@codex-data/sdk 1.0.8 → 1.0.10

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 (55) hide show
  1. package/dist/resources/graphql.d.ts +177 -6
  2. package/dist/resources/graphql.d.ts.map +1 -1
  3. package/dist/resources/graphql.js +10 -2
  4. package/dist/resources/graphql.js.map +1 -1
  5. package/dist/sdk/Mutation.d.ts +2 -2
  6. package/dist/sdk/Mutation.d.ts.map +1 -1
  7. package/dist/sdk/Mutation.js +2 -2
  8. package/dist/sdk/Mutation.js.map +1 -1
  9. package/dist/sdk/Query.d.ts +52 -52
  10. package/dist/sdk/Query.d.ts.map +1 -1
  11. package/dist/sdk/Query.js +51 -51
  12. package/dist/sdk/Query.js.map +1 -1
  13. package/dist/sdk/Subscribe.d.ts +19 -17
  14. package/dist/sdk/Subscribe.d.ts.map +1 -1
  15. package/dist/sdk/Subscribe.js +133 -119
  16. package/dist/sdk/Subscribe.js.map +1 -1
  17. package/dist/sdk/generated/gql.d.ts +44 -29
  18. package/dist/sdk/generated/gql.d.ts.map +1 -1
  19. package/dist/sdk/generated/gql.js +13 -11
  20. package/dist/sdk/generated/gql.js.map +1 -1
  21. package/dist/sdk/generated/graphql.d.ts +792 -72
  22. package/dist/sdk/generated/graphql.d.ts.map +1 -1
  23. package/dist/sdk/generated/graphql.js +25 -15
  24. package/dist/sdk/generated/graphql.js.map +1 -1
  25. package/dist/sdk/index.d.ts +45 -0
  26. package/dist/sdk/index.d.ts.map +1 -1
  27. package/dist/sdk/index.js +83 -5
  28. package/dist/sdk/index.js.map +1 -1
  29. package/dist/sdk/index.test.js +232 -7
  30. package/dist/sdk/index.test.js.map +1 -1
  31. package/package.json +1 -1
  32. package/src/resources/generated_queries/Balances.graphql +78 -0
  33. package/src/resources/generated_queries/GetTokenEvents.graphql +1 -0
  34. package/src/resources/generated_queries/GetTokenEventsForMaker.graphql +1 -0
  35. package/src/resources/generated_queries/Holders.graphql +78 -0
  36. package/src/resources/generated_queries/LiquidityLocks.graphql +7 -1
  37. package/src/resources/generated_queries/LiquidityMetadataByToken.graphql +19 -0
  38. package/src/resources/generated_queries/PrimeHolders.graphql +78 -0
  39. package/src/resources/generated_subscriptions/OnBalanceUpdated.graphql +78 -0
  40. package/src/resources/generated_subscriptions/OnEventsCreated.graphql +3 -0
  41. package/src/resources/generated_subscriptions/OnEventsCreatedByMaker.graphql +92 -0
  42. package/src/resources/generated_subscriptions/OnHoldersUpdated.graphql +78 -0
  43. package/src/resources/generated_subscriptions/OnTokenEventsCreated.graphql +1 -0
  44. package/src/resources/generated_subscriptions/OnUnconfirmedEventsCreatedByMaker.graphql +41 -0
  45. package/src/resources/graphql.schema.json +1219 -129
  46. package/src/resources/graphql.ts +195 -6
  47. package/src/resources/schema.graphql +250 -6
  48. package/src/sdk/Mutation.ts +4 -4
  49. package/src/sdk/Query.ts +109 -108
  50. package/src/sdk/Subscribe.ts +225 -195
  51. package/src/sdk/generated/gql.ts +34 -24
  52. package/src/sdk/generated/graphql.ts +245 -39
  53. package/src/sdk/index.test.ts +361 -10
  54. package/src/sdk/index.ts +89 -6
  55. package/src/resources/generated_queries/ListTopTokens.graphql +0 -55
@@ -10,6 +10,8 @@ import {
10
10
  OnDetailedStatsUpdatedSubscriptionVariables,
11
11
  OnEventLabelCreatedSubscription,
12
12
  OnEventLabelCreatedSubscriptionVariables,
13
+ OnEventsCreatedByMakerSubscription,
14
+ OnEventsCreatedByMakerSubscriptionVariables,
13
15
  OnEventsCreatedSubscription,
14
16
  OnEventsCreatedSubscriptionVariables,
15
17
  OnHoldersUpdatedSubscription,
@@ -44,6 +46,8 @@ import {
44
46
  OnTokenLifecycleEventsCreatedSubscriptionVariables,
45
47
  OnUnconfirmedBarsUpdatedSubscription,
46
48
  OnUnconfirmedBarsUpdatedSubscriptionVariables,
49
+ OnUnconfirmedEventsCreatedByMakerSubscription,
50
+ OnUnconfirmedEventsCreatedByMakerSubscriptionVariables,
47
51
  OnUnconfirmedEventsCreatedSubscription,
48
52
  OnUnconfirmedEventsCreatedSubscriptionVariables,
49
53
  } from "./generated/graphql";
@@ -51,27 +55,14 @@ import { Codex } from "./index";
51
55
 
52
56
  export class Subscribe {
53
57
  constructor(private sdk: Codex) {}
54
- onLaunchpadTokenEvent = async (
55
- vars: OnLaunchpadTokenEventSubscriptionVariables,
56
- sink: Sink<ExecutionResult<OnLaunchpadTokenEventSubscription>>,
57
- ) =>
58
- this.sdk.subscribe(
59
- `subscription OnLaunchpadTokenEvent($input: OnLaunchpadTokenEventInput) {
60
- onLaunchpadTokenEvent (input: $input) {
61
- 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, launchpadName, launchpadProtocol, 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
62
- }
63
- }`,
64
- vars,
65
- sink,
66
- );
67
- onNftEventsCreated = async (
68
- vars: OnNftEventsCreatedSubscriptionVariables,
69
- sink: Sink<ExecutionResult<OnNftEventsCreatedSubscription>>,
58
+ onPriceUpdated = async (
59
+ vars: OnPriceUpdatedSubscriptionVariables,
60
+ sink: Sink<ExecutionResult<OnPriceUpdatedSubscription>>,
70
61
  ) =>
71
62
  this.sdk.subscribe(
72
- `subscription OnNftEventsCreated($address: String, $networkId: Int) {
73
- onNftEventsCreated (address: $address, networkId: $networkId) {
74
- 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
63
+ `subscription OnPriceUpdated($address: String, $networkId: Int, $sourcePairAddress: String) {
64
+ onPriceUpdated (address: $address, networkId: $networkId, sourcePairAddress: $sourcePairAddress) {
65
+ address, confidence, networkId, poolAddress, priceUsd, timestamp
75
66
  }
76
67
  }`,
77
68
  vars,
@@ -90,110 +81,14 @@ export class Subscribe {
90
81
  vars,
91
82
  sink,
92
83
  );
93
- onSimulateTokenContract = async (
94
- vars: OnSimulateTokenContractSubscriptionVariables,
95
- sink: Sink<ExecutionResult<OnSimulateTokenContractSubscription>>,
96
- ) =>
97
- this.sdk.subscribe(
98
- `subscription OnSimulateTokenContract($contractAddress: String, $networkId: Int!, $simulationId: String) {
99
- onSimulateTokenContract (contractAddress: $contractAddress, networkId: $networkId, simulationId: $simulationId) {
100
- 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
101
- }
102
- }`,
103
- vars,
104
- sink,
105
- );
106
- onBarsUpdated = async (
107
- vars: OnBarsUpdatedSubscriptionVariables,
108
- sink: Sink<ExecutionResult<OnBarsUpdatedSubscription>>,
109
- ) =>
110
- this.sdk.subscribe(
111
- `subscription OnBarsUpdated($pairId: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
112
- onBarsUpdated (pairId: $pairId, quoteToken: $quoteToken, statsType: $statsType) {
113
- 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
114
- }
115
- }`,
116
- vars,
117
- sink,
118
- );
119
- onEventLabelCreated = async (
120
- vars: OnEventLabelCreatedSubscriptionVariables,
121
- sink: Sink<ExecutionResult<OnEventLabelCreatedSubscription>>,
122
- ) =>
123
- this.sdk.subscribe(
124
- `subscription OnEventLabelCreated($id: String) {
125
- onEventLabelCreated(id: $id) {
126
- data {
127
- ... on FrontRunLabelData {
128
- index
129
- token0DrainedAmount
130
- token1DrainedAmount
131
- }
132
- ... on SandwichedLabelData {
133
- token0DrainedAmountSandwich: token0DrainedAmount
134
- token1DrainedAmountSandwich: token1DrainedAmount
135
- }
136
- }
137
- id
138
- label
139
- logIndex
140
- networkId
141
- timestamp
142
- transactionHash
143
- transactionIndex
144
- }
145
- }
146
- `,
147
- vars,
148
- sink,
149
- );
150
- onNftPoolEventsCreated = async (
151
- vars: OnNftPoolEventsCreatedSubscriptionVariables,
152
- sink: Sink<ExecutionResult<OnNftPoolEventsCreatedSubscription>>,
153
- ) =>
154
- this.sdk.subscribe(
155
- `subscription OnNftPoolEventsCreated($collectionAddress: String, $exchangeAddress: String, $networkId: Int, $poolAddress: String) {
156
- onNftPoolEventsCreated (collectionAddress: $collectionAddress, exchangeAddress: $exchangeAddress, networkId: $networkId, poolAddress: $poolAddress) {
157
- 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
158
- }
159
- }`,
160
- vars,
161
- sink,
162
- );
163
- onDetailedStatsUpdated = async (
164
- vars: OnDetailedStatsUpdatedSubscriptionVariables,
165
- sink: Sink<ExecutionResult<OnDetailedStatsUpdatedSubscription>>,
166
- ) =>
167
- this.sdk.subscribe(
168
- `subscription OnDetailedStatsUpdated($pairId: String, $statsType: TokenPairStatisticsType, $tokenOfInterest: TokenOfInterest) {
169
- onDetailedStatsUpdated (pairId: $pairId, statsType: $statsType, tokenOfInterest: $tokenOfInterest) {
170
- 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
171
- }
172
- }`,
173
- vars,
174
- sink,
175
- );
176
- onUnconfirmedEventsCreated = async (
177
- vars: OnUnconfirmedEventsCreatedSubscriptionVariables,
178
- sink: Sink<ExecutionResult<OnUnconfirmedEventsCreatedSubscription>>,
179
- ) =>
180
- this.sdk.subscribe(
181
- `subscription OnUnconfirmedEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
182
- onUnconfirmedEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
183
- 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
184
- }
185
- }`,
186
- vars,
187
- sink,
188
- );
189
- onLatestPairUpdated = async (
190
- vars: OnLatestPairUpdatedSubscriptionVariables,
191
- sink: Sink<ExecutionResult<OnLatestPairUpdatedSubscription>>,
84
+ onBalanceUpdated = async (
85
+ vars: OnBalanceUpdatedSubscriptionVariables,
86
+ sink: Sink<ExecutionResult<OnBalanceUpdatedSubscription>>,
192
87
  ) =>
193
88
  this.sdk.subscribe(
194
- `subscription OnLatestPairUpdated($id: String, $networkId: Int) {
195
- onLatestPairUpdated (id: $id, networkId: $networkId) {
196
- address, exchangeHash, id, initialPriceUsd, liquidAt, liquidity, liquidityToken, networkId, newToken, nonLiquidityToken, oldToken, priceChange, priceUsd, token0 { address, currentPoolAmount, decimals, id, initialPoolAmount, name, networkId, pairId, poolVariation, symbol }, token1 { address, currentPoolAmount, decimals, id, initialPoolAmount, name, networkId, pairId, poolVariation, symbol }, transactionHash
89
+ `subscription OnBalanceUpdated($walletAddress: String!) {
90
+ onBalanceUpdated (walletAddress: $walletAddress) {
91
+ address, balance, balanceUsd, firstHeldTimestamp, networkId, shiftedBalance, 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, launchpadName, launchpadProtocol, 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 }, tokenAddress, tokenId, tokenPriceUsd, walletId
197
92
  }
198
93
  }`,
199
94
  vars,
@@ -208,19 +103,6 @@ export class Subscribe {
208
103
  onTokenBarsUpdated (networkId: $networkId, statsType: $statsType, tokenId: $tokenId) {
209
104
  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
210
105
  }
211
- }`,
212
- vars,
213
- sink,
214
- );
215
- onPairMetadataUpdated = async (
216
- vars: OnPairMetadataUpdatedSubscriptionVariables,
217
- sink: Sink<ExecutionResult<OnPairMetadataUpdatedSubscription>>,
218
- ) =>
219
- this.sdk.subscribe(
220
- `subscription OnPairMetadataUpdated($id: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
221
- onPairMetadataUpdated (id: $id, quoteToken: $quoteToken, statsType: $statsType) {
222
- 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, launchpadName, launchpadProtocol, 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, launchpadName, launchpadProtocol, 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
223
- }
224
106
  }`,
225
107
  vars,
226
108
  sink,
@@ -230,48 +112,9 @@ export class Subscribe {
230
112
  sink: Sink<ExecutionResult<OnEventsCreatedSubscription>>,
231
113
  ) =>
232
114
  this.sdk.subscribe(
233
- `subscription OnEventsCreated($address: String, $id: String, $networkId: Int, $quoteToken: QuoteToken) {
234
- onEventsCreated (address: $address, id: $id, networkId: $networkId, quoteToken: $quoteToken) {
235
- 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
236
- }
237
- }`,
238
- vars,
239
- sink,
240
- );
241
- onUnconfirmedBarsUpdated = async (
242
- vars: OnUnconfirmedBarsUpdatedSubscriptionVariables,
243
- sink: Sink<ExecutionResult<OnUnconfirmedBarsUpdatedSubscription>>,
244
- ) =>
245
- this.sdk.subscribe(
246
- `subscription OnUnconfirmedBarsUpdated($pairId: String, $quoteToken: QuoteToken) {
247
- onUnconfirmedBarsUpdated (pairId: $pairId, quoteToken: $quoteToken) {
248
- 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
249
- }
250
- }`,
251
- vars,
252
- sink,
253
- );
254
- onPricesUpdated = async (
255
- vars: OnPricesUpdatedSubscriptionVariables,
256
- sink: Sink<ExecutionResult<OnPricesUpdatedSubscription>>,
257
- ) =>
258
- this.sdk.subscribe(
259
- `subscription OnPricesUpdated($input: [OnPricesUpdatedInput!]!) {
260
- onPricesUpdated (input: $input) {
261
- address, confidence, networkId, poolAddress, priceUsd, timestamp
262
- }
263
- }`,
264
- vars,
265
- sink,
266
- );
267
- onPriceUpdated = async (
268
- vars: OnPriceUpdatedSubscriptionVariables,
269
- sink: Sink<ExecutionResult<OnPriceUpdatedSubscription>>,
270
- ) =>
271
- this.sdk.subscribe(
272
- `subscription OnPriceUpdated($address: String, $networkId: Int, $sourcePairAddress: String) {
273
- onPriceUpdated (address: $address, networkId: $networkId, sourcePairAddress: $sourcePairAddress) {
274
- address, confidence, networkId, poolAddress, priceUsd, timestamp
115
+ `subscription OnEventsCreated($address: String, $id: String, $maker: String, $networkId: Int, $quoteToken: QuoteToken) {
116
+ onEventsCreated (address: $address, id: $id, maker: $maker, networkId: $networkId, quoteToken: $quoteToken) {
117
+ 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, walletLabels }, id, networkId, quoteToken
275
118
  }
276
119
  }`,
277
120
  vars,
@@ -377,27 +220,40 @@ export class Subscribe {
377
220
  vars,
378
221
  sink,
379
222
  );
380
- onTokenLifecycleEventsCreated = async (
381
- vars: OnTokenLifecycleEventsCreatedSubscriptionVariables,
382
- sink: Sink<ExecutionResult<OnTokenLifecycleEventsCreatedSubscription>>,
223
+ onUnconfirmedBarsUpdated = async (
224
+ vars: OnUnconfirmedBarsUpdatedSubscriptionVariables,
225
+ sink: Sink<ExecutionResult<OnUnconfirmedBarsUpdatedSubscription>>,
383
226
  ) =>
384
227
  this.sdk.subscribe(
385
- `subscription OnTokenLifecycleEventsCreated($address: String, $networkId: Int) {
386
- onTokenLifecycleEventsCreated (address: $address, networkId: $networkId) {
387
- events { blockHash, blockNumber, data { ... on TokenBurnEventData { amount, circulatingSupply, totalSupply }, ... on TokenMintEventData { amount, circulatingSupply, totalSupply } }, eventType, id, logIndex, maker, networkId, timestamp, tokenAddress, transactionHash, transactionIndex }, id
228
+ `subscription OnUnconfirmedBarsUpdated($pairId: String, $quoteToken: QuoteToken) {
229
+ onUnconfirmedBarsUpdated (pairId: $pairId, quoteToken: $quoteToken) {
230
+ 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
388
231
  }
389
232
  }`,
390
233
  vars,
391
234
  sink,
392
235
  );
393
- onHoldersUpdated = async (
394
- vars: OnHoldersUpdatedSubscriptionVariables,
395
- sink: Sink<ExecutionResult<OnHoldersUpdatedSubscription>>,
236
+ onNftPoolEventsCreated = async (
237
+ vars: OnNftPoolEventsCreatedSubscriptionVariables,
238
+ sink: Sink<ExecutionResult<OnNftPoolEventsCreatedSubscription>>,
396
239
  ) =>
397
240
  this.sdk.subscribe(
398
- `subscription OnHoldersUpdated($tokenId: String!) {
399
- onHoldersUpdated (tokenId: $tokenId) {
400
- balances { address, balance, firstHeldTimestamp, networkId, shiftedBalance, tokenAddress, tokenId, walletId }, holders, networkId, tokenAddress, tokenId
241
+ `subscription OnNftPoolEventsCreated($collectionAddress: String, $exchangeAddress: String, $networkId: Int, $poolAddress: String) {
242
+ onNftPoolEventsCreated (collectionAddress: $collectionAddress, exchangeAddress: $exchangeAddress, networkId: $networkId, poolAddress: $poolAddress) {
243
+ 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
244
+ }
245
+ }`,
246
+ vars,
247
+ sink,
248
+ );
249
+ onLaunchpadTokenEvent = async (
250
+ vars: OnLaunchpadTokenEventSubscriptionVariables,
251
+ sink: Sink<ExecutionResult<OnLaunchpadTokenEventSubscription>>,
252
+ ) =>
253
+ this.sdk.subscribe(
254
+ `subscription OnLaunchpadTokenEvent($input: OnLaunchpadTokenEventInput) {
255
+ onLaunchpadTokenEvent (input: $input) {
256
+ 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, launchpadName, launchpadProtocol, 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
401
257
  }
402
258
  }`,
403
259
  vars,
@@ -412,6 +268,45 @@ export class Subscribe {
412
268
  onLatestTokens (id: $id, networkId: $networkId, tokenAddress: $tokenAddress) {
413
269
  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
414
270
  }
271
+ }`,
272
+ vars,
273
+ sink,
274
+ );
275
+ onLatestPairUpdated = async (
276
+ vars: OnLatestPairUpdatedSubscriptionVariables,
277
+ sink: Sink<ExecutionResult<OnLatestPairUpdatedSubscription>>,
278
+ ) =>
279
+ this.sdk.subscribe(
280
+ `subscription OnLatestPairUpdated($id: String, $networkId: Int) {
281
+ onLatestPairUpdated (id: $id, networkId: $networkId) {
282
+ address, exchangeHash, id, initialPriceUsd, liquidAt, liquidity, liquidityToken, networkId, newToken, nonLiquidityToken, oldToken, priceChange, priceUsd, token0 { address, currentPoolAmount, decimals, id, initialPoolAmount, name, networkId, pairId, poolVariation, symbol }, token1 { address, currentPoolAmount, decimals, id, initialPoolAmount, name, networkId, pairId, poolVariation, symbol }, transactionHash
283
+ }
284
+ }`,
285
+ vars,
286
+ sink,
287
+ );
288
+ onPairMetadataUpdated = async (
289
+ vars: OnPairMetadataUpdatedSubscriptionVariables,
290
+ sink: Sink<ExecutionResult<OnPairMetadataUpdatedSubscription>>,
291
+ ) =>
292
+ this.sdk.subscribe(
293
+ `subscription OnPairMetadataUpdated($id: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
294
+ onPairMetadataUpdated (id: $id, quoteToken: $quoteToken, statsType: $statsType) {
295
+ 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, launchpadName, launchpadProtocol, 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, launchpadName, launchpadProtocol, 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
296
+ }
297
+ }`,
298
+ vars,
299
+ sink,
300
+ );
301
+ onEventsCreatedByMaker = async (
302
+ vars: OnEventsCreatedByMakerSubscriptionVariables,
303
+ sink: Sink<ExecutionResult<OnEventsCreatedByMakerSubscription>>,
304
+ ) =>
305
+ this.sdk.subscribe(
306
+ `subscription OnEventsCreatedByMaker($input: OnEventsCreatedByMakerInput!) {
307
+ onEventsCreatedByMaker (input: $input) {
308
+ 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, walletLabels }, makerAddress
309
+ }
415
310
  }`,
416
311
  vars,
417
312
  sink,
@@ -423,20 +318,155 @@ export class Subscribe {
423
318
  this.sdk.subscribe(
424
319
  `subscription OnTokenEventsCreated($input: OnTokenEventsCreatedInput!) {
425
320
  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
321
+ 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, walletLabels }, id
427
322
  }
428
323
  }`,
429
324
  vars,
430
325
  sink,
431
326
  );
432
- onBalanceUpdated = async (
433
- vars: OnBalanceUpdatedSubscriptionVariables,
434
- sink: Sink<ExecutionResult<OnBalanceUpdatedSubscription>>,
327
+ onUnconfirmedEventsCreatedByMaker = async (
328
+ vars: OnUnconfirmedEventsCreatedByMakerSubscriptionVariables,
329
+ sink: Sink<ExecutionResult<OnUnconfirmedEventsCreatedByMakerSubscription>>,
435
330
  ) =>
436
331
  this.sdk.subscribe(
437
- `subscription OnBalanceUpdated($walletAddress: String!) {
438
- onBalanceUpdated (walletAddress: $walletAddress) {
439
- address, balance, firstHeldTimestamp, networkId, shiftedBalance, tokenAddress, tokenId, walletId
332
+ `subscription OnUnconfirmedEventsCreatedByMaker($input: OnUnconfirmedEventsCreatedByMakerInput!) {
333
+ onUnconfirmedEventsCreatedByMaker (input: $input) {
334
+ 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 }, makerAddress
335
+ }
336
+ }`,
337
+ vars,
338
+ sink,
339
+ );
340
+ onNftEventsCreated = async (
341
+ vars: OnNftEventsCreatedSubscriptionVariables,
342
+ sink: Sink<ExecutionResult<OnNftEventsCreatedSubscription>>,
343
+ ) =>
344
+ this.sdk.subscribe(
345
+ `subscription OnNftEventsCreated($address: String, $networkId: Int) {
346
+ onNftEventsCreated (address: $address, networkId: $networkId) {
347
+ 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
348
+ }
349
+ }`,
350
+ vars,
351
+ sink,
352
+ );
353
+ onSimulateTokenContract = async (
354
+ vars: OnSimulateTokenContractSubscriptionVariables,
355
+ sink: Sink<ExecutionResult<OnSimulateTokenContractSubscription>>,
356
+ ) =>
357
+ this.sdk.subscribe(
358
+ `subscription OnSimulateTokenContract($contractAddress: String, $networkId: Int!, $simulationId: String) {
359
+ onSimulateTokenContract (contractAddress: $contractAddress, networkId: $networkId, simulationId: $simulationId) {
360
+ 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
361
+ }
362
+ }`,
363
+ vars,
364
+ sink,
365
+ );
366
+ onTokenLifecycleEventsCreated = async (
367
+ vars: OnTokenLifecycleEventsCreatedSubscriptionVariables,
368
+ sink: Sink<ExecutionResult<OnTokenLifecycleEventsCreatedSubscription>>,
369
+ ) =>
370
+ this.sdk.subscribe(
371
+ `subscription OnTokenLifecycleEventsCreated($address: String, $networkId: Int) {
372
+ onTokenLifecycleEventsCreated (address: $address, networkId: $networkId) {
373
+ events { blockHash, blockNumber, data { ... on TokenBurnEventData { amount, circulatingSupply, totalSupply }, ... on TokenMintEventData { amount, circulatingSupply, totalSupply } }, eventType, id, logIndex, maker, networkId, timestamp, tokenAddress, transactionHash, transactionIndex }, id
374
+ }
375
+ }`,
376
+ vars,
377
+ sink,
378
+ );
379
+ onPricesUpdated = async (
380
+ vars: OnPricesUpdatedSubscriptionVariables,
381
+ sink: Sink<ExecutionResult<OnPricesUpdatedSubscription>>,
382
+ ) =>
383
+ this.sdk.subscribe(
384
+ `subscription OnPricesUpdated($input: [OnPricesUpdatedInput!]!) {
385
+ onPricesUpdated (input: $input) {
386
+ address, confidence, networkId, poolAddress, priceUsd, timestamp
387
+ }
388
+ }`,
389
+ vars,
390
+ sink,
391
+ );
392
+ onHoldersUpdated = async (
393
+ vars: OnHoldersUpdatedSubscriptionVariables,
394
+ sink: Sink<ExecutionResult<OnHoldersUpdatedSubscription>>,
395
+ ) =>
396
+ this.sdk.subscribe(
397
+ `subscription OnHoldersUpdated($tokenId: String!) {
398
+ onHoldersUpdated (tokenId: $tokenId) {
399
+ balances { address, balance, balanceUsd, firstHeldTimestamp, networkId, shiftedBalance, 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, launchpadName, launchpadProtocol, 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 }, tokenAddress, tokenId, tokenPriceUsd, walletId }, holders, networkId, tokenAddress, tokenId
400
+ }
401
+ }`,
402
+ vars,
403
+ sink,
404
+ );
405
+ onEventLabelCreated = async (
406
+ vars: OnEventLabelCreatedSubscriptionVariables,
407
+ sink: Sink<ExecutionResult<OnEventLabelCreatedSubscription>>,
408
+ ) =>
409
+ this.sdk.subscribe(
410
+ `subscription OnEventLabelCreated($id: String) {
411
+ onEventLabelCreated(id: $id) {
412
+ data {
413
+ ... on FrontRunLabelData {
414
+ index
415
+ token0DrainedAmount
416
+ token1DrainedAmount
417
+ }
418
+ ... on SandwichedLabelData {
419
+ token0DrainedAmountSandwich: token0DrainedAmount
420
+ token1DrainedAmountSandwich: token1DrainedAmount
421
+ }
422
+ }
423
+ id
424
+ label
425
+ logIndex
426
+ networkId
427
+ timestamp
428
+ transactionHash
429
+ transactionIndex
430
+ }
431
+ }
432
+ `,
433
+ vars,
434
+ sink,
435
+ );
436
+ onUnconfirmedEventsCreated = async (
437
+ vars: OnUnconfirmedEventsCreatedSubscriptionVariables,
438
+ sink: Sink<ExecutionResult<OnUnconfirmedEventsCreatedSubscription>>,
439
+ ) =>
440
+ this.sdk.subscribe(
441
+ `subscription OnUnconfirmedEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
442
+ onUnconfirmedEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
443
+ 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
444
+ }
445
+ }`,
446
+ vars,
447
+ sink,
448
+ );
449
+ onBarsUpdated = async (
450
+ vars: OnBarsUpdatedSubscriptionVariables,
451
+ sink: Sink<ExecutionResult<OnBarsUpdatedSubscription>>,
452
+ ) =>
453
+ this.sdk.subscribe(
454
+ `subscription OnBarsUpdated($pairId: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
455
+ onBarsUpdated (pairId: $pairId, quoteToken: $quoteToken, statsType: $statsType) {
456
+ 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
457
+ }
458
+ }`,
459
+ vars,
460
+ sink,
461
+ );
462
+ onDetailedStatsUpdated = async (
463
+ vars: OnDetailedStatsUpdatedSubscriptionVariables,
464
+ sink: Sink<ExecutionResult<OnDetailedStatsUpdatedSubscription>>,
465
+ ) =>
466
+ this.sdk.subscribe(
467
+ `subscription OnDetailedStatsUpdated($pairId: String, $statsType: TokenPairStatisticsType, $tokenOfInterest: TokenOfInterest) {
468
+ onDetailedStatsUpdated (pairId: $pairId, statsType: $statsType, tokenOfInterest: $tokenOfInterest) {
469
+ 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
440
470
  }
441
471
  }`,
442
472
  vars,