@codex-data/sdk 1.0.3 → 1.0.4

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 (80) hide show
  1. package/dist/resources/generated_queries/FilterPairs.graphql +44 -0
  2. package/dist/resources/generated_queries/FilterTokens.graphql +44 -0
  3. package/dist/resources/generated_queries/GetBars.graphql +165 -0
  4. package/dist/resources/generated_queries/GetCommunityNotes.graphql +11 -0
  5. package/dist/resources/generated_queries/GetDetailedPairStats.graphql +22 -0
  6. package/dist/resources/generated_queries/GetDetailedPairsStats.graphql +22 -0
  7. package/dist/resources/generated_queries/ListPairsForToken.graphql +22 -0
  8. package/dist/resources/generated_queries/ListPairsWithMetadataForToken.graphql +44 -0
  9. package/dist/resources/generated_queries/PairMetadata.graphql +26 -0
  10. package/dist/resources/generated_queries/Token.graphql +11 -0
  11. package/dist/resources/generated_queries/Tokens.graphql +11 -0
  12. package/dist/resources/generated_subscriptions/OnHoldersUpdated.graphql +15 -0
  13. package/dist/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +26 -0
  14. package/dist/resources/generated_subscriptions/OnUnconfirmedEventsCreated.graphql +1 -0
  15. package/dist/resources/graphql.d.ts +202 -109
  16. package/dist/resources/graphql.d.ts.map +1 -1
  17. package/dist/resources/graphql.js +18 -1
  18. package/dist/resources/graphql.js.map +1 -1
  19. package/dist/resources/graphql.schema.json +863 -760
  20. package/dist/resources/graphql.ts +208 -124
  21. package/dist/resources/schema.graphql +312 -154
  22. package/dist/sdk/Mutation.d.ts +2 -2
  23. package/dist/sdk/Mutation.js +2 -2
  24. package/dist/sdk/Query.d.ts +48 -57
  25. package/dist/sdk/Query.d.ts.map +1 -1
  26. package/dist/sdk/Query.js +47 -56
  27. package/dist/sdk/Query.js.map +1 -1
  28. package/dist/sdk/Subscribe.d.ts +13 -12
  29. package/dist/sdk/Subscribe.d.ts.map +1 -1
  30. package/dist/sdk/Subscribe.js +68 -61
  31. package/dist/sdk/Subscribe.js.map +1 -1
  32. package/dist/sdk/generated/gql.d.ts +34 -101
  33. package/dist/sdk/generated/gql.d.ts.map +1 -1
  34. package/dist/sdk/generated/gql.js +14 -22
  35. package/dist/sdk/generated/gql.js.map +1 -1
  36. package/dist/sdk/generated/graphql.d.ts +784 -499
  37. package/dist/sdk/generated/graphql.d.ts.map +1 -1
  38. package/dist/sdk/generated/graphql.js +34 -25
  39. package/dist/sdk/generated/graphql.js.map +1 -1
  40. package/package.json +1 -1
  41. package/src/resources/generated_queries/FilterPairs.graphql +44 -0
  42. package/src/resources/generated_queries/FilterTokens.graphql +44 -0
  43. package/src/resources/generated_queries/GetBars.graphql +165 -0
  44. package/src/resources/generated_queries/GetCommunityNotes.graphql +11 -0
  45. package/src/resources/generated_queries/GetDetailedPairStats.graphql +22 -0
  46. package/src/resources/generated_queries/GetDetailedPairsStats.graphql +22 -0
  47. package/src/resources/generated_queries/ListPairsForToken.graphql +22 -0
  48. package/src/resources/generated_queries/ListPairsWithMetadataForToken.graphql +44 -0
  49. package/src/resources/generated_queries/PairMetadata.graphql +26 -0
  50. package/src/resources/generated_queries/Token.graphql +11 -0
  51. package/src/resources/generated_queries/Tokens.graphql +11 -0
  52. package/src/resources/generated_subscriptions/OnHoldersUpdated.graphql +15 -0
  53. package/src/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +26 -0
  54. package/src/resources/generated_subscriptions/OnUnconfirmedEventsCreated.graphql +1 -0
  55. package/src/resources/graphql.schema.json +863 -760
  56. package/src/resources/graphql.ts +208 -124
  57. package/src/resources/schema.graphql +312 -154
  58. package/src/sdk/Mutation.ts +4 -4
  59. package/src/sdk/Query.ts +100 -136
  60. package/src/sdk/Subscribe.ts +112 -97
  61. package/src/sdk/generated/gql.ts +31 -71
  62. package/src/sdk/generated/graphql.ts +246 -233
  63. package/dist/resources/generated_queries/BackfillWalletState.graphql +0 -3
  64. package/dist/resources/generated_queries/GetLatestPairs.graphql +0 -57
  65. package/dist/resources/generated_queries/GetParallelAssets.graphql +0 -50
  66. package/dist/resources/generated_queries/GetTokenCount.graphql +0 -3
  67. package/dist/resources/generated_queries/GetTokenInfo.graphql +0 -18
  68. package/dist/resources/generated_queries/GetTokensInfo.graphql +0 -18
  69. package/dist/resources/generated_queries/GetUniV3Ticks.graphql +0 -22
  70. package/dist/resources/generated_queries/ListFavoriteTokens.graphql +0 -59
  71. package/dist/resources/generated_queries/PrimeBalance.graphql +0 -12
  72. package/src/resources/generated_queries/BackfillWalletState.graphql +0 -3
  73. package/src/resources/generated_queries/GetLatestPairs.graphql +0 -57
  74. package/src/resources/generated_queries/GetParallelAssets.graphql +0 -50
  75. package/src/resources/generated_queries/GetTokenCount.graphql +0 -3
  76. package/src/resources/generated_queries/GetTokenInfo.graphql +0 -18
  77. package/src/resources/generated_queries/GetTokensInfo.graphql +0 -18
  78. package/src/resources/generated_queries/GetUniV3Ticks.graphql +0 -22
  79. package/src/resources/generated_queries/ListFavoriteTokens.graphql +0 -59
  80. package/src/resources/generated_queries/PrimeBalance.graphql +0 -12
@@ -10,6 +10,8 @@ import {
10
10
  OnEventLabelCreatedSubscriptionVariables,
11
11
  OnEventsCreatedSubscription,
12
12
  OnEventsCreatedSubscriptionVariables,
13
+ OnHoldersUpdatedSubscription,
14
+ OnHoldersUpdatedSubscriptionVariables,
13
15
  OnLatestPairUpdatedSubscription,
14
16
  OnLatestPairUpdatedSubscriptionVariables,
15
17
  OnLatestTokensSubscription,
@@ -43,131 +45,131 @@ import { Codex } from "./index";
43
45
 
44
46
  export class Subscribe {
45
47
  constructor(private sdk: Codex) {}
46
- onPriceUpdated = async (
47
- vars: OnPriceUpdatedSubscriptionVariables,
48
- sink: Sink<ExecutionResult<OnPriceUpdatedSubscription>>,
48
+ onSimulateTokenContract = async (
49
+ vars: OnSimulateTokenContractSubscriptionVariables,
50
+ sink: Sink<ExecutionResult<OnSimulateTokenContractSubscription>>,
49
51
  ) =>
50
52
  this.sdk.subscribe(
51
- `subscription OnPriceUpdated($address: String, $networkId: Int, $sourcePairAddress: String) {
52
- onPriceUpdated (address: $address, networkId: $networkId, sourcePairAddress: $sourcePairAddress) {
53
- address, confidence, networkId, poolAddress, priceUsd, timestamp
53
+ `subscription OnSimulateTokenContract($contractAddress: String, $networkId: Int!, $simulationId: String) {
54
+ onSimulateTokenContract (contractAddress: $contractAddress, networkId: $networkId, simulationId: $simulationId) {
55
+ 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
54
56
  }
55
57
  }`,
56
58
  vars,
57
59
  sink,
58
60
  );
59
- onLatestPairUpdated = async (
60
- vars: OnLatestPairUpdatedSubscriptionVariables,
61
- sink: Sink<ExecutionResult<OnLatestPairUpdatedSubscription>>,
61
+ onUnconfirmedEventsCreated = async (
62
+ vars: OnUnconfirmedEventsCreatedSubscriptionVariables,
63
+ sink: Sink<ExecutionResult<OnUnconfirmedEventsCreatedSubscription>>,
62
64
  ) =>
63
65
  this.sdk.subscribe(
64
- `subscription OnLatestPairUpdated($id: String, $networkId: Int) {
65
- onLatestPairUpdated (id: $id, networkId: $networkId) {
66
- 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
66
+ `subscription OnUnconfirmedEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
67
+ onUnconfirmedEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
68
+ 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
67
69
  }
68
70
  }`,
69
71
  vars,
70
72
  sink,
71
73
  );
72
- onTokenBarsUpdated = async (
73
- vars: OnTokenBarsUpdatedSubscriptionVariables,
74
- sink: Sink<ExecutionResult<OnTokenBarsUpdatedSubscription>>,
74
+ onEventsCreated = async (
75
+ vars: OnEventsCreatedSubscriptionVariables,
76
+ sink: Sink<ExecutionResult<OnEventsCreatedSubscription>>,
75
77
  ) =>
76
78
  this.sdk.subscribe(
77
- `subscription OnTokenBarsUpdated($statsType: TokenPairStatisticsType, $tokenId: String) {
78
- onTokenBarsUpdated (statsType: $statsType, tokenId: $tokenId) {
79
- 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
79
+ `subscription OnEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
80
+ onEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
81
+ 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
80
82
  }
81
83
  }`,
82
84
  vars,
83
85
  sink,
84
86
  );
85
- onPairMetadataUpdated = async (
86
- vars: OnPairMetadataUpdatedSubscriptionVariables,
87
- sink: Sink<ExecutionResult<OnPairMetadataUpdatedSubscription>>,
87
+ onNftEventsCreated = async (
88
+ vars: OnNftEventsCreatedSubscriptionVariables,
89
+ sink: Sink<ExecutionResult<OnNftEventsCreatedSubscription>>,
88
90
  ) =>
89
91
  this.sdk.subscribe(
90
- `subscription OnPairMetadataUpdated($id: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
91
- onPairMetadataUpdated (id: $id, quoteToken: $quoteToken, statsType: $statsType) {
92
- 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, 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, 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, highPrice12, highPrice24, id, liquidity, liquidityToken, lowPrice1, lowPrice1w, lowPrice4, 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, volume12, volume24
92
+ `subscription OnNftEventsCreated($address: String, $networkId: Int) {
93
+ onNftEventsCreated (address: $address, networkId: $networkId) {
94
+ 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
93
95
  }
94
96
  }`,
95
97
  vars,
96
98
  sink,
97
99
  );
98
- onUnconfirmedBarsUpdated = async (
99
- vars: OnUnconfirmedBarsUpdatedSubscriptionVariables,
100
- sink: Sink<ExecutionResult<OnUnconfirmedBarsUpdatedSubscription>>,
100
+ onLatestPairUpdated = async (
101
+ vars: OnLatestPairUpdatedSubscriptionVariables,
102
+ sink: Sink<ExecutionResult<OnLatestPairUpdatedSubscription>>,
101
103
  ) =>
102
104
  this.sdk.subscribe(
103
- `subscription OnUnconfirmedBarsUpdated($pairId: String, $quoteToken: QuoteToken) {
104
- onUnconfirmedBarsUpdated (pairId: $pairId, quoteToken: $quoteToken) {
105
- 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
105
+ `subscription OnLatestPairUpdated($id: String, $networkId: Int) {
106
+ onLatestPairUpdated (id: $id, networkId: $networkId) {
107
+ 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
106
108
  }
107
109
  }`,
108
110
  vars,
109
111
  sink,
110
112
  );
111
- onTokenLifecycleEventsCreated = async (
112
- vars: OnTokenLifecycleEventsCreatedSubscriptionVariables,
113
- sink: Sink<ExecutionResult<OnTokenLifecycleEventsCreatedSubscription>>,
113
+ onPairMetadataUpdated = async (
114
+ vars: OnPairMetadataUpdatedSubscriptionVariables,
115
+ sink: Sink<ExecutionResult<OnPairMetadataUpdatedSubscription>>,
114
116
  ) =>
115
117
  this.sdk.subscribe(
116
- `subscription OnTokenLifecycleEventsCreated($address: String, $networkId: Int) {
117
- onTokenLifecycleEventsCreated (address: $address, networkId: $networkId) {
118
- events { blockHash, blockNumber, data { ... on TokenBurnEventData { amount, circulatingSupply, totalSupply }, ... on TokenMintEventData { amount, circulatingSupply, totalSupply } }, eventType, id, logIndex, maker, networkId, timestamp, tokenAddress, transactionHash, transactionIndex }, id
118
+ `subscription OnPairMetadataUpdated($id: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
119
+ onPairMetadataUpdated (id: $id, quoteToken: $quoteToken, statsType: $statsType) {
120
+ 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
119
121
  }
120
122
  }`,
121
123
  vars,
122
124
  sink,
123
125
  );
124
- onTokenEventsCreated = async (
125
- vars: OnTokenEventsCreatedSubscriptionVariables,
126
- sink: Sink<ExecutionResult<OnTokenEventsCreatedSubscription>>,
126
+ onUnconfirmedBarsUpdated = async (
127
+ vars: OnUnconfirmedBarsUpdatedSubscriptionVariables,
128
+ sink: Sink<ExecutionResult<OnUnconfirmedBarsUpdatedSubscription>>,
127
129
  ) =>
128
130
  this.sdk.subscribe(
129
- `subscription OnTokenEventsCreated($input: OnTokenEventsCreatedInput!) {
130
- onTokenEventsCreated (input: $input) {
131
- 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
131
+ `subscription OnUnconfirmedBarsUpdated($pairId: String, $quoteToken: QuoteToken) {
132
+ onUnconfirmedBarsUpdated (pairId: $pairId, quoteToken: $quoteToken) {
133
+ 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
132
134
  }
133
135
  }`,
134
136
  vars,
135
137
  sink,
136
138
  );
137
- onNftAssetsCreated = async (
138
- vars: OnNftAssetsCreatedSubscriptionVariables,
139
- sink: Sink<ExecutionResult<OnNftAssetsCreatedSubscription>>,
139
+ onHoldersUpdated = async (
140
+ vars: OnHoldersUpdatedSubscriptionVariables,
141
+ sink: Sink<ExecutionResult<OnHoldersUpdatedSubscription>>,
140
142
  ) =>
141
143
  this.sdk.subscribe(
142
- `subscription OnNftAssetsCreated($address: String, $networkId: Int, $tokenId: String) {
143
- onNftAssetsCreated (address: $address, networkId: $networkId, tokenId: $tokenId) {
144
- 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
144
+ `subscription OnHoldersUpdated($tokenId: String!) {
145
+ onHoldersUpdated (tokenId: $tokenId) {
146
+ balances { balance, firstHeldTimestamp, shiftedBalance, tokenId, walletId }, holders, networkId, tokenAddress, tokenId
145
147
  }
146
148
  }`,
147
149
  vars,
148
150
  sink,
149
151
  );
150
- onUnconfirmedEventsCreated = async (
151
- vars: OnUnconfirmedEventsCreatedSubscriptionVariables,
152
- sink: Sink<ExecutionResult<OnUnconfirmedEventsCreatedSubscription>>,
152
+ onLatestTokens = async (
153
+ vars: OnLatestTokensSubscriptionVariables,
154
+ sink: Sink<ExecutionResult<OnLatestTokensSubscription>>,
153
155
  ) =>
154
156
  this.sdk.subscribe(
155
- `subscription OnUnconfirmedEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
156
- onUnconfirmedEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
157
- address, events { address, blockHash, blockNumber, data { ... on UnconfirmedLiquidityChangeEventData { amount0, amount0Shifted, amount1, amount1Shifted, type }, ... on UnconfirmedSwapEventData { amountNonLiquidityToken, priceBaseToken, priceBaseTokenTotal, priceUsd, priceUsdTotal, type } }, eventDisplayType, eventType, id, logIndex, maker, networkId, quoteToken, supplementalIndex, timestamp, transactionHash, transactionIndex }, id, networkId, quoteToken
157
+ `subscription OnLatestTokens($id: String, $networkId: Int, $tokenAddress: String) {
158
+ onLatestTokens (id: $id, networkId: $networkId, tokenAddress: $tokenAddress) {
159
+ 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
158
160
  }
159
161
  }`,
160
162
  vars,
161
163
  sink,
162
164
  );
163
- onSimulateTokenContract = async (
164
- vars: OnSimulateTokenContractSubscriptionVariables,
165
- sink: Sink<ExecutionResult<OnSimulateTokenContractSubscription>>,
165
+ onNftPoolEventsCreated = async (
166
+ vars: OnNftPoolEventsCreatedSubscriptionVariables,
167
+ sink: Sink<ExecutionResult<OnNftPoolEventsCreatedSubscription>>,
166
168
  ) =>
167
169
  this.sdk.subscribe(
168
- `subscription OnSimulateTokenContract($contractAddress: String, $networkId: Int!, $simulationId: String) {
169
- onSimulateTokenContract (contractAddress: $contractAddress, networkId: $networkId, simulationId: $simulationId) {
170
- 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
170
+ `subscription OnNftPoolEventsCreated($collectionAddress: String, $exchangeAddress: String, $networkId: Int, $poolAddress: String) {
171
+ onNftPoolEventsCreated (collectionAddress: $collectionAddress, exchangeAddress: $exchangeAddress, networkId: $networkId, poolAddress: $poolAddress) {
172
+ 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
171
173
  }
172
174
  }`,
173
175
  vars,
@@ -186,53 +188,40 @@ export class Subscribe {
186
188
  vars,
187
189
  sink,
188
190
  );
189
- onNftEventsCreated = async (
190
- vars: OnNftEventsCreatedSubscriptionVariables,
191
- sink: Sink<ExecutionResult<OnNftEventsCreatedSubscription>>,
192
- ) =>
193
- this.sdk.subscribe(
194
- `subscription OnNftEventsCreated($address: String, $networkId: Int) {
195
- onNftEventsCreated (address: $address, networkId: $networkId) {
196
- 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
197
- }
198
- }`,
199
- vars,
200
- sink,
201
- );
202
- onPricesUpdated = async (
203
- vars: OnPricesUpdatedSubscriptionVariables,
204
- sink: Sink<ExecutionResult<OnPricesUpdatedSubscription>>,
191
+ onTokenLifecycleEventsCreated = async (
192
+ vars: OnTokenLifecycleEventsCreatedSubscriptionVariables,
193
+ sink: Sink<ExecutionResult<OnTokenLifecycleEventsCreatedSubscription>>,
205
194
  ) =>
206
195
  this.sdk.subscribe(
207
- `subscription OnPricesUpdated($input: [OnPricesUpdatedInput!]!) {
208
- onPricesUpdated (input: $input) {
209
- address, confidence, networkId, poolAddress, priceUsd, timestamp
196
+ `subscription OnTokenLifecycleEventsCreated($address: String, $networkId: Int) {
197
+ onTokenLifecycleEventsCreated (address: $address, networkId: $networkId) {
198
+ events { blockHash, blockNumber, data { ... on TokenBurnEventData { amount, circulatingSupply, totalSupply }, ... on TokenMintEventData { amount, circulatingSupply, totalSupply } }, eventType, id, logIndex, maker, networkId, timestamp, tokenAddress, transactionHash, transactionIndex }, id
210
199
  }
211
200
  }`,
212
201
  vars,
213
202
  sink,
214
203
  );
215
- onLatestTokens = async (
216
- vars: OnLatestTokensSubscriptionVariables,
217
- sink: Sink<ExecutionResult<OnLatestTokensSubscription>>,
204
+ onNftAssetsCreated = async (
205
+ vars: OnNftAssetsCreatedSubscriptionVariables,
206
+ sink: Sink<ExecutionResult<OnNftAssetsCreatedSubscription>>,
218
207
  ) =>
219
208
  this.sdk.subscribe(
220
- `subscription OnLatestTokens($id: String, $networkId: Int, $tokenAddress: String) {
221
- onLatestTokens (id: $id, networkId: $networkId, tokenAddress: $tokenAddress) {
222
- 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
209
+ `subscription OnNftAssetsCreated($address: String, $networkId: Int, $tokenId: String) {
210
+ onNftAssetsCreated (address: $address, networkId: $networkId, tokenId: $tokenId) {
211
+ 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
223
212
  }
224
213
  }`,
225
214
  vars,
226
215
  sink,
227
216
  );
228
- onEventsCreated = async (
229
- vars: OnEventsCreatedSubscriptionVariables,
230
- sink: Sink<ExecutionResult<OnEventsCreatedSubscription>>,
217
+ onTokenBarsUpdated = async (
218
+ vars: OnTokenBarsUpdatedSubscriptionVariables,
219
+ sink: Sink<ExecutionResult<OnTokenBarsUpdatedSubscription>>,
231
220
  ) =>
232
221
  this.sdk.subscribe(
233
- `subscription OnEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
234
- onEventsCreated (address: $address, id: $id, 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 }, id, networkId, quoteToken
222
+ `subscription OnTokenBarsUpdated($statsType: TokenPairStatisticsType, $tokenId: String) {
223
+ onTokenBarsUpdated (statsType: $statsType, tokenId: $tokenId) {
224
+ 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
236
225
  }
237
226
  }`,
238
227
  vars,
@@ -269,14 +258,40 @@ export class Subscribe {
269
258
  vars,
270
259
  sink,
271
260
  );
272
- onNftPoolEventsCreated = async (
273
- vars: OnNftPoolEventsCreatedSubscriptionVariables,
274
- sink: Sink<ExecutionResult<OnNftPoolEventsCreatedSubscription>>,
261
+ onPricesUpdated = async (
262
+ vars: OnPricesUpdatedSubscriptionVariables,
263
+ sink: Sink<ExecutionResult<OnPricesUpdatedSubscription>>,
275
264
  ) =>
276
265
  this.sdk.subscribe(
277
- `subscription OnNftPoolEventsCreated($collectionAddress: String, $exchangeAddress: String, $networkId: Int, $poolAddress: String) {
278
- onNftPoolEventsCreated (collectionAddress: $collectionAddress, exchangeAddress: $exchangeAddress, networkId: $networkId, poolAddress: $poolAddress) {
279
- 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
266
+ `subscription OnPricesUpdated($input: [OnPricesUpdatedInput!]!) {
267
+ onPricesUpdated (input: $input) {
268
+ address, confidence, networkId, poolAddress, priceUsd, timestamp
269
+ }
270
+ }`,
271
+ vars,
272
+ sink,
273
+ );
274
+ onTokenEventsCreated = async (
275
+ vars: OnTokenEventsCreatedSubscriptionVariables,
276
+ sink: Sink<ExecutionResult<OnTokenEventsCreatedSubscription>>,
277
+ ) =>
278
+ this.sdk.subscribe(
279
+ `subscription OnTokenEventsCreated($input: OnTokenEventsCreatedInput!) {
280
+ onTokenEventsCreated (input: $input) {
281
+ 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
282
+ }
283
+ }`,
284
+ vars,
285
+ sink,
286
+ );
287
+ onPriceUpdated = async (
288
+ vars: OnPriceUpdatedSubscriptionVariables,
289
+ sink: Sink<ExecutionResult<OnPriceUpdatedSubscription>>,
290
+ ) =>
291
+ this.sdk.subscribe(
292
+ `subscription OnPriceUpdated($address: String, $networkId: Int, $sourcePairAddress: String) {
293
+ onPriceUpdated (address: $address, networkId: $networkId, sourcePairAddress: $sourcePairAddress) {
294
+ address, confidence, networkId, poolAddress, priceUsd, timestamp
280
295
  }
281
296
  }`,
282
297
  vars,