@coinbase/cdp-sdk 1.44.0 → 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 +20 -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 -229
  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 +139 -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 -228
  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 +136 -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 +482 -187
  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 -304
  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 +624 -190
  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.
@@ -2634,24 +3027,6 @@ service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detec
2634
3027
  /** Unique identifier for the subscription. */
2635
3028
  subscriptionId: string;
2636
3029
  target: WebhookTarget;
2637
- /**
2638
- * (Deprecated) Use `labels` field instead.
2639
-
2640
- Label key for filtering events. Present when subscription uses traditional single-label format.
2641
- Maintained for backward compatibility only.
2642
-
2643
- * @deprecated
2644
- */
2645
- labelKey?: string;
2646
- /**
2647
- * (Deprecated) Use `labels` field instead.
2648
-
2649
- Label value for filtering events. Present when subscription uses traditional single-label format.
2650
- Maintained for backward compatibility only.
2651
-
2652
- * @deprecated
2653
- */
2654
- labelValue?: string;
2655
3030
  /** Multi-label filters using total overlap logic. Total overlap means the subscription only triggers when events contain ALL these key-value pairs.
2656
3031
  Present when subscription uses multi-label format.
2657
3032
  */
@@ -2669,9 +3044,9 @@ export type WebhookSubscriptionListResponseAllOf = {
2669
3044
  export type WebhookSubscriptionListResponse = WebhookSubscriptionListResponseAllOf & ListResponse;
2670
3045
 
2671
3046
  /**
2672
- * Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
2673
- an event contains ALL the key-value pairs specified here. Additional labels on
2674
- the event are allowed and will not prevent matching.
3047
+ * Optional. Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
3048
+ an event contains ALL the key-value pairs specified here. Additional labels on
3049
+ the event are allowed and will not prevent matching. Omit to receive all events for the selected event types.
2675
3050
 
2676
3051
  **Note:** Currently, labels are supported for onchain webhooks only.
2677
3052
 
@@ -2681,194 +3056,67 @@ See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-refe
2681
3056
  export type WebhookSubscriptionRequestLabels = { [key: string]: string };
2682
3057
 
2683
3058
  /**
2684
- * Request to create a new webhook subscription with support for both traditional single-label
2685
- and multi-label filtering formats.
2686
-
2687
- */
2688
- export type WebhookSubscriptionRequest =
2689
- | (unknown & {
2690
- /** Description of the webhook subscription. */
2691
- description?: Description;
2692
- /** Types of events to subscribe to. Event types follow a three-part dot-separated format:
2693
- service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
2694
- The subscription will only receive events matching these types AND the label filter(s).
2695
- */
2696
- eventTypes?: string[];
2697
- /** Whether the subscription is enabled. */
2698
- isEnabled?: boolean;
2699
- target?: WebhookTarget;
2700
- metadata?: Metadata;
2701
- /**
2702
- * (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
2703
-
2704
- Label key for filtering events. Each subscription filters on exactly one (labelKey, labelValue) pair
2705
- in addition to the event types. Only events matching both the event types AND this label filter will be delivered.
2706
- NOTE: Use either (labelKey + labelValue) OR labels, not both.
3059
+ * Request to create a new webhook subscription with support for multi-label filtering.
2707
3060
 
2708
- Maintained for backward compatibility only.
2709
-
2710
- * @deprecated
2711
- */
2712
- labelKey?: string;
2713
- /**
2714
- * (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
2715
-
2716
- Label value for filtering events. Must correspond to the labelKey (e.g., contract address for contract_address key).
2717
- Only events with this exact label value will be delivered.
2718
- NOTE: Use either (labelKey + labelValue) OR labels, not both.
2719
-
2720
- Maintained for backward compatibility only.
2721
-
2722
- * @deprecated
2723
- */
2724
- labelValue?: string;
2725
- /** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
2726
- an event contains ALL the key-value pairs specified here. Additional labels on
2727
- the event are allowed and will not prevent matching.
2728
-
2729
- **Note:** Currently, labels are supported for onchain webhooks only.
2730
-
2731
- See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
2732
3061
  */
2733
- labels?: WebhookSubscriptionRequestLabels;
2734
- })
2735
- | (unknown & {
2736
- /** Description of the webhook subscription. */
2737
- description?: Description;
2738
- /** Types of events to subscribe to. Event types follow a three-part dot-separated format:
3062
+ export interface WebhookSubscriptionRequest {
3063
+ /** Description of the webhook subscription. */
3064
+ description?: Description;
3065
+ /** Types of events to subscribe to. Event types follow a three-part dot-separated format:
2739
3066
  service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
2740
3067
  The subscription will only receive events matching these types AND the label filter(s).
2741
3068
  */
2742
- eventTypes?: string[];
2743
- /** Whether the subscription is enabled. */
2744
- isEnabled?: boolean;
2745
- target?: WebhookTarget;
2746
- metadata?: Metadata;
2747
- /**
2748
- * (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
2749
-
2750
- Label key for filtering events. Each subscription filters on exactly one (labelKey, labelValue) pair
2751
- in addition to the event types. Only events matching both the event types AND this label filter will be delivered.
2752
- NOTE: Use either (labelKey + labelValue) OR labels, not both.
2753
-
2754
- Maintained for backward compatibility only.
2755
-
2756
- * @deprecated
2757
- */
2758
- labelKey?: string;
2759
- /**
2760
- * (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
2761
-
2762
- Label value for filtering events. Must correspond to the labelKey (e.g., contract address for contract_address key).
2763
- Only events with this exact label value will be delivered.
2764
- NOTE: Use either (labelKey + labelValue) OR labels, not both.
2765
-
2766
- Maintained for backward compatibility only.
2767
-
2768
- * @deprecated
2769
- */
2770
- labelValue?: string;
2771
- /** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
2772
- an event contains ALL the key-value pairs specified here. Additional labels on
2773
- the event are allowed and will not prevent matching.
3069
+ eventTypes: string[];
3070
+ /** Whether the subscription is enabled. */
3071
+ isEnabled: boolean;
3072
+ target: WebhookTarget;
3073
+ metadata?: Metadata;
3074
+ /** Optional. Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
3075
+ an event contains ALL the key-value pairs specified here. Additional labels on
3076
+ the event are allowed and will not prevent matching. Omit to receive all events for the selected event types.
2774
3077
 
2775
3078
  **Note:** Currently, labels are supported for onchain webhooks only.
2776
3079
 
2777
3080
  See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
2778
3081
  */
2779
- labels?: WebhookSubscriptionRequestLabels;
2780
- });
3082
+ labels?: WebhookSubscriptionRequestLabels;
3083
+ }
2781
3084
 
2782
3085
  /**
2783
- * Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
3086
+ * Optional. Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
2784
3087
 
2785
3088
  **Note:** Currently, labels are supported for onchain webhooks only.
2786
3089
 
2787
3090
  See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
3091
+ Omit to receive all events for the selected event types.
2788
3092
 
2789
3093
  */
2790
3094
  export type WebhookSubscriptionUpdateRequestLabels = { [key: string]: string };
2791
3095
 
2792
3096
  /**
2793
- * Request to update an existing webhook subscription. The update format must match
2794
- the original subscription format (traditional or multi-label).
2795
-
2796
- */
2797
- export type WebhookSubscriptionUpdateRequest =
2798
- | (unknown & {
2799
- /** Description of the webhook subscription. */
2800
- description?: Description;
2801
- /** Types of events to subscribe to. Event types follow a three-part dot-separated format:
2802
- service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
2803
- */
2804
- eventTypes?: string[];
2805
- /** Whether the subscription is enabled. */
2806
- isEnabled?: boolean;
2807
- target?: WebhookTarget;
2808
- metadata?: Metadata;
2809
- /** Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
3097
+ * Request to update an existing webhook subscription.
2810
3098
 
2811
- **Note:** Currently, labels are supported for onchain webhooks only.
2812
-
2813
- See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
2814
3099
  */
2815
- labels?: WebhookSubscriptionUpdateRequestLabels;
2816
- /**
2817
- * (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
2818
-
2819
- Label key for filtering events. Use either (labelKey + labelValue) OR labels, not both.
2820
- Maintained for backward compatibility only.
2821
-
2822
- * @deprecated
2823
- */
2824
- labelKey?: string;
2825
- /**
2826
- * (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
2827
-
2828
- Label value for filtering events. Use either (labelKey + labelValue) OR labels, not both.
2829
- Maintained for backward compatibility only.
2830
-
2831
- * @deprecated
2832
- */
2833
- labelValue?: string;
2834
- })
2835
- | (unknown & {
2836
- /** Description of the webhook subscription. */
2837
- description?: Description;
2838
- /** Types of events to subscribe to. Event types follow a three-part dot-separated format:
3100
+ export interface WebhookSubscriptionUpdateRequest {
3101
+ /** Description of the webhook subscription. */
3102
+ description?: Description;
3103
+ /** Types of events to subscribe to. Event types follow a three-part dot-separated format:
2839
3104
  service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
2840
3105
  */
2841
- eventTypes?: string[];
2842
- /** Whether the subscription is enabled. */
2843
- isEnabled?: boolean;
2844
- target?: WebhookTarget;
2845
- metadata?: Metadata;
2846
- /** Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
3106
+ eventTypes: string[];
3107
+ /** Whether the subscription is enabled. */
3108
+ isEnabled: boolean;
3109
+ target: WebhookTarget;
3110
+ metadata?: Metadata;
3111
+ /** Optional. Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
2847
3112
 
2848
3113
  **Note:** Currently, labels are supported for onchain webhooks only.
2849
3114
 
2850
3115
  See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
3116
+ Omit to receive all events for the selected event types.
2851
3117
  */
2852
- labels?: WebhookSubscriptionUpdateRequestLabels;
2853
- /**
2854
- * (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
2855
-
2856
- Label key for filtering events. Use either (labelKey + labelValue) OR labels, not both.
2857
- Maintained for backward compatibility only.
2858
-
2859
- * @deprecated
2860
- */
2861
- labelKey?: string;
2862
- /**
2863
- * (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
2864
-
2865
- Label value for filtering events. Use either (labelKey + labelValue) OR labels, not both.
2866
- Maintained for backward compatibility only.
2867
-
2868
- * @deprecated
2869
- */
2870
- labelValue?: string;
2871
- });
3118
+ labels?: WebhookSubscriptionUpdateRequestLabels;
3119
+ }
2872
3120
 
2873
3121
  /**
2874
3122
  * The version of the x402 protocol.
@@ -2901,7 +3149,10 @@ export type X402ExactEvmPayloadAuthorization = {
2901
3149
  validAfter: string;
2902
3150
  /** The unix timestamp before which the payment is valid. */
2903
3151
  validBefore: string;
2904
- /** 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
+ */
2905
3156
  nonce: string;
2906
3157
  };
2907
3158
 
@@ -2909,12 +3160,86 @@ export type X402ExactEvmPayloadAuthorization = {
2909
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).
2910
3161
  */
2911
3162
  export interface X402ExactEvmPayload {
2912
- /** 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
+ */
2913
3167
  signature: string;
2914
3168
  /** The authorization data for the ERC-3009 authorization message. */
2915
3169
  authorization: X402ExactEvmPayloadAuthorization;
2916
3170
  }
2917
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
+
2918
3243
  /**
2919
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).
2920
3245
  */
@@ -2946,12 +3271,16 @@ export const X402V1PaymentPayloadNetwork = {
2946
3271
  base: "base",
2947
3272
  "solana-devnet": "solana-devnet",
2948
3273
  solana: "solana",
3274
+ polygon: "polygon",
2949
3275
  } as const;
2950
3276
 
2951
3277
  /**
2952
3278
  * The payload of the payment depending on the x402Version, scheme, and network.
2953
3279
  */
2954
- export type X402V1PaymentPayloadPayload = X402ExactEvmPayload | X402ExactSolanaPayload;
3280
+ export type X402V1PaymentPayloadPayload =
3281
+ | X402ExactEvmPayload
3282
+ | X402ExactEvmPermit2Payload
3283
+ | X402ExactSolanaPayload;
2955
3284
 
2956
3285
  /**
2957
3286
  * The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header.
@@ -3031,7 +3360,10 @@ export interface X402ResourceInfo {
3031
3360
  /**
3032
3361
  * The payload of the payment depending on the x402Version, scheme, and network.
3033
3362
  */
3034
- export type X402V2PaymentPayloadPayload = X402ExactEvmPayload | X402ExactSolanaPayload;
3363
+ export type X402V2PaymentPayloadPayload =
3364
+ | X402ExactEvmPayload
3365
+ | X402ExactEvmPermit2Payload
3366
+ | X402ExactSolanaPayload;
3035
3367
 
3036
3368
  /**
3037
3369
  * Optional protocol extensions.
@@ -3053,6 +3385,7 @@ export interface X402V2PaymentPayload {
3053
3385
 
3054
3386
  /**
3055
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.
3056
3389
  */
3057
3390
  export type X402PaymentPayload = X402V1PaymentPayload | X402V2PaymentPayload;
3058
3391
 
@@ -3079,6 +3412,7 @@ export const X402V1PaymentRequirementsNetwork = {
3079
3412
  base: "base",
3080
3413
  "solana-devnet": "solana-devnet",
3081
3414
  solana: "solana",
3415
+ polygon: "polygon",
3082
3416
  } as const;
3083
3417
 
3084
3418
  /**
@@ -3167,6 +3501,14 @@ export const X402VerifyInvalidReason = {
3167
3501
  "invalid_exact_evm_payload_authorization_to_address_kyt",
3168
3502
  invalid_exact_evm_payload_signature: "invalid_exact_evm_payload_signature",
3169
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",
3170
3512
  invalid_exact_svm_payload_transaction: "invalid_exact_svm_payload_transaction",
3171
3513
  invalid_exact_svm_payload_transaction_amount_mismatch:
3172
3514
  "invalid_exact_svm_payload_transaction_amount_mismatch",
@@ -3206,6 +3548,7 @@ export const X402VerifyInvalidReason = {
3206
3548
  "invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts",
3207
3549
  invalid_exact_svm_payload_transaction_fee_payer_transferring_funds:
3208
3550
  "invalid_exact_svm_payload_transaction_fee_payer_transferring_funds",
3551
+ unknown_error: "unknown_error",
3209
3552
  } as const;
3210
3553
 
3211
3554
  /**
@@ -3215,6 +3558,8 @@ export interface X402VerifyPaymentRejection {
3215
3558
  /** Indicates whether the payment is valid. */
3216
3559
  isValid: boolean;
3217
3560
  invalidReason: X402VerifyInvalidReason;
3561
+ /** The message describing the invalid reason. */
3562
+ invalidMessage?: string;
3218
3563
  /**
3219
3564
  * The onchain address of the client that is paying for the resource.
3220
3565
 
@@ -3255,6 +3600,14 @@ export const X402SettleErrorReason = {
3255
3600
  "invalid_exact_evm_payload_authorization_to_address_kyt",
3256
3601
  invalid_exact_evm_payload_signature: "invalid_exact_evm_payload_signature",
3257
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",
3258
3611
  invalid_exact_svm_payload_transaction: "invalid_exact_svm_payload_transaction",
3259
3612
  invalid_exact_svm_payload_transaction_amount_mismatch:
3260
3613
  "invalid_exact_svm_payload_transaction_amount_mismatch",
@@ -3301,6 +3654,7 @@ export const X402SettleErrorReason = {
3301
3654
  settle_exact_svm_block_height_exceeded: "settle_exact_svm_block_height_exceeded",
3302
3655
  settle_exact_svm_transaction_confirmation_timed_out:
3303
3656
  "settle_exact_svm_transaction_confirmation_timed_out",
3657
+ unknown_error: "unknown_error",
3304
3658
  } as const;
3305
3659
 
3306
3660
  /**
@@ -3310,6 +3664,8 @@ export interface X402SettlePaymentRejection {
3310
3664
  /** Indicates whether the payment settlement is successful. */
3311
3665
  success: boolean;
3312
3666
  errorReason: X402SettleErrorReason;
3667
+ /** The message describing the error reason. */
3668
+ errorMessage?: string;
3313
3669
  /**
3314
3670
  * The onchain address of the client that is paying for the resource.
3315
3671
 
@@ -3353,8 +3709,10 @@ export const X402SupportedPaymentKindNetwork = {
3353
3709
  base: "base",
3354
3710
  "solana-devnet": "solana-devnet",
3355
3711
  solana: "solana",
3712
+ polygon: "polygon",
3356
3713
  "eip155:8453": "eip155:8453",
3357
3714
  "eip155:84532": "eip155:84532",
3715
+ "eip155:137": "eip155:137",
3358
3716
  "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
3359
3717
  "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
3360
3718
  } as const;
@@ -3393,6 +3751,7 @@ export type OnrampOrderPaymentMethodTypeId =
3393
3751
  // eslint-disable-next-line @typescript-eslint/no-redeclare
3394
3752
  export const OnrampOrderPaymentMethodTypeId = {
3395
3753
  GUEST_CHECKOUT_APPLE_PAY: "GUEST_CHECKOUT_APPLE_PAY",
3754
+ GUEST_CHECKOUT_GOOGLE_PAY: "GUEST_CHECKOUT_GOOGLE_PAY",
3396
3755
  } as const;
3397
3756
 
3398
3757
  /**
@@ -3544,6 +3903,49 @@ export interface OnrampQuote {
3544
3903
  exchangeRate: string;
3545
3904
  }
3546
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
+
3547
3949
  /**
3548
3950
  * Unauthorized.
3549
3951
  */
@@ -3584,6 +3986,11 @@ export type AlreadyExistsErrorResponse = Error;
3584
3986
  */
3585
3987
  export type InvalidSQLQueryErrorResponse = Error;
3586
3988
 
3989
+ /**
3990
+ * The client closed the connection before the server could send a response.
3991
+ */
3992
+ export type ClientClosedRequestErrorResponse = Error;
3993
+
3587
3994
  /**
3588
3995
  * The request timed out.
3589
3996
  */
@@ -3593,6 +4000,8 @@ export type X402VerifyResponseResponse = {
3593
4000
  /** Indicates whether the payment is valid. */
3594
4001
  isValid: boolean;
3595
4002
  invalidReason?: X402VerifyInvalidReason;
4003
+ /** The message describing the invalid reason. */
4004
+ invalidMessage?: string;
3596
4005
  /**
3597
4006
  * The onchain address of the client that is paying for the resource.
3598
4007
 
@@ -3613,6 +4022,8 @@ export type X402SettleResponseResponse = {
3613
4022
  /** Indicates whether the payment settlement is successful. */
3614
4023
  success: boolean;
3615
4024
  errorReason?: X402SettleErrorReason;
4025
+ /** The message describing the error reason. */
4026
+ errorMessage?: string;
3616
4027
  /**
3617
4028
  * The onchain address of the client that is paying for the resource.
3618
4029
 
@@ -3666,8 +4077,8 @@ section of our Authentication docs for more details on how to generate your Wall
3666
4077
  export type XWalletAuthParameter = string;
3667
4078
 
3668
4079
  /**
3669
- * An optional [UUID v4](https://www.uuidgenerator.net/version4) request header for making requests safely retryable.
3670
- 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.
3671
4082
  Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
3672
4083
 
3673
4084
  */
@@ -3913,6 +4324,17 @@ export type SignEvmTypedData200 = {
3913
4324
  signature: string;
3914
4325
  };
3915
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
+
3916
4338
  export type ListEvmSmartAccountsParams = {
3917
4339
  /**
3918
4340
  * The number of resources to return per page.
@@ -4510,3 +4932,15 @@ export type CreateOnrampSession201 = {
4510
4932
  session: OnrampSession;
4511
4933
  quote?: OnrampQuote;
4512
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
+ };