@codex-data/sdk 1.0.0 → 1.0.1
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 +8 -0
- package/dist/resources/generated_queries/FilterTokens.graphql +6 -0
- package/dist/resources/generated_queries/GetCommunityNotes.graphql +2 -0
- package/dist/resources/generated_queries/GetDetailedPairStats.graphql +4 -0
- package/dist/resources/generated_queries/GetDetailedPairsStats.graphql +4 -0
- package/dist/resources/generated_queries/ListPairsForToken.graphql +4 -0
- package/dist/resources/generated_queries/ListPairsWithMetadataForToken.graphql +8 -0
- package/dist/resources/generated_queries/Token.graphql +2 -0
- package/dist/resources/generated_queries/Tokens.graphql +2 -0
- package/dist/resources/generated_subscriptions/OnPriceUpdated.graphql +10 -2
- package/dist/resources/graphql.d.ts +17 -0
- package/dist/resources/graphql.d.ts.map +1 -1
- package/dist/resources/graphql.js.map +1 -1
- package/dist/resources/graphql.schema.json +144 -0
- package/dist/resources/graphql.ts +19 -0
- package/dist/resources/schema.graphql +27 -0
- package/dist/sdk/Mutation.d.ts +2 -2
- package/dist/sdk/Mutation.js +2 -2
- package/dist/sdk/Query.d.ts +53 -53
- package/dist/sdk/Query.d.ts.map +1 -1
- package/dist/sdk/Query.js +53 -53
- package/dist/sdk/Query.js.map +1 -1
- package/dist/sdk/Subscribe.d.ts +12 -12
- package/dist/sdk/Subscribe.d.ts.map +1 -1
- package/dist/sdk/Subscribe.js +60 -60
- package/dist/sdk/Subscribe.js.map +1 -1
- package/dist/sdk/generated/gql.d.ts +21 -20
- package/dist/sdk/generated/gql.d.ts.map +1 -1
- package/dist/sdk/generated/gql.js +10 -10
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +59 -0
- package/dist/sdk/generated/graphql.d.ts.map +1 -1
- package/dist/sdk/generated/graphql.js +10 -10
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/package.json +2 -2
- package/src/resources/generated_queries/FilterPairs.graphql +8 -0
- package/src/resources/generated_queries/FilterTokens.graphql +6 -0
- package/src/resources/generated_queries/GetCommunityNotes.graphql +2 -0
- package/src/resources/generated_queries/GetDetailedPairStats.graphql +4 -0
- package/src/resources/generated_queries/GetDetailedPairsStats.graphql +4 -0
- package/src/resources/generated_queries/ListPairsForToken.graphql +4 -0
- package/src/resources/generated_queries/ListPairsWithMetadataForToken.graphql +8 -0
- package/src/resources/generated_queries/Token.graphql +2 -0
- package/src/resources/generated_queries/Tokens.graphql +2 -0
- package/src/resources/generated_subscriptions/OnPriceUpdated.graphql +10 -2
- package/src/resources/graphql.schema.json +144 -0
- package/src/resources/graphql.ts +19 -0
- package/src/resources/schema.graphql +27 -0
- package/src/sdk/Mutation.ts +4 -4
- package/src/sdk/Query.ts +111 -111
- package/src/sdk/Subscribe.ts +97 -97
- package/src/sdk/generated/gql.ts +20 -20
- package/src/sdk/generated/graphql.ts +39 -19
package/src/sdk/Subscribe.ts
CHANGED
|
@@ -43,79 +43,79 @@ import { Codex } from "./index";
|
|
|
43
43
|
|
|
44
44
|
export class Subscribe {
|
|
45
45
|
constructor(private sdk: Codex) {}
|
|
46
|
-
|
|
47
|
-
vars:
|
|
48
|
-
sink: Sink<ExecutionResult<
|
|
46
|
+
onPriceUpdated = async (
|
|
47
|
+
vars: OnPriceUpdatedSubscriptionVariables,
|
|
48
|
+
sink: Sink<ExecutionResult<OnPriceUpdatedSubscription>>,
|
|
49
49
|
) =>
|
|
50
50
|
this.sdk.subscribe(
|
|
51
|
-
`subscription
|
|
52
|
-
|
|
51
|
+
`subscription OnPriceUpdated($address: String, $networkId: Int, $sourcePairAddress: String) {
|
|
52
|
+
onPriceUpdated (address: $address, networkId: $networkId, sourcePairAddress: $sourcePairAddress) {
|
|
53
53
|
address, confidence, networkId, poolAddress, priceUsd, timestamp
|
|
54
54
|
}
|
|
55
55
|
}`,
|
|
56
56
|
vars,
|
|
57
57
|
sink,
|
|
58
58
|
);
|
|
59
|
-
|
|
60
|
-
vars:
|
|
61
|
-
sink: Sink<ExecutionResult<
|
|
59
|
+
onLatestPairUpdated = async (
|
|
60
|
+
vars: OnLatestPairUpdatedSubscriptionVariables,
|
|
61
|
+
sink: Sink<ExecutionResult<OnLatestPairUpdatedSubscription>>,
|
|
62
62
|
) =>
|
|
63
63
|
this.sdk.subscribe(
|
|
64
|
-
`subscription
|
|
65
|
-
|
|
66
|
-
address,
|
|
64
|
+
`subscription OnLatestPairUpdated($id: String, $networkId: Int) {
|
|
65
|
+
onLatestPairUpdated (id: $id, networkId: $networkId) {
|
|
66
|
+
address, exchangeHash, id, initialPriceUsd, liquidAt, liquidity, liquidityToken, networkId, newToken, nonLiquidityToken, oldToken, priceChange, priceUsd, token0 { address, currentPoolAmount, decimals, id, initialPoolAmount, name, networkId, pairId, poolVariation, symbol }, token1 { address, currentPoolAmount, decimals, id, initialPoolAmount, name, networkId, pairId, poolVariation, symbol }, transactionHash
|
|
67
67
|
}
|
|
68
68
|
}`,
|
|
69
69
|
vars,
|
|
70
70
|
sink,
|
|
71
71
|
);
|
|
72
|
-
|
|
73
|
-
vars:
|
|
74
|
-
sink: Sink<ExecutionResult<
|
|
72
|
+
onTokenBarsUpdated = async (
|
|
73
|
+
vars: OnTokenBarsUpdatedSubscriptionVariables,
|
|
74
|
+
sink: Sink<ExecutionResult<OnTokenBarsUpdatedSubscription>>,
|
|
75
75
|
) =>
|
|
76
76
|
this.sdk.subscribe(
|
|
77
|
-
`subscription
|
|
78
|
-
|
|
79
|
-
aggregates { r1 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r1D { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r1S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r5 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r5S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r7D { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r15 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r15S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r30 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r30S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r60 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r240 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r720 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } } }, eventSortKey, networkId, pairAddress, pairId, quoteToken,
|
|
77
|
+
`subscription OnTokenBarsUpdated($statsType: TokenPairStatisticsType, $tokenId: String) {
|
|
78
|
+
onTokenBarsUpdated (statsType: $statsType, tokenId: $tokenId) {
|
|
79
|
+
aggregates { r1 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r1D { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r1S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r5 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r5S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r7D { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r15 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r15S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r30 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r30S { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r60 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r240 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } }, r720 { t, token { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken }, usd { buyVolume, buyers, buys, c, h, l, liquidity, o, sellVolume, sellers, sells, t, traders, transactions, v, volume, volumeNativeToken } } }, eventSortKey, networkId, pairAddress, pairId, quoteToken, statsType, timestamp, tokenAddress, tokenId
|
|
80
80
|
}
|
|
81
81
|
}`,
|
|
82
82
|
vars,
|
|
83
83
|
sink,
|
|
84
84
|
);
|
|
85
|
-
|
|
86
|
-
vars:
|
|
87
|
-
sink: Sink<ExecutionResult<
|
|
85
|
+
onPairMetadataUpdated = async (
|
|
86
|
+
vars: OnPairMetadataUpdatedSubscriptionVariables,
|
|
87
|
+
sink: Sink<ExecutionResult<OnPairMetadataUpdatedSubscription>>,
|
|
88
88
|
) =>
|
|
89
89
|
this.sdk.subscribe(
|
|
90
|
-
`subscription
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
`subscription OnPairMetadataUpdated($id: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
|
|
91
|
+
onPairMetadataUpdated (id: $id, quoteToken: $quoteToken, statsType: $statsType) {
|
|
92
|
+
exchangeId, fee, highPrice1, highPrice1w, highPrice4, highPrice12, highPrice24, id, liquidity, liquidityToken, lowPrice1, lowPrice1w, lowPrice4, lowPrice12, lowPrice24, networkId, nonLiquidityToken, pairAddress, price, priceChange1, priceChange1w, priceChange4, priceChange5m, priceChange12, priceChange24, quoteToken, statsType, tickSpacing, token0 { address, decimals, labels { createdAt, subType, type }, name, networkId, pooled, price, symbol }, token1 { address, decimals, labels { createdAt, subType, type }, name, networkId, pooled, price, symbol }, volume1, volume1w, volume4, volume12, volume24
|
|
93
93
|
}
|
|
94
94
|
}`,
|
|
95
95
|
vars,
|
|
96
96
|
sink,
|
|
97
97
|
);
|
|
98
|
-
|
|
99
|
-
vars:
|
|
100
|
-
sink: Sink<ExecutionResult<
|
|
98
|
+
onUnconfirmedBarsUpdated = async (
|
|
99
|
+
vars: OnUnconfirmedBarsUpdatedSubscriptionVariables,
|
|
100
|
+
sink: Sink<ExecutionResult<OnUnconfirmedBarsUpdatedSubscription>>,
|
|
101
101
|
) =>
|
|
102
102
|
this.sdk.subscribe(
|
|
103
|
-
`subscription
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
`subscription OnUnconfirmedBarsUpdated($pairId: String, $quoteToken: QuoteToken) {
|
|
104
|
+
onUnconfirmedBarsUpdated (pairId: $pairId, quoteToken: $quoteToken) {
|
|
105
|
+
aggregates { r1 { c, h, l, o, t, v, volume }, r1S { c, h, l, o, t, v, volume }, r5 { c, h, l, o, t, v, volume }, r5S { c, h, l, o, t, v, volume }, r15 { c, h, l, o, t, v, volume }, r15S { c, h, l, o, t, v, volume } }, eventSortKey, networkId, pairAddress, pairId, quoteToken, quoteTokenAddress, timestamp
|
|
106
106
|
}
|
|
107
107
|
}`,
|
|
108
108
|
vars,
|
|
109
109
|
sink,
|
|
110
110
|
);
|
|
111
|
-
|
|
112
|
-
vars:
|
|
113
|
-
sink: Sink<ExecutionResult<
|
|
111
|
+
onTokenLifecycleEventsCreated = async (
|
|
112
|
+
vars: OnTokenLifecycleEventsCreatedSubscriptionVariables,
|
|
113
|
+
sink: Sink<ExecutionResult<OnTokenLifecycleEventsCreatedSubscription>>,
|
|
114
114
|
) =>
|
|
115
115
|
this.sdk.subscribe(
|
|
116
|
-
`subscription
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
`subscription OnTokenLifecycleEventsCreated($address: String, $networkId: Int) {
|
|
117
|
+
onTokenLifecycleEventsCreated (address: $address, networkId: $networkId) {
|
|
118
|
+
events { blockHash, blockNumber, data { ... on TokenBurnEventData { amount, circulatingSupply, totalSupply }, ... on TokenMintEventData { amount, circulatingSupply, totalSupply } }, eventType, id, logIndex, maker, networkId, timestamp, tokenAddress, transactionHash, transactionIndex }, id
|
|
119
119
|
}
|
|
120
120
|
}`,
|
|
121
121
|
vars,
|
|
@@ -147,53 +147,79 @@ export class Subscribe {
|
|
|
147
147
|
vars,
|
|
148
148
|
sink,
|
|
149
149
|
);
|
|
150
|
-
|
|
151
|
-
vars:
|
|
152
|
-
sink: Sink<ExecutionResult<
|
|
150
|
+
onUnconfirmedEventsCreated = async (
|
|
151
|
+
vars: OnUnconfirmedEventsCreatedSubscriptionVariables,
|
|
152
|
+
sink: Sink<ExecutionResult<OnUnconfirmedEventsCreatedSubscription>>,
|
|
153
153
|
) =>
|
|
154
154
|
this.sdk.subscribe(
|
|
155
|
-
`subscription
|
|
156
|
-
|
|
157
|
-
address,
|
|
155
|
+
`subscription OnUnconfirmedEventsCreated($address: String, $id: String, $quoteToken: QuoteToken) {
|
|
156
|
+
onUnconfirmedEventsCreated (address: $address, id: $id, quoteToken: $quoteToken) {
|
|
157
|
+
address, events { address, blockHash, blockNumber, data { ... on UnconfirmedLiquidityChangeEventData { amount0, amount0Shifted, amount1, amount1Shifted, type }, ... on UnconfirmedSwapEventData { amountNonLiquidityToken, priceBaseToken, priceBaseTokenTotal, priceUsd, priceUsdTotal, type } }, eventDisplayType, eventType, id, logIndex, maker, networkId, quoteToken, supplementalIndex, timestamp, transactionHash, transactionIndex }, id, networkId, quoteToken
|
|
158
158
|
}
|
|
159
159
|
}`,
|
|
160
160
|
vars,
|
|
161
161
|
sink,
|
|
162
162
|
);
|
|
163
|
-
|
|
164
|
-
vars:
|
|
165
|
-
sink: Sink<ExecutionResult<
|
|
163
|
+
onSimulateTokenContract = async (
|
|
164
|
+
vars: OnSimulateTokenContractSubscriptionVariables,
|
|
165
|
+
sink: Sink<ExecutionResult<OnSimulateTokenContractSubscription>>,
|
|
166
166
|
) =>
|
|
167
167
|
this.sdk.subscribe(
|
|
168
|
-
`subscription
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
`subscription OnSimulateTokenContract($contractAddress: String, $networkId: Int!, $simulationId: String) {
|
|
169
|
+
onSimulateTokenContract (contractAddress: $contractAddress, networkId: $networkId, simulationId: $simulationId) {
|
|
170
|
+
analysisType, blockNumber, contractBalance { tokenContractEthBalance, tokenContractTokenBalance }, contractHashKey, creator { creatorAddress, creatorEthBalance, creatorTokenBalance }, deploy { deploySuccess, tokenMintedToDeployer }, errors { contractBalanceErrors { tokenContractEthBalanceError, tokenContractTokenBalanceError }, creatorErrors { creatorEthBalanceError, creatorTokenBalanceError }, deployErrors { deployError, tokenMintedToDeployerError }, liquidityErrors { addLiquidityError, lpTotalSupplyError, postLiquidityEnableTradingError, preLiquidityEnableTradingError }, ownerErrors { ownerAddressError, ownerEthBalanceError, ownerTokenBalanceError }, simulatorError, swapErrors { buyError, buyErrorEnum, sellError, sellErrorEnum }, tokenErrors { canRenounceOwnershipError, canTransferOwnershipError, decimalsError, tokenNameError, tokenSymbolError, totalSupplyError }, transferErrors { tokenContractApprovalError, tokenTransferredToContractError, userApprovalError } }, id, liquidity { addLiquiditySuccess, liquiditySetByPreLiquidityOpenTradingCall, lpTotalSupply, pairAddress, postLiquidityEnableTradingCall, postLiquidityEnableTradingSuccess, preLiquidityEnableTradingCall, preLiquidityEnableTradingSuccess, preLiquidityEnableTradingSupportsTransfer }, networkId, owner { ownerAddress, ownerEthBalance, ownerTokenBalance }, sortKey, status, swap { buyGasUsed, buySuccess, buyTax, maxBuyAmount, maxSellAmount, sellGasUsed, sellSuccess, sellTax }, timestamp, token { canRenounceOwnership, canTransferOwnership, contractAddress, decimals, isOwnerRenounced, tokenName, tokenSymbol, totalSupply }, transfer { tokenContractApprovalSuccess, tokenTransferredToContractSuccess, userApprovalSuccess }, uuid, uuidHashKey
|
|
171
171
|
}
|
|
172
172
|
}`,
|
|
173
173
|
vars,
|
|
174
174
|
sink,
|
|
175
175
|
);
|
|
176
|
-
|
|
177
|
-
vars:
|
|
178
|
-
sink: Sink<ExecutionResult<
|
|
176
|
+
onDetailedStatsUpdated = async (
|
|
177
|
+
vars: OnDetailedStatsUpdatedSubscriptionVariables,
|
|
178
|
+
sink: Sink<ExecutionResult<OnDetailedStatsUpdatedSubscription>>,
|
|
179
179
|
) =>
|
|
180
180
|
this.sdk.subscribe(
|
|
181
|
-
`subscription
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
`subscription OnDetailedStatsUpdated($pairId: String, $statsType: TokenPairStatisticsType, $tokenOfInterest: TokenOfInterest) {
|
|
182
|
+
onDetailedStatsUpdated (pairId: $pairId, statsType: $statsType, tokenOfInterest: $tokenOfInterest) {
|
|
183
|
+
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
|
|
184
184
|
}
|
|
185
185
|
}`,
|
|
186
186
|
vars,
|
|
187
187
|
sink,
|
|
188
188
|
);
|
|
189
|
-
|
|
190
|
-
vars:
|
|
191
|
-
sink: Sink<ExecutionResult<
|
|
189
|
+
onNftEventsCreated = async (
|
|
190
|
+
vars: OnNftEventsCreatedSubscriptionVariables,
|
|
191
|
+
sink: Sink<ExecutionResult<OnNftEventsCreatedSubscription>>,
|
|
192
192
|
) =>
|
|
193
193
|
this.sdk.subscribe(
|
|
194
|
-
`subscription
|
|
195
|
-
|
|
196
|
-
|
|
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>>,
|
|
205
|
+
) =>
|
|
206
|
+
this.sdk.subscribe(
|
|
207
|
+
`subscription OnPricesUpdated($input: [OnPricesUpdatedInput!]!) {
|
|
208
|
+
onPricesUpdated (input: $input) {
|
|
209
|
+
address, confidence, networkId, poolAddress, priceUsd, timestamp
|
|
210
|
+
}
|
|
211
|
+
}`,
|
|
212
|
+
vars,
|
|
213
|
+
sink,
|
|
214
|
+
);
|
|
215
|
+
onLatestTokens = async (
|
|
216
|
+
vars: OnLatestTokensSubscriptionVariables,
|
|
217
|
+
sink: Sink<ExecutionResult<OnLatestTokensSubscription>>,
|
|
218
|
+
) =>
|
|
219
|
+
this.sdk.subscribe(
|
|
220
|
+
`subscription OnLatestTokens($id: String, $networkId: Int, $tokenAddress: String) {
|
|
221
|
+
onLatestTokens (id: $id, networkId: $networkId, tokenAddress: $tokenAddress) {
|
|
222
|
+
blockHash, blockNumber, creatorAddress, creatorBalance, decimals, id, networkId, simulationResults { buyGasUsed, buySuccess, buyTax, canRenounceOwnership, canTransferOwnership, isOwnerRenounced, maxBuyAmount, maxSellAmount, openTradingCall, sellGasUsed, sellSuccess, sellTax }, timeCreated, tokenAddress, tokenName, tokenSymbol, totalSupply, traceIndex, transactionHash, transactionIndex
|
|
197
223
|
}
|
|
198
224
|
}`,
|
|
199
225
|
vars,
|
|
@@ -243,53 +269,27 @@ export class Subscribe {
|
|
|
243
269
|
vars,
|
|
244
270
|
sink,
|
|
245
271
|
);
|
|
246
|
-
|
|
247
|
-
vars:
|
|
248
|
-
sink: Sink<ExecutionResult<
|
|
249
|
-
) =>
|
|
250
|
-
this.sdk.subscribe(
|
|
251
|
-
`subscription OnTokenLifecycleEventsCreated($address: String, $networkId: Int) {
|
|
252
|
-
onTokenLifecycleEventsCreated (address: $address, networkId: $networkId) {
|
|
253
|
-
events { blockHash, blockNumber, data { ... on TokenBurnEventData { amount, circulatingSupply, totalSupply }, ... on TokenMintEventData { amount, circulatingSupply, totalSupply } }, eventType, id, logIndex, maker, networkId, timestamp, tokenAddress, transactionHash, transactionIndex }, id
|
|
254
|
-
}
|
|
255
|
-
}`,
|
|
256
|
-
vars,
|
|
257
|
-
sink,
|
|
258
|
-
);
|
|
259
|
-
onUnconfirmedBarsUpdated = async (
|
|
260
|
-
vars: OnUnconfirmedBarsUpdatedSubscriptionVariables,
|
|
261
|
-
sink: Sink<ExecutionResult<OnUnconfirmedBarsUpdatedSubscription>>,
|
|
262
|
-
) =>
|
|
263
|
-
this.sdk.subscribe(
|
|
264
|
-
`subscription OnUnconfirmedBarsUpdated($pairId: String, $quoteToken: QuoteToken) {
|
|
265
|
-
onUnconfirmedBarsUpdated (pairId: $pairId, quoteToken: $quoteToken) {
|
|
266
|
-
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
|
|
267
|
-
}
|
|
268
|
-
}`,
|
|
269
|
-
vars,
|
|
270
|
-
sink,
|
|
271
|
-
);
|
|
272
|
-
onDetailedStatsUpdated = async (
|
|
273
|
-
vars: OnDetailedStatsUpdatedSubscriptionVariables,
|
|
274
|
-
sink: Sink<ExecutionResult<OnDetailedStatsUpdatedSubscription>>,
|
|
272
|
+
onNftPoolEventsCreated = async (
|
|
273
|
+
vars: OnNftPoolEventsCreatedSubscriptionVariables,
|
|
274
|
+
sink: Sink<ExecutionResult<OnNftPoolEventsCreatedSubscription>>,
|
|
275
275
|
) =>
|
|
276
276
|
this.sdk.subscribe(
|
|
277
|
-
`subscription
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
`subscription OnNftPoolEventsCreated($collectionAddress: String, $exchangeAddress: String, $networkId: Int, $poolAddress: String) {
|
|
278
|
+
onNftPoolEventsCreated (collectionAddress: $collectionAddress, exchangeAddress: $exchangeAddress, networkId: $networkId, poolAddress: $poolAddress) {
|
|
279
|
+
collectionAddress, events { blockHash, blockNumber, collectionAddress, collectionId, data { ... on NewPoolEventData { assetRecipientAddress, bondingCurveAddress, bondingCurveType, buyPriceT, collectionAddress, createdAt, delta, feeAmountT, nbtRatio, networkId, nftTokenBalance, ownerAddress, poolAddress, sellPriceT, startPriceT, tokenAddress, tokenBalanceT, type, usdRatio }, ... on NewPoolEventDataV2 { assetRecipientAddress, bondingCurveAddress, bondingCurveType, buyPriceT, collectionAddress, createdAt, delta, feeAmountT, nbtRatio, networkId, nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftTokenIds, nftTokenQuantities, ownerAddress, poolAddress, poolNftType, propertyChecker, royalties { percent, recipient }, sellPriceT, startPriceT, tokenAddress, tokenBalanceT, type, usdRatio }, ... on NftPoolAssetRecipientUpdateEventData { newAssetRecipient, type }, ... on NftPoolDeltaUpdateEventData { newDelta, type }, ... on NftPoolFeeUpdateEventData { nbtRatio, newFeeT, type, usdRatio }, ... on NftPoolNftDepositEventData { nftTokenBalance, nftTokenIds, tokenBalanceT, type }, ... on NftPoolNftDepositEventDataV2 { nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftTokenAmounts, nftTokenIds, tokenBalanceT, type }, ... on NftPoolNftWithdrawalEventData { nftTokenBalance, nftTokenIds, tokenBalanceT, type }, ... on NftPoolNftWithdrawalEventDataV2 { nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftTokenAmounts, nftTokenIds, tokenBalanceT, type }, ... on NftPoolOwnershipTransferredEventDataV2 { newOwner, type }, ... on NftPoolSpotPriceUpdateEventData { nbtRatio, newBuyPriceT, newSellPriceT, newSpotPriceT, type, usdRatio }, ... on NftPoolSpotPriceUpdateEventDataV2 { nbtRatio, newBuyPriceT, newSellPriceT, newSpotPriceT, type, usdRatio }, ... on NftPoolTokenDepositEventData { amountT, nbtRatio, nftTokenBalance, tokenBalanceT, type, usdRatio }, ... on NftPoolTokenDepositEventDataV2 { amountT, nbtRatio, tokenBalanceT, type, usdRatio }, ... on NftPoolTokenWithdrawalEventData { amountT, nbtRatio, nftTokenBalance, tokenBalanceT, type, usdRatio }, ... on NftPoolTokenWithdrawalEventDataV2 { amountT, nbtRatio, tokenBalanceT, type, usdRatio }, ... on SwapNftInPoolEventData { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftTokenBalance, nftsTransfered { amountT, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio }, ... on SwapNftInPoolEventDataV2 { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftsTransfered { amountT, nftQuantity, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio }, ... on SwapNftOutPoolEventData { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftTokenBalance, nftsTransfered { amountT, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio }, ... on SwapNftOutPoolEventDataV2 { amountT, nbtRatio, newBuyPriceT, newDelta, newSellPriceT, newSpotPriceT, nftAssets { address, attributes { class, css, displayType, maxValue, name, value, valueType }, description, id, media { image, processed, thumbLg, thumbSm }, name, networkId, originalImage, quantity, rawAssetData { animationUrl, externalUrl, imageData, imageUrl }, tokenId, uri }, nftsTransfered { amountT, nftQuantity, nftTokenId }, poolFeeT, protocolFeeT, tokenBalanceT, tokenId, type, usdRatio } }, eventType, exchangeAddress, id, logIndex, maker, networkId, poolAddress, poolType, timestamp, tokenAddress, transactionHash, transactionIndex }, exchangeAddress, id, networkId, poolAddress
|
|
280
280
|
}
|
|
281
281
|
}`,
|
|
282
282
|
vars,
|
|
283
283
|
sink,
|
|
284
284
|
);
|
|
285
|
-
|
|
286
|
-
vars:
|
|
287
|
-
sink: Sink<ExecutionResult<
|
|
285
|
+
onBarsUpdated = async (
|
|
286
|
+
vars: OnBarsUpdatedSubscriptionVariables,
|
|
287
|
+
sink: Sink<ExecutionResult<OnBarsUpdatedSubscription>>,
|
|
288
288
|
) =>
|
|
289
289
|
this.sdk.subscribe(
|
|
290
|
-
`subscription
|
|
291
|
-
|
|
292
|
-
|
|
290
|
+
`subscription OnBarsUpdated($pairId: String, $quoteToken: QuoteToken, $statsType: TokenPairStatisticsType) {
|
|
291
|
+
onBarsUpdated (pairId: $pairId, quoteToken: $quoteToken, statsType: $statsType) {
|
|
292
|
+
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
|
|
293
293
|
}
|
|
294
294
|
}`,
|
|
295
295
|
vars,
|