@codex-data/sdk 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/resources/generated_queries/FilterPairs.graphql +44 -0
- package/dist/resources/generated_queries/FilterTokens.graphql +44 -0
- package/dist/resources/generated_queries/GetBars.graphql +165 -0
- package/dist/resources/generated_queries/GetCommunityNotes.graphql +11 -0
- package/dist/resources/generated_queries/GetDetailedPairStats.graphql +22 -0
- package/dist/resources/generated_queries/GetDetailedPairsStats.graphql +22 -0
- package/dist/resources/generated_queries/GetTokenEvents.graphql +2 -0
- package/dist/resources/generated_queries/GetTokenEventsForMaker.graphql +2 -0
- package/dist/resources/generated_queries/Holders.graphql +1 -0
- package/dist/resources/generated_queries/ListPairsForToken.graphql +22 -0
- package/dist/resources/generated_queries/ListPairsWithMetadataForToken.graphql +44 -0
- package/dist/resources/generated_queries/PairMetadata.graphql +152 -0
- package/dist/resources/generated_queries/Token.graphql +11 -0
- package/dist/resources/generated_queries/Tokens.graphql +11 -0
- package/dist/resources/generated_queries/Top10HoldersPercent.graphql +3 -0
- package/dist/resources/generated_subscriptions/OnEventsCreated.graphql +2 -0
- package/dist/resources/generated_subscriptions/OnHoldersUpdated.graphql +15 -0
- package/dist/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +152 -0
- package/dist/resources/generated_subscriptions/OnTokenEventsCreated.graphql +2 -0
- package/dist/resources/generated_subscriptions/OnUnconfirmedEventsCreated.graphql +1 -0
- package/dist/resources/graphql.d.ts +250 -107
- 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 +1506 -931
- package/dist/resources/graphql.ts +260 -122
- package/dist/resources/schema.graphql +386 -154
- package/dist/sdk/Mutation.d.ts +2 -2
- package/dist/sdk/Mutation.js +2 -2
- package/dist/sdk/Query.d.ts +48 -55
- package/dist/sdk/Query.d.ts.map +1 -1
- package/dist/sdk/Query.js +47 -54
- 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 +68 -61
- package/dist/sdk/Subscribe.js.map +1 -1
- package/dist/sdk/generated/gql.d.ts +51 -104
- package/dist/sdk/generated/gql.d.ts.map +1 -1
- package/dist/sdk/generated/gql.js +20 -26
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +1109 -477
- package/dist/sdk/generated/graphql.d.ts.map +1 -1
- package/dist/sdk/generated/graphql.js +48 -30
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/package.json +1 -1
- package/src/resources/generated_queries/FilterPairs.graphql +44 -0
- package/src/resources/generated_queries/FilterTokens.graphql +44 -0
- package/src/resources/generated_queries/GetBars.graphql +165 -0
- package/src/resources/generated_queries/GetCommunityNotes.graphql +11 -0
- package/src/resources/generated_queries/GetDetailedPairStats.graphql +22 -0
- package/src/resources/generated_queries/GetDetailedPairsStats.graphql +22 -0
- package/src/resources/generated_queries/GetTokenEvents.graphql +2 -0
- package/src/resources/generated_queries/GetTokenEventsForMaker.graphql +2 -0
- package/src/resources/generated_queries/Holders.graphql +1 -0
- package/src/resources/generated_queries/ListPairsForToken.graphql +22 -0
- package/src/resources/generated_queries/ListPairsWithMetadataForToken.graphql +44 -0
- package/src/resources/generated_queries/PairMetadata.graphql +152 -0
- package/src/resources/generated_queries/Token.graphql +11 -0
- package/src/resources/generated_queries/Tokens.graphql +11 -0
- package/src/resources/generated_queries/Top10HoldersPercent.graphql +3 -0
- package/src/resources/generated_subscriptions/OnEventsCreated.graphql +2 -0
- package/src/resources/generated_subscriptions/OnHoldersUpdated.graphql +15 -0
- package/src/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +152 -0
- package/src/resources/generated_subscriptions/OnTokenEventsCreated.graphql +2 -0
- package/src/resources/generated_subscriptions/OnUnconfirmedEventsCreated.graphql +1 -0
- package/src/resources/graphql.schema.json +1506 -931
- package/src/resources/graphql.ts +260 -122
- package/src/resources/schema.graphql +386 -154
- package/src/sdk/Mutation.ts +4 -4
- package/src/sdk/Query.ts +102 -130
- package/src/sdk/Subscribe.ts +112 -97
- package/src/sdk/generated/gql.ts +46 -76
- package/src/sdk/generated/graphql.ts +316 -235
- 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/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,131 +45,131 @@ 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
|
+
onSimulateTokenContract = async (
|
|
49
|
+
vars: OnSimulateTokenContractSubscriptionVariables,
|
|
50
|
+
sink: Sink<ExecutionResult<OnSimulateTokenContractSubscription>>,
|
|
49
51
|
) =>
|
|
50
52
|
this.sdk.subscribe(
|
|
51
|
-
`subscription
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
`subscription OnSimulateTokenContract($contractAddress: String, $networkId: Int!, $simulationId: String) {
|
|
54
|
+
onSimulateTokenContract (contractAddress: $contractAddress, networkId: $networkId, simulationId: $simulationId) {
|
|
55
|
+
analysisType, blockNumber, contractBalance { tokenContractEthBalance, tokenContractTokenBalance }, contractHashKey, creator { creatorAddress, creatorEthBalance, creatorTokenBalance }, deploy { deploySuccess, tokenMintedToDeployer }, errors { contractBalanceErrors { tokenContractEthBalanceError, tokenContractTokenBalanceError }, creatorErrors { creatorEthBalanceError, creatorTokenBalanceError }, deployErrors { deployError, tokenMintedToDeployerError }, liquidityErrors { addLiquidityError, lpTotalSupplyError, postLiquidityEnableTradingError, preLiquidityEnableTradingError }, ownerErrors { ownerAddressError, ownerEthBalanceError, ownerTokenBalanceError }, simulatorError, swapErrors { buyError, buyErrorEnum, sellError, sellErrorEnum }, tokenErrors { canRenounceOwnershipError, canTransferOwnershipError, decimalsError, tokenNameError, tokenSymbolError, totalSupplyError }, transferErrors { tokenContractApprovalError, tokenTransferredToContractError, userApprovalError } }, id, liquidity { addLiquiditySuccess, liquiditySetByPreLiquidityOpenTradingCall, lpTotalSupply, pairAddress, postLiquidityEnableTradingCall, postLiquidityEnableTradingSuccess, preLiquidityEnableTradingCall, preLiquidityEnableTradingSuccess, preLiquidityEnableTradingSupportsTransfer }, networkId, owner { ownerAddress, ownerEthBalance, ownerTokenBalance }, sortKey, status, swap { buyGasUsed, buySuccess, buyTax, maxBuyAmount, maxSellAmount, sellGasUsed, sellSuccess, sellTax }, timestamp, token { canRenounceOwnership, canTransferOwnership, contractAddress, decimals, isOwnerRenounced, tokenName, tokenSymbol, totalSupply }, transfer { tokenContractApprovalSuccess, tokenTransferredToContractSuccess, userApprovalSuccess }, uuid, uuidHashKey
|
|
54
56
|
}
|
|
55
57
|
}`,
|
|
56
58
|
vars,
|
|
57
59
|
sink,
|
|
58
60
|
);
|
|
59
|
-
|
|
60
|
-
vars:
|
|
61
|
-
sink: Sink<ExecutionResult<
|
|
61
|
+
onUnconfirmedEventsCreated = async (
|
|
62
|
+
vars: OnUnconfirmedEventsCreatedSubscriptionVariables,
|
|
63
|
+
sink: Sink<ExecutionResult<OnUnconfirmedEventsCreatedSubscription>>,
|
|
62
64
|
) =>
|
|
63
65
|
this.sdk.subscribe(
|
|
64
|
-
`subscription
|
|
65
|
-
|
|
66
|
-
address,
|
|
66
|
+
`subscription OnUnconfirmedEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
|
|
67
|
+
onUnconfirmedEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
|
|
68
|
+
address, events { address, blockHash, blockNumber, data { ... on UnconfirmedLiquidityChangeEventData { amount0, amount0Shifted, amount1, amount1Shifted, type }, ... on UnconfirmedSwapEventData { amountBaseToken, amountNonLiquidityToken, priceBaseToken, priceBaseTokenTotal, priceUsd, priceUsdTotal, type } }, eventDisplayType, eventType, id, logIndex, maker, networkId, quoteToken, supplementalIndex, timestamp, transactionHash, transactionIndex }, id, networkId, quoteToken
|
|
67
69
|
}
|
|
68
70
|
}`,
|
|
69
71
|
vars,
|
|
70
72
|
sink,
|
|
71
73
|
);
|
|
72
|
-
|
|
73
|
-
vars:
|
|
74
|
-
sink: Sink<ExecutionResult<
|
|
74
|
+
onEventsCreated = async (
|
|
75
|
+
vars: OnEventsCreatedSubscriptionVariables,
|
|
76
|
+
sink: Sink<ExecutionResult<OnEventsCreatedSubscription>>,
|
|
75
77
|
) =>
|
|
76
78
|
this.sdk.subscribe(
|
|
77
|
-
`subscription
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
`subscription OnEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
|
|
80
|
+
onEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
|
|
81
|
+
address, events { address, baseTokenPrice, blockHash, blockNumber, data { ... on BurnEventData { amount0, amount0Shifted, amount1, amount1Shifted, tickLower, tickUpper, type }, ... on MintEventData { amount0, amount0Shifted, amount1, amount1Shifted, tickLower, tickUpper, type }, ... on PoolBalanceChangedEventData { amount0, amount0Shifted, amount1, amount1Shifted, liquidity0, liquidity1, protocolFeeAmount0, protocolFeeAmount1, sender, token0, token1, type }, ... on SwapEventData { amount0, amount0In, amount0Out, amount1, amount1In, amount1Out, amountNonLiquidityToken, priceBaseToken, priceBaseTokenTotal, priceUsd, priceUsdTotal, tick, type } }, eventDisplayType, eventType, id, labels { sandwich { label, sandwichType, token0DrainedAmount, token1DrainedAmount }, washtrade { label } }, liquidityToken, logIndex, maker, networkId, quoteToken, timestamp, token0Address, token0PoolValueUsd, token0SwapValueUsd, token0ValueBase, token1Address, token1PoolValueUsd, token1SwapValueUsd, token1ValueBase, transactionHash, transactionIndex }, id, networkId, quoteToken
|
|
80
82
|
}
|
|
81
83
|
}`,
|
|
82
84
|
vars,
|
|
83
85
|
sink,
|
|
84
86
|
);
|
|
85
|
-
|
|
86
|
-
vars:
|
|
87
|
-
sink: Sink<ExecutionResult<
|
|
87
|
+
onNftEventsCreated = async (
|
|
88
|
+
vars: OnNftEventsCreatedSubscriptionVariables,
|
|
89
|
+
sink: Sink<ExecutionResult<OnNftEventsCreatedSubscription>>,
|
|
88
90
|
) =>
|
|
89
91
|
this.sdk.subscribe(
|
|
90
|
-
`subscription
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
`subscription OnNftEventsCreated($address: String, $networkId: Int) {
|
|
93
|
+
onNftEventsCreated (address: $address, networkId: $networkId) {
|
|
94
|
+
address, events { aggregatorAddress, blockNumber, contractAddress, eventType, exchangeAddress, fillSource, id, individualPriceNetworkBaseToken, individualPriceUsd, individualTradePrice, logIndex, maker, networkId, numberOfTokens, orderDirection, paymentTokenAddress, poolAddress, priceError, sortKey, taker, timestamp, tokenId, totalPriceNetworkBaseToken, totalPriceUsd, totalTradePrice, tradeOffer { ... on NftEventNftTradeItem { address, amount, recipient, tokenId, type }, ... on NftEventTokenTradeItem { address, amount, individualPriceNetworkBaseToken, individualPriceUsd, individualTradePrice, isPrice, priceError, recipient, totalPriceNetworkBaseToken, totalPriceUsd, totalTradePrice, type } }, tradeReceived { ... on NftEventNftTradeItem { address, amount, recipient, tokenId, type }, ... on NftEventTokenTradeItem { address, amount, individualPriceNetworkBaseToken, individualPriceUsd, individualTradePrice, isPrice, priceError, recipient, totalPriceNetworkBaseToken, totalPriceUsd, totalTradePrice, type } }, transactionHash, transactionIndex }, id, networkId
|
|
93
95
|
}
|
|
94
96
|
}`,
|
|
95
97
|
vars,
|
|
96
98
|
sink,
|
|
97
99
|
);
|
|
98
|
-
|
|
99
|
-
vars:
|
|
100
|
-
sink: Sink<ExecutionResult<
|
|
100
|
+
onLatestPairUpdated = async (
|
|
101
|
+
vars: OnLatestPairUpdatedSubscriptionVariables,
|
|
102
|
+
sink: Sink<ExecutionResult<OnLatestPairUpdatedSubscription>>,
|
|
101
103
|
) =>
|
|
102
104
|
this.sdk.subscribe(
|
|
103
|
-
`subscription
|
|
104
|
-
|
|
105
|
-
|
|
105
|
+
`subscription OnLatestPairUpdated($id: String, $networkId: Int) {
|
|
106
|
+
onLatestPairUpdated (id: $id, networkId: $networkId) {
|
|
107
|
+
address, exchangeHash, id, initialPriceUsd, liquidAt, liquidity, liquidityToken, networkId, newToken, nonLiquidityToken, oldToken, priceChange, priceUsd, token0 { address, currentPoolAmount, decimals, id, initialPoolAmount, name, networkId, pairId, poolVariation, symbol }, token1 { address, currentPoolAmount, decimals, id, initialPoolAmount, name, networkId, pairId, poolVariation, symbol }, transactionHash
|
|
106
108
|
}
|
|
107
109
|
}`,
|
|
108
110
|
vars,
|
|
109
111
|
sink,
|
|
110
112
|
);
|
|
111
|
-
|
|
112
|
-
vars:
|
|
113
|
-
sink: Sink<ExecutionResult<
|
|
113
|
+
onPairMetadataUpdated = async (
|
|
114
|
+
vars: OnPairMetadataUpdatedSubscriptionVariables,
|
|
115
|
+
sink: Sink<ExecutionResult<OnPairMetadataUpdatedSubscription>>,
|
|
114
116
|
) =>
|
|
115
117
|
this.sdk.subscribe(
|
|
116
|
-
`subscription
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
`subscription OnPairMetadataUpdated($id: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
|
|
119
|
+
onPairMetadataUpdated (id: $id, quoteToken: $quoteToken, statsType: $statsType) {
|
|
120
|
+
createdAt, enhancedToken0 { address, cmcId, createBlockNumber, createTransactionHash, createdAt, creatorAddress, decimals, exchanges { address, color, exchangeVersion, iconUrl, id, name, networkId, tradeUrl }, freezable, id, info { address, circulatingSupply, cmcId, description, id, imageBannerUrl, imageLargeUrl, imageSmallUrl, imageThumbUrl, isScam, name, networkId, symbol, totalSupply }, isScam, launchpad { completed, completedAt, completedSlot, graduationPercent, migrated, migratedAt, migratedPoolAddress, migratedSlot, poolAddress }, mintable, name, networkId, socialLinks { bitcointalk, blog, coingecko, coinmarketcap, discord, email, facebook, github, instagram, linkedin, reddit, slack, telegram, twitch, twitter, website, wechat, whitepaper, youtube }, symbol }, enhancedToken1 { address, cmcId, createBlockNumber, createTransactionHash, createdAt, creatorAddress, decimals, exchanges { address, color, exchangeVersion, iconUrl, id, name, networkId, tradeUrl }, freezable, id, info { address, circulatingSupply, cmcId, description, id, imageBannerUrl, imageLargeUrl, imageSmallUrl, imageThumbUrl, isScam, name, networkId, symbol, totalSupply }, isScam, launchpad { completed, completedAt, completedSlot, graduationPercent, migrated, migratedAt, migratedPoolAddress, migratedSlot, poolAddress }, mintable, name, networkId, socialLinks { bitcointalk, blog, coingecko, coinmarketcap, discord, email, facebook, github, instagram, linkedin, reddit, slack, telegram, twitch, twitter, website, wechat, whitepaper, youtube }, symbol }, exchangeId, fee, highPrice1, highPrice1w, highPrice4, highPrice5m, highPrice12, highPrice24, id, liquidity, liquidityToken, lowPrice1, lowPrice1w, lowPrice4, lowPrice5m, lowPrice12, lowPrice24, networkId, nonLiquidityToken, pairAddress, price, priceChange1, priceChange1w, priceChange4, priceChange5m, priceChange12, priceChange24, quoteToken, statsType, tickSpacing, token0 { address, decimals, labels { createdAt, subType, type }, name, networkId, pooled, price, symbol }, token1 { address, decimals, labels { createdAt, subType, type }, name, networkId, pooled, price, symbol }, volume1, volume1w, volume4, volume5m, volume12, volume24
|
|
119
121
|
}
|
|
120
122
|
}`,
|
|
121
123
|
vars,
|
|
122
124
|
sink,
|
|
123
125
|
);
|
|
124
|
-
|
|
125
|
-
vars:
|
|
126
|
-
sink: Sink<ExecutionResult<
|
|
126
|
+
onUnconfirmedBarsUpdated = async (
|
|
127
|
+
vars: OnUnconfirmedBarsUpdatedSubscriptionVariables,
|
|
128
|
+
sink: Sink<ExecutionResult<OnUnconfirmedBarsUpdatedSubscription>>,
|
|
127
129
|
) =>
|
|
128
130
|
this.sdk.subscribe(
|
|
129
|
-
`subscription
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
`subscription OnUnconfirmedBarsUpdated($pairId: String, $quoteToken: QuoteToken) {
|
|
132
|
+
onUnconfirmedBarsUpdated (pairId: $pairId, quoteToken: $quoteToken) {
|
|
133
|
+
aggregates { r1 { c, h, l, o, t, v, volume }, r1S { c, h, l, o, t, v, volume }, r5 { c, h, l, o, t, v, volume }, r5S { c, h, l, o, t, v, volume }, r15 { c, h, l, o, t, v, volume }, r15S { c, h, l, o, t, v, volume } }, eventSortKey, networkId, pairAddress, pairId, quoteToken, quoteTokenAddress, timestamp
|
|
132
134
|
}
|
|
133
135
|
}`,
|
|
134
136
|
vars,
|
|
135
137
|
sink,
|
|
136
138
|
);
|
|
137
|
-
|
|
138
|
-
vars:
|
|
139
|
-
sink: Sink<ExecutionResult<
|
|
139
|
+
onHoldersUpdated = async (
|
|
140
|
+
vars: OnHoldersUpdatedSubscriptionVariables,
|
|
141
|
+
sink: Sink<ExecutionResult<OnHoldersUpdatedSubscription>>,
|
|
140
142
|
) =>
|
|
141
143
|
this.sdk.subscribe(
|
|
142
|
-
`subscription
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
`subscription OnHoldersUpdated($tokenId: String!) {
|
|
145
|
+
onHoldersUpdated (tokenId: $tokenId) {
|
|
146
|
+
balances { balance, firstHeldTimestamp, shiftedBalance, tokenId, walletId }, holders, networkId, tokenAddress, tokenId
|
|
145
147
|
}
|
|
146
148
|
}`,
|
|
147
149
|
vars,
|
|
148
150
|
sink,
|
|
149
151
|
);
|
|
150
|
-
|
|
151
|
-
vars:
|
|
152
|
-
sink: Sink<ExecutionResult<
|
|
152
|
+
onLatestTokens = async (
|
|
153
|
+
vars: OnLatestTokensSubscriptionVariables,
|
|
154
|
+
sink: Sink<ExecutionResult<OnLatestTokensSubscription>>,
|
|
153
155
|
) =>
|
|
154
156
|
this.sdk.subscribe(
|
|
155
|
-
`subscription
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
`subscription OnLatestTokens($id: String, $networkId: Int, $tokenAddress: String) {
|
|
158
|
+
onLatestTokens (id: $id, networkId: $networkId, tokenAddress: $tokenAddress) {
|
|
159
|
+
blockHash, blockNumber, creatorAddress, creatorBalance, decimals, id, networkId, simulationResults { buyGasUsed, buySuccess, buyTax, canRenounceOwnership, canTransferOwnership, isOwnerRenounced, maxBuyAmount, maxSellAmount, openTradingCall, sellGasUsed, sellSuccess, sellTax }, timeCreated, tokenAddress, tokenName, tokenSymbol, totalSupply, traceIndex, transactionHash, transactionIndex
|
|
158
160
|
}
|
|
159
161
|
}`,
|
|
160
162
|
vars,
|
|
161
163
|
sink,
|
|
162
164
|
);
|
|
163
|
-
|
|
164
|
-
vars:
|
|
165
|
-
sink: Sink<ExecutionResult<
|
|
165
|
+
onNftPoolEventsCreated = async (
|
|
166
|
+
vars: OnNftPoolEventsCreatedSubscriptionVariables,
|
|
167
|
+
sink: Sink<ExecutionResult<OnNftPoolEventsCreatedSubscription>>,
|
|
166
168
|
) =>
|
|
167
169
|
this.sdk.subscribe(
|
|
168
|
-
`subscription
|
|
169
|
-
|
|
170
|
-
|
|
170
|
+
`subscription OnNftPoolEventsCreated($collectionAddress: String, $exchangeAddress: String, $networkId: Int, $poolAddress: String) {
|
|
171
|
+
onNftPoolEventsCreated (collectionAddress: $collectionAddress, exchangeAddress: $exchangeAddress, networkId: $networkId, poolAddress: $poolAddress) {
|
|
172
|
+
collectionAddress, events { blockHash, blockNumber, collectionAddress, collectionId, data { ... on NewPoolEventData { assetRecipientAddress, bondingCurveAddress, bondingCurveType, buyPriceT, collectionAddress, createdAt, delta, feeAmountT, nbtRatio, networkId, nftTokenBalance, ownerAddress, poolAddress, sellPriceT, startPriceT, tokenAddress, tokenBalanceT, type, usdRatio }, ... on NewPoolEventDataV2 { assetRecipientAddress, bondingCurveAddress, bondingCurveType, buyPriceT, collectionAddress, createdAt, delta, feeAmountT, nbtRatio, networkId, nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftTokenIds, nftTokenQuantities, ownerAddress, poolAddress, poolNftType, propertyChecker, royalties { percent, recipient }, sellPriceT, startPriceT, tokenAddress, tokenBalanceT, type, usdRatio }, ... on NftPoolAssetRecipientUpdateEventData { newAssetRecipient, type }, ... on NftPoolDeltaUpdateEventData { newDelta, type }, ... on NftPoolFeeUpdateEventData { nbtRatio, newFeeT, type, usdRatio }, ... on NftPoolNftDepositEventData { nftTokenBalance, nftTokenIds, tokenBalanceT, type }, ... on NftPoolNftDepositEventDataV2 { nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftTokenAmounts, nftTokenIds, tokenBalanceT, type }, ... on NftPoolNftWithdrawalEventData { nftTokenBalance, nftTokenIds, tokenBalanceT, type }, ... on NftPoolNftWithdrawalEventDataV2 { nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftTokenAmounts, nftTokenIds, tokenBalanceT, type }, ... on NftPoolOwnershipTransferredEventDataV2 { newOwner, type }, ... on NftPoolSpotPriceUpdateEventData { nbtRatio, newBuyPriceT, newSellPriceT, newSpotPriceT, type, usdRatio }, ... on NftPoolSpotPriceUpdateEventDataV2 { nbtRatio, newBuyPriceT, newSellPriceT, newSpotPriceT, type, usdRatio }, ... on NftPoolTokenDepositEventData { amountT, nbtRatio, nftTokenBalance, tokenBalanceT, type, usdRatio }, ... on NftPoolTokenDepositEventDataV2 { amountT, nbtRatio, tokenBalanceT, type, usdRatio }, ... on NftPoolTokenWithdrawalEventData { amountT, nbtRatio, nftTokenBalance, tokenBalanceT, type, usdRatio }, ... on NftPoolTokenWithdrawalEventDataV2 { amountT, nbtRatio, tokenBalanceT, type, usdRatio }, ... on SwapNftInPoolEventData { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftTokenBalance, nftsTransfered { amountT, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio }, ... on SwapNftInPoolEventDataV2 { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftsTransfered { amountT, nftQuantity, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio }, ... on SwapNftOutPoolEventData { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftTokenBalance, nftsTransfered { amountT, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio }, ... on SwapNftOutPoolEventDataV2 { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftsTransfered { amountT, nftQuantity, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio } }, eventType, exchangeAddress, id, logIndex, maker, networkId, poolAddress, poolType, timestamp, tokenAddress, transactionHash, transactionIndex }, exchangeAddress, id, networkId, poolAddress
|
|
171
173
|
}
|
|
172
174
|
}`,
|
|
173
175
|
vars,
|
|
@@ -186,53 +188,40 @@ export class Subscribe {
|
|
|
186
188
|
vars,
|
|
187
189
|
sink,
|
|
188
190
|
);
|
|
189
|
-
|
|
190
|
-
vars:
|
|
191
|
-
sink: Sink<ExecutionResult<
|
|
192
|
-
) =>
|
|
193
|
-
this.sdk.subscribe(
|
|
194
|
-
`subscription OnNftEventsCreated($address: String, $networkId: Int) {
|
|
195
|
-
onNftEventsCreated (address: $address, networkId: $networkId) {
|
|
196
|
-
address, events { aggregatorAddress, blockNumber, contractAddress, eventType, exchangeAddress, fillSource, id, individualPriceNetworkBaseToken, individualPriceUsd, individualTradePrice, logIndex, maker, networkId, numberOfTokens, orderDirection, paymentTokenAddress, poolAddress, priceError, sortKey, taker, timestamp, tokenId, totalPriceNetworkBaseToken, totalPriceUsd, totalTradePrice, tradeOffer { ... on NftEventNftTradeItem { address, amount, recipient, tokenId, type }, ... on NftEventTokenTradeItem { address, amount, individualPriceNetworkBaseToken, individualPriceUsd, individualTradePrice, isPrice, priceError, recipient, totalPriceNetworkBaseToken, totalPriceUsd, totalTradePrice, type } }, tradeReceived { ... on NftEventNftTradeItem { address, amount, recipient, tokenId, type }, ... on NftEventTokenTradeItem { address, amount, individualPriceNetworkBaseToken, individualPriceUsd, individualTradePrice, isPrice, priceError, recipient, totalPriceNetworkBaseToken, totalPriceUsd, totalTradePrice, type } }, transactionHash, transactionIndex }, id, networkId
|
|
197
|
-
}
|
|
198
|
-
}`,
|
|
199
|
-
vars,
|
|
200
|
-
sink,
|
|
201
|
-
);
|
|
202
|
-
onPricesUpdated = async (
|
|
203
|
-
vars: OnPricesUpdatedSubscriptionVariables,
|
|
204
|
-
sink: Sink<ExecutionResult<OnPricesUpdatedSubscription>>,
|
|
191
|
+
onTokenLifecycleEventsCreated = async (
|
|
192
|
+
vars: OnTokenLifecycleEventsCreatedSubscriptionVariables,
|
|
193
|
+
sink: Sink<ExecutionResult<OnTokenLifecycleEventsCreatedSubscription>>,
|
|
205
194
|
) =>
|
|
206
195
|
this.sdk.subscribe(
|
|
207
|
-
`subscription
|
|
208
|
-
|
|
209
|
-
|
|
196
|
+
`subscription OnTokenLifecycleEventsCreated($address: String, $networkId: Int) {
|
|
197
|
+
onTokenLifecycleEventsCreated (address: $address, networkId: $networkId) {
|
|
198
|
+
events { blockHash, blockNumber, data { ... on TokenBurnEventData { amount, circulatingSupply, totalSupply }, ... on TokenMintEventData { amount, circulatingSupply, totalSupply } }, eventType, id, logIndex, maker, networkId, timestamp, tokenAddress, transactionHash, transactionIndex }, id
|
|
210
199
|
}
|
|
211
200
|
}`,
|
|
212
201
|
vars,
|
|
213
202
|
sink,
|
|
214
203
|
);
|
|
215
|
-
|
|
216
|
-
vars:
|
|
217
|
-
sink: Sink<ExecutionResult<
|
|
204
|
+
onNftAssetsCreated = async (
|
|
205
|
+
vars: OnNftAssetsCreatedSubscriptionVariables,
|
|
206
|
+
sink: Sink<ExecutionResult<OnNftAssetsCreatedSubscription>>,
|
|
218
207
|
) =>
|
|
219
208
|
this.sdk.subscribe(
|
|
220
|
-
`subscription
|
|
221
|
-
|
|
222
|
-
|
|
209
|
+
`subscription OnNftAssetsCreated($address: String, $networkId: Int, $tokenId: String) {
|
|
210
|
+
onNftAssetsCreated (address: $address, networkId: $networkId, tokenId: $tokenId) {
|
|
211
|
+
address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri
|
|
223
212
|
}
|
|
224
213
|
}`,
|
|
225
214
|
vars,
|
|
226
215
|
sink,
|
|
227
216
|
);
|
|
228
|
-
|
|
229
|
-
vars:
|
|
230
|
-
sink: Sink<ExecutionResult<
|
|
217
|
+
onTokenBarsUpdated = async (
|
|
218
|
+
vars: OnTokenBarsUpdatedSubscriptionVariables,
|
|
219
|
+
sink: Sink<ExecutionResult<OnTokenBarsUpdatedSubscription>>,
|
|
231
220
|
) =>
|
|
232
221
|
this.sdk.subscribe(
|
|
233
|
-
`subscription
|
|
234
|
-
|
|
235
|
-
|
|
222
|
+
`subscription OnTokenBarsUpdated($statsType: TokenPairStatisticsType, $tokenId: String) {
|
|
223
|
+
onTokenBarsUpdated (statsType: $statsType, tokenId: $tokenId) {
|
|
224
|
+
aggregates { r1 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r1D { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r1S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r5 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r5S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r7D { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r15 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r15S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r30 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r30S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r60 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r240 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r720 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } } }, eventSortKey, networkId, pairAddress, pairId, quoteToken, statsType, timestamp, tokenAddress, tokenId
|
|
236
225
|
}
|
|
237
226
|
}`,
|
|
238
227
|
vars,
|
|
@@ -269,14 +258,40 @@ export class Subscribe {
|
|
|
269
258
|
vars,
|
|
270
259
|
sink,
|
|
271
260
|
);
|
|
272
|
-
|
|
273
|
-
vars:
|
|
274
|
-
sink: Sink<ExecutionResult<
|
|
261
|
+
onPricesUpdated = async (
|
|
262
|
+
vars: OnPricesUpdatedSubscriptionVariables,
|
|
263
|
+
sink: Sink<ExecutionResult<OnPricesUpdatedSubscription>>,
|
|
275
264
|
) =>
|
|
276
265
|
this.sdk.subscribe(
|
|
277
|
-
`subscription
|
|
278
|
-
|
|
279
|
-
|
|
266
|
+
`subscription OnPricesUpdated($input: [OnPricesUpdatedInput!]!) {
|
|
267
|
+
onPricesUpdated (input: $input) {
|
|
268
|
+
address, confidence, networkId, poolAddress, priceUsd, timestamp
|
|
269
|
+
}
|
|
270
|
+
}`,
|
|
271
|
+
vars,
|
|
272
|
+
sink,
|
|
273
|
+
);
|
|
274
|
+
onTokenEventsCreated = async (
|
|
275
|
+
vars: OnTokenEventsCreatedSubscriptionVariables,
|
|
276
|
+
sink: Sink<ExecutionResult<OnTokenEventsCreatedSubscription>>,
|
|
277
|
+
) =>
|
|
278
|
+
this.sdk.subscribe(
|
|
279
|
+
`subscription OnTokenEventsCreated($input: OnTokenEventsCreatedInput!) {
|
|
280
|
+
onTokenEventsCreated (input: $input) {
|
|
281
|
+
events { address, baseTokenPrice, blockHash, blockNumber, data { ... on BurnEventData { amount0, amount0Shifted, amount1, amount1Shifted, tickLower, tickUpper, type }, ... on MintEventData { amount0, amount0Shifted, amount1, amount1Shifted, tickLower, tickUpper, type }, ... on PoolBalanceChangedEventData { amount0, amount0Shifted, amount1, amount1Shifted, liquidity0, liquidity1, protocolFeeAmount0, protocolFeeAmount1, sender, token0, token1, type }, ... on SwapEventData { amount0, amount0In, amount0Out, amount1, amount1In, amount1Out, amountNonLiquidityToken, priceBaseToken, priceBaseTokenTotal, priceUsd, priceUsdTotal, tick, type } }, eventDisplayType, eventType, id, labels { sandwich { label, sandwichType, token0DrainedAmount, token1DrainedAmount }, washtrade { label } }, liquidityToken, logIndex, maker, networkId, quoteToken, timestamp, token0Address, token0PoolValueUsd, token0SwapValueUsd, token0ValueBase, token1Address, token1PoolValueUsd, token1SwapValueUsd, token1ValueBase, transactionHash, transactionIndex }, id
|
|
282
|
+
}
|
|
283
|
+
}`,
|
|
284
|
+
vars,
|
|
285
|
+
sink,
|
|
286
|
+
);
|
|
287
|
+
onPriceUpdated = async (
|
|
288
|
+
vars: OnPriceUpdatedSubscriptionVariables,
|
|
289
|
+
sink: Sink<ExecutionResult<OnPriceUpdatedSubscription>>,
|
|
290
|
+
) =>
|
|
291
|
+
this.sdk.subscribe(
|
|
292
|
+
`subscription OnPriceUpdated($address: String, $networkId: Int, $sourcePairAddress: String) {
|
|
293
|
+
onPriceUpdated (address: $address, networkId: $networkId, sourcePairAddress: $sourcePairAddress) {
|
|
294
|
+
address, confidence, networkId, poolAddress, priceUsd, timestamp
|
|
280
295
|
}
|
|
281
296
|
}`,
|
|
282
297
|
vars,
|