@chainstream-io/sdk 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WatchlistApi-iO0m0ez9.d.cts +7581 -0
- package/dist/WatchlistApi-iO0m0ez9.d.ts +7581 -0
- package/dist/index-BkJK0-d_.d.ts +457 -0
- package/dist/index-DNVVUaIe.d.cts +457 -0
- package/dist/index.cjs +6429 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -40
- package/dist/index.mjs +6403 -0
- package/dist/index.mjs.map +1 -0
- package/dist/openapi/index.cjs +9874 -0
- package/dist/openapi/index.cjs.map +1 -0
- package/dist/openapi/index.d.cts +1340 -0
- package/dist/openapi/index.d.ts +1340 -3
- package/dist/openapi/index.mjs +9318 -0
- package/dist/openapi/index.mjs.map +1 -0
- package/dist/stream/index.cjs +1403 -0
- package/dist/stream/index.cjs.map +1 -0
- package/dist/stream/{stream.fields.d.ts → index.d.cts} +12 -7
- package/dist/stream/index.d.ts +45 -3
- package/dist/stream/index.mjs +1369 -0
- package/dist/stream/index.mjs.map +1 -0
- package/package.json +15 -13
- package/dist/esm/index.d.ts +0 -40
- package/dist/esm/index.js +0 -125
- package/dist/esm/openapi/apis/BlockchainApi.d.ts +0 -57
- package/dist/esm/openapi/apis/BlockchainApi.js +0 -101
- package/dist/esm/openapi/apis/DefiSolanaMoonshotApi.d.ts +0 -44
- package/dist/esm/openapi/apis/DefiSolanaMoonshotApi.js +0 -92
- package/dist/esm/openapi/apis/DefiSolanaPumpfunApi.d.ts +0 -31
- package/dist/esm/openapi/apis/DefiSolanaPumpfunApi.js +0 -56
- package/dist/esm/openapi/apis/DexApi.d.ts +0 -166
- package/dist/esm/openapi/apis/DexApi.js +0 -318
- package/dist/esm/openapi/apis/DexPoolApi.d.ts +0 -48
- package/dist/esm/openapi/apis/DexPoolApi.js +0 -74
- package/dist/esm/openapi/apis/EndpointApi.d.ts +0 -119
- package/dist/esm/openapi/apis/EndpointApi.js +0 -279
- package/dist/esm/openapi/apis/IpfsApi.d.ts +0 -27
- package/dist/esm/openapi/apis/IpfsApi.js +0 -55
- package/dist/esm/openapi/apis/JobsApi.d.ts +0 -44
- package/dist/esm/openapi/apis/JobsApi.js +0 -90
- package/dist/esm/openapi/apis/RankingApi.d.ts +0 -565
- package/dist/esm/openapi/apis/RankingApi.js +0 -739
- package/dist/esm/openapi/apis/RedPacketApi.d.ts +0 -202
- package/dist/esm/openapi/apis/RedPacketApi.js +0 -413
- package/dist/esm/openapi/apis/TokenApi.d.ts +0 -966
- package/dist/esm/openapi/apis/TokenApi.js +0 -1748
- package/dist/esm/openapi/apis/TradeApi.d.ts +0 -278
- package/dist/esm/openapi/apis/TradeApi.js +0 -425
- package/dist/esm/openapi/apis/TransactionApi.d.ts +0 -32
- package/dist/esm/openapi/apis/TransactionApi.js +0 -60
- package/dist/esm/openapi/apis/WalletApi.d.ts +0 -141
- package/dist/esm/openapi/apis/WalletApi.js +0 -247
- package/dist/esm/openapi/apis/WatchlistApi.d.ts +0 -48
- package/dist/esm/openapi/apis/WatchlistApi.js +0 -74
- package/dist/esm/openapi/apis/index.d.ts +0 -15
- package/dist/esm/openapi/apis/index.js +0 -17
- package/dist/esm/openapi/index.d.ts +0 -3
- package/dist/esm/openapi/index.js +0 -5
- package/dist/esm/openapi/models/BlockchainDTO.d.ts +0 -50
- package/dist/esm/openapi/models/BlockchainDTO.js +0 -55
- package/dist/esm/openapi/models/BlockchainLatestBlockDTO.d.ts +0 -38
- package/dist/esm/openapi/models/BlockchainLatestBlockDTO.js +0 -47
- package/dist/esm/openapi/models/BooleanResultDTO.d.ts +0 -32
- package/dist/esm/openapi/models/BooleanResultDTO.js +0 -43
- package/dist/esm/openapi/models/CalculatePnlInput.d.ts +0 -32
- package/dist/esm/openapi/models/CalculatePnlInput.js +0 -41
- package/dist/esm/openapi/models/Candle.d.ts +0 -69
- package/dist/esm/openapi/models/Candle.js +0 -68
- package/dist/esm/openapi/models/ClaimRedPacketInput.d.ts +0 -50
- package/dist/esm/openapi/models/ClaimRedPacketInput.js +0 -49
- package/dist/esm/openapi/models/CreateEndpointInput.d.ts +0 -74
- package/dist/esm/openapi/models/CreateEndpointInput.js +0 -55
- package/dist/esm/openapi/models/CreateRedPacketInput.d.ts +0 -74
- package/dist/esm/openapi/models/CreateRedPacketInput.js +0 -61
- package/dist/esm/openapi/models/CreateRedPacketReply.d.ts +0 -38
- package/dist/esm/openapi/models/CreateRedPacketReply.js +0 -47
- package/dist/esm/openapi/models/CreateTokenInput.d.ts +0 -85
- package/dist/esm/openapi/models/CreateTokenInput.js +0 -73
- package/dist/esm/openapi/models/CreateTokenReply.d.ts +0 -38
- package/dist/esm/openapi/models/CreateTokenReply.js +0 -47
- package/dist/esm/openapi/models/DexDTO.d.ts +0 -50
- package/dist/esm/openapi/models/DexDTO.js +0 -49
- package/dist/esm/openapi/models/DexPage.d.ts +0 -63
- package/dist/esm/openapi/models/DexPage.js +0 -54
- package/dist/esm/openapi/models/DexPoolDTO.d.ts +0 -86
- package/dist/esm/openapi/models/DexPoolDTO.js +0 -67
- package/dist/esm/openapi/models/EndpointListResponse.d.ts +0 -51
- package/dist/esm/openapi/models/EndpointListResponse.js +0 -48
- package/dist/esm/openapi/models/EndpointOperationResponse.d.ts +0 -32
- package/dist/esm/openapi/models/EndpointOperationResponse.js +0 -41
- package/dist/esm/openapi/models/EndpointResponse.d.ts +0 -92
- package/dist/esm/openapi/models/EndpointResponse.js +0 -61
- package/dist/esm/openapi/models/EndpointSecretResponse.d.ts +0 -32
- package/dist/esm/openapi/models/EndpointSecretResponse.js +0 -41
- package/dist/esm/openapi/models/FilterCondition.d.ts +0 -95
- package/dist/esm/openapi/models/FilterCondition.js +0 -95
- package/dist/esm/openapi/models/GainersAndLosersDTO.d.ts +0 -50
- package/dist/esm/openapi/models/GainersAndLosersDTO.js +0 -55
- package/dist/esm/openapi/models/GainersAndLosersPage.d.ts +0 -63
- package/dist/esm/openapi/models/GainersAndLosersPage.js +0 -54
- package/dist/esm/openapi/models/JobDTO.d.ts +0 -38
- package/dist/esm/openapi/models/JobDTO.js +0 -47
- package/dist/esm/openapi/models/JobStreamingDTO.d.ts +0 -38
- package/dist/esm/openapi/models/JobStreamingDTO.js +0 -47
- package/dist/esm/openapi/models/Link.d.ts +0 -48
- package/dist/esm/openapi/models/Link.js +0 -56
- package/dist/esm/openapi/models/MoonshotCreateTokenInput.d.ts +0 -109
- package/dist/esm/openapi/models/MoonshotCreateTokenInput.js +0 -94
- package/dist/esm/openapi/models/MoonshotCreateTokenReply.d.ts +0 -38
- package/dist/esm/openapi/models/MoonshotCreateTokenReply.js +0 -47
- package/dist/esm/openapi/models/MoonshotSubmitCreateToken200Response.d.ts +0 -38
- package/dist/esm/openapi/models/MoonshotSubmitCreateToken200Response.js +0 -43
- package/dist/esm/openapi/models/MoonshotSubmitCreateTokenInput.d.ts +0 -38
- package/dist/esm/openapi/models/MoonshotSubmitCreateTokenInput.js +0 -45
- package/dist/esm/openapi/models/PumpCreateTokenInput.d.ts +0 -113
- package/dist/esm/openapi/models/PumpCreateTokenInput.js +0 -92
- package/dist/esm/openapi/models/PumpCreateTokenReply.d.ts +0 -38
- package/dist/esm/openapi/models/PumpCreateTokenReply.js +0 -45
- package/dist/esm/openapi/models/QuoteResponse.d.ts +0 -62
- package/dist/esm/openapi/models/QuoteResponse.js +0 -51
- package/dist/esm/openapi/models/RedPacketClaimDTO.d.ts +0 -90
- package/dist/esm/openapi/models/RedPacketClaimDTO.js +0 -86
- package/dist/esm/openapi/models/RedPacketClaimsPage.d.ts +0 -57
- package/dist/esm/openapi/models/RedPacketClaimsPage.js +0 -60
- package/dist/esm/openapi/models/RedPacketDTO.d.ts +0 -144
- package/dist/esm/openapi/models/RedPacketDTO.js +0 -122
- package/dist/esm/openapi/models/RedPacketReply.d.ts +0 -32
- package/dist/esm/openapi/models/RedPacketReply.js +0 -43
- package/dist/esm/openapi/models/RedPacketSendTxInput.d.ts +0 -32
- package/dist/esm/openapi/models/RedPacketSendTxInput.js +0 -43
- package/dist/esm/openapi/models/RedPacketSendTxResponse.d.ts +0 -32
- package/dist/esm/openapi/models/RedPacketSendTxResponse.js +0 -43
- package/dist/esm/openapi/models/RedPacketsPage.d.ts +0 -57
- package/dist/esm/openapi/models/RedPacketsPage.js +0 -60
- package/dist/esm/openapi/models/Resolution.d.ts +0 -33
- package/dist/esm/openapi/models/Resolution.js +0 -51
- package/dist/esm/openapi/models/SendTxInput.d.ts +0 -52
- package/dist/esm/openapi/models/SendTxInput.js +0 -54
- package/dist/esm/openapi/models/SendTxResponse.d.ts +0 -44
- package/dist/esm/openapi/models/SendTxResponse.js +0 -51
- package/dist/esm/openapi/models/SwapInput.d.ts +0 -99
- package/dist/esm/openapi/models/SwapInput.js +0 -84
- package/dist/esm/openapi/models/SwapReply.d.ts +0 -38
- package/dist/esm/openapi/models/SwapReply.js +0 -47
- package/dist/esm/openapi/models/SwapRouteInput.d.ts +0 -120
- package/dist/esm/openapi/models/SwapRouteInput.js +0 -89
- package/dist/esm/openapi/models/SwapRouteResponse.d.ts +0 -51
- package/dist/esm/openapi/models/SwapRouteResponse.js +0 -56
- package/dist/esm/openapi/models/Token.d.ts +0 -140
- package/dist/esm/openapi/models/Token.js +0 -95
- package/dist/esm/openapi/models/TokenCreationDTO.d.ts +0 -77
- package/dist/esm/openapi/models/TokenCreationDTO.js +0 -73
- package/dist/esm/openapi/models/TokenCreationPage.d.ts +0 -63
- package/dist/esm/openapi/models/TokenCreationPage.js +0 -54
- package/dist/esm/openapi/models/TokenCreatorsDTO.d.ts +0 -44
- package/dist/esm/openapi/models/TokenCreatorsDTO.js +0 -45
- package/dist/esm/openapi/models/TokenExtraDTO.d.ts +0 -152
- package/dist/esm/openapi/models/TokenExtraDTO.js +0 -81
- package/dist/esm/openapi/models/TokenHolder.d.ts +0 -50
- package/dist/esm/openapi/models/TokenHolder.js +0 -55
- package/dist/esm/openapi/models/TokenHolderPage.d.ts +0 -63
- package/dist/esm/openapi/models/TokenHolderPage.js +0 -54
- package/dist/esm/openapi/models/TokenListPage.d.ts +0 -63
- package/dist/esm/openapi/models/TokenListPage.js +0 -54
- package/dist/esm/openapi/models/TokenMarketData.d.ts +0 -122
- package/dist/esm/openapi/models/TokenMarketData.js +0 -81
- package/dist/esm/openapi/models/TokenMetadata.d.ts +0 -107
- package/dist/esm/openapi/models/TokenMetadata.js +0 -78
- package/dist/esm/openapi/models/TokenPage.d.ts +0 -69
- package/dist/esm/openapi/models/TokenPage.js +0 -56
- package/dist/esm/openapi/models/TokenPriceDTO.d.ts +0 -50
- package/dist/esm/openapi/models/TokenPriceDTO.js +0 -55
- package/dist/esm/openapi/models/TokenPricePage.d.ts +0 -63
- package/dist/esm/openapi/models/TokenPricePage.js +0 -54
- package/dist/esm/openapi/models/TokenSocialMediasDTO.d.ts +0 -104
- package/dist/esm/openapi/models/TokenSocialMediasDTO.js +0 -65
- package/dist/esm/openapi/models/TokenStat.d.ts +0 -788
- package/dist/esm/openapi/models/TokenStat.js +0 -451
- package/dist/esm/openapi/models/TopTradersDTO.d.ts +0 -98
- package/dist/esm/openapi/models/TopTradersDTO.js +0 -85
- package/dist/esm/openapi/models/TopTradersPage.d.ts +0 -63
- package/dist/esm/openapi/models/TopTradersPage.js +0 -54
- package/dist/esm/openapi/models/TradeDetailDTO.d.ts +0 -176
- package/dist/esm/openapi/models/TradeDetailDTO.js +0 -139
- package/dist/esm/openapi/models/TradeEvent.d.ts +0 -105
- package/dist/esm/openapi/models/TradeEvent.js +0 -92
- package/dist/esm/openapi/models/TradePage.d.ts +0 -63
- package/dist/esm/openapi/models/TradePage.js +0 -54
- package/dist/esm/openapi/models/TradeType.d.ts +0 -25
- package/dist/esm/openapi/models/TradeType.js +0 -43
- package/dist/esm/openapi/models/UpdateEndpointInput.d.ts +0 -80
- package/dist/esm/openapi/models/UpdateEndpointInput.js +0 -57
- package/dist/esm/openapi/models/WalletBalanceDetailDTO.d.ts +0 -176
- package/dist/esm/openapi/models/WalletBalanceDetailDTO.js +0 -139
- package/dist/esm/openapi/models/WalletBalancesDTO.d.ts +0 -45
- package/dist/esm/openapi/models/WalletBalancesDTO.js +0 -52
- package/dist/esm/openapi/models/WalletPnlDTO.d.ts +0 -164
- package/dist/esm/openapi/models/WalletPnlDTO.js +0 -131
- package/dist/esm/openapi/models/index.d.ts +0 -70
- package/dist/esm/openapi/models/index.js +0 -72
- package/dist/esm/openapi/runtime.d.ts +0 -184
- package/dist/esm/openapi/runtime.js +0 -333
- package/dist/esm/stream/index.d.ts +0 -3
- package/dist/esm/stream/index.js +0 -3
- package/dist/esm/stream/stream.d.ts +0 -142
- package/dist/esm/stream/stream.fields.d.ts +0 -40
- package/dist/esm/stream/stream.fields.js +0 -242
- package/dist/esm/stream/stream.js +0 -988
- package/dist/esm/stream/stream.model.d.ts +0 -275
- package/dist/esm/stream/stream.model.js +0 -37
- package/dist/index.js +0 -125
- package/dist/openapi/apis/BlockchainApi.d.ts +0 -57
- package/dist/openapi/apis/BlockchainApi.js +0 -101
- package/dist/openapi/apis/DefiSolanaMoonshotApi.d.ts +0 -44
- package/dist/openapi/apis/DefiSolanaMoonshotApi.js +0 -92
- package/dist/openapi/apis/DefiSolanaPumpfunApi.d.ts +0 -31
- package/dist/openapi/apis/DefiSolanaPumpfunApi.js +0 -56
- package/dist/openapi/apis/DexApi.d.ts +0 -166
- package/dist/openapi/apis/DexApi.js +0 -318
- package/dist/openapi/apis/DexPoolApi.d.ts +0 -48
- package/dist/openapi/apis/DexPoolApi.js +0 -74
- package/dist/openapi/apis/EndpointApi.d.ts +0 -119
- package/dist/openapi/apis/EndpointApi.js +0 -279
- package/dist/openapi/apis/IpfsApi.d.ts +0 -27
- package/dist/openapi/apis/IpfsApi.js +0 -55
- package/dist/openapi/apis/JobsApi.d.ts +0 -44
- package/dist/openapi/apis/JobsApi.js +0 -90
- package/dist/openapi/apis/RankingApi.d.ts +0 -565
- package/dist/openapi/apis/RankingApi.js +0 -739
- package/dist/openapi/apis/RedPacketApi.d.ts +0 -202
- package/dist/openapi/apis/RedPacketApi.js +0 -413
- package/dist/openapi/apis/TokenApi.d.ts +0 -966
- package/dist/openapi/apis/TokenApi.js +0 -1748
- package/dist/openapi/apis/TradeApi.d.ts +0 -278
- package/dist/openapi/apis/TradeApi.js +0 -425
- package/dist/openapi/apis/TransactionApi.d.ts +0 -32
- package/dist/openapi/apis/TransactionApi.js +0 -60
- package/dist/openapi/apis/WalletApi.d.ts +0 -141
- package/dist/openapi/apis/WalletApi.js +0 -247
- package/dist/openapi/apis/WatchlistApi.d.ts +0 -48
- package/dist/openapi/apis/WatchlistApi.js +0 -74
- package/dist/openapi/apis/index.d.ts +0 -15
- package/dist/openapi/apis/index.js +0 -17
- package/dist/openapi/index.js +0 -5
- package/dist/openapi/models/BlockchainDTO.d.ts +0 -50
- package/dist/openapi/models/BlockchainDTO.js +0 -55
- package/dist/openapi/models/BlockchainLatestBlockDTO.d.ts +0 -38
- package/dist/openapi/models/BlockchainLatestBlockDTO.js +0 -47
- package/dist/openapi/models/BooleanResultDTO.d.ts +0 -32
- package/dist/openapi/models/BooleanResultDTO.js +0 -43
- package/dist/openapi/models/CalculatePnlInput.d.ts +0 -32
- package/dist/openapi/models/CalculatePnlInput.js +0 -41
- package/dist/openapi/models/Candle.d.ts +0 -69
- package/dist/openapi/models/Candle.js +0 -68
- package/dist/openapi/models/ClaimRedPacketInput.d.ts +0 -50
- package/dist/openapi/models/ClaimRedPacketInput.js +0 -49
- package/dist/openapi/models/CreateEndpointInput.d.ts +0 -74
- package/dist/openapi/models/CreateEndpointInput.js +0 -55
- package/dist/openapi/models/CreateRedPacketInput.d.ts +0 -74
- package/dist/openapi/models/CreateRedPacketInput.js +0 -61
- package/dist/openapi/models/CreateRedPacketReply.d.ts +0 -38
- package/dist/openapi/models/CreateRedPacketReply.js +0 -47
- package/dist/openapi/models/CreateTokenInput.d.ts +0 -85
- package/dist/openapi/models/CreateTokenInput.js +0 -73
- package/dist/openapi/models/CreateTokenReply.d.ts +0 -38
- package/dist/openapi/models/CreateTokenReply.js +0 -47
- package/dist/openapi/models/DexDTO.d.ts +0 -50
- package/dist/openapi/models/DexDTO.js +0 -49
- package/dist/openapi/models/DexPage.d.ts +0 -63
- package/dist/openapi/models/DexPage.js +0 -54
- package/dist/openapi/models/DexPoolDTO.d.ts +0 -86
- package/dist/openapi/models/DexPoolDTO.js +0 -67
- package/dist/openapi/models/EndpointListResponse.d.ts +0 -51
- package/dist/openapi/models/EndpointListResponse.js +0 -48
- package/dist/openapi/models/EndpointOperationResponse.d.ts +0 -32
- package/dist/openapi/models/EndpointOperationResponse.js +0 -41
- package/dist/openapi/models/EndpointResponse.d.ts +0 -92
- package/dist/openapi/models/EndpointResponse.js +0 -61
- package/dist/openapi/models/EndpointSecretResponse.d.ts +0 -32
- package/dist/openapi/models/EndpointSecretResponse.js +0 -41
- package/dist/openapi/models/FilterCondition.d.ts +0 -95
- package/dist/openapi/models/FilterCondition.js +0 -95
- package/dist/openapi/models/GainersAndLosersDTO.d.ts +0 -50
- package/dist/openapi/models/GainersAndLosersDTO.js +0 -55
- package/dist/openapi/models/GainersAndLosersPage.d.ts +0 -63
- package/dist/openapi/models/GainersAndLosersPage.js +0 -54
- package/dist/openapi/models/JobDTO.d.ts +0 -38
- package/dist/openapi/models/JobDTO.js +0 -47
- package/dist/openapi/models/JobStreamingDTO.d.ts +0 -38
- package/dist/openapi/models/JobStreamingDTO.js +0 -47
- package/dist/openapi/models/Link.d.ts +0 -48
- package/dist/openapi/models/Link.js +0 -56
- package/dist/openapi/models/MoonshotCreateTokenInput.d.ts +0 -109
- package/dist/openapi/models/MoonshotCreateTokenInput.js +0 -94
- package/dist/openapi/models/MoonshotCreateTokenReply.d.ts +0 -38
- package/dist/openapi/models/MoonshotCreateTokenReply.js +0 -47
- package/dist/openapi/models/MoonshotSubmitCreateToken200Response.d.ts +0 -38
- package/dist/openapi/models/MoonshotSubmitCreateToken200Response.js +0 -43
- package/dist/openapi/models/MoonshotSubmitCreateTokenInput.d.ts +0 -38
- package/dist/openapi/models/MoonshotSubmitCreateTokenInput.js +0 -45
- package/dist/openapi/models/PumpCreateTokenInput.d.ts +0 -113
- package/dist/openapi/models/PumpCreateTokenInput.js +0 -92
- package/dist/openapi/models/PumpCreateTokenReply.d.ts +0 -38
- package/dist/openapi/models/PumpCreateTokenReply.js +0 -45
- package/dist/openapi/models/QuoteResponse.d.ts +0 -62
- package/dist/openapi/models/QuoteResponse.js +0 -51
- package/dist/openapi/models/RedPacketClaimDTO.d.ts +0 -90
- package/dist/openapi/models/RedPacketClaimDTO.js +0 -86
- package/dist/openapi/models/RedPacketClaimsPage.d.ts +0 -57
- package/dist/openapi/models/RedPacketClaimsPage.js +0 -60
- package/dist/openapi/models/RedPacketDTO.d.ts +0 -144
- package/dist/openapi/models/RedPacketDTO.js +0 -122
- package/dist/openapi/models/RedPacketReply.d.ts +0 -32
- package/dist/openapi/models/RedPacketReply.js +0 -43
- package/dist/openapi/models/RedPacketSendTxInput.d.ts +0 -32
- package/dist/openapi/models/RedPacketSendTxInput.js +0 -43
- package/dist/openapi/models/RedPacketSendTxResponse.d.ts +0 -32
- package/dist/openapi/models/RedPacketSendTxResponse.js +0 -43
- package/dist/openapi/models/RedPacketsPage.d.ts +0 -57
- package/dist/openapi/models/RedPacketsPage.js +0 -60
- package/dist/openapi/models/Resolution.d.ts +0 -33
- package/dist/openapi/models/Resolution.js +0 -51
- package/dist/openapi/models/SendTxInput.d.ts +0 -52
- package/dist/openapi/models/SendTxInput.js +0 -54
- package/dist/openapi/models/SendTxResponse.d.ts +0 -44
- package/dist/openapi/models/SendTxResponse.js +0 -51
- package/dist/openapi/models/SwapInput.d.ts +0 -99
- package/dist/openapi/models/SwapInput.js +0 -84
- package/dist/openapi/models/SwapReply.d.ts +0 -38
- package/dist/openapi/models/SwapReply.js +0 -47
- package/dist/openapi/models/SwapRouteInput.d.ts +0 -120
- package/dist/openapi/models/SwapRouteInput.js +0 -89
- package/dist/openapi/models/SwapRouteResponse.d.ts +0 -51
- package/dist/openapi/models/SwapRouteResponse.js +0 -56
- package/dist/openapi/models/Token.d.ts +0 -140
- package/dist/openapi/models/Token.js +0 -95
- package/dist/openapi/models/TokenCreationDTO.d.ts +0 -77
- package/dist/openapi/models/TokenCreationDTO.js +0 -73
- package/dist/openapi/models/TokenCreationPage.d.ts +0 -63
- package/dist/openapi/models/TokenCreationPage.js +0 -54
- package/dist/openapi/models/TokenCreatorsDTO.d.ts +0 -44
- package/dist/openapi/models/TokenCreatorsDTO.js +0 -45
- package/dist/openapi/models/TokenExtraDTO.d.ts +0 -152
- package/dist/openapi/models/TokenExtraDTO.js +0 -81
- package/dist/openapi/models/TokenHolder.d.ts +0 -50
- package/dist/openapi/models/TokenHolder.js +0 -55
- package/dist/openapi/models/TokenHolderPage.d.ts +0 -63
- package/dist/openapi/models/TokenHolderPage.js +0 -54
- package/dist/openapi/models/TokenListPage.d.ts +0 -63
- package/dist/openapi/models/TokenListPage.js +0 -54
- package/dist/openapi/models/TokenMarketData.d.ts +0 -122
- package/dist/openapi/models/TokenMarketData.js +0 -81
- package/dist/openapi/models/TokenMetadata.d.ts +0 -107
- package/dist/openapi/models/TokenMetadata.js +0 -78
- package/dist/openapi/models/TokenPage.d.ts +0 -69
- package/dist/openapi/models/TokenPage.js +0 -56
- package/dist/openapi/models/TokenPriceDTO.d.ts +0 -50
- package/dist/openapi/models/TokenPriceDTO.js +0 -55
- package/dist/openapi/models/TokenPricePage.d.ts +0 -63
- package/dist/openapi/models/TokenPricePage.js +0 -54
- package/dist/openapi/models/TokenSocialMediasDTO.d.ts +0 -104
- package/dist/openapi/models/TokenSocialMediasDTO.js +0 -65
- package/dist/openapi/models/TokenStat.d.ts +0 -788
- package/dist/openapi/models/TokenStat.js +0 -451
- package/dist/openapi/models/TopTradersDTO.d.ts +0 -98
- package/dist/openapi/models/TopTradersDTO.js +0 -85
- package/dist/openapi/models/TopTradersPage.d.ts +0 -63
- package/dist/openapi/models/TopTradersPage.js +0 -54
- package/dist/openapi/models/TradeDetailDTO.d.ts +0 -176
- package/dist/openapi/models/TradeDetailDTO.js +0 -139
- package/dist/openapi/models/TradeEvent.d.ts +0 -105
- package/dist/openapi/models/TradeEvent.js +0 -92
- package/dist/openapi/models/TradePage.d.ts +0 -63
- package/dist/openapi/models/TradePage.js +0 -54
- package/dist/openapi/models/TradeType.d.ts +0 -25
- package/dist/openapi/models/TradeType.js +0 -43
- package/dist/openapi/models/UpdateEndpointInput.d.ts +0 -80
- package/dist/openapi/models/UpdateEndpointInput.js +0 -57
- package/dist/openapi/models/WalletBalanceDetailDTO.d.ts +0 -176
- package/dist/openapi/models/WalletBalanceDetailDTO.js +0 -139
- package/dist/openapi/models/WalletBalancesDTO.d.ts +0 -45
- package/dist/openapi/models/WalletBalancesDTO.js +0 -52
- package/dist/openapi/models/WalletPnlDTO.d.ts +0 -164
- package/dist/openapi/models/WalletPnlDTO.js +0 -131
- package/dist/openapi/models/index.d.ts +0 -70
- package/dist/openapi/models/index.js +0 -72
- package/dist/openapi/runtime.d.ts +0 -184
- package/dist/openapi/runtime.js +0 -333
- package/dist/stream/index.js +0 -3
- package/dist/stream/stream.d.ts +0 -142
- package/dist/stream/stream.fields.js +0 -242
- package/dist/stream/stream.js +0 -988
- package/dist/stream/stream.model.d.ts +0 -275
- package/dist/stream/stream.model.js +0 -37
|
@@ -0,0 +1,1369 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
|
|
5
|
+
// src/stream/stream.ts
|
|
6
|
+
import { Centrifuge } from "@chainstream-io/centrifuge";
|
|
7
|
+
|
|
8
|
+
// src/stream/stream.fields.ts
|
|
9
|
+
var CEL_FIELD_MAPPINGS = {
|
|
10
|
+
// Wallet balance subscription fields
|
|
11
|
+
"subscribeWalletBalance": {
|
|
12
|
+
"walletAddress": "a",
|
|
13
|
+
"tokenAddress": "ta",
|
|
14
|
+
"tokenPriceInUsd": "tpiu",
|
|
15
|
+
"balance": "b",
|
|
16
|
+
"timestamp": "t"
|
|
17
|
+
},
|
|
18
|
+
// Token candles subscription fields
|
|
19
|
+
"subscribeTokenCandles": {
|
|
20
|
+
"open": "o",
|
|
21
|
+
"close": "c",
|
|
22
|
+
"high": "h",
|
|
23
|
+
"low": "l",
|
|
24
|
+
"volume": "v",
|
|
25
|
+
"resolution": "r",
|
|
26
|
+
"time": "t",
|
|
27
|
+
"number": "n"
|
|
28
|
+
},
|
|
29
|
+
// Token stats subscription fields
|
|
30
|
+
"subscribeTokenStats": {
|
|
31
|
+
"address": "a",
|
|
32
|
+
"timestamp": "t",
|
|
33
|
+
"buys1m": "b1m",
|
|
34
|
+
"sells1m": "s1m",
|
|
35
|
+
"buyers1m": "be1m",
|
|
36
|
+
"sellers1m": "se1m",
|
|
37
|
+
"buyVolumeInUsd1m": "bviu1m",
|
|
38
|
+
"sellVolumeInUsd1m": "sviu1m",
|
|
39
|
+
"price1m": "p1m",
|
|
40
|
+
"openInUsd1m": "oiu1m",
|
|
41
|
+
"closeInUsd1m": "ciu1m",
|
|
42
|
+
"buys5m": "b5m",
|
|
43
|
+
"sells5m": "s5m",
|
|
44
|
+
"buyers5m": "be5m",
|
|
45
|
+
"sellers5m": "se5m",
|
|
46
|
+
"buyVolumeInUsd5m": "bviu5m",
|
|
47
|
+
"sellVolumeInUsd5m": "sviu5m",
|
|
48
|
+
"price5m": "p5m",
|
|
49
|
+
"openInUsd5m": "oiu5m",
|
|
50
|
+
"closeInUsd5m": "ciu5m",
|
|
51
|
+
"buys15m": "b15m",
|
|
52
|
+
"sells15m": "s15m",
|
|
53
|
+
"buyers15m": "be15m",
|
|
54
|
+
"sellers15m": "se15m",
|
|
55
|
+
"buyVolumeInUsd15m": "bviu15m",
|
|
56
|
+
"sellVolumeInUsd15m": "sviu15m",
|
|
57
|
+
"price15m": "p15m",
|
|
58
|
+
"openInUsd15m": "oiu15m",
|
|
59
|
+
"closeInUsd15m": "ciu15m",
|
|
60
|
+
"buys30m": "b30m",
|
|
61
|
+
"sells30m": "s30m",
|
|
62
|
+
"buyers30m": "be30m",
|
|
63
|
+
"sellers30m": "se30m",
|
|
64
|
+
"buyVolumeInUsd30m": "bviu30m",
|
|
65
|
+
"sellVolumeInUsd30m": "sviu30m",
|
|
66
|
+
"price30m": "p30m",
|
|
67
|
+
"openInUsd30m": "oiu30m",
|
|
68
|
+
"closeInUsd30m": "ciu30m",
|
|
69
|
+
"buys1h": "b1h",
|
|
70
|
+
"sells1h": "s1h",
|
|
71
|
+
"buyers1h": "be1h",
|
|
72
|
+
"sellers1h": "se1h",
|
|
73
|
+
"buyVolumeInUsd1h": "bviu1h",
|
|
74
|
+
"sellVolumeInUsd1h": "sviu1h",
|
|
75
|
+
"price1h": "p1h",
|
|
76
|
+
"openInUsd1h": "oiu1h",
|
|
77
|
+
"closeInUsd1h": "ciu1h",
|
|
78
|
+
"buys4h": "b4h",
|
|
79
|
+
"sells4h": "s4h",
|
|
80
|
+
"buyers4h": "be4h",
|
|
81
|
+
"sellers4h": "se4h",
|
|
82
|
+
"buyVolumeInUsd4h": "bviu4h",
|
|
83
|
+
"sellVolumeInUsd4h": "sviu4h",
|
|
84
|
+
"price4h": "p4h",
|
|
85
|
+
"openInUsd4h": "oiu4h",
|
|
86
|
+
"closeInUsd4h": "ciu4h",
|
|
87
|
+
"buys24h": "b24h",
|
|
88
|
+
"sells24h": "s24h",
|
|
89
|
+
"buyers24h": "be24h",
|
|
90
|
+
"sellers24h": "se24h",
|
|
91
|
+
"buyVolumeInUsd24h": "bviu24h",
|
|
92
|
+
"sellVolumeInUsd24h": "sviu24h",
|
|
93
|
+
"price24h": "p24h",
|
|
94
|
+
"price": "p",
|
|
95
|
+
"openInUsd24h": "oiu24h",
|
|
96
|
+
"closeInUsd24h": "ciu24h"
|
|
97
|
+
},
|
|
98
|
+
// Token holder subscription fields
|
|
99
|
+
"subscribeTokenHolders": {
|
|
100
|
+
"tokenAddress": "a",
|
|
101
|
+
"holders": "h",
|
|
102
|
+
"top100Amount": "t100a",
|
|
103
|
+
"top10Amount": "t10a",
|
|
104
|
+
"top100Holders": "t100h",
|
|
105
|
+
"top10Holders": "t10h",
|
|
106
|
+
"top100Ratio": "t100r",
|
|
107
|
+
"top10Ratio": "t10r",
|
|
108
|
+
"timestamp": "ts"
|
|
109
|
+
},
|
|
110
|
+
// New token subscription fields
|
|
111
|
+
"subscribeNewToken": {
|
|
112
|
+
"tokenAddress": "a",
|
|
113
|
+
"name": "n",
|
|
114
|
+
"symbol": "s",
|
|
115
|
+
"createdAtMs": "cts"
|
|
116
|
+
},
|
|
117
|
+
// Token supply subscription fields
|
|
118
|
+
"subscribeTokenSupply": {
|
|
119
|
+
"tokenAddress": "a",
|
|
120
|
+
"supply": "s",
|
|
121
|
+
"timestamp": "ts"
|
|
122
|
+
},
|
|
123
|
+
// Dex pool balance subscription fields
|
|
124
|
+
"subscribeDexPoolBalance": {
|
|
125
|
+
"poolAddress": "a",
|
|
126
|
+
"tokenAAddress": "taa",
|
|
127
|
+
"tokenALiquidityInUsd": "taliu",
|
|
128
|
+
"tokenBAddress": "tba",
|
|
129
|
+
"tokenBLiquidityInUsd": "tbliu"
|
|
130
|
+
},
|
|
131
|
+
// Token liquidity subscription fields
|
|
132
|
+
"subscribeTokenLiquidity": {
|
|
133
|
+
"tokenAddress": "a",
|
|
134
|
+
"metricType": "t",
|
|
135
|
+
"value": "v",
|
|
136
|
+
"timestamp": "ts"
|
|
137
|
+
},
|
|
138
|
+
// New token metadata subscription fields
|
|
139
|
+
"subscribeNewTokensMetadata": {
|
|
140
|
+
"tokenAddress": "a",
|
|
141
|
+
"name": "n",
|
|
142
|
+
"symbol": "s",
|
|
143
|
+
"imageUrl": "iu",
|
|
144
|
+
"description": "de",
|
|
145
|
+
"socialMedia": "sm",
|
|
146
|
+
"createdAtMs": "cts"
|
|
147
|
+
},
|
|
148
|
+
// Token trades subscription fields
|
|
149
|
+
"subscribeTokenTrades": {
|
|
150
|
+
"tokenAddress": "a",
|
|
151
|
+
"timestamp": "t",
|
|
152
|
+
"kind": "k",
|
|
153
|
+
"buyAmount": "ba",
|
|
154
|
+
"buyAmountInUsd": "baiu",
|
|
155
|
+
"buyTokenAddress": "btma",
|
|
156
|
+
"buyTokenName": "btn",
|
|
157
|
+
"buyTokenSymbol": "bts",
|
|
158
|
+
"buyWalletAddress": "bwa",
|
|
159
|
+
"sellAmount": "sa",
|
|
160
|
+
"sellAmountInUsd": "saiu",
|
|
161
|
+
"sellTokenAddress": "stma",
|
|
162
|
+
"sellTokenName": "stn",
|
|
163
|
+
"sellTokenSymbol": "sts",
|
|
164
|
+
"sellWalletAddress": "swa",
|
|
165
|
+
"txHash": "h"
|
|
166
|
+
},
|
|
167
|
+
// Wallet token PnL subscription fields
|
|
168
|
+
"subscribeWalletPnl": {
|
|
169
|
+
"walletAddress": "a",
|
|
170
|
+
"tokenAddress": "ta",
|
|
171
|
+
"tokenPriceInUsd": "tpiu",
|
|
172
|
+
"timestamp": "t",
|
|
173
|
+
"opentime": "ot",
|
|
174
|
+
"lasttime": "lt",
|
|
175
|
+
"closetime": "ct",
|
|
176
|
+
"buyAmount": "ba",
|
|
177
|
+
"buyAmountInUsd": "baiu",
|
|
178
|
+
"buyCount": "bs",
|
|
179
|
+
"buyCount30d": "bs30d",
|
|
180
|
+
"buyCount7d": "bs7d",
|
|
181
|
+
"sellAmount": "sa",
|
|
182
|
+
"sellAmountInUsd": "saiu",
|
|
183
|
+
"sellCount": "ss",
|
|
184
|
+
"sellCount30d": "ss30d",
|
|
185
|
+
"sellCount7d": "ss7d",
|
|
186
|
+
"heldDurationTimestamp": "hdts",
|
|
187
|
+
"averageBuyPriceInUsd": "abpiu",
|
|
188
|
+
"averageSellPriceInUsd": "aspiu",
|
|
189
|
+
"unrealizedProfitInUsd": "upiu",
|
|
190
|
+
"unrealizedProfitRatio": "upr",
|
|
191
|
+
"realizedProfitInUsd": "rpiu",
|
|
192
|
+
"realizedProfitRatio": "rpr",
|
|
193
|
+
"totalRealizedProfitInUsd": "trpiu",
|
|
194
|
+
"totalRealizedProfitRatio": "trr"
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
function getFieldMappings(methodName) {
|
|
198
|
+
return CEL_FIELD_MAPPINGS[methodName] || {};
|
|
199
|
+
}
|
|
200
|
+
function replaceFilterFields(filter, methodName) {
|
|
201
|
+
if (!filter) {
|
|
202
|
+
return filter;
|
|
203
|
+
}
|
|
204
|
+
const fieldMappings = getFieldMappings(methodName);
|
|
205
|
+
let result = filter;
|
|
206
|
+
for (const [longField, shortField] of Object.entries(fieldMappings)) {
|
|
207
|
+
const patterns = [
|
|
208
|
+
// Pattern 1: fieldName (without meta. prefix)
|
|
209
|
+
new RegExp(`\\b${longField}\\b`, "g"),
|
|
210
|
+
// Pattern 2: meta.fieldName (with meta. prefix)
|
|
211
|
+
new RegExp(`\\bmeta\\.${longField}\\b`, "g")
|
|
212
|
+
];
|
|
213
|
+
patterns.forEach((pattern) => {
|
|
214
|
+
result = result.replace(pattern, `meta.${shortField}`);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
return result;
|
|
218
|
+
}
|
|
219
|
+
function getAvailableFields(methodName) {
|
|
220
|
+
const mappings = getFieldMappings(methodName);
|
|
221
|
+
return Object.keys(mappings);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// src/stream/stream.ts
|
|
225
|
+
var StreamApi = class {
|
|
226
|
+
constructor(context) {
|
|
227
|
+
__publicField(this, "realtimeClient");
|
|
228
|
+
__publicField(this, "listenersMap");
|
|
229
|
+
const realtimeEndpoint = context.streamUrl;
|
|
230
|
+
this.realtimeClient = new Centrifuge(realtimeEndpoint, {
|
|
231
|
+
getToken: async (_ctx) => {
|
|
232
|
+
return typeof context.accessToken === "string" ? context.accessToken : await context.accessToken.getToken();
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
this.realtimeClient.on("connected", () => {
|
|
236
|
+
console.log("[streaming] connected");
|
|
237
|
+
}).on("disconnected", (err) => {
|
|
238
|
+
console.warn("[streaming] disconnected", err);
|
|
239
|
+
}).on("error", (err) => {
|
|
240
|
+
console.error("[streaming] error: ", err);
|
|
241
|
+
});
|
|
242
|
+
this.listenersMap = /* @__PURE__ */ new Map();
|
|
243
|
+
}
|
|
244
|
+
connect() {
|
|
245
|
+
this.realtimeClient.connect();
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Start batching commands for efficient bulk operations
|
|
249
|
+
* All subscription commands after this call will be batched until stopBatching is called
|
|
250
|
+
*/
|
|
251
|
+
startBatching() {
|
|
252
|
+
this.realtimeClient.startBatching();
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Stop batching and flush all collected commands to the server
|
|
256
|
+
* This will send all batched subscription commands in a single network request
|
|
257
|
+
*/
|
|
258
|
+
stopBatching() {
|
|
259
|
+
this.realtimeClient.stopBatching();
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Batch subscribe method that accepts a function containing subscription calls
|
|
263
|
+
* All subscription methods called within the function will be batched
|
|
264
|
+
* @param batchFunction Function containing subscription method calls
|
|
265
|
+
* @returns Array of unsubscribe functions
|
|
266
|
+
*/
|
|
267
|
+
batchSubscribe(batchFunction) {
|
|
268
|
+
this.startBatching();
|
|
269
|
+
const unsubscribles = batchFunction();
|
|
270
|
+
this.stopBatching();
|
|
271
|
+
return unsubscribles;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Batch unsubscribe method that accepts an array of unsubscribe functions
|
|
275
|
+
* All unsubscribe calls will be executed at once
|
|
276
|
+
* @param unsubscribles Array of unsubscribe functions to execute
|
|
277
|
+
*/
|
|
278
|
+
batchUnsubscribe(unsubscribles) {
|
|
279
|
+
if (!unsubscribles || unsubscribles.length === 0) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
unsubscribles.forEach((unsub) => {
|
|
283
|
+
if (unsub && typeof unsub.unsubscribe === "function") {
|
|
284
|
+
unsub.unsubscribe();
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
subscribe(channel, fn, filter, methodName) {
|
|
289
|
+
let sub = this.realtimeClient.getSubscription(channel);
|
|
290
|
+
let listeners = this.listenersMap.get(channel);
|
|
291
|
+
if (!sub) {
|
|
292
|
+
listeners = /* @__PURE__ */ new Set();
|
|
293
|
+
this.listenersMap.set(channel, listeners);
|
|
294
|
+
console.log("[xrealtime] create new sub: ", channel);
|
|
295
|
+
const processedFilter = filter && methodName ? replaceFilterFields(filter, methodName) : filter;
|
|
296
|
+
sub = this.realtimeClient.newSubscription(channel, {
|
|
297
|
+
delta: "fossil",
|
|
298
|
+
...processedFilter && { filter: processedFilter }
|
|
299
|
+
});
|
|
300
|
+
sub.on("subscribed", () => {
|
|
301
|
+
console.log("[xrealtime] subscribed", channel);
|
|
302
|
+
}).on("unsubscribed", () => {
|
|
303
|
+
console.log("[xrealtime] unsubscribed", channel);
|
|
304
|
+
}).on("publication", (ctx) => {
|
|
305
|
+
listeners?.forEach((it) => it(ctx.data));
|
|
306
|
+
}).subscribe();
|
|
307
|
+
}
|
|
308
|
+
listeners?.add(fn);
|
|
309
|
+
return new StreamUnsubscrible(this, channel, fn);
|
|
310
|
+
}
|
|
311
|
+
unsubscribe(channel, fn) {
|
|
312
|
+
const listeners = this.listenersMap.get(channel);
|
|
313
|
+
if (!listeners) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
listeners.delete(fn);
|
|
317
|
+
console.log("unsubscribe, remain listeners: ", listeners.size);
|
|
318
|
+
if (listeners.size === 0) {
|
|
319
|
+
console.log("unsubscribe channel: ", channel);
|
|
320
|
+
const sub = this.realtimeClient.getSubscription(channel);
|
|
321
|
+
if (sub) {
|
|
322
|
+
sub.unsubscribe();
|
|
323
|
+
this.realtimeClient.removeSubscription(sub);
|
|
324
|
+
}
|
|
325
|
+
this.listenersMap.delete(channel);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
formatScientificNotation(value) {
|
|
329
|
+
if (value === null || value === void 0) {
|
|
330
|
+
return "0";
|
|
331
|
+
}
|
|
332
|
+
const strValue = value.toString();
|
|
333
|
+
if (strValue.includes("e-") || strValue.includes("E-")) {
|
|
334
|
+
return Number(value).toFixed(20).replace(/\.?0+$/, "");
|
|
335
|
+
}
|
|
336
|
+
return strValue;
|
|
337
|
+
}
|
|
338
|
+
subscribeTokenCandles({
|
|
339
|
+
chain,
|
|
340
|
+
tokenAddress,
|
|
341
|
+
resolution,
|
|
342
|
+
callback,
|
|
343
|
+
filter
|
|
344
|
+
}) {
|
|
345
|
+
const channel = `dex-candle:${chain}_${tokenAddress}_${resolution}`;
|
|
346
|
+
return this.subscribe(channel, (data) => {
|
|
347
|
+
callback({
|
|
348
|
+
open: data.o,
|
|
349
|
+
close: data.c,
|
|
350
|
+
high: data.h,
|
|
351
|
+
low: data.l,
|
|
352
|
+
volume: data.v,
|
|
353
|
+
resolution: data.r,
|
|
354
|
+
time: data.t,
|
|
355
|
+
number: data.n
|
|
356
|
+
});
|
|
357
|
+
}, filter, "subscribeTokenCandles");
|
|
358
|
+
}
|
|
359
|
+
subscribeTokenStats({
|
|
360
|
+
chain,
|
|
361
|
+
tokenAddress,
|
|
362
|
+
callback,
|
|
363
|
+
filter
|
|
364
|
+
}) {
|
|
365
|
+
const channel = `dex-token-stats:${chain}_${tokenAddress}`;
|
|
366
|
+
return this.subscribe(channel, (data) => callback({
|
|
367
|
+
address: data.a,
|
|
368
|
+
timestamp: data.t,
|
|
369
|
+
buys1m: data.b1m,
|
|
370
|
+
sells1m: data.s1m,
|
|
371
|
+
buyers1m: data.be1m,
|
|
372
|
+
sellers1m: data.se1m,
|
|
373
|
+
buyVolumeInUsd1m: this.formatScientificNotation(data.bviu1m),
|
|
374
|
+
sellVolumeInUsd1m: this.formatScientificNotation(data.sviu1m),
|
|
375
|
+
price1m: this.formatScientificNotation(data.p1m),
|
|
376
|
+
openInUsd1m: this.formatScientificNotation(data.oiu1m),
|
|
377
|
+
closeInUsd1m: this.formatScientificNotation(data.ciu1m),
|
|
378
|
+
buys5m: data.b5m,
|
|
379
|
+
sells5m: data.s5m,
|
|
380
|
+
buyers5m: data.be5m,
|
|
381
|
+
sellers5m: data.se5m,
|
|
382
|
+
buyVolumeInUsd5m: this.formatScientificNotation(data.bviu5m),
|
|
383
|
+
sellVolumeInUsd5m: this.formatScientificNotation(data.sviu5m),
|
|
384
|
+
price5m: this.formatScientificNotation(data.p5m),
|
|
385
|
+
openInUsd5m: this.formatScientificNotation(data.oiu5m),
|
|
386
|
+
closeInUsd5m: this.formatScientificNotation(data.ciu5m),
|
|
387
|
+
buys15m: data.b15m,
|
|
388
|
+
sells15m: data.s15m,
|
|
389
|
+
buyers15m: data.be15m,
|
|
390
|
+
sellers15m: data.se15m,
|
|
391
|
+
buyVolumeInUsd15m: this.formatScientificNotation(data.bviu15m),
|
|
392
|
+
sellVolumeInUsd15m: this.formatScientificNotation(data.sviu15m),
|
|
393
|
+
price15m: this.formatScientificNotation(data.p15m),
|
|
394
|
+
openInUsd15m: this.formatScientificNotation(data.oiu15m),
|
|
395
|
+
closeInUsd15m: this.formatScientificNotation(data.ciu15m),
|
|
396
|
+
buys30m: data.b30m,
|
|
397
|
+
sells30m: data.s30m,
|
|
398
|
+
buyers30m: data.be30m,
|
|
399
|
+
sellers30m: data.se30m,
|
|
400
|
+
buyVolumeInUsd30m: this.formatScientificNotation(data.bviu30m),
|
|
401
|
+
sellVolumeInUsd30m: this.formatScientificNotation(data.sviu30m),
|
|
402
|
+
price30m: this.formatScientificNotation(data.p30m),
|
|
403
|
+
openInUsd30m: this.formatScientificNotation(data.oiu30m),
|
|
404
|
+
closeInUsd30m: this.formatScientificNotation(data.ciu30m),
|
|
405
|
+
buys1h: data.b1h,
|
|
406
|
+
sells1h: data.s1h,
|
|
407
|
+
buyers1h: data.be1h,
|
|
408
|
+
sellers1h: data.se1h,
|
|
409
|
+
buyVolumeInUsd1h: this.formatScientificNotation(data.bviu1h),
|
|
410
|
+
sellVolumeInUsd1h: this.formatScientificNotation(data.sviu1h),
|
|
411
|
+
price1h: this.formatScientificNotation(data.p1h),
|
|
412
|
+
openInUsd1h: this.formatScientificNotation(data.oiu1h),
|
|
413
|
+
closeInUsd1h: this.formatScientificNotation(data.ciu1h),
|
|
414
|
+
buys4h: data.b4h,
|
|
415
|
+
sells4h: data.s4h,
|
|
416
|
+
buyers4h: data.be4h,
|
|
417
|
+
sellers4h: data.se4h,
|
|
418
|
+
buyVolumeInUsd4h: this.formatScientificNotation(data.bviu4h),
|
|
419
|
+
sellVolumeInUsd4h: this.formatScientificNotation(data.sviu4h),
|
|
420
|
+
price4h: this.formatScientificNotation(data.p4h),
|
|
421
|
+
openInUsd4h: this.formatScientificNotation(data.oiu4h),
|
|
422
|
+
closeInUsd4h: this.formatScientificNotation(data.ciu4h),
|
|
423
|
+
buys24h: data.b24h,
|
|
424
|
+
sells24h: data.s24h,
|
|
425
|
+
buyers24h: data.be24h,
|
|
426
|
+
sellers24h: data.se24h,
|
|
427
|
+
buyVolumeInUsd24h: this.formatScientificNotation(data.bviu24h),
|
|
428
|
+
sellVolumeInUsd24h: this.formatScientificNotation(data.sviu24h),
|
|
429
|
+
price24h: this.formatScientificNotation(data.p24h),
|
|
430
|
+
openInUsd24h: this.formatScientificNotation(data.oiu24h),
|
|
431
|
+
closeInUsd24h: this.formatScientificNotation(data.ciu24h),
|
|
432
|
+
price: this.formatScientificNotation(data.p)
|
|
433
|
+
}), filter, "subscribeTokenStats");
|
|
434
|
+
}
|
|
435
|
+
subscribeTokenHolders({
|
|
436
|
+
chain,
|
|
437
|
+
tokenAddress,
|
|
438
|
+
callback,
|
|
439
|
+
filter
|
|
440
|
+
}) {
|
|
441
|
+
const channel = `dex-token-holding:${chain}_${tokenAddress}`;
|
|
442
|
+
return this.subscribe(channel, (data) => callback({
|
|
443
|
+
tokenAddress: data.a,
|
|
444
|
+
holders: data.h,
|
|
445
|
+
top100Amount: this.formatScientificNotation(data.t100a),
|
|
446
|
+
top10Amount: this.formatScientificNotation(data.t10a),
|
|
447
|
+
top100Holders: data.t100h,
|
|
448
|
+
top10Holders: data.t10h,
|
|
449
|
+
top100Ratio: this.formatScientificNotation(data.t100r),
|
|
450
|
+
top10Ratio: this.formatScientificNotation(data.t10r),
|
|
451
|
+
creatorsHolders: data.ch,
|
|
452
|
+
creatorsAmount: this.formatScientificNotation(data.ca),
|
|
453
|
+
creatorsRatio: this.formatScientificNotation(data.cr),
|
|
454
|
+
timestamp: data.ts
|
|
455
|
+
}), filter, "subscribeTokenHolders");
|
|
456
|
+
}
|
|
457
|
+
subscribeNewToken({
|
|
458
|
+
chain,
|
|
459
|
+
callback,
|
|
460
|
+
filter
|
|
461
|
+
}) {
|
|
462
|
+
const channel = `dex-new-token:${chain}`;
|
|
463
|
+
return this.subscribe(channel, (data) => {
|
|
464
|
+
const result = {
|
|
465
|
+
tokenAddress: data.a,
|
|
466
|
+
name: data.n,
|
|
467
|
+
symbol: data.s,
|
|
468
|
+
createdAtMs: data.cts
|
|
469
|
+
};
|
|
470
|
+
if (data.dec) {
|
|
471
|
+
result.decimals = data.dec;
|
|
472
|
+
}
|
|
473
|
+
if (data.lf) {
|
|
474
|
+
result.launchFrom = {};
|
|
475
|
+
if (data.lf.pa) {
|
|
476
|
+
result.launchFrom.programAddress = data.lf.pa;
|
|
477
|
+
}
|
|
478
|
+
if (data.lf.pf) {
|
|
479
|
+
result.launchFrom.protocolFamily = data.lf.pf;
|
|
480
|
+
}
|
|
481
|
+
if (data.lf.pn) {
|
|
482
|
+
result.launchFrom.protocolName = data.lf.pn;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
callback(result);
|
|
486
|
+
}, filter, "subscribeNewToken");
|
|
487
|
+
}
|
|
488
|
+
subscribeNewTokensMetadata({
|
|
489
|
+
chain,
|
|
490
|
+
callback
|
|
491
|
+
}) {
|
|
492
|
+
const channel = `dex-new-tokens-metadata:${chain}`;
|
|
493
|
+
return this.subscribe(
|
|
494
|
+
channel,
|
|
495
|
+
(data) => callback(
|
|
496
|
+
data.map(
|
|
497
|
+
(it) => ({
|
|
498
|
+
tokenAddress: it.a,
|
|
499
|
+
name: it.n,
|
|
500
|
+
symbol: it.s,
|
|
501
|
+
imageUrl: it.iu,
|
|
502
|
+
description: it.de,
|
|
503
|
+
socialMedia: (() => {
|
|
504
|
+
const socialMedia = {};
|
|
505
|
+
if (it.sm?.tw) {
|
|
506
|
+
socialMedia.twitter = it.sm.tw;
|
|
507
|
+
}
|
|
508
|
+
if (it.sm?.tg) {
|
|
509
|
+
socialMedia.telegram = it.sm.tg;
|
|
510
|
+
}
|
|
511
|
+
if (it.sm?.w) {
|
|
512
|
+
socialMedia.website = it.sm.w;
|
|
513
|
+
}
|
|
514
|
+
if (it.sm?.tt) {
|
|
515
|
+
socialMedia.tiktok = it.sm.tt;
|
|
516
|
+
}
|
|
517
|
+
if (it.sm?.dc) {
|
|
518
|
+
socialMedia.discord = it.sm.dc;
|
|
519
|
+
}
|
|
520
|
+
if (it.sm?.fb) {
|
|
521
|
+
socialMedia.facebook = it.sm.fb;
|
|
522
|
+
}
|
|
523
|
+
if (it.sm?.gh) {
|
|
524
|
+
socialMedia.github = it.sm.gh;
|
|
525
|
+
}
|
|
526
|
+
if (it.sm?.ig) {
|
|
527
|
+
socialMedia.instagram = it.sm.ig;
|
|
528
|
+
}
|
|
529
|
+
if (it.sm?.li) {
|
|
530
|
+
socialMedia.linkedin = it.sm.li;
|
|
531
|
+
}
|
|
532
|
+
if (it.sm?.md) {
|
|
533
|
+
socialMedia.medium = it.sm.md;
|
|
534
|
+
}
|
|
535
|
+
if (it.sm?.rd) {
|
|
536
|
+
socialMedia.reddit = it.sm.rd;
|
|
537
|
+
}
|
|
538
|
+
if (it.sm?.yt) {
|
|
539
|
+
socialMedia.youtube = it.sm.yt;
|
|
540
|
+
}
|
|
541
|
+
if (it.sm?.bb) {
|
|
542
|
+
socialMedia.bitbucket = it.sm.bb;
|
|
543
|
+
}
|
|
544
|
+
return socialMedia;
|
|
545
|
+
})(),
|
|
546
|
+
createdAtMs: it.cts
|
|
547
|
+
})
|
|
548
|
+
)
|
|
549
|
+
)
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
// subscribeNewTokens({
|
|
553
|
+
// chain,
|
|
554
|
+
// callback,
|
|
555
|
+
// }: {
|
|
556
|
+
// chain: string;
|
|
557
|
+
// callback: (data: NewToken[]) => void;
|
|
558
|
+
// }): Unsubscrible {
|
|
559
|
+
// const channel = `dex-new-tokens:${chain}`;
|
|
560
|
+
// return this.subscribe(channel, (data: any[]) =>
|
|
561
|
+
// callback(
|
|
562
|
+
// data.map(
|
|
563
|
+
// (it: any) =>
|
|
564
|
+
// ({
|
|
565
|
+
// tokenAddress: it.a,
|
|
566
|
+
// name: it.n,
|
|
567
|
+
// symbol: it.s,
|
|
568
|
+
// description: it.de,
|
|
569
|
+
// createdAtMs: it.cts,
|
|
570
|
+
// }) as NewToken
|
|
571
|
+
// )
|
|
572
|
+
// )
|
|
573
|
+
// );
|
|
574
|
+
// }
|
|
575
|
+
subscribeTokenSupply({
|
|
576
|
+
chain,
|
|
577
|
+
tokenAddress,
|
|
578
|
+
callback,
|
|
579
|
+
filter
|
|
580
|
+
}) {
|
|
581
|
+
const channel = `dex-token-supply:${chain}_${tokenAddress}`;
|
|
582
|
+
return this.subscribe(channel, (data) => callback({
|
|
583
|
+
tokenAddress: data.a,
|
|
584
|
+
supply: data.s,
|
|
585
|
+
marketCapInUsd: data.mc,
|
|
586
|
+
timestamp: data.ts
|
|
587
|
+
}), filter, "subscribeTokenSupply");
|
|
588
|
+
}
|
|
589
|
+
subscribeTokenLiquidity({
|
|
590
|
+
chain,
|
|
591
|
+
tokenAddress,
|
|
592
|
+
callback,
|
|
593
|
+
filter
|
|
594
|
+
}) {
|
|
595
|
+
const channel = `dex-token-general-stat-num:${chain}_${tokenAddress}`;
|
|
596
|
+
return this.subscribe(channel, (data) => callback({
|
|
597
|
+
tokenAddress: data.a,
|
|
598
|
+
metricType: data.t,
|
|
599
|
+
value: data.v,
|
|
600
|
+
timestamp: data.ts
|
|
601
|
+
}), filter, "subscribeTokenLiquidity");
|
|
602
|
+
}
|
|
603
|
+
subscribeRankingTokensLiquidity({
|
|
604
|
+
chain,
|
|
605
|
+
channelType,
|
|
606
|
+
callback
|
|
607
|
+
}) {
|
|
608
|
+
const channel = `dex-ranking-token-general_stat_num-list:${chain}_${channelType}`;
|
|
609
|
+
return this.subscribe(
|
|
610
|
+
channel,
|
|
611
|
+
(data) => callback(
|
|
612
|
+
data?.map(
|
|
613
|
+
(it) => ({
|
|
614
|
+
tokenAddress: it.a,
|
|
615
|
+
metricType: it.t,
|
|
616
|
+
value: it.v,
|
|
617
|
+
timestamp: it.ts
|
|
618
|
+
})
|
|
619
|
+
)
|
|
620
|
+
)
|
|
621
|
+
);
|
|
622
|
+
}
|
|
623
|
+
subscribeRankingTokensList({
|
|
624
|
+
chain,
|
|
625
|
+
ranking_type,
|
|
626
|
+
dex,
|
|
627
|
+
callback
|
|
628
|
+
}) {
|
|
629
|
+
const channel = dex ? `dex-ranking-list:${chain}_${ranking_type}_${dex}` : `dex-ranking-list:${chain}_${ranking_type}`;
|
|
630
|
+
return this.subscribe(
|
|
631
|
+
channel,
|
|
632
|
+
(data) => callback(
|
|
633
|
+
data?.map((item) => {
|
|
634
|
+
const result = {};
|
|
635
|
+
if (item.t) {
|
|
636
|
+
result.metadata = {
|
|
637
|
+
tokenAddress: item.t.a
|
|
638
|
+
};
|
|
639
|
+
if (item.t.n) {
|
|
640
|
+
result.metadata.name = item.t.n;
|
|
641
|
+
}
|
|
642
|
+
if (item.t.s) {
|
|
643
|
+
result.metadata.symbol = item.t.s;
|
|
644
|
+
}
|
|
645
|
+
if (item.t.iu) {
|
|
646
|
+
result.metadata.imageUrl = item.t.iu;
|
|
647
|
+
}
|
|
648
|
+
if (item.t.de) {
|
|
649
|
+
result.metadata.description = item.t.de;
|
|
650
|
+
}
|
|
651
|
+
if (item.t.d) {
|
|
652
|
+
result.metadata.decimals = item.t.dec;
|
|
653
|
+
}
|
|
654
|
+
if (item.t.cts) {
|
|
655
|
+
result.metadata.createdAtMs = item.t.cts;
|
|
656
|
+
}
|
|
657
|
+
if (item.t.lf) {
|
|
658
|
+
result.metadata.launchFrom = {};
|
|
659
|
+
if (item.t.lf.pa) {
|
|
660
|
+
result.metadata.launchFrom.programAddress = item.t.lf.pa;
|
|
661
|
+
}
|
|
662
|
+
if (item.t.lf.pf) {
|
|
663
|
+
result.metadata.launchFrom.protocolFamily = item.t.lf.pf;
|
|
664
|
+
}
|
|
665
|
+
if (item.t.lf.pn) {
|
|
666
|
+
result.metadata.launchFrom.protocolName = item.t.lf.pn;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
if (item.t.mt) {
|
|
670
|
+
result.metadata.migratedTo = {};
|
|
671
|
+
if (item.t.mt.pa) {
|
|
672
|
+
result.metadata.migratedTo.programAddress = item.t.mt.pa;
|
|
673
|
+
}
|
|
674
|
+
if (item.t.mt.pf) {
|
|
675
|
+
result.metadata.migratedTo.protocolFamily = item.t.mt.pf;
|
|
676
|
+
}
|
|
677
|
+
if (item.t.mt.pn) {
|
|
678
|
+
result.metadata.migratedTo.protocolName = item.t.mt.pn;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
if (item.t.sm) {
|
|
682
|
+
result.metadata.socialMedia = {};
|
|
683
|
+
if (item.t.sm.tw) {
|
|
684
|
+
result.metadata.socialMedia.twitter = item.t.sm.tw;
|
|
685
|
+
}
|
|
686
|
+
if (item.t.sm.tg) {
|
|
687
|
+
result.metadata.socialMedia.telegram = item.t.sm.tg;
|
|
688
|
+
}
|
|
689
|
+
if (item.t.sm.w) {
|
|
690
|
+
result.metadata.socialMedia.website = item.t.sm.w;
|
|
691
|
+
}
|
|
692
|
+
if (item.t.sm.tt) {
|
|
693
|
+
result.metadata.socialMedia.tiktok = item.t.sm.tt;
|
|
694
|
+
}
|
|
695
|
+
if (item.t.sm.dc) {
|
|
696
|
+
result.metadata.socialMedia.discord = item.t.sm.dc;
|
|
697
|
+
}
|
|
698
|
+
if (item.t.sm.fb) {
|
|
699
|
+
result.metadata.socialMedia.facebook = item.t.sm.fb;
|
|
700
|
+
}
|
|
701
|
+
if (item.t.sm.gh) {
|
|
702
|
+
result.metadata.socialMedia.github = item.t.sm.gh;
|
|
703
|
+
}
|
|
704
|
+
if (item.t.sm.ig) {
|
|
705
|
+
result.metadata.socialMedia.instagram = item.t.sm.ig;
|
|
706
|
+
}
|
|
707
|
+
if (item.t.sm.li) {
|
|
708
|
+
result.metadata.socialMedia.linkedin = item.t.sm.li;
|
|
709
|
+
}
|
|
710
|
+
if (item.t.sm.md) {
|
|
711
|
+
result.metadata.socialMedia.medium = item.t.sm.md;
|
|
712
|
+
}
|
|
713
|
+
if (item.t.sm.rd) {
|
|
714
|
+
result.metadata.socialMedia.reddit = item.t.sm.rd;
|
|
715
|
+
}
|
|
716
|
+
if (item.t.sm.yt) {
|
|
717
|
+
result.metadata.socialMedia.youtube = item.t.sm.yt;
|
|
718
|
+
}
|
|
719
|
+
if (item.t.sm.bb) {
|
|
720
|
+
result.metadata.socialMedia.bitbucket = item.t.sm.bb;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
if (item.t.cts) {
|
|
724
|
+
result.metadata.createdAtMs = item.t.cts;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
if (item.bc) {
|
|
728
|
+
result.bondingCurve = {};
|
|
729
|
+
if (item.bc.pr) {
|
|
730
|
+
result.bondingCurve.progressRatio = this.formatScientificNotation(item.bc.pr);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
if (item.h) {
|
|
734
|
+
result.holder = {
|
|
735
|
+
tokenAddress: item.h.a,
|
|
736
|
+
timestamp: item.h.ts || 0
|
|
737
|
+
};
|
|
738
|
+
if (item.h.h) {
|
|
739
|
+
result.holder.holders = item.h.h;
|
|
740
|
+
}
|
|
741
|
+
if (item.h.t100a) {
|
|
742
|
+
result.holder.top100Amount = this.formatScientificNotation(item.h.t100a);
|
|
743
|
+
}
|
|
744
|
+
if (item.h.t10a) {
|
|
745
|
+
result.holder.top10Amount = this.formatScientificNotation(item.h.t10a);
|
|
746
|
+
}
|
|
747
|
+
if (item.h.t100h) {
|
|
748
|
+
result.holder.top100Holders = item.h.t100h;
|
|
749
|
+
}
|
|
750
|
+
if (item.h.t10h) {
|
|
751
|
+
result.holder.top10Holders = item.h.t10h;
|
|
752
|
+
}
|
|
753
|
+
if (item.h.t100r) {
|
|
754
|
+
result.holder.top100Ratio = this.formatScientificNotation(item.h.t100r);
|
|
755
|
+
}
|
|
756
|
+
if (item.h.t10r) {
|
|
757
|
+
result.holder.top10Ratio = this.formatScientificNotation(item.h.t10r);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
if (item.s) {
|
|
761
|
+
result.supply = {
|
|
762
|
+
tokenAddress: item.s.a,
|
|
763
|
+
timestamp: item.s.ts || 0
|
|
764
|
+
};
|
|
765
|
+
if (item.s.s) {
|
|
766
|
+
result.supply.supply = item.s.s;
|
|
767
|
+
}
|
|
768
|
+
if (item.s.mc) {
|
|
769
|
+
result.supply.marketCapInUsd = item.s.mc;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
if (item.ts) {
|
|
773
|
+
result.stat = {
|
|
774
|
+
address: item.ts.a,
|
|
775
|
+
timestamp: item.ts.t || 0
|
|
776
|
+
};
|
|
777
|
+
if (item.ts.b1m) {
|
|
778
|
+
result.stat.buys1m = item.ts.b1m;
|
|
779
|
+
}
|
|
780
|
+
if (item.ts.s1m) {
|
|
781
|
+
result.stat.sells1m = item.ts.s1m;
|
|
782
|
+
}
|
|
783
|
+
if (item.ts.be1m) {
|
|
784
|
+
result.stat.buyers1m = item.ts.be1m;
|
|
785
|
+
}
|
|
786
|
+
if (item.ts.se1m) {
|
|
787
|
+
result.stat.sellers1m = item.ts.se1m;
|
|
788
|
+
}
|
|
789
|
+
if (item.ts.bviu1m) {
|
|
790
|
+
result.stat.buyVolumeInUsd1m = this.formatScientificNotation(item.ts.bviu1m);
|
|
791
|
+
}
|
|
792
|
+
if (item.ts.sviu1m) {
|
|
793
|
+
result.stat.sellVolumeInUsd1m = this.formatScientificNotation(item.ts.sviu1m);
|
|
794
|
+
}
|
|
795
|
+
if (item.ts.p1m) {
|
|
796
|
+
result.stat.price1m = this.formatScientificNotation(item.ts.p1m);
|
|
797
|
+
}
|
|
798
|
+
if (item.ts.oiu1m) {
|
|
799
|
+
result.stat.openInUsd1m = this.formatScientificNotation(item.ts.oiu1m);
|
|
800
|
+
}
|
|
801
|
+
if (item.ts.ciu1m) {
|
|
802
|
+
result.stat.closeInUsd1m = this.formatScientificNotation(item.ts.ciu1m);
|
|
803
|
+
}
|
|
804
|
+
if (item.ts.b5m) {
|
|
805
|
+
result.stat.buys5m = item.ts.b5m;
|
|
806
|
+
}
|
|
807
|
+
if (item.ts.s5m) {
|
|
808
|
+
result.stat.sells5m = item.ts.s5m;
|
|
809
|
+
}
|
|
810
|
+
if (item.ts.be5m) {
|
|
811
|
+
result.stat.buyers5m = item.ts.be5m;
|
|
812
|
+
}
|
|
813
|
+
if (item.ts.se5m) {
|
|
814
|
+
result.stat.sellers5m = item.ts.se5m;
|
|
815
|
+
}
|
|
816
|
+
if (item.ts.bviu5m) {
|
|
817
|
+
result.stat.buyVolumeInUsd5m = this.formatScientificNotation(item.ts.bviu5m);
|
|
818
|
+
}
|
|
819
|
+
if (item.ts.sviu5m) {
|
|
820
|
+
result.stat.sellVolumeInUsd5m = this.formatScientificNotation(item.ts.sviu5m);
|
|
821
|
+
}
|
|
822
|
+
if (item.ts.p5m) {
|
|
823
|
+
result.stat.price5m = this.formatScientificNotation(item.ts.p5m);
|
|
824
|
+
}
|
|
825
|
+
if (item.ts.oiu5m) {
|
|
826
|
+
result.stat.openInUsd5m = this.formatScientificNotation(item.ts.oiu5m);
|
|
827
|
+
}
|
|
828
|
+
if (item.ts.ciu5m) {
|
|
829
|
+
result.stat.closeInUsd5m = this.formatScientificNotation(item.ts.ciu5m);
|
|
830
|
+
}
|
|
831
|
+
if (item.ts.b15m) {
|
|
832
|
+
result.stat.buys15m = item.ts.b15m;
|
|
833
|
+
}
|
|
834
|
+
if (item.ts.s15m) {
|
|
835
|
+
result.stat.sells15m = item.ts.s15m;
|
|
836
|
+
}
|
|
837
|
+
if (item.ts.be15m) {
|
|
838
|
+
result.stat.buyers15m = item.ts.be15m;
|
|
839
|
+
}
|
|
840
|
+
if (item.ts.se15m) {
|
|
841
|
+
result.stat.sellers15m = item.ts.se15m;
|
|
842
|
+
}
|
|
843
|
+
if (item.ts.bviu15m) {
|
|
844
|
+
result.stat.buyVolumeInUsd15m = this.formatScientificNotation(item.ts.bviu15m);
|
|
845
|
+
}
|
|
846
|
+
if (item.ts.sviu15m) {
|
|
847
|
+
result.stat.sellVolumeInUsd15m = this.formatScientificNotation(item.ts.sviu15m);
|
|
848
|
+
}
|
|
849
|
+
if (item.ts.p15m) {
|
|
850
|
+
result.stat.price15m = this.formatScientificNotation(item.ts.p15m);
|
|
851
|
+
}
|
|
852
|
+
if (item.ts.oiu15m) {
|
|
853
|
+
result.stat.openInUsd15m = this.formatScientificNotation(item.ts.oiu15m);
|
|
854
|
+
}
|
|
855
|
+
if (item.ts.ciu15m) {
|
|
856
|
+
result.stat.closeInUsd15m = this.formatScientificNotation(item.ts.ciu15m);
|
|
857
|
+
}
|
|
858
|
+
if (item.ts.b30m) {
|
|
859
|
+
result.stat.buys30m = item.ts.b30m;
|
|
860
|
+
}
|
|
861
|
+
if (item.ts.s30m) {
|
|
862
|
+
result.stat.sells30m = item.ts.s30m;
|
|
863
|
+
}
|
|
864
|
+
if (item.ts.be30m) {
|
|
865
|
+
result.stat.buyers30m = item.ts.be30m;
|
|
866
|
+
}
|
|
867
|
+
if (item.ts.se30m) {
|
|
868
|
+
result.stat.sellers30m = item.ts.se30m;
|
|
869
|
+
}
|
|
870
|
+
if (item.ts.bviu30m) {
|
|
871
|
+
result.stat.buyVolumeInUsd30m = this.formatScientificNotation(item.ts.bviu30m);
|
|
872
|
+
}
|
|
873
|
+
if (item.ts.sviu30m) {
|
|
874
|
+
result.stat.sellVolumeInUsd30m = this.formatScientificNotation(item.ts.sviu30m);
|
|
875
|
+
}
|
|
876
|
+
if (item.ts.p30m) {
|
|
877
|
+
result.stat.price30m = this.formatScientificNotation(item.ts.p30m);
|
|
878
|
+
}
|
|
879
|
+
if (item.ts.oiu30m) {
|
|
880
|
+
result.stat.openInUsd30m = this.formatScientificNotation(item.ts.oiu30m);
|
|
881
|
+
}
|
|
882
|
+
if (item.ts.ciu30m) {
|
|
883
|
+
result.stat.closeInUsd30m = this.formatScientificNotation(item.ts.ciu30m);
|
|
884
|
+
}
|
|
885
|
+
if (item.ts.b1h) {
|
|
886
|
+
result.stat.buys1h = item.ts.b1h;
|
|
887
|
+
}
|
|
888
|
+
if (item.ts.s1h) {
|
|
889
|
+
result.stat.sells1h = item.ts.s1h;
|
|
890
|
+
}
|
|
891
|
+
if (item.ts.be1h) {
|
|
892
|
+
result.stat.buyers1h = item.ts.be1h;
|
|
893
|
+
}
|
|
894
|
+
if (item.ts.se1h) {
|
|
895
|
+
result.stat.sellers1h = item.ts.se1h;
|
|
896
|
+
}
|
|
897
|
+
if (item.ts.bviu1h) {
|
|
898
|
+
result.stat.buyVolumeInUsd1h = this.formatScientificNotation(item.ts.bviu1h);
|
|
899
|
+
}
|
|
900
|
+
if (item.ts.sviu1h) {
|
|
901
|
+
result.stat.sellVolumeInUsd1h = this.formatScientificNotation(item.ts.sviu1h);
|
|
902
|
+
}
|
|
903
|
+
if (item.ts.p1h) {
|
|
904
|
+
result.stat.price1h = this.formatScientificNotation(item.ts.p1h);
|
|
905
|
+
}
|
|
906
|
+
if (item.ts.oiu1h) {
|
|
907
|
+
result.stat.openInUsd1h = this.formatScientificNotation(item.ts.oiu1h);
|
|
908
|
+
}
|
|
909
|
+
if (item.ts.ciu1h) {
|
|
910
|
+
result.stat.closeInUsd1h = this.formatScientificNotation(item.ts.ciu1h);
|
|
911
|
+
}
|
|
912
|
+
if (item.ts.b4h) {
|
|
913
|
+
result.stat.buys4h = item.ts.b4h;
|
|
914
|
+
}
|
|
915
|
+
if (item.ts.s4h) {
|
|
916
|
+
result.stat.sells4h = item.ts.s4h;
|
|
917
|
+
}
|
|
918
|
+
if (item.ts.be4h) {
|
|
919
|
+
result.stat.buyers4h = item.ts.be4h;
|
|
920
|
+
}
|
|
921
|
+
if (item.ts.se4h) {
|
|
922
|
+
result.stat.sellers4h = item.ts.se4h;
|
|
923
|
+
}
|
|
924
|
+
if (item.ts.bviu4h) {
|
|
925
|
+
result.stat.buyVolumeInUsd4h = this.formatScientificNotation(item.ts.bviu4h);
|
|
926
|
+
}
|
|
927
|
+
if (item.ts.sviu4h) {
|
|
928
|
+
result.stat.sellVolumeInUsd4h = this.formatScientificNotation(item.ts.sviu4h);
|
|
929
|
+
}
|
|
930
|
+
if (item.ts.p4h) {
|
|
931
|
+
result.stat.price4h = this.formatScientificNotation(item.ts.p4h);
|
|
932
|
+
}
|
|
933
|
+
if (item.ts.oiu4h) {
|
|
934
|
+
result.stat.openInUsd4h = this.formatScientificNotation(item.ts.oiu4h);
|
|
935
|
+
}
|
|
936
|
+
if (item.ts.ciu4h) {
|
|
937
|
+
result.stat.closeInUsd4h = this.formatScientificNotation(item.ts.ciu4h);
|
|
938
|
+
}
|
|
939
|
+
if (item.ts.b24h) {
|
|
940
|
+
result.stat.buys24h = item.ts.b24h;
|
|
941
|
+
}
|
|
942
|
+
if (item.ts.s24h) {
|
|
943
|
+
result.stat.sells24h = item.ts.s24h;
|
|
944
|
+
}
|
|
945
|
+
if (item.ts.be24h) {
|
|
946
|
+
result.stat.buyers24h = item.ts.be24h;
|
|
947
|
+
}
|
|
948
|
+
if (item.ts.se24h) {
|
|
949
|
+
result.stat.sellers24h = item.ts.se24h;
|
|
950
|
+
}
|
|
951
|
+
if (item.ts.bviu24h) {
|
|
952
|
+
result.stat.buyVolumeInUsd24h = this.formatScientificNotation(item.ts.bviu24h);
|
|
953
|
+
}
|
|
954
|
+
if (item.ts.sviu24h) {
|
|
955
|
+
result.stat.sellVolumeInUsd24h = this.formatScientificNotation(item.ts.sviu24h);
|
|
956
|
+
}
|
|
957
|
+
if (item.ts.p24h) {
|
|
958
|
+
result.stat.price24h = this.formatScientificNotation(item.ts.p24h);
|
|
959
|
+
}
|
|
960
|
+
if (item.ts.oiu24h) {
|
|
961
|
+
result.stat.openInUsd24h = this.formatScientificNotation(item.ts.oiu24h);
|
|
962
|
+
}
|
|
963
|
+
if (item.ts.ciu24h) {
|
|
964
|
+
result.stat.closeInUsd24h = this.formatScientificNotation(item.ts.ciu24h);
|
|
965
|
+
}
|
|
966
|
+
if (item.ts.p) {
|
|
967
|
+
result.stat.price = this.formatScientificNotation(item.ts.p);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
return result;
|
|
971
|
+
})
|
|
972
|
+
)
|
|
973
|
+
);
|
|
974
|
+
}
|
|
975
|
+
subscribeRankingTokensStats({
|
|
976
|
+
chain,
|
|
977
|
+
channelType,
|
|
978
|
+
callback
|
|
979
|
+
}) {
|
|
980
|
+
const channel = `dex-ranking-token-stats-list:${chain}_${channelType}`;
|
|
981
|
+
return this.subscribe(
|
|
982
|
+
channel,
|
|
983
|
+
(data) => callback(
|
|
984
|
+
data?.map(
|
|
985
|
+
(it) => ({
|
|
986
|
+
address: it.a,
|
|
987
|
+
timestamp: it.t,
|
|
988
|
+
buys1m: it.b1m,
|
|
989
|
+
sells1m: it.s1m,
|
|
990
|
+
buyers1m: it.be1m,
|
|
991
|
+
sellers1m: it.se1m,
|
|
992
|
+
buyVolumeInUsd1m: this.formatScientificNotation(it.bviu1m),
|
|
993
|
+
sellVolumeInUsd1m: this.formatScientificNotation(it.sviu1m),
|
|
994
|
+
price1m: this.formatScientificNotation(it.p1m),
|
|
995
|
+
openInUsd1m: this.formatScientificNotation(it.oiu1m),
|
|
996
|
+
closeInUsd1m: this.formatScientificNotation(it.ciu1m),
|
|
997
|
+
buys5m: it.b5m,
|
|
998
|
+
sells5m: it.s5m,
|
|
999
|
+
buyers5m: it.be5m,
|
|
1000
|
+
sellers5m: it.se5m,
|
|
1001
|
+
buyVolumeInUsd5m: this.formatScientificNotation(it.bviu5m),
|
|
1002
|
+
sellVolumeInUsd5m: this.formatScientificNotation(it.sviu5m),
|
|
1003
|
+
price5m: this.formatScientificNotation(it.p5m),
|
|
1004
|
+
openInUsd5m: this.formatScientificNotation(it.oiu5m),
|
|
1005
|
+
closeInUsd5m: this.formatScientificNotation(it.ciu5m),
|
|
1006
|
+
buys15m: it.b15m,
|
|
1007
|
+
sells15m: it.s15m,
|
|
1008
|
+
buyers15m: it.be15m,
|
|
1009
|
+
sellers15m: it.se15m,
|
|
1010
|
+
buyVolumeInUsd15m: this.formatScientificNotation(it.bviu15m),
|
|
1011
|
+
sellVolumeInUsd15m: this.formatScientificNotation(it.sviu15m),
|
|
1012
|
+
price15m: this.formatScientificNotation(it.p15m),
|
|
1013
|
+
openInUsd15m: this.formatScientificNotation(it.oiu15m),
|
|
1014
|
+
closeInUsd15m: this.formatScientificNotation(it.ciu15m),
|
|
1015
|
+
buys30m: it.b30m,
|
|
1016
|
+
sells30m: it.s30m,
|
|
1017
|
+
buyers30m: it.be30m,
|
|
1018
|
+
sellers30m: it.se30m,
|
|
1019
|
+
buyVolumeInUsd30m: this.formatScientificNotation(it.bviu30m),
|
|
1020
|
+
sellVolumeInUsd30m: this.formatScientificNotation(it.sviu30m),
|
|
1021
|
+
price30m: this.formatScientificNotation(it.p30m),
|
|
1022
|
+
openInUsd30m: this.formatScientificNotation(it.oiu30m),
|
|
1023
|
+
closeInUsd30m: this.formatScientificNotation(it.ciu30m),
|
|
1024
|
+
buys1h: it.b1h,
|
|
1025
|
+
sells1h: it.s1h,
|
|
1026
|
+
buyers1h: it.be1h,
|
|
1027
|
+
sellers1h: it.se1h,
|
|
1028
|
+
buyVolumeInUsd1h: this.formatScientificNotation(it.bviu1h),
|
|
1029
|
+
sellVolumeInUsd1h: this.formatScientificNotation(it.sviu1h),
|
|
1030
|
+
price1h: this.formatScientificNotation(it.p1h),
|
|
1031
|
+
openInUsd1h: this.formatScientificNotation(it.oiu1h),
|
|
1032
|
+
closeInUsd1h: this.formatScientificNotation(it.ciu1h),
|
|
1033
|
+
buys4h: it.b4h,
|
|
1034
|
+
sells4h: it.s4h,
|
|
1035
|
+
buyers4h: it.be4h,
|
|
1036
|
+
sellers4h: it.se4h,
|
|
1037
|
+
buyVolumeInUsd4h: this.formatScientificNotation(it.bviu4h),
|
|
1038
|
+
sellVolumeInUsd4h: this.formatScientificNotation(it.sviu4h),
|
|
1039
|
+
price4h: this.formatScientificNotation(it.p4h),
|
|
1040
|
+
openInUsd4h: this.formatScientificNotation(it.oiu4h),
|
|
1041
|
+
closeInUsd4h: this.formatScientificNotation(it.ciu4h),
|
|
1042
|
+
buys24h: it.b24h,
|
|
1043
|
+
sells24h: it.s24h,
|
|
1044
|
+
buyers24h: it.be24h,
|
|
1045
|
+
sellers24h: it.se24h,
|
|
1046
|
+
buyVolumeInUsd24h: this.formatScientificNotation(it.bviu24h),
|
|
1047
|
+
sellVolumeInUsd24h: this.formatScientificNotation(it.sviu24h),
|
|
1048
|
+
price24h: this.formatScientificNotation(it.p24h),
|
|
1049
|
+
price: this.formatScientificNotation(it.p),
|
|
1050
|
+
openInUsd24h: this.formatScientificNotation(it.oiu24h),
|
|
1051
|
+
closeInUsd24h: this.formatScientificNotation(it.ciu24h)
|
|
1052
|
+
})
|
|
1053
|
+
)
|
|
1054
|
+
)
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
1057
|
+
subscribeRankingTokensHolders({
|
|
1058
|
+
chain,
|
|
1059
|
+
channelType,
|
|
1060
|
+
callback
|
|
1061
|
+
}) {
|
|
1062
|
+
const channel = `dex-ranking-token-holding-list:${chain}_${channelType}`;
|
|
1063
|
+
return this.subscribe(
|
|
1064
|
+
channel,
|
|
1065
|
+
(data) => callback(
|
|
1066
|
+
data?.map(
|
|
1067
|
+
(it) => ({
|
|
1068
|
+
tokenAddress: it.a,
|
|
1069
|
+
holders: it.h,
|
|
1070
|
+
top100Amount: this.formatScientificNotation(it.t100a),
|
|
1071
|
+
top10Amount: this.formatScientificNotation(it.t10a),
|
|
1072
|
+
top100Holders: it.t100h,
|
|
1073
|
+
top10Holders: it.t10h,
|
|
1074
|
+
top100Ratio: this.formatScientificNotation(it.t100r),
|
|
1075
|
+
top10Ratio: this.formatScientificNotation(it.t10r),
|
|
1076
|
+
timestamp: it.ts
|
|
1077
|
+
})
|
|
1078
|
+
)
|
|
1079
|
+
)
|
|
1080
|
+
);
|
|
1081
|
+
}
|
|
1082
|
+
subscribeRankingTokensSupply({
|
|
1083
|
+
chain,
|
|
1084
|
+
channelType,
|
|
1085
|
+
callback
|
|
1086
|
+
}) {
|
|
1087
|
+
const channel = `dex-ranking-token-supply-list:${chain}_${channelType}`;
|
|
1088
|
+
return this.subscribe(
|
|
1089
|
+
channel,
|
|
1090
|
+
(data) => callback(
|
|
1091
|
+
data?.map(
|
|
1092
|
+
(it) => ({
|
|
1093
|
+
tokenAddress: it.a,
|
|
1094
|
+
supply: it.s,
|
|
1095
|
+
marketCapInUsd: it.mc,
|
|
1096
|
+
timestamp: it.ts
|
|
1097
|
+
})
|
|
1098
|
+
)
|
|
1099
|
+
)
|
|
1100
|
+
);
|
|
1101
|
+
}
|
|
1102
|
+
subscribeRankingTokensBondingCurve({
|
|
1103
|
+
chain,
|
|
1104
|
+
callback
|
|
1105
|
+
}) {
|
|
1106
|
+
const channel = `dex-ranking-token-bounding-curve-list:${chain}_new`;
|
|
1107
|
+
return this.subscribe(
|
|
1108
|
+
channel,
|
|
1109
|
+
(data) => callback(
|
|
1110
|
+
data?.map(
|
|
1111
|
+
(it) => ({
|
|
1112
|
+
tokenAddress: it.a,
|
|
1113
|
+
progressRatio: it.pr
|
|
1114
|
+
})
|
|
1115
|
+
)
|
|
1116
|
+
)
|
|
1117
|
+
);
|
|
1118
|
+
}
|
|
1119
|
+
// subscribeTokenTrades({
|
|
1120
|
+
// chain,
|
|
1121
|
+
// tokenAddress,
|
|
1122
|
+
// callback,
|
|
1123
|
+
// }: {
|
|
1124
|
+
// chain: string;
|
|
1125
|
+
// tokenAddress: string;
|
|
1126
|
+
// callback: (data: TradeEvent[]) => void;
|
|
1127
|
+
// }): Unsubscrible {
|
|
1128
|
+
// const channel = `dex-trades:${chain}_${tokenAddress}`;
|
|
1129
|
+
// return this.subscribe(channel, (data: any[]) =>
|
|
1130
|
+
// callback(
|
|
1131
|
+
// data?.map(
|
|
1132
|
+
// (it: any) =>
|
|
1133
|
+
// ({
|
|
1134
|
+
// maker: it.bwa,
|
|
1135
|
+
// baseAmount: it.ba,
|
|
1136
|
+
// quoteAmount: it.sa,
|
|
1137
|
+
// // quoteSymbol: ,
|
|
1138
|
+
// quoteAddress: it.swa,
|
|
1139
|
+
// amountInUsd: it.baiu,
|
|
1140
|
+
// timestamp: it.t,
|
|
1141
|
+
// event: it.k,
|
|
1142
|
+
// txHash: it.h,
|
|
1143
|
+
// // priceInUsd: ,
|
|
1144
|
+
// // id: ,
|
|
1145
|
+
// // buyCostUsd: it.,
|
|
1146
|
+
// tokenAddress: it.a,
|
|
1147
|
+
// }) as TradeEvent
|
|
1148
|
+
// )
|
|
1149
|
+
// )
|
|
1150
|
+
// );
|
|
1151
|
+
// }
|
|
1152
|
+
subscribeWalletBalance({
|
|
1153
|
+
chain,
|
|
1154
|
+
walletAddress,
|
|
1155
|
+
callback,
|
|
1156
|
+
filter
|
|
1157
|
+
}) {
|
|
1158
|
+
const channel = `dex-wallet-balance:${chain}_${walletAddress}`;
|
|
1159
|
+
return this.subscribe(channel, (data) => callback([
|
|
1160
|
+
{
|
|
1161
|
+
walletAddress: data.a,
|
|
1162
|
+
tokenAddress: data.ta,
|
|
1163
|
+
tokenPriceInUsd: data.tpiu,
|
|
1164
|
+
balance: data.b,
|
|
1165
|
+
timestamp: data.t
|
|
1166
|
+
}
|
|
1167
|
+
]), filter, "subscribeWalletBalance");
|
|
1168
|
+
}
|
|
1169
|
+
subscribeWalletPnl({
|
|
1170
|
+
chain,
|
|
1171
|
+
walletAddress,
|
|
1172
|
+
callback,
|
|
1173
|
+
filter
|
|
1174
|
+
}) {
|
|
1175
|
+
const channel = `dex-wallet-token-pnl:${chain}_${walletAddress}`;
|
|
1176
|
+
return this.subscribe(channel, (data) => callback({
|
|
1177
|
+
walletAddress: data.a,
|
|
1178
|
+
tokenAddress: data.ta,
|
|
1179
|
+
tokenPriceInUsd: data.tpiu,
|
|
1180
|
+
timestamp: data.t,
|
|
1181
|
+
opentime: data.ot,
|
|
1182
|
+
lasttime: data.lt,
|
|
1183
|
+
closetime: data.ct,
|
|
1184
|
+
buyAmount: data.ba,
|
|
1185
|
+
buyAmountInUsd: data.baiu,
|
|
1186
|
+
buyCount: data.bs,
|
|
1187
|
+
buyCount30d: data.bs30d,
|
|
1188
|
+
buyCount7d: data.bs7d,
|
|
1189
|
+
sellAmount: data.sa,
|
|
1190
|
+
sellAmountInUsd: data.saiu,
|
|
1191
|
+
sellCount: data.ss,
|
|
1192
|
+
sellCount30d: data.ss30d,
|
|
1193
|
+
sellCount7d: data.ss7d,
|
|
1194
|
+
heldDurationTimestamp: data.hdts,
|
|
1195
|
+
averageBuyPriceInUsd: data.abpiu,
|
|
1196
|
+
averageSellPriceInUsd: data.aspiu,
|
|
1197
|
+
unrealizedProfitInUsd: data.upiu,
|
|
1198
|
+
unrealizedProfitRatio: data.upr,
|
|
1199
|
+
realizedProfitInUsd: data.rpiu,
|
|
1200
|
+
realizedProfitRatio: data.rpr,
|
|
1201
|
+
totalRealizedProfitInUsd: data.trpiu,
|
|
1202
|
+
totalRealizedProfitRatio: data.trr
|
|
1203
|
+
}), filter, "subscribeWalletPnl");
|
|
1204
|
+
}
|
|
1205
|
+
subscribeWalletPnlList({
|
|
1206
|
+
chain,
|
|
1207
|
+
walletAddress,
|
|
1208
|
+
callback
|
|
1209
|
+
}) {
|
|
1210
|
+
const channel = `dex-wallet-pnl-list:${chain}_${walletAddress}`;
|
|
1211
|
+
return this.subscribe(
|
|
1212
|
+
channel,
|
|
1213
|
+
(data) => callback(
|
|
1214
|
+
data?.map(
|
|
1215
|
+
(it) => ({
|
|
1216
|
+
walletAddress: it.a,
|
|
1217
|
+
buys: it.bs,
|
|
1218
|
+
buyAmount: it.ba,
|
|
1219
|
+
buyAmountInUsd: it.baiu,
|
|
1220
|
+
averageBuyPriceInUsd: it.abpiu,
|
|
1221
|
+
sellAmount: it.sa,
|
|
1222
|
+
sellAmountInUsd: it.saiu,
|
|
1223
|
+
sells: it.ss,
|
|
1224
|
+
wins: it.ws,
|
|
1225
|
+
winRatio: it.wr,
|
|
1226
|
+
pnlInUsd: it.piu,
|
|
1227
|
+
averagePnlInUsd: it.apiu,
|
|
1228
|
+
pnlRatio: it.pr,
|
|
1229
|
+
profitableDays: it.pd,
|
|
1230
|
+
losingDays: it.ld,
|
|
1231
|
+
tokens: it.ts,
|
|
1232
|
+
resolution: it.r
|
|
1233
|
+
})
|
|
1234
|
+
)
|
|
1235
|
+
)
|
|
1236
|
+
);
|
|
1237
|
+
}
|
|
1238
|
+
subscribeTokenTrade({
|
|
1239
|
+
chain,
|
|
1240
|
+
tokenAddress,
|
|
1241
|
+
callback,
|
|
1242
|
+
filter
|
|
1243
|
+
}) {
|
|
1244
|
+
const channel = `dex-trade:${chain}_${tokenAddress}`;
|
|
1245
|
+
return this.subscribe(channel, (data) => callback({
|
|
1246
|
+
tokenAddress: data.a,
|
|
1247
|
+
timestamp: data.t,
|
|
1248
|
+
kind: data.k,
|
|
1249
|
+
buyAmount: data.ba,
|
|
1250
|
+
buyAmountInUsd: data.baiu,
|
|
1251
|
+
buyTokenAddress: data.btma,
|
|
1252
|
+
buyTokenName: data.btn,
|
|
1253
|
+
buyTokenSymbol: data.bts,
|
|
1254
|
+
buyWalletAddress: data.bwa,
|
|
1255
|
+
sellAmount: data.sa,
|
|
1256
|
+
sellAmountInUsd: data.saiu,
|
|
1257
|
+
sellTokenAddress: data.stma,
|
|
1258
|
+
sellTokenName: data.stn,
|
|
1259
|
+
sellTokenSymbol: data.sts,
|
|
1260
|
+
sellWalletAddress: data.swa,
|
|
1261
|
+
txHash: data.h
|
|
1262
|
+
}), filter, "subscribeTokenTrades");
|
|
1263
|
+
}
|
|
1264
|
+
subscribeWalletTrade({
|
|
1265
|
+
chain,
|
|
1266
|
+
walletAddress,
|
|
1267
|
+
callback,
|
|
1268
|
+
filter
|
|
1269
|
+
}) {
|
|
1270
|
+
const channel = `dex-wallet-trade:${chain}_${walletAddress}`;
|
|
1271
|
+
return this.subscribe(channel, (data) => callback({
|
|
1272
|
+
tokenAddress: data.a,
|
|
1273
|
+
timestamp: data.t,
|
|
1274
|
+
kind: data.k,
|
|
1275
|
+
buyAmount: data.ba,
|
|
1276
|
+
buyAmountInUsd: data.baiu,
|
|
1277
|
+
buyTokenAddress: data.btma,
|
|
1278
|
+
buyTokenName: data.btn,
|
|
1279
|
+
buyTokenSymbol: data.bts,
|
|
1280
|
+
buyWalletAddress: data.bwa,
|
|
1281
|
+
sellAmount: data.sa,
|
|
1282
|
+
sellAmountInUsd: data.saiu,
|
|
1283
|
+
sellTokenAddress: data.stma,
|
|
1284
|
+
sellTokenName: data.stn,
|
|
1285
|
+
sellTokenSymbol: data.sts,
|
|
1286
|
+
sellWalletAddress: data.swa,
|
|
1287
|
+
txHash: data.h
|
|
1288
|
+
}), filter, "subscribeTokenTrades");
|
|
1289
|
+
}
|
|
1290
|
+
subscribeDexPoolBalance({
|
|
1291
|
+
chain,
|
|
1292
|
+
poolAddress,
|
|
1293
|
+
callback
|
|
1294
|
+
}) {
|
|
1295
|
+
const channel = `dex-pool-balance:${chain}_${poolAddress}`;
|
|
1296
|
+
return this.subscribe(
|
|
1297
|
+
channel,
|
|
1298
|
+
(data) => callback({
|
|
1299
|
+
poolAddress: data.a,
|
|
1300
|
+
tokenAAddress: data.taa,
|
|
1301
|
+
tokenALiquidityInUsd: data.taliu,
|
|
1302
|
+
tokenBAddress: data.tba,
|
|
1303
|
+
tokenBLiquidityInUsd: data.tbliu
|
|
1304
|
+
})
|
|
1305
|
+
);
|
|
1306
|
+
}
|
|
1307
|
+
};
|
|
1308
|
+
var StreamUnsubscrible = class {
|
|
1309
|
+
constructor(streamApi, channel, fn) {
|
|
1310
|
+
this.streamApi = streamApi;
|
|
1311
|
+
this.channel = channel;
|
|
1312
|
+
this.fn = fn;
|
|
1313
|
+
}
|
|
1314
|
+
unsubscribe() {
|
|
1315
|
+
this.streamApi.unsubscribe(this.channel, this.fn);
|
|
1316
|
+
}
|
|
1317
|
+
};
|
|
1318
|
+
|
|
1319
|
+
// src/stream/stream.model.ts
|
|
1320
|
+
var TokenActivityType = /* @__PURE__ */ ((TokenActivityType2) => {
|
|
1321
|
+
TokenActivityType2["Sell"] = "sell";
|
|
1322
|
+
TokenActivityType2["Buy"] = "buy";
|
|
1323
|
+
TokenActivityType2["AddLiquidity"] = "add_liquidity";
|
|
1324
|
+
TokenActivityType2["RemoveLiquidity"] = "remove_liquidity";
|
|
1325
|
+
return TokenActivityType2;
|
|
1326
|
+
})(TokenActivityType || {});
|
|
1327
|
+
var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
|
|
1328
|
+
ChannelType2["New"] = "new";
|
|
1329
|
+
ChannelType2["HOT"] = "trending";
|
|
1330
|
+
ChannelType2["US_STOCKS"] = "us_stocks";
|
|
1331
|
+
ChannelType2["COMPLETED"] = "completed";
|
|
1332
|
+
ChannelType2["GRADUATED"] = "graduated";
|
|
1333
|
+
return ChannelType2;
|
|
1334
|
+
})(ChannelType || {});
|
|
1335
|
+
var MetricType = /* @__PURE__ */ ((MetricType2) => {
|
|
1336
|
+
MetricType2["LIQUIDITY_IN_USD"] = "liquidity_in_usd";
|
|
1337
|
+
MetricType2["MIGRATED_RATIO"] = "migrated_ratio";
|
|
1338
|
+
return MetricType2;
|
|
1339
|
+
})(MetricType || {});
|
|
1340
|
+
var RankingType = /* @__PURE__ */ ((RankingType2) => {
|
|
1341
|
+
RankingType2["NEW"] = "new";
|
|
1342
|
+
RankingType2["HOT"] = "trending";
|
|
1343
|
+
RankingType2["STOCKS"] = "stocks";
|
|
1344
|
+
RankingType2["FINALSTRETCH"] = "completed";
|
|
1345
|
+
RankingType2["MIGRATED"] = "graduated";
|
|
1346
|
+
return RankingType2;
|
|
1347
|
+
})(RankingType || {});
|
|
1348
|
+
var Dex = /* @__PURE__ */ ((Dex2) => {
|
|
1349
|
+
Dex2["PUMP_FUN"] = "pump_fun";
|
|
1350
|
+
Dex2["RAYDIUM_LAUNCHPAD"] = "raydium_launchpad";
|
|
1351
|
+
Dex2["METEOR_DYNAMIC_BOUNDING_CURVE"] = "meteora_dynamic_bounding_curve";
|
|
1352
|
+
Dex2["BONK_FUN"] = "bonk_fun";
|
|
1353
|
+
Dex2["BOOP_FUN"] = "boop_fun";
|
|
1354
|
+
Dex2["MOONIT_FUN"] = "moonit_fun";
|
|
1355
|
+
return Dex2;
|
|
1356
|
+
})(Dex || {});
|
|
1357
|
+
export {
|
|
1358
|
+
CEL_FIELD_MAPPINGS,
|
|
1359
|
+
ChannelType,
|
|
1360
|
+
Dex,
|
|
1361
|
+
MetricType,
|
|
1362
|
+
RankingType,
|
|
1363
|
+
StreamApi,
|
|
1364
|
+
TokenActivityType,
|
|
1365
|
+
getAvailableFields,
|
|
1366
|
+
getFieldMappings,
|
|
1367
|
+
replaceFilterFields
|
|
1368
|
+
};
|
|
1369
|
+
//# sourceMappingURL=index.mjs.map
|