@coinbase/cdp-sdk 1.38.6 → 1.39.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 +6 -0
- package/README.md +17 -0
- package/_cjs/auth/utils/http.js +2 -1
- package/_cjs/auth/utils/http.js.map +1 -1
- package/_cjs/client/end-user/endUser.js +39 -0
- package/_cjs/client/end-user/endUser.js.map +1 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +19 -2
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js +25 -1
- package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -1
- package/_cjs/openapi-client/generated/onramp/onramp.js +1 -1
- package/_cjs/openapi-client/generated/sql-api-alpha/sql-api-alpha.js +1 -2
- package/_cjs/openapi-client/generated/sql-api-alpha/sql-api-alpha.js.map +1 -1
- package/_cjs/openapi-client/generated/webhooks/webhooks.js +130 -0
- package/_cjs/openapi-client/generated/webhooks/webhooks.js.map +1 -0
- package/_cjs/openapi-client/index.js +2 -0
- package/_cjs/openapi-client/index.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/auth/utils/http.js +2 -1
- package/_esm/auth/utils/http.js.map +1 -1
- package/_esm/client/end-user/endUser.js +39 -0
- package/_esm/client/end-user/endUser.js.map +1 -1
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +17 -0
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js +22 -0
- package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -1
- package/_esm/openapi-client/generated/onramp/onramp.js +1 -1
- package/_esm/openapi-client/generated/sql-api-alpha/sql-api-alpha.js +1 -2
- package/_esm/openapi-client/generated/sql-api-alpha/sql-api-alpha.js.map +1 -1
- package/_esm/openapi-client/generated/webhooks/webhooks.js +122 -0
- package/_esm/openapi-client/generated/webhooks/webhooks.js.map +1 -0
- package/_esm/openapi-client/index.js +2 -0
- package/_esm/openapi-client/index.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/auth/utils/http.d.ts.map +1 -1
- package/_types/client/end-user/endUser.d.ts +30 -1
- package/_types/client/end-user/endUser.d.ts.map +1 -1
- package/_types/client/end-user/endUser.types.d.ts +5 -1
- package/_types/client/end-user/endUser.types.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +369 -38
- 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 +16 -1
- package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.d.ts.map +1 -1
- package/_types/openapi-client/generated/onramp/onramp.d.ts +1 -1
- package/_types/openapi-client/generated/sql-api-alpha/sql-api-alpha.d.ts +1 -2
- package/_types/openapi-client/generated/sql-api-alpha/sql-api-alpha.d.ts.map +1 -1
- package/_types/openapi-client/generated/webhooks/webhooks.d.ts +117 -0
- package/_types/openapi-client/generated/webhooks/webhooks.d.ts.map +1 -0
- package/_types/openapi-client/index.d.ts +7 -0
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/auth/utils/http.ts +2 -1
- package/client/end-user/endUser.ts +48 -1
- package/client/end-user/endUser.types.ts +6 -1
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +390 -38
- package/openapi-client/generated/end-user-accounts/end-user-accounts.ts +31 -0
- package/openapi-client/generated/onramp/onramp.ts +1 -1
- package/openapi-client/generated/sql-api-alpha/sql-api-alpha.ts +1 -2
- package/openapi-client/generated/webhooks/webhooks.ts +185 -0
- package/openapi-client/index.ts +2 -0
- package/package.json +1 -1
- package/version.ts +1 -1
|
@@ -73,13 +73,41 @@ export interface DeveloperJWTAuthentication {
|
|
|
73
73
|
sub: string;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* The type of OAuth2 provider.
|
|
78
|
+
*/
|
|
79
|
+
export type OAuth2ProviderType = (typeof OAuth2ProviderType)[keyof typeof OAuth2ProviderType];
|
|
80
|
+
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
82
|
+
export const OAuth2ProviderType = {
|
|
83
|
+
google: "google",
|
|
84
|
+
apple: "apple",
|
|
85
|
+
x: "x",
|
|
86
|
+
} as const;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Information about an end user who authenticates using a third-party provider.
|
|
90
|
+
*/
|
|
91
|
+
export interface OAuth2Authentication {
|
|
92
|
+
type: OAuth2ProviderType;
|
|
93
|
+
/** The unique identifier for the end user that is captured in the `sub` claim of the JWT. */
|
|
94
|
+
sub: string;
|
|
95
|
+
/** The email address of the end user contained within the user's ID token, if available from third-party OAuth2 provider's token exchange. */
|
|
96
|
+
email?: string;
|
|
97
|
+
/** The full name of the end user if available from third-party OAuth2 provider's token exchange. */
|
|
98
|
+
name?: string;
|
|
99
|
+
/** The username of the end user if available from third-party OAuth2 provider's token exchange. */
|
|
100
|
+
username?: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
76
103
|
/**
|
|
77
104
|
* Information about how the end user is authenticated.
|
|
78
105
|
*/
|
|
79
106
|
export type AuthenticationMethod =
|
|
80
107
|
| EmailAuthentication
|
|
81
108
|
| SmsAuthentication
|
|
82
|
-
| DeveloperJWTAuthentication
|
|
109
|
+
| DeveloperJWTAuthentication
|
|
110
|
+
| OAuth2Authentication;
|
|
83
111
|
|
|
84
112
|
/**
|
|
85
113
|
* The list of valid authentication methods linked to the end user.
|
|
@@ -102,6 +130,8 @@ export interface EndUser {
|
|
|
102
130
|
evmSmartAccounts: string[];
|
|
103
131
|
/** The list of Solana accounts associated with the end user. Currently, only one Solana account is supported per end user. */
|
|
104
132
|
solanaAccounts: string[];
|
|
133
|
+
/** The date and time when the end user was created, in ISO 8601 format. */
|
|
134
|
+
createdAt: string;
|
|
105
135
|
}
|
|
106
136
|
|
|
107
137
|
export interface ListResponse {
|
|
@@ -146,8 +176,24 @@ export const ErrorType = {
|
|
|
146
176
|
recipient_allowlist_violation: "recipient_allowlist_violation",
|
|
147
177
|
recipient_allowlist_pending: "recipient_allowlist_pending",
|
|
148
178
|
travel_rules_recipient_violation: "travel_rules_recipient_violation",
|
|
179
|
+
transfer_amount_out_of_bounds: "transfer_amount_out_of_bounds",
|
|
180
|
+
transfer_recipient_address_invalid: "transfer_recipient_address_invalid",
|
|
181
|
+
transfer_quote_expired: "transfer_quote_expired",
|
|
182
|
+
mfa_already_enrolled: "mfa_already_enrolled",
|
|
183
|
+
mfa_invalid_code: "mfa_invalid_code",
|
|
184
|
+
mfa_flow_expired: "mfa_flow_expired",
|
|
185
|
+
mfa_required: "mfa_required",
|
|
186
|
+
mfa_not_enrolled: "mfa_not_enrolled",
|
|
149
187
|
} as const;
|
|
150
188
|
|
|
189
|
+
/**
|
|
190
|
+
* A valid HTTP or HTTPS URL.
|
|
191
|
+
* @minLength 11
|
|
192
|
+
* @maxLength 2048
|
|
193
|
+
* @pattern ^https?://.*$
|
|
194
|
+
*/
|
|
195
|
+
export type Url = string;
|
|
196
|
+
|
|
151
197
|
/**
|
|
152
198
|
* An error response including the code for the type of error and a human-readable message describing the error.
|
|
153
199
|
*/
|
|
@@ -158,7 +204,7 @@ export interface Error {
|
|
|
158
204
|
/** A unique identifier for the request that generated the error. This can be used to help debug issues with the API. */
|
|
159
205
|
correlationId?: string;
|
|
160
206
|
/** A link to the corresponding error documentation. */
|
|
161
|
-
errorLink?:
|
|
207
|
+
errorLink?: Url;
|
|
162
208
|
}
|
|
163
209
|
|
|
164
210
|
export interface EvmAccount {
|
|
@@ -406,7 +452,7 @@ export interface CreateSpendPermissionRequest {
|
|
|
406
452
|
/** Arbitrary data to include in the permission. */
|
|
407
453
|
extraData?: string;
|
|
408
454
|
/** The paymaster URL of the spend permission. */
|
|
409
|
-
paymasterUrl?:
|
|
455
|
+
paymasterUrl?: Url;
|
|
410
456
|
}
|
|
411
457
|
|
|
412
458
|
/**
|
|
@@ -463,7 +509,7 @@ export interface RevokeSpendPermissionRequest {
|
|
|
463
509
|
/** The hash of the spend permission to revoke. */
|
|
464
510
|
permissionHash: string;
|
|
465
511
|
/** The paymaster URL of the spend permission. */
|
|
466
|
-
paymasterUrl?:
|
|
512
|
+
paymasterUrl?: Url;
|
|
467
513
|
}
|
|
468
514
|
|
|
469
515
|
/**
|
|
@@ -2304,6 +2350,21 @@ export interface SolanaTokenBalance {
|
|
|
2304
2350
|
token: SolanaToken;
|
|
2305
2351
|
}
|
|
2306
2352
|
|
|
2353
|
+
/**
|
|
2354
|
+
* Enables control over how often queries need to be fully re-executed on the backing store.
|
|
2355
|
+
This can be useful in scenarios where API calls might be made frequently, API latency is critical, and some freshness lag (ex: 750ms, 2s, 5s) is tolerable.
|
|
2356
|
+
By default, each query result is returned from cache so long as the result is from an identical query and less than 500ms old. This freshness tolerance can be modified upwards, to a maximum of 900000ms (i.e. 900s, 15m).
|
|
2357
|
+
|
|
2358
|
+
*/
|
|
2359
|
+
export type OnchainDataQueryCache = {
|
|
2360
|
+
/**
|
|
2361
|
+
* The maximum tolerable staleness of the query result cache in milliseconds. If a previous execution result of an identical query is older than this age, the query will be re-executed. If the data is less than this age, the result will be returned from cache.
|
|
2362
|
+
* @minimum 500
|
|
2363
|
+
* @maximum 900000
|
|
2364
|
+
*/
|
|
2365
|
+
maxAgeMs?: number;
|
|
2366
|
+
};
|
|
2367
|
+
|
|
2307
2368
|
/**
|
|
2308
2369
|
* Request to execute a SQL query against indexed blockchain data.
|
|
2309
2370
|
*/
|
|
@@ -2311,9 +2372,14 @@ export interface OnchainDataQuery {
|
|
|
2311
2372
|
/**
|
|
2312
2373
|
* SQL query to execute against the indexed blockchain data.
|
|
2313
2374
|
* @minLength 1
|
|
2314
|
-
* @maxLength
|
|
2375
|
+
* @maxLength 100000
|
|
2315
2376
|
*/
|
|
2316
2377
|
sql: string;
|
|
2378
|
+
/** Enables control over how often queries need to be fully re-executed on the backing store.
|
|
2379
|
+
This can be useful in scenarios where API calls might be made frequently, API latency is critical, and some freshness lag (ex: 750ms, 2s, 5s) is tolerable.
|
|
2380
|
+
By default, each query result is returned from cache so long as the result is from an identical query and less than 500ms old. This freshness tolerance can be modified upwards, to a maximum of 900000ms (i.e. 900s, 15m).
|
|
2381
|
+
*/
|
|
2382
|
+
cache?: OnchainDataQueryCache;
|
|
2317
2383
|
}
|
|
2318
2384
|
|
|
2319
2385
|
/**
|
|
@@ -2371,8 +2437,10 @@ export type OnchainDataResultSchema = {
|
|
|
2371
2437
|
* Metadata about query execution.
|
|
2372
2438
|
*/
|
|
2373
2439
|
export type OnchainDataResultMetadata = {
|
|
2374
|
-
/** Whether the result was served from cache. */
|
|
2440
|
+
/** Whether the result was served from the query result cache. */
|
|
2375
2441
|
cached?: boolean;
|
|
2442
|
+
/** When the query result was executed against the backing store in RFC 3339 format. */
|
|
2443
|
+
executionTimestamp?: string;
|
|
2376
2444
|
/** Query execution time in milliseconds. */
|
|
2377
2445
|
executionTimeMs?: number;
|
|
2378
2446
|
/** Number of rows returned. */
|
|
@@ -2407,6 +2475,228 @@ export interface AccountTokenAddressesResponse {
|
|
|
2407
2475
|
totalCount?: number;
|
|
2408
2476
|
}
|
|
2409
2477
|
|
|
2478
|
+
/**
|
|
2479
|
+
* Additional headers to include in webhook requests.
|
|
2480
|
+
*/
|
|
2481
|
+
export type WebhookTargetHeaders = { [key: string]: string };
|
|
2482
|
+
|
|
2483
|
+
/**
|
|
2484
|
+
* Target configuration for webhook delivery.
|
|
2485
|
+
Specifies the destination URL and any custom headers to include in webhook requests.
|
|
2486
|
+
|
|
2487
|
+
*/
|
|
2488
|
+
export interface WebhookTarget {
|
|
2489
|
+
/** The webhook URL to deliver events to. */
|
|
2490
|
+
url: Url;
|
|
2491
|
+
/** Additional headers to include in webhook requests. */
|
|
2492
|
+
headers?: WebhookTargetHeaders;
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
/**
|
|
2496
|
+
* Additional metadata for the subscription.
|
|
2497
|
+
*/
|
|
2498
|
+
export type WebhookSubscriptionResponseMetadata = {
|
|
2499
|
+
/** Secret for webhook signature validation.
|
|
2500
|
+
|
|
2501
|
+
**Note:** Webhooks are in beta and this interface is subject to change.
|
|
2502
|
+
*/
|
|
2503
|
+
secret?: string;
|
|
2504
|
+
};
|
|
2505
|
+
|
|
2506
|
+
/**
|
|
2507
|
+
* Multi-label filters using total overlap logic. Total overlap means the subscription only triggers when events contain ALL these key-value pairs.
|
|
2508
|
+
Present when subscription uses multi-label format.
|
|
2509
|
+
|
|
2510
|
+
*/
|
|
2511
|
+
export type WebhookSubscriptionResponseLabels = { [key: string]: string };
|
|
2512
|
+
|
|
2513
|
+
/**
|
|
2514
|
+
* Response containing webhook subscription details.
|
|
2515
|
+
*/
|
|
2516
|
+
export interface WebhookSubscriptionResponse {
|
|
2517
|
+
/** When the subscription was created. */
|
|
2518
|
+
createdAt: string;
|
|
2519
|
+
/** Description of the webhook subscription. */
|
|
2520
|
+
description?: string;
|
|
2521
|
+
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2522
|
+
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2523
|
+
*/
|
|
2524
|
+
eventTypes: string[];
|
|
2525
|
+
/** Whether the subscription is enabled. */
|
|
2526
|
+
isEnabled: boolean;
|
|
2527
|
+
/** Additional metadata for the subscription. */
|
|
2528
|
+
metadata?: WebhookSubscriptionResponseMetadata;
|
|
2529
|
+
/** Unique identifier for the subscription. */
|
|
2530
|
+
subscriptionId: string;
|
|
2531
|
+
target: WebhookTarget;
|
|
2532
|
+
/** Label key for filtering events. Present when subscription uses traditional single-label format.
|
|
2533
|
+
*/
|
|
2534
|
+
labelKey?: string;
|
|
2535
|
+
/** Label value for filtering events. Present when subscription uses traditional single-label format.
|
|
2536
|
+
*/
|
|
2537
|
+
labelValue?: string;
|
|
2538
|
+
/** Multi-label filters using total overlap logic. Total overlap means the subscription only triggers when events contain ALL these key-value pairs.
|
|
2539
|
+
Present when subscription uses multi-label format.
|
|
2540
|
+
*/
|
|
2541
|
+
labels?: WebhookSubscriptionResponseLabels;
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
/**
|
|
2545
|
+
* Response containing a list of webhook subscriptions.
|
|
2546
|
+
*/
|
|
2547
|
+
export type WebhookSubscriptionListResponseAllOf = {
|
|
2548
|
+
/** The list of webhook subscriptions. */
|
|
2549
|
+
subscriptions: WebhookSubscriptionResponse[];
|
|
2550
|
+
};
|
|
2551
|
+
|
|
2552
|
+
export type WebhookSubscriptionListResponse = WebhookSubscriptionListResponseAllOf & ListResponse;
|
|
2553
|
+
|
|
2554
|
+
/**
|
|
2555
|
+
* Additional metadata for the subscription.
|
|
2556
|
+
*/
|
|
2557
|
+
export type WebhookSubscriptionRequestMetadata = { [key: string]: unknown };
|
|
2558
|
+
|
|
2559
|
+
/**
|
|
2560
|
+
* Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2561
|
+
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2562
|
+
the event are allowed and will not prevent matching.
|
|
2563
|
+
NOTE: Use either labels OR (labelKey + labelValue), not both.
|
|
2564
|
+
|
|
2565
|
+
*/
|
|
2566
|
+
export type WebhookSubscriptionRequestLabels = { [key: string]: string };
|
|
2567
|
+
|
|
2568
|
+
/**
|
|
2569
|
+
* Request to create a new webhook subscription with support for both traditional single-label
|
|
2570
|
+
and multi-label filtering formats.
|
|
2571
|
+
|
|
2572
|
+
*/
|
|
2573
|
+
export type WebhookSubscriptionRequest =
|
|
2574
|
+
| (unknown & {
|
|
2575
|
+
/** Description of the webhook subscription. */
|
|
2576
|
+
description?: string;
|
|
2577
|
+
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2578
|
+
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2579
|
+
The subscription will only receive events matching these types AND the label filter(s).
|
|
2580
|
+
*/
|
|
2581
|
+
eventTypes?: string[];
|
|
2582
|
+
/** Whether the subscription is enabled. */
|
|
2583
|
+
isEnabled?: boolean;
|
|
2584
|
+
target?: WebhookTarget;
|
|
2585
|
+
/** Additional metadata for the subscription. */
|
|
2586
|
+
metadata?: WebhookSubscriptionRequestMetadata;
|
|
2587
|
+
/** Label key for filtering events. Each subscription filters on exactly one (labelKey, labelValue) pair
|
|
2588
|
+
in addition to the event types. Only events matching both the event types AND this label filter will be delivered.
|
|
2589
|
+
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2590
|
+
*/
|
|
2591
|
+
labelKey?: string;
|
|
2592
|
+
/** Label value for filtering events. Must correspond to the labelKey (e.g., contract address for contract_address key).
|
|
2593
|
+
Only events with this exact label value will be delivered.
|
|
2594
|
+
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2595
|
+
*/
|
|
2596
|
+
labelValue?: string;
|
|
2597
|
+
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2598
|
+
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2599
|
+
the event are allowed and will not prevent matching.
|
|
2600
|
+
NOTE: Use either labels OR (labelKey + labelValue), not both.
|
|
2601
|
+
*/
|
|
2602
|
+
labels?: WebhookSubscriptionRequestLabels;
|
|
2603
|
+
})
|
|
2604
|
+
| (unknown & {
|
|
2605
|
+
/** Description of the webhook subscription. */
|
|
2606
|
+
description?: string;
|
|
2607
|
+
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2608
|
+
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2609
|
+
The subscription will only receive events matching these types AND the label filter(s).
|
|
2610
|
+
*/
|
|
2611
|
+
eventTypes?: string[];
|
|
2612
|
+
/** Whether the subscription is enabled. */
|
|
2613
|
+
isEnabled?: boolean;
|
|
2614
|
+
target?: WebhookTarget;
|
|
2615
|
+
/** Additional metadata for the subscription. */
|
|
2616
|
+
metadata?: WebhookSubscriptionRequestMetadata;
|
|
2617
|
+
/** Label key for filtering events. Each subscription filters on exactly one (labelKey, labelValue) pair
|
|
2618
|
+
in addition to the event types. Only events matching both the event types AND this label filter will be delivered.
|
|
2619
|
+
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2620
|
+
*/
|
|
2621
|
+
labelKey?: string;
|
|
2622
|
+
/** Label value for filtering events. Must correspond to the labelKey (e.g., contract address for contract_address key).
|
|
2623
|
+
Only events with this exact label value will be delivered.
|
|
2624
|
+
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2625
|
+
*/
|
|
2626
|
+
labelValue?: string;
|
|
2627
|
+
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2628
|
+
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2629
|
+
the event are allowed and will not prevent matching.
|
|
2630
|
+
NOTE: Use either labels OR (labelKey + labelValue), not both.
|
|
2631
|
+
*/
|
|
2632
|
+
labels?: WebhookSubscriptionRequestLabels;
|
|
2633
|
+
});
|
|
2634
|
+
|
|
2635
|
+
/**
|
|
2636
|
+
* Additional metadata for the subscription.
|
|
2637
|
+
*/
|
|
2638
|
+
export type WebhookSubscriptionUpdateRequestMetadata = { [key: string]: unknown };
|
|
2639
|
+
|
|
2640
|
+
/**
|
|
2641
|
+
* Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2642
|
+
an event contains ALL the key-value pairs specified here. Use either labels OR (labelKey + labelValue), not both.
|
|
2643
|
+
|
|
2644
|
+
*/
|
|
2645
|
+
export type WebhookSubscriptionUpdateRequestLabels = { [key: string]: string };
|
|
2646
|
+
|
|
2647
|
+
/**
|
|
2648
|
+
* Request to update an existing webhook subscription. The update format must match
|
|
2649
|
+
the original subscription format (traditional or multi-label).
|
|
2650
|
+
|
|
2651
|
+
*/
|
|
2652
|
+
export type WebhookSubscriptionUpdateRequest =
|
|
2653
|
+
| (unknown & {
|
|
2654
|
+
/** Description of the webhook subscription. */
|
|
2655
|
+
description?: string;
|
|
2656
|
+
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2657
|
+
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2658
|
+
*/
|
|
2659
|
+
eventTypes?: string[];
|
|
2660
|
+
/** Whether the subscription is enabled. */
|
|
2661
|
+
isEnabled?: boolean;
|
|
2662
|
+
target?: WebhookTarget;
|
|
2663
|
+
/** Additional metadata for the subscription. */
|
|
2664
|
+
metadata?: WebhookSubscriptionUpdateRequestMetadata;
|
|
2665
|
+
/** Label key for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2666
|
+
*/
|
|
2667
|
+
labelKey?: string;
|
|
2668
|
+
/** Label value for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2669
|
+
*/
|
|
2670
|
+
labelValue?: string;
|
|
2671
|
+
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2672
|
+
an event contains ALL the key-value pairs specified here. Use either labels OR (labelKey + labelValue), not both.
|
|
2673
|
+
*/
|
|
2674
|
+
labels?: WebhookSubscriptionUpdateRequestLabels;
|
|
2675
|
+
})
|
|
2676
|
+
| (unknown & {
|
|
2677
|
+
/** Description of the webhook subscription. */
|
|
2678
|
+
description?: string;
|
|
2679
|
+
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2680
|
+
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2681
|
+
*/
|
|
2682
|
+
eventTypes?: string[];
|
|
2683
|
+
/** Whether the subscription is enabled. */
|
|
2684
|
+
isEnabled?: boolean;
|
|
2685
|
+
target?: WebhookTarget;
|
|
2686
|
+
/** Additional metadata for the subscription. */
|
|
2687
|
+
metadata?: WebhookSubscriptionUpdateRequestMetadata;
|
|
2688
|
+
/** Label key for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2689
|
+
*/
|
|
2690
|
+
labelKey?: string;
|
|
2691
|
+
/** Label value for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2692
|
+
*/
|
|
2693
|
+
labelValue?: string;
|
|
2694
|
+
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2695
|
+
an event contains ALL the key-value pairs specified here. Use either labels OR (labelKey + labelValue), not both.
|
|
2696
|
+
*/
|
|
2697
|
+
labels?: WebhookSubscriptionUpdateRequestLabels;
|
|
2698
|
+
});
|
|
2699
|
+
|
|
2410
2700
|
/**
|
|
2411
2701
|
* The version of the x402 protocol.
|
|
2412
2702
|
*/
|
|
@@ -2548,7 +2838,7 @@ export interface X402PaymentRequirements {
|
|
|
2548
2838
|
/** The maximum amount required to pay for the resource in atomic units of the payment asset. */
|
|
2549
2839
|
maxAmountRequired: string;
|
|
2550
2840
|
/** The URL of the resource to pay for. */
|
|
2551
|
-
resource:
|
|
2841
|
+
resource: Url;
|
|
2552
2842
|
/** The description of the resource. */
|
|
2553
2843
|
description: string;
|
|
2554
2844
|
/** The MIME type of the resource response. */
|
|
@@ -2594,6 +2884,8 @@ export const X402VerifyInvalidReason = {
|
|
|
2594
2884
|
invalid_payment_requirements: "invalid_payment_requirements",
|
|
2595
2885
|
invalid_payload: "invalid_payload",
|
|
2596
2886
|
invalid_exact_evm_payload_authorization_value: "invalid_exact_evm_payload_authorization_value",
|
|
2887
|
+
invalid_exact_evm_payload_authorization_value_too_low:
|
|
2888
|
+
"invalid_exact_evm_payload_authorization_value_too_low",
|
|
2597
2889
|
invalid_exact_evm_payload_authorization_valid_after:
|
|
2598
2890
|
"invalid_exact_evm_payload_authorization_valid_after",
|
|
2599
2891
|
invalid_exact_evm_payload_authorization_valid_before:
|
|
@@ -2641,6 +2933,10 @@ export const X402VerifyInvalidReason = {
|
|
|
2641
2933
|
"invalid_exact_svm_payload_transaction_simulation_failed",
|
|
2642
2934
|
invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata:
|
|
2643
2935
|
"invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata",
|
|
2936
|
+
invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts:
|
|
2937
|
+
"invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts",
|
|
2938
|
+
invalid_exact_svm_payload_transaction_fee_payer_transferring_funds:
|
|
2939
|
+
"invalid_exact_svm_payload_transaction_fee_payer_transferring_funds",
|
|
2644
2940
|
} as const;
|
|
2645
2941
|
|
|
2646
2942
|
/**
|
|
@@ -2818,8 +3114,8 @@ export const OnrampPaymentLinkType = {
|
|
|
2818
3114
|
Please refer to the [Onramp docs](https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/onramp-overview) for details on how to integrate with the different payment link types.
|
|
2819
3115
|
*/
|
|
2820
3116
|
export interface OnrampPaymentLink {
|
|
2821
|
-
/** The URL to the hosted widget the user should be redirected to. For certain payment link types you can append your
|
|
2822
|
-
url:
|
|
3117
|
+
/** The URL to the hosted widget the user should be redirected to. For certain payment link types you can append your own redirect_url query parameter to this URL to ensure the user is redirected back to your app after the widget completes. */
|
|
3118
|
+
url: Url;
|
|
2823
3119
|
paymentLinkType: OnrampPaymentLinkType;
|
|
2824
3120
|
}
|
|
2825
3121
|
|
|
@@ -2844,7 +3140,7 @@ export const OnrampQuotePaymentMethodTypeId = {
|
|
|
2844
3140
|
*/
|
|
2845
3141
|
export interface OnrampSession {
|
|
2846
3142
|
/** Ready-to-use onramp URL. */
|
|
2847
|
-
onrampUrl:
|
|
3143
|
+
onrampUrl: Url;
|
|
2848
3144
|
}
|
|
2849
3145
|
|
|
2850
3146
|
/**
|
|
@@ -2979,6 +3275,47 @@ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/i
|
|
|
2979
3275
|
*/
|
|
2980
3276
|
export type IdempotencyKeyParameter = string;
|
|
2981
3277
|
|
|
3278
|
+
/**
|
|
3279
|
+
* The number of resources to return per page.
|
|
3280
|
+
*/
|
|
3281
|
+
export type PageSizeParameter = number;
|
|
3282
|
+
|
|
3283
|
+
/**
|
|
3284
|
+
* The token for the next page of resources, if any.
|
|
3285
|
+
*/
|
|
3286
|
+
export type PageTokenParameter = string;
|
|
3287
|
+
|
|
3288
|
+
/**
|
|
3289
|
+
* Configuration for creating an EVM account for the end user.
|
|
3290
|
+
*/
|
|
3291
|
+
export type CreateEndUserBodyEvmAccount = {
|
|
3292
|
+
/** 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. */
|
|
3293
|
+
createSmartAccount?: boolean;
|
|
3294
|
+
};
|
|
3295
|
+
|
|
3296
|
+
/**
|
|
3297
|
+
* Configuration for creating a Solana account for the end user.
|
|
3298
|
+
*/
|
|
3299
|
+
export type CreateEndUserBodySolanaAccount = {
|
|
3300
|
+
/** Only false is a valid option since currently smart accounts on Solana are not supported. */
|
|
3301
|
+
createSmartAccount?: boolean;
|
|
3302
|
+
};
|
|
3303
|
+
|
|
3304
|
+
export type CreateEndUserBody = {
|
|
3305
|
+
/**
|
|
3306
|
+
* A stable, unique identifier for the end user. The `userId` must be unique across all end users in the developer's CDP Project. It must be between 1 and 100 characters long and can only contain alphanumeric characters and hyphens.
|
|
3307
|
+
|
|
3308
|
+
If `userId` is not provided in the request, the server will generate a random UUID.
|
|
3309
|
+
* @pattern ^[a-zA-Z0-9-]{1,100}$
|
|
3310
|
+
*/
|
|
3311
|
+
userId?: string;
|
|
3312
|
+
authenticationMethods: AuthenticationMethods;
|
|
3313
|
+
/** Configuration for creating an EVM account for the end user. */
|
|
3314
|
+
evmAccount?: CreateEndUserBodyEvmAccount;
|
|
3315
|
+
/** Configuration for creating a Solana account for the end user. */
|
|
3316
|
+
solanaAccount?: CreateEndUserBodySolanaAccount;
|
|
3317
|
+
};
|
|
3318
|
+
|
|
2982
3319
|
export type ListEndUsersParams = {
|
|
2983
3320
|
/**
|
|
2984
3321
|
* The number of end users to return per page.
|
|
@@ -3019,13 +3356,13 @@ export type ValidateEndUserAccessTokenBody = {
|
|
|
3019
3356
|
|
|
3020
3357
|
export type ListEvmAccountsParams = {
|
|
3021
3358
|
/**
|
|
3022
|
-
* The number of
|
|
3359
|
+
* The number of resources to return per page.
|
|
3023
3360
|
*/
|
|
3024
|
-
pageSize?:
|
|
3361
|
+
pageSize?: PageSizeParameter;
|
|
3025
3362
|
/**
|
|
3026
|
-
* The token for the next page of
|
|
3363
|
+
* The token for the next page of resources, if any.
|
|
3027
3364
|
*/
|
|
3028
|
-
pageToken?:
|
|
3365
|
+
pageToken?: PageTokenParameter;
|
|
3029
3366
|
};
|
|
3030
3367
|
|
|
3031
3368
|
export type ListEvmAccounts200AllOf = {
|
|
@@ -3132,13 +3469,13 @@ export type SignEvmTypedData200 = {
|
|
|
3132
3469
|
|
|
3133
3470
|
export type ListEvmSmartAccountsParams = {
|
|
3134
3471
|
/**
|
|
3135
|
-
* The number of
|
|
3472
|
+
* The number of resources to return per page.
|
|
3136
3473
|
*/
|
|
3137
|
-
pageSize?:
|
|
3474
|
+
pageSize?: PageSizeParameter;
|
|
3138
3475
|
/**
|
|
3139
|
-
* The token for the next page of
|
|
3476
|
+
* The token for the next page of resources, if any.
|
|
3140
3477
|
*/
|
|
3141
|
-
pageToken?:
|
|
3478
|
+
pageToken?: PageTokenParameter;
|
|
3142
3479
|
};
|
|
3143
3480
|
|
|
3144
3481
|
export type ListEvmSmartAccounts200AllOf = {
|
|
@@ -3212,7 +3549,7 @@ export type PrepareUserOperationBody = {
|
|
|
3212
3549
|
/** The list of calls to make from the Smart Account. */
|
|
3213
3550
|
calls: EvmCall[];
|
|
3214
3551
|
/** The URL of the paymaster to use for the user operation. */
|
|
3215
|
-
paymasterUrl?:
|
|
3552
|
+
paymasterUrl?: Url;
|
|
3216
3553
|
};
|
|
3217
3554
|
|
|
3218
3555
|
export type PrepareAndSendUserOperationBody = {
|
|
@@ -3220,7 +3557,7 @@ export type PrepareAndSendUserOperationBody = {
|
|
|
3220
3557
|
/** The list of calls to make from the Smart Account. */
|
|
3221
3558
|
calls: EvmCall[];
|
|
3222
3559
|
/** The URL of the paymaster to use for the user operation. */
|
|
3223
|
-
paymasterUrl?:
|
|
3560
|
+
paymasterUrl?: Url;
|
|
3224
3561
|
};
|
|
3225
3562
|
|
|
3226
3563
|
export type SendUserOperationBody = {
|
|
@@ -3299,13 +3636,13 @@ export type CreateEvmSwapQuoteBody = {
|
|
|
3299
3636
|
|
|
3300
3637
|
export type ListEvmTokenBalancesParams = {
|
|
3301
3638
|
/**
|
|
3302
|
-
* The number of
|
|
3639
|
+
* The number of resources to return per page.
|
|
3303
3640
|
*/
|
|
3304
|
-
pageSize?:
|
|
3641
|
+
pageSize?: PageSizeParameter;
|
|
3305
3642
|
/**
|
|
3306
|
-
* The token for the next page of
|
|
3643
|
+
* The token for the next page of resources, if any.
|
|
3307
3644
|
*/
|
|
3308
|
-
pageToken?:
|
|
3645
|
+
pageToken?: PageTokenParameter;
|
|
3309
3646
|
};
|
|
3310
3647
|
|
|
3311
3648
|
export type ListEvmTokenBalances200AllOf = {
|
|
@@ -3362,13 +3699,13 @@ export type RequestEvmFaucet200 = {
|
|
|
3362
3699
|
|
|
3363
3700
|
export type ListPoliciesParams = {
|
|
3364
3701
|
/**
|
|
3365
|
-
* The number of
|
|
3702
|
+
* The number of resources to return per page.
|
|
3366
3703
|
*/
|
|
3367
|
-
pageSize?:
|
|
3704
|
+
pageSize?: PageSizeParameter;
|
|
3368
3705
|
/**
|
|
3369
|
-
* The token for the next page of
|
|
3706
|
+
* The token for the next page of resources, if any.
|
|
3370
3707
|
*/
|
|
3371
|
-
pageToken?:
|
|
3708
|
+
pageToken?: PageTokenParameter;
|
|
3372
3709
|
/**
|
|
3373
3710
|
* The scope of the policies to return. If `project`, the response will include exactly one policy, which is the project-level policy. If `account`, the response will include all account-level policies for the developer's CDP Project.
|
|
3374
3711
|
*/
|
|
@@ -3428,13 +3765,13 @@ Policy descriptions can consist of alphanumeric characters, spaces, commas, and
|
|
|
3428
3765
|
|
|
3429
3766
|
export type ListSolanaAccountsParams = {
|
|
3430
3767
|
/**
|
|
3431
|
-
* The number of
|
|
3768
|
+
* The number of resources to return per page.
|
|
3432
3769
|
*/
|
|
3433
|
-
pageSize?:
|
|
3770
|
+
pageSize?: PageSizeParameter;
|
|
3434
3771
|
/**
|
|
3435
|
-
* The token for the next page of
|
|
3772
|
+
* The token for the next page of resources, if any.
|
|
3436
3773
|
*/
|
|
3437
|
-
pageToken?:
|
|
3774
|
+
pageToken?: PageTokenParameter;
|
|
3438
3775
|
};
|
|
3439
3776
|
|
|
3440
3777
|
export type ListSolanaAccounts200AllOf = {
|
|
@@ -3596,13 +3933,13 @@ export type ListSolanaTokenBalances200 = ListSolanaTokenBalances200AllOf & ListR
|
|
|
3596
3933
|
|
|
3597
3934
|
export type ListDataTokenBalancesParams = {
|
|
3598
3935
|
/**
|
|
3599
|
-
* The number of
|
|
3936
|
+
* The number of resources to return per page.
|
|
3600
3937
|
*/
|
|
3601
|
-
pageSize?:
|
|
3938
|
+
pageSize?: PageSizeParameter;
|
|
3602
3939
|
/**
|
|
3603
|
-
* The token for the next page of
|
|
3940
|
+
* The token for the next page of resources, if any.
|
|
3604
3941
|
*/
|
|
3605
|
-
pageToken?:
|
|
3942
|
+
pageToken?: PageTokenParameter;
|
|
3606
3943
|
};
|
|
3607
3944
|
|
|
3608
3945
|
export type ListDataTokenBalances200AllOf = {
|
|
@@ -3612,6 +3949,17 @@ export type ListDataTokenBalances200AllOf = {
|
|
|
3612
3949
|
|
|
3613
3950
|
export type ListDataTokenBalances200 = ListDataTokenBalances200AllOf & ListResponse;
|
|
3614
3951
|
|
|
3952
|
+
export type ListWebhookSubscriptionsParams = {
|
|
3953
|
+
/**
|
|
3954
|
+
* The number of subscriptions to return per page.
|
|
3955
|
+
*/
|
|
3956
|
+
pageSize?: number;
|
|
3957
|
+
/**
|
|
3958
|
+
* The token for the next page of subscriptions, if any.
|
|
3959
|
+
*/
|
|
3960
|
+
pageToken?: string;
|
|
3961
|
+
};
|
|
3962
|
+
|
|
3615
3963
|
export type VerifyX402PaymentBody = {
|
|
3616
3964
|
x402Version: X402Version;
|
|
3617
3965
|
paymentPayload: X402PaymentPayload;
|
|
@@ -3695,10 +4043,14 @@ Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/res
|
|
|
3695
4043
|
country?: string;
|
|
3696
4044
|
/** The ISO 3166-2 two letter state code (e.g. NY). Only required for US. */
|
|
3697
4045
|
subdivision?: string;
|
|
3698
|
-
/** URL to redirect the user to when they successfully complete a transaction. This URL will be
|
|
3699
|
-
redirectUrl?:
|
|
4046
|
+
/** URL to redirect the user to when they successfully complete a transaction. This URL will be embedded in the returned onramp URL as a query parameter. */
|
|
4047
|
+
redirectUrl?: Url;
|
|
3700
4048
|
/** The IP address of the end user requesting the onramp transaction. */
|
|
3701
4049
|
clientIp?: string;
|
|
4050
|
+
/** 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.
|
|
4051
|
+
|
|
4052
|
+
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. */
|
|
4053
|
+
partnerUserRef?: string;
|
|
3702
4054
|
};
|
|
3703
4055
|
|
|
3704
4056
|
export type CreateOnrampSession201 = {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* OpenAPI spec version: 2.0.0
|
|
7
7
|
*/
|
|
8
8
|
import type {
|
|
9
|
+
CreateEndUserBody,
|
|
9
10
|
EndUser,
|
|
10
11
|
ListEndUsers200,
|
|
11
12
|
ListEndUsersParams,
|
|
@@ -16,6 +17,25 @@ import { cdpApiClient } from "../../cdpApiClient.js";
|
|
|
16
17
|
|
|
17
18
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
18
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Creates an end user. An end user is an entity that can own CDP EVM accounts, EVM smart accounts, and/or Solana accounts. 1 or more authentication methods must be associated with an end user. By default, no accounts are created unless the optional `evmAccount` and/or `solanaAccount` fields are provided.
|
|
22
|
+
This API is intended to be used by the developer's own backend, and is authenticated using the developer's CDP API key.
|
|
23
|
+
* @summary Create an end user
|
|
24
|
+
*/
|
|
25
|
+
export const createEndUser = (
|
|
26
|
+
createEndUserBody: CreateEndUserBody,
|
|
27
|
+
options?: SecondParameter<typeof cdpApiClient>,
|
|
28
|
+
) => {
|
|
29
|
+
return cdpApiClient<EndUser>(
|
|
30
|
+
{
|
|
31
|
+
url: `/v2/end-users`,
|
|
32
|
+
method: "POST",
|
|
33
|
+
headers: { "Content-Type": "application/json" },
|
|
34
|
+
data: createEndUserBody,
|
|
35
|
+
},
|
|
36
|
+
options,
|
|
37
|
+
);
|
|
38
|
+
};
|
|
19
39
|
/**
|
|
20
40
|
* Lists the end users belonging to the developer's CDP Project.
|
|
21
41
|
By default, the response is sorted by creation date in ascending order and paginated to 20 users per page.
|
|
@@ -47,7 +67,18 @@ export const validateEndUserAccessToken = (
|
|
|
47
67
|
options,
|
|
48
68
|
);
|
|
49
69
|
};
|
|
70
|
+
/**
|
|
71
|
+
* Gets an end user by ID.
|
|
72
|
+
|
|
73
|
+
This API is intended to be used by the developer's own backend, and is authenticated using the developer's CDP API key.
|
|
74
|
+
* @summary Get an end user
|
|
75
|
+
*/
|
|
76
|
+
export const getEndUser = (userId: string, options?: SecondParameter<typeof cdpApiClient>) => {
|
|
77
|
+
return cdpApiClient<EndUser>({ url: `/v2/end-users/${userId}`, method: "GET" }, options);
|
|
78
|
+
};
|
|
79
|
+
export type CreateEndUserResult = NonNullable<Awaited<ReturnType<typeof createEndUser>>>;
|
|
50
80
|
export type ListEndUsersResult = NonNullable<Awaited<ReturnType<typeof listEndUsers>>>;
|
|
51
81
|
export type ValidateEndUserAccessTokenResult = NonNullable<
|
|
52
82
|
Awaited<ReturnType<typeof validateEndUserAccessToken>>
|
|
53
83
|
>;
|
|
84
|
+
export type GetEndUserResult = NonNullable<Awaited<ReturnType<typeof getEndUser>>>;
|