@coinbase/cdp-sdk 1.44.1 → 1.45.0

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 (125) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +117 -0
  3. package/_cjs/accounts/evm/toEvmDelegatedAccount.js +27 -0
  4. package/_cjs/accounts/evm/toEvmDelegatedAccount.js.map +1 -0
  5. package/_cjs/accounts/evm/toEvmServerAccount.js +127 -55
  6. package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
  7. package/_cjs/accounts/evm/toEvmSmartAccount.js +111 -45
  8. package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
  9. package/_cjs/accounts/solana/toSolanaAccount.js +49 -19
  10. package/_cjs/accounts/solana/toSolanaAccount.js.map +1 -1
  11. package/_cjs/actions/evm/waitForEvmEip7702DelegationStatus.js +37 -0
  12. package/_cjs/actions/evm/waitForEvmEip7702DelegationStatus.js.map +1 -0
  13. package/_cjs/analytics.js +10 -228
  14. package/_cjs/analytics.js.map +1 -1
  15. package/_cjs/client/cdp.js +0 -6
  16. package/_cjs/client/cdp.js.map +1 -1
  17. package/_cjs/client/evm/evm.js +482 -227
  18. package/_cjs/client/evm/evm.js.map +1 -1
  19. package/_cjs/client/policies/policies.js +41 -11
  20. package/_cjs/client/policies/policies.js.map +1 -1
  21. package/_cjs/client/solana/solana.js +177 -106
  22. package/_cjs/client/solana/solana.js.map +1 -1
  23. package/_cjs/index.js +3 -1
  24. package/_cjs/index.js.map +1 -1
  25. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +137 -5
  26. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  27. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.js +30 -1
  28. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.js.map +1 -1
  29. package/_cjs/openapi-client/generated/onramp/onramp.js +15 -1
  30. package/_cjs/openapi-client/generated/onramp/onramp.js.map +1 -1
  31. package/_cjs/policies/evmSchema.js +127 -1
  32. package/_cjs/policies/evmSchema.js.map +1 -1
  33. package/_cjs/policies/solanaSchema.js +102 -1
  34. package/_cjs/policies/solanaSchema.js.map +1 -1
  35. package/_cjs/policies/types.js +7 -0
  36. package/_cjs/policies/types.js.map +1 -1
  37. package/_cjs/version.js +1 -1
  38. package/_esm/accounts/evm/toEvmDelegatedAccount.js +24 -0
  39. package/_esm/accounts/evm/toEvmDelegatedAccount.js.map +1 -0
  40. package/_esm/accounts/evm/toEvmServerAccount.js +127 -55
  41. package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
  42. package/_esm/accounts/evm/toEvmSmartAccount.js +111 -45
  43. package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
  44. package/_esm/accounts/solana/toSolanaAccount.js +49 -19
  45. package/_esm/accounts/solana/toSolanaAccount.js.map +1 -1
  46. package/_esm/actions/evm/waitForEvmEip7702DelegationStatus.js +34 -0
  47. package/_esm/actions/evm/waitForEvmEip7702DelegationStatus.js.map +1 -0
  48. package/_esm/analytics.js +9 -227
  49. package/_esm/analytics.js.map +1 -1
  50. package/_esm/client/cdp.js +0 -6
  51. package/_esm/client/cdp.js.map +1 -1
  52. package/_esm/client/evm/evm.js +482 -227
  53. package/_esm/client/evm/evm.js.map +1 -1
  54. package/_esm/client/policies/policies.js +41 -11
  55. package/_esm/client/policies/policies.js.map +1 -1
  56. package/_esm/client/solana/solana.js +177 -106
  57. package/_esm/client/solana/solana.js.map +1 -1
  58. package/_esm/index.js +1 -0
  59. package/_esm/index.js.map +1 -1
  60. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +134 -3
  61. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  62. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.js +27 -0
  63. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.js.map +1 -1
  64. package/_esm/openapi-client/generated/onramp/onramp.js +13 -0
  65. package/_esm/openapi-client/generated/onramp/onramp.js.map +1 -1
  66. package/_esm/policies/evmSchema.js +126 -0
  67. package/_esm/policies/evmSchema.js.map +1 -1
  68. package/_esm/policies/solanaSchema.js +101 -0
  69. package/_esm/policies/solanaSchema.js.map +1 -1
  70. package/_esm/policies/types.js +9 -2
  71. package/_esm/policies/types.js.map +1 -1
  72. package/_esm/version.js +1 -1
  73. package/_types/accounts/evm/toEvmDelegatedAccount.d.ts +13 -0
  74. package/_types/accounts/evm/toEvmDelegatedAccount.d.ts.map +1 -0
  75. package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
  76. package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
  77. package/_types/accounts/solana/toSolanaAccount.d.ts.map +1 -1
  78. package/_types/actions/evm/waitForEvmEip7702DelegationStatus.d.ts +32 -0
  79. package/_types/actions/evm/waitForEvmEip7702DelegationStatus.d.ts.map +1 -0
  80. package/_types/analytics.d.ts +5 -38
  81. package/_types/analytics.d.ts.map +1 -1
  82. package/_types/client/cdp.d.ts.map +1 -1
  83. package/_types/client/evm/evm.d.ts +54 -1
  84. package/_types/client/evm/evm.d.ts.map +1 -1
  85. package/_types/client/evm/evm.types.d.ts +29 -2
  86. package/_types/client/evm/evm.types.d.ts.map +1 -1
  87. package/_types/client/policies/policies.d.ts.map +1 -1
  88. package/_types/client/solana/solana.d.ts.map +1 -1
  89. package/_types/index.d.ts +2 -0
  90. package/_types/index.d.ts.map +1 -1
  91. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +436 -10
  92. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  93. package/_types/openapi-client/generated/evm-accounts/evm-accounts.d.ts +21 -1
  94. package/_types/openapi-client/generated/evm-accounts/evm-accounts.d.ts.map +1 -1
  95. package/_types/openapi-client/generated/onramp/onramp.d.ts +8 -1
  96. package/_types/openapi-client/generated/onramp/onramp.d.ts.map +1 -1
  97. package/_types/openapi-client/index.d.ts +4 -0
  98. package/_types/openapi-client/index.d.ts.map +1 -1
  99. package/_types/policies/evmSchema.d.ts +2717 -601
  100. package/_types/policies/evmSchema.d.ts.map +1 -1
  101. package/_types/policies/solanaSchema.d.ts +1411 -47
  102. package/_types/policies/solanaSchema.d.ts.map +1 -1
  103. package/_types/policies/types.d.ts +8427 -2942
  104. package/_types/policies/types.d.ts.map +1 -1
  105. package/_types/version.d.ts +1 -1
  106. package/accounts/evm/toEvmDelegatedAccount.ts +26 -0
  107. package/accounts/evm/toEvmServerAccount.ts +115 -67
  108. package/accounts/evm/toEvmSmartAccount.ts +100 -56
  109. package/accounts/solana/toSolanaAccount.ts +44 -24
  110. package/actions/evm/waitForEvmEip7702DelegationStatus.ts +57 -0
  111. package/analytics.ts +8 -294
  112. package/client/cdp.ts +0 -7
  113. package/client/evm/evm.ts +517 -282
  114. package/client/evm/evm.types.ts +41 -0
  115. package/client/policies/policies.ts +41 -16
  116. package/client/solana/solana.ts +195 -141
  117. package/index.ts +5 -0
  118. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +580 -11
  119. package/openapi-client/generated/evm-accounts/evm-accounts.ts +49 -0
  120. package/openapi-client/generated/onramp/onramp.ts +24 -0
  121. package/package.json +1 -1
  122. package/policies/evmSchema.ts +164 -0
  123. package/policies/solanaSchema.ts +130 -0
  124. package/policies/types.ts +14 -0
  125. package/version.ts +1 -1
@@ -83,6 +83,7 @@ export const OAuth2ProviderType = {
83
83
  google: "google",
84
84
  apple: "apple",
85
85
  x: "x",
86
+ telegram: "telegram",
86
87
  } as const;
87
88
 
88
89
  /**
@@ -100,6 +101,25 @@ export interface OAuth2Authentication {
100
101
  username?: string;
101
102
  }
102
103
 
104
+ /**
105
+ * Information about an end user who authenticates using Telegram.
106
+ */
107
+ export interface TelegramAuthentication {
108
+ type: OAuth2ProviderType;
109
+ /** The Telegram ID for the end user. */
110
+ id: number;
111
+ /** The Telegram user's first name. */
112
+ firstName?: string;
113
+ /** The Telegram user's last name. */
114
+ lastName?: string;
115
+ /** The Telegram user's profile picture. */
116
+ photoUrl?: string;
117
+ /** The Telegram user's last login as a Unix timestamp. */
118
+ authDate: number;
119
+ /** The Telegram user's username. */
120
+ username?: string;
121
+ }
122
+
103
123
  /**
104
124
  * Information about how the end user is authenticated.
105
125
  */
@@ -107,7 +127,8 @@ export type AuthenticationMethod =
107
127
  | EmailAuthentication
108
128
  | SmsAuthentication
109
129
  | DeveloperJWTAuthentication
110
- | OAuth2Authentication;
130
+ | OAuth2Authentication
131
+ | TelegramAuthentication;
111
132
 
112
133
  /**
113
134
  * The list of valid authentication methods linked to the end user.
@@ -234,6 +255,7 @@ export type ErrorType = (typeof ErrorType)[keyof typeof ErrorType];
234
255
  export const ErrorType = {
235
256
  already_exists: "already_exists",
236
257
  bad_gateway: "bad_gateway",
258
+ client_closed_request: "client_closed_request",
237
259
  faucet_limit_exceeded: "faucet_limit_exceeded",
238
260
  forbidden: "forbidden",
239
261
  idempotency_error: "idempotency_error",
@@ -244,6 +266,8 @@ export const ErrorType = {
244
266
  malformed_transaction: "malformed_transaction",
245
267
  not_found: "not_found",
246
268
  payment_method_required: "payment_method_required",
269
+ payment_required: "payment_required",
270
+ settlement_failed: "settlement_failed",
247
271
  rate_limit_exceeded: "rate_limit_exceeded",
248
272
  request_canceled: "request_canceled",
249
273
  service_unavailable: "service_unavailable",
@@ -262,14 +286,31 @@ export const ErrorType = {
262
286
  recipient_allowlist_violation: "recipient_allowlist_violation",
263
287
  recipient_allowlist_pending: "recipient_allowlist_pending",
264
288
  travel_rules_recipient_violation: "travel_rules_recipient_violation",
265
- transfer_amount_out_of_bounds: "transfer_amount_out_of_bounds",
266
- transfer_recipient_address_invalid: "transfer_recipient_address_invalid",
267
- transfer_quote_expired: "transfer_quote_expired",
289
+ source_account_invalid: "source_account_invalid",
290
+ target_account_invalid: "target_account_invalid",
291
+ source_account_not_found: "source_account_not_found",
292
+ target_account_not_found: "target_account_not_found",
293
+ source_asset_not_supported: "source_asset_not_supported",
294
+ target_asset_not_supported: "target_asset_not_supported",
295
+ target_email_invalid: "target_email_invalid",
296
+ target_onchain_address_invalid: "target_onchain_address_invalid",
297
+ transfer_amount_invalid: "transfer_amount_invalid",
298
+ transfer_asset_not_supported: "transfer_asset_not_supported",
299
+ insufficient_balance: "insufficient_balance",
300
+ metadata_too_many_entries: "metadata_too_many_entries",
301
+ metadata_key_too_long: "metadata_key_too_long",
302
+ metadata_value_too_long: "metadata_value_too_long",
303
+ travel_rules_field_missing: "travel_rules_field_missing",
304
+ asset_mismatch: "asset_mismatch",
268
305
  mfa_already_enrolled: "mfa_already_enrolled",
269
306
  mfa_invalid_code: "mfa_invalid_code",
270
307
  mfa_flow_expired: "mfa_flow_expired",
271
308
  mfa_required: "mfa_required",
272
309
  mfa_not_enrolled: "mfa_not_enrolled",
310
+ order_quote_expired: "order_quote_expired",
311
+ order_already_filled: "order_already_filled",
312
+ order_already_canceled: "order_already_canceled",
313
+ account_not_ready: "account_not_ready",
273
314
  } as const;
274
315
 
275
316
  /**
@@ -362,6 +403,61 @@ export interface EIP712Message {
362
403
  message: EIP712MessageMessage;
363
404
  }
364
405
 
406
+ /**
407
+ * The network for the EIP-7702 delegation.
408
+ */
409
+ export type EvmEip7702DelegationNetwork =
410
+ (typeof EvmEip7702DelegationNetwork)[keyof typeof EvmEip7702DelegationNetwork];
411
+
412
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
413
+ export const EvmEip7702DelegationNetwork = {
414
+ "base-sepolia": "base-sepolia",
415
+ base: "base",
416
+ arbitrum: "arbitrum",
417
+ optimism: "optimism",
418
+ polygon: "polygon",
419
+ ethereum: "ethereum",
420
+ "ethereum-sepolia": "ethereum-sepolia",
421
+ } as const;
422
+
423
+ /**
424
+ * The current status of the delegation operation.
425
+ UNSPECIFIED means the status has not been set. PENDING means the operation has been created but not yet submitted. SUBMITTED means the operation has been submitted to the network. COMPLETED means the operation has completed successfully. FAILED means the operation has failed.
426
+ */
427
+ export type EvmEip7702DelegationOperationStatus =
428
+ (typeof EvmEip7702DelegationOperationStatus)[keyof typeof EvmEip7702DelegationOperationStatus];
429
+
430
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
431
+ export const EvmEip7702DelegationOperationStatus = {
432
+ UNSPECIFIED: "UNSPECIFIED",
433
+ PENDING: "PENDING",
434
+ SUBMITTED: "SUBMITTED",
435
+ COMPLETED: "COMPLETED",
436
+ FAILED: "FAILED",
437
+ } as const;
438
+
439
+ /**
440
+ * The status of an EIP-7702 delegation operation.
441
+ */
442
+ export interface EvmEip7702DelegationOperation {
443
+ /** The unique identifier for the delegation operation. */
444
+ delegationOperationId: string;
445
+ /** The current status of the delegation operation.
446
+ UNSPECIFIED means the status has not been set. PENDING means the operation has been created but not yet submitted. SUBMITTED means the operation has been submitted to the network. COMPLETED means the operation has completed successfully. FAILED means the operation has failed. */
447
+ status: EvmEip7702DelegationOperationStatus;
448
+ /**
449
+ * The hash of the delegation transaction, if available. Present once the transaction has been submitted to the network.
450
+ * @pattern ^0x[0-9a-fA-F]{64}$
451
+ */
452
+ transactionHash?: string;
453
+ network: EvmEip7702DelegationNetwork;
454
+ /**
455
+ * The address the account has delegated to, if any. Only present when the account has an active delegation.
456
+ * @pattern ^0x[0-9a-fA-F]{40}$
457
+ */
458
+ delegateAddress?: string;
459
+ }
460
+
365
461
  export interface EvmSmartAccount {
366
462
  /**
367
463
  * The 0x-prefixed, checksum address of the Smart Account.
@@ -609,6 +705,7 @@ export const EvmSwapsNetwork = {
609
705
  ethereum: "ethereum",
610
706
  arbitrum: "arbitrum",
611
707
  optimism: "optimism",
708
+ polygon: "polygon",
612
709
  } as const;
613
710
 
614
711
  /**
@@ -968,6 +1065,7 @@ export interface EthValueCriterion {
968
1065
  type: EthValueCriterionType;
969
1066
  /**
970
1067
  * The amount of ETH, in wei, that the transaction's `value` field should be compared to.
1068
+ * @maxLength 78
971
1069
  * @pattern ^[0-9]+$
972
1070
  */
973
1071
  ethValue: string;
@@ -2314,6 +2412,294 @@ export interface SendUserOperationRule {
2314
2412
  criteria: SendUserOperationCriteria;
2315
2413
  }
2316
2414
 
2415
+ export type SignEndUserEvmTransactionCriteriaItem =
2416
+ | EthValueCriterion
2417
+ | EvmAddressCriterion
2418
+ | EvmDataCriterion
2419
+ | NetUSDChangeCriterion;
2420
+
2421
+ /**
2422
+ * A schema for specifying criteria for the signEndUserEvmTransaction operation.
2423
+ */
2424
+ export type SignEndUserEvmTransactionCriteria = SignEndUserEvmTransactionCriteriaItem[];
2425
+
2426
+ /**
2427
+ * Whether matching the rule will cause the request to be rejected or accepted.
2428
+ */
2429
+ export type SignEndUserEvmTransactionRuleAction =
2430
+ (typeof SignEndUserEvmTransactionRuleAction)[keyof typeof SignEndUserEvmTransactionRuleAction];
2431
+
2432
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2433
+ export const SignEndUserEvmTransactionRuleAction = {
2434
+ reject: "reject",
2435
+ accept: "accept",
2436
+ } as const;
2437
+
2438
+ /**
2439
+ * The operation to which the rule applies. Every element of the `criteria` array must match the specified operation.
2440
+ */
2441
+ export type SignEndUserEvmTransactionRuleOperation =
2442
+ (typeof SignEndUserEvmTransactionRuleOperation)[keyof typeof SignEndUserEvmTransactionRuleOperation];
2443
+
2444
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2445
+ export const SignEndUserEvmTransactionRuleOperation = {
2446
+ signEndUserEvmTransaction: "signEndUserEvmTransaction",
2447
+ } as const;
2448
+
2449
+ export interface SignEndUserEvmTransactionRule {
2450
+ /** Whether matching the rule will cause the request to be rejected or accepted. */
2451
+ action: SignEndUserEvmTransactionRuleAction;
2452
+ /** The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. */
2453
+ operation: SignEndUserEvmTransactionRuleOperation;
2454
+ criteria: SignEndUserEvmTransactionCriteria;
2455
+ }
2456
+
2457
+ export type SendEndUserEvmTransactionCriteriaItem =
2458
+ | EthValueCriterion
2459
+ | EvmAddressCriterion
2460
+ | EvmNetworkCriterion
2461
+ | EvmDataCriterion
2462
+ | NetUSDChangeCriterion;
2463
+
2464
+ /**
2465
+ * A schema for specifying criteria for the sendEndUserEvmTransaction operation.
2466
+ */
2467
+ export type SendEndUserEvmTransactionCriteria = SendEndUserEvmTransactionCriteriaItem[];
2468
+
2469
+ /**
2470
+ * Whether matching the rule will cause the request to be rejected or accepted.
2471
+ */
2472
+ export type SendEndUserEvmTransactionRuleAction =
2473
+ (typeof SendEndUserEvmTransactionRuleAction)[keyof typeof SendEndUserEvmTransactionRuleAction];
2474
+
2475
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2476
+ export const SendEndUserEvmTransactionRuleAction = {
2477
+ reject: "reject",
2478
+ accept: "accept",
2479
+ } as const;
2480
+
2481
+ /**
2482
+ * The operation to which the rule applies. Every element of the `criteria` array must match the specified operation.
2483
+ */
2484
+ export type SendEndUserEvmTransactionRuleOperation =
2485
+ (typeof SendEndUserEvmTransactionRuleOperation)[keyof typeof SendEndUserEvmTransactionRuleOperation];
2486
+
2487
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2488
+ export const SendEndUserEvmTransactionRuleOperation = {
2489
+ sendEndUserEvmTransaction: "sendEndUserEvmTransaction",
2490
+ } as const;
2491
+
2492
+ export interface SendEndUserEvmTransactionRule {
2493
+ /** Whether matching the rule will cause the request to be rejected or accepted. */
2494
+ action: SendEndUserEvmTransactionRuleAction;
2495
+ /** The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. */
2496
+ operation: SendEndUserEvmTransactionRuleOperation;
2497
+ criteria: SendEndUserEvmTransactionCriteria;
2498
+ }
2499
+
2500
+ /**
2501
+ * A schema for specifying criteria for the signEndUserEvmMessage operation.
2502
+ */
2503
+ export type SignEndUserEvmMessageCriteria = EvmMessageCriterion[];
2504
+
2505
+ /**
2506
+ * Whether matching the rule will cause the request to be rejected or accepted.
2507
+ */
2508
+ export type SignEndUserEvmMessageRuleAction =
2509
+ (typeof SignEndUserEvmMessageRuleAction)[keyof typeof SignEndUserEvmMessageRuleAction];
2510
+
2511
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2512
+ export const SignEndUserEvmMessageRuleAction = {
2513
+ reject: "reject",
2514
+ accept: "accept",
2515
+ } as const;
2516
+
2517
+ /**
2518
+ * The operation to which the rule applies. Every element of the `criteria` array must match the specified operation.
2519
+ */
2520
+ export type SignEndUserEvmMessageRuleOperation =
2521
+ (typeof SignEndUserEvmMessageRuleOperation)[keyof typeof SignEndUserEvmMessageRuleOperation];
2522
+
2523
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2524
+ export const SignEndUserEvmMessageRuleOperation = {
2525
+ signEndUserEvmMessage: "signEndUserEvmMessage",
2526
+ } as const;
2527
+
2528
+ export interface SignEndUserEvmMessageRule {
2529
+ /** Whether matching the rule will cause the request to be rejected or accepted. */
2530
+ action: SignEndUserEvmMessageRuleAction;
2531
+ /** The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. */
2532
+ operation: SignEndUserEvmMessageRuleOperation;
2533
+ criteria: SignEndUserEvmMessageCriteria;
2534
+ }
2535
+
2536
+ export type SignEndUserEvmTypedDataCriteriaItem =
2537
+ | SignEvmTypedDataFieldCriterion
2538
+ | SignEvmTypedDataVerifyingContractCriterion;
2539
+
2540
+ /**
2541
+ * A schema for specifying criteria for the signEndUserEvmTypedData operation.
2542
+ */
2543
+ export type SignEndUserEvmTypedDataCriteria = SignEndUserEvmTypedDataCriteriaItem[];
2544
+
2545
+ /**
2546
+ * Whether matching the rule will cause the request to be rejected or accepted.
2547
+ */
2548
+ export type SignEndUserEvmTypedDataRuleAction =
2549
+ (typeof SignEndUserEvmTypedDataRuleAction)[keyof typeof SignEndUserEvmTypedDataRuleAction];
2550
+
2551
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2552
+ export const SignEndUserEvmTypedDataRuleAction = {
2553
+ reject: "reject",
2554
+ accept: "accept",
2555
+ } as const;
2556
+
2557
+ /**
2558
+ * The operation to which the rule applies. Every element of the `criteria` array must match the specified operation.
2559
+ */
2560
+ export type SignEndUserEvmTypedDataRuleOperation =
2561
+ (typeof SignEndUserEvmTypedDataRuleOperation)[keyof typeof SignEndUserEvmTypedDataRuleOperation];
2562
+
2563
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2564
+ export const SignEndUserEvmTypedDataRuleOperation = {
2565
+ signEndUserEvmTypedData: "signEndUserEvmTypedData",
2566
+ } as const;
2567
+
2568
+ export interface SignEndUserEvmTypedDataRule {
2569
+ /** Whether matching the rule will cause the request to be rejected or accepted. */
2570
+ action: SignEndUserEvmTypedDataRuleAction;
2571
+ /** The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. */
2572
+ operation: SignEndUserEvmTypedDataRuleOperation;
2573
+ criteria: SignEndUserEvmTypedDataCriteria;
2574
+ }
2575
+
2576
+ export type SignEndUserSolTransactionCriteriaItem =
2577
+ | SolAddressCriterion
2578
+ | SolValueCriterion
2579
+ | SplAddressCriterion
2580
+ | SplValueCriterion
2581
+ | MintAddressCriterion
2582
+ | SolDataCriterion
2583
+ | ProgramIdCriterion;
2584
+
2585
+ /**
2586
+ * A schema for specifying criteria for the signEndUserSolTransaction operation.
2587
+ */
2588
+ export type SignEndUserSolTransactionCriteria = SignEndUserSolTransactionCriteriaItem[];
2589
+
2590
+ /**
2591
+ * Whether matching the rule will cause the request to be rejected or accepted.
2592
+ */
2593
+ export type SignEndUserSolTransactionRuleAction =
2594
+ (typeof SignEndUserSolTransactionRuleAction)[keyof typeof SignEndUserSolTransactionRuleAction];
2595
+
2596
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2597
+ export const SignEndUserSolTransactionRuleAction = {
2598
+ reject: "reject",
2599
+ accept: "accept",
2600
+ } as const;
2601
+
2602
+ /**
2603
+ * The operation to which the rule applies. Every element of the `criteria` array must match the specified operation.
2604
+ */
2605
+ export type SignEndUserSolTransactionRuleOperation =
2606
+ (typeof SignEndUserSolTransactionRuleOperation)[keyof typeof SignEndUserSolTransactionRuleOperation];
2607
+
2608
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2609
+ export const SignEndUserSolTransactionRuleOperation = {
2610
+ signEndUserSolTransaction: "signEndUserSolTransaction",
2611
+ } as const;
2612
+
2613
+ export interface SignEndUserSolTransactionRule {
2614
+ /** Whether matching the rule will cause the request to be rejected or accepted. */
2615
+ action: SignEndUserSolTransactionRuleAction;
2616
+ /** The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. */
2617
+ operation: SignEndUserSolTransactionRuleOperation;
2618
+ criteria: SignEndUserSolTransactionCriteria;
2619
+ }
2620
+
2621
+ export type SendEndUserSolTransactionCriteriaItem =
2622
+ | SolAddressCriterion
2623
+ | SolValueCriterion
2624
+ | SplAddressCriterion
2625
+ | SplValueCriterion
2626
+ | MintAddressCriterion
2627
+ | SolDataCriterion
2628
+ | ProgramIdCriterion
2629
+ | SolNetworkCriterion;
2630
+
2631
+ /**
2632
+ * A schema for specifying criteria for the sendEndUserSolTransaction operation.
2633
+ */
2634
+ export type SendEndUserSolTransactionCriteria = SendEndUserSolTransactionCriteriaItem[];
2635
+
2636
+ /**
2637
+ * Whether matching the rule will cause the request to be rejected or accepted.
2638
+ */
2639
+ export type SendEndUserSolTransactionRuleAction =
2640
+ (typeof SendEndUserSolTransactionRuleAction)[keyof typeof SendEndUserSolTransactionRuleAction];
2641
+
2642
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2643
+ export const SendEndUserSolTransactionRuleAction = {
2644
+ reject: "reject",
2645
+ accept: "accept",
2646
+ } as const;
2647
+
2648
+ /**
2649
+ * The operation to which the rule applies. Every element of the `criteria` array must match the specified operation.
2650
+ */
2651
+ export type SendEndUserSolTransactionRuleOperation =
2652
+ (typeof SendEndUserSolTransactionRuleOperation)[keyof typeof SendEndUserSolTransactionRuleOperation];
2653
+
2654
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2655
+ export const SendEndUserSolTransactionRuleOperation = {
2656
+ sendEndUserSolTransaction: "sendEndUserSolTransaction",
2657
+ } as const;
2658
+
2659
+ export interface SendEndUserSolTransactionRule {
2660
+ /** Whether matching the rule will cause the request to be rejected or accepted. */
2661
+ action: SendEndUserSolTransactionRuleAction;
2662
+ /** The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. */
2663
+ operation: SendEndUserSolTransactionRuleOperation;
2664
+ criteria: SendEndUserSolTransactionCriteria;
2665
+ }
2666
+
2667
+ /**
2668
+ * A schema for specifying criteria for the signEndUserSolMessage operation.
2669
+ */
2670
+ export type SignEndUserSolMessageCriteria = SolMessageCriterion[];
2671
+
2672
+ /**
2673
+ * Whether matching the rule will cause the request to be rejected or accepted.
2674
+ */
2675
+ export type SignEndUserSolMessageRuleAction =
2676
+ (typeof SignEndUserSolMessageRuleAction)[keyof typeof SignEndUserSolMessageRuleAction];
2677
+
2678
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2679
+ export const SignEndUserSolMessageRuleAction = {
2680
+ reject: "reject",
2681
+ accept: "accept",
2682
+ } as const;
2683
+
2684
+ /**
2685
+ * The operation to which the rule applies. Every element of the `criteria` array must match the specified operation.
2686
+ */
2687
+ export type SignEndUserSolMessageRuleOperation =
2688
+ (typeof SignEndUserSolMessageRuleOperation)[keyof typeof SignEndUserSolMessageRuleOperation];
2689
+
2690
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2691
+ export const SignEndUserSolMessageRuleOperation = {
2692
+ signEndUserSolMessage: "signEndUserSolMessage",
2693
+ } as const;
2694
+
2695
+ export interface SignEndUserSolMessageRule {
2696
+ /** Whether matching the rule will cause the request to be rejected or accepted. */
2697
+ action: SignEndUserSolMessageRuleAction;
2698
+ /** The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. */
2699
+ operation: SignEndUserSolMessageRuleOperation;
2700
+ criteria: SignEndUserSolMessageCriteria;
2701
+ }
2702
+
2317
2703
  /**
2318
2704
  * A rule that limits the behavior of an account.
2319
2705
  */
@@ -2327,7 +2713,14 @@ export type Rule =
2327
2713
  | SignSolMessageRule
2328
2714
  | SignEvmHashRule
2329
2715
  | PrepareUserOperationRule
2330
- | SendUserOperationRule;
2716
+ | SendUserOperationRule
2717
+ | SignEndUserEvmTransactionRule
2718
+ | SendEndUserEvmTransactionRule
2719
+ | SignEndUserEvmMessageRule
2720
+ | SignEndUserEvmTypedDataRule
2721
+ | SignEndUserSolTransactionRule
2722
+ | SendEndUserSolTransactionRule
2723
+ | SignEndUserSolMessageRule;
2331
2724
 
2332
2725
  /**
2333
2726
  * The scope of the policy. Only one project-level policy can exist at any time.
@@ -2756,7 +3149,10 @@ export type X402ExactEvmPayloadAuthorization = {
2756
3149
  validAfter: string;
2757
3150
  /** The unix timestamp before which the payment is valid. */
2758
3151
  validBefore: string;
2759
- /** The hex-encoded nonce of the payment. */
3152
+ /**
3153
+ * The hex-encoded nonce of the payment (bytes32).
3154
+ * @pattern ^0x[0-9a-fA-F]{64}$
3155
+ */
2760
3156
  nonce: string;
2761
3157
  };
2762
3158
 
@@ -2764,12 +3160,86 @@ export type X402ExactEvmPayloadAuthorization = {
2764
3160
  * The x402 protocol exact scheme payload for EVM networks. The scheme is implemented using ERC-3009. For more details, please see [EVM Exact Scheme Details](https://github.com/coinbase/x402/blob/main/specs/schemes/exact/scheme_exact_evm.md).
2765
3161
  */
2766
3162
  export interface X402ExactEvmPayload {
2767
- /** The EIP-712 hex-encoded signature of the ERC-3009 authorization message. */
3163
+ /**
3164
+ * The EIP-712 hex-encoded signature of the ERC-3009 authorization message. Smart account signatures may be longer than 65 bytes.
3165
+ * @pattern ^0x[0-9a-fA-F]{130,}$
3166
+ */
2768
3167
  signature: string;
2769
3168
  /** The authorization data for the ERC-3009 authorization message. */
2770
3169
  authorization: X402ExactEvmPayloadAuthorization;
2771
3170
  }
2772
3171
 
3172
+ /**
3173
+ * The token permissions for the transfer.
3174
+ */
3175
+ export type X402ExactEvmPermit2PayloadPermit2AuthorizationPermitted = {
3176
+ /**
3177
+ * The 0x-prefixed, checksum EVM address of the token to transfer.
3178
+ * @pattern ^0x[0-9a-fA-F]{40}$
3179
+ */
3180
+ token: string;
3181
+ /** The amount to transfer in atomic units. */
3182
+ amount: string;
3183
+ };
3184
+
3185
+ /**
3186
+ * The witness data containing payment details.
3187
+ */
3188
+ export type X402ExactEvmPermit2PayloadPermit2AuthorizationWitness = {
3189
+ /**
3190
+ * The 0x-prefixed, checksum EVM address of the recipient.
3191
+ * @pattern ^0x[0-9a-fA-F]{40}$
3192
+ */
3193
+ to: string;
3194
+ /** The unix timestamp after which the payment is valid. */
3195
+ validAfter: string;
3196
+ /**
3197
+ * Optional hex-encoded extra data.
3198
+ * @pattern ^0x[0-9a-fA-F]*$
3199
+ */
3200
+ extra?: string;
3201
+ };
3202
+
3203
+ /**
3204
+ * The authorization data for the Permit2 PermitWitnessTransferFrom message.
3205
+ */
3206
+ export type X402ExactEvmPermit2PayloadPermit2Authorization = {
3207
+ /**
3208
+ * The 0x-prefixed, checksum EVM address of the sender of the payment.
3209
+ * @pattern ^0x[0-9a-fA-F]{40}$
3210
+ */
3211
+ from: string;
3212
+ /** The token permissions for the transfer. */
3213
+ permitted: X402ExactEvmPermit2PayloadPermit2AuthorizationPermitted;
3214
+ /**
3215
+ * The 0x-prefixed, checksum EVM address of the spender (x402 Permit2 proxy contract).
3216
+ * @pattern ^0x[0-9a-fA-F]{40}$
3217
+ */
3218
+ spender: string;
3219
+ /**
3220
+ * The Permit2 nonce as a decimal string (uint256).
3221
+ * @pattern ^[0-9]+$
3222
+ */
3223
+ nonce: string;
3224
+ /** The unix timestamp before which the permit is valid. */
3225
+ deadline: string;
3226
+ /** The witness data containing payment details. */
3227
+ witness: X402ExactEvmPermit2PayloadPermit2AuthorizationWitness;
3228
+ };
3229
+
3230
+ /**
3231
+ * The x402 protocol exact scheme payload for EVM networks using Permit2. Permit2 is a universal token approval mechanism that works with any ERC-20 token, unlike ERC-3009 which requires token-level support.
3232
+ */
3233
+ export interface X402ExactEvmPermit2Payload {
3234
+ /**
3235
+ * The EIP-712 hex-encoded signature of the Permit2 PermitWitnessTransferFrom message. Smart account signatures may be longer than 65 bytes.
3236
+ * @pattern ^0x[0-9a-fA-F]{130,}$
3237
+ */
3238
+ signature: string;
3239
+ /** The authorization data for the Permit2 PermitWitnessTransferFrom message. */
3240
+ permit2Authorization: X402ExactEvmPermit2PayloadPermit2Authorization;
3241
+ }
3242
+
2773
3243
  /**
2774
3244
  * The x402 protocol exact scheme payload for Solana networks. For more details, please see [Solana Exact Scheme Details](https://github.com/coinbase/x402/blob/main/specs/schemes/exact/scheme_exact_svm.md).
2775
3245
  */
@@ -2801,12 +3271,16 @@ export const X402V1PaymentPayloadNetwork = {
2801
3271
  base: "base",
2802
3272
  "solana-devnet": "solana-devnet",
2803
3273
  solana: "solana",
3274
+ polygon: "polygon",
2804
3275
  } as const;
2805
3276
 
2806
3277
  /**
2807
3278
  * The payload of the payment depending on the x402Version, scheme, and network.
2808
3279
  */
2809
- export type X402V1PaymentPayloadPayload = X402ExactEvmPayload | X402ExactSolanaPayload;
3280
+ export type X402V1PaymentPayloadPayload =
3281
+ | X402ExactEvmPayload
3282
+ | X402ExactEvmPermit2Payload
3283
+ | X402ExactSolanaPayload;
2810
3284
 
2811
3285
  /**
2812
3286
  * The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header.
@@ -2886,7 +3360,10 @@ export interface X402ResourceInfo {
2886
3360
  /**
2887
3361
  * The payload of the payment depending on the x402Version, scheme, and network.
2888
3362
  */
2889
- export type X402V2PaymentPayloadPayload = X402ExactEvmPayload | X402ExactSolanaPayload;
3363
+ export type X402V2PaymentPayloadPayload =
3364
+ | X402ExactEvmPayload
3365
+ | X402ExactEvmPermit2Payload
3366
+ | X402ExactSolanaPayload;
2890
3367
 
2891
3368
  /**
2892
3369
  * Optional protocol extensions.
@@ -2908,6 +3385,7 @@ export interface X402V2PaymentPayload {
2908
3385
 
2909
3386
  /**
2910
3387
  * The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header.
3388
+ For EVM networks, smart account signatures can be longer than 65 bytes.
2911
3389
  */
2912
3390
  export type X402PaymentPayload = X402V1PaymentPayload | X402V2PaymentPayload;
2913
3391
 
@@ -2934,6 +3412,7 @@ export const X402V1PaymentRequirementsNetwork = {
2934
3412
  base: "base",
2935
3413
  "solana-devnet": "solana-devnet",
2936
3414
  solana: "solana",
3415
+ polygon: "polygon",
2937
3416
  } as const;
2938
3417
 
2939
3418
  /**
@@ -3022,6 +3501,14 @@ export const X402VerifyInvalidReason = {
3022
3501
  "invalid_exact_evm_payload_authorization_to_address_kyt",
3023
3502
  invalid_exact_evm_payload_signature: "invalid_exact_evm_payload_signature",
3024
3503
  invalid_exact_evm_payload_signature_address: "invalid_exact_evm_payload_signature_address",
3504
+ invalid_exact_evm_permit2_payload_allowance_required:
3505
+ "invalid_exact_evm_permit2_payload_allowance_required",
3506
+ invalid_exact_evm_permit2_payload_signature: "invalid_exact_evm_permit2_payload_signature",
3507
+ invalid_exact_evm_permit2_payload_deadline: "invalid_exact_evm_permit2_payload_deadline",
3508
+ invalid_exact_evm_permit2_payload_valid_after: "invalid_exact_evm_permit2_payload_valid_after",
3509
+ invalid_exact_evm_permit2_payload_spender: "invalid_exact_evm_permit2_payload_spender",
3510
+ invalid_exact_evm_permit2_payload_recipient: "invalid_exact_evm_permit2_payload_recipient",
3511
+ invalid_exact_evm_permit2_payload_amount: "invalid_exact_evm_permit2_payload_amount",
3025
3512
  invalid_exact_svm_payload_transaction: "invalid_exact_svm_payload_transaction",
3026
3513
  invalid_exact_svm_payload_transaction_amount_mismatch:
3027
3514
  "invalid_exact_svm_payload_transaction_amount_mismatch",
@@ -3113,6 +3600,14 @@ export const X402SettleErrorReason = {
3113
3600
  "invalid_exact_evm_payload_authorization_to_address_kyt",
3114
3601
  invalid_exact_evm_payload_signature: "invalid_exact_evm_payload_signature",
3115
3602
  invalid_exact_evm_payload_signature_address: "invalid_exact_evm_payload_signature_address",
3603
+ invalid_exact_evm_permit2_payload_allowance_required:
3604
+ "invalid_exact_evm_permit2_payload_allowance_required",
3605
+ invalid_exact_evm_permit2_payload_signature: "invalid_exact_evm_permit2_payload_signature",
3606
+ invalid_exact_evm_permit2_payload_deadline: "invalid_exact_evm_permit2_payload_deadline",
3607
+ invalid_exact_evm_permit2_payload_valid_after: "invalid_exact_evm_permit2_payload_valid_after",
3608
+ invalid_exact_evm_permit2_payload_spender: "invalid_exact_evm_permit2_payload_spender",
3609
+ invalid_exact_evm_permit2_payload_recipient: "invalid_exact_evm_permit2_payload_recipient",
3610
+ invalid_exact_evm_permit2_payload_amount: "invalid_exact_evm_permit2_payload_amount",
3116
3611
  invalid_exact_svm_payload_transaction: "invalid_exact_svm_payload_transaction",
3117
3612
  invalid_exact_svm_payload_transaction_amount_mismatch:
3118
3613
  "invalid_exact_svm_payload_transaction_amount_mismatch",
@@ -3214,8 +3709,10 @@ export const X402SupportedPaymentKindNetwork = {
3214
3709
  base: "base",
3215
3710
  "solana-devnet": "solana-devnet",
3216
3711
  solana: "solana",
3712
+ polygon: "polygon",
3217
3713
  "eip155:8453": "eip155:8453",
3218
3714
  "eip155:84532": "eip155:84532",
3715
+ "eip155:137": "eip155:137",
3219
3716
  "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
3220
3717
  "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
3221
3718
  } as const;
@@ -3254,6 +3751,7 @@ export type OnrampOrderPaymentMethodTypeId =
3254
3751
  // eslint-disable-next-line @typescript-eslint/no-redeclare
3255
3752
  export const OnrampOrderPaymentMethodTypeId = {
3256
3753
  GUEST_CHECKOUT_APPLE_PAY: "GUEST_CHECKOUT_APPLE_PAY",
3754
+ GUEST_CHECKOUT_GOOGLE_PAY: "GUEST_CHECKOUT_GOOGLE_PAY",
3257
3755
  } as const;
3258
3756
 
3259
3757
  /**
@@ -3405,6 +3903,49 @@ export interface OnrampQuote {
3405
3903
  exchangeRate: string;
3406
3904
  }
3407
3905
 
3906
+ /**
3907
+ * The type of user identifier:
3908
+ - `phone_number`: A phone number in E.164 format associated with an onramp user.
3909
+
3910
+ */
3911
+ export type OnrampUserIdType = (typeof OnrampUserIdType)[keyof typeof OnrampUserIdType];
3912
+
3913
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
3914
+ export const OnrampUserIdType = {
3915
+ phone_number: "phone_number",
3916
+ } as const;
3917
+
3918
+ /**
3919
+ * The type of limit:
3920
+ - `weekly_spending`: Rolling 7-day spending limit. The limit applies to the sum of all completed transactions
3921
+ within a sliding 168-hour (7-day) window. As time passes, older transactions naturally expire from the window.
3922
+ $500 is the default limit.
3923
+ - `lifetime_transactions`: All-time transaction count limit. Tracks the total number of completed transactions
3924
+ across the user's entire history with no time-based expiration. Once the limit is reached, no further
3925
+ transactions are allowed. 15 is the default limit.
3926
+
3927
+ */
3928
+ export type OnrampLimitType = (typeof OnrampLimitType)[keyof typeof OnrampLimitType];
3929
+
3930
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
3931
+ export const OnrampLimitType = {
3932
+ weekly_spending: "weekly_spending",
3933
+ lifetime_transactions: "lifetime_transactions",
3934
+ } as const;
3935
+
3936
+ /**
3937
+ * A single limit with remaining capacity.
3938
+ */
3939
+ export interface OnrampUserLimit {
3940
+ limitType: OnrampLimitType;
3941
+ /** The currency of the limit amounts. Only present for spending limits, not for count-based limits. */
3942
+ currency?: string;
3943
+ /** The maximum limit value. */
3944
+ limit: string;
3945
+ /** The remaining amount or count available. */
3946
+ remaining: string;
3947
+ }
3948
+
3408
3949
  /**
3409
3950
  * Unauthorized.
3410
3951
  */
@@ -3445,6 +3986,11 @@ export type AlreadyExistsErrorResponse = Error;
3445
3986
  */
3446
3987
  export type InvalidSQLQueryErrorResponse = Error;
3447
3988
 
3989
+ /**
3990
+ * The client closed the connection before the server could send a response.
3991
+ */
3992
+ export type ClientClosedRequestErrorResponse = Error;
3993
+
3448
3994
  /**
3449
3995
  * The request timed out.
3450
3996
  */
@@ -3531,8 +4077,8 @@ section of our Authentication docs for more details on how to generate your Wall
3531
4077
  export type XWalletAuthParameter = string;
3532
4078
 
3533
4079
  /**
3534
- * An optional [UUID v4](https://www.uuidgenerator.net/version4) request header for making requests safely retryable.
3535
- When included, duplicate requests with the same key will return identical responses.
4080
+ * An optional string request header for making requests safely retryable.
4081
+ When included, duplicate requests with the same key will return identical responses.
3536
4082
  Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
3537
4083
 
3538
4084
  */
@@ -3778,6 +4324,17 @@ export type SignEvmTypedData200 = {
3778
4324
  signature: string;
3779
4325
  };
3780
4326
 
4327
+ export type CreateEvmEip7702DelegationBody = {
4328
+ network: EvmEip7702DelegationNetwork;
4329
+ /** Whether to configure spend permissions for the upgraded, delegated account. When enabled, the account can grant permissions for third parties to spend on its behalf. */
4330
+ enableSpendPermissions?: boolean;
4331
+ };
4332
+
4333
+ export type CreateEvmEip7702Delegation201 = {
4334
+ /** The unique identifier for the delegation operation. Use this to poll the operation status. */
4335
+ delegationOperationId: string;
4336
+ };
4337
+
3781
4338
  export type ListEvmSmartAccountsParams = {
3782
4339
  /**
3783
4340
  * The number of resources to return per page.
@@ -4375,3 +4932,15 @@ export type CreateOnrampSession201 = {
4375
4932
  session: OnrampSession;
4376
4933
  quote?: OnrampQuote;
4377
4934
  };
4935
+
4936
+ export type GetOnrampUserLimitsBody = {
4937
+ paymentMethodType: OnrampOrderPaymentMethodTypeId;
4938
+ /** The user identifier value. For `phone_number` type, this must be in E.164 format. */
4939
+ userId: string;
4940
+ userIdType: OnrampUserIdType;
4941
+ };
4942
+
4943
+ export type GetOnrampUserLimits200 = {
4944
+ /** The list of limits applicable to the user. */
4945
+ limits: OnrampUserLimit[];
4946
+ };