@coinbase/cdp-sdk 1.51.1 → 1.51.2

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 (71) hide show
  1. package/_cjs/actions/evm/getUserOperation.js +1 -0
  2. package/_cjs/actions/evm/getUserOperation.js.map +1 -1
  3. package/_cjs/actions/evm/sendUserOperation.js +2 -0
  4. package/_cjs/actions/evm/sendUserOperation.js.map +1 -1
  5. package/_cjs/client/evm/evm.js +5 -0
  6. package/_cjs/client/evm/evm.js.map +1 -1
  7. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +176 -2
  8. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  9. package/_cjs/openapi-client/generated/end-user-account-management/end-user-account-management.js +3 -0
  10. package/_cjs/openapi-client/generated/end-user-account-management/end-user-account-management.js.map +1 -1
  11. package/_cjs/openapi-client/generated/onramp/onramp.js +35 -3
  12. package/_cjs/openapi-client/generated/onramp/onramp.js.map +1 -1
  13. package/_cjs/openapi-client/generated/sql-api/sql-api.js +23 -10
  14. package/_cjs/openapi-client/generated/sql-api/sql-api.js.map +1 -1
  15. package/_cjs/openapi-client/generated/webhooks/webhooks.js +15 -43
  16. package/_cjs/openapi-client/generated/webhooks/webhooks.js.map +1 -1
  17. package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.js +17 -1
  18. package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.js.map +1 -1
  19. package/_cjs/version.js +1 -1
  20. package/_esm/actions/evm/getUserOperation.js +1 -0
  21. package/_esm/actions/evm/getUserOperation.js.map +1 -1
  22. package/_esm/actions/evm/sendUserOperation.js +2 -0
  23. package/_esm/actions/evm/sendUserOperation.js.map +1 -1
  24. package/_esm/client/evm/evm.js +5 -0
  25. package/_esm/client/evm/evm.js.map +1 -1
  26. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +174 -0
  27. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  28. package/_esm/openapi-client/generated/end-user-account-management/end-user-account-management.js +3 -0
  29. package/_esm/openapi-client/generated/end-user-account-management/end-user-account-management.js.map +1 -1
  30. package/_esm/openapi-client/generated/onramp/onramp.js +32 -2
  31. package/_esm/openapi-client/generated/onramp/onramp.js.map +1 -1
  32. package/_esm/openapi-client/generated/sql-api/sql-api.js +23 -10
  33. package/_esm/openapi-client/generated/sql-api/sql-api.js.map +1 -1
  34. package/_esm/openapi-client/generated/webhooks/webhooks.js +15 -43
  35. package/_esm/openapi-client/generated/webhooks/webhooks.js.map +1 -1
  36. package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.js +15 -0
  37. package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.js.map +1 -1
  38. package/_esm/version.js +1 -1
  39. package/_types/actions/evm/getUserOperation.d.ts.map +1 -1
  40. package/_types/actions/evm/sendUserOperation.d.ts +7 -0
  41. package/_types/actions/evm/sendUserOperation.d.ts.map +1 -1
  42. package/_types/client/evm/evm.d.ts +1 -0
  43. package/_types/client/evm/evm.d.ts.map +1 -1
  44. package/_types/client/evm/evm.types.d.ts +7 -1
  45. package/_types/client/evm/evm.types.d.ts.map +1 -1
  46. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +1064 -83
  47. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  48. package/_types/openapi-client/generated/end-user-account-management/end-user-account-management.d.ts +3 -0
  49. package/_types/openapi-client/generated/end-user-account-management/end-user-account-management.d.ts.map +1 -1
  50. package/_types/openapi-client/generated/onramp/onramp.d.ts +20 -2
  51. package/_types/openapi-client/generated/onramp/onramp.d.ts.map +1 -1
  52. package/_types/openapi-client/generated/sql-api/sql-api.d.ts +23 -10
  53. package/_types/openapi-client/generated/sql-api/sql-api.d.ts.map +1 -1
  54. package/_types/openapi-client/generated/webhooks/webhooks.d.ts +15 -43
  55. package/_types/openapi-client/generated/webhooks/webhooks.d.ts.map +1 -1
  56. package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.d.ts +10 -1
  57. package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.d.ts.map +1 -1
  58. package/_types/openapi-client/index.d.ts.map +1 -1
  59. package/_types/version.d.ts +1 -1
  60. package/package.json +1 -1
  61. package/src/actions/evm/getUserOperation.ts +1 -0
  62. package/src/actions/evm/sendUserOperation.ts +9 -0
  63. package/src/client/evm/evm.ts +5 -0
  64. package/src/client/evm/evm.types.ts +7 -0
  65. package/src/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +1358 -100
  66. package/src/openapi-client/generated/end-user-account-management/end-user-account-management.ts +3 -0
  67. package/src/openapi-client/generated/onramp/onramp.ts +57 -3
  68. package/src/openapi-client/generated/sql-api/sql-api.ts +23 -10
  69. package/src/openapi-client/generated/webhooks/webhooks.ts +15 -43
  70. package/src/openapi-client/generated/x402-facilitator/x402-facilitator.ts +26 -0
  71. package/src/version.ts +1 -1
@@ -100,6 +100,9 @@ export const getEndUser = (
100
100
  Both params must be provided together.
101
101
 
102
102
  - **phoneNumber**: looks up a user by their SMS-verified phone number.
103
+ - **siweAddress**: looks up a user by the Ethereum address they authenticated
104
+ with via Sign In With Ethereum (EIP-4361).
105
+
103
106
 
104
107
  Returns all matching end users. If no end users match, an empty array is returned.
105
108
 
@@ -9,17 +9,65 @@ import type {
9
9
  CreateOnrampOrder201,
10
10
  CreateOnrampOrderBody,
11
11
  CreateOnrampSession201,
12
- CreateOnrampSessionBody,
13
12
  GetOnrampOrderById200,
14
13
  GetOnrampUserLimits200,
15
14
  GetOnrampUserLimitsBody,
15
+ InitiateOnrampVerificationRequest,
16
16
  OnrampLimitUpgradeRequest,
17
+ OnrampSessionRequest,
18
+ OnrampVerificationConfirmation,
19
+ OnrampVerificationId,
20
+ OnrampVerificationInitiation,
21
+ SubmitOnrampVerificationRequest,
17
22
  } from "../coinbaseDeveloperPlatformAPIs.schemas.js";
18
23
 
19
24
  import { cdpApiClient } from "../../cdpApiClient.js";
20
25
 
21
26
  type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
22
27
 
28
+ /**
29
+ * Initiates OTP verification by sending a 6-digit code to the user via the specified channel (SMS or email). Returns a `verificationId` that must be passed to the Submit Onramp Verification endpoint along with the OTP code within 10 minutes.
30
+
31
+ **Access to this API requires allowlisting.** During Onramp Headless API onboarding, contact the Onramp team to enable Onramp-managed verification for your application.
32
+ * @summary Initiate onramp verification
33
+ */
34
+ export const initiateOnrampVerification = (
35
+ initiateOnrampVerificationRequest: InitiateOnrampVerificationRequest,
36
+ options?: SecondParameter<typeof cdpApiClient<OnrampVerificationInitiation>>,
37
+ ) => {
38
+ return cdpApiClient<OnrampVerificationInitiation>(
39
+ {
40
+ url: `/v2/onramp/verifications`,
41
+ method: "POST",
42
+ headers: { "Content-Type": "application/json" },
43
+ data: initiateOnrampVerificationRequest,
44
+ },
45
+ options,
46
+ );
47
+ };
48
+ /**
49
+ * Submits the OTP code to complete verification. On success, marks the verification as verified and returns the same `verificationId`. The destination does not need to be re-sent. Onramp uses the value captured at initiation time.
50
+
51
+ The returned `verificationId` should be stored on the user's device and passed to the Create Onramp Order endpoint. It is valid for 60 days.
52
+
53
+ **Access to this API requires allowlisting.** During Onramp Headless API onboarding, contact the Onramp team to enable Onramp-managed verification for your application.
54
+ * @summary Submit onramp verification
55
+ */
56
+ export const submitOnrampVerification = (
57
+ verificationId: OnrampVerificationId,
58
+ submitOnrampVerificationRequest: SubmitOnrampVerificationRequest,
59
+ options?: SecondParameter<typeof cdpApiClient<OnrampVerificationConfirmation>>,
60
+ ) => {
61
+ return cdpApiClient<OnrampVerificationConfirmation>(
62
+ {
63
+ url: `/v2/onramp/verifications/${verificationId}/submit`,
64
+ method: "POST",
65
+ headers: { "Content-Type": "application/json" },
66
+ data: submitOnrampVerificationRequest,
67
+ },
68
+ options,
69
+ );
70
+ };
23
71
  /**
24
72
  * Create a new Onramp order or get a quote for an Onramp order. Either `paymentAmount` or `purchaseAmount` must be provided.
25
73
 
@@ -77,7 +125,7 @@ export const getOnrampOrderById = (
77
125
  * @summary Create an onramp session
78
126
  */
79
127
  export const createOnrampSession = (
80
- createOnrampSessionBody: CreateOnrampSessionBody,
128
+ onrampSessionRequest: OnrampSessionRequest,
81
129
  options?: SecondParameter<typeof cdpApiClient<CreateOnrampSession201>>,
82
130
  ) => {
83
131
  return cdpApiClient<CreateOnrampSession201>(
@@ -85,7 +133,7 @@ export const createOnrampSession = (
85
133
  url: `/v2/onramp/sessions`,
86
134
  method: "POST",
87
135
  headers: { "Content-Type": "application/json" },
88
- data: createOnrampSessionBody,
136
+ data: onrampSessionRequest,
89
137
  },
90
138
  options,
91
139
  );
@@ -136,6 +184,12 @@ export const requestLimitsUpgrade = (
136
184
  options,
137
185
  );
138
186
  };
187
+ export type InitiateOnrampVerificationResult = NonNullable<
188
+ Awaited<ReturnType<typeof initiateOnrampVerification>>
189
+ >;
190
+ export type SubmitOnrampVerificationResult = NonNullable<
191
+ Awaited<ReturnType<typeof submitOnrampVerification>>
192
+ >;
139
193
  export type CreateOnrampOrderResult = NonNullable<Awaited<ReturnType<typeof createOnrampOrder>>>;
140
194
  export type GetOnrampOrderByIdResult = NonNullable<Awaited<ReturnType<typeof getOnrampOrderById>>>;
141
195
  export type CreateOnrampSessionResult = NonNullable<
@@ -30,21 +30,34 @@ Queries are executed against optimized data structures for high-performance anal
30
30
  - No DDL or DML operations
31
31
  - Query that follow limits (defined below)
32
32
 
33
- ### Supported Tables
34
-
35
- - `<network>.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more.
36
- - `<network>.transactions` - Base mainnet transaction data including hash, block number, gas usage.
37
- - `<network>.blocks` - Base mainnet block information.
38
- - `<network>.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode).
39
- - `<network>.decoded_user_operations` - Decoded user operations data including hash, block number, gas usage, builder codes, entrypoint version, and more.
40
- - `<network>.transaction_attributions` - Information about the attributions of a transaction to a builder and associated builder codes.
41
-
42
33
  ### Supported Networks
43
34
 
44
35
  - Base Mainnet: `base`
45
36
  - Base Sepolia: `base_sepolia`
37
+ - Solana Mainnet: `solana`
38
+ - Hyperevm Mainnet: `hyperevm`
39
+
40
+ ### Supported Tables
41
+
42
+ The below tables are supported for `base` and `base_sepolia` networks.
43
+
44
+ | Table | Description |
45
+ | --- | --- |
46
+ | `<network>.events` | Decoded event logs with parameters, event signature, topics, and more. |
47
+ | `<network>.transactions` | Transaction data including hash, block number, and gas usage. |
48
+ | `<network>.blocks` | Block information. |
49
+ | `<network>.encoded_logs` | Encoded log data for event logs that cannot be decoded by our event decoder (ex: log0 opcode). |
50
+ | `<network>.decoded_user_operations` | Decoded user operations data including hash, block number, gas usage, builder codes, entrypoint version, and more. |
51
+ | `<network>.transaction_attributions` | Information about the attributions of a transaction to a builder and associated builder codes. |
52
+
53
+ Following the above, the valid tables on Base Mainnet are `base.events`, `base.transactions`, `base.blocks`, `base.encoded_logs`, `base.decoded_user_operations`, and `base.transaction_attributions`.
54
+
55
+ Separately, there is a limited set of tables supported for `solana` and `hyperevm` networks:
46
56
 
47
- So for example, valid tables are: `base.events`, `base_sepolia.events`, `base.transactions`, etc.
57
+ | Table | Description |
58
+ | --- | --- |
59
+ | `solana.instructions` | Solana instruction call data including program ID, instruction data, and more. Currently supports just Token2022 and SPL Token programs. |
60
+ | `hyperevm.events` | Hyperevm decoded event logs with parameters, event signature, topics, and more. Currently supports just B20 events. |
48
61
 
49
62
  ### Query Limits
50
63
 
@@ -41,58 +41,30 @@ export const listWebhookSubscriptions = (
41
41
  );
42
42
  };
43
43
  /**
44
- * Subscribe to real-time events across CDP products using flexible filtering.
44
+ * Subscribe to real-time events across CDP products.
45
45
 
46
- ### Event Types
47
-
48
- **Onchain Events** - Monitor Base mainnet with microsecond precision:
49
- - `onchain.activity.detected` - Smart contract events, transfers, swaps, NFT activity
50
- - **Requires** `labels` for filtering (e.g., `contract_address`, `event_name`)
46
+ ### Filtering
51
47
 
52
- **Onramp/Offramp Events** - Transaction lifecycle notifications:
53
- - `onramp.transaction.created`, `onramp.transaction.updated`
54
- - `onramp.transaction.success`, `onramp.transaction.failed`
55
- - `offramp.transaction.created`, `offramp.transaction.updated`
56
- - `offramp.transaction.success`, `offramp.transaction.failed`
57
- - **No labels required** - maximum simplicity for transaction monitoring
48
+ Onchain events can utilize multi-label filtering to only receive events that match all the specified labels.
58
49
 
59
- **Payments Transfers Events** - Transfer lifecycle notifications:
60
- - `payments.transfers.quoted` - Transfer created and awaiting execution
61
- - `payments.transfers.processing` - Transfer execution in progress
62
- - `payments.transfers.completed` - Transfer completed successfully
63
- - `payments.transfers.failed` - Transfer failed
64
- - `payments.transfers.travel_rule_incomplete` - Travel rule information is missing
65
- - `payments.transfers.travel_rule_completed` - Travel rule information has been provided and the transfer will proceed
66
- - **No labels required** - enable the transfers webhook to monitor status transitions
50
+ Allows labels are:
51
+ - `network` (required) Blockchain network
52
+ - `contract_address` Smart contract address
53
+ - `event_name` Event name (e.g., "Transfer", "Burn")
54
+ - `event_signature` Event signature (e.g., "Transfer(address,address,uint256)")
55
+ - `transaction_from` Transaction sender address
56
+ - `transaction_to` Transaction recipient address
57
+ - `params.*` Any event parameter from the log event (e.g., `params.from`, `params.to`, `params.sender`, `params.tokenId`)
67
58
 
68
- **Wallet Events** - Wallet activity notifications:
69
- - `wallet.activity.detected`
59
+ For webhook types that aren't `onchain.*`, labels are ignored.
70
60
 
71
61
  ### Webhook Signature Verification
72
- All webhooks include cryptographic signatures for security.
73
- The signature secret is returned in `secret` field when creating a subscription.
74
62
 
75
- **Note:** Webhooks are in beta and this interface is subject to change.
76
-
77
- See the [verification guide](https://docs.cdp.coinbase.com/onramp-&-offramp/webhooks#webhook-signature-verification) for implementation details.
63
+ All webhooks include an HMAC-SHA256 signed header for security. The signature is signed with the secret that is returned in the `secret` field when creating a subscription.
78
64
 
79
- ### Onchain Label Filtering
65
+ Do not lose the secret, as you will not be able to recreate it. If you lose the secret, you will need to create a new subscription.
80
66
 
81
- For `onchain.activity.detected` events, use `labels` for precise filtering with AND logic (max 20 labels per webhook).
82
-
83
- **Allowed labels** (all in snake_case format):
84
- - `network` (required) - Blockchain network
85
- - `contract_address` - Smart contract address
86
- - `event_name` - Event name (e.g., "Transfer", "Burn")
87
- - `event_signature` - Event signature hash
88
- - `transaction_from` - Transaction sender address
89
- - `transaction_to` - Transaction recipient address
90
- - `params.*` - Any event parameter (e.g., `params.from`, `params.to`, `params.sender`, `params.tokenId`)
91
-
92
- **Examples**:
93
- - **Liquidity Pool Monitor**: `{"network": "base-mainnet", "contract_address": "0xcd1f9777571493aeacb7eae45cd30a226d3e612d", "event_name": "Burn"}`
94
- - **Price Oracle Tracker**: `{"network": "base-mainnet", "contract_address": "0xbac4a9428ea707c51f171ed9890c3c2fa810305d", "event_name": "PriceUpdated"}`
95
- - **DeFi Protocol Activity**: `{"network": "base-mainnet", "contract_address": "0x45c6e6a47a711b14d8357d5243f46704904578e3", "event_name": "Deposit"}`
67
+ See the [verification guide](https://docs.cdp.coinbase.com/onramp-&-offramp/webhooks#webhook-signature-verification) for implementation details.
96
68
 
97
69
  * @summary Create webhook subscription
98
70
  */
@@ -18,6 +18,8 @@ import type {
18
18
  X402SearchResourcesResponse,
19
19
  X402SettleResponseResponse,
20
20
  X402SupportedPaymentKindsResponseResponse,
21
+ X402ValidateRequest,
22
+ X402ValidateResponse,
21
23
  X402VerifyResponseResponse,
22
24
  } from "../coinbaseDeveloperPlatformAPIs.schemas.js";
23
25
 
@@ -91,6 +93,7 @@ export const listX402DiscoveryResources = (
91
93
  /**
92
94
  * Gets x402 merchant discovery information for a given merchant payment address.
93
95
  This endpoint returns all active x402 resources associated with the specified `payTo` address, allowing clients to discover what payment-gated resources a merchant exposes and their corresponding payment requirements.
96
+ If no active resources are found for the `payTo` address, the endpoint returns an empty `resources` list.
94
97
  The response is paginated, and by default, returns 20 items per page.
95
98
  * @summary List merchant discovery info
96
99
  */
@@ -137,6 +140,26 @@ export const postX402DiscoveryMcp = (
137
140
  options,
138
141
  );
139
142
  };
143
+ /**
144
+ * Validates an x402 endpoint's bazaar-discovery configuration by probing the seller's URL live.
145
+ Returns a uniform array of preflight check results (reachable, returns402, hasBazaarExtension, parse) and a simulated facilitator accept/reject decision so sellers and agents can confirm their endpoint is ready to be discovered before going live.
146
+ This operation is read-only: it performs no payment and does not index the resource.
147
+ * @summary Validate x402 endpoint
148
+ */
149
+ export const validateX402Resource = (
150
+ x402ValidateRequest: X402ValidateRequest,
151
+ options?: SecondParameter<typeof cdpApiClient<X402ValidateResponse>>,
152
+ ) => {
153
+ return cdpApiClient<X402ValidateResponse>(
154
+ {
155
+ url: `/v2/x402/validate`,
156
+ method: "POST",
157
+ headers: { "Content-Type": "application/json" },
158
+ data: x402ValidateRequest,
159
+ },
160
+ options,
161
+ );
162
+ };
140
163
  export type VerifyX402PaymentResult = NonNullable<Awaited<ReturnType<typeof verifyX402Payment>>>;
141
164
  export type SettleX402PaymentResult = NonNullable<Awaited<ReturnType<typeof settleX402Payment>>>;
142
165
  export type SupportedX402PaymentKindsResult = NonNullable<
@@ -154,3 +177,6 @@ export type SearchX402ResourcesResult = NonNullable<
154
177
  export type PostX402DiscoveryMcpResult = NonNullable<
155
178
  Awaited<ReturnType<typeof postX402DiscoveryMcp>>
156
179
  >;
180
+ export type ValidateX402ResourceResult = NonNullable<
181
+ Awaited<ReturnType<typeof validateX402Resource>>
182
+ >;
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "1.51.1";
1
+ export const version = "1.51.2";