Using npm:
$ npm install @hellomoon/api
Using yarn:
$ yarn add @hellomoon/api
const { RestClient } = require("@hellomoon/api");
const client = new RestClient(process.env.API_KEY);
client.send(new ListStreamsRequest()).then(subscriptions => {
// Do something with your subscriptions
}).catch(console.error);
const { RestClient, TokenSwapStream, dataStreamFilters } = require("@hellomoon/api");
const stream = new TokenSwapStream({
target: {
targetType: "WEBSOCKET",
},
filters: {
programId: dataStreamFilters.text.equals("whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc")
},
name: "SDK Test"
});
const client = new RestClient(process.env.API_KEY);
client.send(new CreateStreamsRequest(stream)).then(subscription => {
// Do something with your subscription
}).catch(console.error);
const { RestClient, TokenSwapStream, dataStreamFilters } = require("@hellomoon/api");
const stream = new TokenSwapStream({
id: "YOUR_SUBSCRIPTION_ID",
target: {
targetType: "WEBSOCKET",
},
filters: {
programId: dataStreamFilters.text.equals("whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc")
},
name: "SDK Test"
});
const client = new RestClient(process.env.API_KEY);
client.send(new UpdateStreamsRequest(stream)).then(subscription => {
// Do something with your subscription
}).catch(console.error);
const { RestClient } = require("@hellomoon/api");
const client = new RestClient(process.env.API_KEY);
client.send(new DeleteStreamsRequest("YOUR_SUBSCRIPTION_ID")).then(() => {
}).catch(console.error);
Balance changes for all accounts at a transaction level. Each transaction will have 0 or more balance changes.
Balance changes for Liquidity Pool (LP) at a transaction level.
Creation of new Liquidity Pools (LPs)
Liquidity has been deposited or withdrawn from the Liquidity Pool (LP).
Listing stats for the NFT collection. This is at the collection level. Each collection is emitted at most once per block. If a block contains multiple instruction that modify the stats for a collection, this describes the last instruction.
Actions taken on secondary NFT markets, e.g. MagicEden. These are generally emitted in the order as they happen on-chain, but new collections may be delayed.
NFT tokens that are minted or sold from the collection to the first owner during the mint phase. These are not emitted in the order as they happen on-chain. To receive the events as they happen on-chain, use NftPrimarySaleWithoutCollection.
NFT tokens that are minted or sold from the collection to the first owner during the mint phase. These are emitted in the order as they happen on-chain. To receive the events with the collection name, use NftPrimarySaleWithCollection.
Events related to the Sharky protocol
This stream emits events everytime Hello Moon determines a liquidity pool has changed the valuation of a tokens
This stream emits events anytime a token is swapped on a DEX that Hello Moon monitors.
Balance changes for all accounts at a transaction level. Each transaction will have 0 or more balance changes.
const { StreamClient, isStreamError } = require("@hellomoon/api");
/**
* The format of the data you expect to receive back from your stream.
* We don't know what a stream will return ahead of time, it is optional to define for typing support
*/
type MyDataType {
mint: string;
}
const client = new StreamClient(process.env.API_KEY);
client.connect(data => {
// A fallback message catcher. This shouldn't fire, but can be used for system messages come through
console.log(data);
}).then(disconnect => {
const unsubscribe = client.subscribe("YOUR_SUBSCRIPTION_ID", data => {
// An array of streamed events
console.log(data);
});
// Disconnect after 60 seconds
setTimeout(disconnect, 60000);
}, err => {
// Handle error
console.log(err);
}).catch(console.error);
const { StreamClient, TokenPriceRequest } = require("@hellomoon/api");
const client = new StreamClient(process.env.API_KEY);
client.connect(data => {
// A fallback message catcher. This shouldn't fire, but can be used for system messages come through
console.log(data);
}).then(disconnect => {
client.send(new TokenPriceRequest({
}).then(responseData => {
// The response object
console.log(responseData);
// Disconnect when we are done
disconnect();
}, err => {
// Handle error
}));
}).catch(console.error);
const { StreamClient, isStreamError } = require("@hellomoon/api");
/**
* The format of the data you expect to receive back from your stream.
* We don't know what a stream will return ahead of time, it is optional to define for typing support
*/
type MyDataType {
mint: string;
}
const client = new StreamClient(process.env.API_KEY);
client.connect(data => {
// A fallback message catcher. This shouldn't fire, but can be used for system messages come through
console.log(data);
}).then(disconnect => {
const unsubscribe = client.subscribe<MyDataType>("YOUR_SUBSCRIPTION_ID", data => {
client.send(new TokenPriceRequest({
mint: data[0].mint
}).then(price => {
// The response object
console.log(data);
// Disconnect when we are done
}, err => {
// Handle error
}));
});
// Disconnect after 10 seconds
setTimeout(disconnect, 10000);
}).catch(console.error);
const { RestClient, NftListingStatusRequest } = require("@hellomoon/api");
const client = new RestClient(process.env.API_KEY);
client
.send(new NftListingStatusRequest())
.then(console.log)
.catch(console.error);
- AllTimeTxnsByUserRequest
- BlockRewardsRequest
- CitrusLoanEventsRequest
- CitrusLoanSummaryRequest
- CollaterizedLoanSummaryRequest
- CollectionAllTimeRequest
- CollectionFloorpriceRequest
- CollectionListingCandlesticksRequest
- CollectionListingStatsRequest
- CollectionMintsRequest
- CollectionNameRequest
- CollectionProgramUsageRequest
- CollectionStatsRequest
- CollectionVolatilityRequest
- CumulativeTokenVolumeRequest
- CurrentLpEmissionsRequest
- DailyNftAvgMedianSalesRequest
- DefiLendingRequest
- DefiLiquidityPoolsBalancesRequest
- DefiLiquidityPoolsMetadataRequest
- DefiLiquidityPoolsRequest
- DefiProgramLeaderboardV2Request
- DefiProgramNetNewUsersDailyRequest
- DefiProgramOverlapRequest
- DefiSwapProgramsRequest
- DefiTokenLeaderboardV3Request
- DefiTokenNetNewPurchasesRequest
- DefiTokenUsersDailyRequest
- FilterSetRequest
- FraktLoanEventsRequest
- FraktLoanSummaryRequest
- JupiterCurrentStatsRequest
- JupiterHistoricalTradingStatsRequest
- JupiterPairsBrokenDownWeeklyRequest
- JupiterSwapStatsRequest
- LeaderboardStatsRequest
- NftCollectionOwnersCurrentV1Request
- NftDistinctOwnersInTimeDailyV1Request
- NftHoldingPeriodV1Request
- NftListingStatusRequest
- NftListingsRequest
- NftMarketStatsRequest
- NftMintInformationRequest
- NftMintPriceByCreatorAvgRequest
- NftMintsByOwnerRequest
- NftOverlappingOwnersV1Request
- NftOwnersCumulativeV1Request
- NftPrimarySaleCollectionStatsRequest
- NftSocialRequest
- NftTopHoldersRequest
- OverlapTopRequest
- SalesPerMarketDailyRequest
- SalesPrimaryRequest
- SalesSecondaryRequest
- SharkyApyRequest
- SharkyDefaultStatsRequest
- SharkyHistoricalDefaultsRequest
- SharkyLoanEventsRequest
- SharkyLoanSummaryRequest
- SolanaArtemisProgramStatsRequest
- SolanaTxnsByUserRequest
- SplTokenListRequest
- Stakeaccountsv2Request
- Stakeactionsv2Request
- Staketransfersv2Request
- StreamCreateRequest
- StreamUpdateRequest
- TokenBalancesByOwnerRequest
- TokenPriceCandlesticksRequest
- TokenPriceRequest
- TokenSwapsRequest
- TokenTransfersWithOwnerRequest
- Tokencreationv2Request
- Tokensupplyv2Request
- TopTokenSellBuyJupRequest
- TopTokensPerProgram24hrRequest
- WashtradingCollectionIndexV7Request