@coinbase/cdp-sdk 1.38.3 → 1.38.5

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 (195) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +24 -0
  3. package/_cjs/accounts/evm/toEvmServerAccount.js +0 -36
  4. package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
  5. package/_cjs/accounts/evm/toEvmSmartAccount.js +0 -36
  6. package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
  7. package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js +0 -42
  8. package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
  9. package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js +0 -42
  10. package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
  11. package/_cjs/accounts/solana/toSolanaAccount.js +0 -30
  12. package/_cjs/accounts/solana/toSolanaAccount.js.map +1 -1
  13. package/_cjs/actions/evm/sendUserOperation.js +2 -0
  14. package/_cjs/actions/evm/sendUserOperation.js.map +1 -1
  15. package/_cjs/actions/solana/rpc.js +16 -0
  16. package/_cjs/actions/solana/rpc.js.map +1 -0
  17. package/_cjs/actions/solana/transfer.js +74 -48
  18. package/_cjs/actions/solana/transfer.js.map +1 -1
  19. package/_cjs/actions/solana/utils.js +4 -6
  20. package/_cjs/actions/solana/utils.js.map +1 -1
  21. package/_cjs/auth/utils/http.js +5 -2
  22. package/_cjs/auth/utils/http.js.map +1 -1
  23. package/_cjs/auth/utils/jwt.js +1 -1
  24. package/_cjs/auth/utils/jwt.js.map +1 -1
  25. package/_cjs/client/evm/evm.js +49 -0
  26. package/_cjs/client/evm/evm.js.map +1 -1
  27. package/_cjs/openapi-client/cdpApiClient.js +4 -0
  28. package/_cjs/openapi-client/cdpApiClient.js.map +1 -1
  29. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +6 -41
  30. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  31. package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js +10 -1
  32. package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -1
  33. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +14 -1
  34. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
  35. package/_cjs/openapi-client/generated/sql-api-alpha/sql-api-alpha.js +14 -1
  36. package/_cjs/openapi-client/generated/sql-api-alpha/sql-api-alpha.js.map +1 -1
  37. package/_cjs/openapi-client/index.js +0 -3
  38. package/_cjs/openapi-client/index.js.map +1 -1
  39. package/_cjs/version.js +1 -1
  40. package/_esm/accounts/evm/toEvmServerAccount.js +0 -36
  41. package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
  42. package/_esm/accounts/evm/toEvmSmartAccount.js +0 -36
  43. package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
  44. package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js +0 -42
  45. package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
  46. package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js +0 -42
  47. package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
  48. package/_esm/accounts/solana/toSolanaAccount.js +0 -30
  49. package/_esm/accounts/solana/toSolanaAccount.js.map +1 -1
  50. package/_esm/actions/evm/sendUserOperation.js +2 -0
  51. package/_esm/actions/evm/sendUserOperation.js.map +1 -1
  52. package/_esm/actions/solana/rpc.js +13 -0
  53. package/_esm/actions/solana/rpc.js.map +1 -0
  54. package/_esm/actions/solana/transfer.js +72 -48
  55. package/_esm/actions/solana/transfer.js.map +1 -1
  56. package/_esm/actions/solana/utils.js +4 -6
  57. package/_esm/actions/solana/utils.js.map +1 -1
  58. package/_esm/auth/utils/http.js +5 -2
  59. package/_esm/auth/utils/http.js.map +1 -1
  60. package/_esm/auth/utils/jwt.js +1 -1
  61. package/_esm/auth/utils/jwt.js.map +1 -1
  62. package/_esm/client/evm/evm.js +49 -0
  63. package/_esm/client/evm/evm.js.map +1 -1
  64. package/_esm/openapi-client/cdpApiClient.js +4 -0
  65. package/_esm/openapi-client/cdpApiClient.js.map +1 -1
  66. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +5 -39
  67. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  68. package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js +8 -0
  69. package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -1
  70. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +12 -0
  71. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
  72. package/_esm/openapi-client/generated/sql-api-alpha/sql-api-alpha.js +12 -0
  73. package/_esm/openapi-client/generated/sql-api-alpha/sql-api-alpha.js.map +1 -1
  74. package/_esm/openapi-client/index.js +0 -3
  75. package/_esm/openapi-client/index.js.map +1 -1
  76. package/_esm/version.js +1 -1
  77. package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
  78. package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
  79. package/_types/accounts/evm/toNetworkScopedEvmServerAccount.d.ts.map +1 -1
  80. package/_types/accounts/evm/toNetworkScopedEvmSmartAccount.d.ts.map +1 -1
  81. package/_types/accounts/evm/types.d.ts +3 -18
  82. package/_types/accounts/evm/types.d.ts.map +1 -1
  83. package/_types/accounts/solana/toSolanaAccount.d.ts.map +1 -1
  84. package/_types/actions/evm/sendUserOperation.d.ts +11 -0
  85. package/_types/actions/evm/sendUserOperation.d.ts.map +1 -1
  86. package/_types/actions/evm/types.d.ts +1 -66
  87. package/_types/actions/evm/types.d.ts.map +1 -1
  88. package/_types/actions/solana/rpc.d.ts +10 -0
  89. package/_types/actions/solana/rpc.d.ts.map +1 -0
  90. package/_types/actions/solana/transfer.d.ts +37 -1
  91. package/_types/actions/solana/transfer.d.ts.map +1 -1
  92. package/_types/actions/solana/types.d.ts +1 -62
  93. package/_types/actions/solana/types.d.ts.map +1 -1
  94. package/_types/actions/solana/utils.d.ts +4 -6
  95. package/_types/actions/solana/utils.d.ts.map +1 -1
  96. package/_types/auth/utils/http.d.ts.map +1 -1
  97. package/_types/client/evm/evm.d.ts +29 -2
  98. package/_types/client/evm/evm.d.ts.map +1 -1
  99. package/_types/client/evm/evm.types.d.ts +20 -2
  100. package/_types/client/evm/evm.types.d.ts.map +1 -1
  101. package/_types/openapi-client/cdpApiClient.d.ts.map +1 -1
  102. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +44 -246
  103. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  104. package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.d.ts +8 -1
  105. package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.d.ts.map +1 -1
  106. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts +7 -1
  107. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts.map +1 -1
  108. package/_types/openapi-client/generated/sql-api-alpha/sql-api-alpha.d.ts +11 -0
  109. package/_types/openapi-client/generated/sql-api-alpha/sql-api-alpha.d.ts.map +1 -1
  110. package/_types/openapi-client/index.d.ts +3 -6
  111. package/_types/openapi-client/index.d.ts.map +1 -1
  112. package/_types/types/calls.d.ts +1 -0
  113. package/_types/types/calls.d.ts.map +1 -1
  114. package/_types/version.d.ts +1 -1
  115. package/accounts/evm/toEvmServerAccount.ts +0 -47
  116. package/accounts/evm/toEvmSmartAccount.ts +0 -47
  117. package/accounts/evm/toNetworkScopedEvmServerAccount.ts +0 -50
  118. package/accounts/evm/toNetworkScopedEvmSmartAccount.ts +0 -49
  119. package/accounts/evm/types.ts +5 -49
  120. package/accounts/solana/toSolanaAccount.ts +0 -41
  121. package/actions/evm/sendUserOperation.ts +14 -0
  122. package/actions/evm/types.ts +1 -74
  123. package/actions/solana/rpc.ts +17 -0
  124. package/actions/solana/transfer.ts +115 -84
  125. package/actions/solana/types.ts +1 -70
  126. package/actions/solana/utils.ts +4 -6
  127. package/auth/utils/http.ts +5 -2
  128. package/auth/utils/jwt.ts +1 -1
  129. package/client/evm/evm.ts +61 -0
  130. package/client/evm/evm.types.ts +23 -0
  131. package/openapi-client/cdpApiClient.ts +5 -0
  132. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +53 -289
  133. package/openapi-client/generated/end-user-accounts/end-user-accounts.ts +14 -0
  134. package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts +23 -0
  135. package/openapi-client/generated/sql-api-alpha/sql-api-alpha.ts +13 -0
  136. package/openapi-client/index.ts +0 -3
  137. package/package.json +5 -6
  138. package/types/calls.ts +1 -0
  139. package/version.ts +1 -1
  140. package/_cjs/actions/Quote.js +0 -106
  141. package/_cjs/actions/Quote.js.map +0 -1
  142. package/_cjs/actions/evm/fund/fund.js +0 -50
  143. package/_cjs/actions/evm/fund/fund.js.map +0 -1
  144. package/_cjs/actions/evm/fund/quoteFund.js +0 -47
  145. package/_cjs/actions/evm/fund/quoteFund.js.map +0 -1
  146. package/_cjs/actions/solana/fund/fund.js +0 -50
  147. package/_cjs/actions/solana/fund/fund.js.map +0 -1
  148. package/_cjs/actions/solana/fund/quoteFund.js +0 -47
  149. package/_cjs/actions/solana/fund/quoteFund.js.map +0 -1
  150. package/_cjs/actions/types.js +0 -3
  151. package/_cjs/actions/types.js.map +0 -1
  152. package/_cjs/actions/waitForFundOperationReceipt.js +0 -64
  153. package/_cjs/actions/waitForFundOperationReceipt.js.map +0 -1
  154. package/_cjs/openapi-client/generated/payments-alpha/payments-alpha.js +0 -50
  155. package/_cjs/openapi-client/generated/payments-alpha/payments-alpha.js.map +0 -1
  156. package/_esm/actions/Quote.js +0 -101
  157. package/_esm/actions/Quote.js.map +0 -1
  158. package/_esm/actions/evm/fund/fund.js +0 -47
  159. package/_esm/actions/evm/fund/fund.js.map +0 -1
  160. package/_esm/actions/evm/fund/quoteFund.js +0 -44
  161. package/_esm/actions/evm/fund/quoteFund.js.map +0 -1
  162. package/_esm/actions/solana/fund/fund.js +0 -47
  163. package/_esm/actions/solana/fund/fund.js.map +0 -1
  164. package/_esm/actions/solana/fund/quoteFund.js +0 -44
  165. package/_esm/actions/solana/fund/quoteFund.js.map +0 -1
  166. package/_esm/actions/types.js +0 -2
  167. package/_esm/actions/types.js.map +0 -1
  168. package/_esm/actions/waitForFundOperationReceipt.js +0 -61
  169. package/_esm/actions/waitForFundOperationReceipt.js.map +0 -1
  170. package/_esm/openapi-client/generated/payments-alpha/payments-alpha.js +0 -42
  171. package/_esm/openapi-client/generated/payments-alpha/payments-alpha.js.map +0 -1
  172. package/_types/actions/Quote.d.ts +0 -97
  173. package/_types/actions/Quote.d.ts.map +0 -1
  174. package/_types/actions/evm/fund/fund.d.ts +0 -21
  175. package/_types/actions/evm/fund/fund.d.ts.map +0 -1
  176. package/_types/actions/evm/fund/quoteFund.d.ts +0 -22
  177. package/_types/actions/evm/fund/quoteFund.d.ts.map +0 -1
  178. package/_types/actions/solana/fund/fund.d.ts +0 -19
  179. package/_types/actions/solana/fund/fund.d.ts.map +0 -1
  180. package/_types/actions/solana/fund/quoteFund.d.ts +0 -20
  181. package/_types/actions/solana/fund/quoteFund.d.ts.map +0 -1
  182. package/_types/actions/types.d.ts +0 -37
  183. package/_types/actions/types.d.ts.map +0 -1
  184. package/_types/actions/waitForFundOperationReceipt.d.ts +0 -68
  185. package/_types/actions/waitForFundOperationReceipt.d.ts.map +0 -1
  186. package/_types/openapi-client/generated/payments-alpha/payments-alpha.d.ts +0 -42
  187. package/_types/openapi-client/generated/payments-alpha/payments-alpha.d.ts.map +0 -1
  188. package/actions/Quote.ts +0 -154
  189. package/actions/evm/fund/fund.ts +0 -73
  190. package/actions/evm/fund/quoteFund.ts +0 -79
  191. package/actions/solana/fund/fund.ts +0 -71
  192. package/actions/solana/fund/quoteFund.ts +0 -77
  193. package/actions/types.ts +0 -39
  194. package/actions/waitForFundOperationReceipt.ts +0 -118
  195. package/openapi-client/generated/payments-alpha/payments-alpha.ts +0 -96
@@ -104,6 +104,11 @@ export interface EndUser {
104
104
  solanaAccounts: string[];
105
105
  }
106
106
 
107
+ export interface ListResponse {
108
+ /** The token for the next page of items, if any. */
109
+ nextPageToken?: string;
110
+ }
111
+
107
112
  /**
108
113
  * The code that indicates the type of error that occurred. These error codes can be used to determine how to handle the error.
109
114
  */
@@ -177,11 +182,6 @@ Account names are guaranteed to be unique across all EVM accounts in the develop
177
182
  updatedAt?: string;
178
183
  }
179
184
 
180
- export interface ListResponse {
181
- /** The token for the next page of items, if any. */
182
- nextPageToken?: string;
183
- }
184
-
185
185
  /**
186
186
  * The domain of the EIP-712 typed data.
187
187
  */
@@ -286,6 +286,8 @@ export interface EvmCall {
286
286
  * @pattern ^0x[0-9a-fA-F]*$
287
287
  */
288
288
  data: string;
289
+ /** The override gas limit to use for the call instead of the bundler's estimated gas limit. */
290
+ overrideGasLimit?: string;
289
291
  }
290
292
 
291
293
  /**
@@ -2309,7 +2311,7 @@ export interface OnchainDataQuery {
2309
2311
  /**
2310
2312
  * SQL query to execute against the indexed blockchain data.
2311
2313
  * @minLength 1
2312
- * @maxLength 10000
2314
+ * @maxLength 50000
2313
2315
  */
2314
2316
  sql: string;
2315
2317
  }
@@ -2715,236 +2717,6 @@ export interface X402SupportedPaymentKind {
2715
2717
  extra?: X402SupportedPaymentKindExtra;
2716
2718
  }
2717
2719
 
2718
- /**
2719
- * The action of the payment method.
2720
- */
2721
- export type PaymentRailAction = (typeof PaymentRailAction)[keyof typeof PaymentRailAction];
2722
-
2723
- // eslint-disable-next-line @typescript-eslint/no-redeclare
2724
- export const PaymentRailAction = {
2725
- source: "source",
2726
- target: "target",
2727
- } as const;
2728
-
2729
- /**
2730
- * The type of payment method.
2731
- */
2732
- export type PaymentMethodType = (typeof PaymentMethodType)[keyof typeof PaymentMethodType];
2733
-
2734
- // eslint-disable-next-line @typescript-eslint/no-redeclare
2735
- export const PaymentMethodType = {
2736
- card: "card",
2737
- fiat_account: "fiat_account",
2738
- } as const;
2739
-
2740
- /**
2741
- * The limit for this payment method being used as a source for transfers.
2742
- */
2743
- export type PaymentMethodLimitsSourceLimit = {
2744
- /** The amount of the limit. */
2745
- amount?: string;
2746
- /** The currency of the limit. */
2747
- currency?: string;
2748
- };
2749
-
2750
- /**
2751
- * The limit for this payment method being used as a target for transfers.
2752
- */
2753
- export type PaymentMethodLimitsTargetLimit = {
2754
- /** The amount of the limit. */
2755
- amount?: string;
2756
- /** The currency of the limit. */
2757
- currency?: string;
2758
- };
2759
-
2760
- /**
2761
- * The limits of the payment method.
2762
- */
2763
- export type PaymentMethodLimits = {
2764
- /** The limit for this payment method being used as a source for transfers. */
2765
- sourceLimit?: PaymentMethodLimitsSourceLimit;
2766
- /** The limit for this payment method being used as a target for transfers. */
2767
- targetLimit?: PaymentMethodLimitsTargetLimit;
2768
- };
2769
-
2770
- /**
2771
- * The fiat payment method object.
2772
- */
2773
- export interface PaymentMethod {
2774
- /**
2775
- * The ID of the payment method which previously was added.
2776
- * @pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
2777
- */
2778
- id: string;
2779
- /** The type of payment method. */
2780
- type: PaymentMethodType;
2781
- /** The currency of the payment method. */
2782
- currency: string;
2783
- /** The actions for the payment method. */
2784
- actions: PaymentRailAction[];
2785
- /** The limits of the payment method. */
2786
- limits?: PaymentMethodLimits;
2787
- }
2788
-
2789
- /**
2790
- * The networks of the asset.
2791
- */
2792
- export type CryptoRailNetworksItem = {
2793
- /** The name of the network. */
2794
- name?: string;
2795
- /** The chain ID of the network. */
2796
- chainId?: number;
2797
- /** The contract address of the asset on the network. */
2798
- contractAddress?: string;
2799
- };
2800
-
2801
- /**
2802
- * The crypto rails available.
2803
- */
2804
- export interface CryptoRail {
2805
- /** The currency symbol of the asset. */
2806
- currency: string;
2807
- /** The name of the asset. */
2808
- name: string;
2809
- /** All available networks of the asset. */
2810
- networks: CryptoRailNetworksItem[];
2811
- /** The actions for the crypto rail. */
2812
- actions: PaymentRailAction[];
2813
- }
2814
-
2815
- /**
2816
- * The fiat payment method request object.
2817
- */
2818
- export interface PaymentMethodRequest {
2819
- /**
2820
- * The ID of the payment method.
2821
- * @pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
2822
- */
2823
- id: string;
2824
- }
2825
-
2826
- /**
2827
- * The source of the transfer.
2828
- */
2829
- export type TransferSource = PaymentMethodRequest;
2830
-
2831
- /**
2832
- * The crypto rail input object which specifies the symbol, network, and address which is the source or destination wallet address.
2833
- */
2834
- export interface CryptoRailAddress {
2835
- /** The symbol of the currency of the payment rail. */
2836
- currency: string;
2837
- /** The network of the payment rail. */
2838
- network: string;
2839
- /** The address of the payment rail. This is the source or destination wallet address. It is not a contract address. */
2840
- address: string;
2841
- }
2842
-
2843
- /**
2844
- * The target of the transfer.
2845
- */
2846
- export type TransferTarget = CryptoRailAddress;
2847
-
2848
- /**
2849
- * The type of fee.
2850
- */
2851
- export type FeeType = (typeof FeeType)[keyof typeof FeeType];
2852
-
2853
- // eslint-disable-next-line @typescript-eslint/no-redeclare
2854
- export const FeeType = {
2855
- exchange_fee: "exchange_fee",
2856
- network_fee: "network_fee",
2857
- } as const;
2858
-
2859
- /**
2860
- * The fee for the transfer.
2861
- */
2862
- export interface Fee {
2863
- /** The type of fee. */
2864
- type: FeeType;
2865
- /** The amount of the fee. */
2866
- amount: string;
2867
- /** The currency of the fee. */
2868
- currency: string;
2869
- /** The description of the fee. */
2870
- description?: string;
2871
- }
2872
-
2873
- /**
2874
- * The type of the source of the transfer.
2875
- */
2876
- export type TransferSourceType = (typeof TransferSourceType)[keyof typeof TransferSourceType];
2877
-
2878
- // eslint-disable-next-line @typescript-eslint/no-redeclare
2879
- export const TransferSourceType = {
2880
- payment_method: "payment_method",
2881
- } as const;
2882
-
2883
- /**
2884
- * The type of the target of the transfer.
2885
- */
2886
- export type TransferTargetType = (typeof TransferTargetType)[keyof typeof TransferTargetType];
2887
-
2888
- // eslint-disable-next-line @typescript-eslint/no-redeclare
2889
- export const TransferTargetType = {
2890
- crypto_rail: "crypto_rail",
2891
- } as const;
2892
-
2893
- /**
2894
- * The status of the transfer.
2895
- */
2896
- export type TransferStatus = (typeof TransferStatus)[keyof typeof TransferStatus];
2897
-
2898
- // eslint-disable-next-line @typescript-eslint/no-redeclare
2899
- export const TransferStatus = {
2900
- created: "created",
2901
- pending: "pending",
2902
- started: "started",
2903
- completed: "completed",
2904
- failed: "failed",
2905
- } as const;
2906
-
2907
- /**
2908
- * The transfer object.
2909
- */
2910
- export interface Transfer {
2911
- /**
2912
- * The ID of the transfer.
2913
- * @pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
2914
- */
2915
- id: string;
2916
- /** The type of the source of the transfer. */
2917
- sourceType: TransferSourceType;
2918
- /** The source of the transfer. */
2919
- source: PaymentMethodRequest;
2920
- /** The type of the target of the transfer. */
2921
- targetType: TransferTargetType;
2922
- /** The target of the transfer. */
2923
- target: CryptoRailAddress;
2924
- /** The amount the source will transfer. */
2925
- sourceAmount: string;
2926
- /** The currency the source will transfer. */
2927
- sourceCurrency: string;
2928
- /** The amount the target will receive. */
2929
- targetAmount: string;
2930
- /** The currency the target will receive. */
2931
- targetCurrency: string;
2932
- /** The amount the customer put in to transfer. */
2933
- userAmount: string;
2934
- /** The currency the customer put in to transfer. */
2935
- userCurrency: string;
2936
- /** The fees for the transfer. */
2937
- fees: Fee[];
2938
- /** The status of the transfer. */
2939
- status: TransferStatus;
2940
- /** The UTC date and time in ISO 8601 format the transfer was created. */
2941
- createdAt: string;
2942
- /** The UTC date and time in ISO 8601 format the transfer was updated. */
2943
- updatedAt: string;
2944
- /** The transaction hash or transaction signature of the transfer. */
2945
- transactionHash?: string;
2946
- }
2947
-
2948
2720
  /**
2949
2721
  * The type of payment method to be used to complete an onramp order.
2950
2722
  */
@@ -3025,6 +2797,8 @@ export interface OnrampOrder {
3025
2797
  createdAt: string;
3026
2798
  /** The date and time the order was last updated. */
3027
2799
  updatedAt: string;
2800
+ /** The partner user reference ID. */
2801
+ partnerUserRef?: string;
3028
2802
  }
3029
2803
 
3030
2804
  /**
@@ -3095,6 +2869,11 @@ export interface OnrampQuote {
3095
2869
  exchangeRate: string;
3096
2870
  }
3097
2871
 
2872
+ /**
2873
+ * Unauthorized.
2874
+ */
2875
+ export type UnauthorizedErrorResponse = Error;
2876
+
3098
2877
  /**
3099
2878
  * Internal server error.
3100
2879
  */
@@ -3130,11 +2909,6 @@ export type AlreadyExistsErrorResponse = Error;
3130
2909
  */
3131
2910
  export type InvalidSQLQueryErrorResponse = Error;
3132
2911
 
3133
- /**
3134
- * Unauthorized.
3135
- */
3136
- export type UnauthorizedErrorResponse = Error;
3137
-
3138
2912
  /**
3139
2913
  * The request timed out.
3140
2914
  */
@@ -3205,6 +2979,36 @@ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/i
3205
2979
  */
3206
2980
  export type IdempotencyKeyParameter = string;
3207
2981
 
2982
+ export type ListEndUsersParams = {
2983
+ /**
2984
+ * The number of end users to return per page.
2985
+ */
2986
+ pageSize?: number;
2987
+ /**
2988
+ * The token for the desired page of end users. Will be empty if there are no more end users to fetch.
2989
+ */
2990
+ pageToken?: string;
2991
+ /**
2992
+ * Sort end users. Defaults to ascending order (oldest first).
2993
+ */
2994
+ sort?: ListEndUsersSortItem[];
2995
+ };
2996
+
2997
+ export type ListEndUsersSortItem = (typeof ListEndUsersSortItem)[keyof typeof ListEndUsersSortItem];
2998
+
2999
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
3000
+ export const ListEndUsersSortItem = {
3001
+ "createdAt=asc": "createdAt=asc",
3002
+ "createdAt=desc": "createdAt=desc",
3003
+ } as const;
3004
+
3005
+ export type ListEndUsers200AllOf = {
3006
+ /** The list of end users. */
3007
+ endUsers: EndUser[];
3008
+ };
3009
+
3010
+ export type ListEndUsers200 = ListEndUsers200AllOf & ListResponse;
3011
+
3208
3012
  /**
3209
3013
  * The request body for a developer to verify an end user's access token.
3210
3014
  */
@@ -3411,6 +3215,14 @@ export type PrepareUserOperationBody = {
3411
3215
  paymasterUrl?: string;
3412
3216
  };
3413
3217
 
3218
+ export type PrepareAndSendUserOperationBody = {
3219
+ network: EvmUserOperationNetwork;
3220
+ /** The list of calls to make from the Smart Account. */
3221
+ calls: EvmCall[];
3222
+ /** The URL of the paymaster to use for the user operation. */
3223
+ paymasterUrl?: string;
3224
+ };
3225
+
3414
3226
  export type SendUserOperationBody = {
3415
3227
  /** The hex-encoded signature of the user operation. This should be a 65-byte signature consisting of the `r`, `s`, and `v` values of the ECDSA signature. Note that the `v` value should conform to the `personal_sign` standard, which means it should be 27 or 28. */
3416
3228
  signature: string;
@@ -3812,54 +3624,6 @@ export type SettleX402PaymentBody = {
3812
3624
  paymentRequirements: X402PaymentRequirements;
3813
3625
  };
3814
3626
 
3815
- export type GetCryptoRailsParams = {
3816
- /**
3817
- * Comma separated list of networks to filter the rails by.
3818
- */
3819
- networks?: string;
3820
- };
3821
-
3822
- /**
3823
- * The type of the source of the transfer.
3824
- */
3825
- export type CreatePaymentTransferQuoteBodySourceType =
3826
- (typeof CreatePaymentTransferQuoteBodySourceType)[keyof typeof CreatePaymentTransferQuoteBodySourceType];
3827
-
3828
- // eslint-disable-next-line @typescript-eslint/no-redeclare
3829
- export const CreatePaymentTransferQuoteBodySourceType = {
3830
- payment_method: "payment_method",
3831
- } as const;
3832
-
3833
- /**
3834
- * The type of the target of the transfer.
3835
- */
3836
- export type CreatePaymentTransferQuoteBodyTargetType =
3837
- (typeof CreatePaymentTransferQuoteBodyTargetType)[keyof typeof CreatePaymentTransferQuoteBodyTargetType];
3838
-
3839
- // eslint-disable-next-line @typescript-eslint/no-redeclare
3840
- export const CreatePaymentTransferQuoteBodyTargetType = {
3841
- crypto_rail: "crypto_rail",
3842
- } as const;
3843
-
3844
- export type CreatePaymentTransferQuoteBody = {
3845
- /** The type of the source of the transfer. */
3846
- sourceType: CreatePaymentTransferQuoteBodySourceType;
3847
- source: TransferSource;
3848
- /** The type of the target of the transfer. */
3849
- targetType: CreatePaymentTransferQuoteBodyTargetType;
3850
- target: TransferTarget;
3851
- /** The amount of the transfer, which is either for the source currency to buy, or the target currency to receive. */
3852
- amount: string;
3853
- /** The currency of the transfer. This can be specified as the source currency, which would be used to buy, or else the target currency, which is how much will be received. */
3854
- currency: string;
3855
- /** Whether to execute the transfer. If true, the transfer will be committed and executed. If false, the quote will be generated and returned. */
3856
- execute?: boolean;
3857
- };
3858
-
3859
- export type CreatePaymentTransferQuote201 = {
3860
- transfer: Transfer;
3861
- };
3862
-
3863
3627
  export type CreateOnrampOrderBody = {
3864
3628
  /** The timestamp of when the user acknowledged that by using Coinbase Onramp they are accepting the Coinbase Terms (https://www.coinbase.com/legal/guest-checkout/us), User Agreement (https://www.coinbase.com/legal/user_agreement), and Privacy Policy (https://www.coinbase.com/legal/privacy). */
3865
3629
  agreementAcceptedAt: string;
@@ -7,6 +7,8 @@
7
7
  */
8
8
  import type {
9
9
  EndUser,
10
+ ListEndUsers200,
11
+ ListEndUsersParams,
10
12
  ValidateEndUserAccessTokenBody,
11
13
  } from "../coinbaseDeveloperPlatformAPIs.schemas.js";
12
14
 
@@ -14,6 +16,17 @@ import { cdpApiClient } from "../../cdpApiClient.js";
14
16
 
15
17
  type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
16
18
 
19
+ /**
20
+ * Lists the end users belonging to the developer's CDP Project.
21
+ By default, the response is sorted by creation date in ascending order and paginated to 20 users per page.
22
+ * @summary List end users
23
+ */
24
+ export const listEndUsers = (
25
+ params?: ListEndUsersParams,
26
+ options?: SecondParameter<typeof cdpApiClient>,
27
+ ) => {
28
+ return cdpApiClient<ListEndUsers200>({ url: `/v2/end-users`, method: "GET", params }, options);
29
+ };
17
30
  /**
18
31
  * Validates the end user's access token and returns the end user's information. Returns an error if the access token is invalid or expired.
19
32
 
@@ -34,6 +47,7 @@ export const validateEndUserAccessToken = (
34
47
  options,
35
48
  );
36
49
  };
50
+ export type ListEndUsersResult = NonNullable<Awaited<ReturnType<typeof listEndUsers>>>;
37
51
  export type ValidateEndUserAccessTokenResult = NonNullable<
38
52
  Awaited<ReturnType<typeof validateEndUserAccessToken>>
39
53
  >;
@@ -14,6 +14,7 @@ import type {
14
14
  ListEvmSmartAccountsParams,
15
15
  ListSpendPermissions200,
16
16
  ListSpendPermissionsParams,
17
+ PrepareAndSendUserOperationBody,
17
18
  PrepareUserOperationBody,
18
19
  RevokeSpendPermissionRequest,
19
20
  SendUserOperationBody,
@@ -120,6 +121,25 @@ export const prepareUserOperation = (
120
121
  options,
121
122
  );
122
123
  };
124
+ /**
125
+ * Prepares, signs, and sends a user operation for an EVM Smart Account. This API can be used only if the owner on Smart Account is a CDP EVM Account.
126
+ * @summary Prepare and send a user operation for EVM Smart Account
127
+ */
128
+ export const prepareAndSendUserOperation = (
129
+ address: string,
130
+ prepareAndSendUserOperationBody: PrepareAndSendUserOperationBody,
131
+ options?: SecondParameter<typeof cdpApiClient>,
132
+ ) => {
133
+ return cdpApiClient<EvmUserOperation>(
134
+ {
135
+ url: `/v2/evm/smart-accounts/${address}/user-operations/prepare-and-send`,
136
+ method: "POST",
137
+ headers: { "Content-Type": "application/json" },
138
+ data: prepareAndSendUserOperationBody,
139
+ },
140
+ options,
141
+ );
142
+ };
123
143
  /**
124
144
  * Gets a user operation by its hash.
125
145
  * @summary Get a user operation
@@ -225,6 +245,9 @@ export type UpdateEvmSmartAccountResult = NonNullable<
225
245
  export type PrepareUserOperationResult = NonNullable<
226
246
  Awaited<ReturnType<typeof prepareUserOperation>>
227
247
  >;
248
+ export type PrepareAndSendUserOperationResult = NonNullable<
249
+ Awaited<ReturnType<typeof prepareAndSendUserOperation>>
250
+ >;
228
251
  export type GetUserOperationResult = NonNullable<Awaited<ReturnType<typeof getUserOperation>>>;
229
252
  export type SendUserOperationResult = NonNullable<Awaited<ReturnType<typeof sendUserOperation>>>;
230
253
  export type CreateSpendPermissionResult = NonNullable<
@@ -57,4 +57,17 @@ export const runSQLQuery = (
57
57
  options,
58
58
  );
59
59
  };
60
+ /**
61
+ * Retrieve the SQL grammar for the SQL API.
62
+
63
+ The SQL queries that are supported by the SQL API are defined via an ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL API.
64
+
65
+ This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar as well.
66
+
67
+ * @summary Get SQL grammar
68
+ */
69
+ export const getSQLGrammar = (options?: SecondParameter<typeof cdpApiClient>) => {
70
+ return cdpApiClient<string>({ url: `/v2/data/query/grammar`, method: "GET" }, options);
71
+ };
60
72
  export type RunSQLQueryResult = NonNullable<Awaited<ReturnType<typeof runSQLQuery>>>;
73
+ export type GetSQLGrammarResult = NonNullable<Awaited<ReturnType<typeof getSQLGrammar>>>;
@@ -7,7 +7,6 @@ export * from "./generated/solana-accounts/solana-accounts.js";
7
7
  export * from "./generated/solana-token-balances/solana-token-balances.js";
8
8
  export * from "./generated/faucets/faucets.js";
9
9
  export * from "./generated/policy-engine/policy-engine.js";
10
- export * from "./generated/payments-alpha/payments-alpha.js";
11
10
  export * from "./generated/onramp/onramp.js";
12
11
  export * from "./generated/onchain-data/onchain-data.js";
13
12
  export * from "./generated/end-user-accounts/end-user-accounts.js";
@@ -22,7 +21,6 @@ import * as evmSwaps from "./generated/evm-swaps/evm-swaps.js";
22
21
  import * as evmTokenBalances from "./generated/evm-token-balances/evm-token-balances.js";
23
22
  import * as faucets from "./generated/faucets/faucets.js";
24
23
  import * as onchainData from "./generated/onchain-data/onchain-data.js";
25
- import * as payments from "./generated/payments-alpha/payments-alpha.js";
26
24
  import * as policies from "./generated/policy-engine/policy-engine.js";
27
25
  import * as solana from "./generated/solana-accounts/solana-accounts.js";
28
26
  import * as solanaTokenBalances from "./generated/solana-token-balances/solana-token-balances.js";
@@ -37,7 +35,6 @@ export const CdpOpenApiClient = {
37
35
  ...faucets,
38
36
  ...onchainData,
39
37
  ...policies,
40
- ...payments,
41
38
  ...endUserAccounts,
42
39
  configure,
43
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-sdk",
3
- "version": "1.38.3",
3
+ "version": "1.38.5",
4
4
  "description": "SDK for interacting with the Coinbase Developer Platform Wallet API",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
@@ -18,7 +18,9 @@
18
18
  }
19
19
  },
20
20
  "dependencies": {
21
- "@solana/spl-token": "^0.4.13",
21
+ "@solana/kit": "^3.0.3",
22
+ "@solana-program/token": "^0.6.0",
23
+ "@solana-program/system": "^0.8.0",
22
24
  "@solana/web3.js": "^1.98.1",
23
25
  "abitype": "1.0.6",
24
26
  "axios": "^1.12.2",
@@ -43,8 +45,5 @@
43
45
  "cdp sdk",
44
46
  "sdk",
45
47
  "api"
46
- ],
47
- "overrides": {
48
- "bigint-buffer": "npm:bigint-buffer-fixed@^1.1.6"
49
- }
48
+ ]
50
49
  }
package/types/calls.ts CHANGED
@@ -11,6 +11,7 @@ export type Call<call = unknown, extraProperties extends Record<string, unknown>
11
11
  data?: Hex | undefined;
12
12
  to: Address;
13
13
  value?: bigint | undefined;
14
+ overrideGasLimit?: string | undefined;
14
15
  })
15
16
  | (extraProperties &
16
17
  (Omit<GetMulticallContractParameters<call, AbiStateMutability>, "address"> & {
package/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "1.38.3";
1
+ export const version = "1.38.5";
@@ -1,106 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SolanaQuote = exports.EvmQuote = void 0;
4
- /**
5
- * Base class representing a funding quote that can be executed.
6
- */
7
- class BaseQuote {
8
- /** Quote for the transfer. */
9
- quoteId;
10
- /** The amount in fiat currency. */
11
- fiatAmount;
12
- /** The fiat currency. */
13
- fiatCurrency;
14
- /** The amount in the token to transfer. */
15
- tokenAmount;
16
- /** The token to transfer. */
17
- token;
18
- /** Fees in the token to transfer. */
19
- fees;
20
- apiClient;
21
- /**
22
- * Creates a new BaseQuote instance.
23
- *
24
- * @param apiClient - The API client.
25
- * @param quoteId - The quote ID.
26
- * @param fiatAmount - The amount in fiat currency.
27
- * @param fiatCurrency - The fiat currency.
28
- * @param tokenAmount - The amount in the token to transfer.
29
- * @param token - The token to transfer.
30
- * @param fees - Fees for the transfer.
31
- */
32
- constructor(apiClient, quoteId, fiatAmount, fiatCurrency, tokenAmount, token, fees) {
33
- this.apiClient = apiClient;
34
- this.quoteId = quoteId;
35
- this.fiatAmount = fiatAmount;
36
- this.fiatCurrency = fiatCurrency;
37
- this.tokenAmount = tokenAmount;
38
- this.token = token;
39
- this.fees = fees;
40
- }
41
- /**
42
- * Executes the quote to perform the actual fund transfer.
43
- *
44
- * @returns A promise that resolves to the result of the executed quote.
45
- */
46
- async execute() {
47
- const transfer = await this.apiClient.executePaymentTransferQuote(this.quoteId);
48
- return {
49
- id: transfer.id,
50
- network: transfer.target.network,
51
- targetAmount: transfer.targetAmount,
52
- targetCurrency: transfer.targetCurrency,
53
- status: transfer.status,
54
- transactionHash: transfer.transactionHash,
55
- };
56
- }
57
- }
58
- /**
59
- * A class representing an EVM funding quote that can be executed.
60
- */
61
- class EvmQuote extends BaseQuote {
62
- /** Network to transfer the funds to (EVM networks). */
63
- network;
64
- /**
65
- * Creates a new EvmQuote instance.
66
- *
67
- * @param apiClient - The API client.
68
- * @param quoteId - The quote ID.
69
- * @param network - The EVM network to transfer funds to.
70
- * @param fiatAmount - The amount in fiat currency.
71
- * @param fiatCurrency - The fiat currency.
72
- * @param tokenAmount - The amount in the token to transfer.
73
- * @param token - The token to transfer.
74
- * @param fees - Fees for the transfer.
75
- */
76
- constructor(apiClient, quoteId, network, fiatAmount, fiatCurrency, tokenAmount, token, fees) {
77
- super(apiClient, quoteId, fiatAmount, fiatCurrency, tokenAmount, token, fees);
78
- this.network = network;
79
- }
80
- }
81
- exports.EvmQuote = EvmQuote;
82
- /**
83
- * A class representing a Solana funding quote that can be executed.
84
- */
85
- class SolanaQuote extends BaseQuote {
86
- /** Network to transfer the funds to (Solana). */
87
- network;
88
- /**
89
- * Creates a new SolanaQuote instance.
90
- *
91
- * @param apiClient - The API client.
92
- * @param quoteId - The quote ID.
93
- * @param network - The Solana network to transfer funds to.
94
- * @param fiatAmount - The amount in fiat currency.
95
- * @param fiatCurrency - The fiat currency.
96
- * @param tokenAmount - The amount in the token to transfer.
97
- * @param token - The token to transfer.
98
- * @param fees - Fees for the transfer.
99
- */
100
- constructor(apiClient, quoteId, network, fiatAmount, fiatCurrency, tokenAmount, token, fees) {
101
- super(apiClient, quoteId, fiatAmount, fiatCurrency, tokenAmount, token, fees);
102
- this.network = network;
103
- }
104
- }
105
- exports.SolanaQuote = SolanaQuote;
106
- //# sourceMappingURL=Quote.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Quote.js","sourceRoot":"","sources":["../../actions/Quote.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAe,SAAS;IACtB,8BAA8B;IACvB,OAAO,CAAS;IACvB,mCAAmC;IAC5B,UAAU,CAAS;IAC1B,yBAAyB;IAClB,YAAY,CAAS;IAC5B,2CAA2C;IACpC,WAAW,CAAS;IAC3B,6BAA6B;IACtB,KAAK,CAAS;IACrB,qCAAqC;IAC9B,IAAI,CAKP;IAEM,SAAS,CAAuB;IAE1C;;;;;;;;;;OAUG;IACH,YACE,SAA+B,EAC/B,OAAe,EACf,UAAkB,EAClB,YAAoB,EACpB,WAAmB,EACnB,KAAa,EACb,IAIG;QAEH,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,OAAO;QACX,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,2BAA2B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEhF,OAAO;YACL,EAAE,EAAE,QAAQ,CAAC,EAAE;YACf,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO;YAChC,YAAY,EAAE,QAAQ,CAAC,YAAY;YACnC,cAAc,EAAE,QAAQ,CAAC,cAAc;YACvC,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,eAAe,EAAE,QAAQ,CAAC,eAAe;SAC1C,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAa,QAAS,SAAQ,SAAS;IACrC,uDAAuD;IAChD,OAAO,CAAsB;IAEpC;;;;;;;;;;;OAWG;IACH,YACE,SAA+B,EAC/B,OAAe,EACf,OAA4B,EAC5B,UAAkB,EAClB,YAAoB,EACpB,WAAmB,EACnB,KAAa,EACb,IAIG;QAEH,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QAC9E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAjCD,4BAiCC;AAED;;GAEG;AACH,MAAa,WAAY,SAAQ,SAAS;IACxC,iDAAiD;IAC1C,OAAO,CAAW;IAEzB;;;;;;;;;;;OAWG;IACH,YACE,SAA+B,EAC/B,OAAe,EACf,OAAiB,EACjB,UAAkB,EAClB,YAAoB,EACpB,WAAmB,EACnB,KAAa,EACb,IAIG;QAEH,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QAC9E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAjCD,kCAiCC"}