@coinbase/cdp-sdk 1.43.1 → 1.44.1
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 +18 -0
- package/README.md +55 -0
- package/_cjs/actions/evm/sendUserOperation.js +23 -10
- package/_cjs/actions/evm/sendUserOperation.js.map +1 -1
- package/_cjs/actions/evm/transfer/utils.js.map +1 -1
- package/_cjs/analytics.js +22 -23
- package/_cjs/analytics.js.map +1 -1
- package/_cjs/auth/utils/hash.js +1 -1
- package/_cjs/auth/utils/hash.js.map +1 -1
- package/_cjs/auth/utils/http.js +4 -1
- package/_cjs/auth/utils/http.js.map +1 -1
- package/_cjs/client/end-user/endUser.js +87 -4
- package/_cjs/client/end-user/endUser.js.map +1 -1
- package/_cjs/client/end-user/toEndUserAccount.js +51 -0
- package/_cjs/client/end-user/toEndUserAccount.js.map +1 -0
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +6 -2
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js +43 -1
- package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -1
- package/_cjs/openapi-client/generated/webhooks/webhooks.js +8 -1
- package/_cjs/openapi-client/generated/webhooks/webhooks.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/actions/evm/sendUserOperation.js +23 -10
- package/_esm/actions/evm/sendUserOperation.js.map +1 -1
- package/_esm/actions/evm/transfer/utils.js.map +1 -1
- package/_esm/analytics.js +22 -23
- package/_esm/analytics.js.map +1 -1
- package/_esm/auth/utils/hash.js +1 -1
- package/_esm/auth/utils/hash.js.map +1 -1
- package/_esm/auth/utils/http.js +4 -1
- package/_esm/auth/utils/http.js.map +1 -1
- package/_esm/client/end-user/endUser.js +88 -5
- package/_esm/client/end-user/endUser.js.map +1 -1
- package/_esm/client/end-user/toEndUserAccount.js +48 -0
- package/_esm/client/end-user/toEndUserAccount.js.map +1 -0
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +6 -2
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js +39 -0
- package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -1
- package/_esm/openapi-client/generated/webhooks/webhooks.js +8 -1
- package/_esm/openapi-client/generated/webhooks/webhooks.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/actions/evm/sendUserOperation.d.ts.map +1 -1
- package/_types/actions/evm/transfer/utils.d.ts +2 -1
- package/_types/actions/evm/transfer/utils.d.ts.map +1 -1
- package/_types/analytics.d.ts.map +1 -1
- package/_types/auth/utils/http.d.ts.map +1 -1
- package/_types/client/end-user/endUser.d.ts +64 -6
- package/_types/client/end-user/endUser.d.ts.map +1 -1
- package/_types/client/end-user/endUser.types.d.ts +119 -1
- package/_types/client/end-user/endUser.types.d.ts.map +1 -1
- package/_types/client/end-user/toEndUserAccount.d.ts +20 -0
- package/_types/client/end-user/toEndUserAccount.d.ts.map +1 -0
- package/_types/index.d.ts +1 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +104 -211
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
- package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.d.ts +22 -1
- package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.d.ts.map +1 -1
- package/_types/openapi-client/generated/webhooks/webhooks.d.ts +8 -1
- package/_types/openapi-client/generated/webhooks/webhooks.d.ts.map +1 -1
- package/_types/openapi-client/index.d.ts +3 -0
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/actions/evm/sendUserOperation.ts +45 -11
- package/actions/evm/transfer/utils.ts +4 -2
- package/analytics.ts +24 -34
- package/auth/utils/hash.ts +1 -1
- package/auth/utils/http.ts +5 -2
- package/client/end-user/endUser.ts +118 -13
- package/client/end-user/endUser.types.ts +135 -0
- package/client/end-user/toEndUserAccount.ts +80 -0
- package/index.ts +1 -1
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +106 -208
- package/openapi-client/generated/end-user-accounts/end-user-accounts.ts +75 -0
- package/openapi-client/generated/webhooks/webhooks.ts +8 -1
- package/package.json +1 -1
- package/version.ts +1 -1
|
@@ -235,8 +235,6 @@ export declare const ErrorType: {
|
|
|
235
235
|
readonly mfa_flow_expired: "mfa_flow_expired";
|
|
236
236
|
readonly mfa_required: "mfa_required";
|
|
237
237
|
readonly mfa_not_enrolled: "mfa_not_enrolled";
|
|
238
|
-
readonly mfa_multiple_methods_available: "mfa_multiple_methods_available";
|
|
239
|
-
readonly mfa_invalid_method: "mfa_invalid_method";
|
|
240
238
|
};
|
|
241
239
|
/**
|
|
242
240
|
* A valid HTTP or HTTPS URL.
|
|
@@ -2086,6 +2084,18 @@ export interface AccountTokenAddressesResponse {
|
|
|
2086
2084
|
*/
|
|
2087
2085
|
totalCount?: number;
|
|
2088
2086
|
}
|
|
2087
|
+
/**
|
|
2088
|
+
* A human-readable description.
|
|
2089
|
+
* @minLength 0
|
|
2090
|
+
* @maxLength 500
|
|
2091
|
+
*/
|
|
2092
|
+
export type Description = string;
|
|
2093
|
+
/**
|
|
2094
|
+
* Optional metadata as key-value pairs. Use this to store additional structured information on a resource, such as customer IDs, order references, or any application-specific data. Up to 50 key/value pairs may be provided. Keys and values are both strings. Keys must be ≤ 40 characters; values must be ≤ 500 characters.
|
|
2095
|
+
*/
|
|
2096
|
+
export interface Metadata {
|
|
2097
|
+
[key: string]: string;
|
|
2098
|
+
}
|
|
2089
2099
|
/**
|
|
2090
2100
|
* Additional headers to include in webhook requests.
|
|
2091
2101
|
*/
|
|
@@ -2103,16 +2113,17 @@ export interface WebhookTarget {
|
|
|
2103
2113
|
/** Additional headers to include in webhook requests. */
|
|
2104
2114
|
headers?: WebhookTargetHeaders;
|
|
2105
2115
|
}
|
|
2106
|
-
|
|
2107
|
-
* Additional metadata for the subscription.
|
|
2108
|
-
*/
|
|
2109
|
-
export type WebhookSubscriptionResponseMetadata = {
|
|
2116
|
+
export type WebhookSubscriptionResponseMetadataAllOf = {
|
|
2110
2117
|
/**
|
|
2111
2118
|
* Use the root-level `secret` field instead. Maintained for backward compatibility only.
|
|
2112
2119
|
* @deprecated
|
|
2113
2120
|
*/
|
|
2114
2121
|
secret?: string;
|
|
2115
2122
|
};
|
|
2123
|
+
/**
|
|
2124
|
+
* Additional metadata for the subscription.
|
|
2125
|
+
*/
|
|
2126
|
+
export type WebhookSubscriptionResponseMetadata = Metadata & WebhookSubscriptionResponseMetadataAllOf;
|
|
2116
2127
|
/**
|
|
2117
2128
|
* Multi-label filters using total overlap logic. Total overlap means the subscription only triggers when events contain ALL these key-value pairs.
|
|
2118
2129
|
Present when subscription uses multi-label format.
|
|
@@ -2128,7 +2139,7 @@ export interface WebhookSubscriptionResponse {
|
|
|
2128
2139
|
/** When the subscription was created. */
|
|
2129
2140
|
createdAt: string;
|
|
2130
2141
|
/** Description of the webhook subscription. */
|
|
2131
|
-
description?:
|
|
2142
|
+
description?: Description;
|
|
2132
2143
|
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2133
2144
|
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2134
2145
|
*/
|
|
@@ -2142,24 +2153,6 @@ export interface WebhookSubscriptionResponse {
|
|
|
2142
2153
|
/** Unique identifier for the subscription. */
|
|
2143
2154
|
subscriptionId: string;
|
|
2144
2155
|
target: WebhookTarget;
|
|
2145
|
-
/**
|
|
2146
|
-
* (Deprecated) Use `labels` field instead.
|
|
2147
|
-
|
|
2148
|
-
Label key for filtering events. Present when subscription uses traditional single-label format.
|
|
2149
|
-
Maintained for backward compatibility only.
|
|
2150
|
-
|
|
2151
|
-
* @deprecated
|
|
2152
|
-
*/
|
|
2153
|
-
labelKey?: string;
|
|
2154
|
-
/**
|
|
2155
|
-
* (Deprecated) Use `labels` field instead.
|
|
2156
|
-
|
|
2157
|
-
Label value for filtering events. Present when subscription uses traditional single-label format.
|
|
2158
|
-
Maintained for backward compatibility only.
|
|
2159
|
-
|
|
2160
|
-
* @deprecated
|
|
2161
|
-
*/
|
|
2162
|
-
labelValue?: string;
|
|
2163
2156
|
/** Multi-label filters using total overlap logic. Total overlap means the subscription only triggers when events contain ALL these key-value pairs.
|
|
2164
2157
|
Present when subscription uses multi-label format.
|
|
2165
2158
|
*/
|
|
@@ -2174,15 +2167,9 @@ export type WebhookSubscriptionListResponseAllOf = {
|
|
|
2174
2167
|
};
|
|
2175
2168
|
export type WebhookSubscriptionListResponse = WebhookSubscriptionListResponseAllOf & ListResponse;
|
|
2176
2169
|
/**
|
|
2177
|
-
*
|
|
2178
|
-
*/
|
|
2179
|
-
export type WebhookSubscriptionRequestMetadata = {
|
|
2180
|
-
[key: string]: unknown;
|
|
2181
|
-
};
|
|
2182
|
-
/**
|
|
2183
|
-
* Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2170
|
+
* Optional. Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2184
2171
|
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2185
|
-
the event are allowed and will not prevent matching.
|
|
2172
|
+
the event are allowed and will not prevent matching. Omit to receive all events for the selected event types.
|
|
2186
2173
|
|
|
2187
2174
|
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2188
2175
|
|
|
@@ -2193,200 +2180,67 @@ export type WebhookSubscriptionRequestLabels = {
|
|
|
2193
2180
|
[key: string]: string;
|
|
2194
2181
|
};
|
|
2195
2182
|
/**
|
|
2196
|
-
* Request to create a new webhook subscription with support for
|
|
2197
|
-
and multi-label filtering formats.
|
|
2183
|
+
* Request to create a new webhook subscription with support for multi-label filtering.
|
|
2198
2184
|
|
|
2199
2185
|
*/
|
|
2200
|
-
export
|
|
2186
|
+
export interface WebhookSubscriptionRequest {
|
|
2201
2187
|
/** Description of the webhook subscription. */
|
|
2202
|
-
description?:
|
|
2188
|
+
description?: Description;
|
|
2203
2189
|
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2204
|
-
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2205
|
-
The subscription will only receive events matching these types AND the label filter(s).
|
|
2206
|
-
*/
|
|
2207
|
-
eventTypes
|
|
2208
|
-
/** Whether the subscription is enabled. */
|
|
2209
|
-
isEnabled?: boolean;
|
|
2210
|
-
target?: WebhookTarget;
|
|
2211
|
-
/** Additional metadata for the subscription. */
|
|
2212
|
-
metadata?: WebhookSubscriptionRequestMetadata;
|
|
2213
|
-
/**
|
|
2214
|
-
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2215
|
-
|
|
2216
|
-
Label key for filtering events. Each subscription filters on exactly one (labelKey, labelValue) pair
|
|
2217
|
-
in addition to the event types. Only events matching both the event types AND this label filter will be delivered.
|
|
2218
|
-
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2219
|
-
|
|
2220
|
-
Maintained for backward compatibility only.
|
|
2221
|
-
|
|
2222
|
-
* @deprecated
|
|
2223
|
-
*/
|
|
2224
|
-
labelKey?: string;
|
|
2225
|
-
/**
|
|
2226
|
-
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2227
|
-
|
|
2228
|
-
Label value for filtering events. Must correspond to the labelKey (e.g., contract address for contract_address key).
|
|
2229
|
-
Only events with this exact label value will be delivered.
|
|
2230
|
-
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2231
|
-
|
|
2232
|
-
Maintained for backward compatibility only.
|
|
2233
|
-
|
|
2234
|
-
* @deprecated
|
|
2235
|
-
*/
|
|
2236
|
-
labelValue?: string;
|
|
2237
|
-
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2238
|
-
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2239
|
-
the event are allowed and will not prevent matching.
|
|
2240
|
-
|
|
2241
|
-
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2242
|
-
|
|
2243
|
-
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2244
|
-
*/
|
|
2245
|
-
labels?: WebhookSubscriptionRequestLabels;
|
|
2246
|
-
}) | (unknown & {
|
|
2247
|
-
/** Description of the webhook subscription. */
|
|
2248
|
-
description?: string;
|
|
2249
|
-
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2250
|
-
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2251
|
-
The subscription will only receive events matching these types AND the label filter(s).
|
|
2252
|
-
*/
|
|
2253
|
-
eventTypes?: string[];
|
|
2190
|
+
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2191
|
+
The subscription will only receive events matching these types AND the label filter(s).
|
|
2192
|
+
*/
|
|
2193
|
+
eventTypes: string[];
|
|
2254
2194
|
/** Whether the subscription is enabled. */
|
|
2255
|
-
isEnabled
|
|
2256
|
-
target
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
Maintained for backward compatibility only.
|
|
2267
|
-
|
|
2268
|
-
* @deprecated
|
|
2269
|
-
*/
|
|
2270
|
-
labelKey?: string;
|
|
2271
|
-
/**
|
|
2272
|
-
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2273
|
-
|
|
2274
|
-
Label value for filtering events. Must correspond to the labelKey (e.g., contract address for contract_address key).
|
|
2275
|
-
Only events with this exact label value will be delivered.
|
|
2276
|
-
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2277
|
-
|
|
2278
|
-
Maintained for backward compatibility only.
|
|
2279
|
-
|
|
2280
|
-
* @deprecated
|
|
2281
|
-
*/
|
|
2282
|
-
labelValue?: string;
|
|
2283
|
-
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2284
|
-
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2285
|
-
the event are allowed and will not prevent matching.
|
|
2286
|
-
|
|
2287
|
-
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2288
|
-
|
|
2289
|
-
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2290
|
-
*/
|
|
2195
|
+
isEnabled: boolean;
|
|
2196
|
+
target: WebhookTarget;
|
|
2197
|
+
metadata?: Metadata;
|
|
2198
|
+
/** Optional. Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2199
|
+
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2200
|
+
the event are allowed and will not prevent matching. Omit to receive all events for the selected event types.
|
|
2201
|
+
|
|
2202
|
+
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2203
|
+
|
|
2204
|
+
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2205
|
+
*/
|
|
2291
2206
|
labels?: WebhookSubscriptionRequestLabels;
|
|
2292
|
-
}
|
|
2293
|
-
/**
|
|
2294
|
-
* Additional metadata for the subscription.
|
|
2295
|
-
*/
|
|
2296
|
-
export type WebhookSubscriptionUpdateRequestMetadata = {
|
|
2297
|
-
[key: string]: unknown;
|
|
2298
|
-
};
|
|
2207
|
+
}
|
|
2299
2208
|
/**
|
|
2300
|
-
* Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2209
|
+
* Optional. Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2301
2210
|
|
|
2302
2211
|
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2303
2212
|
|
|
2304
2213
|
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2214
|
+
Omit to receive all events for the selected event types.
|
|
2305
2215
|
|
|
2306
2216
|
*/
|
|
2307
2217
|
export type WebhookSubscriptionUpdateRequestLabels = {
|
|
2308
2218
|
[key: string]: string;
|
|
2309
2219
|
};
|
|
2310
2220
|
/**
|
|
2311
|
-
* Request to update an existing webhook subscription.
|
|
2312
|
-
the original subscription format (traditional or multi-label).
|
|
2313
|
-
|
|
2314
|
-
*/
|
|
2315
|
-
export type WebhookSubscriptionUpdateRequest = (unknown & {
|
|
2316
|
-
/** Description of the webhook subscription. */
|
|
2317
|
-
description?: string;
|
|
2318
|
-
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2319
|
-
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2320
|
-
*/
|
|
2321
|
-
eventTypes?: string[];
|
|
2322
|
-
/** Whether the subscription is enabled. */
|
|
2323
|
-
isEnabled?: boolean;
|
|
2324
|
-
target?: WebhookTarget;
|
|
2325
|
-
/** Additional metadata for the subscription. */
|
|
2326
|
-
metadata?: WebhookSubscriptionUpdateRequestMetadata;
|
|
2327
|
-
/** Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2328
|
-
|
|
2329
|
-
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2330
|
-
|
|
2331
|
-
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2332
|
-
*/
|
|
2333
|
-
labels?: WebhookSubscriptionUpdateRequestLabels;
|
|
2334
|
-
/**
|
|
2335
|
-
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2221
|
+
* Request to update an existing webhook subscription.
|
|
2336
2222
|
|
|
2337
|
-
Label key for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2338
|
-
Maintained for backward compatibility only.
|
|
2339
|
-
|
|
2340
|
-
* @deprecated
|
|
2341
|
-
*/
|
|
2342
|
-
labelKey?: string;
|
|
2343
|
-
/**
|
|
2344
|
-
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2345
|
-
|
|
2346
|
-
Label value for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2347
|
-
Maintained for backward compatibility only.
|
|
2348
|
-
|
|
2349
|
-
* @deprecated
|
|
2350
2223
|
*/
|
|
2351
|
-
|
|
2352
|
-
}) | (unknown & {
|
|
2224
|
+
export interface WebhookSubscriptionUpdateRequest {
|
|
2353
2225
|
/** Description of the webhook subscription. */
|
|
2354
|
-
description?:
|
|
2226
|
+
description?: Description;
|
|
2355
2227
|
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2356
|
-
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2357
|
-
*/
|
|
2358
|
-
eventTypes
|
|
2228
|
+
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2229
|
+
*/
|
|
2230
|
+
eventTypes: string[];
|
|
2359
2231
|
/** Whether the subscription is enabled. */
|
|
2360
|
-
isEnabled
|
|
2361
|
-
target
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
*/
|
|
2232
|
+
isEnabled: boolean;
|
|
2233
|
+
target: WebhookTarget;
|
|
2234
|
+
metadata?: Metadata;
|
|
2235
|
+
/** Optional. Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2236
|
+
|
|
2237
|
+
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2238
|
+
|
|
2239
|
+
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2240
|
+
Omit to receive all events for the selected event types.
|
|
2241
|
+
*/
|
|
2370
2242
|
labels?: WebhookSubscriptionUpdateRequestLabels;
|
|
2371
|
-
|
|
2372
|
-
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2373
|
-
|
|
2374
|
-
Label key for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2375
|
-
Maintained for backward compatibility only.
|
|
2376
|
-
|
|
2377
|
-
* @deprecated
|
|
2378
|
-
*/
|
|
2379
|
-
labelKey?: string;
|
|
2380
|
-
/**
|
|
2381
|
-
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2382
|
-
|
|
2383
|
-
Label value for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2384
|
-
Maintained for backward compatibility only.
|
|
2385
|
-
|
|
2386
|
-
* @deprecated
|
|
2387
|
-
*/
|
|
2388
|
-
labelValue?: string;
|
|
2389
|
-
});
|
|
2243
|
+
}
|
|
2390
2244
|
/**
|
|
2391
2245
|
* The version of the x402 protocol.
|
|
2392
2246
|
*/
|
|
@@ -2519,8 +2373,8 @@ export interface X402V2PaymentRequirements {
|
|
|
2519
2373
|
export interface X402ResourceInfo {
|
|
2520
2374
|
/** The URL of the resource. */
|
|
2521
2375
|
url?: string;
|
|
2522
|
-
/**
|
|
2523
|
-
description?:
|
|
2376
|
+
/** A human-readable description of the resource. */
|
|
2377
|
+
description?: Description;
|
|
2524
2378
|
/** The MIME type of the resource response. */
|
|
2525
2379
|
mimeType?: string;
|
|
2526
2380
|
}
|
|
@@ -2591,8 +2445,8 @@ export interface X402V1PaymentRequirements {
|
|
|
2591
2445
|
maxAmountRequired: string;
|
|
2592
2446
|
/** The URL of the resource to pay for. */
|
|
2593
2447
|
resource: string;
|
|
2594
|
-
/**
|
|
2595
|
-
description:
|
|
2448
|
+
/** A human-readable description of the resource. */
|
|
2449
|
+
description: Description;
|
|
2596
2450
|
/** The MIME type of the resource response. */
|
|
2597
2451
|
mimeType: string;
|
|
2598
2452
|
/** The optional JSON schema describing the resource output. */
|
|
@@ -2664,6 +2518,7 @@ export declare const X402VerifyInvalidReason: {
|
|
|
2664
2518
|
readonly invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata: "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata";
|
|
2665
2519
|
readonly invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts: "invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts";
|
|
2666
2520
|
readonly invalid_exact_svm_payload_transaction_fee_payer_transferring_funds: "invalid_exact_svm_payload_transaction_fee_payer_transferring_funds";
|
|
2521
|
+
readonly unknown_error: "unknown_error";
|
|
2667
2522
|
};
|
|
2668
2523
|
/**
|
|
2669
2524
|
* The result when x402 payment verification fails.
|
|
@@ -2672,6 +2527,8 @@ export interface X402VerifyPaymentRejection {
|
|
|
2672
2527
|
/** Indicates whether the payment is valid. */
|
|
2673
2528
|
isValid: boolean;
|
|
2674
2529
|
invalidReason: X402VerifyInvalidReason;
|
|
2530
|
+
/** The message describing the invalid reason. */
|
|
2531
|
+
invalidMessage?: string;
|
|
2675
2532
|
/**
|
|
2676
2533
|
* The onchain address of the client that is paying for the resource.
|
|
2677
2534
|
|
|
@@ -2727,6 +2584,7 @@ export declare const X402SettleErrorReason: {
|
|
|
2727
2584
|
readonly settle_exact_failed_onchain: "settle_exact_failed_onchain";
|
|
2728
2585
|
readonly settle_exact_svm_block_height_exceeded: "settle_exact_svm_block_height_exceeded";
|
|
2729
2586
|
readonly settle_exact_svm_transaction_confirmation_timed_out: "settle_exact_svm_transaction_confirmation_timed_out";
|
|
2587
|
+
readonly unknown_error: "unknown_error";
|
|
2730
2588
|
};
|
|
2731
2589
|
/**
|
|
2732
2590
|
* The result when x402 payment settlement fails.
|
|
@@ -2735,6 +2593,8 @@ export interface X402SettlePaymentRejection {
|
|
|
2735
2593
|
/** Indicates whether the payment settlement is successful. */
|
|
2736
2594
|
success: boolean;
|
|
2737
2595
|
errorReason: X402SettleErrorReason;
|
|
2596
|
+
/** The message describing the error reason. */
|
|
2597
|
+
errorMessage?: string;
|
|
2738
2598
|
/**
|
|
2739
2599
|
* The onchain address of the client that is paying for the resource.
|
|
2740
2600
|
|
|
@@ -2770,6 +2630,10 @@ export declare const X402SupportedPaymentKindNetwork: {
|
|
|
2770
2630
|
readonly base: "base";
|
|
2771
2631
|
readonly "solana-devnet": "solana-devnet";
|
|
2772
2632
|
readonly solana: "solana";
|
|
2633
|
+
readonly "eip155:8453": "eip155:8453";
|
|
2634
|
+
readonly "eip155:84532": "eip155:84532";
|
|
2635
|
+
readonly "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
2636
|
+
readonly "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1";
|
|
2773
2637
|
};
|
|
2774
2638
|
/**
|
|
2775
2639
|
* The optional additional scheme-specific payment info.
|
|
@@ -2789,6 +2653,12 @@ export interface X402SupportedPaymentKind {
|
|
|
2789
2653
|
/** The optional additional scheme-specific payment info. */
|
|
2790
2654
|
extra?: X402SupportedPaymentKindExtra;
|
|
2791
2655
|
}
|
|
2656
|
+
/**
|
|
2657
|
+
* A blockchain address. Format varies by network (e.g., 0x-prefixed for EVM, base58 for Solana).
|
|
2658
|
+
* @minLength 1
|
|
2659
|
+
* @maxLength 128
|
|
2660
|
+
*/
|
|
2661
|
+
export type BlockchainAddress = string;
|
|
2792
2662
|
/**
|
|
2793
2663
|
* The type of payment method to be used to complete an onramp order.
|
|
2794
2664
|
*/
|
|
@@ -2848,7 +2718,7 @@ export interface OnrampOrder {
|
|
|
2848
2718
|
/** The exchange rate used to convert fiat to crypto i.e. the crypto value of one fiat. */
|
|
2849
2719
|
exchangeRate: string;
|
|
2850
2720
|
/** The destination address to send the crypto to. */
|
|
2851
|
-
destinationAddress:
|
|
2721
|
+
destinationAddress: BlockchainAddress;
|
|
2852
2722
|
/** The network to send the crypto on. */
|
|
2853
2723
|
destinationNetwork: string;
|
|
2854
2724
|
status: OnrampOrderStatus;
|
|
@@ -2965,6 +2835,8 @@ export type X402VerifyResponseResponse = {
|
|
|
2965
2835
|
/** Indicates whether the payment is valid. */
|
|
2966
2836
|
isValid: boolean;
|
|
2967
2837
|
invalidReason?: X402VerifyInvalidReason;
|
|
2838
|
+
/** The message describing the invalid reason. */
|
|
2839
|
+
invalidMessage?: string;
|
|
2968
2840
|
/**
|
|
2969
2841
|
* The onchain address of the client that is paying for the resource.
|
|
2970
2842
|
|
|
@@ -2983,6 +2855,8 @@ export type X402SettleResponseResponse = {
|
|
|
2983
2855
|
/** Indicates whether the payment settlement is successful. */
|
|
2984
2856
|
success: boolean;
|
|
2985
2857
|
errorReason?: X402SettleErrorReason;
|
|
2858
|
+
/** The message describing the error reason. */
|
|
2859
|
+
errorMessage?: string;
|
|
2986
2860
|
/**
|
|
2987
2861
|
* The onchain address of the client that is paying for the resource.
|
|
2988
2862
|
|
|
@@ -3107,6 +2981,25 @@ export type ValidateEndUserAccessTokenBody = {
|
|
|
3107
2981
|
/** The access token in JWT format to verify. */
|
|
3108
2982
|
accessToken: string;
|
|
3109
2983
|
};
|
|
2984
|
+
export type AddEndUserEvmAccountBody = {
|
|
2985
|
+
[key: string]: unknown;
|
|
2986
|
+
};
|
|
2987
|
+
export type AddEndUserEvmAccount201 = {
|
|
2988
|
+
evmAccount: EndUserEvmAccount;
|
|
2989
|
+
};
|
|
2990
|
+
export type AddEndUserEvmSmartAccountBody = {
|
|
2991
|
+
/** If true, enables spend permissions for the EVM smart account. */
|
|
2992
|
+
enableSpendPermissions?: boolean;
|
|
2993
|
+
};
|
|
2994
|
+
export type AddEndUserEvmSmartAccount201 = {
|
|
2995
|
+
evmSmartAccount: EndUserEvmSmartAccount;
|
|
2996
|
+
};
|
|
2997
|
+
export type AddEndUserSolanaAccountBody = {
|
|
2998
|
+
[key: string]: unknown;
|
|
2999
|
+
};
|
|
3000
|
+
export type AddEndUserSolanaAccount201 = {
|
|
3001
|
+
solanaAccount: EndUserSolanaAccount;
|
|
3002
|
+
};
|
|
3110
3003
|
/**
|
|
3111
3004
|
* The type of key being imported. Determines what type of account will be associated for the end user.
|
|
3112
3005
|
*/
|
|
@@ -3658,7 +3551,7 @@ export type CreateOnrampOrderBody = {
|
|
|
3658
3551
|
/** The timestamp of when the user acknowledged that by using Coinbase Onramp they are accepting the Coinbase Terms (https://www.coinbase.com/legal/guest-checkout/us), User Agreement (https://www.coinbase.com/legal/user_agreement), and Privacy Policy (https://www.coinbase.com/legal/privacy). */
|
|
3659
3552
|
agreementAcceptedAt: string;
|
|
3660
3553
|
/** The address the purchased crypto will be sent to. */
|
|
3661
|
-
destinationAddress:
|
|
3554
|
+
destinationAddress: BlockchainAddress;
|
|
3662
3555
|
/** The name of the crypto network the purchased currency will be sent on.
|
|
3663
3556
|
|
|
3664
3557
|
Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location. */
|
|
@@ -3712,7 +3605,7 @@ export type CreateOnrampSessionBody = {
|
|
|
3712
3605
|
Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location. */
|
|
3713
3606
|
destinationNetwork: string;
|
|
3714
3607
|
/** The address the purchased crypto will be sent to. */
|
|
3715
|
-
destinationAddress:
|
|
3608
|
+
destinationAddress: BlockchainAddress;
|
|
3716
3609
|
/** A string representing the amount of fiat the user wishes to pay in exchange for crypto. When using this parameter, the returned quote will be inclusive of fees i.e. the user will pay this exact amount of the payment currency. */
|
|
3717
3610
|
paymentAmount?: string;
|
|
3718
3611
|
/** A string representing the amount of crypto the user wishes to purchase. When using this parameter, the returned quote will be exclusive of fees i.e. the user will receive this exact amount of the purchase currency. */
|