@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
|
@@ -58,10 +58,33 @@ export interface DeveloperJWTAuthentication {
|
|
|
58
58
|
/** The unique identifier for the end user that is captured in the `sub` claim of the JWT. */
|
|
59
59
|
sub: string;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* The type of OAuth2 provider.
|
|
63
|
+
*/
|
|
64
|
+
export type OAuth2ProviderType = (typeof OAuth2ProviderType)[keyof typeof OAuth2ProviderType];
|
|
65
|
+
export declare const OAuth2ProviderType: {
|
|
66
|
+
readonly google: "google";
|
|
67
|
+
readonly apple: "apple";
|
|
68
|
+
readonly x: "x";
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Information about an end user who authenticates using a third-party provider.
|
|
72
|
+
*/
|
|
73
|
+
export interface OAuth2Authentication {
|
|
74
|
+
type: OAuth2ProviderType;
|
|
75
|
+
/** The unique identifier for the end user that is captured in the `sub` claim of the JWT. */
|
|
76
|
+
sub: string;
|
|
77
|
+
/** The email address of the end user contained within the user's ID token, if available from third-party OAuth2 provider's token exchange. */
|
|
78
|
+
email?: string;
|
|
79
|
+
/** The full name of the end user if available from third-party OAuth2 provider's token exchange. */
|
|
80
|
+
name?: string;
|
|
81
|
+
/** The username of the end user if available from third-party OAuth2 provider's token exchange. */
|
|
82
|
+
username?: string;
|
|
83
|
+
}
|
|
61
84
|
/**
|
|
62
85
|
* Information about how the end user is authenticated.
|
|
63
86
|
*/
|
|
64
|
-
export type AuthenticationMethod = EmailAuthentication | SmsAuthentication | DeveloperJWTAuthentication;
|
|
87
|
+
export type AuthenticationMethod = EmailAuthentication | SmsAuthentication | DeveloperJWTAuthentication | OAuth2Authentication;
|
|
65
88
|
/**
|
|
66
89
|
* The list of valid authentication methods linked to the end user.
|
|
67
90
|
*/
|
|
@@ -82,6 +105,8 @@ export interface EndUser {
|
|
|
82
105
|
evmSmartAccounts: string[];
|
|
83
106
|
/** The list of Solana accounts associated with the end user. Currently, only one Solana account is supported per end user. */
|
|
84
107
|
solanaAccounts: string[];
|
|
108
|
+
/** The date and time when the end user was created, in ISO 8601 format. */
|
|
109
|
+
createdAt: string;
|
|
85
110
|
}
|
|
86
111
|
export interface ListResponse {
|
|
87
112
|
/** The token for the next page of items, if any. */
|
|
@@ -122,7 +147,22 @@ export declare const ErrorType: {
|
|
|
122
147
|
readonly recipient_allowlist_violation: "recipient_allowlist_violation";
|
|
123
148
|
readonly recipient_allowlist_pending: "recipient_allowlist_pending";
|
|
124
149
|
readonly travel_rules_recipient_violation: "travel_rules_recipient_violation";
|
|
150
|
+
readonly transfer_amount_out_of_bounds: "transfer_amount_out_of_bounds";
|
|
151
|
+
readonly transfer_recipient_address_invalid: "transfer_recipient_address_invalid";
|
|
152
|
+
readonly transfer_quote_expired: "transfer_quote_expired";
|
|
153
|
+
readonly mfa_already_enrolled: "mfa_already_enrolled";
|
|
154
|
+
readonly mfa_invalid_code: "mfa_invalid_code";
|
|
155
|
+
readonly mfa_flow_expired: "mfa_flow_expired";
|
|
156
|
+
readonly mfa_required: "mfa_required";
|
|
157
|
+
readonly mfa_not_enrolled: "mfa_not_enrolled";
|
|
125
158
|
};
|
|
159
|
+
/**
|
|
160
|
+
* A valid HTTP or HTTPS URL.
|
|
161
|
+
* @minLength 11
|
|
162
|
+
* @maxLength 2048
|
|
163
|
+
* @pattern ^https?://.*$
|
|
164
|
+
*/
|
|
165
|
+
export type Url = string;
|
|
126
166
|
/**
|
|
127
167
|
* An error response including the code for the type of error and a human-readable message describing the error.
|
|
128
168
|
*/
|
|
@@ -133,7 +173,7 @@ export interface Error {
|
|
|
133
173
|
/** A unique identifier for the request that generated the error. This can be used to help debug issues with the API. */
|
|
134
174
|
correlationId?: string;
|
|
135
175
|
/** A link to the corresponding error documentation. */
|
|
136
|
-
errorLink?:
|
|
176
|
+
errorLink?: Url;
|
|
137
177
|
}
|
|
138
178
|
export interface EvmAccount {
|
|
139
179
|
/**
|
|
@@ -360,7 +400,7 @@ export interface CreateSpendPermissionRequest {
|
|
|
360
400
|
/** Arbitrary data to include in the permission. */
|
|
361
401
|
extraData?: string;
|
|
362
402
|
/** The paymaster URL of the spend permission. */
|
|
363
|
-
paymasterUrl?:
|
|
403
|
+
paymasterUrl?: Url;
|
|
364
404
|
}
|
|
365
405
|
/**
|
|
366
406
|
* The core spend permission.
|
|
@@ -414,7 +454,7 @@ export interface RevokeSpendPermissionRequest {
|
|
|
414
454
|
/** The hash of the spend permission to revoke. */
|
|
415
455
|
permissionHash: string;
|
|
416
456
|
/** The paymaster URL of the spend permission. */
|
|
417
|
-
paymasterUrl?:
|
|
457
|
+
paymasterUrl?: Url;
|
|
418
458
|
}
|
|
419
459
|
/**
|
|
420
460
|
* The network on which to perform the swap.
|
|
@@ -1849,6 +1889,20 @@ export interface SolanaTokenBalance {
|
|
|
1849
1889
|
amount: SolanaTokenAmount;
|
|
1850
1890
|
token: SolanaToken;
|
|
1851
1891
|
}
|
|
1892
|
+
/**
|
|
1893
|
+
* Enables control over how often queries need to be fully re-executed on the backing store.
|
|
1894
|
+
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.
|
|
1895
|
+
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).
|
|
1896
|
+
|
|
1897
|
+
*/
|
|
1898
|
+
export type OnchainDataQueryCache = {
|
|
1899
|
+
/**
|
|
1900
|
+
* 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.
|
|
1901
|
+
* @minimum 500
|
|
1902
|
+
* @maximum 900000
|
|
1903
|
+
*/
|
|
1904
|
+
maxAgeMs?: number;
|
|
1905
|
+
};
|
|
1852
1906
|
/**
|
|
1853
1907
|
* Request to execute a SQL query against indexed blockchain data.
|
|
1854
1908
|
*/
|
|
@@ -1856,9 +1910,14 @@ export interface OnchainDataQuery {
|
|
|
1856
1910
|
/**
|
|
1857
1911
|
* SQL query to execute against the indexed blockchain data.
|
|
1858
1912
|
* @minLength 1
|
|
1859
|
-
* @maxLength
|
|
1913
|
+
* @maxLength 100000
|
|
1860
1914
|
*/
|
|
1861
1915
|
sql: string;
|
|
1916
|
+
/** Enables control over how often queries need to be fully re-executed on the backing store.
|
|
1917
|
+
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.
|
|
1918
|
+
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).
|
|
1919
|
+
*/
|
|
1920
|
+
cache?: OnchainDataQueryCache;
|
|
1862
1921
|
}
|
|
1863
1922
|
/**
|
|
1864
1923
|
* Row data with column names as keys.
|
|
@@ -1910,8 +1969,10 @@ export type OnchainDataResultSchema = {
|
|
|
1910
1969
|
* Metadata about query execution.
|
|
1911
1970
|
*/
|
|
1912
1971
|
export type OnchainDataResultMetadata = {
|
|
1913
|
-
/** Whether the result was served from cache. */
|
|
1972
|
+
/** Whether the result was served from the query result cache. */
|
|
1914
1973
|
cached?: boolean;
|
|
1974
|
+
/** When the query result was executed against the backing store in RFC 3339 format. */
|
|
1975
|
+
executionTimestamp?: string;
|
|
1915
1976
|
/** Query execution time in milliseconds. */
|
|
1916
1977
|
executionTimeMs?: number;
|
|
1917
1978
|
/** Number of rows returned. */
|
|
@@ -1943,6 +2004,223 @@ export interface AccountTokenAddressesResponse {
|
|
|
1943
2004
|
*/
|
|
1944
2005
|
totalCount?: number;
|
|
1945
2006
|
}
|
|
2007
|
+
/**
|
|
2008
|
+
* Additional headers to include in webhook requests.
|
|
2009
|
+
*/
|
|
2010
|
+
export type WebhookTargetHeaders = {
|
|
2011
|
+
[key: string]: string;
|
|
2012
|
+
};
|
|
2013
|
+
/**
|
|
2014
|
+
* Target configuration for webhook delivery.
|
|
2015
|
+
Specifies the destination URL and any custom headers to include in webhook requests.
|
|
2016
|
+
|
|
2017
|
+
*/
|
|
2018
|
+
export interface WebhookTarget {
|
|
2019
|
+
/** The webhook URL to deliver events to. */
|
|
2020
|
+
url: Url;
|
|
2021
|
+
/** Additional headers to include in webhook requests. */
|
|
2022
|
+
headers?: WebhookTargetHeaders;
|
|
2023
|
+
}
|
|
2024
|
+
/**
|
|
2025
|
+
* Additional metadata for the subscription.
|
|
2026
|
+
*/
|
|
2027
|
+
export type WebhookSubscriptionResponseMetadata = {
|
|
2028
|
+
/** Secret for webhook signature validation.
|
|
2029
|
+
|
|
2030
|
+
**Note:** Webhooks are in beta and this interface is subject to change.
|
|
2031
|
+
*/
|
|
2032
|
+
secret?: string;
|
|
2033
|
+
};
|
|
2034
|
+
/**
|
|
2035
|
+
* Multi-label filters using total overlap logic. Total overlap means the subscription only triggers when events contain ALL these key-value pairs.
|
|
2036
|
+
Present when subscription uses multi-label format.
|
|
2037
|
+
|
|
2038
|
+
*/
|
|
2039
|
+
export type WebhookSubscriptionResponseLabels = {
|
|
2040
|
+
[key: string]: string;
|
|
2041
|
+
};
|
|
2042
|
+
/**
|
|
2043
|
+
* Response containing webhook subscription details.
|
|
2044
|
+
*/
|
|
2045
|
+
export interface WebhookSubscriptionResponse {
|
|
2046
|
+
/** When the subscription was created. */
|
|
2047
|
+
createdAt: string;
|
|
2048
|
+
/** Description of the webhook subscription. */
|
|
2049
|
+
description?: string;
|
|
2050
|
+
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2051
|
+
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2052
|
+
*/
|
|
2053
|
+
eventTypes: string[];
|
|
2054
|
+
/** Whether the subscription is enabled. */
|
|
2055
|
+
isEnabled: boolean;
|
|
2056
|
+
/** Additional metadata for the subscription. */
|
|
2057
|
+
metadata?: WebhookSubscriptionResponseMetadata;
|
|
2058
|
+
/** Unique identifier for the subscription. */
|
|
2059
|
+
subscriptionId: string;
|
|
2060
|
+
target: WebhookTarget;
|
|
2061
|
+
/** Label key for filtering events. Present when subscription uses traditional single-label format.
|
|
2062
|
+
*/
|
|
2063
|
+
labelKey?: string;
|
|
2064
|
+
/** Label value for filtering events. Present when subscription uses traditional single-label format.
|
|
2065
|
+
*/
|
|
2066
|
+
labelValue?: string;
|
|
2067
|
+
/** Multi-label filters using total overlap logic. Total overlap means the subscription only triggers when events contain ALL these key-value pairs.
|
|
2068
|
+
Present when subscription uses multi-label format.
|
|
2069
|
+
*/
|
|
2070
|
+
labels?: WebhookSubscriptionResponseLabels;
|
|
2071
|
+
}
|
|
2072
|
+
/**
|
|
2073
|
+
* Response containing a list of webhook subscriptions.
|
|
2074
|
+
*/
|
|
2075
|
+
export type WebhookSubscriptionListResponseAllOf = {
|
|
2076
|
+
/** The list of webhook subscriptions. */
|
|
2077
|
+
subscriptions: WebhookSubscriptionResponse[];
|
|
2078
|
+
};
|
|
2079
|
+
export type WebhookSubscriptionListResponse = WebhookSubscriptionListResponseAllOf & ListResponse;
|
|
2080
|
+
/**
|
|
2081
|
+
* Additional metadata for the subscription.
|
|
2082
|
+
*/
|
|
2083
|
+
export type WebhookSubscriptionRequestMetadata = {
|
|
2084
|
+
[key: string]: unknown;
|
|
2085
|
+
};
|
|
2086
|
+
/**
|
|
2087
|
+
* Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2088
|
+
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2089
|
+
the event are allowed and will not prevent matching.
|
|
2090
|
+
NOTE: Use either labels OR (labelKey + labelValue), not both.
|
|
2091
|
+
|
|
2092
|
+
*/
|
|
2093
|
+
export type WebhookSubscriptionRequestLabels = {
|
|
2094
|
+
[key: string]: string;
|
|
2095
|
+
};
|
|
2096
|
+
/**
|
|
2097
|
+
* Request to create a new webhook subscription with support for both traditional single-label
|
|
2098
|
+
and multi-label filtering formats.
|
|
2099
|
+
|
|
2100
|
+
*/
|
|
2101
|
+
export type WebhookSubscriptionRequest = (unknown & {
|
|
2102
|
+
/** Description of the webhook subscription. */
|
|
2103
|
+
description?: string;
|
|
2104
|
+
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2105
|
+
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2106
|
+
The subscription will only receive events matching these types AND the label filter(s).
|
|
2107
|
+
*/
|
|
2108
|
+
eventTypes?: string[];
|
|
2109
|
+
/** Whether the subscription is enabled. */
|
|
2110
|
+
isEnabled?: boolean;
|
|
2111
|
+
target?: WebhookTarget;
|
|
2112
|
+
/** Additional metadata for the subscription. */
|
|
2113
|
+
metadata?: WebhookSubscriptionRequestMetadata;
|
|
2114
|
+
/** Label key for filtering events. Each subscription filters on exactly one (labelKey, labelValue) pair
|
|
2115
|
+
in addition to the event types. Only events matching both the event types AND this label filter will be delivered.
|
|
2116
|
+
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2117
|
+
*/
|
|
2118
|
+
labelKey?: string;
|
|
2119
|
+
/** Label value for filtering events. Must correspond to the labelKey (e.g., contract address for contract_address key).
|
|
2120
|
+
Only events with this exact label value will be delivered.
|
|
2121
|
+
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2122
|
+
*/
|
|
2123
|
+
labelValue?: string;
|
|
2124
|
+
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2125
|
+
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2126
|
+
the event are allowed and will not prevent matching.
|
|
2127
|
+
NOTE: Use either labels OR (labelKey + labelValue), not both.
|
|
2128
|
+
*/
|
|
2129
|
+
labels?: WebhookSubscriptionRequestLabels;
|
|
2130
|
+
}) | (unknown & {
|
|
2131
|
+
/** Description of the webhook subscription. */
|
|
2132
|
+
description?: string;
|
|
2133
|
+
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2134
|
+
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2135
|
+
The subscription will only receive events matching these types AND the label filter(s).
|
|
2136
|
+
*/
|
|
2137
|
+
eventTypes?: string[];
|
|
2138
|
+
/** Whether the subscription is enabled. */
|
|
2139
|
+
isEnabled?: boolean;
|
|
2140
|
+
target?: WebhookTarget;
|
|
2141
|
+
/** Additional metadata for the subscription. */
|
|
2142
|
+
metadata?: WebhookSubscriptionRequestMetadata;
|
|
2143
|
+
/** Label key for filtering events. Each subscription filters on exactly one (labelKey, labelValue) pair
|
|
2144
|
+
in addition to the event types. Only events matching both the event types AND this label filter will be delivered.
|
|
2145
|
+
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2146
|
+
*/
|
|
2147
|
+
labelKey?: string;
|
|
2148
|
+
/** Label value for filtering events. Must correspond to the labelKey (e.g., contract address for contract_address key).
|
|
2149
|
+
Only events with this exact label value will be delivered.
|
|
2150
|
+
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2151
|
+
*/
|
|
2152
|
+
labelValue?: string;
|
|
2153
|
+
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2154
|
+
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2155
|
+
the event are allowed and will not prevent matching.
|
|
2156
|
+
NOTE: Use either labels OR (labelKey + labelValue), not both.
|
|
2157
|
+
*/
|
|
2158
|
+
labels?: WebhookSubscriptionRequestLabels;
|
|
2159
|
+
});
|
|
2160
|
+
/**
|
|
2161
|
+
* Additional metadata for the subscription.
|
|
2162
|
+
*/
|
|
2163
|
+
export type WebhookSubscriptionUpdateRequestMetadata = {
|
|
2164
|
+
[key: string]: unknown;
|
|
2165
|
+
};
|
|
2166
|
+
/**
|
|
2167
|
+
* Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2168
|
+
an event contains ALL the key-value pairs specified here. Use either labels OR (labelKey + labelValue), not both.
|
|
2169
|
+
|
|
2170
|
+
*/
|
|
2171
|
+
export type WebhookSubscriptionUpdateRequestLabels = {
|
|
2172
|
+
[key: string]: string;
|
|
2173
|
+
};
|
|
2174
|
+
/**
|
|
2175
|
+
* Request to update an existing webhook subscription. The update format must match
|
|
2176
|
+
the original subscription format (traditional or multi-label).
|
|
2177
|
+
|
|
2178
|
+
*/
|
|
2179
|
+
export type WebhookSubscriptionUpdateRequest = (unknown & {
|
|
2180
|
+
/** Description of the webhook subscription. */
|
|
2181
|
+
description?: string;
|
|
2182
|
+
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2183
|
+
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2184
|
+
*/
|
|
2185
|
+
eventTypes?: string[];
|
|
2186
|
+
/** Whether the subscription is enabled. */
|
|
2187
|
+
isEnabled?: boolean;
|
|
2188
|
+
target?: WebhookTarget;
|
|
2189
|
+
/** Additional metadata for the subscription. */
|
|
2190
|
+
metadata?: WebhookSubscriptionUpdateRequestMetadata;
|
|
2191
|
+
/** Label key for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2192
|
+
*/
|
|
2193
|
+
labelKey?: string;
|
|
2194
|
+
/** Label value for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2195
|
+
*/
|
|
2196
|
+
labelValue?: string;
|
|
2197
|
+
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2198
|
+
an event contains ALL the key-value pairs specified here. Use either labels OR (labelKey + labelValue), not both.
|
|
2199
|
+
*/
|
|
2200
|
+
labels?: WebhookSubscriptionUpdateRequestLabels;
|
|
2201
|
+
}) | (unknown & {
|
|
2202
|
+
/** Description of the webhook subscription. */
|
|
2203
|
+
description?: string;
|
|
2204
|
+
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2205
|
+
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2206
|
+
*/
|
|
2207
|
+
eventTypes?: string[];
|
|
2208
|
+
/** Whether the subscription is enabled. */
|
|
2209
|
+
isEnabled?: boolean;
|
|
2210
|
+
target?: WebhookTarget;
|
|
2211
|
+
/** Additional metadata for the subscription. */
|
|
2212
|
+
metadata?: WebhookSubscriptionUpdateRequestMetadata;
|
|
2213
|
+
/** Label key for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2214
|
+
*/
|
|
2215
|
+
labelKey?: string;
|
|
2216
|
+
/** Label value for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2217
|
+
*/
|
|
2218
|
+
labelValue?: string;
|
|
2219
|
+
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2220
|
+
an event contains ALL the key-value pairs specified here. Use either labels OR (labelKey + labelValue), not both.
|
|
2221
|
+
*/
|
|
2222
|
+
labels?: WebhookSubscriptionUpdateRequestLabels;
|
|
2223
|
+
});
|
|
1946
2224
|
/**
|
|
1947
2225
|
* The version of the x402 protocol.
|
|
1948
2226
|
*/
|
|
@@ -2062,7 +2340,7 @@ export interface X402PaymentRequirements {
|
|
|
2062
2340
|
/** The maximum amount required to pay for the resource in atomic units of the payment asset. */
|
|
2063
2341
|
maxAmountRequired: string;
|
|
2064
2342
|
/** The URL of the resource to pay for. */
|
|
2065
|
-
resource:
|
|
2343
|
+
resource: Url;
|
|
2066
2344
|
/** The description of the resource. */
|
|
2067
2345
|
description: string;
|
|
2068
2346
|
/** The MIME type of the resource response. */
|
|
@@ -2104,6 +2382,7 @@ export declare const X402VerifyInvalidReason: {
|
|
|
2104
2382
|
readonly invalid_payment_requirements: "invalid_payment_requirements";
|
|
2105
2383
|
readonly invalid_payload: "invalid_payload";
|
|
2106
2384
|
readonly invalid_exact_evm_payload_authorization_value: "invalid_exact_evm_payload_authorization_value";
|
|
2385
|
+
readonly invalid_exact_evm_payload_authorization_value_too_low: "invalid_exact_evm_payload_authorization_value_too_low";
|
|
2107
2386
|
readonly invalid_exact_evm_payload_authorization_valid_after: "invalid_exact_evm_payload_authorization_valid_after";
|
|
2108
2387
|
readonly invalid_exact_evm_payload_authorization_valid_before: "invalid_exact_evm_payload_authorization_valid_before";
|
|
2109
2388
|
readonly invalid_exact_evm_payload_authorization_typed_data_message: "invalid_exact_evm_payload_authorization_typed_data_message";
|
|
@@ -2129,6 +2408,8 @@ export declare const X402VerifyInvalidReason: {
|
|
|
2129
2408
|
readonly invalid_exact_svm_payload_transaction_sender_ata_not_found: "invalid_exact_svm_payload_transaction_sender_ata_not_found";
|
|
2130
2409
|
readonly invalid_exact_svm_payload_transaction_simulation_failed: "invalid_exact_svm_payload_transaction_simulation_failed";
|
|
2131
2410
|
readonly invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata: "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata";
|
|
2411
|
+
readonly invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts: "invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts";
|
|
2412
|
+
readonly invalid_exact_svm_payload_transaction_fee_payer_transferring_funds: "invalid_exact_svm_payload_transaction_fee_payer_transferring_funds";
|
|
2132
2413
|
};
|
|
2133
2414
|
/**
|
|
2134
2415
|
* The reason the payment settlement errored on the x402 protocol.
|
|
@@ -2271,8 +2552,8 @@ export declare const OnrampPaymentLinkType: {
|
|
|
2271
2552
|
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.
|
|
2272
2553
|
*/
|
|
2273
2554
|
export interface OnrampPaymentLink {
|
|
2274
|
-
/** The URL to the hosted widget the user should be redirected to. For certain payment link types you can append your
|
|
2275
|
-
url:
|
|
2555
|
+
/** 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. */
|
|
2556
|
+
url: Url;
|
|
2276
2557
|
paymentLinkType: OnrampPaymentLinkType;
|
|
2277
2558
|
}
|
|
2278
2559
|
/**
|
|
@@ -2292,7 +2573,7 @@ export declare const OnrampQuotePaymentMethodTypeId: {
|
|
|
2292
2573
|
*/
|
|
2293
2574
|
export interface OnrampSession {
|
|
2294
2575
|
/** Ready-to-use onramp URL. */
|
|
2295
|
-
onrampUrl:
|
|
2576
|
+
onrampUrl: Url;
|
|
2296
2577
|
}
|
|
2297
2578
|
/**
|
|
2298
2579
|
* Quote information with pricing details for the crypto purchase.
|
|
@@ -2410,6 +2691,42 @@ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/i
|
|
|
2410
2691
|
|
|
2411
2692
|
*/
|
|
2412
2693
|
export type IdempotencyKeyParameter = string;
|
|
2694
|
+
/**
|
|
2695
|
+
* The number of resources to return per page.
|
|
2696
|
+
*/
|
|
2697
|
+
export type PageSizeParameter = number;
|
|
2698
|
+
/**
|
|
2699
|
+
* The token for the next page of resources, if any.
|
|
2700
|
+
*/
|
|
2701
|
+
export type PageTokenParameter = string;
|
|
2702
|
+
/**
|
|
2703
|
+
* Configuration for creating an EVM account for the end user.
|
|
2704
|
+
*/
|
|
2705
|
+
export type CreateEndUserBodyEvmAccount = {
|
|
2706
|
+
/** 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. */
|
|
2707
|
+
createSmartAccount?: boolean;
|
|
2708
|
+
};
|
|
2709
|
+
/**
|
|
2710
|
+
* Configuration for creating a Solana account for the end user.
|
|
2711
|
+
*/
|
|
2712
|
+
export type CreateEndUserBodySolanaAccount = {
|
|
2713
|
+
/** Only false is a valid option since currently smart accounts on Solana are not supported. */
|
|
2714
|
+
createSmartAccount?: boolean;
|
|
2715
|
+
};
|
|
2716
|
+
export type CreateEndUserBody = {
|
|
2717
|
+
/**
|
|
2718
|
+
* 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.
|
|
2719
|
+
|
|
2720
|
+
If `userId` is not provided in the request, the server will generate a random UUID.
|
|
2721
|
+
* @pattern ^[a-zA-Z0-9-]{1,100}$
|
|
2722
|
+
*/
|
|
2723
|
+
userId?: string;
|
|
2724
|
+
authenticationMethods: AuthenticationMethods;
|
|
2725
|
+
/** Configuration for creating an EVM account for the end user. */
|
|
2726
|
+
evmAccount?: CreateEndUserBodyEvmAccount;
|
|
2727
|
+
/** Configuration for creating a Solana account for the end user. */
|
|
2728
|
+
solanaAccount?: CreateEndUserBodySolanaAccount;
|
|
2729
|
+
};
|
|
2413
2730
|
export type ListEndUsersParams = {
|
|
2414
2731
|
/**
|
|
2415
2732
|
* The number of end users to return per page.
|
|
@@ -2443,13 +2760,13 @@ export type ValidateEndUserAccessTokenBody = {
|
|
|
2443
2760
|
};
|
|
2444
2761
|
export type ListEvmAccountsParams = {
|
|
2445
2762
|
/**
|
|
2446
|
-
* The number of
|
|
2763
|
+
* The number of resources to return per page.
|
|
2447
2764
|
*/
|
|
2448
|
-
pageSize?:
|
|
2765
|
+
pageSize?: PageSizeParameter;
|
|
2449
2766
|
/**
|
|
2450
|
-
* The token for the next page of
|
|
2767
|
+
* The token for the next page of resources, if any.
|
|
2451
2768
|
*/
|
|
2452
|
-
pageToken?:
|
|
2769
|
+
pageToken?: PageTokenParameter;
|
|
2453
2770
|
};
|
|
2454
2771
|
export type ListEvmAccounts200AllOf = {
|
|
2455
2772
|
/** The list of EVM accounts. */
|
|
@@ -2538,13 +2855,13 @@ export type SignEvmTypedData200 = {
|
|
|
2538
2855
|
};
|
|
2539
2856
|
export type ListEvmSmartAccountsParams = {
|
|
2540
2857
|
/**
|
|
2541
|
-
* The number of
|
|
2858
|
+
* The number of resources to return per page.
|
|
2542
2859
|
*/
|
|
2543
|
-
pageSize?:
|
|
2860
|
+
pageSize?: PageSizeParameter;
|
|
2544
2861
|
/**
|
|
2545
|
-
* The token for the next page of
|
|
2862
|
+
* The token for the next page of resources, if any.
|
|
2546
2863
|
*/
|
|
2547
|
-
pageToken?:
|
|
2864
|
+
pageToken?: PageTokenParameter;
|
|
2548
2865
|
};
|
|
2549
2866
|
export type ListEvmSmartAccounts200AllOf = {
|
|
2550
2867
|
/** The list of Smart Accounts. */
|
|
@@ -2608,14 +2925,14 @@ export type PrepareUserOperationBody = {
|
|
|
2608
2925
|
/** The list of calls to make from the Smart Account. */
|
|
2609
2926
|
calls: EvmCall[];
|
|
2610
2927
|
/** The URL of the paymaster to use for the user operation. */
|
|
2611
|
-
paymasterUrl?:
|
|
2928
|
+
paymasterUrl?: Url;
|
|
2612
2929
|
};
|
|
2613
2930
|
export type PrepareAndSendUserOperationBody = {
|
|
2614
2931
|
network: EvmUserOperationNetwork;
|
|
2615
2932
|
/** The list of calls to make from the Smart Account. */
|
|
2616
2933
|
calls: EvmCall[];
|
|
2617
2934
|
/** The URL of the paymaster to use for the user operation. */
|
|
2618
|
-
paymasterUrl?:
|
|
2935
|
+
paymasterUrl?: Url;
|
|
2619
2936
|
};
|
|
2620
2937
|
export type SendUserOperationBody = {
|
|
2621
2938
|
/** The hex-encoded signature of the user operation. This should be a 65-byte signature consisting of the `r`, `s`, and `v` values of the ECDSA signature. Note that the `v` value should conform to the `personal_sign` standard, which means it should be 27 or 28. */
|
|
@@ -2687,13 +3004,13 @@ export type CreateEvmSwapQuoteBody = {
|
|
|
2687
3004
|
};
|
|
2688
3005
|
export type ListEvmTokenBalancesParams = {
|
|
2689
3006
|
/**
|
|
2690
|
-
* The number of
|
|
3007
|
+
* The number of resources to return per page.
|
|
2691
3008
|
*/
|
|
2692
|
-
pageSize?:
|
|
3009
|
+
pageSize?: PageSizeParameter;
|
|
2693
3010
|
/**
|
|
2694
|
-
* The token for the next page of
|
|
3011
|
+
* The token for the next page of resources, if any.
|
|
2695
3012
|
*/
|
|
2696
|
-
pageToken?:
|
|
3013
|
+
pageToken?: PageTokenParameter;
|
|
2697
3014
|
};
|
|
2698
3015
|
export type ListEvmTokenBalances200AllOf = {
|
|
2699
3016
|
/** The list of EVM token balances. */
|
|
@@ -2737,13 +3054,13 @@ export type RequestEvmFaucet200 = {
|
|
|
2737
3054
|
};
|
|
2738
3055
|
export type ListPoliciesParams = {
|
|
2739
3056
|
/**
|
|
2740
|
-
* The number of
|
|
3057
|
+
* The number of resources to return per page.
|
|
2741
3058
|
*/
|
|
2742
|
-
pageSize?:
|
|
3059
|
+
pageSize?: PageSizeParameter;
|
|
2743
3060
|
/**
|
|
2744
|
-
* The token for the next page of
|
|
3061
|
+
* The token for the next page of resources, if any.
|
|
2745
3062
|
*/
|
|
2746
|
-
pageToken?:
|
|
3063
|
+
pageToken?: PageTokenParameter;
|
|
2747
3064
|
/**
|
|
2748
3065
|
* 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.
|
|
2749
3066
|
*/
|
|
@@ -2791,13 +3108,13 @@ export type UpdatePolicyBody = {
|
|
|
2791
3108
|
};
|
|
2792
3109
|
export type ListSolanaAccountsParams = {
|
|
2793
3110
|
/**
|
|
2794
|
-
* The number of
|
|
3111
|
+
* The number of resources to return per page.
|
|
2795
3112
|
*/
|
|
2796
|
-
pageSize?:
|
|
3113
|
+
pageSize?: PageSizeParameter;
|
|
2797
3114
|
/**
|
|
2798
|
-
* The token for the next page of
|
|
3115
|
+
* The token for the next page of resources, if any.
|
|
2799
3116
|
*/
|
|
2800
|
-
pageToken?:
|
|
3117
|
+
pageToken?: PageTokenParameter;
|
|
2801
3118
|
};
|
|
2802
3119
|
export type ListSolanaAccounts200AllOf = {
|
|
2803
3120
|
/** The list of Solana accounts. */
|
|
@@ -2930,19 +3247,29 @@ export type ListSolanaTokenBalances200AllOf = {
|
|
|
2930
3247
|
export type ListSolanaTokenBalances200 = ListSolanaTokenBalances200AllOf & ListResponse;
|
|
2931
3248
|
export type ListDataTokenBalancesParams = {
|
|
2932
3249
|
/**
|
|
2933
|
-
* The number of
|
|
3250
|
+
* The number of resources to return per page.
|
|
2934
3251
|
*/
|
|
2935
|
-
pageSize?:
|
|
3252
|
+
pageSize?: PageSizeParameter;
|
|
2936
3253
|
/**
|
|
2937
|
-
* The token for the next page of
|
|
3254
|
+
* The token for the next page of resources, if any.
|
|
2938
3255
|
*/
|
|
2939
|
-
pageToken?:
|
|
3256
|
+
pageToken?: PageTokenParameter;
|
|
2940
3257
|
};
|
|
2941
3258
|
export type ListDataTokenBalances200AllOf = {
|
|
2942
3259
|
/** The list of EVM token balances. */
|
|
2943
3260
|
balances: TokenBalance[];
|
|
2944
3261
|
};
|
|
2945
3262
|
export type ListDataTokenBalances200 = ListDataTokenBalances200AllOf & ListResponse;
|
|
3263
|
+
export type ListWebhookSubscriptionsParams = {
|
|
3264
|
+
/**
|
|
3265
|
+
* The number of subscriptions to return per page.
|
|
3266
|
+
*/
|
|
3267
|
+
pageSize?: number;
|
|
3268
|
+
/**
|
|
3269
|
+
* The token for the next page of subscriptions, if any.
|
|
3270
|
+
*/
|
|
3271
|
+
pageToken?: string;
|
|
3272
|
+
};
|
|
2946
3273
|
export type VerifyX402PaymentBody = {
|
|
2947
3274
|
x402Version: X402Version;
|
|
2948
3275
|
paymentPayload: X402PaymentPayload;
|
|
@@ -3021,10 +3348,14 @@ export type CreateOnrampSessionBody = {
|
|
|
3021
3348
|
country?: string;
|
|
3022
3349
|
/** The ISO 3166-2 two letter state code (e.g. NY). Only required for US. */
|
|
3023
3350
|
subdivision?: string;
|
|
3024
|
-
/** URL to redirect the user to when they successfully complete a transaction. This URL will be
|
|
3025
|
-
redirectUrl?:
|
|
3351
|
+
/** 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. */
|
|
3352
|
+
redirectUrl?: Url;
|
|
3026
3353
|
/** The IP address of the end user requesting the onramp transaction. */
|
|
3027
3354
|
clientIp?: string;
|
|
3355
|
+
/** 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.
|
|
3356
|
+
|
|
3357
|
+
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. */
|
|
3358
|
+
partnerUserRef?: string;
|
|
3028
3359
|
};
|
|
3029
3360
|
export type CreateOnrampSession201 = {
|
|
3030
3361
|
session: OnrampSession;
|