@codex-data/sdk 1.0.6 → 1.0.7

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.
Files changed (77) hide show
  1. package/dist/resources/generated_queries/FilterPairs.graphql +20 -0
  2. package/dist/resources/generated_queries/FilterTokens.graphql +20 -0
  3. package/dist/resources/generated_queries/GetBars.graphql +4 -1
  4. package/dist/resources/generated_queries/GetCommunityNotes.graphql +2 -0
  5. package/dist/resources/generated_queries/GetDetailedPairStats.graphql +4 -0
  6. package/dist/resources/generated_queries/GetDetailedPairsStats.graphql +4 -0
  7. package/dist/resources/generated_queries/GetTokenEvents.graphql +1 -0
  8. package/dist/resources/generated_queries/GetTokenEventsForMaker.graphql +1 -0
  9. package/dist/resources/generated_queries/ListPairsForToken.graphql +4 -0
  10. package/dist/resources/generated_queries/ListPairsWithMetadataForToken.graphql +8 -0
  11. package/dist/resources/generated_queries/PairMetadata.graphql +4 -0
  12. package/dist/resources/generated_queries/Token.graphql +2 -0
  13. package/dist/resources/generated_queries/Tokens.graphql +2 -0
  14. package/dist/resources/generated_subscriptions/OnEventsCreated.graphql +1 -0
  15. package/dist/resources/generated_subscriptions/OnLaunchpadTokenEvent.graphql +2 -0
  16. package/dist/resources/generated_subscriptions/OnLaunchpadTokenEventBatch.graphql +91 -0
  17. package/dist/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +4 -0
  18. package/dist/resources/generated_subscriptions/OnTokenEventsCreated.graphql +1 -0
  19. package/dist/resources/graphql.d.ts +167 -8
  20. package/dist/resources/graphql.d.ts.map +1 -1
  21. package/dist/resources/graphql.js +33 -0
  22. package/dist/resources/graphql.js.map +1 -1
  23. package/dist/resources/graphql.schema.json +918 -14
  24. package/dist/resources/graphql.ts +167 -8
  25. package/dist/resources/schema.graphql +250 -8
  26. package/dist/resources/subscriptions_override/OnLaunchpadTokenEventBatch.graphql +91 -0
  27. package/dist/scripts/generateGraphql.js +3 -4
  28. package/dist/scripts/generateGraphql.js.map +1 -1
  29. package/dist/sdk/Mutation.d.ts +1 -1
  30. package/dist/sdk/Mutation.d.ts.map +1 -1
  31. package/dist/sdk/Mutation.js +1 -1
  32. package/dist/sdk/Mutation.js.map +1 -1
  33. package/dist/sdk/Query.d.ts +49 -49
  34. package/dist/sdk/Query.d.ts.map +1 -1
  35. package/dist/sdk/Query.js +49 -49
  36. package/dist/sdk/Query.js.map +1 -1
  37. package/dist/sdk/Subscribe.d.ts +17 -16
  38. package/dist/sdk/Subscribe.d.ts.map +1 -1
  39. package/dist/sdk/Subscribe.js +171 -77
  40. package/dist/sdk/Subscribe.js.map +1 -1
  41. package/dist/sdk/generated/gql.d.ts +41 -34
  42. package/dist/sdk/generated/gql.d.ts.map +1 -1
  43. package/dist/sdk/generated/gql.js +18 -17
  44. package/dist/sdk/generated/gql.js.map +1 -1
  45. package/dist/sdk/generated/graphql.d.ts +355 -9
  46. package/dist/sdk/generated/graphql.d.ts.map +1 -1
  47. package/dist/sdk/generated/graphql.js +52 -18
  48. package/dist/sdk/generated/graphql.js.map +1 -1
  49. package/package.json +1 -1
  50. package/src/resources/generated_queries/FilterPairs.graphql +20 -0
  51. package/src/resources/generated_queries/FilterTokens.graphql +20 -0
  52. package/src/resources/generated_queries/GetBars.graphql +4 -1
  53. package/src/resources/generated_queries/GetCommunityNotes.graphql +2 -0
  54. package/src/resources/generated_queries/GetDetailedPairStats.graphql +4 -0
  55. package/src/resources/generated_queries/GetDetailedPairsStats.graphql +4 -0
  56. package/src/resources/generated_queries/GetTokenEvents.graphql +1 -0
  57. package/src/resources/generated_queries/GetTokenEventsForMaker.graphql +1 -0
  58. package/src/resources/generated_queries/ListPairsForToken.graphql +4 -0
  59. package/src/resources/generated_queries/ListPairsWithMetadataForToken.graphql +8 -0
  60. package/src/resources/generated_queries/PairMetadata.graphql +4 -0
  61. package/src/resources/generated_queries/Token.graphql +2 -0
  62. package/src/resources/generated_queries/Tokens.graphql +2 -0
  63. package/src/resources/generated_subscriptions/OnEventsCreated.graphql +1 -0
  64. package/src/resources/generated_subscriptions/OnLaunchpadTokenEvent.graphql +2 -0
  65. package/src/resources/generated_subscriptions/OnLaunchpadTokenEventBatch.graphql +91 -0
  66. package/src/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +4 -0
  67. package/src/resources/generated_subscriptions/OnTokenEventsCreated.graphql +1 -0
  68. package/src/resources/graphql.schema.json +918 -14
  69. package/src/resources/graphql.ts +167 -8
  70. package/src/resources/schema.graphql +250 -8
  71. package/src/resources/subscriptions_override/OnLaunchpadTokenEventBatch.graphql +91 -0
  72. package/src/scripts/generateGraphql.ts +2 -4
  73. package/src/sdk/Mutation.ts +2 -2
  74. package/src/sdk/Query.ts +103 -103
  75. package/src/sdk/Subscribe.ts +225 -123
  76. package/src/sdk/generated/gql.ts +39 -34
  77. package/src/sdk/generated/graphql.ts +207 -42
@@ -18,6 +18,8 @@ import {
18
18
  OnLatestPairUpdatedSubscriptionVariables,
19
19
  OnLatestTokensSubscription,
20
20
  OnLatestTokensSubscriptionVariables,
21
+ OnLaunchpadTokenEventBatchSubscription,
22
+ OnLaunchpadTokenEventBatchSubscriptionVariables,
21
23
  OnLaunchpadTokenEventSubscription,
22
24
  OnLaunchpadTokenEventSubscriptionVariables,
23
25
  OnNftAssetsCreatedSubscription,
@@ -49,66 +51,40 @@ import { Codex } from "./index";
49
51
 
50
52
  export class Subscribe {
51
53
  constructor(private sdk: Codex) {}
52
- onHoldersUpdated = async (
53
- vars: OnHoldersUpdatedSubscriptionVariables,
54
- sink: Sink<ExecutionResult<OnHoldersUpdatedSubscription>>,
55
- ) =>
56
- this.sdk.subscribe(
57
- `subscription OnHoldersUpdated($tokenId: String!) {
58
- onHoldersUpdated (tokenId: $tokenId) {
59
- balances { address, balance, firstHeldTimestamp, networkId, shiftedBalance, tokenAddress, tokenId, walletId }, holders, networkId, tokenAddress, tokenId
60
- }
61
- }`,
62
- vars,
63
- sink,
64
- );
65
- onUnconfirmedBarsUpdated = async (
66
- vars: OnUnconfirmedBarsUpdatedSubscriptionVariables,
67
- sink: Sink<ExecutionResult<OnUnconfirmedBarsUpdatedSubscription>>,
68
- ) =>
69
- this.sdk.subscribe(
70
- `subscription OnUnconfirmedBarsUpdated($pairId: String, $quoteToken: QuoteToken) {
71
- onUnconfirmedBarsUpdated (pairId: $pairId, quoteToken: $quoteToken) {
72
- aggregates { r1 { c, h, l, o, t, v, volume }, r1S { c, h, l, o, t, v, volume }, r5 { c, h, l, o, t, v, volume }, r5S { c, h, l, o, t, v, volume }, r15 { c, h, l, o, t, v, volume }, r15S { c, h, l, o, t, v, volume } }, eventSortKey, networkId, pairAddress, pairId, quoteToken, quoteTokenAddress, timestamp
73
- }
74
- }`,
75
- vars,
76
- sink,
77
- );
78
- onUnconfirmedEventsCreated = async (
79
- vars: OnUnconfirmedEventsCreatedSubscriptionVariables,
80
- sink: Sink<ExecutionResult<OnUnconfirmedEventsCreatedSubscription>>,
54
+ onTokenBarsUpdated = async (
55
+ vars: OnTokenBarsUpdatedSubscriptionVariables,
56
+ sink: Sink<ExecutionResult<OnTokenBarsUpdatedSubscription>>,
81
57
  ) =>
82
58
  this.sdk.subscribe(
83
- `subscription OnUnconfirmedEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
84
- onUnconfirmedEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
85
- address, events { address, blockHash, blockNumber, data { ... on UnconfirmedLiquidityChangeEventData { amount0, amount0Shifted, amount1, amount1Shifted, type }, ... on UnconfirmedSwapEventData { amountBaseToken, amountNonLiquidityToken, priceBaseToken, priceBaseTokenTotal, priceUsd, priceUsdTotal, type } }, eventDisplayType, eventType, id, logIndex, maker, networkId, quoteToken, supplementalIndex, timestamp, transactionHash, transactionIndex }, id, networkId, quoteToken
59
+ `subscription OnTokenBarsUpdated($networkId: Int, $statsType: TokenPairStatisticsType, $tokenId: String) {
60
+ onTokenBarsUpdated (networkId: $networkId, statsType: $statsType, tokenId: $tokenId) {
61
+ aggregates { r1 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r1D { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r1S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r5 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r5S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r7D { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r15 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r15S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r30 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r30S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r60 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r240 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r720 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } } }, eventSortKey, networkId, pairAddress, pairId, quoteToken, statsType, timestamp, tokenAddress, tokenId
86
62
  }
87
63
  }`,
88
64
  vars,
89
65
  sink,
90
66
  );
91
- onTokenBarsUpdated = async (
92
- vars: OnTokenBarsUpdatedSubscriptionVariables,
93
- sink: Sink<ExecutionResult<OnTokenBarsUpdatedSubscription>>,
67
+ onLatestTokens = async (
68
+ vars: OnLatestTokensSubscriptionVariables,
69
+ sink: Sink<ExecutionResult<OnLatestTokensSubscription>>,
94
70
  ) =>
95
71
  this.sdk.subscribe(
96
- `subscription OnTokenBarsUpdated($networkId: Int, $statsType: TokenPairStatisticsType, $tokenId: String) {
97
- onTokenBarsUpdated (networkId: $networkId, statsType: $statsType, tokenId: $tokenId) {
98
- aggregates { r1 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r1D { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r1S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r5 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r5S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r7D { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r15 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r15S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r30 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r30S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r60 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r240 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r720 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } } }, eventSortKey, networkId, pairAddress, pairId, quoteToken, statsType, timestamp, tokenAddress, tokenId
72
+ `subscription OnLatestTokens($id: String, $networkId: Int, $tokenAddress: String) {
73
+ onLatestTokens (id: $id, networkId: $networkId, tokenAddress: $tokenAddress) {
74
+ blockHash, blockNumber, creatorAddress, creatorBalance, decimals, id, networkId, simulationResults { buyGasUsed, buySuccess, buyTax, canRenounceOwnership, canTransferOwnership, isOwnerRenounced, maxBuyAmount, maxSellAmount, openTradingCall, sellGasUsed, sellSuccess, sellTax }, timeCreated, tokenAddress, tokenName, tokenSymbol, totalSupply, traceIndex, transactionHash, transactionIndex
99
75
  }
100
76
  }`,
101
77
  vars,
102
78
  sink,
103
79
  );
104
- onNftPoolEventsCreated = async (
105
- vars: OnNftPoolEventsCreatedSubscriptionVariables,
106
- sink: Sink<ExecutionResult<OnNftPoolEventsCreatedSubscription>>,
80
+ onTokenLifecycleEventsCreated = async (
81
+ vars: OnTokenLifecycleEventsCreatedSubscriptionVariables,
82
+ sink: Sink<ExecutionResult<OnTokenLifecycleEventsCreatedSubscription>>,
107
83
  ) =>
108
84
  this.sdk.subscribe(
109
- `subscription OnNftPoolEventsCreated($collectionAddress: String, $exchangeAddress: String, $networkId: Int, $poolAddress: String) {
110
- onNftPoolEventsCreated (collectionAddress: $collectionAddress, exchangeAddress: $exchangeAddress, networkId: $networkId, poolAddress: $poolAddress) {
111
- collectionAddress, events { blockHash, blockNumber, collectionAddress, collectionId, data { ... on NewPoolEventData { assetRecipientAddress, bondingCurveAddress, bondingCurveType, buyPriceT, collectionAddress, createdAt, delta, feeAmountT, nbtRatio, networkId, nftTokenBalance, ownerAddress, poolAddress, sellPriceT, startPriceT, tokenAddress, tokenBalanceT, type, usdRatio }, ... on NewPoolEventDataV2 { assetRecipientAddress, bondingCurveAddress, bondingCurveType, buyPriceT, collectionAddress, createdAt, delta, feeAmountT, nbtRatio, networkId, nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftTokenIds, nftTokenQuantities, ownerAddress, poolAddress, poolNftType, propertyChecker, royalties { percent, recipient }, sellPriceT, startPriceT, tokenAddress, tokenBalanceT, type, usdRatio }, ... on NftPoolAssetRecipientUpdateEventData { newAssetRecipient, type }, ... on NftPoolDeltaUpdateEventData { newDelta, type }, ... on NftPoolFeeUpdateEventData { nbtRatio, newFeeT, type, usdRatio }, ... on NftPoolNftDepositEventData { nftTokenBalance, nftTokenIds, tokenBalanceT, type }, ... on NftPoolNftDepositEventDataV2 { nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftTokenAmounts, nftTokenIds, tokenBalanceT, type }, ... on NftPoolNftWithdrawalEventData { nftTokenBalance, nftTokenIds, tokenBalanceT, type }, ... on NftPoolNftWithdrawalEventDataV2 { nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftTokenAmounts, nftTokenIds, tokenBalanceT, type }, ... on NftPoolOwnershipTransferredEventDataV2 { newOwner, type }, ... on NftPoolSpotPriceUpdateEventData { nbtRatio, newBuyPriceT, newSellPriceT, newSpotPriceT, type, usdRatio }, ... on NftPoolSpotPriceUpdateEventDataV2 { nbtRatio, newBuyPriceT, newSellPriceT, newSpotPriceT, type, usdRatio }, ... on NftPoolTokenDepositEventData { amountT, nbtRatio, nftTokenBalance, tokenBalanceT, type, usdRatio }, ... on NftPoolTokenDepositEventDataV2 { amountT, nbtRatio, tokenBalanceT, type, usdRatio }, ... on NftPoolTokenWithdrawalEventData { amountT, nbtRatio, nftTokenBalance, tokenBalanceT, type, usdRatio }, ... on NftPoolTokenWithdrawalEventDataV2 { amountT, nbtRatio, tokenBalanceT, type, usdRatio }, ... on SwapNftInPoolEventData { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftTokenBalance, nftsTransfered { amountT, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio }, ... on SwapNftInPoolEventDataV2 { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftsTransfered { amountT, nftQuantity, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio }, ... on SwapNftOutPoolEventData { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftTokenBalance, nftsTransfered { amountT, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio }, ... on SwapNftOutPoolEventDataV2 { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftsTransfered { amountT, nftQuantity, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio } }, eventType, exchangeAddress, id, logIndex, maker, networkId, poolAddress, poolType, timestamp, tokenAddress, transactionHash, transactionIndex }, exchangeAddress, id, networkId, poolAddress
85
+ `subscription OnTokenLifecycleEventsCreated($address: String, $networkId: Int) {
86
+ onTokenLifecycleEventsCreated (address: $address, networkId: $networkId) {
87
+ events { blockHash, blockNumber, data { ... on TokenBurnEventData { amount, circulatingSupply, totalSupply }, ... on TokenMintEventData { amount, circulatingSupply, totalSupply } }, eventType, id, logIndex, maker, networkId, timestamp, tokenAddress, transactionHash, transactionIndex }, id
112
88
  }
113
89
  }`,
114
90
  vars,
@@ -145,92 +121,192 @@ export class Subscribe {
145
121
  vars,
146
122
  sink,
147
123
  );
148
- onTokenLifecycleEventsCreated = async (
149
- vars: OnTokenLifecycleEventsCreatedSubscriptionVariables,
150
- sink: Sink<ExecutionResult<OnTokenLifecycleEventsCreatedSubscription>>,
124
+ onLaunchpadTokenEvent = async (
125
+ vars: OnLaunchpadTokenEventSubscriptionVariables,
126
+ sink: Sink<ExecutionResult<OnLaunchpadTokenEventSubscription>>,
151
127
  ) =>
152
128
  this.sdk.subscribe(
153
- `subscription OnTokenLifecycleEventsCreated($address: String, $networkId: Int) {
154
- onTokenLifecycleEventsCreated (address: $address, networkId: $networkId) {
155
- events { blockHash, blockNumber, data { ... on TokenBurnEventData { amount, circulatingSupply, totalSupply }, ... on TokenMintEventData { amount, circulatingSupply, totalSupply } }, eventType, id, logIndex, maker, networkId, timestamp, tokenAddress, transactionHash, transactionIndex }, id
129
+ `subscription OnLaunchpadTokenEvent($input: OnLaunchpadTokenEventInput) {
130
+ onLaunchpadTokenEvent (input: $input) {
131
+ address, buyCount1, eventType, holders, marketCap, networkId, price, protocol, sellCount1, token { address, cmcId, createBlockNumber, createTransactionHash, createdAt, creatorAddress, decimals, exchanges { address, color, exchangeVersion, iconUrl, id, name, networkId, tradeUrl }, freezable, id, info { address, circulatingSupply, cmcId, description, id, imageBannerUrl, imageLargeUrl, imageSmallUrl, imageThumbUrl, isScam, name, networkId, symbol, totalSupply }, isScam, launchpad { completed, completedAt, completedSlot, graduationPercent, launchpadProtocol, migrated, migratedAt, migratedPoolAddress, migratedSlot, name, poolAddress }, mintable, name, networkId, socialLinks { bitcointalk, blog, coingecko, coinmarketcap, discord, email, facebook, github, instagram, linkedin, reddit, slack, telegram, twitch, twitter, website, wechat, whitepaper, youtube }, symbol }, transactions1, volume1
156
132
  }
157
133
  }`,
158
134
  vars,
159
135
  sink,
160
136
  );
161
- onTokenEventsCreated = async (
162
- vars: OnTokenEventsCreatedSubscriptionVariables,
163
- sink: Sink<ExecutionResult<OnTokenEventsCreatedSubscription>>,
137
+ onDetailedStatsUpdated = async (
138
+ vars: OnDetailedStatsUpdatedSubscriptionVariables,
139
+ sink: Sink<ExecutionResult<OnDetailedStatsUpdatedSubscription>>,
164
140
  ) =>
165
141
  this.sdk.subscribe(
166
- `subscription OnTokenEventsCreated($input: OnTokenEventsCreatedInput!) {
167
- onTokenEventsCreated (input: $input) {
168
- events { address, baseTokenPrice, blockHash, blockNumber, data { ... on BurnEventData { amount0, amount0Shifted, amount1, amount1Shifted, tickLower, tickUpper, type }, ... on MintEventData { amount0, amount0Shifted, amount1, amount1Shifted, tickLower, tickUpper, type }, ... on PoolBalanceChangedEventData { amount0, amount0Shifted, amount1, amount1Shifted, liquidity0, liquidity1, protocolFeeAmount0, protocolFeeAmount1, sender, token0, token1, type }, ... on SwapEventData { amount0, amount0In, amount0Out, amount1, amount1In, amount1Out, amountNonLiquidityToken, priceBaseToken, priceBaseTokenTotal, priceUsd, priceUsdTotal, tick, type } }, eventDisplayType, eventType, id, labels { sandwich { label, sandwichType, token0DrainedAmount, token1DrainedAmount }, washtrade { label } }, liquidityToken, logIndex, maker, networkId, quoteToken, timestamp, token0Address, token0PoolValueUsd, token0SwapValueUsd, token0ValueBase, token1Address, token1PoolValueUsd, token1SwapValueUsd, token1ValueBase, transactionHash, transactionIndex }, id
142
+ `subscription OnDetailedStatsUpdated($pairId: String, $statsType: TokenPairStatisticsType, $tokenOfInterest: TokenOfInterest) {
143
+ onDetailedStatsUpdated (pairId: $pairId, statsType: $statsType, tokenOfInterest: $tokenOfInterest) {
144
+ bucketCount, pairId, queryTimestamp, statsType, stats_day1 { buckets { end, start }, buyVolume { buckets, change, currentValue, previousValue }, buyers { buckets, change, currentValue, previousValue }, buys { buckets, change, currentValue, previousValue }, endTimestamp, sellVolume { buckets, change, currentValue, previousValue }, sellers { buckets, change, currentValue, previousValue }, sells { buckets, change, currentValue, previousValue }, timestamp, traders { buckets, change, currentValue, previousValue }, transactions { buckets, change, currentValue, previousValue }, volume { buckets, change, currentValue, previousValue }, windowSize }, stats_hour1 { buckets { end, start }, buyVolume { buckets, change, currentValue, previousValue }, buyers { buckets, change, currentValue, previousValue }, buys { buckets, change, currentValue, previousValue }, endTimestamp, sellVolume { buckets, change, currentValue, previousValue }, sellers { buckets, change, currentValue, previousValue }, sells { buckets, change, currentValue, previousValue }, timestamp, traders { buckets, change, currentValue, previousValue }, transactions { buckets, change, currentValue, previousValue }, volume { buckets, change, currentValue, previousValue }, windowSize }, stats_hour4 { buckets { end, start }, buyVolume { buckets, change, currentValue, previousValue }, buyers { buckets, change, currentValue, previousValue }, buys { buckets, change, currentValue, previousValue }, endTimestamp, sellVolume { buckets, change, currentValue, previousValue }, sellers { buckets, change, currentValue, previousValue }, sells { buckets, change, currentValue, previousValue }, timestamp, traders { buckets, change, currentValue, previousValue }, transactions { buckets, change, currentValue, previousValue }, volume { buckets, change, currentValue, previousValue }, windowSize }, stats_hour12 { buckets { end, start }, buyVolume { buckets, change, currentValue, previousValue }, buyers { buckets, change, currentValue, previousValue }, buys { buckets, change, currentValue, previousValue }, endTimestamp, sellVolume { buckets, change, currentValue, previousValue }, sellers { buckets, change, currentValue, previousValue }, sells { buckets, change, currentValue, previousValue }, timestamp, traders { buckets, change, currentValue, previousValue }, transactions { buckets, change, currentValue, previousValue }, volume { buckets, change, currentValue, previousValue }, windowSize }, stats_min5 { buckets { end, start }, buyVolume { buckets, change, currentValue, previousValue }, buyers { buckets, change, currentValue, previousValue }, buys { buckets, change, currentValue, previousValue }, endTimestamp, sellVolume { buckets, change, currentValue, previousValue }, sellers { buckets, change, currentValue, previousValue }, sells { buckets, change, currentValue, previousValue }, timestamp, traders { buckets, change, currentValue, previousValue }, transactions { buckets, change, currentValue, previousValue }, volume { buckets, change, currentValue, previousValue }, windowSize }, tokenOfInterest
169
145
  }
170
146
  }`,
171
147
  vars,
172
148
  sink,
173
149
  );
174
- onNftEventsCreated = async (
175
- vars: OnNftEventsCreatedSubscriptionVariables,
176
- sink: Sink<ExecutionResult<OnNftEventsCreatedSubscription>>,
150
+ onBalanceUpdated = async (
151
+ vars: OnBalanceUpdatedSubscriptionVariables,
152
+ sink: Sink<ExecutionResult<OnBalanceUpdatedSubscription>>,
177
153
  ) =>
178
154
  this.sdk.subscribe(
179
- `subscription OnNftEventsCreated($address: String, $networkId: Int) {
180
- onNftEventsCreated (address: $address, networkId: $networkId) {
181
- address, events { aggregatorAddress, blockNumber, contractAddress, eventType, exchangeAddress, fillSource, id, individualPriceNetworkBaseToken, individualPriceUsd, individualTradePrice, logIndex, maker, networkId, numberOfTokens, orderDirection, paymentTokenAddress, poolAddress, priceError, sortKey, taker, timestamp, tokenId, totalPriceNetworkBaseToken, totalPriceUsd, totalTradePrice, tradeOffer { ... on NftEventNftTradeItem { address, amount, recipient, tokenId, type }, ... on NftEventTokenTradeItem { address, amount, individualPriceNetworkBaseToken, individualPriceUsd, individualTradePrice, isPrice, priceError, recipient, totalPriceNetworkBaseToken, totalPriceUsd, totalTradePrice, type } }, tradeReceived { ... on NftEventNftTradeItem { address, amount, recipient, tokenId, type }, ... on NftEventTokenTradeItem { address, amount, individualPriceNetworkBaseToken, individualPriceUsd, individualTradePrice, isPrice, priceError, recipient, totalPriceNetworkBaseToken, totalPriceUsd, totalTradePrice, type } }, transactionHash, transactionIndex }, id, networkId
155
+ `subscription OnBalanceUpdated($walletAddress: String!) {
156
+ onBalanceUpdated (walletAddress: $walletAddress) {
157
+ address, balance, firstHeldTimestamp, networkId, shiftedBalance, tokenAddress, tokenId, walletId
182
158
  }
183
159
  }`,
184
160
  vars,
185
161
  sink,
186
162
  );
187
- onPriceUpdated = async (
188
- vars: OnPriceUpdatedSubscriptionVariables,
189
- sink: Sink<ExecutionResult<OnPriceUpdatedSubscription>>,
163
+ onUnconfirmedBarsUpdated = async (
164
+ vars: OnUnconfirmedBarsUpdatedSubscriptionVariables,
165
+ sink: Sink<ExecutionResult<OnUnconfirmedBarsUpdatedSubscription>>,
190
166
  ) =>
191
167
  this.sdk.subscribe(
192
- `subscription OnPriceUpdated($address: String, $networkId: Int, $sourcePairAddress: String) {
193
- onPriceUpdated (address: $address, networkId: $networkId, sourcePairAddress: $sourcePairAddress) {
194
- address, confidence, networkId, poolAddress, priceUsd, timestamp
168
+ `subscription OnUnconfirmedBarsUpdated($pairId: String, $quoteToken: QuoteToken) {
169
+ onUnconfirmedBarsUpdated (pairId: $pairId, quoteToken: $quoteToken) {
170
+ aggregates { r1 { c, h, l, o, t, v, volume }, r1S { c, h, l, o, t, v, volume }, r5 { c, h, l, o, t, v, volume }, r5S { c, h, l, o, t, v, volume }, r15 { c, h, l, o, t, v, volume }, r15S { c, h, l, o, t, v, volume } }, eventSortKey, networkId, pairAddress, pairId, quoteToken, quoteTokenAddress, timestamp
195
171
  }
196
172
  }`,
197
173
  vars,
198
174
  sink,
199
175
  );
200
- onLatestTokens = async (
201
- vars: OnLatestTokensSubscriptionVariables,
202
- sink: Sink<ExecutionResult<OnLatestTokensSubscription>>,
176
+ onPricesUpdated = async (
177
+ vars: OnPricesUpdatedSubscriptionVariables,
178
+ sink: Sink<ExecutionResult<OnPricesUpdatedSubscription>>,
203
179
  ) =>
204
180
  this.sdk.subscribe(
205
- `subscription OnLatestTokens($id: String, $networkId: Int, $tokenAddress: String) {
206
- onLatestTokens (id: $id, networkId: $networkId, tokenAddress: $tokenAddress) {
207
- blockHash, blockNumber, creatorAddress, creatorBalance, decimals, id, networkId, simulationResults { buyGasUsed, buySuccess, buyTax, canRenounceOwnership, canTransferOwnership, isOwnerRenounced, maxBuyAmount, maxSellAmount, openTradingCall, sellGasUsed, sellSuccess, sellTax }, timeCreated, tokenAddress, tokenName, tokenSymbol, totalSupply, traceIndex, transactionHash, transactionIndex
181
+ `subscription OnPricesUpdated($input: [OnPricesUpdatedInput!]!) {
182
+ onPricesUpdated (input: $input) {
183
+ address, confidence, networkId, poolAddress, priceUsd, timestamp
208
184
  }
209
185
  }`,
210
186
  vars,
211
187
  sink,
212
188
  );
213
- onPairMetadataUpdated = async (
214
- vars: OnPairMetadataUpdatedSubscriptionVariables,
215
- sink: Sink<ExecutionResult<OnPairMetadataUpdatedSubscription>>,
189
+ onSimulateTokenContract = async (
190
+ vars: OnSimulateTokenContractSubscriptionVariables,
191
+ sink: Sink<ExecutionResult<OnSimulateTokenContractSubscription>>,
216
192
  ) =>
217
193
  this.sdk.subscribe(
218
- `subscription OnPairMetadataUpdated($id: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
219
- onPairMetadataUpdated (id: $id, quoteToken: $quoteToken, statsType: $statsType) {
220
- createdAt, enhancedToken0 { address, cmcId, createBlockNumber, createTransactionHash, createdAt, creatorAddress, decimals, exchanges { address, color, exchangeVersion, iconUrl, id, name, networkId, tradeUrl }, freezable, id, info { address, circulatingSupply, cmcId, description, id, imageBannerUrl, imageLargeUrl, imageSmallUrl, imageThumbUrl, isScam, name, networkId, symbol, totalSupply }, isScam, launchpad { completed, completedAt, completedSlot, graduationPercent, migrated, migratedAt, migratedPoolAddress, migratedSlot, poolAddress }, mintable, name, networkId, socialLinks { bitcointalk, blog, coingecko, coinmarketcap, discord, email, facebook, github, instagram, linkedin, reddit, slack, telegram, twitch, twitter, website, wechat, whitepaper, youtube }, symbol }, enhancedToken1 { address, cmcId, createBlockNumber, createTransactionHash, createdAt, creatorAddress, decimals, exchanges { address, color, exchangeVersion, iconUrl, id, name, networkId, tradeUrl }, freezable, id, info { address, circulatingSupply, cmcId, description, id, imageBannerUrl, imageLargeUrl, imageSmallUrl, imageThumbUrl, isScam, name, networkId, symbol, totalSupply }, isScam, launchpad { completed, completedAt, completedSlot, graduationPercent, migrated, migratedAt, migratedPoolAddress, migratedSlot, poolAddress }, mintable, name, networkId, socialLinks { bitcointalk, blog, coingecko, coinmarketcap, discord, email, facebook, github, instagram, linkedin, reddit, slack, telegram, twitch, twitter, website, wechat, whitepaper, youtube }, symbol }, exchangeId, fee, highPrice1, highPrice1w, highPrice4, highPrice5m, highPrice12, highPrice24, id, liquidity, liquidityToken, lowPrice1, lowPrice1w, lowPrice4, lowPrice5m, lowPrice12, lowPrice24, networkId, nonLiquidityToken, pairAddress, price, priceChange1, priceChange1w, priceChange4, priceChange5m, priceChange12, priceChange24, quoteToken, statsType, tickSpacing, token0 { address, decimals, labels { createdAt, subType, type }, name, networkId, pooled, price, symbol }, token1 { address, decimals, labels { createdAt, subType, type }, name, networkId, pooled, price, symbol }, volume1, volume1w, volume4, volume5m, volume12, volume24
194
+ `subscription OnSimulateTokenContract($contractAddress: String, $networkId: Int!, $simulationId: String) {
195
+ onSimulateTokenContract (contractAddress: $contractAddress, networkId: $networkId, simulationId: $simulationId) {
196
+ analysisType, blockNumber, contractBalance { tokenContractEthBalance, tokenContractTokenBalance }, contractHashKey, creator { creatorAddress, creatorEthBalance, creatorTokenBalance }, deploy { deploySuccess, tokenMintedToDeployer }, errors { contractBalanceErrors { tokenContractEthBalanceError, tokenContractTokenBalanceError }, creatorErrors { creatorEthBalanceError, creatorTokenBalanceError }, deployErrors { deployError, tokenMintedToDeployerError }, liquidityErrors { addLiquidityError, lpTotalSupplyError, postLiquidityEnableTradingError, preLiquidityEnableTradingError }, ownerErrors { ownerAddressError, ownerEthBalanceError, ownerTokenBalanceError }, simulatorError, swapErrors { buyError, buyErrorEnum, sellError, sellErrorEnum }, tokenErrors { canRenounceOwnershipError, canTransferOwnershipError, decimalsError, tokenNameError, tokenSymbolError, totalSupplyError }, transferErrors { tokenContractApprovalError, tokenTransferredToContractError, userApprovalError } }, id, liquidity { addLiquiditySuccess, liquiditySetByPreLiquidityOpenTradingCall, lpTotalSupply, pairAddress, postLiquidityEnableTradingCall, postLiquidityEnableTradingSuccess, preLiquidityEnableTradingCall, preLiquidityEnableTradingSuccess, preLiquidityEnableTradingSupportsTransfer }, networkId, owner { ownerAddress, ownerEthBalance, ownerTokenBalance }, sortKey, status, swap { buyGasUsed, buySuccess, buyTax, maxBuyAmount, maxSellAmount, sellGasUsed, sellSuccess, sellTax }, timestamp, token { canRenounceOwnership, canTransferOwnership, contractAddress, decimals, isOwnerRenounced, tokenName, tokenSymbol, totalSupply }, transfer { tokenContractApprovalSuccess, tokenTransferredToContractSuccess, userApprovalSuccess }, uuid, uuidHashKey
221
197
  }
222
198
  }`,
223
199
  vars,
224
200
  sink,
225
201
  );
226
- onSimulateTokenContract = async (
227
- vars: OnSimulateTokenContractSubscriptionVariables,
228
- sink: Sink<ExecutionResult<OnSimulateTokenContractSubscription>>,
202
+ onLaunchpadTokenEventBatch = async (
203
+ vars: OnLaunchpadTokenEventBatchSubscriptionVariables,
204
+ sink: Sink<ExecutionResult<OnLaunchpadTokenEventBatchSubscription>>,
229
205
  ) =>
230
206
  this.sdk.subscribe(
231
- `subscription OnSimulateTokenContract($contractAddress: String, $networkId: Int!, $simulationId: String) {
232
- onSimulateTokenContract (contractAddress: $contractAddress, networkId: $networkId, simulationId: $simulationId) {
233
- analysisType, blockNumber, contractBalance { tokenContractEthBalance, tokenContractTokenBalance }, contractHashKey, creator { creatorAddress, creatorEthBalance, creatorTokenBalance }, deploy { deploySuccess, tokenMintedToDeployer }, errors { contractBalanceErrors { tokenContractEthBalanceError, tokenContractTokenBalanceError }, creatorErrors { creatorEthBalanceError, creatorTokenBalanceError }, deployErrors { deployError, tokenMintedToDeployerError }, liquidityErrors { addLiquidityError, lpTotalSupplyError, postLiquidityEnableTradingError, preLiquidityEnableTradingError }, ownerErrors { ownerAddressError, ownerEthBalanceError, ownerTokenBalanceError }, simulatorError, swapErrors { buyError, buyErrorEnum, sellError, sellErrorEnum }, tokenErrors { canRenounceOwnershipError, canTransferOwnershipError, decimalsError, tokenNameError, tokenSymbolError, totalSupplyError }, transferErrors { tokenContractApprovalError, tokenTransferredToContractError, userApprovalError } }, id, liquidity { addLiquiditySuccess, liquiditySetByPreLiquidityOpenTradingCall, lpTotalSupply, pairAddress, postLiquidityEnableTradingCall, postLiquidityEnableTradingSuccess, preLiquidityEnableTradingCall, preLiquidityEnableTradingSuccess, preLiquidityEnableTradingSupportsTransfer }, networkId, owner { ownerAddress, ownerEthBalance, ownerTokenBalance }, sortKey, status, swap { buyGasUsed, buySuccess, buyTax, maxBuyAmount, maxSellAmount, sellGasUsed, sellSuccess, sellTax }, timestamp, token { canRenounceOwnership, canTransferOwnership, contractAddress, decimals, isOwnerRenounced, tokenName, tokenSymbol, totalSupply }, transfer { tokenContractApprovalSuccess, tokenTransferredToContractSuccess, userApprovalSuccess }, uuid, uuidHashKey
207
+ `subscription OnLaunchpadTokenEventBatch {
208
+ onLaunchpadTokenEventBatch {
209
+ address
210
+ buyCount1
211
+ eventType
212
+ holders
213
+ marketCap
214
+ networkId
215
+ price
216
+ protocol
217
+ sellCount1
218
+ token {
219
+ address
220
+ cmcId
221
+ createBlockNumber
222
+ createTransactionHash
223
+ createdAt
224
+ creatorAddress
225
+ decimals
226
+ exchanges {
227
+ address
228
+ color
229
+ exchangeVersion
230
+ iconUrl
231
+ id
232
+ name
233
+ networkId
234
+ tradeUrl
235
+ }
236
+ freezable
237
+ id
238
+ info {
239
+ address
240
+ circulatingSupply
241
+ cmcId
242
+ description
243
+ id
244
+ imageBannerUrl
245
+ imageLargeUrl
246
+ imageSmallUrl
247
+ imageThumbUrl
248
+ isScam
249
+ name
250
+ networkId
251
+ symbol
252
+ totalSupply
253
+ }
254
+ isScam
255
+ launchpad {
256
+ completed
257
+ completedAt
258
+ completedSlot
259
+ graduationPercent
260
+ launchpadProtocol
261
+ migrated
262
+ migratedAt
263
+ migratedPoolAddress
264
+ migratedSlot
265
+ name
266
+ poolAddress
267
+ }
268
+ mintable
269
+ name
270
+ networkId
271
+ socialLinks {
272
+ bitcointalk
273
+ blog
274
+ coingecko
275
+ coinmarketcap
276
+ discord
277
+ email
278
+ facebook
279
+ github
280
+ instagram
281
+ linkedin
282
+ reddit
283
+ slack
284
+ telegram
285
+ twitch
286
+ twitter
287
+ website
288
+ wechat
289
+ whitepaper
290
+ youtube
291
+ }
292
+ symbol
293
+ }
294
+ transactions1
295
+ volume1
296
+ }
297
+ }
298
+ `,
299
+ vars,
300
+ sink,
301
+ );
302
+ onNftAssetsCreated = async (
303
+ vars: OnNftAssetsCreatedSubscriptionVariables,
304
+ sink: Sink<ExecutionResult<OnNftAssetsCreatedSubscription>>,
305
+ ) =>
306
+ this.sdk.subscribe(
307
+ `subscription OnNftAssetsCreated($address: String, $networkId: Int, $tokenId: String) {
308
+ onNftAssetsCreated (address: $address, networkId: $networkId, tokenId: $tokenId) {
309
+ address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri
234
310
  }
235
311
  }`,
236
312
  vars,
@@ -256,85 +332,111 @@ export class Subscribe {
256
332
  this.sdk.subscribe(
257
333
  `subscription OnEventsCreated($address: String, $id: String, $networkId: Int, $quoteToken: QuoteToken) {
258
334
  onEventsCreated (address: $address, id: $id, networkId: $networkId, quoteToken: $quoteToken) {
259
- address, events { address, baseTokenPrice, blockHash, blockNumber, data { ... on BurnEventData { amount0, amount0Shifted, amount1, amount1Shifted, tickLower, tickUpper, type }, ... on MintEventData { amount0, amount0Shifted, amount1, amount1Shifted, tickLower, tickUpper, type }, ... on PoolBalanceChangedEventData { amount0, amount0Shifted, amount1, amount1Shifted, liquidity0, liquidity1, protocolFeeAmount0, protocolFeeAmount1, sender, token0, token1, type }, ... on SwapEventData { amount0, amount0In, amount0Out, amount1, amount1In, amount1Out, amountNonLiquidityToken, priceBaseToken, priceBaseTokenTotal, priceUsd, priceUsdTotal, tick, type } }, eventDisplayType, eventType, id, labels { sandwich { label, sandwichType, token0DrainedAmount, token1DrainedAmount }, washtrade { label } }, liquidityToken, logIndex, maker, networkId, quoteToken, timestamp, token0Address, token0PoolValueUsd, token0SwapValueUsd, token0ValueBase, token1Address, token1PoolValueUsd, token1SwapValueUsd, token1ValueBase, transactionHash, transactionIndex }, id, networkId, quoteToken
335
+ address, events { address, baseTokenPrice, blockHash, blockNumber, data { ... on BurnEventData { amount0, amount0Shifted, amount1, amount1Shifted, tickLower, tickUpper, type }, ... on MintEventData { amount0, amount0Shifted, amount1, amount1Shifted, tickLower, tickUpper, type }, ... on PoolBalanceChangedEventData { amount0, amount0Shifted, amount1, amount1Shifted, liquidity0, liquidity1, protocolFeeAmount0, protocolFeeAmount1, sender, token0, token1, type }, ... on SwapEventData { amount0, amount0In, amount0Out, amount1, amount1In, amount1Out, amountNonLiquidityToken, priceBaseToken, priceBaseTokenTotal, priceUsd, priceUsdTotal, tick, type } }, eventDisplayType, eventType, id, labels { sandwich { label, sandwichType, token0DrainedAmount, token1DrainedAmount }, washtrade { label } }, liquidityToken, logIndex, maker, networkId, quoteToken, timestamp, token0Address, token0PoolValueUsd, token0SwapValueUsd, token0ValueBase, token1Address, token1PoolValueUsd, token1SwapValueUsd, token1ValueBase, transactionHash, transactionIndex, walletAge }, id, networkId, quoteToken
260
336
  }
261
337
  }`,
262
338
  vars,
263
339
  sink,
264
340
  );
265
- onBarsUpdated = async (
266
- vars: OnBarsUpdatedSubscriptionVariables,
267
- sink: Sink<ExecutionResult<OnBarsUpdatedSubscription>>,
341
+ onNftEventsCreated = async (
342
+ vars: OnNftEventsCreatedSubscriptionVariables,
343
+ sink: Sink<ExecutionResult<OnNftEventsCreatedSubscription>>,
268
344
  ) =>
269
345
  this.sdk.subscribe(
270
- `subscription OnBarsUpdated($pairId: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
271
- onBarsUpdated (pairId: $pairId, quoteToken: $quoteToken, statsType: $statsType) {
272
- aggregates { r1 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r1D { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r1S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r5 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r5S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r7D { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r15 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r15S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r30 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r30S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r60 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r240 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r720 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } } }, eventSortKey, networkId, pairAddress, pairId, quoteToken, quoteTokenAddress, statsType, timestamp
346
+ `subscription OnNftEventsCreated($address: String, $networkId: Int) {
347
+ onNftEventsCreated (address: $address, networkId: $networkId) {
348
+ address, events { aggregatorAddress, blockNumber, contractAddress, eventType, exchangeAddress, fillSource, id, individualPriceNetworkBaseToken, individualPriceUsd, individualTradePrice, logIndex, maker, networkId, numberOfTokens, orderDirection, paymentTokenAddress, poolAddress, priceError, sortKey, taker, timestamp, tokenId, totalPriceNetworkBaseToken, totalPriceUsd, totalTradePrice, tradeOffer { ... on NftEventNftTradeItem { address, amount, recipient, tokenId, type }, ... on NftEventTokenTradeItem { address, amount, individualPriceNetworkBaseToken, individualPriceUsd, individualTradePrice, isPrice, priceError, recipient, totalPriceNetworkBaseToken, totalPriceUsd, totalTradePrice, type } }, tradeReceived { ... on NftEventNftTradeItem { address, amount, recipient, tokenId, type }, ... on NftEventTokenTradeItem { address, amount, individualPriceNetworkBaseToken, individualPriceUsd, individualTradePrice, isPrice, priceError, recipient, totalPriceNetworkBaseToken, totalPriceUsd, totalTradePrice, type } }, transactionHash, transactionIndex }, id, networkId
273
349
  }
274
350
  }`,
275
351
  vars,
276
352
  sink,
277
353
  );
278
- onLaunchpadTokenEvent = async (
279
- vars: OnLaunchpadTokenEventSubscriptionVariables,
280
- sink: Sink<ExecutionResult<OnLaunchpadTokenEventSubscription>>,
354
+ onUnconfirmedEventsCreated = async (
355
+ vars: OnUnconfirmedEventsCreatedSubscriptionVariables,
356
+ sink: Sink<ExecutionResult<OnUnconfirmedEventsCreatedSubscription>>,
281
357
  ) =>
282
358
  this.sdk.subscribe(
283
- `subscription OnLaunchpadTokenEvent($input: OnLaunchpadTokenEventInput) {
284
- onLaunchpadTokenEvent (input: $input) {
285
- address, buyCount1, eventType, holders, marketCap, networkId, price, protocol, sellCount1, token { address, cmcId, createBlockNumber, createTransactionHash, createdAt, creatorAddress, decimals, exchanges { address, color, exchangeVersion, iconUrl, id, name, networkId, tradeUrl }, freezable, id, info { address, circulatingSupply, cmcId, description, id, imageBannerUrl, imageLargeUrl, imageSmallUrl, imageThumbUrl, isScam, name, networkId, symbol, totalSupply }, isScam, launchpad { completed, completedAt, completedSlot, graduationPercent, migrated, migratedAt, migratedPoolAddress, migratedSlot, poolAddress }, mintable, name, networkId, socialLinks { bitcointalk, blog, coingecko, coinmarketcap, discord, email, facebook, github, instagram, linkedin, reddit, slack, telegram, twitch, twitter, website, wechat, whitepaper, youtube }, symbol }, transactions1, volume1
359
+ `subscription OnUnconfirmedEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
360
+ onUnconfirmedEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
361
+ address, events { address, blockHash, blockNumber, data { ... on UnconfirmedLiquidityChangeEventData { amount0, amount0Shifted, amount1, amount1Shifted, type }, ... on UnconfirmedSwapEventData { amountBaseToken, amountNonLiquidityToken, priceBaseToken, priceBaseTokenTotal, priceUsd, priceUsdTotal, type } }, eventDisplayType, eventType, id, logIndex, maker, networkId, quoteToken, supplementalIndex, timestamp, transactionHash, transactionIndex }, id, networkId, quoteToken
286
362
  }
287
363
  }`,
288
364
  vars,
289
365
  sink,
290
366
  );
291
- onNftAssetsCreated = async (
292
- vars: OnNftAssetsCreatedSubscriptionVariables,
293
- sink: Sink<ExecutionResult<OnNftAssetsCreatedSubscription>>,
367
+ onPriceUpdated = async (
368
+ vars: OnPriceUpdatedSubscriptionVariables,
369
+ sink: Sink<ExecutionResult<OnPriceUpdatedSubscription>>,
294
370
  ) =>
295
371
  this.sdk.subscribe(
296
- `subscription OnNftAssetsCreated($address: String, $networkId: Int, $tokenId: String) {
297
- onNftAssetsCreated (address: $address, networkId: $networkId, tokenId: $tokenId) {
298
- address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri
372
+ `subscription OnPriceUpdated($address: String, $networkId: Int, $sourcePairAddress: String) {
373
+ onPriceUpdated (address: $address, networkId: $networkId, sourcePairAddress: $sourcePairAddress) {
374
+ address, confidence, networkId, poolAddress, priceUsd, timestamp
299
375
  }
300
376
  }`,
301
377
  vars,
302
378
  sink,
303
379
  );
304
- onDetailedStatsUpdated = async (
305
- vars: OnDetailedStatsUpdatedSubscriptionVariables,
306
- sink: Sink<ExecutionResult<OnDetailedStatsUpdatedSubscription>>,
380
+ onNftPoolEventsCreated = async (
381
+ vars: OnNftPoolEventsCreatedSubscriptionVariables,
382
+ sink: Sink<ExecutionResult<OnNftPoolEventsCreatedSubscription>>,
307
383
  ) =>
308
384
  this.sdk.subscribe(
309
- `subscription OnDetailedStatsUpdated($pairId: String, $statsType: TokenPairStatisticsType, $tokenOfInterest: TokenOfInterest) {
310
- onDetailedStatsUpdated (pairId: $pairId, statsType: $statsType, tokenOfInterest: $tokenOfInterest) {
311
- bucketCount, pairId, queryTimestamp, statsType, stats_day1 { buckets { end, start }, buyVolume { buckets, change, currentValue, previousValue }, buyers { buckets, change, currentValue, previousValue }, buys { buckets, change, currentValue, previousValue }, endTimestamp, sellVolume { buckets, change, currentValue, previousValue }, sellers { buckets, change, currentValue, previousValue }, sells { buckets, change, currentValue, previousValue }, timestamp, traders { buckets, change, currentValue, previousValue }, transactions { buckets, change, currentValue, previousValue }, volume { buckets, change, currentValue, previousValue }, windowSize }, stats_hour1 { buckets { end, start }, buyVolume { buckets, change, currentValue, previousValue }, buyers { buckets, change, currentValue, previousValue }, buys { buckets, change, currentValue, previousValue }, endTimestamp, sellVolume { buckets, change, currentValue, previousValue }, sellers { buckets, change, currentValue, previousValue }, sells { buckets, change, currentValue, previousValue }, timestamp, traders { buckets, change, currentValue, previousValue }, transactions { buckets, change, currentValue, previousValue }, volume { buckets, change, currentValue, previousValue }, windowSize }, stats_hour4 { buckets { end, start }, buyVolume { buckets, change, currentValue, previousValue }, buyers { buckets, change, currentValue, previousValue }, buys { buckets, change, currentValue, previousValue }, endTimestamp, sellVolume { buckets, change, currentValue, previousValue }, sellers { buckets, change, currentValue, previousValue }, sells { buckets, change, currentValue, previousValue }, timestamp, traders { buckets, change, currentValue, previousValue }, transactions { buckets, change, currentValue, previousValue }, volume { buckets, change, currentValue, previousValue }, windowSize }, stats_hour12 { buckets { end, start }, buyVolume { buckets, change, currentValue, previousValue }, buyers { buckets, change, currentValue, previousValue }, buys { buckets, change, currentValue, previousValue }, endTimestamp, sellVolume { buckets, change, currentValue, previousValue }, sellers { buckets, change, currentValue, previousValue }, sells { buckets, change, currentValue, previousValue }, timestamp, traders { buckets, change, currentValue, previousValue }, transactions { buckets, change, currentValue, previousValue }, volume { buckets, change, currentValue, previousValue }, windowSize }, stats_min5 { buckets { end, start }, buyVolume { buckets, change, currentValue, previousValue }, buyers { buckets, change, currentValue, previousValue }, buys { buckets, change, currentValue, previousValue }, endTimestamp, sellVolume { buckets, change, currentValue, previousValue }, sellers { buckets, change, currentValue, previousValue }, sells { buckets, change, currentValue, previousValue }, timestamp, traders { buckets, change, currentValue, previousValue }, transactions { buckets, change, currentValue, previousValue }, volume { buckets, change, currentValue, previousValue }, windowSize }, tokenOfInterest
385
+ `subscription OnNftPoolEventsCreated($collectionAddress: String, $exchangeAddress: String, $networkId: Int, $poolAddress: String) {
386
+ onNftPoolEventsCreated (collectionAddress: $collectionAddress, exchangeAddress: $exchangeAddress, networkId: $networkId, poolAddress: $poolAddress) {
387
+ collectionAddress, events { blockHash, blockNumber, collectionAddress, collectionId, data { ... on NewPoolEventData { assetRecipientAddress, bondingCurveAddress, bondingCurveType, buyPriceT, collectionAddress, createdAt, delta, feeAmountT, nbtRatio, networkId, nftTokenBalance, ownerAddress, poolAddress, sellPriceT, startPriceT, tokenAddress, tokenBalanceT, type, usdRatio }, ... on NewPoolEventDataV2 { assetRecipientAddress, bondingCurveAddress, bondingCurveType, buyPriceT, collectionAddress, createdAt, delta, feeAmountT, nbtRatio, networkId, nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftTokenIds, nftTokenQuantities, ownerAddress, poolAddress, poolNftType, propertyChecker, royalties { percent, recipient }, sellPriceT, startPriceT, tokenAddress, tokenBalanceT, type, usdRatio }, ... on NftPoolAssetRecipientUpdateEventData { newAssetRecipient, type }, ... on NftPoolDeltaUpdateEventData { newDelta, type }, ... on NftPoolFeeUpdateEventData { nbtRatio, newFeeT, type, usdRatio }, ... on NftPoolNftDepositEventData { nftTokenBalance, nftTokenIds, tokenBalanceT, type }, ... on NftPoolNftDepositEventDataV2 { nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftTokenAmounts, nftTokenIds, tokenBalanceT, type }, ... on NftPoolNftWithdrawalEventData { nftTokenBalance, nftTokenIds, tokenBalanceT, type }, ... on NftPoolNftWithdrawalEventDataV2 { nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftTokenAmounts, nftTokenIds, tokenBalanceT, type }, ... on NftPoolOwnershipTransferredEventDataV2 { newOwner, type }, ... on NftPoolSpotPriceUpdateEventData { nbtRatio, newBuyPriceT, newSellPriceT, newSpotPriceT, type, usdRatio }, ... on NftPoolSpotPriceUpdateEventDataV2 { nbtRatio, newBuyPriceT, newSellPriceT, newSpotPriceT, type, usdRatio }, ... on NftPoolTokenDepositEventData { amountT, nbtRatio, nftTokenBalance, tokenBalanceT, type, usdRatio }, ... on NftPoolTokenDepositEventDataV2 { amountT, nbtRatio, tokenBalanceT, type, usdRatio }, ... on NftPoolTokenWithdrawalEventData { amountT, nbtRatio, nftTokenBalance, tokenBalanceT, type, usdRatio }, ... on NftPoolTokenWithdrawalEventDataV2 { amountT, nbtRatio, tokenBalanceT, type, usdRatio }, ... on SwapNftInPoolEventData { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftTokenBalance, nftsTransfered { amountT, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio }, ... on SwapNftInPoolEventDataV2 { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftsTransfered { amountT, nftQuantity, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio }, ... on SwapNftOutPoolEventData { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftTokenBalance, nftsTransfered { amountT, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio }, ... on SwapNftOutPoolEventDataV2 { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftsTransfered { amountT, nftQuantity, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio } }, eventType, exchangeAddress, id, logIndex, maker, networkId, poolAddress, poolType, timestamp, tokenAddress, transactionHash, transactionIndex }, exchangeAddress, id, networkId, poolAddress
312
388
  }
313
389
  }`,
314
390
  vars,
315
391
  sink,
316
392
  );
317
- onBalanceUpdated = async (
318
- vars: OnBalanceUpdatedSubscriptionVariables,
319
- sink: Sink<ExecutionResult<OnBalanceUpdatedSubscription>>,
393
+ onHoldersUpdated = async (
394
+ vars: OnHoldersUpdatedSubscriptionVariables,
395
+ sink: Sink<ExecutionResult<OnHoldersUpdatedSubscription>>,
320
396
  ) =>
321
397
  this.sdk.subscribe(
322
- `subscription OnBalanceUpdated($walletAddress: String!) {
323
- onBalanceUpdated (walletAddress: $walletAddress) {
324
- address, balance, firstHeldTimestamp, networkId, shiftedBalance, tokenAddress, tokenId, walletId
398
+ `subscription OnHoldersUpdated($tokenId: String!) {
399
+ onHoldersUpdated (tokenId: $tokenId) {
400
+ balances { address, balance, firstHeldTimestamp, networkId, shiftedBalance, tokenAddress, tokenId, walletId }, holders, networkId, tokenAddress, tokenId
325
401
  }
326
402
  }`,
327
403
  vars,
328
404
  sink,
329
405
  );
330
- onPricesUpdated = async (
331
- vars: OnPricesUpdatedSubscriptionVariables,
332
- sink: Sink<ExecutionResult<OnPricesUpdatedSubscription>>,
406
+ onBarsUpdated = async (
407
+ vars: OnBarsUpdatedSubscriptionVariables,
408
+ sink: Sink<ExecutionResult<OnBarsUpdatedSubscription>>,
333
409
  ) =>
334
410
  this.sdk.subscribe(
335
- `subscription OnPricesUpdated($input: [OnPricesUpdatedInput!]!) {
336
- onPricesUpdated (input: $input) {
337
- address, confidence, networkId, poolAddress, priceUsd, timestamp
411
+ `subscription OnBarsUpdated($pairId: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
412
+ onBarsUpdated (pairId: $pairId, quoteToken: $quoteToken, statsType: $statsType) {
413
+ aggregates { r1 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r1D { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r1S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r5 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r5S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r7D { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r15 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r15S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r30 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r30S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r60 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r240 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r720 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } } }, eventSortKey, networkId, pairAddress, pairId, quoteToken, quoteTokenAddress, statsType, timestamp
414
+ }
415
+ }`,
416
+ vars,
417
+ sink,
418
+ );
419
+ onTokenEventsCreated = async (
420
+ vars: OnTokenEventsCreatedSubscriptionVariables,
421
+ sink: Sink<ExecutionResult<OnTokenEventsCreatedSubscription>>,
422
+ ) =>
423
+ this.sdk.subscribe(
424
+ `subscription OnTokenEventsCreated($input: OnTokenEventsCreatedInput!) {
425
+ onTokenEventsCreated (input: $input) {
426
+ events { address, baseTokenPrice, blockHash, blockNumber, data { ... on BurnEventData { amount0, amount0Shifted, amount1, amount1Shifted, tickLower, tickUpper, type }, ... on MintEventData { amount0, amount0Shifted, amount1, amount1Shifted, tickLower, tickUpper, type }, ... on PoolBalanceChangedEventData { amount0, amount0Shifted, amount1, amount1Shifted, liquidity0, liquidity1, protocolFeeAmount0, protocolFeeAmount1, sender, token0, token1, type }, ... on SwapEventData { amount0, amount0In, amount0Out, amount1, amount1In, amount1Out, amountNonLiquidityToken, priceBaseToken, priceBaseTokenTotal, priceUsd, priceUsdTotal, tick, type } }, eventDisplayType, eventType, id, labels { sandwich { label, sandwichType, token0DrainedAmount, token1DrainedAmount }, washtrade { label } }, liquidityToken, logIndex, maker, networkId, quoteToken, timestamp, token0Address, token0PoolValueUsd, token0SwapValueUsd, token0ValueBase, token1Address, token1PoolValueUsd, token1SwapValueUsd, token1ValueBase, transactionHash, transactionIndex, walletAge }, id
427
+ }
428
+ }`,
429
+ vars,
430
+ sink,
431
+ );
432
+ onPairMetadataUpdated = async (
433
+ vars: OnPairMetadataUpdatedSubscriptionVariables,
434
+ sink: Sink<ExecutionResult<OnPairMetadataUpdatedSubscription>>,
435
+ ) =>
436
+ this.sdk.subscribe(
437
+ `subscription OnPairMetadataUpdated($id: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
438
+ onPairMetadataUpdated (id: $id, quoteToken: $quoteToken, statsType: $statsType) {
439
+ createdAt, enhancedToken0 { address, cmcId, createBlockNumber, createTransactionHash, createdAt, creatorAddress, decimals, exchanges { address, color, exchangeVersion, iconUrl, id, name, networkId, tradeUrl }, freezable, id, info { address, circulatingSupply, cmcId, description, id, imageBannerUrl, imageLargeUrl, imageSmallUrl, imageThumbUrl, isScam, name, networkId, symbol, totalSupply }, isScam, launchpad { completed, completedAt, completedSlot, graduationPercent, launchpadProtocol, migrated, migratedAt, migratedPoolAddress, migratedSlot, name, poolAddress }, mintable, name, networkId, socialLinks { bitcointalk, blog, coingecko, coinmarketcap, discord, email, facebook, github, instagram, linkedin, reddit, slack, telegram, twitch, twitter, website, wechat, whitepaper, youtube }, symbol }, enhancedToken1 { address, cmcId, createBlockNumber, createTransactionHash, createdAt, creatorAddress, decimals, exchanges { address, color, exchangeVersion, iconUrl, id, name, networkId, tradeUrl }, freezable, id, info { address, circulatingSupply, cmcId, description, id, imageBannerUrl, imageLargeUrl, imageSmallUrl, imageThumbUrl, isScam, name, networkId, symbol, totalSupply }, isScam, launchpad { completed, completedAt, completedSlot, graduationPercent, launchpadProtocol, migrated, migratedAt, migratedPoolAddress, migratedSlot, name, poolAddress }, mintable, name, networkId, socialLinks { bitcointalk, blog, coingecko, coinmarketcap, discord, email, facebook, github, instagram, linkedin, reddit, slack, telegram, twitch, twitter, website, wechat, whitepaper, youtube }, symbol }, exchangeId, fee, highPrice1, highPrice1w, highPrice4, highPrice5m, highPrice12, highPrice24, id, liquidity, liquidityToken, lowPrice1, lowPrice1w, lowPrice4, lowPrice5m, lowPrice12, lowPrice24, networkId, nonLiquidityToken, pairAddress, price, priceChange1, priceChange1w, priceChange4, priceChange5m, priceChange12, priceChange24, quoteToken, statsType, tickSpacing, token0 { address, decimals, labels { createdAt, subType, type }, name, networkId, pooled, price, symbol }, token1 { address, decimals, labels { createdAt, subType, type }, name, networkId, pooled, price, symbol }, volume1, volume1w, volume4, volume5m, volume12, volume24
338
440
  }
339
441
  }`,
340
442
  vars,