@codex-data/sdk 0.6.1 → 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.
Files changed (233) hide show
  1. package/dist/resources/generated_mutations/CreateApiTokens.graphql +9 -0
  2. package/dist/resources/generated_mutations/CreateWebhooks.graphql +80 -0
  3. package/dist/resources/generated_mutations/DeleteApiToken.graphql +3 -0
  4. package/{src/sdk/graphql → dist/resources/generated_mutations}/DeleteWebhooks.graphql +1 -1
  5. package/dist/resources/generated_queries/ApiToken.graphql +9 -0
  6. package/dist/resources/generated_queries/ApiTokens.graphql +9 -0
  7. package/dist/resources/generated_queries/Balances.graphql +12 -0
  8. package/dist/resources/generated_queries/ChartUrls.graphql +7 -0
  9. package/dist/resources/generated_queries/FilterExchanges.graphql +43 -0
  10. package/dist/resources/generated_queries/FilterNftCollections.graphql +569 -0
  11. package/dist/resources/generated_queries/FilterNftParallelAssets.graphql +60 -0
  12. package/dist/resources/generated_queries/FilterNftPoolCollections.graphql +71 -0
  13. package/dist/resources/generated_queries/FilterNftPools.graphql +124 -0
  14. package/dist/resources/generated_queries/FilterPairs.graphql +339 -0
  15. package/dist/resources/generated_queries/FilterTokens.graphql +279 -0
  16. package/{src/sdk/graphql → dist/resources/generated_queries}/GetBars.graphql +21 -9
  17. package/dist/resources/generated_queries/GetCommunityNotes.graphql +20 -0
  18. package/dist/resources/generated_queries/GetDetailedNftStats.graphql +831 -0
  19. package/{src/sdk/graphql → dist/resources/generated_queries}/GetDetailedPairStats.graphql +370 -373
  20. package/dist/resources/generated_queries/GetDetailedPairsStats.graphql +922 -0
  21. package/dist/resources/generated_queries/GetEventLabels.graphql +24 -0
  22. package/dist/resources/generated_queries/GetExchanges.graphql +12 -0
  23. package/dist/resources/generated_queries/GetLatestPairs.graphql +57 -0
  24. package/dist/resources/generated_queries/GetLatestTokens.graphql +39 -0
  25. package/dist/resources/generated_queries/GetNetworkStats.graphql +13 -0
  26. package/{src/sdk/graphql → dist/resources/generated_queries}/GetNetworkStatus.graphql +2 -1
  27. package/{src/sdk/graphql → dist/resources/generated_queries}/GetNetworks.graphql +1 -0
  28. package/dist/resources/generated_queries/GetNftAssets.graphql +59 -0
  29. package/dist/resources/generated_queries/GetNftCollectionMetadata.graphql +75 -0
  30. package/dist/resources/generated_queries/GetNftContracts.graphql +39 -0
  31. package/dist/resources/generated_queries/GetNftEvents.graphql +54 -0
  32. package/dist/resources/generated_queries/GetNftPool.graphql +74 -0
  33. package/dist/resources/generated_queries/GetNftPoolCollection.graphql +33 -0
  34. package/dist/resources/generated_queries/GetNftPoolCollectionsByExchange.graphql +38 -0
  35. package/dist/resources/generated_queries/GetNftPoolEvents.graphql +41 -0
  36. package/dist/resources/generated_queries/GetNftPoolStats.graphql +40 -0
  37. package/dist/resources/generated_queries/GetNftPoolsByCollectionAndExchange.graphql +89 -0
  38. package/dist/resources/generated_queries/GetNftPoolsByOwner.graphql +89 -0
  39. package/dist/resources/generated_queries/GetParallelAssets.graphql +50 -0
  40. package/dist/resources/generated_queries/GetParallelCardChanges.graphql +57 -0
  41. package/dist/resources/generated_queries/GetPrimePoolAssets.graphql +32 -0
  42. package/dist/resources/generated_queries/GetPrimePoolEvents.graphql +38 -0
  43. package/dist/resources/generated_queries/GetPrimePools.graphql +62 -0
  44. package/dist/resources/generated_queries/GetSimulateTokenContractResults.graphql +128 -0
  45. package/{src/sdk/graphql → dist/resources/generated_queries}/GetSymbol.graphql +7 -7
  46. package/dist/resources/generated_queries/GetTokenCount.graphql +3 -0
  47. package/dist/resources/generated_queries/GetTokenEvents.graphql +49 -0
  48. package/dist/resources/generated_queries/GetTokenInfo.graphql +17 -0
  49. package/dist/resources/generated_queries/GetTokenPrices.graphql +9 -0
  50. package/dist/resources/generated_queries/GetTokensInfo.graphql +17 -0
  51. package/dist/resources/generated_queries/GetUniV3Ticks.graphql +22 -0
  52. package/dist/resources/generated_queries/GetWebhooks.graphql +36 -0
  53. package/dist/resources/generated_queries/Holders.graphql +14 -0
  54. package/dist/resources/generated_queries/LiquidityLocks.graphql +26 -0
  55. package/dist/resources/generated_queries/LiquidityMetadata.graphql +17 -0
  56. package/dist/resources/generated_queries/ListFavoriteTokens.graphql +58 -0
  57. package/{src/sdk/graphql → dist/resources/generated_queries}/ListPairsForToken.graphql +77 -41
  58. package/dist/resources/generated_queries/ListPairsWithMetadataForToken.graphql +282 -0
  59. package/{src/sdk/graphql → dist/resources/generated_queries}/ListTopTokens.graphql +22 -16
  60. package/dist/resources/generated_queries/NftHolders.graphql +12 -0
  61. package/{src/sdk/graphql/OnPairMetadataUpdated.graphql → dist/resources/generated_queries/PairMetadata.graphql} +21 -3
  62. package/dist/resources/generated_queries/PrimeBalance.graphql +12 -0
  63. package/dist/resources/generated_queries/PrimeHolders.graphql +13 -0
  64. package/dist/resources/generated_queries/SearchNfts.graphql +35 -0
  65. package/dist/resources/generated_queries/Token.graphql +62 -0
  66. package/dist/resources/generated_queries/TokenLifecycleEvents.graphql +22 -0
  67. package/{src/sdk/graphql/GetSparklines.graphql → dist/resources/generated_queries/TokenSparklines.graphql} +2 -2
  68. package/dist/resources/generated_queries/Tokens.graphql +62 -0
  69. package/dist/resources/generated_queries/WalletNftCollectionAssets.graphql +11 -0
  70. package/dist/resources/generated_queries/WalletNftCollections.graphql +10 -0
  71. package/dist/resources/generated_subscriptions/OnBarsUpdated.graphql +513 -0
  72. package/{src/sdk/graphql → dist/resources/generated_subscriptions}/OnDetailedStatsUpdated.graphql +119 -111
  73. package/dist/resources/generated_subscriptions/OnEventLabelCreated.graphql +11 -0
  74. package/dist/resources/generated_subscriptions/OnEventsCreated.graphql +46 -0
  75. package/dist/resources/generated_subscriptions/OnLatestPairUpdated.graphql +42 -0
  76. package/dist/resources/generated_subscriptions/OnLatestTokens.graphql +37 -0
  77. package/{src/sdk/graphql → dist/resources/generated_subscriptions}/OnNftAssetsCreated.graphql +30 -17
  78. package/dist/resources/generated_subscriptions/OnNftEventsCreated.graphql +36 -0
  79. package/dist/resources/generated_subscriptions/OnNftPoolEventsCreated.graphql +37 -0
  80. package/dist/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +73 -0
  81. package/{src/sdk/graphql → dist/resources/generated_subscriptions}/OnPriceUpdated.graphql +1 -1
  82. package/dist/resources/generated_subscriptions/OnPricesUpdated.graphql +9 -0
  83. package/dist/resources/generated_subscriptions/OnSimulateTokenContract.graphql +121 -0
  84. package/dist/resources/generated_subscriptions/OnTokenEventsCreated.graphql +39 -0
  85. package/dist/resources/generated_subscriptions/OnTokenLifecycleEventsCreated.graphql +18 -0
  86. package/dist/resources/generated_subscriptions/OnUnconfirmedEventsCreated.graphql +32 -0
  87. package/dist/resources/graphql.d.ts +131 -0
  88. package/dist/resources/graphql.d.ts.map +1 -1
  89. package/dist/resources/graphql.js.map +1 -1
  90. package/dist/resources/graphql.schema.json +1570 -0
  91. package/dist/resources/graphql.ts +148 -0
  92. package/dist/resources/schema.graphql +184 -0
  93. package/dist/scripts/buildSdk.d.ts +2 -0
  94. package/dist/scripts/buildSdk.d.ts.map +1 -0
  95. package/dist/scripts/buildSdk.js +135 -0
  96. package/dist/scripts/buildSdk.js.map +1 -0
  97. package/dist/scripts/generateGraphql.d.ts +30 -0
  98. package/dist/scripts/generateGraphql.d.ts.map +1 -0
  99. package/dist/scripts/generateGraphql.js +179 -0
  100. package/dist/scripts/generateGraphql.js.map +1 -0
  101. package/dist/sdk/Mutation.d.ts +5 -8
  102. package/dist/sdk/Mutation.d.ts.map +1 -1
  103. package/dist/sdk/Mutation.js +3 -0
  104. package/dist/sdk/Mutation.js.map +1 -1
  105. package/dist/sdk/Query.d.ts +65 -14
  106. package/dist/sdk/Query.d.ts.map +1 -1
  107. package/dist/sdk/Query.js +64 -12
  108. package/dist/sdk/Query.js.map +1 -1
  109. package/dist/sdk/Subscribe.d.ts +18 -11
  110. package/dist/sdk/Subscribe.d.ts.map +1 -1
  111. package/dist/sdk/Subscribe.js +112 -9
  112. package/dist/sdk/Subscribe.js.map +1 -1
  113. package/dist/sdk/generated/gql.d.ts +636 -66
  114. package/dist/sdk/generated/gql.d.ts.map +1 -1
  115. package/dist/sdk/generated/gql.js +84 -22
  116. package/dist/sdk/generated/gql.js.map +1 -1
  117. package/dist/sdk/generated/graphql.d.ts +8407 -2195
  118. package/dist/sdk/generated/graphql.d.ts.map +1 -1
  119. package/dist/sdk/generated/graphql.js +87 -25
  120. package/dist/sdk/generated/graphql.js.map +1 -1
  121. package/package.json +12 -4
  122. package/src/resources/generated_mutations/CreateApiTokens.graphql +9 -0
  123. package/src/resources/generated_mutations/CreateWebhooks.graphql +80 -0
  124. package/src/resources/generated_mutations/DeleteApiToken.graphql +3 -0
  125. package/src/resources/generated_mutations/DeleteWebhooks.graphql +5 -0
  126. package/src/resources/generated_queries/ApiToken.graphql +9 -0
  127. package/src/resources/generated_queries/ApiTokens.graphql +9 -0
  128. package/src/resources/generated_queries/Balances.graphql +12 -0
  129. package/src/resources/generated_queries/ChartUrls.graphql +7 -0
  130. package/src/resources/generated_queries/FilterExchanges.graphql +43 -0
  131. package/src/resources/generated_queries/FilterNftCollections.graphql +569 -0
  132. package/src/resources/generated_queries/FilterNftParallelAssets.graphql +60 -0
  133. package/src/resources/generated_queries/FilterNftPoolCollections.graphql +71 -0
  134. package/src/resources/generated_queries/FilterNftPools.graphql +124 -0
  135. package/src/resources/generated_queries/FilterPairs.graphql +339 -0
  136. package/src/resources/generated_queries/FilterTokens.graphql +279 -0
  137. package/src/resources/generated_queries/GetBars.graphql +44 -0
  138. package/src/resources/generated_queries/GetCommunityNotes.graphql +20 -0
  139. package/src/resources/generated_queries/GetDetailedNftStats.graphql +831 -0
  140. package/src/resources/generated_queries/GetDetailedPairStats.graphql +938 -0
  141. package/src/resources/generated_queries/GetDetailedPairsStats.graphql +922 -0
  142. package/src/resources/generated_queries/GetEventLabels.graphql +24 -0
  143. package/src/resources/generated_queries/GetExchanges.graphql +12 -0
  144. package/src/resources/generated_queries/GetLatestPairs.graphql +57 -0
  145. package/src/resources/generated_queries/GetLatestTokens.graphql +39 -0
  146. package/src/resources/generated_queries/GetNetworkStats.graphql +13 -0
  147. package/src/resources/generated_queries/GetNetworkStatus.graphql +8 -0
  148. package/src/resources/generated_queries/GetNetworks.graphql +7 -0
  149. package/src/resources/generated_queries/GetNftAssets.graphql +59 -0
  150. package/src/resources/generated_queries/GetNftCollectionMetadata.graphql +75 -0
  151. package/src/resources/generated_queries/GetNftContracts.graphql +39 -0
  152. package/src/resources/generated_queries/GetNftEvents.graphql +54 -0
  153. package/src/resources/generated_queries/GetNftPool.graphql +74 -0
  154. package/src/resources/generated_queries/GetNftPoolCollection.graphql +33 -0
  155. package/src/resources/generated_queries/GetNftPoolCollectionsByExchange.graphql +38 -0
  156. package/src/resources/generated_queries/GetNftPoolEvents.graphql +41 -0
  157. package/src/resources/generated_queries/GetNftPoolStats.graphql +40 -0
  158. package/src/resources/generated_queries/GetNftPoolsByCollectionAndExchange.graphql +89 -0
  159. package/src/resources/generated_queries/GetNftPoolsByOwner.graphql +89 -0
  160. package/src/resources/generated_queries/GetParallelAssets.graphql +50 -0
  161. package/src/resources/generated_queries/GetParallelCardChanges.graphql +57 -0
  162. package/src/resources/generated_queries/GetPrimePoolAssets.graphql +32 -0
  163. package/src/resources/generated_queries/GetPrimePoolEvents.graphql +38 -0
  164. package/src/resources/generated_queries/GetPrimePools.graphql +62 -0
  165. package/src/resources/generated_queries/GetSimulateTokenContractResults.graphql +128 -0
  166. package/src/resources/generated_queries/GetSymbol.graphql +11 -0
  167. package/src/resources/generated_queries/GetTokenCount.graphql +3 -0
  168. package/src/resources/generated_queries/GetTokenEvents.graphql +49 -0
  169. package/src/resources/generated_queries/GetTokenInfo.graphql +17 -0
  170. package/src/resources/generated_queries/GetTokenPrices.graphql +9 -0
  171. package/src/resources/generated_queries/GetTokensInfo.graphql +17 -0
  172. package/src/resources/generated_queries/GetUniV3Ticks.graphql +22 -0
  173. package/src/resources/generated_queries/GetWebhooks.graphql +36 -0
  174. package/src/resources/generated_queries/Holders.graphql +14 -0
  175. package/src/resources/generated_queries/LiquidityLocks.graphql +26 -0
  176. package/src/resources/generated_queries/LiquidityMetadata.graphql +17 -0
  177. package/src/resources/generated_queries/ListFavoriteTokens.graphql +58 -0
  178. package/src/resources/generated_queries/ListPairsForToken.graphql +141 -0
  179. package/src/resources/generated_queries/ListPairsWithMetadataForToken.graphql +282 -0
  180. package/src/resources/generated_queries/ListTopTokens.graphql +54 -0
  181. package/src/resources/generated_queries/NftHolders.graphql +12 -0
  182. package/src/resources/generated_queries/PairMetadata.graphql +73 -0
  183. package/src/resources/generated_queries/PrimeBalance.graphql +12 -0
  184. package/src/resources/generated_queries/PrimeHolders.graphql +13 -0
  185. package/src/resources/generated_queries/SearchNfts.graphql +35 -0
  186. package/src/resources/generated_queries/Token.graphql +62 -0
  187. package/src/resources/generated_queries/TokenLifecycleEvents.graphql +22 -0
  188. package/src/resources/generated_queries/TokenSparklines.graphql +10 -0
  189. package/src/resources/generated_queries/Tokens.graphql +62 -0
  190. package/src/resources/generated_queries/WalletNftCollectionAssets.graphql +11 -0
  191. package/src/resources/generated_queries/WalletNftCollections.graphql +10 -0
  192. package/src/resources/generated_subscriptions/OnBarsUpdated.graphql +513 -0
  193. package/src/resources/generated_subscriptions/OnDetailedStatsUpdated.graphql +332 -0
  194. package/src/resources/generated_subscriptions/OnEventLabelCreated.graphql +11 -0
  195. package/src/resources/generated_subscriptions/OnEventsCreated.graphql +46 -0
  196. package/src/resources/generated_subscriptions/OnLatestPairUpdated.graphql +42 -0
  197. package/src/resources/generated_subscriptions/OnLatestTokens.graphql +37 -0
  198. package/src/resources/generated_subscriptions/OnNftAssetsCreated.graphql +42 -0
  199. package/src/resources/generated_subscriptions/OnNftEventsCreated.graphql +36 -0
  200. package/src/resources/generated_subscriptions/OnNftPoolEventsCreated.graphql +37 -0
  201. package/src/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +73 -0
  202. package/src/resources/generated_subscriptions/OnPriceUpdated.graphql +9 -0
  203. package/src/resources/generated_subscriptions/OnPricesUpdated.graphql +9 -0
  204. package/src/resources/generated_subscriptions/OnSimulateTokenContract.graphql +121 -0
  205. package/src/resources/generated_subscriptions/OnTokenEventsCreated.graphql +39 -0
  206. package/src/resources/generated_subscriptions/OnTokenLifecycleEventsCreated.graphql +18 -0
  207. package/src/resources/generated_subscriptions/OnUnconfirmedEventsCreated.graphql +32 -0
  208. package/src/resources/graphql.schema.json +1570 -0
  209. package/src/resources/graphql.ts +148 -0
  210. package/src/resources/schema.graphql +184 -0
  211. package/src/scripts/buildSdk.ts +173 -0
  212. package/src/scripts/generateGraphql.ts +236 -0
  213. package/src/sdk/Mutation.ts +13 -4
  214. package/src/sdk/Query.ts +252 -37
  215. package/src/sdk/Subscribe.ts +230 -41
  216. package/src/sdk/generated/gql.ts +354 -44
  217. package/src/sdk/generated/graphql.ts +889 -151
  218. package/src/sdk/graphql/GetPairEvents.graphql +6 -1
  219. package/dist/sdk/Query.test.d.ts +0 -2
  220. package/dist/sdk/Query.test.d.ts.map +0 -1
  221. package/dist/sdk/Query.test.js +0 -50
  222. package/dist/sdk/Query.test.js.map +0 -1
  223. package/src/sdk/Query.test.ts +0 -40
  224. package/src/sdk/graphql/CreateWebhooks.graphql +0 -464
  225. package/src/sdk/graphql/FilterExchanges.graphql +0 -23
  226. package/src/sdk/graphql/FilterPairs.graphql +0 -126
  227. package/src/sdk/graphql/FilterTokens.graphql +0 -131
  228. package/src/sdk/graphql/GetPrice.graphql +0 -9
  229. package/src/sdk/graphql/GetTokens.graphql +0 -14
  230. package/src/sdk/graphql/GetWebhooks.graphql +0 -120
  231. package/src/sdk/graphql/OnBarsUpdated.graphql +0 -68
  232. package/src/sdk/graphql/OnEventsCreated.graphql +0 -62
  233. package/src/sdk/graphql/OnNftEventsCreated.graphql +0 -83
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=buildSdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSdk.d.ts","sourceRoot":"","sources":["../../src/scripts/buildSdk.ts"],"names":[],"mappings":""}
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const fs_1 = __importDefault(require("fs"));
16
+ const camelCase_1 = __importDefault(require("lodash/camelCase"));
17
+ const path_1 = __importDefault(require("path"));
18
+ const GENERATED_SUBSCRIPTIONS_DIRECTORY = path_1.default.join(__dirname, "..", "resources", "generated_subscriptions");
19
+ const GENERATED_MUTATIONS_DIRECTORY = path_1.default.join(__dirname, "..", "resources", "generated_mutations");
20
+ const GENERATED_QUERIES_DIRECTORY = path_1.default.join(__dirname, "..", "resources", "generated_queries");
21
+ class Subscription {
22
+ constructor(subscriptionName) {
23
+ this.subscriptionName = subscriptionName;
24
+ }
25
+ pre() {
26
+ return `${this.subscriptionName}SubscriptionVariables, ${this.subscriptionName}Subscription`;
27
+ }
28
+ main() {
29
+ const graphqlString = fs_1.default.readFileSync(path_1.default.join(GENERATED_SUBSCRIPTIONS_DIRECTORY, this.subscriptionName + ".graphql"), "utf8");
30
+ return `${(0, camelCase_1.default)(this.subscriptionName)} = async (vars: ${this.subscriptionName}SubscriptionVariables, sink: Sink<ExecutionResult<${this.subscriptionName}Subscription>>) => this.sdk.subscribe(\`${graphqlString}\`, vars, sink);`;
31
+ }
32
+ }
33
+ class Mutation {
34
+ constructor(mutationName) {
35
+ this.mutationName = mutationName;
36
+ }
37
+ pre() {
38
+ return `${this.mutationName}Document,
39
+ ${this.mutationName}MutationVariables`;
40
+ }
41
+ main() {
42
+ return `${(0, camelCase_1.default)(this.mutationName)} = async (vars: ${this.mutationName}MutationVariables) => this.sdk.mutation(${this.mutationName}Document, vars);`;
43
+ }
44
+ }
45
+ class Query {
46
+ constructor(queryName) {
47
+ this.queryName = queryName;
48
+ }
49
+ pre() {
50
+ return `${this.queryName}Document,
51
+ ${this.queryName}QueryVariables`;
52
+ }
53
+ main() {
54
+ return `${(0, camelCase_1.default)(this.queryName)} = async (vars: ${this.queryName}QueryVariables) => this.sdk.query(${this.queryName}Document, vars);`;
55
+ }
56
+ }
57
+ class SDK {
58
+ constructor() {
59
+ this.queries = [];
60
+ this.mutations = [];
61
+ this.subscriptions = [];
62
+ this.initialize();
63
+ }
64
+ initialize() {
65
+ // crawl the generatedQueries and then create the typescript code for that query.
66
+ const queries = fs_1.default.readdirSync(GENERATED_QUERIES_DIRECTORY);
67
+ const mutations = fs_1.default.readdirSync(GENERATED_MUTATIONS_DIRECTORY);
68
+ const subscriptions = fs_1.default.readdirSync(GENERATED_SUBSCRIPTIONS_DIRECTORY);
69
+ for (const file of queries) {
70
+ this.queries.push(new Query(path_1.default.basename(file, ".graphql")));
71
+ }
72
+ for (const file of mutations) {
73
+ this.mutations.push(new Mutation(path_1.default.basename(file, ".graphql")));
74
+ }
75
+ for (const file of subscriptions) {
76
+ this.subscriptions.push(new Subscription(path_1.default.basename(file, ".graphql")));
77
+ }
78
+ }
79
+ printSubscriptions() {
80
+ return `
81
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT IT DIRECTLY
82
+ import {
83
+ ${this.subscriptions.map((q) => " " + q.pre()).join(",\n")}
84
+ } from "./generated/graphql";
85
+ import { Codex } from "./index";
86
+ import { ExecutionResult, Sink } from "graphql-ws";
87
+
88
+ export class Subscribe {
89
+ constructor(private sdk: Codex) {}
90
+ ${this.subscriptions.map((q) => q.main()).join("\n")}
91
+ }
92
+ `;
93
+ }
94
+ printMutations() {
95
+ return `
96
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT IT DIRECTLY
97
+ import {
98
+ ${this.mutations.map((q) => " " + q.pre()).join(",\n")}
99
+ } from "./generated/graphql";
100
+ import { Codex } from "./index";
101
+
102
+ export class Mutation {
103
+ constructor(private sdk: Codex) {}
104
+ ${this.mutations.map((q) => q.main()).join("\n")}
105
+ }
106
+ `;
107
+ }
108
+ printQueries() {
109
+ return `
110
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT IT DIRECTLY
111
+ import {
112
+ ${this.queries.map((q) => " " + q.pre()).join(",\n")}
113
+ } from "./generated/graphql";
114
+ import { Codex } from "./index";
115
+
116
+ export class Query {
117
+ constructor(private sdk: Codex) {}
118
+ ${this.queries.map((q) => q.main()).join("\n")}
119
+ }
120
+ `;
121
+ }
122
+ output() {
123
+ fs_1.default.writeFileSync(path_1.default.join(__dirname, "..", "sdk", "Subscribe.ts"), this.printSubscriptions(), "utf8");
124
+ fs_1.default.writeFileSync(path_1.default.join(__dirname, "..", "sdk", "Mutation.ts"), this.printMutations(), "utf8");
125
+ fs_1.default.writeFileSync(path_1.default.join(__dirname, "..", "sdk", "Query.ts"), this.printQueries(), "utf8");
126
+ }
127
+ }
128
+ function run() {
129
+ return __awaiter(this, void 0, void 0, function* () {
130
+ const sdk = new SDK();
131
+ sdk.output();
132
+ });
133
+ }
134
+ run().then(() => process.exit());
135
+ //# sourceMappingURL=buildSdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSdk.js","sourceRoot":"","sources":["../../src/scripts/buildSdk.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,iEAAyC;AACzC,gDAAwB;AAExB,MAAM,iCAAiC,GAAG,cAAI,CAAC,IAAI,CACjD,SAAS,EACT,IAAI,EACJ,WAAW,EACX,yBAAyB,CAC1B,CAAC;AACF,MAAM,6BAA6B,GAAG,cAAI,CAAC,IAAI,CAC7C,SAAS,EACT,IAAI,EACJ,WAAW,EACX,qBAAqB,CACtB,CAAC;AACF,MAAM,2BAA2B,GAAG,cAAI,CAAC,IAAI,CAC3C,SAAS,EACT,IAAI,EACJ,WAAW,EACX,mBAAmB,CACpB,CAAC;AAEF,MAAM,YAAY;IAChB,YAAoB,gBAAwB;QAAxB,qBAAgB,GAAhB,gBAAgB,CAAQ;IAAG,CAAC;IAChD,GAAG;QACD,OAAO,GAAG,IAAI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
@@ -0,0 +1,30 @@
1
+ import VariableOptions from "gql-query-builder/build/VariableOptions";
2
+ type SchemaTypeDefinition = {
3
+ kind: "NON_NULL" | "SCALAR" | "LIST" | "OBJECT" | "INPUT_OBJECT" | "ENUM" | "UNION" | undefined | null;
4
+ name?: string | null;
5
+ ofType?: SchemaTypeDefinition | null;
6
+ isDeprecated?: boolean | null;
7
+ };
8
+ type SchemaType = {
9
+ name: string;
10
+ description?: string | null;
11
+ type: SchemaTypeDefinition;
12
+ isDeprecated?: boolean | null;
13
+ fields?: SchemaType[];
14
+ };
15
+ type Fields = Array<string | {
16
+ [key: string]: Fields;
17
+ }>;
18
+ export declare const getLeafType: (type: SchemaTypeDefinition, allTypes: SchemaType[], result: Fields, currentName: string, level?: number) => Fields;
19
+ export declare const getLeafArgs: (type: SchemaTypeDefinition, result: VariableOptions) => VariableOptions;
20
+ export declare function parseVariables(args: SchemaType[]): {
21
+ type?: string | undefined;
22
+ name?: string | undefined;
23
+ value: any;
24
+ list?: boolean | [boolean] | undefined;
25
+ required?: boolean | undefined;
26
+ } | {
27
+ [x: string]: any;
28
+ };
29
+ export {};
30
+ //# sourceMappingURL=generateGraphql.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateGraphql.d.ts","sourceRoot":"","sources":["../../src/scripts/generateGraphql.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,MAAM,yCAAyC,CAAC;AAItE,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EACA,UAAU,GACV,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,cAAc,GACd,MAAM,GACN,OAAO,GACP,SAAS,GACT,IAAI,CAAC;IACT,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACrC,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;CACvB,CAAC;AAEF,KAAK,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC,CAAC;AAMxD,eAAO,MAAM,WAAW,SAChB,oBAAoB,YAChB,UAAU,EAAE,+BAET,MAAM,2BAmCpB,CAAC;AAEF,eAAO,MAAM,WAAW,SAChB,oBAAoB,UAClB,eAAe,KACtB,eA2BF,CAAC;AAEF,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE;;;;;;;;EAWhD"}