@codex-data/sdk 1.0.0-rc1 → 1.0.0-rc3

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 (113) hide show
  1. package/dist/resources/generated_mutations/CreateWebhooks.graphql +392 -0
  2. package/dist/resources/generated_queries/FilterPairs.graphql +8 -0
  3. package/dist/resources/generated_queries/FilterTokens.graphql +7 -0
  4. package/dist/resources/generated_queries/GetCommunityNotes.graphql +100 -0
  5. package/dist/resources/generated_queries/GetDetailedPairStats.graphql +2 -0
  6. package/dist/resources/generated_queries/GetDetailedPairsStats.graphql +2 -0
  7. package/dist/resources/generated_queries/GetEventLabels.graphql +11 -0
  8. package/dist/resources/generated_queries/GetNftEvents.graphql +46 -0
  9. package/dist/resources/generated_queries/GetNftPoolEvents.graphql +375 -0
  10. package/dist/resources/generated_queries/GetPrimePoolEvents.graphql +118 -0
  11. package/dist/resources/generated_queries/GetTokenEvents.graphql +49 -0
  12. package/dist/resources/generated_queries/GetTokenEventsForMaker.graphql +98 -0
  13. package/dist/resources/generated_queries/GetTokenInfo.graphql +1 -0
  14. package/dist/resources/generated_queries/GetTokensInfo.graphql +1 -0
  15. package/dist/resources/generated_queries/GetWebhooks.graphql +98 -0
  16. package/dist/resources/generated_queries/ListFavoriteTokens.graphql +1 -0
  17. package/dist/resources/generated_queries/ListPairsForToken.graphql +2 -0
  18. package/dist/resources/generated_queries/ListPairsWithMetadataForToken.graphql +4 -0
  19. package/dist/resources/generated_queries/ListTopTokens.graphql +1 -0
  20. package/dist/resources/generated_queries/Token.graphql +1 -0
  21. package/dist/resources/generated_queries/TokenLifecycleEvents.graphql +12 -0
  22. package/dist/resources/generated_queries/Tokens.graphql +1 -0
  23. package/dist/resources/generated_subscriptions/OnBarsUpdated.graphql +42 -0
  24. package/dist/resources/generated_subscriptions/OnEventLabelCreated.graphql +11 -0
  25. package/dist/resources/generated_subscriptions/OnEventsCreated.graphql +49 -0
  26. package/dist/resources/generated_subscriptions/OnNftEventsCreated.graphql +46 -0
  27. package/dist/resources/generated_subscriptions/OnNftPoolEventsCreated.graphql +375 -0
  28. package/dist/resources/generated_subscriptions/OnTokenBarsUpdated.graphql +551 -0
  29. package/dist/resources/generated_subscriptions/OnTokenEventsCreated.graphql +49 -0
  30. package/dist/resources/generated_subscriptions/OnTokenLifecycleEventsCreated.graphql +12 -0
  31. package/dist/resources/generated_subscriptions/OnUnconfirmedEventsCreated.graphql +17 -0
  32. package/dist/resources/graphql.d.ts +138 -13
  33. package/dist/resources/graphql.d.ts.map +1 -1
  34. package/dist/resources/graphql.js +8 -0
  35. package/dist/resources/graphql.js.map +1 -1
  36. package/dist/resources/graphql.schema.json +940 -122
  37. package/dist/resources/graphql.ts +148 -14
  38. package/dist/resources/mutations_override/CreateWebhooks.graphql +472 -0
  39. package/dist/resources/queries_override/GetEventLabels.graphql +35 -0
  40. package/dist/resources/queries_override/GetWebhooks.graphql +134 -0
  41. package/dist/resources/schema.graphql +185 -16
  42. package/dist/resources/subscriptions_override/OnEventLabelCreated.graphql +22 -0
  43. package/dist/scripts/generateGraphql.d.ts +1 -0
  44. package/dist/scripts/generateGraphql.d.ts.map +1 -1
  45. package/dist/scripts/generateGraphql.js +48 -12
  46. package/dist/scripts/generateGraphql.js.map +1 -1
  47. package/dist/sdk/Mutation.d.ts +1 -1
  48. package/dist/sdk/Mutation.js +1 -1
  49. package/dist/sdk/Query.d.ts +55 -54
  50. package/dist/sdk/Query.d.ts.map +1 -1
  51. package/dist/sdk/Query.js +54 -53
  52. package/dist/sdk/Query.js.map +1 -1
  53. package/dist/sdk/Subscribe.d.ts +12 -11
  54. package/dist/sdk/Subscribe.d.ts.map +1 -1
  55. package/dist/sdk/Subscribe.js +80 -55
  56. package/dist/sdk/Subscribe.js.map +1 -1
  57. package/dist/sdk/generated/gql.d.ts +76 -58
  58. package/dist/sdk/generated/gql.d.ts.map +1 -1
  59. package/dist/sdk/generated/gql.js +31 -29
  60. package/dist/sdk/generated/gql.js.map +1 -1
  61. package/dist/sdk/generated/graphql.d.ts +2908 -90
  62. package/dist/sdk/generated/graphql.d.ts.map +1 -1
  63. package/dist/sdk/generated/graphql.js +41 -31
  64. package/dist/sdk/generated/graphql.js.map +1 -1
  65. package/dist/sdk/index.d.ts.map +1 -1
  66. package/dist/sdk/index.js +1 -0
  67. package/dist/sdk/index.js.map +1 -1
  68. package/package.json +1 -1
  69. package/src/resources/generated_mutations/CreateWebhooks.graphql +392 -0
  70. package/src/resources/generated_queries/FilterPairs.graphql +8 -0
  71. package/src/resources/generated_queries/FilterTokens.graphql +7 -0
  72. package/src/resources/generated_queries/GetCommunityNotes.graphql +100 -0
  73. package/src/resources/generated_queries/GetDetailedPairStats.graphql +2 -0
  74. package/src/resources/generated_queries/GetDetailedPairsStats.graphql +2 -0
  75. package/src/resources/generated_queries/GetEventLabels.graphql +11 -0
  76. package/src/resources/generated_queries/GetNftEvents.graphql +46 -0
  77. package/src/resources/generated_queries/GetNftPoolEvents.graphql +375 -0
  78. package/src/resources/generated_queries/GetPrimePoolEvents.graphql +118 -0
  79. package/src/resources/generated_queries/GetTokenEvents.graphql +49 -0
  80. package/src/resources/generated_queries/GetTokenEventsForMaker.graphql +98 -0
  81. package/src/resources/generated_queries/GetTokenInfo.graphql +1 -0
  82. package/src/resources/generated_queries/GetTokensInfo.graphql +1 -0
  83. package/src/resources/generated_queries/GetWebhooks.graphql +98 -0
  84. package/src/resources/generated_queries/ListFavoriteTokens.graphql +1 -0
  85. package/src/resources/generated_queries/ListPairsForToken.graphql +2 -0
  86. package/src/resources/generated_queries/ListPairsWithMetadataForToken.graphql +4 -0
  87. package/src/resources/generated_queries/ListTopTokens.graphql +1 -0
  88. package/src/resources/generated_queries/Token.graphql +1 -0
  89. package/src/resources/generated_queries/TokenLifecycleEvents.graphql +12 -0
  90. package/src/resources/generated_queries/Tokens.graphql +1 -0
  91. package/src/resources/generated_subscriptions/OnBarsUpdated.graphql +42 -0
  92. package/src/resources/generated_subscriptions/OnEventLabelCreated.graphql +11 -0
  93. package/src/resources/generated_subscriptions/OnEventsCreated.graphql +49 -0
  94. package/src/resources/generated_subscriptions/OnNftEventsCreated.graphql +46 -0
  95. package/src/resources/generated_subscriptions/OnNftPoolEventsCreated.graphql +375 -0
  96. package/src/resources/generated_subscriptions/OnTokenBarsUpdated.graphql +551 -0
  97. package/src/resources/generated_subscriptions/OnTokenEventsCreated.graphql +49 -0
  98. package/src/resources/generated_subscriptions/OnTokenLifecycleEventsCreated.graphql +12 -0
  99. package/src/resources/generated_subscriptions/OnUnconfirmedEventsCreated.graphql +17 -0
  100. package/src/resources/graphql.schema.json +940 -122
  101. package/src/resources/graphql.ts +148 -14
  102. package/src/resources/mutations_override/CreateWebhooks.graphql +472 -0
  103. package/src/resources/queries_override/GetEventLabels.graphql +35 -0
  104. package/src/resources/queries_override/GetWebhooks.graphql +134 -0
  105. package/src/resources/schema.graphql +185 -16
  106. package/src/resources/subscriptions_override/OnEventLabelCreated.graphql +22 -0
  107. package/src/scripts/generateGraphql.ts +87 -17
  108. package/src/sdk/Mutation.ts +2 -2
  109. package/src/sdk/Query.ts +117 -113
  110. package/src/sdk/Subscribe.ts +118 -85
  111. package/src/sdk/generated/gql.ts +68 -58
  112. package/src/sdk/generated/graphql.ts +226 -72
  113. package/src/sdk/index.ts +1 -0
@@ -28,6 +28,8 @@ import {
28
28
  OnPriceUpdatedSubscriptionVariables,
29
29
  OnSimulateTokenContractSubscription,
30
30
  OnSimulateTokenContractSubscriptionVariables,
31
+ OnTokenBarsUpdatedSubscription,
32
+ OnTokenBarsUpdatedSubscriptionVariables,
31
33
  OnTokenEventsCreatedSubscription,
32
34
  OnTokenEventsCreatedSubscriptionVariables,
33
35
  OnTokenLifecycleEventsCreatedSubscription,
@@ -52,162 +54,193 @@ export class Subscribe {
52
54
  vars,
53
55
  sink,
54
56
  );
55
- onDetailedStatsUpdated = async (
56
- vars: OnDetailedStatsUpdatedSubscriptionVariables,
57
- sink: Sink<ExecutionResult<OnDetailedStatsUpdatedSubscription>>,
57
+ onNftEventsCreated = async (
58
+ vars: OnNftEventsCreatedSubscriptionVariables,
59
+ sink: Sink<ExecutionResult<OnNftEventsCreatedSubscription>>,
58
60
  ) =>
59
61
  this.sdk.subscribe(
60
- `subscription OnDetailedStatsUpdated($pairId: String, $statsType: TokenPairStatisticsType, $tokenOfInterest: TokenOfInterest) {
61
- onDetailedStatsUpdated (pairId: $pairId, statsType: $statsType, tokenOfInterest: $tokenOfInterest) {
62
- 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
62
+ `subscription OnNftEventsCreated($address: String, $networkId: Int) {
63
+ onNftEventsCreated (address: $address, networkId: $networkId) {
64
+ 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
65
  }
64
66
  }`,
65
67
  vars,
66
68
  sink,
67
69
  );
68
- onLatestPairUpdated = async (
69
- vars: OnLatestPairUpdatedSubscriptionVariables,
70
- sink: Sink<ExecutionResult<OnLatestPairUpdatedSubscription>>,
70
+ onBarsUpdated = async (
71
+ vars: OnBarsUpdatedSubscriptionVariables,
72
+ sink: Sink<ExecutionResult<OnBarsUpdatedSubscription>>,
71
73
  ) =>
72
74
  this.sdk.subscribe(
73
- `subscription OnLatestPairUpdated($id: String, $networkId: Int) {
74
- onLatestPairUpdated (id: $id, networkId: $networkId) {
75
- 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
75
+ `subscription OnBarsUpdated($pairId: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
76
+ onBarsUpdated (pairId: $pairId, quoteToken: $quoteToken, statsType: $statsType) {
77
+ 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
76
78
  }
77
79
  }`,
78
80
  vars,
79
81
  sink,
80
82
  );
81
- onEventsCreated = async (
82
- vars: OnEventsCreatedSubscriptionVariables,
83
- sink: Sink<ExecutionResult<OnEventsCreatedSubscription>>,
83
+ onTokenBarsUpdated = async (
84
+ vars: OnTokenBarsUpdatedSubscriptionVariables,
85
+ sink: Sink<ExecutionResult<OnTokenBarsUpdatedSubscription>>,
84
86
  ) =>
85
87
  this.sdk.subscribe(
86
- `subscription OnEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
87
- onEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
88
- address, events { address, baseTokenPrice, blockHash, blockNumber, eventDisplayType, eventType, id, labels { sandwich { label, sandwichType, token0DrainedAmount, token1DrainedAmount }, washtrade { label } }, liquidityToken, logIndex, maker, networkId, quoteToken, timestamp, token0PoolValueUsd, token0SwapValueUsd, token0ValueBase, token1PoolValueUsd, token1SwapValueUsd, token1ValueBase, transactionHash, transactionIndex }, id, networkId, quoteToken
88
+ `subscription OnTokenBarsUpdated($statsType: TokenPairStatisticsType, $tokenId: String) {
89
+ onTokenBarsUpdated (statsType: $statsType, tokenId: $tokenId) {
90
+ 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
89
91
  }
90
92
  }`,
91
93
  vars,
92
94
  sink,
93
95
  );
94
- onSimulateTokenContract = async (
95
- vars: OnSimulateTokenContractSubscriptionVariables,
96
- sink: Sink<ExecutionResult<OnSimulateTokenContractSubscription>>,
96
+ onUnconfirmedEventsCreated = async (
97
+ vars: OnUnconfirmedEventsCreatedSubscriptionVariables,
98
+ sink: Sink<ExecutionResult<OnUnconfirmedEventsCreatedSubscription>>,
97
99
  ) =>
98
100
  this.sdk.subscribe(
99
- `subscription OnSimulateTokenContract($contractAddress: String, $networkId: Int!, $simulationId: String) {
100
- onSimulateTokenContract (contractAddress: $contractAddress, networkId: $networkId, simulationId: $simulationId) {
101
- 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
+ `subscription OnUnconfirmedEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
102
+ onUnconfirmedEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
103
+ 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
102
104
  }
103
105
  }`,
104
106
  vars,
105
107
  sink,
106
108
  );
107
- onBarsUpdated = async (
108
- vars: OnBarsUpdatedSubscriptionVariables,
109
- sink: Sink<ExecutionResult<OnBarsUpdatedSubscription>>,
109
+ onLatestPairUpdated = async (
110
+ vars: OnLatestPairUpdatedSubscriptionVariables,
111
+ sink: Sink<ExecutionResult<OnLatestPairUpdatedSubscription>>,
110
112
  ) =>
111
113
  this.sdk.subscribe(
112
- `subscription OnBarsUpdated($pairId: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
113
- onBarsUpdated (pairId: $pairId, quoteToken: $quoteToken, statsType: $statsType) {
114
- 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 } }, 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
114
+ `subscription OnLatestPairUpdated($id: String, $networkId: Int) {
115
+ onLatestPairUpdated (id: $id, networkId: $networkId) {
116
+ 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
115
117
  }
116
118
  }`,
117
119
  vars,
118
120
  sink,
119
121
  );
120
- onPairMetadataUpdated = async (
121
- vars: OnPairMetadataUpdatedSubscriptionVariables,
122
- sink: Sink<ExecutionResult<OnPairMetadataUpdatedSubscription>>,
122
+ onTokenEventsCreated = async (
123
+ vars: OnTokenEventsCreatedSubscriptionVariables,
124
+ sink: Sink<ExecutionResult<OnTokenEventsCreatedSubscription>>,
123
125
  ) =>
124
126
  this.sdk.subscribe(
125
- `subscription OnPairMetadataUpdated($id: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
126
- onPairMetadataUpdated (id: $id, quoteToken: $quoteToken, statsType: $statsType) {
127
- 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
127
+ `subscription OnTokenEventsCreated($input: OnTokenEventsCreatedInput!) {
128
+ onTokenEventsCreated (input: $input) {
129
+ 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, token0PoolValueUsd, token0SwapValueUsd, token0ValueBase, token1PoolValueUsd, token1SwapValueUsd, token1ValueBase, transactionHash, transactionIndex }, id
128
130
  }
129
131
  }`,
130
132
  vars,
131
133
  sink,
132
134
  );
133
- onLatestTokens = async (
134
- vars: OnLatestTokensSubscriptionVariables,
135
- sink: Sink<ExecutionResult<OnLatestTokensSubscription>>,
135
+ onNftAssetsCreated = async (
136
+ vars: OnNftAssetsCreatedSubscriptionVariables,
137
+ sink: Sink<ExecutionResult<OnNftAssetsCreatedSubscription>>,
136
138
  ) =>
137
139
  this.sdk.subscribe(
138
- `subscription OnLatestTokens($id: String, $networkId: Int, $tokenAddress: String) {
139
- onLatestTokens (id: $id, networkId: $networkId, tokenAddress: $tokenAddress) {
140
- 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
140
+ `subscription OnNftAssetsCreated($address: String, $networkId: Int, $tokenId: String) {
141
+ onNftAssetsCreated (address: $address, networkId: $networkId, tokenId: $tokenId) {
142
+ 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
141
143
  }
142
144
  }`,
143
145
  vars,
144
146
  sink,
145
147
  );
146
- onNftAssetsCreated = async (
147
- vars: OnNftAssetsCreatedSubscriptionVariables,
148
- sink: Sink<ExecutionResult<OnNftAssetsCreatedSubscription>>,
148
+ onPriceUpdated = async (
149
+ vars: OnPriceUpdatedSubscriptionVariables,
150
+ sink: Sink<ExecutionResult<OnPriceUpdatedSubscription>>,
149
151
  ) =>
150
152
  this.sdk.subscribe(
151
- `subscription OnNftAssetsCreated($address: String, $networkId: Int, $tokenId: String) {
152
- onNftAssetsCreated (address: $address, networkId: $networkId, tokenId: $tokenId) {
153
- 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
153
+ `subscription OnPriceUpdated($address: String, $networkId: Int) {
154
+ onPriceUpdated (address: $address, networkId: $networkId) {
155
+ address, confidence, networkId, priceUsd, timestamp
154
156
  }
155
157
  }`,
156
158
  vars,
157
159
  sink,
158
160
  );
159
- onUnconfirmedEventsCreated = async (
160
- vars: OnUnconfirmedEventsCreatedSubscriptionVariables,
161
- sink: Sink<ExecutionResult<OnUnconfirmedEventsCreatedSubscription>>,
161
+ onLatestTokens = async (
162
+ vars: OnLatestTokensSubscriptionVariables,
163
+ sink: Sink<ExecutionResult<OnLatestTokensSubscription>>,
162
164
  ) =>
163
165
  this.sdk.subscribe(
164
- `subscription OnUnconfirmedEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
165
- onUnconfirmedEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
166
- address, events { address, blockHash, blockNumber, eventDisplayType, eventType, id, logIndex, maker, networkId, quoteToken, supplementalIndex, timestamp, transactionHash, transactionIndex }, id, networkId, quoteToken
166
+ `subscription OnLatestTokens($id: String, $networkId: Int, $tokenAddress: String) {
167
+ onLatestTokens (id: $id, networkId: $networkId, tokenAddress: $tokenAddress) {
168
+ 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
167
169
  }
168
170
  }`,
169
171
  vars,
170
172
  sink,
171
173
  );
172
- onEventLabelCreated = async (
173
- vars: OnEventLabelCreatedSubscriptionVariables,
174
- sink: Sink<ExecutionResult<OnEventLabelCreatedSubscription>>,
174
+ onNftPoolEventsCreated = async (
175
+ vars: OnNftPoolEventsCreatedSubscriptionVariables,
176
+ sink: Sink<ExecutionResult<OnNftPoolEventsCreatedSubscription>>,
175
177
  ) =>
176
178
  this.sdk.subscribe(
177
- `subscription OnEventLabelCreated($id: String) {
178
- onEventLabelCreated (id: $id) {
179
- id, label, logIndex, networkId, timestamp, transactionHash, transactionIndex
179
+ `subscription OnNftPoolEventsCreated($collectionAddress: String, $exchangeAddress: String, $networkId: Int, $poolAddress: String) {
180
+ onNftPoolEventsCreated (collectionAddress: $collectionAddress, exchangeAddress: $exchangeAddress, networkId: $networkId, poolAddress: $poolAddress) {
181
+ 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
180
182
  }
181
183
  }`,
182
184
  vars,
183
185
  sink,
184
186
  );
185
- onPriceUpdated = async (
186
- vars: OnPriceUpdatedSubscriptionVariables,
187
- sink: Sink<ExecutionResult<OnPriceUpdatedSubscription>>,
187
+ onSimulateTokenContract = async (
188
+ vars: OnSimulateTokenContractSubscriptionVariables,
189
+ sink: Sink<ExecutionResult<OnSimulateTokenContractSubscription>>,
188
190
  ) =>
189
191
  this.sdk.subscribe(
190
- `subscription OnPriceUpdated($address: String, $networkId: Int) {
191
- onPriceUpdated (address: $address, networkId: $networkId) {
192
- address, confidence, networkId, priceUsd, timestamp
192
+ `subscription OnSimulateTokenContract($contractAddress: String, $networkId: Int!, $simulationId: String) {
193
+ onSimulateTokenContract (contractAddress: $contractAddress, networkId: $networkId, simulationId: $simulationId) {
194
+ 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
193
195
  }
194
196
  }`,
195
197
  vars,
196
198
  sink,
197
199
  );
198
- onNftPoolEventsCreated = async (
199
- vars: OnNftPoolEventsCreatedSubscriptionVariables,
200
- sink: Sink<ExecutionResult<OnNftPoolEventsCreatedSubscription>>,
200
+ onEventsCreated = async (
201
+ vars: OnEventsCreatedSubscriptionVariables,
202
+ sink: Sink<ExecutionResult<OnEventsCreatedSubscription>>,
201
203
  ) =>
202
204
  this.sdk.subscribe(
203
- `subscription OnNftPoolEventsCreated($collectionAddress: String, $exchangeAddress: String, $networkId: Int, $poolAddress: String) {
204
- onNftPoolEventsCreated (collectionAddress: $collectionAddress, exchangeAddress: $exchangeAddress, networkId: $networkId, poolAddress: $poolAddress) {
205
- collectionAddress, events { blockHash, blockNumber, collectionAddress, collectionId, eventType, exchangeAddress, id, logIndex, maker, networkId, poolAddress, poolType, timestamp, tokenAddress, transactionHash, transactionIndex }, exchangeAddress, id, networkId, poolAddress
205
+ `subscription OnEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
206
+ onEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
207
+ 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, token0PoolValueUsd, token0SwapValueUsd, token0ValueBase, token1PoolValueUsd, token1SwapValueUsd, token1ValueBase, transactionHash, transactionIndex }, id, networkId, quoteToken
206
208
  }
207
209
  }`,
208
210
  vars,
209
211
  sink,
210
212
  );
213
+ onEventLabelCreated = async (
214
+ vars: OnEventLabelCreatedSubscriptionVariables,
215
+ sink: Sink<ExecutionResult<OnEventLabelCreatedSubscription>>,
216
+ ) =>
217
+ this.sdk.subscribe(
218
+ `subscription OnEventLabelCreated($id: String) {
219
+ onEventLabelCreated(id: $id) {
220
+ data {
221
+ ... on FrontRunLabelData {
222
+ index
223
+ token0DrainedAmount
224
+ token1DrainedAmount
225
+ }
226
+ ... on SandwichedLabelData {
227
+ token0DrainedAmountSandwich: token0DrainedAmount
228
+ token1DrainedAmountSandwich: token1DrainedAmount
229
+ }
230
+ }
231
+ id
232
+ label
233
+ logIndex
234
+ networkId
235
+ timestamp
236
+ transactionHash
237
+ transactionIndex
238
+ }
239
+ }
240
+ `,
241
+ vars,
242
+ sink,
243
+ );
211
244
  onTokenLifecycleEventsCreated = async (
212
245
  vars: OnTokenLifecycleEventsCreatedSubscriptionVariables,
213
246
  sink: Sink<ExecutionResult<OnTokenLifecycleEventsCreatedSubscription>>,
@@ -215,33 +248,33 @@ export class Subscribe {
215
248
  this.sdk.subscribe(
216
249
  `subscription OnTokenLifecycleEventsCreated($address: String, $networkId: Int) {
217
250
  onTokenLifecycleEventsCreated (address: $address, networkId: $networkId) {
218
- events { blockHash, blockNumber, eventType, id, logIndex, maker, networkId, timestamp, tokenAddress, transactionHash, transactionIndex }, id
251
+ events { blockHash, blockNumber, data { ... on TokenBurnEventData { amount, circulatingSupply, totalSupply }, ... on TokenMintEventData { amount, circulatingSupply, totalSupply } }, eventType, id, logIndex, maker, networkId, timestamp, tokenAddress, transactionHash, transactionIndex }, id
219
252
  }
220
253
  }`,
221
254
  vars,
222
255
  sink,
223
256
  );
224
- onTokenEventsCreated = async (
225
- vars: OnTokenEventsCreatedSubscriptionVariables,
226
- sink: Sink<ExecutionResult<OnTokenEventsCreatedSubscription>>,
257
+ onDetailedStatsUpdated = async (
258
+ vars: OnDetailedStatsUpdatedSubscriptionVariables,
259
+ sink: Sink<ExecutionResult<OnDetailedStatsUpdatedSubscription>>,
227
260
  ) =>
228
261
  this.sdk.subscribe(
229
- `subscription OnTokenEventsCreated($input: OnTokenEventsCreatedInput!) {
230
- onTokenEventsCreated (input: $input) {
231
- events { address, baseTokenPrice, blockHash, blockNumber, eventDisplayType, eventType, id, labels { sandwich { label, sandwichType, token0DrainedAmount, token1DrainedAmount }, washtrade { label } }, liquidityToken, logIndex, maker, networkId, quoteToken, timestamp, token0PoolValueUsd, token0SwapValueUsd, token0ValueBase, token1PoolValueUsd, token1SwapValueUsd, token1ValueBase, transactionHash, transactionIndex }, id
262
+ `subscription OnDetailedStatsUpdated($pairId: String, $statsType: TokenPairStatisticsType, $tokenOfInterest: TokenOfInterest) {
263
+ onDetailedStatsUpdated (pairId: $pairId, statsType: $statsType, tokenOfInterest: $tokenOfInterest) {
264
+ 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
232
265
  }
233
266
  }`,
234
267
  vars,
235
268
  sink,
236
269
  );
237
- onNftEventsCreated = async (
238
- vars: OnNftEventsCreatedSubscriptionVariables,
239
- sink: Sink<ExecutionResult<OnNftEventsCreatedSubscription>>,
270
+ onPairMetadataUpdated = async (
271
+ vars: OnPairMetadataUpdatedSubscriptionVariables,
272
+ sink: Sink<ExecutionResult<OnPairMetadataUpdatedSubscription>>,
240
273
  ) =>
241
274
  this.sdk.subscribe(
242
- `subscription OnNftEventsCreated($address: String, $networkId: Int) {
243
- onNftEventsCreated (address: $address, networkId: $networkId) {
244
- 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, transactionHash, transactionIndex }, id, networkId
275
+ `subscription OnPairMetadataUpdated($id: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
276
+ onPairMetadataUpdated (id: $id, quoteToken: $quoteToken, statsType: $statsType) {
277
+ 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
245
278
  }
246
279
  }`,
247
280
  vars,