@coinbase/cdp-sdk 1.40.1 → 1.41.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.
- package/CHANGELOG.md +12 -0
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +13 -5
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +12 -4
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +371 -64
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +393 -68
- package/package.json +4 -4
- package/version.ts +1 -1
|
@@ -89,6 +89,61 @@ export type AuthenticationMethod = EmailAuthentication | SmsAuthentication | Dev
|
|
|
89
89
|
* The list of valid authentication methods linked to the end user.
|
|
90
90
|
*/
|
|
91
91
|
export type AuthenticationMethods = AuthenticationMethod[];
|
|
92
|
+
/**
|
|
93
|
+
* An object containing information about the end user's TOTP enrollment.
|
|
94
|
+
*/
|
|
95
|
+
export type MFAMethodsTotp = {
|
|
96
|
+
/** The date and time when the method was enrolled, in ISO 8601 format. */
|
|
97
|
+
enrolledAt: string;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Information about the end user's MFA enrollments.
|
|
101
|
+
|
|
102
|
+
*/
|
|
103
|
+
export interface MFAMethods {
|
|
104
|
+
/** The date and time when the end user was prompted for MFA enrollment, in ISO 8601 format. If the this field exists, and the user has no other enrolled MFA methods, then the user skipped MFA enrollment. */
|
|
105
|
+
enrollmentPromptedAt?: string;
|
|
106
|
+
/** An object containing information about the end user's TOTP enrollment. */
|
|
107
|
+
totp?: MFAMethodsTotp;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Information about an EVM account associated with an end user.
|
|
111
|
+
*/
|
|
112
|
+
export interface EndUserEvmAccount {
|
|
113
|
+
/**
|
|
114
|
+
* The address of the EVM account.
|
|
115
|
+
* @pattern ^0x[0-9a-fA-F]{40}$
|
|
116
|
+
*/
|
|
117
|
+
address: string;
|
|
118
|
+
/** The date and time when the account was created, in ISO 8601 format. */
|
|
119
|
+
createdAt: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Information about an EVM smart account associated with an end user.
|
|
123
|
+
*/
|
|
124
|
+
export interface EndUserEvmSmartAccount {
|
|
125
|
+
/**
|
|
126
|
+
* The address of the EVM smart account.
|
|
127
|
+
* @pattern ^0x[0-9a-fA-F]{40}$
|
|
128
|
+
*/
|
|
129
|
+
address: string;
|
|
130
|
+
/** The addresses of the EVM EOA accounts that own this smart account. Smart accounts can have multiple owners, such as when spend permissions are enabled. */
|
|
131
|
+
ownerAddresses: string[];
|
|
132
|
+
/** The date and time when the account was created, in ISO 8601 format. */
|
|
133
|
+
createdAt: string;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Information about a Solana account associated with an end user.
|
|
137
|
+
*/
|
|
138
|
+
export interface EndUserSolanaAccount {
|
|
139
|
+
/**
|
|
140
|
+
* The base58 encoded address of the Solana account.
|
|
141
|
+
* @pattern ^[1-9A-HJ-NP-Za-km-z]{32,44}$
|
|
142
|
+
*/
|
|
143
|
+
address: string;
|
|
144
|
+
/** The date and time when the account was created, in ISO 8601 format. */
|
|
145
|
+
createdAt: string;
|
|
146
|
+
}
|
|
92
147
|
/**
|
|
93
148
|
* Information about the end user.
|
|
94
149
|
*/
|
|
@@ -99,21 +154,28 @@ export interface EndUser {
|
|
|
99
154
|
*/
|
|
100
155
|
userId: string;
|
|
101
156
|
authenticationMethods: AuthenticationMethods;
|
|
157
|
+
mfaMethods?: MFAMethods;
|
|
102
158
|
/**
|
|
103
159
|
* **DEPRECATED**: Use `evmAccountObjects` instead for richer account information. The list of EVM account addresses associated with the end user. End users can have up to 10 EVM accounts.
|
|
104
160
|
* @deprecated
|
|
105
161
|
*/
|
|
106
162
|
evmAccounts: string[];
|
|
163
|
+
/** The list of EVM accounts associated with the end user. End users can have up to 10 EVM accounts. */
|
|
164
|
+
evmAccountObjects: EndUserEvmAccount[];
|
|
107
165
|
/**
|
|
108
166
|
* **DEPRECATED**: Use `evmSmartAccountObjects` instead for richer account information including owner relationships. The list of EVM smart account addresses associated with the end user. Each EVM EOA can own one smart account.
|
|
109
167
|
* @deprecated
|
|
110
168
|
*/
|
|
111
169
|
evmSmartAccounts: string[];
|
|
170
|
+
/** The list of EVM smart accounts associated with the end user. Each EVM EOA can own one smart account. */
|
|
171
|
+
evmSmartAccountObjects: EndUserEvmSmartAccount[];
|
|
112
172
|
/**
|
|
113
173
|
* **DEPRECATED**: Use `solanaAccountObjects` instead for richer account information. The list of Solana account addresses associated with the end user. End users can have up to 10 Solana accounts.
|
|
114
174
|
* @deprecated
|
|
115
175
|
*/
|
|
116
176
|
solanaAccounts: string[];
|
|
177
|
+
/** The list of Solana accounts associated with the end user. End users can have up to 10 Solana accounts. */
|
|
178
|
+
solanaAccountObjects: EndUserSolanaAccount[];
|
|
117
179
|
/** The date and time when the end user was created, in ISO 8601 format. */
|
|
118
180
|
createdAt: string;
|
|
119
181
|
}
|
|
@@ -2034,10 +2096,10 @@ export interface WebhookTarget {
|
|
|
2034
2096
|
* Additional metadata for the subscription.
|
|
2035
2097
|
*/
|
|
2036
2098
|
export type WebhookSubscriptionResponseMetadata = {
|
|
2037
|
-
/**
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2099
|
+
/**
|
|
2100
|
+
* Use the root-level `secret` field instead. Maintained for backward compatibility only.
|
|
2101
|
+
* @deprecated
|
|
2102
|
+
*/
|
|
2041
2103
|
secret?: string;
|
|
2042
2104
|
};
|
|
2043
2105
|
/**
|
|
@@ -2064,13 +2126,27 @@ export interface WebhookSubscriptionResponse {
|
|
|
2064
2126
|
isEnabled: boolean;
|
|
2065
2127
|
/** Additional metadata for the subscription. */
|
|
2066
2128
|
metadata?: WebhookSubscriptionResponseMetadata;
|
|
2129
|
+
/** Secret for webhook signature validation. */
|
|
2130
|
+
secret: string;
|
|
2067
2131
|
/** Unique identifier for the subscription. */
|
|
2068
2132
|
subscriptionId: string;
|
|
2069
2133
|
target: WebhookTarget;
|
|
2070
|
-
/**
|
|
2134
|
+
/**
|
|
2135
|
+
* (Deprecated) Use `labels` field instead.
|
|
2136
|
+
|
|
2137
|
+
Label key for filtering events. Present when subscription uses traditional single-label format.
|
|
2138
|
+
Maintained for backward compatibility only.
|
|
2139
|
+
|
|
2140
|
+
* @deprecated
|
|
2071
2141
|
*/
|
|
2072
2142
|
labelKey?: string;
|
|
2073
|
-
/**
|
|
2143
|
+
/**
|
|
2144
|
+
* (Deprecated) Use `labels` field instead.
|
|
2145
|
+
|
|
2146
|
+
Label value for filtering events. Present when subscription uses traditional single-label format.
|
|
2147
|
+
Maintained for backward compatibility only.
|
|
2148
|
+
|
|
2149
|
+
* @deprecated
|
|
2074
2150
|
*/
|
|
2075
2151
|
labelValue?: string;
|
|
2076
2152
|
/** Multi-label filters using total overlap logic. Total overlap means the subscription only triggers when events contain ALL these key-value pairs.
|
|
@@ -2096,7 +2172,10 @@ export type WebhookSubscriptionRequestMetadata = {
|
|
|
2096
2172
|
* Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2097
2173
|
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2098
2174
|
the event are allowed and will not prevent matching.
|
|
2099
|
-
|
|
2175
|
+
|
|
2176
|
+
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2177
|
+
|
|
2178
|
+
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2100
2179
|
|
|
2101
2180
|
*/
|
|
2102
2181
|
export type WebhookSubscriptionRequestLabels = {
|
|
@@ -2120,20 +2199,37 @@ The subscription will only receive events matching these types AND the label fil
|
|
|
2120
2199
|
target?: WebhookTarget;
|
|
2121
2200
|
/** Additional metadata for the subscription. */
|
|
2122
2201
|
metadata?: WebhookSubscriptionRequestMetadata;
|
|
2123
|
-
/**
|
|
2202
|
+
/**
|
|
2203
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2204
|
+
|
|
2205
|
+
Label key for filtering events. Each subscription filters on exactly one (labelKey, labelValue) pair
|
|
2124
2206
|
in addition to the event types. Only events matching both the event types AND this label filter will be delivered.
|
|
2125
2207
|
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2126
|
-
|
|
2208
|
+
|
|
2209
|
+
Maintained for backward compatibility only.
|
|
2210
|
+
|
|
2211
|
+
* @deprecated
|
|
2212
|
+
*/
|
|
2127
2213
|
labelKey?: string;
|
|
2128
|
-
/**
|
|
2214
|
+
/**
|
|
2215
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2216
|
+
|
|
2217
|
+
Label value for filtering events. Must correspond to the labelKey (e.g., contract address for contract_address key).
|
|
2129
2218
|
Only events with this exact label value will be delivered.
|
|
2130
2219
|
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2131
|
-
|
|
2220
|
+
|
|
2221
|
+
Maintained for backward compatibility only.
|
|
2222
|
+
|
|
2223
|
+
* @deprecated
|
|
2224
|
+
*/
|
|
2132
2225
|
labelValue?: string;
|
|
2133
2226
|
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2134
2227
|
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2135
2228
|
the event are allowed and will not prevent matching.
|
|
2136
|
-
|
|
2229
|
+
|
|
2230
|
+
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2231
|
+
|
|
2232
|
+
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2137
2233
|
*/
|
|
2138
2234
|
labels?: WebhookSubscriptionRequestLabels;
|
|
2139
2235
|
}) | (unknown & {
|
|
@@ -2149,20 +2245,37 @@ The subscription will only receive events matching these types AND the label fil
|
|
|
2149
2245
|
target?: WebhookTarget;
|
|
2150
2246
|
/** Additional metadata for the subscription. */
|
|
2151
2247
|
metadata?: WebhookSubscriptionRequestMetadata;
|
|
2152
|
-
/**
|
|
2248
|
+
/**
|
|
2249
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2250
|
+
|
|
2251
|
+
Label key for filtering events. Each subscription filters on exactly one (labelKey, labelValue) pair
|
|
2153
2252
|
in addition to the event types. Only events matching both the event types AND this label filter will be delivered.
|
|
2154
2253
|
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2155
|
-
|
|
2254
|
+
|
|
2255
|
+
Maintained for backward compatibility only.
|
|
2256
|
+
|
|
2257
|
+
* @deprecated
|
|
2258
|
+
*/
|
|
2156
2259
|
labelKey?: string;
|
|
2157
|
-
/**
|
|
2260
|
+
/**
|
|
2261
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2262
|
+
|
|
2263
|
+
Label value for filtering events. Must correspond to the labelKey (e.g., contract address for contract_address key).
|
|
2158
2264
|
Only events with this exact label value will be delivered.
|
|
2159
2265
|
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2160
|
-
|
|
2266
|
+
|
|
2267
|
+
Maintained for backward compatibility only.
|
|
2268
|
+
|
|
2269
|
+
* @deprecated
|
|
2270
|
+
*/
|
|
2161
2271
|
labelValue?: string;
|
|
2162
2272
|
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2163
2273
|
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2164
2274
|
the event are allowed and will not prevent matching.
|
|
2165
|
-
|
|
2275
|
+
|
|
2276
|
+
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2277
|
+
|
|
2278
|
+
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2166
2279
|
*/
|
|
2167
2280
|
labels?: WebhookSubscriptionRequestLabels;
|
|
2168
2281
|
});
|
|
@@ -2173,8 +2286,11 @@ export type WebhookSubscriptionUpdateRequestMetadata = {
|
|
|
2173
2286
|
[key: string]: unknown;
|
|
2174
2287
|
};
|
|
2175
2288
|
/**
|
|
2176
|
-
* Multi-label filters
|
|
2177
|
-
|
|
2289
|
+
* Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2290
|
+
|
|
2291
|
+
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2292
|
+
|
|
2293
|
+
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2178
2294
|
|
|
2179
2295
|
*/
|
|
2180
2296
|
export type WebhookSubscriptionUpdateRequestLabels = {
|
|
@@ -2197,16 +2313,31 @@ service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detec
|
|
|
2197
2313
|
target?: WebhookTarget;
|
|
2198
2314
|
/** Additional metadata for the subscription. */
|
|
2199
2315
|
metadata?: WebhookSubscriptionUpdateRequestMetadata;
|
|
2200
|
-
/**
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
labelValue?: string;
|
|
2206
|
-
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2207
|
-
an event contains ALL the key-value pairs specified here. Use either labels OR (labelKey + labelValue), not both.
|
|
2316
|
+
/** Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2317
|
+
|
|
2318
|
+
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2319
|
+
|
|
2320
|
+
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2208
2321
|
*/
|
|
2209
2322
|
labels?: WebhookSubscriptionUpdateRequestLabels;
|
|
2323
|
+
/**
|
|
2324
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2325
|
+
|
|
2326
|
+
Label key for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2327
|
+
Maintained for backward compatibility only.
|
|
2328
|
+
|
|
2329
|
+
* @deprecated
|
|
2330
|
+
*/
|
|
2331
|
+
labelKey?: string;
|
|
2332
|
+
/**
|
|
2333
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2334
|
+
|
|
2335
|
+
Label value for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2336
|
+
Maintained for backward compatibility only.
|
|
2337
|
+
|
|
2338
|
+
* @deprecated
|
|
2339
|
+
*/
|
|
2340
|
+
labelValue?: string;
|
|
2210
2341
|
}) | (unknown & {
|
|
2211
2342
|
/** Description of the webhook subscription. */
|
|
2212
2343
|
description?: string;
|
|
@@ -2219,16 +2350,31 @@ service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detec
|
|
|
2219
2350
|
target?: WebhookTarget;
|
|
2220
2351
|
/** Additional metadata for the subscription. */
|
|
2221
2352
|
metadata?: WebhookSubscriptionUpdateRequestMetadata;
|
|
2222
|
-
/**
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
labelValue?: string;
|
|
2228
|
-
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2229
|
-
an event contains ALL the key-value pairs specified here. Use either labels OR (labelKey + labelValue), not both.
|
|
2353
|
+
/** Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2354
|
+
|
|
2355
|
+
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2356
|
+
|
|
2357
|
+
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2230
2358
|
*/
|
|
2231
2359
|
labels?: WebhookSubscriptionUpdateRequestLabels;
|
|
2360
|
+
/**
|
|
2361
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2362
|
+
|
|
2363
|
+
Label key for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2364
|
+
Maintained for backward compatibility only.
|
|
2365
|
+
|
|
2366
|
+
* @deprecated
|
|
2367
|
+
*/
|
|
2368
|
+
labelKey?: string;
|
|
2369
|
+
/**
|
|
2370
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2371
|
+
|
|
2372
|
+
Label value for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2373
|
+
Maintained for backward compatibility only.
|
|
2374
|
+
|
|
2375
|
+
* @deprecated
|
|
2376
|
+
*/
|
|
2377
|
+
labelValue?: string;
|
|
2232
2378
|
});
|
|
2233
2379
|
/**
|
|
2234
2380
|
* The version of the x402 protocol.
|
|
@@ -2236,6 +2382,7 @@ an event contains ALL the key-value pairs specified here. Use either labels OR (
|
|
|
2236
2382
|
export type X402Version = (typeof X402Version)[keyof typeof X402Version];
|
|
2237
2383
|
export declare const X402Version: {
|
|
2238
2384
|
readonly NUMBER_1: 1;
|
|
2385
|
+
readonly NUMBER_2: 2;
|
|
2239
2386
|
};
|
|
2240
2387
|
/**
|
|
2241
2388
|
* The authorization data for the ERC-3009 authorization message.
|
|
@@ -2279,15 +2426,15 @@ export interface X402ExactSolanaPayload {
|
|
|
2279
2426
|
/**
|
|
2280
2427
|
* The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`.
|
|
2281
2428
|
*/
|
|
2282
|
-
export type
|
|
2283
|
-
export declare const
|
|
2429
|
+
export type X402V1PaymentPayloadScheme = (typeof X402V1PaymentPayloadScheme)[keyof typeof X402V1PaymentPayloadScheme];
|
|
2430
|
+
export declare const X402V1PaymentPayloadScheme: {
|
|
2284
2431
|
readonly exact: "exact";
|
|
2285
2432
|
};
|
|
2286
2433
|
/**
|
|
2287
2434
|
* The network of the blockchain to send payment on.
|
|
2288
2435
|
*/
|
|
2289
|
-
export type
|
|
2290
|
-
export declare const
|
|
2436
|
+
export type X402V1PaymentPayloadNetwork = (typeof X402V1PaymentPayloadNetwork)[keyof typeof X402V1PaymentPayloadNetwork];
|
|
2437
|
+
export declare const X402V1PaymentPayloadNetwork: {
|
|
2291
2438
|
readonly "base-sepolia": "base-sepolia";
|
|
2292
2439
|
readonly base: "base";
|
|
2293
2440
|
readonly "solana-devnet": "solana-devnet";
|
|
@@ -2296,31 +2443,114 @@ export declare const X402PaymentPayloadNetwork: {
|
|
|
2296
2443
|
/**
|
|
2297
2444
|
* The payload of the payment depending on the x402Version, scheme, and network.
|
|
2298
2445
|
*/
|
|
2299
|
-
export type
|
|
2446
|
+
export type X402V1PaymentPayloadPayload = X402ExactEvmPayload | X402ExactSolanaPayload;
|
|
2300
2447
|
/**
|
|
2301
2448
|
* The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header.
|
|
2302
2449
|
*/
|
|
2303
|
-
export interface
|
|
2450
|
+
export interface X402V1PaymentPayload {
|
|
2304
2451
|
x402Version: X402Version;
|
|
2305
2452
|
/** The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. */
|
|
2306
|
-
scheme:
|
|
2453
|
+
scheme: X402V1PaymentPayloadScheme;
|
|
2307
2454
|
/** The network of the blockchain to send payment on. */
|
|
2308
|
-
network:
|
|
2455
|
+
network: X402V1PaymentPayloadNetwork;
|
|
2456
|
+
/** The payload of the payment depending on the x402Version, scheme, and network. */
|
|
2457
|
+
payload: X402V1PaymentPayloadPayload;
|
|
2458
|
+
}
|
|
2459
|
+
/**
|
|
2460
|
+
* The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`.
|
|
2461
|
+
*/
|
|
2462
|
+
export type X402V2PaymentRequirementsScheme = (typeof X402V2PaymentRequirementsScheme)[keyof typeof X402V2PaymentRequirementsScheme];
|
|
2463
|
+
export declare const X402V2PaymentRequirementsScheme: {
|
|
2464
|
+
readonly exact: "exact";
|
|
2465
|
+
};
|
|
2466
|
+
/**
|
|
2467
|
+
* The optional additional scheme-specific payment info.
|
|
2468
|
+
*/
|
|
2469
|
+
export type X402V2PaymentRequirementsExtra = {
|
|
2470
|
+
[key: string]: unknown;
|
|
2471
|
+
};
|
|
2472
|
+
/**
|
|
2473
|
+
* The x402 protocol payment requirements that the resource server expects the client's payment payload to meet.
|
|
2474
|
+
*/
|
|
2475
|
+
export interface X402V2PaymentRequirements {
|
|
2476
|
+
/** The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. */
|
|
2477
|
+
scheme: X402V2PaymentRequirementsScheme;
|
|
2478
|
+
/** The network of the blockchain to send payment on in caip2 format. */
|
|
2479
|
+
network: string;
|
|
2480
|
+
/**
|
|
2481
|
+
* The asset to pay with.
|
|
2482
|
+
|
|
2483
|
+
For EVM networks, the asset will be a 0x-prefixed, checksum EVM address.
|
|
2484
|
+
|
|
2485
|
+
For Solana-based networks, the asset will be a base58-encoded Solana address.
|
|
2486
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
2487
|
+
*/
|
|
2488
|
+
asset: string;
|
|
2489
|
+
/** The amount to pay for the resource in atomic units of the payment asset. */
|
|
2490
|
+
amount: string;
|
|
2491
|
+
/**
|
|
2492
|
+
* The destination to pay value to.
|
|
2493
|
+
|
|
2494
|
+
For EVM networks, payTo will be a 0x-prefixed, checksum EVM address.
|
|
2495
|
+
|
|
2496
|
+
For Solana-based networks, payTo will be a base58-encoded Solana address.
|
|
2497
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
2498
|
+
*/
|
|
2499
|
+
payTo: string;
|
|
2500
|
+
/** The maximum time in seconds for the resource server to respond. */
|
|
2501
|
+
maxTimeoutSeconds: number;
|
|
2502
|
+
/** The optional additional scheme-specific payment info. */
|
|
2503
|
+
extra?: X402V2PaymentRequirementsExtra;
|
|
2504
|
+
}
|
|
2505
|
+
/**
|
|
2506
|
+
* Describes the resource being accessed in x402 protocol.
|
|
2507
|
+
*/
|
|
2508
|
+
export interface X402ResourceInfo {
|
|
2509
|
+
/** The URL of the resource. */
|
|
2510
|
+
url?: string;
|
|
2511
|
+
/** The description of the resource. */
|
|
2512
|
+
description?: string;
|
|
2513
|
+
/** The MIME type of the resource response. */
|
|
2514
|
+
mimeType?: string;
|
|
2515
|
+
}
|
|
2516
|
+
/**
|
|
2517
|
+
* The payload of the payment depending on the x402Version, scheme, and network.
|
|
2518
|
+
*/
|
|
2519
|
+
export type X402V2PaymentPayloadPayload = X402ExactEvmPayload | X402ExactSolanaPayload;
|
|
2520
|
+
/**
|
|
2521
|
+
* Optional protocol extensions.
|
|
2522
|
+
*/
|
|
2523
|
+
export type X402V2PaymentPayloadExtensions = {
|
|
2524
|
+
[key: string]: unknown;
|
|
2525
|
+
};
|
|
2526
|
+
/**
|
|
2527
|
+
* The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header.
|
|
2528
|
+
*/
|
|
2529
|
+
export interface X402V2PaymentPayload {
|
|
2530
|
+
x402Version: X402Version;
|
|
2309
2531
|
/** The payload of the payment depending on the x402Version, scheme, and network. */
|
|
2310
|
-
payload:
|
|
2532
|
+
payload: X402V2PaymentPayloadPayload;
|
|
2533
|
+
accepted: X402V2PaymentRequirements;
|
|
2534
|
+
resource?: X402ResourceInfo;
|
|
2535
|
+
/** Optional protocol extensions. */
|
|
2536
|
+
extensions?: X402V2PaymentPayloadExtensions;
|
|
2311
2537
|
}
|
|
2538
|
+
/**
|
|
2539
|
+
* The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header.
|
|
2540
|
+
*/
|
|
2541
|
+
export type X402PaymentPayload = X402V1PaymentPayload | X402V2PaymentPayload;
|
|
2312
2542
|
/**
|
|
2313
2543
|
* The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`.
|
|
2314
2544
|
*/
|
|
2315
|
-
export type
|
|
2316
|
-
export declare const
|
|
2545
|
+
export type X402V1PaymentRequirementsScheme = (typeof X402V1PaymentRequirementsScheme)[keyof typeof X402V1PaymentRequirementsScheme];
|
|
2546
|
+
export declare const X402V1PaymentRequirementsScheme: {
|
|
2317
2547
|
readonly exact: "exact";
|
|
2318
2548
|
};
|
|
2319
2549
|
/**
|
|
2320
2550
|
* The network of the blockchain to send payment on.
|
|
2321
2551
|
*/
|
|
2322
|
-
export type
|
|
2323
|
-
export declare const
|
|
2552
|
+
export type X402V1PaymentRequirementsNetwork = (typeof X402V1PaymentRequirementsNetwork)[keyof typeof X402V1PaymentRequirementsNetwork];
|
|
2553
|
+
export declare const X402V1PaymentRequirementsNetwork: {
|
|
2324
2554
|
readonly "base-sepolia": "base-sepolia";
|
|
2325
2555
|
readonly base: "base";
|
|
2326
2556
|
readonly "solana-devnet": "solana-devnet";
|
|
@@ -2329,40 +2559,40 @@ export declare const X402PaymentRequirementsNetwork: {
|
|
|
2329
2559
|
/**
|
|
2330
2560
|
* The optional JSON schema describing the resource output.
|
|
2331
2561
|
*/
|
|
2332
|
-
export type
|
|
2562
|
+
export type X402V1PaymentRequirementsOutputSchema = {
|
|
2333
2563
|
[key: string]: unknown;
|
|
2334
2564
|
};
|
|
2335
2565
|
/**
|
|
2336
2566
|
* The optional additional scheme-specific payment info.
|
|
2337
2567
|
*/
|
|
2338
|
-
export type
|
|
2568
|
+
export type X402V1PaymentRequirementsExtra = {
|
|
2339
2569
|
[key: string]: unknown;
|
|
2340
2570
|
};
|
|
2341
2571
|
/**
|
|
2342
2572
|
* The x402 protocol payment requirements that the resource server expects the client's payment payload to meet.
|
|
2343
2573
|
*/
|
|
2344
|
-
export interface
|
|
2574
|
+
export interface X402V1PaymentRequirements {
|
|
2345
2575
|
/** The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. */
|
|
2346
|
-
scheme:
|
|
2576
|
+
scheme: X402V1PaymentRequirementsScheme;
|
|
2347
2577
|
/** The network of the blockchain to send payment on. */
|
|
2348
|
-
network:
|
|
2578
|
+
network: X402V1PaymentRequirementsNetwork;
|
|
2349
2579
|
/** The maximum amount required to pay for the resource in atomic units of the payment asset. */
|
|
2350
2580
|
maxAmountRequired: string;
|
|
2351
2581
|
/** The URL of the resource to pay for. */
|
|
2352
|
-
resource:
|
|
2582
|
+
resource: string;
|
|
2353
2583
|
/** The description of the resource. */
|
|
2354
2584
|
description: string;
|
|
2355
2585
|
/** The MIME type of the resource response. */
|
|
2356
2586
|
mimeType: string;
|
|
2357
2587
|
/** The optional JSON schema describing the resource output. */
|
|
2358
|
-
outputSchema?:
|
|
2588
|
+
outputSchema?: X402V1PaymentRequirementsOutputSchema;
|
|
2359
2589
|
/**
|
|
2360
2590
|
* The destination to pay value to.
|
|
2361
2591
|
|
|
2362
2592
|
For EVM networks, payTo will be a 0x-prefixed, checksum EVM address.
|
|
2363
2593
|
|
|
2364
2594
|
For Solana-based networks, payTo will be a base58-encoded Solana address.
|
|
2365
|
-
* @pattern ^0x[a-fA-F0-9]{40}|[
|
|
2595
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
2366
2596
|
*/
|
|
2367
2597
|
payTo: string;
|
|
2368
2598
|
/** The maximum time in seconds for the resource server to respond. */
|
|
@@ -2373,12 +2603,16 @@ export interface X402PaymentRequirements {
|
|
|
2373
2603
|
For EVM networks, the asset will be a 0x-prefixed, checksum EVM address.
|
|
2374
2604
|
|
|
2375
2605
|
For Solana-based networks, the asset will be a base58-encoded Solana address.
|
|
2376
|
-
* @pattern ^0x[a-fA-F0-9]{40}|[
|
|
2606
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
2377
2607
|
*/
|
|
2378
2608
|
asset: string;
|
|
2379
2609
|
/** The optional additional scheme-specific payment info. */
|
|
2380
|
-
extra?:
|
|
2610
|
+
extra?: X402V1PaymentRequirementsExtra;
|
|
2381
2611
|
}
|
|
2612
|
+
/**
|
|
2613
|
+
* The x402 protocol payment requirements that the resource server expects the client's payment payload to meet.
|
|
2614
|
+
*/
|
|
2615
|
+
export type X402PaymentRequirements = X402V1PaymentRequirements | X402V2PaymentRequirements;
|
|
2382
2616
|
/**
|
|
2383
2617
|
* The reason the payment is invalid on the x402 protocol.
|
|
2384
2618
|
*/
|
|
@@ -2420,6 +2654,23 @@ export declare const X402VerifyInvalidReason: {
|
|
|
2420
2654
|
readonly invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts: "invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts";
|
|
2421
2655
|
readonly invalid_exact_svm_payload_transaction_fee_payer_transferring_funds: "invalid_exact_svm_payload_transaction_fee_payer_transferring_funds";
|
|
2422
2656
|
};
|
|
2657
|
+
/**
|
|
2658
|
+
* The result when x402 payment verification fails.
|
|
2659
|
+
*/
|
|
2660
|
+
export interface X402VerifyPaymentRejection {
|
|
2661
|
+
/** Indicates whether the payment is valid. */
|
|
2662
|
+
isValid: boolean;
|
|
2663
|
+
invalidReason: X402VerifyInvalidReason;
|
|
2664
|
+
/**
|
|
2665
|
+
* The onchain address of the client that is paying for the resource.
|
|
2666
|
+
|
|
2667
|
+
For EVM networks, the payer will be a 0x-prefixed, checksum EVM address.
|
|
2668
|
+
|
|
2669
|
+
For Solana-based networks, the payer will be a base58-encoded Solana address.
|
|
2670
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
2671
|
+
*/
|
|
2672
|
+
payer?: string;
|
|
2673
|
+
}
|
|
2423
2674
|
/**
|
|
2424
2675
|
* The reason the payment settlement errored on the x402 protocol.
|
|
2425
2676
|
*/
|
|
@@ -2438,9 +2689,38 @@ export declare const X402SettleErrorReason: {
|
|
|
2438
2689
|
readonly invalid_exact_evm_payload_authorization_from_address_kyt: "invalid_exact_evm_payload_authorization_from_address_kyt";
|
|
2439
2690
|
readonly invalid_exact_evm_payload_authorization_to_address_kyt: "invalid_exact_evm_payload_authorization_to_address_kyt";
|
|
2440
2691
|
readonly invalid_exact_evm_payload_signature_address: "invalid_exact_evm_payload_signature_address";
|
|
2692
|
+
readonly settle_exact_evm_transaction_confirmation_timed_out: "settle_exact_evm_transaction_confirmation_timed_out";
|
|
2693
|
+
readonly settle_exact_node_failure: "settle_exact_node_failure";
|
|
2694
|
+
readonly settle_exact_failed_onchain: "settle_exact_failed_onchain";
|
|
2441
2695
|
readonly settle_exact_svm_block_height_exceeded: "settle_exact_svm_block_height_exceeded";
|
|
2442
2696
|
readonly settle_exact_svm_transaction_confirmation_timed_out: "settle_exact_svm_transaction_confirmation_timed_out";
|
|
2443
2697
|
};
|
|
2698
|
+
/**
|
|
2699
|
+
* The result when x402 payment settlement fails.
|
|
2700
|
+
*/
|
|
2701
|
+
export interface X402SettlePaymentRejection {
|
|
2702
|
+
/** Indicates whether the payment settlement is successful. */
|
|
2703
|
+
success: boolean;
|
|
2704
|
+
errorReason: X402SettleErrorReason;
|
|
2705
|
+
/**
|
|
2706
|
+
* The onchain address of the client that is paying for the resource.
|
|
2707
|
+
|
|
2708
|
+
For EVM networks, the payer will be a 0x-prefixed, checksum EVM address.
|
|
2709
|
+
|
|
2710
|
+
For Solana-based networks, the payer will be a base58-encoded Solana address.
|
|
2711
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
2712
|
+
*/
|
|
2713
|
+
payer?: string;
|
|
2714
|
+
/**
|
|
2715
|
+
* The transaction of the settlement.
|
|
2716
|
+
For EVM networks, the transaction will be a 0x-prefixed, EVM transaction hash.
|
|
2717
|
+
For Solana-based networks, the transaction will be a base58-encoded Solana signature.
|
|
2718
|
+
* @pattern ^(0x[a-fA-F0-9]{64}|[1-9A-HJ-NP-Za-km-z]{87,88})$
|
|
2719
|
+
*/
|
|
2720
|
+
transaction?: string;
|
|
2721
|
+
/** The network where the settlement occurred. */
|
|
2722
|
+
network?: string;
|
|
2723
|
+
}
|
|
2444
2724
|
/**
|
|
2445
2725
|
* The scheme of the payment protocol.
|
|
2446
2726
|
*/
|
|
@@ -2577,6 +2857,13 @@ export declare const OnrampQuotePaymentMethodTypeId: {
|
|
|
2577
2857
|
readonly FIAT_WALLET: "FIAT_WALLET";
|
|
2578
2858
|
readonly CRYPTO_WALLET: "CRYPTO_WALLET";
|
|
2579
2859
|
};
|
|
2860
|
+
/**
|
|
2861
|
+
* A valid URI.
|
|
2862
|
+
* @minLength 5
|
|
2863
|
+
* @maxLength 2048
|
|
2864
|
+
* @pattern ^.*://.*$
|
|
2865
|
+
*/
|
|
2866
|
+
export type Uri = string;
|
|
2580
2867
|
/**
|
|
2581
2868
|
* An onramp session containing a ready-to-use onramp URL.
|
|
2582
2869
|
*/
|
|
@@ -2651,10 +2938,14 @@ export type X402VerifyResponseResponse = {
|
|
|
2651
2938
|
For EVM networks, the payer will be a 0x-prefixed, checksum EVM address.
|
|
2652
2939
|
|
|
2653
2940
|
For Solana-based networks, the payer will be a base58-encoded Solana address.
|
|
2654
|
-
* @pattern ^0x[a-fA-F0-9]{40}|[
|
|
2941
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
2655
2942
|
*/
|
|
2656
2943
|
payer: string;
|
|
2657
2944
|
};
|
|
2945
|
+
/**
|
|
2946
|
+
* Invalid payment verification on the x402 protocol.
|
|
2947
|
+
*/
|
|
2948
|
+
export type X402VerifyInvalidErrorResponse = X402VerifyPaymentRejection;
|
|
2658
2949
|
export type X402SettleResponseResponse = {
|
|
2659
2950
|
/** Indicates whether the payment settlement is successful. */
|
|
2660
2951
|
success: boolean;
|
|
@@ -2665,22 +2956,36 @@ export type X402SettleResponseResponse = {
|
|
|
2665
2956
|
For EVM networks, the payer will be a 0x-prefixed, checksum EVM address.
|
|
2666
2957
|
|
|
2667
2958
|
For Solana-based networks, the payer will be a base58-encoded Solana address.
|
|
2668
|
-
* @pattern ^0x[a-fA-F0-9]{40}|[
|
|
2959
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
2669
2960
|
*/
|
|
2670
2961
|
payer: string;
|
|
2671
2962
|
/**
|
|
2672
2963
|
* The transaction of the settlement.
|
|
2673
2964
|
For EVM networks, the transaction will be a 0x-prefixed, EVM transaction hash.
|
|
2674
2965
|
For Solana-based networks, the transaction will be a base58-encoded Solana signature.
|
|
2675
|
-
* @pattern ^0x[a-fA-F0-9]{
|
|
2966
|
+
* @pattern ^(0x[a-fA-F0-9]{64}|[1-9A-HJ-NP-Za-km-z]{87,88})$
|
|
2676
2967
|
*/
|
|
2677
2968
|
transaction: string;
|
|
2678
2969
|
/** The network where the settlement occurred. */
|
|
2679
2970
|
network: string;
|
|
2680
2971
|
};
|
|
2972
|
+
/**
|
|
2973
|
+
* Unsuccessful payment settlement on the x402 protocol.
|
|
2974
|
+
*/
|
|
2975
|
+
export type X402SettleErrorResponse = X402SettlePaymentRejection;
|
|
2976
|
+
/**
|
|
2977
|
+
* A map of CAIP-2 network or protocol family patterns to their supported signer addresses.
|
|
2978
|
+
*/
|
|
2979
|
+
export type X402SupportedPaymentKindsResponseResponseSigners = {
|
|
2980
|
+
[key: string]: string[];
|
|
2981
|
+
};
|
|
2681
2982
|
export type X402SupportedPaymentKindsResponseResponse = {
|
|
2682
2983
|
/** The list of supported payment kinds. */
|
|
2683
2984
|
kinds: X402SupportedPaymentKind[];
|
|
2985
|
+
/** The list of supported x402 extensions. */
|
|
2986
|
+
extensions: string[];
|
|
2987
|
+
/** A map of CAIP-2 network or protocol family patterns to their supported signer addresses. */
|
|
2988
|
+
signers: X402SupportedPaymentKindsResponseResponseSigners;
|
|
2684
2989
|
};
|
|
2685
2990
|
/**
|
|
2686
2991
|
* Rate limit exceeded.
|
|
@@ -2714,6 +3019,8 @@ export type PageTokenParameter = string;
|
|
|
2714
3019
|
export type CreateEndUserBodyEvmAccount = {
|
|
2715
3020
|
/** If true, creates an EVM smart account and a default EVM EOA account as the owner. If false, only a EVM EOA account is created. */
|
|
2716
3021
|
createSmartAccount?: boolean;
|
|
3022
|
+
/** If true, enables spend permissions for the EVM smart account. */
|
|
3023
|
+
enableSpendPermissions?: boolean;
|
|
2717
3024
|
};
|
|
2718
3025
|
/**
|
|
2719
3026
|
* Configuration for creating a Solana account for the end user.
|
|
@@ -3362,11 +3669,11 @@ export type CreateOnrampSessionBody = {
|
|
|
3362
3669
|
country?: string;
|
|
3363
3670
|
/** The ISO 3166-2 two letter state code (e.g. NY). Only required for US. */
|
|
3364
3671
|
subdivision?: string;
|
|
3365
|
-
/**
|
|
3366
|
-
redirectUrl?:
|
|
3672
|
+
/** URI to redirect the user to when they successfully complete a transaction. This URI will be embedded in the returned onramp URI as a query parameter. */
|
|
3673
|
+
redirectUrl?: Uri;
|
|
3367
3674
|
/** The IP address of the end user requesting the onramp transaction. */
|
|
3368
3675
|
clientIp?: string;
|
|
3369
|
-
/** A unique string that represents the user in your app. This can be used to link individual transactions
|
|
3676
|
+
/** A unique string that represents the user in your app. This can be used to link individual transactions together so you can retrieve the transaction history for your users. Prefix this string with “sandbox-” (e.g. "sandbox-user-1234") to perform a sandbox transaction which will allow you to test your integration without any real transfer of funds.
|
|
3370
3677
|
|
|
3371
3678
|
This value can be used with with [Onramp User Transactions API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-onramp-transactions-by-id) to retrieve all transactions created by the user. */
|
|
3372
3679
|
partnerUserRef?: string;
|