@codex-data/sdk 1.0.4 → 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/FilterPairs.graphql +0 -44
- package/dist/resources/generated_queries/FilterTokens.graphql +0 -33
- package/dist/resources/generated_queries/GetBars.graphql +0 -22
- package/dist/resources/generated_queries/GetCommunityNotes.graphql +0 -11
- package/dist/resources/generated_queries/GetDetailedPairStats.graphql +0 -22
- package/dist/resources/generated_queries/GetDetailedPairsStats.graphql +0 -22
- package/dist/resources/generated_queries/Holders.graphql +2 -0
- package/dist/resources/generated_queries/ListPairsForToken.graphql +0 -22
- package/dist/resources/generated_queries/ListPairsWithMetadataForToken.graphql +0 -44
- package/dist/resources/generated_queries/PairMetadata.graphql +0 -22
- package/dist/resources/generated_queries/PrimeHolders.graphql +2 -0
- package/dist/resources/generated_queries/Token.graphql +0 -11
- package/dist/resources/generated_queries/Tokens.graphql +0 -11
- package/dist/resources/generated_subscriptions/OnHoldersUpdated.graphql +2 -0
- package/dist/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +0 -22
- package/dist/resources/graphql.d.ts +33 -32
- package/dist/resources/graphql.d.ts.map +1 -1
- package/dist/resources/graphql.js +9 -2
- package/dist/resources/graphql.js.map +1 -1
- package/dist/resources/graphql.schema.json +336 -172
- package/dist/resources/graphql.ts +35 -34
- package/dist/resources/schema.graphql +37 -41
- 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 +47 -47
- package/dist/sdk/Query.d.ts.map +1 -1
- package/dist/sdk/Query.js +47 -47
- package/dist/sdk/Query.js.map +1 -1
- package/dist/sdk/Subscribe.d.ts +13 -13
- package/dist/sdk/Subscribe.d.ts.map +1 -1
- package/dist/sdk/Subscribe.js +79 -79
- package/dist/sdk/Subscribe.js.map +1 -1
- package/dist/sdk/generated/gql.d.ts +32 -32
- package/dist/sdk/generated/gql.d.ts.map +1 -1
- package/dist/sdk/generated/gql.js +16 -16
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +41 -344
- package/dist/sdk/generated/graphql.d.ts.map +1 -1
- package/dist/sdk/generated/graphql.js +27 -20
- 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/FilterPairs.graphql +0 -44
- package/src/resources/generated_queries/FilterTokens.graphql +0 -33
- package/src/resources/generated_queries/GetBars.graphql +0 -22
- package/src/resources/generated_queries/GetCommunityNotes.graphql +0 -11
- package/src/resources/generated_queries/GetDetailedPairStats.graphql +0 -22
- package/src/resources/generated_queries/GetDetailedPairsStats.graphql +0 -22
- package/src/resources/generated_queries/Holders.graphql +2 -0
- package/src/resources/generated_queries/ListPairsForToken.graphql +0 -22
- package/src/resources/generated_queries/ListPairsWithMetadataForToken.graphql +0 -44
- package/src/resources/generated_queries/PairMetadata.graphql +0 -22
- package/src/resources/generated_queries/PrimeHolders.graphql +2 -0
- package/src/resources/generated_queries/Token.graphql +0 -11
- package/src/resources/generated_queries/Tokens.graphql +0 -11
- package/src/resources/generated_subscriptions/OnHoldersUpdated.graphql +2 -0
- package/src/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +0 -22
- package/src/resources/graphql.schema.json +336 -172
- package/src/resources/graphql.ts +35 -34
- package/src/resources/schema.graphql +37 -41
- package/src/sdk/Mutation.ts +4 -4
- package/src/sdk/Query.ts +99 -99
- package/src/sdk/Subscribe.ts +133 -133
- package/src/sdk/generated/gql.ts +32 -32
- package/src/sdk/generated/graphql.ts +67 -66
package/src/sdk/Subscribe.ts
CHANGED
|
@@ -45,14 +45,27 @@ import { Codex } from "./index";
|
|
|
45
45
|
|
|
46
46
|
export class Subscribe {
|
|
47
47
|
constructor(private sdk: Codex) {}
|
|
48
|
-
|
|
49
|
-
vars:
|
|
50
|
-
sink: Sink<ExecutionResult<
|
|
48
|
+
onHoldersUpdated = async (
|
|
49
|
+
vars: OnHoldersUpdatedSubscriptionVariables,
|
|
50
|
+
sink: Sink<ExecutionResult<OnHoldersUpdatedSubscription>>,
|
|
51
51
|
) =>
|
|
52
52
|
this.sdk.subscribe(
|
|
53
|
-
`subscription
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
`subscription OnHoldersUpdated($tokenId: String!) {
|
|
54
|
+
onHoldersUpdated (tokenId: $tokenId) {
|
|
55
|
+
balances { address, balance, firstHeldTimestamp, shiftedBalance, tokenAddress, tokenId, walletId }, holders, networkId, tokenAddress, tokenId
|
|
56
|
+
}
|
|
57
|
+
}`,
|
|
58
|
+
vars,
|
|
59
|
+
sink,
|
|
60
|
+
);
|
|
61
|
+
onUnconfirmedBarsUpdated = async (
|
|
62
|
+
vars: OnUnconfirmedBarsUpdatedSubscriptionVariables,
|
|
63
|
+
sink: Sink<ExecutionResult<OnUnconfirmedBarsUpdatedSubscription>>,
|
|
64
|
+
) =>
|
|
65
|
+
this.sdk.subscribe(
|
|
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
|
|
56
69
|
}
|
|
57
70
|
}`,
|
|
58
71
|
vars,
|
|
@@ -71,79 +84,110 @@ export class Subscribe {
|
|
|
71
84
|
vars,
|
|
72
85
|
sink,
|
|
73
86
|
);
|
|
74
|
-
|
|
75
|
-
vars:
|
|
76
|
-
sink: Sink<ExecutionResult<
|
|
87
|
+
onTokenBarsUpdated = async (
|
|
88
|
+
vars: OnTokenBarsUpdatedSubscriptionVariables,
|
|
89
|
+
sink: Sink<ExecutionResult<OnTokenBarsUpdatedSubscription>>,
|
|
77
90
|
) =>
|
|
78
91
|
this.sdk.subscribe(
|
|
79
|
-
`subscription
|
|
80
|
-
|
|
81
|
-
|
|
92
|
+
`subscription OnTokenBarsUpdated($statsType: TokenPairStatisticsType, $tokenId: String) {
|
|
93
|
+
onTokenBarsUpdated (statsType: $statsType, tokenId: $tokenId) {
|
|
94
|
+
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
|
|
82
95
|
}
|
|
83
96
|
}`,
|
|
84
97
|
vars,
|
|
85
98
|
sink,
|
|
86
99
|
);
|
|
87
|
-
|
|
88
|
-
vars:
|
|
89
|
-
sink: Sink<ExecutionResult<
|
|
100
|
+
onNftPoolEventsCreated = async (
|
|
101
|
+
vars: OnNftPoolEventsCreatedSubscriptionVariables,
|
|
102
|
+
sink: Sink<ExecutionResult<OnNftPoolEventsCreatedSubscription>>,
|
|
90
103
|
) =>
|
|
91
104
|
this.sdk.subscribe(
|
|
92
|
-
`subscription
|
|
93
|
-
|
|
94
|
-
|
|
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
|
|
95
108
|
}
|
|
96
109
|
}`,
|
|
97
110
|
vars,
|
|
98
111
|
sink,
|
|
99
112
|
);
|
|
100
|
-
|
|
101
|
-
vars:
|
|
102
|
-
sink: Sink<ExecutionResult<
|
|
113
|
+
onEventLabelCreated = async (
|
|
114
|
+
vars: OnEventLabelCreatedSubscriptionVariables,
|
|
115
|
+
sink: Sink<ExecutionResult<OnEventLabelCreatedSubscription>>,
|
|
103
116
|
) =>
|
|
104
117
|
this.sdk.subscribe(
|
|
105
|
-
`subscription
|
|
106
|
-
|
|
107
|
-
|
|
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
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
`,
|
|
141
|
+
vars,
|
|
142
|
+
sink,
|
|
143
|
+
);
|
|
144
|
+
onTokenLifecycleEventsCreated = async (
|
|
145
|
+
vars: OnTokenLifecycleEventsCreatedSubscriptionVariables,
|
|
146
|
+
sink: Sink<ExecutionResult<OnTokenLifecycleEventsCreatedSubscription>>,
|
|
147
|
+
) =>
|
|
148
|
+
this.sdk.subscribe(
|
|
149
|
+
`subscription OnTokenLifecycleEventsCreated($address: String, $networkId: Int) {
|
|
150
|
+
onTokenLifecycleEventsCreated (address: $address, networkId: $networkId) {
|
|
151
|
+
events { blockHash, blockNumber, data { ... on TokenBurnEventData { amount, circulatingSupply, totalSupply }, ... on TokenMintEventData { amount, circulatingSupply, totalSupply } }, eventType, id, logIndex, maker, networkId, timestamp, tokenAddress, transactionHash, transactionIndex }, id
|
|
108
152
|
}
|
|
109
153
|
}`,
|
|
110
154
|
vars,
|
|
111
155
|
sink,
|
|
112
156
|
);
|
|
113
|
-
|
|
114
|
-
vars:
|
|
115
|
-
sink: Sink<ExecutionResult<
|
|
157
|
+
onTokenEventsCreated = async (
|
|
158
|
+
vars: OnTokenEventsCreatedSubscriptionVariables,
|
|
159
|
+
sink: Sink<ExecutionResult<OnTokenEventsCreatedSubscription>>,
|
|
116
160
|
) =>
|
|
117
161
|
this.sdk.subscribe(
|
|
118
|
-
`subscription
|
|
119
|
-
|
|
120
|
-
|
|
162
|
+
`subscription OnTokenEventsCreated($input: OnTokenEventsCreatedInput!) {
|
|
163
|
+
onTokenEventsCreated (input: $input) {
|
|
164
|
+
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
|
|
121
165
|
}
|
|
122
166
|
}`,
|
|
123
167
|
vars,
|
|
124
168
|
sink,
|
|
125
169
|
);
|
|
126
|
-
|
|
127
|
-
vars:
|
|
128
|
-
sink: Sink<ExecutionResult<
|
|
170
|
+
onNftEventsCreated = async (
|
|
171
|
+
vars: OnNftEventsCreatedSubscriptionVariables,
|
|
172
|
+
sink: Sink<ExecutionResult<OnNftEventsCreatedSubscription>>,
|
|
129
173
|
) =>
|
|
130
174
|
this.sdk.subscribe(
|
|
131
|
-
`subscription
|
|
132
|
-
|
|
133
|
-
|
|
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
|
|
134
178
|
}
|
|
135
179
|
}`,
|
|
136
180
|
vars,
|
|
137
181
|
sink,
|
|
138
182
|
);
|
|
139
|
-
|
|
140
|
-
vars:
|
|
141
|
-
sink: Sink<ExecutionResult<
|
|
183
|
+
onPriceUpdated = async (
|
|
184
|
+
vars: OnPriceUpdatedSubscriptionVariables,
|
|
185
|
+
sink: Sink<ExecutionResult<OnPriceUpdatedSubscription>>,
|
|
142
186
|
) =>
|
|
143
187
|
this.sdk.subscribe(
|
|
144
|
-
`subscription
|
|
145
|
-
|
|
146
|
-
|
|
188
|
+
`subscription OnPriceUpdated($address: String, $networkId: Int, $sourcePairAddress: String) {
|
|
189
|
+
onPriceUpdated (address: $address, networkId: $networkId, sourcePairAddress: $sourcePairAddress) {
|
|
190
|
+
address, confidence, networkId, poolAddress, priceUsd, timestamp
|
|
147
191
|
}
|
|
148
192
|
}`,
|
|
149
193
|
vars,
|
|
@@ -162,150 +206,106 @@ export class Subscribe {
|
|
|
162
206
|
vars,
|
|
163
207
|
sink,
|
|
164
208
|
);
|
|
165
|
-
|
|
166
|
-
vars:
|
|
167
|
-
sink: Sink<ExecutionResult<
|
|
209
|
+
onPairMetadataUpdated = async (
|
|
210
|
+
vars: OnPairMetadataUpdatedSubscriptionVariables,
|
|
211
|
+
sink: Sink<ExecutionResult<OnPairMetadataUpdatedSubscription>>,
|
|
168
212
|
) =>
|
|
169
213
|
this.sdk.subscribe(
|
|
170
|
-
`subscription
|
|
171
|
-
|
|
172
|
-
|
|
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
|
|
173
217
|
}
|
|
174
218
|
}`,
|
|
175
219
|
vars,
|
|
176
220
|
sink,
|
|
177
221
|
);
|
|
178
|
-
|
|
179
|
-
vars:
|
|
180
|
-
sink: Sink<ExecutionResult<
|
|
222
|
+
onSimulateTokenContract = async (
|
|
223
|
+
vars: OnSimulateTokenContractSubscriptionVariables,
|
|
224
|
+
sink: Sink<ExecutionResult<OnSimulateTokenContractSubscription>>,
|
|
181
225
|
) =>
|
|
182
226
|
this.sdk.subscribe(
|
|
183
|
-
`subscription
|
|
184
|
-
|
|
185
|
-
|
|
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
|
|
186
230
|
}
|
|
187
231
|
}`,
|
|
188
232
|
vars,
|
|
189
233
|
sink,
|
|
190
234
|
);
|
|
191
|
-
|
|
192
|
-
vars:
|
|
193
|
-
sink: Sink<ExecutionResult<
|
|
235
|
+
onLatestPairUpdated = async (
|
|
236
|
+
vars: OnLatestPairUpdatedSubscriptionVariables,
|
|
237
|
+
sink: Sink<ExecutionResult<OnLatestPairUpdatedSubscription>>,
|
|
194
238
|
) =>
|
|
195
239
|
this.sdk.subscribe(
|
|
196
|
-
`subscription
|
|
197
|
-
|
|
198
|
-
|
|
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
|
|
199
243
|
}
|
|
200
244
|
}`,
|
|
201
245
|
vars,
|
|
202
246
|
sink,
|
|
203
247
|
);
|
|
204
|
-
|
|
205
|
-
vars:
|
|
206
|
-
sink: Sink<ExecutionResult<
|
|
248
|
+
onEventsCreated = async (
|
|
249
|
+
vars: OnEventsCreatedSubscriptionVariables,
|
|
250
|
+
sink: Sink<ExecutionResult<OnEventsCreatedSubscription>>,
|
|
207
251
|
) =>
|
|
208
252
|
this.sdk.subscribe(
|
|
209
|
-
`subscription
|
|
210
|
-
|
|
211
|
-
address,
|
|
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
|
|
212
256
|
}
|
|
213
257
|
}`,
|
|
214
258
|
vars,
|
|
215
259
|
sink,
|
|
216
260
|
);
|
|
217
|
-
|
|
218
|
-
vars:
|
|
219
|
-
sink: Sink<ExecutionResult<
|
|
261
|
+
onBarsUpdated = async (
|
|
262
|
+
vars: OnBarsUpdatedSubscriptionVariables,
|
|
263
|
+
sink: Sink<ExecutionResult<OnBarsUpdatedSubscription>>,
|
|
220
264
|
) =>
|
|
221
265
|
this.sdk.subscribe(
|
|
222
|
-
`subscription
|
|
223
|
-
|
|
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
|
|
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
|
|
225
269
|
}
|
|
226
270
|
}`,
|
|
227
271
|
vars,
|
|
228
272
|
sink,
|
|
229
273
|
);
|
|
230
|
-
|
|
231
|
-
vars:
|
|
232
|
-
sink: Sink<ExecutionResult<
|
|
233
|
-
) =>
|
|
234
|
-
this.sdk.subscribe(
|
|
235
|
-
`subscription OnEventLabelCreated($id: String) {
|
|
236
|
-
onEventLabelCreated(id: $id) {
|
|
237
|
-
data {
|
|
238
|
-
... on FrontRunLabelData {
|
|
239
|
-
index
|
|
240
|
-
token0DrainedAmount
|
|
241
|
-
token1DrainedAmount
|
|
242
|
-
}
|
|
243
|
-
... on SandwichedLabelData {
|
|
244
|
-
token0DrainedAmountSandwich: token0DrainedAmount
|
|
245
|
-
token1DrainedAmountSandwich: token1DrainedAmount
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
id
|
|
249
|
-
label
|
|
250
|
-
logIndex
|
|
251
|
-
networkId
|
|
252
|
-
timestamp
|
|
253
|
-
transactionHash
|
|
254
|
-
transactionIndex
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
`,
|
|
258
|
-
vars,
|
|
259
|
-
sink,
|
|
260
|
-
);
|
|
261
|
-
onPricesUpdated = async (
|
|
262
|
-
vars: OnPricesUpdatedSubscriptionVariables,
|
|
263
|
-
sink: Sink<ExecutionResult<OnPricesUpdatedSubscription>>,
|
|
274
|
+
onNftAssetsCreated = async (
|
|
275
|
+
vars: OnNftAssetsCreatedSubscriptionVariables,
|
|
276
|
+
sink: Sink<ExecutionResult<OnNftAssetsCreatedSubscription>>,
|
|
264
277
|
) =>
|
|
265
278
|
this.sdk.subscribe(
|
|
266
|
-
`subscription
|
|
267
|
-
|
|
268
|
-
address,
|
|
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
|
|
269
282
|
}
|
|
270
283
|
}`,
|
|
271
284
|
vars,
|
|
272
285
|
sink,
|
|
273
286
|
);
|
|
274
|
-
|
|
275
|
-
vars:
|
|
276
|
-
sink: Sink<ExecutionResult<
|
|
287
|
+
onDetailedStatsUpdated = async (
|
|
288
|
+
vars: OnDetailedStatsUpdatedSubscriptionVariables,
|
|
289
|
+
sink: Sink<ExecutionResult<OnDetailedStatsUpdatedSubscription>>,
|
|
277
290
|
) =>
|
|
278
291
|
this.sdk.subscribe(
|
|
279
|
-
`subscription
|
|
280
|
-
|
|
281
|
-
|
|
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
|
|
282
295
|
}
|
|
283
296
|
}`,
|
|
284
297
|
vars,
|
|
285
298
|
sink,
|
|
286
299
|
);
|
|
287
|
-
|
|
288
|
-
vars:
|
|
289
|
-
sink: Sink<ExecutionResult<
|
|
300
|
+
onPricesUpdated = async (
|
|
301
|
+
vars: OnPricesUpdatedSubscriptionVariables,
|
|
302
|
+
sink: Sink<ExecutionResult<OnPricesUpdatedSubscription>>,
|
|
290
303
|
) =>
|
|
291
304
|
this.sdk.subscribe(
|
|
292
|
-
`subscription
|
|
293
|
-
|
|
305
|
+
`subscription OnPricesUpdated($input: [OnPricesUpdatedInput!]!) {
|
|
306
|
+
onPricesUpdated (input: $input) {
|
|
294
307
|
address, confidence, networkId, poolAddress, priceUsd, timestamp
|
|
295
308
|
}
|
|
296
|
-
}`,
|
|
297
|
-
vars,
|
|
298
|
-
sink,
|
|
299
|
-
);
|
|
300
|
-
onBarsUpdated = async (
|
|
301
|
-
vars: OnBarsUpdatedSubscriptionVariables,
|
|
302
|
-
sink: Sink<ExecutionResult<OnBarsUpdatedSubscription>>,
|
|
303
|
-
) =>
|
|
304
|
-
this.sdk.subscribe(
|
|
305
|
-
`subscription OnBarsUpdated($pairId: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
|
|
306
|
-
onBarsUpdated (pairId: $pairId, quoteToken: $quoteToken, statsType: $statsType) {
|
|
307
|
-
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
|
|
308
|
-
}
|
|
309
309
|
}`,
|
|
310
310
|
vars,
|
|
311
311
|
sink,
|