@codex-data/sdk 0.6.2 → 1.0.0-rc1
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_mutations/CreateApiTokens.graphql +9 -0
- package/dist/resources/generated_mutations/CreateWebhooks.graphql +80 -0
- package/dist/resources/generated_mutations/DeleteApiToken.graphql +3 -0
- package/{src/sdk/graphql → dist/resources/generated_mutations}/DeleteWebhooks.graphql +1 -1
- package/dist/resources/generated_queries/ApiToken.graphql +9 -0
- package/dist/resources/generated_queries/ApiTokens.graphql +9 -0
- package/dist/resources/generated_queries/Balances.graphql +12 -0
- package/dist/resources/generated_queries/ChartUrls.graphql +7 -0
- package/dist/resources/generated_queries/FilterExchanges.graphql +43 -0
- package/dist/resources/generated_queries/FilterNftCollections.graphql +569 -0
- package/dist/resources/generated_queries/FilterNftParallelAssets.graphql +60 -0
- package/dist/resources/generated_queries/FilterNftPoolCollections.graphql +71 -0
- package/dist/resources/generated_queries/FilterNftPools.graphql +124 -0
- package/dist/resources/generated_queries/FilterPairs.graphql +339 -0
- package/dist/resources/generated_queries/FilterTokens.graphql +279 -0
- package/{src/sdk/graphql → dist/resources/generated_queries}/GetBars.graphql +21 -9
- package/dist/resources/generated_queries/GetCommunityNotes.graphql +20 -0
- package/dist/resources/generated_queries/GetDetailedNftStats.graphql +831 -0
- package/{src/sdk/graphql → dist/resources/generated_queries}/GetDetailedPairStats.graphql +370 -373
- package/dist/resources/generated_queries/GetDetailedPairsStats.graphql +922 -0
- package/dist/resources/generated_queries/GetEventLabels.graphql +24 -0
- package/dist/resources/generated_queries/GetExchanges.graphql +12 -0
- package/dist/resources/generated_queries/GetLatestPairs.graphql +57 -0
- package/dist/resources/generated_queries/GetLatestTokens.graphql +39 -0
- package/dist/resources/generated_queries/GetNetworkStats.graphql +13 -0
- package/{src/sdk/graphql → dist/resources/generated_queries}/GetNetworkStatus.graphql +2 -1
- package/{src/sdk/graphql → dist/resources/generated_queries}/GetNetworks.graphql +1 -0
- package/dist/resources/generated_queries/GetNftAssets.graphql +59 -0
- package/dist/resources/generated_queries/GetNftCollectionMetadata.graphql +75 -0
- package/dist/resources/generated_queries/GetNftContracts.graphql +39 -0
- package/dist/resources/generated_queries/GetNftEvents.graphql +54 -0
- package/dist/resources/generated_queries/GetNftPool.graphql +74 -0
- package/dist/resources/generated_queries/GetNftPoolCollection.graphql +33 -0
- package/dist/resources/generated_queries/GetNftPoolCollectionsByExchange.graphql +38 -0
- package/dist/resources/generated_queries/GetNftPoolEvents.graphql +41 -0
- package/dist/resources/generated_queries/GetNftPoolStats.graphql +40 -0
- package/dist/resources/generated_queries/GetNftPoolsByCollectionAndExchange.graphql +89 -0
- package/dist/resources/generated_queries/GetNftPoolsByOwner.graphql +89 -0
- package/dist/resources/generated_queries/GetParallelAssets.graphql +50 -0
- package/dist/resources/generated_queries/GetParallelCardChanges.graphql +57 -0
- package/dist/resources/generated_queries/GetPrimePoolAssets.graphql +32 -0
- package/dist/resources/generated_queries/GetPrimePoolEvents.graphql +38 -0
- package/dist/resources/generated_queries/GetPrimePools.graphql +62 -0
- package/dist/resources/generated_queries/GetSimulateTokenContractResults.graphql +128 -0
- package/{src/sdk/graphql → dist/resources/generated_queries}/GetSymbol.graphql +7 -7
- package/dist/resources/generated_queries/GetTokenCount.graphql +3 -0
- package/dist/resources/generated_queries/GetTokenEvents.graphql +49 -0
- package/dist/resources/generated_queries/GetTokenInfo.graphql +17 -0
- package/dist/resources/generated_queries/GetTokenPrices.graphql +9 -0
- package/dist/resources/generated_queries/GetTokensInfo.graphql +17 -0
- package/dist/resources/generated_queries/GetUniV3Ticks.graphql +22 -0
- package/dist/resources/generated_queries/GetWebhooks.graphql +36 -0
- package/dist/resources/generated_queries/Holders.graphql +14 -0
- package/dist/resources/generated_queries/LiquidityLocks.graphql +26 -0
- package/dist/resources/generated_queries/LiquidityMetadata.graphql +17 -0
- package/dist/resources/generated_queries/ListFavoriteTokens.graphql +58 -0
- package/{src/sdk/graphql → dist/resources/generated_queries}/ListPairsForToken.graphql +77 -41
- package/dist/resources/generated_queries/ListPairsWithMetadataForToken.graphql +282 -0
- package/{src/sdk/graphql → dist/resources/generated_queries}/ListTopTokens.graphql +22 -16
- package/dist/resources/generated_queries/NftHolders.graphql +12 -0
- package/{src/sdk/graphql/OnPairMetadataUpdated.graphql → dist/resources/generated_queries/PairMetadata.graphql} +21 -3
- package/dist/resources/generated_queries/PrimeBalance.graphql +12 -0
- package/dist/resources/generated_queries/PrimeHolders.graphql +13 -0
- package/dist/resources/generated_queries/SearchNfts.graphql +35 -0
- package/dist/resources/generated_queries/Token.graphql +62 -0
- package/dist/resources/generated_queries/TokenLifecycleEvents.graphql +22 -0
- package/{src/sdk/graphql/GetSparklines.graphql → dist/resources/generated_queries/TokenSparklines.graphql} +2 -2
- package/dist/resources/generated_queries/Tokens.graphql +62 -0
- package/dist/resources/generated_queries/WalletNftCollectionAssets.graphql +11 -0
- package/dist/resources/generated_queries/WalletNftCollections.graphql +10 -0
- package/dist/resources/generated_subscriptions/OnBarsUpdated.graphql +513 -0
- package/{src/sdk/graphql → dist/resources/generated_subscriptions}/OnDetailedStatsUpdated.graphql +119 -111
- package/dist/resources/generated_subscriptions/OnEventLabelCreated.graphql +11 -0
- package/dist/resources/generated_subscriptions/OnEventsCreated.graphql +46 -0
- package/dist/resources/generated_subscriptions/OnLatestPairUpdated.graphql +42 -0
- package/dist/resources/generated_subscriptions/OnLatestTokens.graphql +37 -0
- package/{src/sdk/graphql → dist/resources/generated_subscriptions}/OnNftAssetsCreated.graphql +30 -17
- package/dist/resources/generated_subscriptions/OnNftEventsCreated.graphql +36 -0
- package/dist/resources/generated_subscriptions/OnNftPoolEventsCreated.graphql +37 -0
- package/dist/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +73 -0
- package/{src/sdk/graphql → dist/resources/generated_subscriptions}/OnPriceUpdated.graphql +1 -1
- package/dist/resources/generated_subscriptions/OnPricesUpdated.graphql +9 -0
- package/dist/resources/generated_subscriptions/OnSimulateTokenContract.graphql +121 -0
- package/dist/resources/generated_subscriptions/OnTokenEventsCreated.graphql +39 -0
- package/dist/resources/generated_subscriptions/OnTokenLifecycleEventsCreated.graphql +18 -0
- package/dist/resources/generated_subscriptions/OnUnconfirmedEventsCreated.graphql +32 -0
- package/dist/resources/graphql.d.ts +131 -0
- package/dist/resources/graphql.d.ts.map +1 -1
- package/dist/resources/graphql.js.map +1 -1
- package/dist/resources/graphql.schema.json +1570 -0
- package/dist/resources/graphql.ts +148 -0
- package/dist/resources/schema.graphql +184 -0
- package/dist/scripts/buildSdk.d.ts +2 -0
- package/dist/scripts/buildSdk.d.ts.map +1 -0
- package/dist/scripts/buildSdk.js +135 -0
- package/dist/scripts/buildSdk.js.map +1 -0
- package/dist/scripts/generateGraphql.d.ts +30 -0
- package/dist/scripts/generateGraphql.d.ts.map +1 -0
- package/dist/scripts/generateGraphql.js +179 -0
- package/dist/scripts/generateGraphql.js.map +1 -0
- package/dist/sdk/Mutation.d.ts +5 -8
- package/dist/sdk/Mutation.d.ts.map +1 -1
- package/dist/sdk/Mutation.js +3 -0
- package/dist/sdk/Mutation.js.map +1 -1
- package/dist/sdk/Query.d.ts +65 -14
- package/dist/sdk/Query.d.ts.map +1 -1
- package/dist/sdk/Query.js +64 -12
- package/dist/sdk/Query.js.map +1 -1
- package/dist/sdk/Subscribe.d.ts +18 -11
- package/dist/sdk/Subscribe.d.ts.map +1 -1
- package/dist/sdk/Subscribe.js +112 -9
- package/dist/sdk/Subscribe.js.map +1 -1
- package/dist/sdk/generated/gql.d.ts +636 -66
- package/dist/sdk/generated/gql.d.ts.map +1 -1
- package/dist/sdk/generated/gql.js +84 -22
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +8407 -2195
- package/dist/sdk/generated/graphql.d.ts.map +1 -1
- package/dist/sdk/generated/graphql.js +87 -25
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/package.json +12 -4
- package/src/resources/generated_mutations/CreateApiTokens.graphql +9 -0
- package/src/resources/generated_mutations/CreateWebhooks.graphql +80 -0
- package/src/resources/generated_mutations/DeleteApiToken.graphql +3 -0
- package/src/resources/generated_mutations/DeleteWebhooks.graphql +5 -0
- package/src/resources/generated_queries/ApiToken.graphql +9 -0
- package/src/resources/generated_queries/ApiTokens.graphql +9 -0
- package/src/resources/generated_queries/Balances.graphql +12 -0
- package/src/resources/generated_queries/ChartUrls.graphql +7 -0
- package/src/resources/generated_queries/FilterExchanges.graphql +43 -0
- package/src/resources/generated_queries/FilterNftCollections.graphql +569 -0
- package/src/resources/generated_queries/FilterNftParallelAssets.graphql +60 -0
- package/src/resources/generated_queries/FilterNftPoolCollections.graphql +71 -0
- package/src/resources/generated_queries/FilterNftPools.graphql +124 -0
- package/src/resources/generated_queries/FilterPairs.graphql +339 -0
- package/src/resources/generated_queries/FilterTokens.graphql +279 -0
- package/src/resources/generated_queries/GetBars.graphql +44 -0
- package/src/resources/generated_queries/GetCommunityNotes.graphql +20 -0
- package/src/resources/generated_queries/GetDetailedNftStats.graphql +831 -0
- package/src/resources/generated_queries/GetDetailedPairStats.graphql +938 -0
- package/src/resources/generated_queries/GetDetailedPairsStats.graphql +922 -0
- package/src/resources/generated_queries/GetEventLabels.graphql +24 -0
- package/src/resources/generated_queries/GetExchanges.graphql +12 -0
- package/src/resources/generated_queries/GetLatestPairs.graphql +57 -0
- package/src/resources/generated_queries/GetLatestTokens.graphql +39 -0
- package/src/resources/generated_queries/GetNetworkStats.graphql +13 -0
- package/src/resources/generated_queries/GetNetworkStatus.graphql +8 -0
- package/src/resources/generated_queries/GetNetworks.graphql +7 -0
- package/src/resources/generated_queries/GetNftAssets.graphql +59 -0
- package/src/resources/generated_queries/GetNftCollectionMetadata.graphql +75 -0
- package/src/resources/generated_queries/GetNftContracts.graphql +39 -0
- package/src/resources/generated_queries/GetNftEvents.graphql +54 -0
- package/src/resources/generated_queries/GetNftPool.graphql +74 -0
- package/src/resources/generated_queries/GetNftPoolCollection.graphql +33 -0
- package/src/resources/generated_queries/GetNftPoolCollectionsByExchange.graphql +38 -0
- package/src/resources/generated_queries/GetNftPoolEvents.graphql +41 -0
- package/src/resources/generated_queries/GetNftPoolStats.graphql +40 -0
- package/src/resources/generated_queries/GetNftPoolsByCollectionAndExchange.graphql +89 -0
- package/src/resources/generated_queries/GetNftPoolsByOwner.graphql +89 -0
- package/src/resources/generated_queries/GetParallelAssets.graphql +50 -0
- package/src/resources/generated_queries/GetParallelCardChanges.graphql +57 -0
- package/src/resources/generated_queries/GetPrimePoolAssets.graphql +32 -0
- package/src/resources/generated_queries/GetPrimePoolEvents.graphql +38 -0
- package/src/resources/generated_queries/GetPrimePools.graphql +62 -0
- package/src/resources/generated_queries/GetSimulateTokenContractResults.graphql +128 -0
- package/src/resources/generated_queries/GetSymbol.graphql +11 -0
- package/src/resources/generated_queries/GetTokenCount.graphql +3 -0
- package/src/resources/generated_queries/GetTokenEvents.graphql +49 -0
- package/src/resources/generated_queries/GetTokenInfo.graphql +17 -0
- package/src/resources/generated_queries/GetTokenPrices.graphql +9 -0
- package/src/resources/generated_queries/GetTokensInfo.graphql +17 -0
- package/src/resources/generated_queries/GetUniV3Ticks.graphql +22 -0
- package/src/resources/generated_queries/GetWebhooks.graphql +36 -0
- package/src/resources/generated_queries/Holders.graphql +14 -0
- package/src/resources/generated_queries/LiquidityLocks.graphql +26 -0
- package/src/resources/generated_queries/LiquidityMetadata.graphql +17 -0
- package/src/resources/generated_queries/ListFavoriteTokens.graphql +58 -0
- package/src/resources/generated_queries/ListPairsForToken.graphql +141 -0
- package/src/resources/generated_queries/ListPairsWithMetadataForToken.graphql +282 -0
- package/src/resources/generated_queries/ListTopTokens.graphql +54 -0
- package/src/resources/generated_queries/NftHolders.graphql +12 -0
- package/src/resources/generated_queries/PairMetadata.graphql +73 -0
- package/src/resources/generated_queries/PrimeBalance.graphql +12 -0
- package/src/resources/generated_queries/PrimeHolders.graphql +13 -0
- package/src/resources/generated_queries/SearchNfts.graphql +35 -0
- package/src/resources/generated_queries/Token.graphql +62 -0
- package/src/resources/generated_queries/TokenLifecycleEvents.graphql +22 -0
- package/src/resources/generated_queries/TokenSparklines.graphql +10 -0
- package/src/resources/generated_queries/Tokens.graphql +62 -0
- package/src/resources/generated_queries/WalletNftCollectionAssets.graphql +11 -0
- package/src/resources/generated_queries/WalletNftCollections.graphql +10 -0
- package/src/resources/generated_subscriptions/OnBarsUpdated.graphql +513 -0
- package/src/resources/generated_subscriptions/OnDetailedStatsUpdated.graphql +332 -0
- package/src/resources/generated_subscriptions/OnEventLabelCreated.graphql +11 -0
- package/src/resources/generated_subscriptions/OnEventsCreated.graphql +46 -0
- package/src/resources/generated_subscriptions/OnLatestPairUpdated.graphql +42 -0
- package/src/resources/generated_subscriptions/OnLatestTokens.graphql +37 -0
- package/src/resources/generated_subscriptions/OnNftAssetsCreated.graphql +42 -0
- package/src/resources/generated_subscriptions/OnNftEventsCreated.graphql +36 -0
- package/src/resources/generated_subscriptions/OnNftPoolEventsCreated.graphql +37 -0
- package/src/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +73 -0
- package/src/resources/generated_subscriptions/OnPriceUpdated.graphql +9 -0
- package/src/resources/generated_subscriptions/OnPricesUpdated.graphql +9 -0
- package/src/resources/generated_subscriptions/OnSimulateTokenContract.graphql +121 -0
- package/src/resources/generated_subscriptions/OnTokenEventsCreated.graphql +39 -0
- package/src/resources/generated_subscriptions/OnTokenLifecycleEventsCreated.graphql +18 -0
- package/src/resources/generated_subscriptions/OnUnconfirmedEventsCreated.graphql +32 -0
- package/src/resources/graphql.schema.json +1570 -0
- package/src/resources/graphql.ts +148 -0
- package/src/resources/schema.graphql +184 -0
- package/src/scripts/buildSdk.ts +173 -0
- package/src/scripts/generateGraphql.ts +236 -0
- package/src/sdk/Mutation.ts +13 -4
- package/src/sdk/Query.ts +252 -37
- package/src/sdk/Subscribe.ts +230 -41
- package/src/sdk/generated/gql.ts +354 -44
- package/src/sdk/generated/graphql.ts +889 -151
- package/dist/sdk/Query.test.d.ts +0 -2
- package/dist/sdk/Query.test.d.ts.map +0 -1
- package/dist/sdk/Query.test.js +0 -50
- package/dist/sdk/Query.test.js.map +0 -1
- package/src/sdk/Query.test.ts +0 -40
- package/src/sdk/graphql/CreateWebhooks.graphql +0 -464
- package/src/sdk/graphql/FilterExchanges.graphql +0 -23
- package/src/sdk/graphql/FilterPairs.graphql +0 -126
- package/src/sdk/graphql/FilterTokens.graphql +0 -131
- package/src/sdk/graphql/GetPrice.graphql +0 -9
- package/src/sdk/graphql/GetTokens.graphql +0 -14
- package/src/sdk/graphql/GetWebhooks.graphql +0 -120
- package/src/sdk/graphql/OnBarsUpdated.graphql +0 -68
- package/src/sdk/graphql/OnEventsCreated.graphql +0 -62
- package/src/sdk/graphql/OnNftEventsCreated.graphql +0 -83
package/src/resources/graphql.ts
CHANGED
|
@@ -68,6 +68,21 @@ export type AddTokenLifecycleEventsOutput = {
|
|
|
68
68
|
id: Scalars['String']['output'];
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
+
/** Response returned by `onUnconfirmedEventsCreated`. */
|
|
72
|
+
export type AddUnconfirmedEventsOutput = {
|
|
73
|
+
__typename?: 'AddUnconfirmedEventsOutput';
|
|
74
|
+
/** The contract address of the pair. */
|
|
75
|
+
address: Scalars['String']['output'];
|
|
76
|
+
/** A list of transactions for the token. */
|
|
77
|
+
events: Array<Maybe<UnconfirmedEvent>>;
|
|
78
|
+
/** The ID of the event (`address`:`networkId`). For example, `0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2:1`. */
|
|
79
|
+
id: Scalars['String']['output'];
|
|
80
|
+
/** The network ID that the token is deployed on. */
|
|
81
|
+
networkId: Scalars['Int']['output'];
|
|
82
|
+
/** The token of interest within the pair. Can be `token0` or `token1`. */
|
|
83
|
+
quoteToken?: Maybe<QuoteToken>;
|
|
84
|
+
};
|
|
85
|
+
|
|
71
86
|
export enum AlertRecurrence {
|
|
72
87
|
Indefinite = 'INDEFINITE',
|
|
73
88
|
Once = 'ONCE'
|
|
@@ -1141,6 +1156,7 @@ export type GasEstimate = {
|
|
|
1141
1156
|
approveTxHash?: Maybe<Scalars['String']['output']>;
|
|
1142
1157
|
error?: Maybe<Scalars['String']['output']>;
|
|
1143
1158
|
gasLimitEstimate?: Maybe<Scalars['String']['output']>;
|
|
1159
|
+
totalFee?: Maybe<Scalars['String']['output']>;
|
|
1144
1160
|
};
|
|
1145
1161
|
|
|
1146
1162
|
export type GasFee = {
|
|
@@ -1189,10 +1205,25 @@ export type GetGasEstimateInput = {
|
|
|
1189
1205
|
networkId: Scalars['Int']['input'];
|
|
1190
1206
|
outputTokenAddress: Scalars['String']['input'];
|
|
1191
1207
|
poolAddress?: InputMaybe<Scalars['String']['input']>;
|
|
1208
|
+
sendWithPrivateRpc?: InputMaybe<Scalars['Boolean']['input']>;
|
|
1192
1209
|
userId?: InputMaybe<Scalars['Int']['input']>;
|
|
1193
1210
|
walletId?: InputMaybe<Scalars['Int']['input']>;
|
|
1194
1211
|
};
|
|
1195
1212
|
|
|
1213
|
+
/** Response returned by `getNetworkStats`. */
|
|
1214
|
+
export type GetNetworkStatsResponse = {
|
|
1215
|
+
__typename?: 'GetNetworkStatsResponse';
|
|
1216
|
+
liquidity: Scalars['Float']['output'];
|
|
1217
|
+
transactions1: Scalars['Int']['output'];
|
|
1218
|
+
transactions4: Scalars['Int']['output'];
|
|
1219
|
+
transactions12: Scalars['Int']['output'];
|
|
1220
|
+
transactions24: Scalars['Int']['output'];
|
|
1221
|
+
volume1: Scalars['Float']['output'];
|
|
1222
|
+
volume4: Scalars['Float']['output'];
|
|
1223
|
+
volume12: Scalars['Float']['output'];
|
|
1224
|
+
volume24: Scalars['Float']['output'];
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1196
1227
|
/** Response returned by `getNftPoolCollectionsByExchange`. */
|
|
1197
1228
|
export type GetNftPoolCollectionsResponse = {
|
|
1198
1229
|
__typename?: 'GetNftPoolCollectionsResponse';
|
|
@@ -4288,6 +4319,11 @@ export type OnBarsUpdatedResponse = {
|
|
|
4288
4319
|
timestamp: Scalars['Int']['output'];
|
|
4289
4320
|
};
|
|
4290
4321
|
|
|
4322
|
+
export type OnPricesUpdatedInput = {
|
|
4323
|
+
address: Scalars['String']['input'];
|
|
4324
|
+
networkId: Scalars['Int']['input'];
|
|
4325
|
+
};
|
|
4326
|
+
|
|
4291
4327
|
export type OnTokenEventsCreatedInput = {
|
|
4292
4328
|
networkId: Scalars['Int']['input'];
|
|
4293
4329
|
tokenAddress: Scalars['String']['input'];
|
|
@@ -5637,6 +5673,7 @@ export type Query = {
|
|
|
5637
5673
|
/** Returns new tokens listed over the last three days. */
|
|
5638
5674
|
getLatestPairs?: Maybe<LatestPairConnection>;
|
|
5639
5675
|
getLatestTokens?: Maybe<LatestTokenConnection>;
|
|
5676
|
+
getNetworkStats?: Maybe<GetNetworkStatsResponse>;
|
|
5640
5677
|
/** Returns the status of a list of networks supported on Defined. */
|
|
5641
5678
|
getNetworkStatus?: Maybe<Array<MetadataResponse>>;
|
|
5642
5679
|
/** Returns a list of all networks supported on Defined. */
|
|
@@ -5808,6 +5845,7 @@ export type QueryFilterPairsArgs = {
|
|
|
5808
5845
|
|
|
5809
5846
|
|
|
5810
5847
|
export type QueryFilterTokensArgs = {
|
|
5848
|
+
excludeTokens?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
|
|
5811
5849
|
filters?: InputMaybe<TokenFilters>;
|
|
5812
5850
|
limit?: InputMaybe<Scalars['Int']['input']>;
|
|
5813
5851
|
offset?: InputMaybe<Scalars['Int']['input']>;
|
|
@@ -5902,6 +5940,12 @@ export type QueryGetLatestTokensArgs = {
|
|
|
5902
5940
|
};
|
|
5903
5941
|
|
|
5904
5942
|
|
|
5943
|
+
export type QueryGetNetworkStatsArgs = {
|
|
5944
|
+
exchangeAddress?: InputMaybe<Scalars['String']['input']>;
|
|
5945
|
+
networkId: Scalars['Int']['input'];
|
|
5946
|
+
};
|
|
5947
|
+
|
|
5948
|
+
|
|
5905
5949
|
export type QueryGetNetworkStatusArgs = {
|
|
5906
5950
|
networkIds: Array<Scalars['Int']['input']>;
|
|
5907
5951
|
};
|
|
@@ -5971,6 +6015,7 @@ export type QueryGetNftPoolEventsArgs = {
|
|
|
5971
6015
|
limit?: InputMaybe<Scalars['Int']['input']>;
|
|
5972
6016
|
networkId: Scalars['Int']['input'];
|
|
5973
6017
|
poolAddress?: InputMaybe<Scalars['String']['input']>;
|
|
6018
|
+
timestamp?: InputMaybe<EventQueryTimestampInput>;
|
|
5974
6019
|
};
|
|
5975
6020
|
|
|
5976
6021
|
|
|
@@ -6310,6 +6355,34 @@ export type RawTransactionWebhookConditionInput = {
|
|
|
6310
6355
|
toOrFrom?: InputMaybe<StringEqualsConditionInput>;
|
|
6311
6356
|
};
|
|
6312
6357
|
|
|
6358
|
+
export type ReferralEventData = ReferralsEventPayoutData | ReferralsEventRewardData;
|
|
6359
|
+
|
|
6360
|
+
export type ReferralsEventPayoutData = {
|
|
6361
|
+
__typename?: 'ReferralsEventPayoutData';
|
|
6362
|
+
payouts: Array<ReferralsPayoutData>;
|
|
6363
|
+
};
|
|
6364
|
+
|
|
6365
|
+
export type ReferralsEventRewardData = {
|
|
6366
|
+
__typename?: 'ReferralsEventRewardData';
|
|
6367
|
+
inputTokenAddress: Scalars['String']['output'];
|
|
6368
|
+
networkId: Scalars['Int']['output'];
|
|
6369
|
+
outputTokenAddress: Scalars['String']['output'];
|
|
6370
|
+
payoutPercent: Scalars['Float']['output'];
|
|
6371
|
+
referralUserId: Scalars['String']['output'];
|
|
6372
|
+
rewardTokenAddress?: Maybe<Scalars['String']['output']>;
|
|
6373
|
+
rewardTokenAmount?: Maybe<Scalars['String']['output']>;
|
|
6374
|
+
transactionFee: Scalars['String']['output'];
|
|
6375
|
+
transactionId: Scalars['String']['output'];
|
|
6376
|
+
transactionTokenAddress: Scalars['String']['output'];
|
|
6377
|
+
transactionTokenAmount: Scalars['String']['output'];
|
|
6378
|
+
};
|
|
6379
|
+
|
|
6380
|
+
export type ReferralsPayoutData = {
|
|
6381
|
+
__typename?: 'ReferralsPayoutData';
|
|
6382
|
+
tokenAddressNetworkIdPaid: Scalars['String']['output'];
|
|
6383
|
+
tokenAmountPaid: Scalars['String']['output'];
|
|
6384
|
+
};
|
|
6385
|
+
|
|
6313
6386
|
/** Price data for each supported resolution. */
|
|
6314
6387
|
export type ResolutionBarData = {
|
|
6315
6388
|
__typename?: 'ResolutionBarData';
|
|
@@ -6710,11 +6783,15 @@ export type Subscription = {
|
|
|
6710
6783
|
onPairMetadataUpdated?: Maybe<PairMetadata>;
|
|
6711
6784
|
/** Live-streamed price updates for a token. */
|
|
6712
6785
|
onPriceUpdated?: Maybe<Price>;
|
|
6786
|
+
/** Live-streamed price updates for multiple tokens. */
|
|
6787
|
+
onPricesUpdated: Price;
|
|
6713
6788
|
onSimulateTokenContract: SimulateTokenContractResult;
|
|
6714
6789
|
/** Live streamed events for a given token across all it's pools */
|
|
6715
6790
|
onTokenEventsCreated: AddTokenEventsOutput;
|
|
6716
6791
|
/** Live-streamed token lifecycle events (mints and burns) */
|
|
6717
6792
|
onTokenLifecycleEventsCreated: AddTokenLifecycleEventsOutput;
|
|
6793
|
+
/** Live-streamed unconfirmed transactions for a token. (Solana only) */
|
|
6794
|
+
onUnconfirmedEventsCreated?: Maybe<AddUnconfirmedEventsOutput>;
|
|
6718
6795
|
};
|
|
6719
6796
|
|
|
6720
6797
|
|
|
@@ -6791,6 +6868,11 @@ export type SubscriptionOnPriceUpdatedArgs = {
|
|
|
6791
6868
|
};
|
|
6792
6869
|
|
|
6793
6870
|
|
|
6871
|
+
export type SubscriptionOnPricesUpdatedArgs = {
|
|
6872
|
+
input: Array<OnPricesUpdatedInput>;
|
|
6873
|
+
};
|
|
6874
|
+
|
|
6875
|
+
|
|
6794
6876
|
export type SubscriptionOnSimulateTokenContractArgs = {
|
|
6795
6877
|
contractAddress?: InputMaybe<Scalars['String']['input']>;
|
|
6796
6878
|
networkId: Scalars['Int']['input'];
|
|
@@ -6808,6 +6890,13 @@ export type SubscriptionOnTokenLifecycleEventsCreatedArgs = {
|
|
|
6808
6890
|
networkId?: InputMaybe<Scalars['Int']['input']>;
|
|
6809
6891
|
};
|
|
6810
6892
|
|
|
6893
|
+
|
|
6894
|
+
export type SubscriptionOnUnconfirmedEventsCreatedArgs = {
|
|
6895
|
+
address?: InputMaybe<Scalars['String']['input']>;
|
|
6896
|
+
id?: InputMaybe<Scalars['String']['input']>;
|
|
6897
|
+
quoteToken?: InputMaybe<QuoteToken>;
|
|
6898
|
+
};
|
|
6899
|
+
|
|
6811
6900
|
/** Event data for a token swap event. */
|
|
6812
6901
|
export type SwapEventData = {
|
|
6813
6902
|
__typename?: 'SwapEventData';
|
|
@@ -7563,6 +7652,65 @@ export type TokenWithMetadata = {
|
|
|
7563
7652
|
volume: Scalars['String']['output'];
|
|
7564
7653
|
};
|
|
7565
7654
|
|
|
7655
|
+
/** An unconfirmed token transaction. */
|
|
7656
|
+
export type UnconfirmedEvent = {
|
|
7657
|
+
__typename?: 'UnconfirmedEvent';
|
|
7658
|
+
/** The contract address of the token's top pair. */
|
|
7659
|
+
address: Scalars['String']['output'];
|
|
7660
|
+
/** The hash of the block where the transaction occurred. */
|
|
7661
|
+
blockHash: Scalars['String']['output'];
|
|
7662
|
+
/** The block number for the transaction. */
|
|
7663
|
+
blockNumber: Scalars['Int']['output'];
|
|
7664
|
+
/** The event-specific data for the transaction. */
|
|
7665
|
+
data?: Maybe<UnconfirmedEventData>;
|
|
7666
|
+
/** A more specific breakdown of `eventType`. Splits `Swap` into `Buy` or `Sell`. */
|
|
7667
|
+
eventDisplayType?: Maybe<EventDisplayType>;
|
|
7668
|
+
/** The type of transaction event. Can be `Burn`, `Mint`, `Swap`, `Sync`, `Collect`, or `CollectProtocol`. */
|
|
7669
|
+
eventType: EventType;
|
|
7670
|
+
/** The ID of the event (`address:networkId`). For example, `0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2:1`. */
|
|
7671
|
+
id: Scalars['String']['output'];
|
|
7672
|
+
/** The index of the log in the block. */
|
|
7673
|
+
logIndex: Scalars['Int']['output'];
|
|
7674
|
+
/** The wallet address that performed the transaction. */
|
|
7675
|
+
maker?: Maybe<Scalars['String']['output']>;
|
|
7676
|
+
/** The network ID that the token is deployed on. */
|
|
7677
|
+
networkId: Scalars['Int']['output'];
|
|
7678
|
+
/** The token of interest within the token's top pair. Can be `token0` or `token1`. */
|
|
7679
|
+
quoteToken?: Maybe<QuoteToken>;
|
|
7680
|
+
/** A optional unique identifier of where the event is within the transaction. */
|
|
7681
|
+
supplementalIndex?: Maybe<Scalars['Int']['output']>;
|
|
7682
|
+
/** The unix timestamp for when the transaction occurred. */
|
|
7683
|
+
timestamp: Scalars['Int']['output'];
|
|
7684
|
+
/** The unique hash for the transaction. */
|
|
7685
|
+
transactionHash: Scalars['String']['output'];
|
|
7686
|
+
/** The index of the transaction within the block. */
|
|
7687
|
+
transactionIndex: Scalars['Int']['output'];
|
|
7688
|
+
};
|
|
7689
|
+
|
|
7690
|
+
export type UnconfirmedEventData = UnconfirmedLiquidityChangeEventData | UnconfirmedSwapEventData;
|
|
7691
|
+
|
|
7692
|
+
export type UnconfirmedLiquidityChangeEventData = {
|
|
7693
|
+
__typename?: 'UnconfirmedLiquidityChangeEventData';
|
|
7694
|
+
/** The amount of `token0` added or removed from the pair. */
|
|
7695
|
+
amount0?: Maybe<Scalars['String']['output']>;
|
|
7696
|
+
/** The amount of `token0` added or removed from the pair, adjusted by the number of decimals in the token. For example, if `amount0` is in WEI, `amount0Shifted` will be in ETH. */
|
|
7697
|
+
amount0Shifted?: Maybe<Scalars['String']['output']>;
|
|
7698
|
+
/** The amount of `token1` added or removed from the pair. */
|
|
7699
|
+
amount1?: Maybe<Scalars['String']['output']>;
|
|
7700
|
+
/** The amount of `token1` added or removed from the pair, adjusted by the number of decimals in the token. For example, USDC `amount1Shifted` will be by 6 decimals. */
|
|
7701
|
+
amount1Shifted?: Maybe<Scalars['String']['output']>;
|
|
7702
|
+
/** The type of token event, `Mint` or 'Burn'. */
|
|
7703
|
+
type: EventType;
|
|
7704
|
+
};
|
|
7705
|
+
|
|
7706
|
+
export type UnconfirmedSwapEventData = {
|
|
7707
|
+
__typename?: 'UnconfirmedSwapEventData';
|
|
7708
|
+
/** The amount of `quoteToken` involved in the swap. For example, if `quoteToken` is USDC for a USDC/WETH pair, `amountNonLiquidityToken` would be the amount of USDC involved in the swap. */
|
|
7709
|
+
amountNonLiquidityToken?: Maybe<Scalars['String']['output']>;
|
|
7710
|
+
/** The type of token event, `Swap`. */
|
|
7711
|
+
type: EventType;
|
|
7712
|
+
};
|
|
7713
|
+
|
|
7566
7714
|
export type UniV3Tick = {
|
|
7567
7715
|
__typename?: 'UniV3Tick';
|
|
7568
7716
|
liquidityNet?: Maybe<Scalars['String']['output']>;
|
|
@@ -68,6 +68,26 @@ type AddTokenLifecycleEventsOutput {
|
|
|
68
68
|
events: [TokenLifecycleEvent!]!
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
"""Response returned by `onUnconfirmedEventsCreated`."""
|
|
72
|
+
type AddUnconfirmedEventsOutput {
|
|
73
|
+
"""The contract address of the pair."""
|
|
74
|
+
address: String!
|
|
75
|
+
|
|
76
|
+
"""The network ID that the token is deployed on."""
|
|
77
|
+
networkId: Int!
|
|
78
|
+
|
|
79
|
+
"""
|
|
80
|
+
The ID of the event (`address`:`networkId`). For example, `0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2:1`.
|
|
81
|
+
"""
|
|
82
|
+
id: String!
|
|
83
|
+
|
|
84
|
+
"""The token of interest within the pair. Can be `token0` or `token1`."""
|
|
85
|
+
quoteToken: QuoteToken
|
|
86
|
+
|
|
87
|
+
"""A list of transactions for the token."""
|
|
88
|
+
events: [UnconfirmedEvent]!
|
|
89
|
+
}
|
|
90
|
+
|
|
71
91
|
enum AlertRecurrence {
|
|
72
92
|
INDEFINITE
|
|
73
93
|
ONCE
|
|
@@ -1388,6 +1408,7 @@ type GasEstimate {
|
|
|
1388
1408
|
gasLimitEstimate: String
|
|
1389
1409
|
error: String
|
|
1390
1410
|
approveTxHash: String
|
|
1411
|
+
totalFee: String
|
|
1391
1412
|
}
|
|
1392
1413
|
|
|
1393
1414
|
type GasFee {
|
|
@@ -1446,6 +1467,20 @@ input GetGasEstimateInput {
|
|
|
1446
1467
|
userId: Int
|
|
1447
1468
|
walletId: Int
|
|
1448
1469
|
customGas: String
|
|
1470
|
+
sendWithPrivateRpc: Boolean
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
"""Response returned by `getNetworkStats`."""
|
|
1474
|
+
type GetNetworkStatsResponse {
|
|
1475
|
+
volume24: Float!
|
|
1476
|
+
volume12: Float!
|
|
1477
|
+
volume4: Float!
|
|
1478
|
+
volume1: Float!
|
|
1479
|
+
liquidity: Float!
|
|
1480
|
+
transactions24: Int!
|
|
1481
|
+
transactions12: Int!
|
|
1482
|
+
transactions4: Int!
|
|
1483
|
+
transactions1: Int!
|
|
1449
1484
|
}
|
|
1450
1485
|
|
|
1451
1486
|
"""Response returned by `getNftPoolCollectionsByExchange`."""
|
|
@@ -5606,6 +5641,11 @@ input OneOfNumberConditionInput {
|
|
|
5606
5641
|
oneOf: [Int!]!
|
|
5607
5642
|
}
|
|
5608
5643
|
|
|
5644
|
+
input OnPricesUpdatedInput {
|
|
5645
|
+
address: String!
|
|
5646
|
+
networkId: Int!
|
|
5647
|
+
}
|
|
5648
|
+
|
|
5609
5649
|
input OnTokenEventsCreatedInput {
|
|
5610
5650
|
tokenAddress: String!
|
|
5611
5651
|
networkId: Int!
|
|
@@ -7358,6 +7398,9 @@ type Query {
|
|
|
7358
7398
|
"""The event types to filter by."""
|
|
7359
7399
|
eventTypes: [NftPoolEventType!]
|
|
7360
7400
|
|
|
7401
|
+
"""The time range to filter by."""
|
|
7402
|
+
timestamp: EventQueryTimestampInput
|
|
7403
|
+
|
|
7361
7404
|
"""The cursor to use for pagination."""
|
|
7362
7405
|
cursor: String
|
|
7363
7406
|
|
|
@@ -7793,6 +7836,9 @@ type Query {
|
|
|
7793
7836
|
"""
|
|
7794
7837
|
tokens: [String]
|
|
7795
7838
|
|
|
7839
|
+
"""A list of token IDs to exclude from results (`address:networkId`)"""
|
|
7840
|
+
excludeTokens: [String]
|
|
7841
|
+
|
|
7796
7842
|
"""A list of ranking attributes to apply."""
|
|
7797
7843
|
rankings: [TokenRanking]
|
|
7798
7844
|
|
|
@@ -7981,6 +8027,13 @@ type Query {
|
|
|
7981
8027
|
"""
|
|
7982
8028
|
currencyCode: String
|
|
7983
8029
|
): SymbolResponse
|
|
8030
|
+
getNetworkStats(
|
|
8031
|
+
"""The network Id to filter by"""
|
|
8032
|
+
networkId: Int!
|
|
8033
|
+
|
|
8034
|
+
"""The Exchange address to filter by (optional)"""
|
|
8035
|
+
exchangeAddress: String
|
|
8036
|
+
): GetNetworkStatsResponse
|
|
7984
8037
|
|
|
7985
8038
|
"""Returns transactions for a pair."""
|
|
7986
8039
|
getTokenEvents(
|
|
@@ -8358,6 +8411,31 @@ input RawTransactionWebhookConditionInput {
|
|
|
8358
8411
|
ignoreNftEvents: Boolean
|
|
8359
8412
|
}
|
|
8360
8413
|
|
|
8414
|
+
union ReferralEventData = ReferralsEventRewardData | ReferralsEventPayoutData
|
|
8415
|
+
|
|
8416
|
+
type ReferralsEventPayoutData {
|
|
8417
|
+
payouts: [ReferralsPayoutData!]!
|
|
8418
|
+
}
|
|
8419
|
+
|
|
8420
|
+
type ReferralsEventRewardData {
|
|
8421
|
+
networkId: Int!
|
|
8422
|
+
inputTokenAddress: String!
|
|
8423
|
+
outputTokenAddress: String!
|
|
8424
|
+
transactionId: String!
|
|
8425
|
+
transactionTokenAmount: String!
|
|
8426
|
+
transactionTokenAddress: String!
|
|
8427
|
+
transactionFee: String!
|
|
8428
|
+
referralUserId: String!
|
|
8429
|
+
payoutPercent: Float!
|
|
8430
|
+
rewardTokenAmount: String
|
|
8431
|
+
rewardTokenAddress: String
|
|
8432
|
+
}
|
|
8433
|
+
|
|
8434
|
+
type ReferralsPayoutData {
|
|
8435
|
+
tokenAmountPaid: String!
|
|
8436
|
+
tokenAddressNetworkIdPaid: String!
|
|
8437
|
+
}
|
|
8438
|
+
|
|
8361
8439
|
"""Price data for each supported resolution."""
|
|
8362
8440
|
type ResolutionBarData {
|
|
8363
8441
|
"""1 second resolution."""
|
|
@@ -8849,6 +8927,18 @@ type Subscription {
|
|
|
8849
8927
|
quoteToken: QuoteToken
|
|
8850
8928
|
): AddEventsOutput
|
|
8851
8929
|
|
|
8930
|
+
"""Live-streamed unconfirmed transactions for a token. (Solana only)"""
|
|
8931
|
+
onUnconfirmedEventsCreated(
|
|
8932
|
+
"""The pair contract address."""
|
|
8933
|
+
address: String
|
|
8934
|
+
|
|
8935
|
+
"""The ID of the pair (`address`:`networkId`)."""
|
|
8936
|
+
id: String
|
|
8937
|
+
|
|
8938
|
+
"""The token of interest within the pair. Can be `token0` or `token1`."""
|
|
8939
|
+
quoteToken: QuoteToken
|
|
8940
|
+
): AddUnconfirmedEventsOutput
|
|
8941
|
+
|
|
8852
8942
|
"""Live-streamed price updates for a token."""
|
|
8853
8943
|
onPriceUpdated(
|
|
8854
8944
|
"""The token contract address."""
|
|
@@ -8858,6 +8948,9 @@ type Subscription {
|
|
|
8858
8948
|
networkId: Int
|
|
8859
8949
|
): Price
|
|
8860
8950
|
|
|
8951
|
+
"""Live-streamed price updates for multiple tokens."""
|
|
8952
|
+
onPricesUpdated(input: [OnPricesUpdatedInput!]!): Price!
|
|
8953
|
+
|
|
8861
8954
|
"""Live-streamed stat updates for a given token within a pair."""
|
|
8862
8955
|
onPairMetadataUpdated(
|
|
8863
8956
|
"""The ID of the pair (`address`:`networkId`)."""
|
|
@@ -9985,6 +10078,97 @@ type TokenWithMetadata {
|
|
|
9985
10078
|
lastTransaction: Int
|
|
9986
10079
|
}
|
|
9987
10080
|
|
|
10081
|
+
"""An unconfirmed token transaction."""
|
|
10082
|
+
type UnconfirmedEvent {
|
|
10083
|
+
"""The contract address of the token's top pair."""
|
|
10084
|
+
address: String!
|
|
10085
|
+
|
|
10086
|
+
"""The hash of the block where the transaction occurred."""
|
|
10087
|
+
blockHash: String!
|
|
10088
|
+
|
|
10089
|
+
"""The block number for the transaction."""
|
|
10090
|
+
blockNumber: Int!
|
|
10091
|
+
|
|
10092
|
+
"""
|
|
10093
|
+
The type of transaction event. Can be `Burn`, `Mint`, `Swap`, `Sync`, `Collect`, or `CollectProtocol`.
|
|
10094
|
+
"""
|
|
10095
|
+
eventType: EventType!
|
|
10096
|
+
|
|
10097
|
+
"""
|
|
10098
|
+
The ID of the event (`address:networkId`). For example, `0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2:1`.
|
|
10099
|
+
"""
|
|
10100
|
+
id: String!
|
|
10101
|
+
|
|
10102
|
+
"""The index of the log in the block."""
|
|
10103
|
+
logIndex: Int!
|
|
10104
|
+
|
|
10105
|
+
"""The wallet address that performed the transaction."""
|
|
10106
|
+
maker: String
|
|
10107
|
+
|
|
10108
|
+
"""The network ID that the token is deployed on."""
|
|
10109
|
+
networkId: Int!
|
|
10110
|
+
|
|
10111
|
+
"""
|
|
10112
|
+
The token of interest within the token's top pair. Can be `token0` or `token1`.
|
|
10113
|
+
"""
|
|
10114
|
+
quoteToken: QuoteToken
|
|
10115
|
+
|
|
10116
|
+
"""The unix timestamp for when the transaction occurred."""
|
|
10117
|
+
timestamp: Int!
|
|
10118
|
+
|
|
10119
|
+
"""The unique hash for the transaction."""
|
|
10120
|
+
transactionHash: String!
|
|
10121
|
+
|
|
10122
|
+
"""The index of the transaction within the block."""
|
|
10123
|
+
transactionIndex: Int!
|
|
10124
|
+
|
|
10125
|
+
"""
|
|
10126
|
+
A optional unique identifier of where the event is within the transaction.
|
|
10127
|
+
"""
|
|
10128
|
+
supplementalIndex: Int
|
|
10129
|
+
|
|
10130
|
+
"""
|
|
10131
|
+
A more specific breakdown of `eventType`. Splits `Swap` into `Buy` or `Sell`.
|
|
10132
|
+
"""
|
|
10133
|
+
eventDisplayType: EventDisplayType
|
|
10134
|
+
|
|
10135
|
+
"""The event-specific data for the transaction."""
|
|
10136
|
+
data: UnconfirmedEventData
|
|
10137
|
+
}
|
|
10138
|
+
|
|
10139
|
+
union UnconfirmedEventData = UnconfirmedSwapEventData | UnconfirmedLiquidityChangeEventData
|
|
10140
|
+
|
|
10141
|
+
type UnconfirmedLiquidityChangeEventData {
|
|
10142
|
+
"""The amount of `token0` added or removed from the pair."""
|
|
10143
|
+
amount0: String
|
|
10144
|
+
|
|
10145
|
+
"""The amount of `token1` added or removed from the pair."""
|
|
10146
|
+
amount1: String
|
|
10147
|
+
|
|
10148
|
+
"""
|
|
10149
|
+
The amount of `token0` added or removed from the pair, adjusted by the number of decimals in the token. For example, if `amount0` is in WEI, `amount0Shifted` will be in ETH.
|
|
10150
|
+
"""
|
|
10151
|
+
amount0Shifted: String
|
|
10152
|
+
|
|
10153
|
+
"""
|
|
10154
|
+
The amount of `token1` added or removed from the pair, adjusted by the number of decimals in the token. For example, USDC `amount1Shifted` will be by 6 decimals.
|
|
10155
|
+
"""
|
|
10156
|
+
amount1Shifted: String
|
|
10157
|
+
|
|
10158
|
+
"""The type of token event, `Mint` or 'Burn'."""
|
|
10159
|
+
type: EventType!
|
|
10160
|
+
}
|
|
10161
|
+
|
|
10162
|
+
type UnconfirmedSwapEventData {
|
|
10163
|
+
"""
|
|
10164
|
+
The amount of `quoteToken` involved in the swap. For example, if `quoteToken` is USDC for a USDC/WETH pair, `amountNonLiquidityToken` would be the amount of USDC involved in the swap.
|
|
10165
|
+
"""
|
|
10166
|
+
amountNonLiquidityToken: String
|
|
10167
|
+
|
|
10168
|
+
"""The type of token event, `Swap`."""
|
|
10169
|
+
type: EventType!
|
|
10170
|
+
}
|
|
10171
|
+
|
|
9988
10172
|
type UniV3Tick {
|
|
9989
10173
|
tick: Int
|
|
9990
10174
|
liquidityNet: String
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import camelCase from "lodash/camelCase";
|
|
3
|
+
import path from "path";
|
|
4
|
+
|
|
5
|
+
const GENERATED_SUBSCRIPTIONS_DIRECTORY = path.join(
|
|
6
|
+
__dirname,
|
|
7
|
+
"..",
|
|
8
|
+
"resources",
|
|
9
|
+
"generated_subscriptions",
|
|
10
|
+
);
|
|
11
|
+
const GENERATED_MUTATIONS_DIRECTORY = path.join(
|
|
12
|
+
__dirname,
|
|
13
|
+
"..",
|
|
14
|
+
"resources",
|
|
15
|
+
"generated_mutations",
|
|
16
|
+
);
|
|
17
|
+
const GENERATED_QUERIES_DIRECTORY = path.join(
|
|
18
|
+
__dirname,
|
|
19
|
+
"..",
|
|
20
|
+
"resources",
|
|
21
|
+
"generated_queries",
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
class Subscription {
|
|
25
|
+
constructor(private subscriptionName: string) {}
|
|
26
|
+
pre() {
|
|
27
|
+
return `${this.subscriptionName}SubscriptionVariables, ${this.subscriptionName}Subscription`;
|
|
28
|
+
}
|
|
29
|
+
main() {
|
|
30
|
+
const graphqlString = fs.readFileSync(
|
|
31
|
+
path.join(
|
|
32
|
+
GENERATED_SUBSCRIPTIONS_DIRECTORY,
|
|
33
|
+
this.subscriptionName + ".graphql",
|
|
34
|
+
),
|
|
35
|
+
"utf8",
|
|
36
|
+
);
|
|
37
|
+
return `${camelCase(this.subscriptionName)} = async (vars: ${
|
|
38
|
+
this.subscriptionName
|
|
39
|
+
}SubscriptionVariables, sink: Sink<ExecutionResult<${
|
|
40
|
+
this.subscriptionName
|
|
41
|
+
}Subscription>>) => this.sdk.subscribe(\`${graphqlString}\`, vars, sink);`;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
class Mutation {
|
|
46
|
+
constructor(private mutationName: string) {}
|
|
47
|
+
pre() {
|
|
48
|
+
return `${this.mutationName}Document,
|
|
49
|
+
${this.mutationName}MutationVariables`;
|
|
50
|
+
}
|
|
51
|
+
main() {
|
|
52
|
+
return `${camelCase(this.mutationName)} = async (vars: ${
|
|
53
|
+
this.mutationName
|
|
54
|
+
}MutationVariables) => this.sdk.mutation(${
|
|
55
|
+
this.mutationName
|
|
56
|
+
}Document, vars);`;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
class Query {
|
|
61
|
+
constructor(private queryName: string) {}
|
|
62
|
+
|
|
63
|
+
pre() {
|
|
64
|
+
return `${this.queryName}Document,
|
|
65
|
+
${this.queryName}QueryVariables`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
main() {
|
|
69
|
+
return `${camelCase(this.queryName)} = async (vars: ${
|
|
70
|
+
this.queryName
|
|
71
|
+
}QueryVariables) => this.sdk.query(${this.queryName}Document, vars);`;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
class SDK {
|
|
76
|
+
private queries: Query[] = [];
|
|
77
|
+
private mutations: Mutation[] = [];
|
|
78
|
+
private subscriptions: Subscription[] = [];
|
|
79
|
+
|
|
80
|
+
constructor() {
|
|
81
|
+
this.initialize();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
initialize() {
|
|
85
|
+
// crawl the generatedQueries and then create the typescript code for that query.
|
|
86
|
+
const queries = fs.readdirSync(GENERATED_QUERIES_DIRECTORY);
|
|
87
|
+
const mutations = fs.readdirSync(GENERATED_MUTATIONS_DIRECTORY);
|
|
88
|
+
const subscriptions = fs.readdirSync(GENERATED_SUBSCRIPTIONS_DIRECTORY);
|
|
89
|
+
|
|
90
|
+
for (const file of queries) {
|
|
91
|
+
this.queries.push(new Query(path.basename(file, ".graphql")));
|
|
92
|
+
}
|
|
93
|
+
for (const file of mutations) {
|
|
94
|
+
this.mutations.push(new Mutation(path.basename(file, ".graphql")));
|
|
95
|
+
}
|
|
96
|
+
for (const file of subscriptions) {
|
|
97
|
+
this.subscriptions.push(
|
|
98
|
+
new Subscription(path.basename(file, ".graphql")),
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
printSubscriptions(): string {
|
|
104
|
+
return `
|
|
105
|
+
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT IT DIRECTLY
|
|
106
|
+
import {
|
|
107
|
+
${this.subscriptions.map((q) => " " + q.pre()).join(",\n")}
|
|
108
|
+
} from "./generated/graphql";
|
|
109
|
+
import { Codex } from "./index";
|
|
110
|
+
import { ExecutionResult, Sink } from "graphql-ws";
|
|
111
|
+
|
|
112
|
+
export class Subscribe {
|
|
113
|
+
constructor(private sdk: Codex) {}
|
|
114
|
+
${this.subscriptions.map((q) => q.main()).join("\n")}
|
|
115
|
+
}
|
|
116
|
+
`;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
printMutations(): string {
|
|
120
|
+
return `
|
|
121
|
+
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT IT DIRECTLY
|
|
122
|
+
import {
|
|
123
|
+
${this.mutations.map((q) => " " + q.pre()).join(",\n")}
|
|
124
|
+
} from "./generated/graphql";
|
|
125
|
+
import { Codex } from "./index";
|
|
126
|
+
|
|
127
|
+
export class Mutation {
|
|
128
|
+
constructor(private sdk: Codex) {}
|
|
129
|
+
${this.mutations.map((q) => q.main()).join("\n")}
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
printQueries(): string {
|
|
135
|
+
return `
|
|
136
|
+
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT IT DIRECTLY
|
|
137
|
+
import {
|
|
138
|
+
${this.queries.map((q) => " " + q.pre()).join(",\n")}
|
|
139
|
+
} from "./generated/graphql";
|
|
140
|
+
import { Codex } from "./index";
|
|
141
|
+
|
|
142
|
+
export class Query {
|
|
143
|
+
constructor(private sdk: Codex) {}
|
|
144
|
+
${this.queries.map((q) => q.main()).join("\n")}
|
|
145
|
+
}
|
|
146
|
+
`;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
output() {
|
|
150
|
+
fs.writeFileSync(
|
|
151
|
+
path.join(__dirname, "..", "sdk", "Subscribe.ts"),
|
|
152
|
+
this.printSubscriptions(),
|
|
153
|
+
"utf8",
|
|
154
|
+
);
|
|
155
|
+
fs.writeFileSync(
|
|
156
|
+
path.join(__dirname, "..", "sdk", "Mutation.ts"),
|
|
157
|
+
this.printMutations(),
|
|
158
|
+
"utf8",
|
|
159
|
+
);
|
|
160
|
+
fs.writeFileSync(
|
|
161
|
+
path.join(__dirname, "..", "sdk", "Query.ts"),
|
|
162
|
+
this.printQueries(),
|
|
163
|
+
"utf8",
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
async function run() {
|
|
169
|
+
const sdk = new SDK();
|
|
170
|
+
sdk.output();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
run().then(() => process.exit());
|