@codex-data/sdk 1.0.8 → 1.0.10

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 (55) hide show
  1. package/dist/resources/graphql.d.ts +177 -6
  2. package/dist/resources/graphql.d.ts.map +1 -1
  3. package/dist/resources/graphql.js +10 -2
  4. package/dist/resources/graphql.js.map +1 -1
  5. package/dist/sdk/Mutation.d.ts +2 -2
  6. package/dist/sdk/Mutation.d.ts.map +1 -1
  7. package/dist/sdk/Mutation.js +2 -2
  8. package/dist/sdk/Mutation.js.map +1 -1
  9. package/dist/sdk/Query.d.ts +52 -52
  10. package/dist/sdk/Query.d.ts.map +1 -1
  11. package/dist/sdk/Query.js +51 -51
  12. package/dist/sdk/Query.js.map +1 -1
  13. package/dist/sdk/Subscribe.d.ts +19 -17
  14. package/dist/sdk/Subscribe.d.ts.map +1 -1
  15. package/dist/sdk/Subscribe.js +133 -119
  16. package/dist/sdk/Subscribe.js.map +1 -1
  17. package/dist/sdk/generated/gql.d.ts +44 -29
  18. package/dist/sdk/generated/gql.d.ts.map +1 -1
  19. package/dist/sdk/generated/gql.js +13 -11
  20. package/dist/sdk/generated/gql.js.map +1 -1
  21. package/dist/sdk/generated/graphql.d.ts +792 -72
  22. package/dist/sdk/generated/graphql.d.ts.map +1 -1
  23. package/dist/sdk/generated/graphql.js +25 -15
  24. package/dist/sdk/generated/graphql.js.map +1 -1
  25. package/dist/sdk/index.d.ts +45 -0
  26. package/dist/sdk/index.d.ts.map +1 -1
  27. package/dist/sdk/index.js +83 -5
  28. package/dist/sdk/index.js.map +1 -1
  29. package/dist/sdk/index.test.js +232 -7
  30. package/dist/sdk/index.test.js.map +1 -1
  31. package/package.json +1 -1
  32. package/src/resources/generated_queries/Balances.graphql +78 -0
  33. package/src/resources/generated_queries/GetTokenEvents.graphql +1 -0
  34. package/src/resources/generated_queries/GetTokenEventsForMaker.graphql +1 -0
  35. package/src/resources/generated_queries/Holders.graphql +78 -0
  36. package/src/resources/generated_queries/LiquidityLocks.graphql +7 -1
  37. package/src/resources/generated_queries/LiquidityMetadataByToken.graphql +19 -0
  38. package/src/resources/generated_queries/PrimeHolders.graphql +78 -0
  39. package/src/resources/generated_subscriptions/OnBalanceUpdated.graphql +78 -0
  40. package/src/resources/generated_subscriptions/OnEventsCreated.graphql +3 -0
  41. package/src/resources/generated_subscriptions/OnEventsCreatedByMaker.graphql +92 -0
  42. package/src/resources/generated_subscriptions/OnHoldersUpdated.graphql +78 -0
  43. package/src/resources/generated_subscriptions/OnTokenEventsCreated.graphql +1 -0
  44. package/src/resources/generated_subscriptions/OnUnconfirmedEventsCreatedByMaker.graphql +41 -0
  45. package/src/resources/graphql.schema.json +1219 -129
  46. package/src/resources/graphql.ts +195 -6
  47. package/src/resources/schema.graphql +250 -6
  48. package/src/sdk/Mutation.ts +4 -4
  49. package/src/sdk/Query.ts +109 -108
  50. package/src/sdk/Subscribe.ts +225 -195
  51. package/src/sdk/generated/gql.ts +34 -24
  52. package/src/sdk/generated/graphql.ts +245 -39
  53. package/src/sdk/index.test.ts +361 -10
  54. package/src/sdk/index.ts +89 -6
  55. package/src/resources/generated_queries/ListTopTokens.graphql +0 -55
@@ -14,6 +14,15 @@ directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on
14
14
 
15
15
  directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA
16
16
 
17
+ """Response returned by `onEventsCreatedByMaker`."""
18
+ type AddEventsByMakerOutput {
19
+ """The address of the maker."""
20
+ makerAddress: String!
21
+
22
+ """A list of transactions for the maker."""
23
+ events: [Event!]!
24
+ }
25
+
17
26
  """Response returned by `onEventsCreated`."""
18
27
  type AddEventsOutput {
19
28
  """The contract address of the pair."""
@@ -86,6 +95,14 @@ type AddTrackedWalletEventsOutput {
86
95
  userId: String!
87
96
  }
88
97
 
98
+ type AddUnconfirmedEventsByMakerOutput {
99
+ """The wallet address of the maker."""
100
+ makerAddress: String!
101
+
102
+ """A list of transactions for the maker."""
103
+ events: [UnconfirmedEvent!]!
104
+ }
105
+
89
106
  """Response returned by `onUnconfirmedEventsCreated`."""
90
107
  type AddUnconfirmedEventsOutput {
91
108
  """The contract address of the pair."""
@@ -182,8 +199,17 @@ type Balance {
182
199
  """
183
200
  shiftedBalance: Float!
184
201
 
202
+ """The balance held by the wallet in USD."""
203
+ balanceUsd: String
204
+
205
+ """The token price in USD."""
206
+ tokenPriceUsd: String
207
+
185
208
  """The time that this address first held a token."""
186
209
  firstHeldTimestamp: Int
210
+
211
+ """Metadata for the token."""
212
+ token: EnhancedToken
187
213
  }
188
214
 
189
215
  input BalancesInput {
@@ -211,6 +237,9 @@ input BalancesInput {
211
237
  """A cursor for use in pagination."""
212
238
  cursor: String
213
239
 
240
+ """Whether to remove scam tokens from the response."""
241
+ removeScams: Boolean
242
+
214
243
  """The ID of the wallet (`walletAddress:networkId`)."""
215
244
  walletId: String @deprecated(reason: "Use walletAddress and networkId instead")
216
245
 
@@ -541,6 +570,62 @@ input CreateApiTokensInput {
541
570
  expiresIn: Int
542
571
  }
543
572
 
573
+ """Input for creating a market cap webhook."""
574
+ input CreateMarketCapWebhookArgs {
575
+ """The name of the webhook (max 128 characters)."""
576
+ name: String!
577
+
578
+ """The url to which the webhook message should be sent."""
579
+ callbackUrl: String!
580
+
581
+ """
582
+ A string value to hash along with `deduplicationId` using SHA-256. Included in the webhook message for added security.
583
+ """
584
+ securityToken: String!
585
+
586
+ """The recurrence of the webhook. Can be `INDEFINITE` or `ONCE`."""
587
+ alertRecurrence: AlertRecurrence!
588
+
589
+ """
590
+ A webhook group ID (max 64 characters). Can be used to group webhooks so that their messages are kept in order as a group rather than by individual webhook.
591
+ """
592
+ groupId: String
593
+
594
+ """
595
+ The conditions which must be met in order for the webhook to send a message.
596
+ """
597
+ conditions: MarketCapEventWebhookConditionInput!
598
+
599
+ """The settings for retrying failed webhook messages."""
600
+ retrySettings: RetrySettingsInput
601
+
602
+ """
603
+ An optional bucket ID (max 64 characters). Can be used to query for subgroups of webhooks (useful if you have a large number of webhooks).
604
+ """
605
+ bucketId: String
606
+
607
+ """
608
+ An optional bucket sort key (max 64 characters). Can be used to query for subgroups of webhooks (useful if you have a large number of webhooks).
609
+ """
610
+ bucketSortkey: String
611
+
612
+ """
613
+ The type of publishing for the webhook. If not set, it defaults to `SINGLE`.
614
+ """
615
+ publishingType: PublishingType
616
+
617
+ """
618
+ If enabled, new webhooks won't be created if a webhook with the same parameters already exists. If callbackUrl, conditions, publishingType, and alertRecurrence all match, then we return the existing webhook.
619
+ """
620
+ deduplicate: Boolean
621
+ }
622
+
623
+ """Input for creating market cap webhooks."""
624
+ input CreateMarketCapWebhooksInput {
625
+ """A list of market cap webhooks to create."""
626
+ webhooks: [CreateMarketCapWebhookArgs!]!
627
+ }
628
+
544
629
  """Input for creating an NFT event webhook."""
545
630
  input CreateNftEventWebhookArgs {
546
631
  """The name of the webhook (max 128 characters)."""
@@ -778,6 +863,9 @@ input CreateWebhooksInput {
778
863
 
779
864
  """Input for creating raw transaction webhooks."""
780
865
  rawTransactionWebhooksInput: CreateRawTransactionWebhooksInput
866
+
867
+ """Input for creating market cap webhooks."""
868
+ marketCapWebhooksInput: CreateMarketCapWebhooksInput
781
869
  }
782
870
 
783
871
  """Result returned by `createWebhooks`."""
@@ -793,6 +881,9 @@ type CreateWebhooksOutput {
793
881
 
794
882
  """The list of raw transaction webhooks that were created."""
795
883
  rawTransactionWebhooks: [Webhook]!
884
+
885
+ """The list of market cap event webhooks that were created."""
886
+ marketCapWebhooks: [Webhook]!
796
887
  }
797
888
 
798
889
  enum CreationContext {
@@ -1371,6 +1462,9 @@ type Event {
1371
1462
 
1372
1463
  """The age of the wallet in seconds."""
1373
1464
  walletAge: Int
1465
+
1466
+ """Labels attributed to the wallet."""
1467
+ walletLabels: [String!]
1374
1468
  }
1375
1469
 
1376
1470
  """Response returned by `getTokenEvents`."""
@@ -1778,7 +1872,10 @@ input FilterTokenWalletsInput {
1778
1872
  tokenId: String
1779
1873
 
1780
1874
  """The wallet address to filter wallets for"""
1781
- walletAddress: String
1875
+ walletAddress: String @deprecated(reason: "Use wallets instead")
1876
+
1877
+ """A list of wallet addresses to filter wallets for"""
1878
+ wallets: [String]
1782
1879
 
1783
1880
  """The network ID to filter wallets for"""
1784
1881
  networkId: Int
@@ -2113,6 +2210,16 @@ type HoldersUpdate {
2113
2210
  balances: [Balance!]!
2114
2211
  }
2115
2212
 
2213
+ input IndexerStateInput {
2214
+ """The network ID to check the state of."""
2215
+ networkId: Int!
2216
+ }
2217
+
2218
+ enum IndexerStatus {
2219
+ Behind
2220
+ Normal
2221
+ }
2222
+
2116
2223
  """Bar chart data."""
2117
2224
  type IndividualBarData {
2118
2225
  """The opening price."""
@@ -2518,6 +2625,8 @@ enum LaunchpadTokenProtocol {
2518
2625
  Vertigo
2519
2626
  Rainbow
2520
2627
  EgoTech
2628
+ ArenaTrade
2629
+ Moonit
2521
2630
  }
2522
2631
 
2523
2632
  scalar link__Import
@@ -2586,6 +2695,23 @@ type LiquidityLock {
2586
2695
  liquidityNftData: LiquidityNftData
2587
2696
  }
2588
2697
 
2698
+ """A breakdown of how much and where liquidity is locked."""
2699
+ type LiquidityLockBreakdownForToken {
2700
+ """The protocol with which the liquidity is locked."""
2701
+ lockProtocol: LiquidityLockProtocol!
2702
+
2703
+ """The amount of liquidity locked in USD."""
2704
+ amountLockedUsd: String!
2705
+
2706
+ """The amount of tokens locked in the protocol."""
2707
+ amountLockedTokens: String!
2708
+
2709
+ """
2710
+ The amount of tokens locked in the protocol shifted by number of decimals the token has.
2711
+ """
2712
+ amountLockedTokensShifted: String!
2713
+ }
2714
+
2589
2715
  type LiquidityLockConnection {
2590
2716
  """A list of liquidity locks."""
2591
2717
  items: [LiquidityLock!]!
@@ -2612,6 +2738,45 @@ type LiquidityMetadata {
2612
2738
  liquidity: LiquidityData!
2613
2739
  }
2614
2740
 
2741
+ """
2742
+ Metadata about a token's liquidity. Includes locked liquidity data for up to 100 pairs that the token is in.
2743
+ """
2744
+ type LiquidityMetadataByToken {
2745
+ """The address of the token."""
2746
+ tokenAddress: String!
2747
+
2748
+ """The network ID the token is deployed on."""
2749
+ networkId: Int!
2750
+
2751
+ """The total liquidity in USD."""
2752
+ totalLiquidityUsd: String!
2753
+
2754
+ """The locked liquidity in USD."""
2755
+ lockedLiquidityUsd: String!
2756
+
2757
+ """The total amount of tokens in pairs."""
2758
+ totalTokenLiquidity: String!
2759
+
2760
+ """
2761
+ The total amount of tokens in pairs shifted by number of decimals the token has.
2762
+ """
2763
+ totalTokenLiquidityShifted: String!
2764
+
2765
+ """The locked amount of tokens in pairs."""
2766
+ lockedTokenLiquidity: String!
2767
+
2768
+ """
2769
+ The locked amount of tokens in pairs shifted by number of decimals the token has.
2770
+ """
2771
+ lockedTokenLiquidityShifted: String!
2772
+
2773
+ """The percentage of liquidity that is locked."""
2774
+ lockedLiquidityPercentage: Float!
2775
+
2776
+ """A breakdown of how much and where liquidity is locked."""
2777
+ lockBreakdown: [LiquidityLockBreakdownForToken]!
2778
+ }
2779
+
2615
2780
  """Liquidity NFT position data"""
2616
2781
  type LiquidityNftData {
2617
2782
  """The tokenId of the liquidity position nft."""
@@ -2718,6 +2883,46 @@ input MakerEventsQueryInput {
2718
2883
  tokenAddress: String
2719
2884
  }
2720
2885
 
2886
+ """Webhook conditions for a market cap event."""
2887
+ type MarketCapEventWebhookCondition {
2888
+ """The token contract address the webhook is listening for."""
2889
+ tokenAddress: StringEqualsCondition!
2890
+
2891
+ """The network ID the webhook is listening on."""
2892
+ networkId: IntEqualsCondition!
2893
+
2894
+ """
2895
+ The market cap condition that must be met in order for the webhook to send.
2896
+ """
2897
+ fdvMarketCapUsd: ComparisonOperator
2898
+
2899
+ """
2900
+ The circulating market cap condition that must be met in order for the webhook to send.
2901
+ """
2902
+ circulatingMarketCapUsd: ComparisonOperator
2903
+
2904
+ """The pair contract address the webhook is listening for."""
2905
+ pairAddress: StringEqualsCondition
2906
+ }
2907
+
2908
+ """Input conditions for a market cap event webhook."""
2909
+ input MarketCapEventWebhookConditionInput {
2910
+ """The contract address of the token to listen for."""
2911
+ tokenAddress: StringEqualsConditionInput!
2912
+
2913
+ """The network ID to listen on."""
2914
+ networkId: IntEqualsConditionInput!
2915
+
2916
+ """The price conditions to listen for."""
2917
+ fdvMarketCapUsd: ComparisonOperatorInput
2918
+
2919
+ """The circulating market cap conditions to listen for."""
2920
+ circulatingMarketCapUsd: ComparisonOperatorInput
2921
+
2922
+ """The contract address of the pair to listen for."""
2923
+ pairAddress: StringEqualsConditionInput
2924
+ }
2925
+
2721
2926
  """The status for a network supported on Defined."""
2722
2927
  type MetadataResponse {
2723
2928
  """The last processed block on the network."""
@@ -6565,6 +6770,12 @@ input OneOfNumberConditionInput {
6565
6770
  oneOf: [Int!]!
6566
6771
  }
6567
6772
 
6773
+ """Input for `onEventsCreatedByMaker`."""
6774
+ input OnEventsCreatedByMakerInput {
6775
+ """The wallet address of the maker."""
6776
+ makerAddress: String!
6777
+ }
6778
+
6568
6779
  """Input for `onLaunchpadTokenEvent`."""
6569
6780
  input OnLaunchpadTokenEventInput {
6570
6781
  """The protocol of the token."""
@@ -6627,7 +6838,10 @@ type OnTokenBarsUpdatedResponse {
6627
6838
  }
6628
6839
 
6629
6840
  input OnTokenEventsCreatedInput {
6841
+ """The token address to filter by."""
6630
6842
  tokenAddress: String
6843
+
6844
+ """The network ID to filter by."""
6631
6845
  networkId: Int!
6632
6846
  }
6633
6847
 
@@ -6661,6 +6875,12 @@ type OnUnconfirmedBarsUpdated {
6661
6875
  quoteTokenAddress: String!
6662
6876
  }
6663
6877
 
6878
+ """Input for `onUnconfirmedEventsCreatedByMaker`."""
6879
+ input OnUnconfirmedEventsCreatedByMakerInput {
6880
+ """The wallet address of the maker."""
6881
+ makerAddress: String!
6882
+ }
6883
+
6664
6884
  enum OrderState {
6665
6885
  CREATED
6666
6886
  PENDING
@@ -9192,7 +9412,7 @@ type Query {
9192
9412
  The time frame for trending results. Can be `1`, `5`, `15`, `30`, `60`, `240`, `720`, or `1D`.
9193
9413
  """
9194
9414
  resolution: String
9195
- ): [TokenWithMetadata!]
9415
+ ): [TokenWithMetadata!] @deprecated(reason: "This query is no longer supported and will not return up to date data. Use `filterTokens` instead.")
9196
9416
 
9197
9417
  """
9198
9418
  Returns charting metadata for a given pair. Used for implementing a Trading View datafeed.
@@ -9331,7 +9551,7 @@ type Query {
9331
9551
  ): TokenSearchResponse @deprecated(reason: "This query is no longer supported and will not return up to date data. Use `filterTokens` instead.")
9332
9552
 
9333
9553
  """
9334
- Returns the percentage of a token’s total supply held collectively by its top 10 holders.
9554
+ Returns the percentage of a token's total supply held collectively by its top 10 holders.
9335
9555
  """
9336
9556
  top10HoldersPercent(tokenId: String!): Float
9337
9557
 
@@ -9481,7 +9701,10 @@ type Query {
9481
9701
  """Returns liquidity locks for a given pair."""
9482
9702
  liquidityLocks(
9483
9703
  """The address of the pair."""
9484
- pairAddress: String!
9704
+ pairAddress: String
9705
+
9706
+ """The address of the token."""
9707
+ tokenAddress: String
9485
9708
 
9486
9709
  """The network id of the pair."""
9487
9710
  networkId: Int!
@@ -9501,6 +9724,17 @@ type Query {
9501
9724
  networkId: Int!
9502
9725
  ): LiquidityMetadata
9503
9726
 
9727
+ """
9728
+ Returns liquidity metadata for a given token. Includes liquidity lock data for up to 100 pairs that the token is in.
9729
+ """
9730
+ liquidityMetadataByToken(
9731
+ """The address of the token."""
9732
+ tokenAddress: String!
9733
+
9734
+ """The network id of the token."""
9735
+ networkId: Int!
9736
+ ): LiquidityMetadataByToken!
9737
+
9504
9738
  """Returns a list of top traders for a given token."""
9505
9739
  tokenTopTraders(input: TokenTopTradersInput!): TokenTopTradersConnection!
9506
9740
 
@@ -10279,8 +10513,14 @@ type Subscription {
10279
10513
 
10280
10514
  """The networkId to use when getting all events per network"""
10281
10515
  networkId: Int
10516
+
10517
+ """docs: hide"""
10518
+ maker: String
10282
10519
  ): AddEventsOutput
10283
10520
 
10521
+ """Live-streamed transactions for a maker."""
10522
+ onEventsCreatedByMaker(input: OnEventsCreatedByMakerInput!): AddEventsByMakerOutput
10523
+
10284
10524
  """Live-streamed unconfirmed transactions for a token. (Solana only)"""
10285
10525
  onUnconfirmedEventsCreated(
10286
10526
  """The pair contract address."""
@@ -10293,6 +10533,9 @@ type Subscription {
10293
10533
  quoteToken: QuoteToken
10294
10534
  ): AddUnconfirmedEventsOutput
10295
10535
 
10536
+ """Live-streamed unconfirmed transactions for a maker. (Solana only)"""
10537
+ onUnconfirmedEventsCreatedByMaker(input: OnUnconfirmedEventsCreatedByMakerInput!): AddUnconfirmedEventsByMakerOutput
10538
+
10296
10539
  """Live-streamed price updates for a token."""
10297
10540
  onPriceUpdated(
10298
10541
  """The token contract address."""
@@ -13332,7 +13575,7 @@ type Webhook {
13332
13575
  }
13333
13576
 
13334
13577
  """Webhook conditions that must be met for each webhook type."""
13335
- union WebhookCondition = PriceEventWebhookCondition | TokenPairEventWebhookCondition | NftEventWebhookCondition | RawTransactionWebhookCondition
13578
+ union WebhookCondition = PriceEventWebhookCondition | MarketCapEventWebhookCondition | TokenPairEventWebhookCondition | NftEventWebhookCondition | RawTransactionWebhookCondition
13336
13579
 
13337
13580
  """NFT marketplace names."""
13338
13581
  enum WebhookNftEventFillSource {
@@ -13366,6 +13609,7 @@ enum WebhookType {
13366
13609
  NFT_EVENT
13367
13610
  TOKEN_PAIR_EVENT
13368
13611
  RAW_TRANSACTION
13612
+ MARKET_CAP_EVENT
13369
13613
  }
13370
13614
 
13371
13615
  """Price stats for a pair over a time frame."""
@@ -13388,7 +13632,7 @@ type WindowedDetailedCurrencyPairStats {
13388
13632
  """The lowest price in USD in the time frame."""
13389
13633
  lowest: DetailedPairStatsStringMetrics
13390
13634
 
13391
- """The closing price for the time frame."""
13635
+ """The closing price forr the time frame."""
13392
13636
  close: DetailedPairStatsStringMetrics
13393
13637
 
13394
13638
  """The liquidity for the time frame."""
@@ -13,12 +13,12 @@ import { Codex } from "./index";
13
13
 
14
14
  export class Mutation {
15
15
  constructor(private sdk: Codex) {}
16
- deleteWebhooks = async (vars: DeleteWebhooksMutationVariables) =>
17
- this.sdk.mutation(DeleteWebhooksDocument, vars);
18
- createApiTokens = async (vars: CreateApiTokensMutationVariables) =>
19
- this.sdk.mutation(CreateApiTokensDocument, vars);
20
16
  createWebhooks = async (vars: CreateWebhooksMutationVariables) =>
21
17
  this.sdk.mutation(CreateWebhooksDocument, vars);
22
18
  deleteApiToken = async (vars: DeleteApiTokenMutationVariables) =>
23
19
  this.sdk.mutation(DeleteApiTokenDocument, vars);
20
+ createApiTokens = async (vars: CreateApiTokensMutationVariables) =>
21
+ this.sdk.mutation(CreateApiTokensDocument, vars);
22
+ deleteWebhooks = async (vars: DeleteWebhooksMutationVariables) =>
23
+ this.sdk.mutation(DeleteWebhooksDocument, vars);
24
24
  }