@codex-data/sdk 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/resources/generated_queries/Balances.graphql +2 -0
- package/dist/resources/generated_queries/FilterTokens.graphql +11 -0
- package/dist/resources/generated_queries/GetBars.graphql +143 -0
- package/dist/resources/generated_queries/Holders.graphql +2 -0
- package/dist/resources/generated_queries/PairMetadata.graphql +4 -0
- package/dist/resources/generated_queries/PrimeHolders.graphql +2 -0
- package/dist/resources/generated_subscriptions/OnHoldersUpdated.graphql +17 -0
- package/dist/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +4 -0
- package/dist/resources/generated_subscriptions/OnUnconfirmedEventsCreated.graphql +1 -0
- package/dist/resources/graphql.d.ts +207 -113
- package/dist/resources/graphql.d.ts.map +1 -1
- package/dist/resources/graphql.js +26 -2
- package/dist/resources/graphql.js.map +1 -1
- package/dist/resources/graphql.schema.json +1031 -764
- package/dist/resources/graphql.ts +213 -128
- package/dist/resources/schema.graphql +312 -158
- package/dist/sdk/Mutation.d.ts +2 -2
- package/dist/sdk/Mutation.d.ts.map +1 -1
- package/dist/sdk/Mutation.js +2 -2
- package/dist/sdk/Mutation.js.map +1 -1
- package/dist/sdk/Query.d.ts +50 -59
- package/dist/sdk/Query.d.ts.map +1 -1
- package/dist/sdk/Query.js +49 -58
- package/dist/sdk/Query.js.map +1 -1
- package/dist/sdk/Subscribe.d.ts +13 -12
- package/dist/sdk/Subscribe.d.ts.map +1 -1
- package/dist/sdk/Subscribe.js +86 -79
- package/dist/sdk/Subscribe.js.map +1 -1
- package/dist/sdk/generated/gql.d.ts +24 -91
- package/dist/sdk/generated/gql.d.ts.map +1 -1
- package/dist/sdk/generated/gql.js +9 -17
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +476 -494
- package/dist/sdk/generated/graphql.d.ts.map +1 -1
- package/dist/sdk/generated/graphql.js +37 -21
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/package.json +1 -1
- package/src/resources/generated_queries/Balances.graphql +2 -0
- package/src/resources/generated_queries/FilterTokens.graphql +11 -0
- package/src/resources/generated_queries/GetBars.graphql +143 -0
- package/src/resources/generated_queries/Holders.graphql +2 -0
- package/src/resources/generated_queries/PairMetadata.graphql +4 -0
- package/src/resources/generated_queries/PrimeHolders.graphql +2 -0
- package/src/resources/generated_subscriptions/OnHoldersUpdated.graphql +17 -0
- package/src/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +4 -0
- package/src/resources/generated_subscriptions/OnUnconfirmedEventsCreated.graphql +1 -0
- package/src/resources/graphql.schema.json +1031 -764
- package/src/resources/graphql.ts +213 -128
- package/src/resources/schema.graphql +312 -158
- package/src/sdk/Mutation.ts +4 -4
- package/src/sdk/Query.ts +105 -141
- package/src/sdk/Subscribe.ts +125 -110
- package/src/sdk/generated/gql.ts +21 -61
- package/src/sdk/generated/graphql.ts +241 -227
- package/dist/resources/generated_queries/BackfillWalletState.graphql +0 -3
- package/dist/resources/generated_queries/GetLatestPairs.graphql +0 -57
- package/dist/resources/generated_queries/GetParallelAssets.graphql +0 -50
- package/dist/resources/generated_queries/GetTokenCount.graphql +0 -3
- package/dist/resources/generated_queries/GetTokenInfo.graphql +0 -18
- package/dist/resources/generated_queries/GetTokensInfo.graphql +0 -18
- package/dist/resources/generated_queries/GetUniV3Ticks.graphql +0 -22
- package/dist/resources/generated_queries/ListFavoriteTokens.graphql +0 -59
- package/dist/resources/generated_queries/PrimeBalance.graphql +0 -12
- package/src/resources/generated_queries/BackfillWalletState.graphql +0 -3
- package/src/resources/generated_queries/GetLatestPairs.graphql +0 -57
- package/src/resources/generated_queries/GetParallelAssets.graphql +0 -50
- package/src/resources/generated_queries/GetTokenCount.graphql +0 -3
- package/src/resources/generated_queries/GetTokenInfo.graphql +0 -18
- package/src/resources/generated_queries/GetTokensInfo.graphql +0 -18
- package/src/resources/generated_queries/GetUniV3Ticks.graphql +0 -22
- package/src/resources/generated_queries/ListFavoriteTokens.graphql +0 -59
- package/src/resources/generated_queries/PrimeBalance.graphql +0 -12
package/src/sdk/Subscribe.ts
CHANGED
|
@@ -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,27 +45,40 @@ import { Codex } from "./index";
|
|
|
43
45
|
|
|
44
46
|
export class Subscribe {
|
|
45
47
|
constructor(private sdk: Codex) {}
|
|
46
|
-
|
|
47
|
-
vars:
|
|
48
|
-
sink: Sink<ExecutionResult<
|
|
48
|
+
onHoldersUpdated = async (
|
|
49
|
+
vars: OnHoldersUpdatedSubscriptionVariables,
|
|
50
|
+
sink: Sink<ExecutionResult<OnHoldersUpdatedSubscription>>,
|
|
49
51
|
) =>
|
|
50
52
|
this.sdk.subscribe(
|
|
51
|
-
`subscription
|
|
52
|
-
|
|
53
|
-
address,
|
|
53
|
+
`subscription OnHoldersUpdated($tokenId: String!) {
|
|
54
|
+
onHoldersUpdated (tokenId: $tokenId) {
|
|
55
|
+
balances { address, balance, firstHeldTimestamp, shiftedBalance, tokenAddress, tokenId, walletId }, holders, networkId, tokenAddress, tokenId
|
|
54
56
|
}
|
|
55
57
|
}`,
|
|
56
58
|
vars,
|
|
57
59
|
sink,
|
|
58
60
|
);
|
|
59
|
-
|
|
60
|
-
vars:
|
|
61
|
-
sink: Sink<ExecutionResult<
|
|
61
|
+
onUnconfirmedBarsUpdated = async (
|
|
62
|
+
vars: OnUnconfirmedBarsUpdatedSubscriptionVariables,
|
|
63
|
+
sink: Sink<ExecutionResult<OnUnconfirmedBarsUpdatedSubscription>>,
|
|
62
64
|
) =>
|
|
63
65
|
this.sdk.subscribe(
|
|
64
|
-
`subscription
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
`subscription OnUnconfirmedBarsUpdated($pairId: String, $quoteToken: QuoteToken) {
|
|
67
|
+
onUnconfirmedBarsUpdated (pairId: $pairId, quoteToken: $quoteToken) {
|
|
68
|
+
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
|
|
69
|
+
}
|
|
70
|
+
}`,
|
|
71
|
+
vars,
|
|
72
|
+
sink,
|
|
73
|
+
);
|
|
74
|
+
onUnconfirmedEventsCreated = async (
|
|
75
|
+
vars: OnUnconfirmedEventsCreatedSubscriptionVariables,
|
|
76
|
+
sink: Sink<ExecutionResult<OnUnconfirmedEventsCreatedSubscription>>,
|
|
77
|
+
) =>
|
|
78
|
+
this.sdk.subscribe(
|
|
79
|
+
`subscription OnUnconfirmedEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
|
|
80
|
+
onUnconfirmedEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
|
|
81
|
+
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
82
|
}
|
|
68
83
|
}`,
|
|
69
84
|
vars,
|
|
@@ -82,29 +97,47 @@ export class Subscribe {
|
|
|
82
97
|
vars,
|
|
83
98
|
sink,
|
|
84
99
|
);
|
|
85
|
-
|
|
86
|
-
vars:
|
|
87
|
-
sink: Sink<ExecutionResult<
|
|
100
|
+
onNftPoolEventsCreated = async (
|
|
101
|
+
vars: OnNftPoolEventsCreatedSubscriptionVariables,
|
|
102
|
+
sink: Sink<ExecutionResult<OnNftPoolEventsCreatedSubscription>>,
|
|
88
103
|
) =>
|
|
89
104
|
this.sdk.subscribe(
|
|
90
|
-
`subscription
|
|
91
|
-
|
|
92
|
-
|
|
105
|
+
`subscription OnNftPoolEventsCreated($collectionAddress: String, $exchangeAddress: String, $networkId: Int, $poolAddress: String) {
|
|
106
|
+
onNftPoolEventsCreated (collectionAddress: $collectionAddress, exchangeAddress: $exchangeAddress, networkId: $networkId, poolAddress: $poolAddress) {
|
|
107
|
+
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
|
|
93
108
|
}
|
|
94
109
|
}`,
|
|
95
110
|
vars,
|
|
96
111
|
sink,
|
|
97
112
|
);
|
|
98
|
-
|
|
99
|
-
vars:
|
|
100
|
-
sink: Sink<ExecutionResult<
|
|
113
|
+
onEventLabelCreated = async (
|
|
114
|
+
vars: OnEventLabelCreatedSubscriptionVariables,
|
|
115
|
+
sink: Sink<ExecutionResult<OnEventLabelCreatedSubscription>>,
|
|
101
116
|
) =>
|
|
102
117
|
this.sdk.subscribe(
|
|
103
|
-
`subscription
|
|
104
|
-
|
|
105
|
-
|
|
118
|
+
`subscription OnEventLabelCreated($id: String) {
|
|
119
|
+
onEventLabelCreated(id: $id) {
|
|
120
|
+
data {
|
|
121
|
+
... on FrontRunLabelData {
|
|
122
|
+
index
|
|
123
|
+
token0DrainedAmount
|
|
124
|
+
token1DrainedAmount
|
|
125
|
+
}
|
|
126
|
+
... on SandwichedLabelData {
|
|
127
|
+
token0DrainedAmountSandwich: token0DrainedAmount
|
|
128
|
+
token1DrainedAmountSandwich: token1DrainedAmount
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
id
|
|
132
|
+
label
|
|
133
|
+
logIndex
|
|
134
|
+
networkId
|
|
135
|
+
timestamp
|
|
136
|
+
transactionHash
|
|
137
|
+
transactionIndex
|
|
106
138
|
}
|
|
107
|
-
}
|
|
139
|
+
}
|
|
140
|
+
`,
|
|
108
141
|
vars,
|
|
109
142
|
sink,
|
|
110
143
|
);
|
|
@@ -134,162 +167,144 @@ export class Subscribe {
|
|
|
134
167
|
vars,
|
|
135
168
|
sink,
|
|
136
169
|
);
|
|
137
|
-
|
|
138
|
-
vars:
|
|
139
|
-
sink: Sink<ExecutionResult<
|
|
170
|
+
onNftEventsCreated = async (
|
|
171
|
+
vars: OnNftEventsCreatedSubscriptionVariables,
|
|
172
|
+
sink: Sink<ExecutionResult<OnNftEventsCreatedSubscription>>,
|
|
140
173
|
) =>
|
|
141
174
|
this.sdk.subscribe(
|
|
142
|
-
`subscription
|
|
143
|
-
|
|
144
|
-
address,
|
|
175
|
+
`subscription OnNftEventsCreated($address: String, $networkId: Int) {
|
|
176
|
+
onNftEventsCreated (address: $address, networkId: $networkId) {
|
|
177
|
+
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
|
|
145
178
|
}
|
|
146
179
|
}`,
|
|
147
180
|
vars,
|
|
148
181
|
sink,
|
|
149
182
|
);
|
|
150
|
-
|
|
151
|
-
vars:
|
|
152
|
-
sink: Sink<ExecutionResult<
|
|
183
|
+
onPriceUpdated = async (
|
|
184
|
+
vars: OnPriceUpdatedSubscriptionVariables,
|
|
185
|
+
sink: Sink<ExecutionResult<OnPriceUpdatedSubscription>>,
|
|
153
186
|
) =>
|
|
154
187
|
this.sdk.subscribe(
|
|
155
|
-
`subscription
|
|
156
|
-
|
|
157
|
-
address,
|
|
188
|
+
`subscription OnPriceUpdated($address: String, $networkId: Int, $sourcePairAddress: String) {
|
|
189
|
+
onPriceUpdated (address: $address, networkId: $networkId, sourcePairAddress: $sourcePairAddress) {
|
|
190
|
+
address, confidence, networkId, poolAddress, priceUsd, timestamp
|
|
158
191
|
}
|
|
159
192
|
}`,
|
|
160
193
|
vars,
|
|
161
194
|
sink,
|
|
162
195
|
);
|
|
163
|
-
|
|
164
|
-
vars:
|
|
165
|
-
sink: Sink<ExecutionResult<
|
|
196
|
+
onLatestTokens = async (
|
|
197
|
+
vars: OnLatestTokensSubscriptionVariables,
|
|
198
|
+
sink: Sink<ExecutionResult<OnLatestTokensSubscription>>,
|
|
166
199
|
) =>
|
|
167
200
|
this.sdk.subscribe(
|
|
168
|
-
`subscription
|
|
169
|
-
|
|
170
|
-
|
|
201
|
+
`subscription OnLatestTokens($id: String, $networkId: Int, $tokenAddress: String) {
|
|
202
|
+
onLatestTokens (id: $id, networkId: $networkId, tokenAddress: $tokenAddress) {
|
|
203
|
+
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
|
|
171
204
|
}
|
|
172
205
|
}`,
|
|
173
206
|
vars,
|
|
174
207
|
sink,
|
|
175
208
|
);
|
|
176
|
-
|
|
177
|
-
vars:
|
|
178
|
-
sink: Sink<ExecutionResult<
|
|
209
|
+
onPairMetadataUpdated = async (
|
|
210
|
+
vars: OnPairMetadataUpdatedSubscriptionVariables,
|
|
211
|
+
sink: Sink<ExecutionResult<OnPairMetadataUpdatedSubscription>>,
|
|
179
212
|
) =>
|
|
180
213
|
this.sdk.subscribe(
|
|
181
|
-
`subscription
|
|
182
|
-
|
|
183
|
-
|
|
214
|
+
`subscription OnPairMetadataUpdated($id: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
|
|
215
|
+
onPairMetadataUpdated (id: $id, quoteToken: $quoteToken, statsType: $statsType) {
|
|
216
|
+
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, 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, 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
|
|
184
217
|
}
|
|
185
218
|
}`,
|
|
186
219
|
vars,
|
|
187
220
|
sink,
|
|
188
221
|
);
|
|
189
|
-
|
|
190
|
-
vars:
|
|
191
|
-
sink: Sink<ExecutionResult<
|
|
222
|
+
onSimulateTokenContract = async (
|
|
223
|
+
vars: OnSimulateTokenContractSubscriptionVariables,
|
|
224
|
+
sink: Sink<ExecutionResult<OnSimulateTokenContractSubscription>>,
|
|
192
225
|
) =>
|
|
193
226
|
this.sdk.subscribe(
|
|
194
|
-
`subscription
|
|
195
|
-
|
|
196
|
-
|
|
227
|
+
`subscription OnSimulateTokenContract($contractAddress: String, $networkId: Int!, $simulationId: String) {
|
|
228
|
+
onSimulateTokenContract (contractAddress: $contractAddress, networkId: $networkId, simulationId: $simulationId) {
|
|
229
|
+
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
|
|
197
230
|
}
|
|
198
231
|
}`,
|
|
199
232
|
vars,
|
|
200
233
|
sink,
|
|
201
234
|
);
|
|
202
|
-
|
|
203
|
-
vars:
|
|
204
|
-
sink: Sink<ExecutionResult<
|
|
235
|
+
onLatestPairUpdated = async (
|
|
236
|
+
vars: OnLatestPairUpdatedSubscriptionVariables,
|
|
237
|
+
sink: Sink<ExecutionResult<OnLatestPairUpdatedSubscription>>,
|
|
205
238
|
) =>
|
|
206
239
|
this.sdk.subscribe(
|
|
207
|
-
`subscription
|
|
208
|
-
|
|
209
|
-
address,
|
|
240
|
+
`subscription OnLatestPairUpdated($id: String, $networkId: Int) {
|
|
241
|
+
onLatestPairUpdated (id: $id, networkId: $networkId) {
|
|
242
|
+
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
|
|
210
243
|
}
|
|
211
244
|
}`,
|
|
212
245
|
vars,
|
|
213
246
|
sink,
|
|
214
247
|
);
|
|
215
|
-
|
|
216
|
-
vars:
|
|
217
|
-
sink: Sink<ExecutionResult<
|
|
248
|
+
onEventsCreated = async (
|
|
249
|
+
vars: OnEventsCreatedSubscriptionVariables,
|
|
250
|
+
sink: Sink<ExecutionResult<OnEventsCreatedSubscription>>,
|
|
218
251
|
) =>
|
|
219
252
|
this.sdk.subscribe(
|
|
220
|
-
`subscription
|
|
221
|
-
|
|
222
|
-
blockHash, blockNumber,
|
|
253
|
+
`subscription OnEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
|
|
254
|
+
onEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
|
|
255
|
+
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
|
|
223
256
|
}
|
|
224
257
|
}`,
|
|
225
258
|
vars,
|
|
226
259
|
sink,
|
|
227
260
|
);
|
|
228
|
-
|
|
229
|
-
vars:
|
|
230
|
-
sink: Sink<ExecutionResult<
|
|
261
|
+
onBarsUpdated = async (
|
|
262
|
+
vars: OnBarsUpdatedSubscriptionVariables,
|
|
263
|
+
sink: Sink<ExecutionResult<OnBarsUpdatedSubscription>>,
|
|
231
264
|
) =>
|
|
232
265
|
this.sdk.subscribe(
|
|
233
|
-
`subscription
|
|
234
|
-
|
|
235
|
-
|
|
266
|
+
`subscription OnBarsUpdated($pairId: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
|
|
267
|
+
onBarsUpdated (pairId: $pairId, quoteToken: $quoteToken, statsType: $statsType) {
|
|
268
|
+
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
|
|
236
269
|
}
|
|
237
270
|
}`,
|
|
238
271
|
vars,
|
|
239
272
|
sink,
|
|
240
273
|
);
|
|
241
|
-
|
|
242
|
-
vars:
|
|
243
|
-
sink: Sink<ExecutionResult<
|
|
274
|
+
onNftAssetsCreated = async (
|
|
275
|
+
vars: OnNftAssetsCreatedSubscriptionVariables,
|
|
276
|
+
sink: Sink<ExecutionResult<OnNftAssetsCreatedSubscription>>,
|
|
244
277
|
) =>
|
|
245
278
|
this.sdk.subscribe(
|
|
246
|
-
`subscription
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
... on FrontRunLabelData {
|
|
250
|
-
index
|
|
251
|
-
token0DrainedAmount
|
|
252
|
-
token1DrainedAmount
|
|
253
|
-
}
|
|
254
|
-
... on SandwichedLabelData {
|
|
255
|
-
token0DrainedAmountSandwich: token0DrainedAmount
|
|
256
|
-
token1DrainedAmountSandwich: token1DrainedAmount
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
id
|
|
260
|
-
label
|
|
261
|
-
logIndex
|
|
262
|
-
networkId
|
|
263
|
-
timestamp
|
|
264
|
-
transactionHash
|
|
265
|
-
transactionIndex
|
|
279
|
+
`subscription OnNftAssetsCreated($address: String, $networkId: Int, $tokenId: String) {
|
|
280
|
+
onNftAssetsCreated (address: $address, networkId: $networkId, tokenId: $tokenId) {
|
|
281
|
+
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
|
|
266
282
|
}
|
|
267
|
-
}
|
|
268
|
-
`,
|
|
283
|
+
}`,
|
|
269
284
|
vars,
|
|
270
285
|
sink,
|
|
271
286
|
);
|
|
272
|
-
|
|
273
|
-
vars:
|
|
274
|
-
sink: Sink<ExecutionResult<
|
|
287
|
+
onDetailedStatsUpdated = async (
|
|
288
|
+
vars: OnDetailedStatsUpdatedSubscriptionVariables,
|
|
289
|
+
sink: Sink<ExecutionResult<OnDetailedStatsUpdatedSubscription>>,
|
|
275
290
|
) =>
|
|
276
291
|
this.sdk.subscribe(
|
|
277
|
-
`subscription
|
|
278
|
-
|
|
279
|
-
|
|
292
|
+
`subscription OnDetailedStatsUpdated($pairId: String, $statsType: TokenPairStatisticsType, $tokenOfInterest: TokenOfInterest) {
|
|
293
|
+
onDetailedStatsUpdated (pairId: $pairId, statsType: $statsType, tokenOfInterest: $tokenOfInterest) {
|
|
294
|
+
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
|
|
280
295
|
}
|
|
281
296
|
}`,
|
|
282
297
|
vars,
|
|
283
298
|
sink,
|
|
284
299
|
);
|
|
285
|
-
|
|
286
|
-
vars:
|
|
287
|
-
sink: Sink<ExecutionResult<
|
|
300
|
+
onPricesUpdated = async (
|
|
301
|
+
vars: OnPricesUpdatedSubscriptionVariables,
|
|
302
|
+
sink: Sink<ExecutionResult<OnPricesUpdatedSubscription>>,
|
|
288
303
|
) =>
|
|
289
304
|
this.sdk.subscribe(
|
|
290
|
-
`subscription
|
|
291
|
-
|
|
292
|
-
|
|
305
|
+
`subscription OnPricesUpdated($input: [OnPricesUpdatedInput!]!) {
|
|
306
|
+
onPricesUpdated (input: $input) {
|
|
307
|
+
address, confidence, networkId, poolAddress, priceUsd, timestamp
|
|
293
308
|
}
|
|
294
309
|
}`,
|
|
295
310
|
vars,
|