@coinbase/cdp-sdk 1.33.0 → 1.34.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 +14 -0
- package/README.md +19 -0
- package/_cjs/accounts/evm/toEvmServerAccount.js +1 -1
- package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_cjs/accounts/evm/toEvmSmartAccount.js +1 -1
- package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js +2 -2
- package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
- package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js +2 -2
- package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
- package/_cjs/actions/evm/listSpendPermissions.js +19 -1
- package/_cjs/actions/evm/listSpendPermissions.js.map +1 -1
- package/_cjs/actions/evm/spend-permissions/resolveSpendPermission.js +64 -0
- package/_cjs/actions/evm/spend-permissions/resolveSpendPermission.js.map +1 -0
- package/_cjs/client/cdp.js +4 -0
- package/_cjs/client/cdp.js.map +1 -1
- package/_cjs/client/end-user/endUser.js +28 -0
- package/_cjs/client/end-user/endUser.js.map +1 -0
- package/_cjs/client/end-user/endUser.types.js +3 -0
- package/_cjs/client/end-user/endUser.types.js.map +1 -0
- package/_cjs/client/evm/evm.js +12 -11
- package/_cjs/client/evm/evm.js.map +1 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +121 -2
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js +20 -0
- package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -0
- package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.msw.js +61 -0
- package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.msw.js.map +1 -0
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +79 -20
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/evm-token-balances/evm-token-balances.js +1 -2
- package/_cjs/openapi-client/generated/evm-token-balances/evm-token-balances.js.map +1 -1
- package/_cjs/openapi-client/generated/index.msw.js +3 -0
- package/_cjs/openapi-client/generated/index.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/onchain-data/onchain-data.js +63 -0
- package/_cjs/openapi-client/generated/onchain-data/onchain-data.js.map +1 -0
- package/_cjs/openapi-client/generated/onchain-data/onchain-data.msw.js +139 -0
- package/_cjs/openapi-client/generated/onchain-data/onchain-data.msw.js.map +1 -0
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js +48 -4
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.js +39 -0
- package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.js.map +1 -0
- package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.msw.js +84 -0
- package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.msw.js.map +1 -0
- package/_cjs/openapi-client/index.js +5 -0
- package/_cjs/openapi-client/index.js.map +1 -1
- package/_cjs/spend-permissions/utils.js +26 -0
- package/_cjs/spend-permissions/utils.js.map +1 -0
- package/_cjs/version.js +1 -1
- package/_esm/accounts/evm/toEvmServerAccount.js +1 -1
- package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_esm/accounts/evm/toEvmSmartAccount.js +1 -1
- package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js +2 -2
- package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
- package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js +2 -2
- package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
- package/_esm/actions/evm/listSpendPermissions.js +19 -1
- package/_esm/actions/evm/listSpendPermissions.js.map +1 -1
- package/_esm/actions/evm/spend-permissions/resolveSpendPermission.js +61 -0
- package/_esm/actions/evm/spend-permissions/resolveSpendPermission.js.map +1 -0
- package/_esm/client/cdp.js +4 -0
- package/_esm/client/cdp.js.map +1 -1
- package/_esm/client/end-user/endUser.js +24 -0
- package/_esm/client/end-user/endUser.js.map +1 -0
- package/_esm/client/end-user/endUser.types.js +2 -0
- package/_esm/client/end-user/endUser.types.js.map +1 -0
- package/_esm/client/evm/evm.js +13 -12
- package/_esm/client/evm/evm.js.map +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +119 -0
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js +16 -0
- package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -0
- package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.msw.js +52 -0
- package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.msw.js.map +1 -0
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +79 -20
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -1
- package/_esm/openapi-client/generated/evm-token-balances/evm-token-balances.js +1 -2
- package/_esm/openapi-client/generated/evm-token-balances/evm-token-balances.js.map +1 -1
- package/_esm/openapi-client/generated/index.msw.js +3 -0
- package/_esm/openapi-client/generated/index.msw.js.map +1 -1
- package/_esm/openapi-client/generated/onchain-data/onchain-data.js +57 -0
- package/_esm/openapi-client/generated/onchain-data/onchain-data.js.map +1 -0
- package/_esm/openapi-client/generated/onchain-data/onchain-data.msw.js +129 -0
- package/_esm/openapi-client/generated/onchain-data/onchain-data.msw.js.map +1 -0
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js +48 -4
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
- package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.js +33 -0
- package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.js.map +1 -0
- package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.msw.js +74 -0
- package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.msw.js.map +1 -0
- package/_esm/openapi-client/index.js +5 -0
- package/_esm/openapi-client/index.js.map +1 -1
- package/_esm/spend-permissions/utils.js +23 -0
- package/_esm/spend-permissions/utils.js.map +1 -0
- package/_esm/version.js +1 -1
- package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
- package/_types/accounts/evm/toNetworkScopedEvmSmartAccount.d.ts.map +1 -1
- package/_types/accounts/evm/types.d.ts +5 -5
- package/_types/accounts/evm/types.d.ts.map +1 -1
- package/_types/actions/evm/listSpendPermissions.d.ts +10 -2
- package/_types/actions/evm/listSpendPermissions.d.ts.map +1 -1
- package/_types/actions/evm/spend-permissions/resolveSpendPermission.d.ts +12 -0
- package/_types/actions/evm/spend-permissions/resolveSpendPermission.d.ts.map +1 -0
- package/_types/actions/evm/spend-permissions/types.d.ts +3 -2
- package/_types/actions/evm/spend-permissions/types.d.ts.map +1 -1
- package/_types/actions/evm/types.d.ts +4 -8
- package/_types/actions/evm/types.d.ts.map +1 -1
- package/_types/auth/utils/jwt.d.ts +1 -1
- package/_types/client/cdp.d.ts +3 -0
- package/_types/client/cdp.d.ts.map +1 -1
- package/_types/client/end-user/endUser.d.ts +16 -0
- package/_types/client/end-user/endUser.d.ts.map +1 -0
- package/_types/client/end-user/endUser.types.d.ts +10 -0
- package/_types/client/end-user/endUser.types.d.ts.map +1 -0
- package/_types/client/evm/evm.d.ts +3 -2
- package/_types/client/evm/evm.d.ts.map +1 -1
- package/_types/client/evm/evm.types.d.ts +7 -44
- package/_types/client/evm/evm.types.d.ts.map +1 -1
- package/_types/index.d.ts +2 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +520 -39
- 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 +20 -0
- package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.d.ts.map +1 -0
- package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.msw.d.ts +9 -0
- package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.msw.d.ts.map +1 -0
- package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/evm-token-balances/evm-token-balances.d.ts +1 -2
- package/_types/openapi-client/generated/evm-token-balances/evm-token-balances.d.ts.map +1 -1
- package/_types/openapi-client/generated/index.msw.d.ts +3 -0
- package/_types/openapi-client/generated/index.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/onchain-data/onchain-data.d.ts +59 -0
- package/_types/openapi-client/generated/onchain-data/onchain-data.d.ts.map +1 -0
- package/_types/openapi-client/generated/onchain-data/onchain-data.msw.d.ts +10 -0
- package/_types/openapi-client/generated/onchain-data/onchain-data.msw.d.ts.map +1 -0
- package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.d.ts +30 -0
- package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.d.ts.map +1 -0
- package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.msw.d.ts +10 -0
- package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.msw.d.ts.map +1 -0
- package/_types/openapi-client/index.d.ts +4 -0
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/spend-permissions/types.d.ts +40 -5
- package/_types/spend-permissions/types.d.ts.map +1 -1
- package/_types/spend-permissions/utils.d.ts +12 -0
- package/_types/spend-permissions/utils.d.ts.map +1 -0
- package/_types/version.d.ts +1 -1
- package/accounts/evm/toEvmServerAccount.ts +1 -3
- package/accounts/evm/toEvmSmartAccount.ts +1 -1
- package/accounts/evm/toNetworkScopedEvmServerAccount.ts +4 -4
- package/accounts/evm/toNetworkScopedEvmSmartAccount.ts +4 -4
- package/accounts/evm/types.ts +5 -5
- package/actions/evm/listSpendPermissions.ts +42 -3
- package/actions/evm/spend-permissions/resolveSpendPermission.ts +85 -0
- package/actions/evm/spend-permissions/types.ts +3 -2
- package/actions/evm/types.ts +4 -12
- package/auth/utils/jwt.ts +1 -1
- package/client/cdp.ts +5 -0
- package/client/end-user/endUser.ts +27 -0
- package/client/end-user/endUser.types.ts +9 -0
- package/client/evm/evm.ts +25 -16
- package/client/evm/evm.types.ts +6 -48
- package/index.ts +2 -1
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +614 -40
- package/openapi-client/generated/end-user-accounts/end-user-accounts.msw.ts +95 -0
- package/openapi-client/generated/end-user-accounts/end-user-accounts.ts +39 -0
- package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.ts +79 -20
- package/openapi-client/generated/evm-token-balances/evm-token-balances.ts +1 -2
- package/openapi-client/generated/index.msw.ts +3 -0
- package/openapi-client/generated/onchain-data/onchain-data.msw.ts +185 -0
- package/openapi-client/generated/onchain-data/onchain-data.ts +103 -0
- package/openapi-client/generated/policy-engine/policy-engine.msw.ts +48 -4
- package/openapi-client/generated/x402-facilitator/x402-facilitator.msw.ts +136 -0
- package/openapi-client/generated/x402-facilitator/x402-facilitator.ts +70 -0
- package/openapi-client/index.ts +5 -0
- package/package.json +1 -1
- package/spend-permissions/types.ts +46 -16
- package/spend-permissions/utils.ts +35 -0
- package/version.ts +1 -1
|
@@ -5,30 +5,103 @@
|
|
|
5
5
|
* The Coinbase Developer Platform APIs - leading the world's transition onchain.
|
|
6
6
|
* OpenAPI spec version: 2.0.0
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
/**
|
|
9
|
+
* The type of authentication information.
|
|
10
|
+
*/
|
|
11
|
+
export type EmailAuthenticationType =
|
|
12
|
+
(typeof EmailAuthenticationType)[keyof typeof EmailAuthenticationType];
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
15
|
+
export const EmailAuthenticationType = {
|
|
16
|
+
email: "email",
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Information about an end user who authenticates using a one-time password sent to their email address.
|
|
21
|
+
*/
|
|
22
|
+
export interface EmailAuthentication {
|
|
23
|
+
/** The type of authentication information. */
|
|
24
|
+
type: EmailAuthenticationType;
|
|
25
|
+
/** The email address of the end user. */
|
|
26
|
+
email: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The type of authentication information.
|
|
31
|
+
*/
|
|
32
|
+
export type SmsAuthenticationType =
|
|
33
|
+
(typeof SmsAuthenticationType)[keyof typeof SmsAuthenticationType];
|
|
34
|
+
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
36
|
+
export const SmsAuthenticationType = {
|
|
37
|
+
sms: "sms",
|
|
38
|
+
} as const;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Information about an end user who authenticates using a one-time password sent to their phone number via SMS.
|
|
42
|
+
*/
|
|
43
|
+
export interface SmsAuthentication {
|
|
44
|
+
/** The type of authentication information. */
|
|
45
|
+
type: SmsAuthenticationType;
|
|
14
46
|
/**
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
Account names are guaranteed to be unique across all EVM accounts in the developer's CDP Project.
|
|
18
|
-
* @pattern ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
|
|
47
|
+
* The phone number of the end user in E.164 format.
|
|
48
|
+
* @pattern ^\+[1-9]\d{1,14}$
|
|
19
49
|
*/
|
|
20
|
-
|
|
21
|
-
/** The list of policy IDs that apply to the account. This will include both the project-level policy and the account-level policy, if one exists. */
|
|
22
|
-
policies?: string[];
|
|
23
|
-
/** The UTC ISO 8601 timestamp at which the account was created. */
|
|
24
|
-
createdAt?: string;
|
|
25
|
-
/** The UTC ISO 8601 timestamp at which the account was last updated. */
|
|
26
|
-
updatedAt?: string;
|
|
50
|
+
phoneNumber: string;
|
|
27
51
|
}
|
|
28
52
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
53
|
+
/**
|
|
54
|
+
* The type of authentication information.
|
|
55
|
+
*/
|
|
56
|
+
export type DeveloperJWTAuthenticationType =
|
|
57
|
+
(typeof DeveloperJWTAuthenticationType)[keyof typeof DeveloperJWTAuthenticationType];
|
|
58
|
+
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
60
|
+
export const DeveloperJWTAuthenticationType = {
|
|
61
|
+
jwt: "jwt",
|
|
62
|
+
} as const;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Information about an end user who authenticates using a JWT issued by the developer.
|
|
66
|
+
*/
|
|
67
|
+
export interface DeveloperJWTAuthentication {
|
|
68
|
+
/** The type of authentication information. */
|
|
69
|
+
type: DeveloperJWTAuthenticationType;
|
|
70
|
+
/** The key ID of the JWK used to sign the JWT. */
|
|
71
|
+
kid: string;
|
|
72
|
+
/** The unique identifier for the end user that is captured in the `sub` claim of the JWT. */
|
|
73
|
+
sub: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Information about how the end user is authenticated.
|
|
78
|
+
*/
|
|
79
|
+
export type AuthenticationMethod =
|
|
80
|
+
| EmailAuthentication
|
|
81
|
+
| SmsAuthentication
|
|
82
|
+
| DeveloperJWTAuthentication;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The list of valid authentication methods linked to the end user.
|
|
86
|
+
*/
|
|
87
|
+
export type AuthenticationMethods = AuthenticationMethod[];
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Information about the end user.
|
|
91
|
+
*/
|
|
92
|
+
export interface EndUser {
|
|
93
|
+
/**
|
|
94
|
+
* 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.
|
|
95
|
+
* @pattern ^[a-zA-Z0-9-]{1,100}$
|
|
96
|
+
*/
|
|
97
|
+
userId: string;
|
|
98
|
+
authenticationMethods: AuthenticationMethods;
|
|
99
|
+
/** The list of EVM accounts associated with the end user. Currently, only one EVM account is supported per end user. */
|
|
100
|
+
evmAccounts: string[];
|
|
101
|
+
/** The list of EVM smart accounts associated with the end user. Currently, only one EVM smart account is supported per end user. */
|
|
102
|
+
evmSmartAccounts: string[];
|
|
103
|
+
/** The list of Solana accounts associated with the end user. Currently, only one Solana account is supported per end user. */
|
|
104
|
+
solanaAccounts: string[];
|
|
32
105
|
}
|
|
33
106
|
|
|
34
107
|
/**
|
|
@@ -45,6 +118,7 @@ export const ErrorType = {
|
|
|
45
118
|
idempotency_error: "idempotency_error",
|
|
46
119
|
internal_server_error: "internal_server_error",
|
|
47
120
|
invalid_request: "invalid_request",
|
|
121
|
+
invalid_sql_query: "invalid_sql_query",
|
|
48
122
|
invalid_signature: "invalid_signature",
|
|
49
123
|
malformed_transaction: "malformed_transaction",
|
|
50
124
|
not_found: "not_found",
|
|
@@ -78,6 +152,32 @@ export interface Error {
|
|
|
78
152
|
errorLink?: string;
|
|
79
153
|
}
|
|
80
154
|
|
|
155
|
+
export interface EvmAccount {
|
|
156
|
+
/**
|
|
157
|
+
* The 0x-prefixed, checksum EVM address.
|
|
158
|
+
* @pattern ^0x[0-9a-fA-F]{40}$
|
|
159
|
+
*/
|
|
160
|
+
address: string;
|
|
161
|
+
/**
|
|
162
|
+
* An optional name for the account.
|
|
163
|
+
Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long.
|
|
164
|
+
Account names are guaranteed to be unique across all EVM accounts in the developer's CDP Project.
|
|
165
|
+
* @pattern ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
|
|
166
|
+
*/
|
|
167
|
+
name?: string;
|
|
168
|
+
/** The list of policy IDs that apply to the account. This will include both the project-level policy and the account-level policy, if one exists. */
|
|
169
|
+
policies?: string[];
|
|
170
|
+
/** The UTC ISO 8601 timestamp at which the account was created. */
|
|
171
|
+
createdAt?: string;
|
|
172
|
+
/** The UTC ISO 8601 timestamp at which the account was last updated. */
|
|
173
|
+
updatedAt?: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export interface ListResponse {
|
|
177
|
+
/** The token for the next page of items, if any. */
|
|
178
|
+
nextPageToken?: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
81
181
|
/**
|
|
82
182
|
* The domain of the EIP-712 typed data.
|
|
83
183
|
*/
|
|
@@ -202,6 +302,20 @@ export interface UserOperationReceiptRevert {
|
|
|
202
302
|
*/
|
|
203
303
|
export interface UserOperationReceipt {
|
|
204
304
|
revert?: UserOperationReceiptRevert;
|
|
305
|
+
/**
|
|
306
|
+
* The hash of this transaction as 0x-prefixed string.
|
|
307
|
+
* @pattern ^0x[a-fA-F0-9]{64}$
|
|
308
|
+
*/
|
|
309
|
+
transactionHash?: string;
|
|
310
|
+
/**
|
|
311
|
+
* The block hash of the block including the transaction as 0x-prefixed string.
|
|
312
|
+
* @pattern ^0x[0-9a-fA-F]{64}$|^$
|
|
313
|
+
*/
|
|
314
|
+
blockHash?: string;
|
|
315
|
+
/** The block height (number) of the block including the transaction. */
|
|
316
|
+
blockNumber?: number;
|
|
317
|
+
/** The gas used for landing this user operation. */
|
|
318
|
+
gasUsed?: string;
|
|
205
319
|
}
|
|
206
320
|
|
|
207
321
|
/**
|
|
@@ -240,21 +354,33 @@ export interface EvmUserOperation {
|
|
|
240
354
|
receipts?: UserOperationReceipt[];
|
|
241
355
|
}
|
|
242
356
|
|
|
357
|
+
/**
|
|
358
|
+
* The network the spend permission is on.
|
|
359
|
+
*/
|
|
360
|
+
export type SpendPermissionNetwork =
|
|
361
|
+
(typeof SpendPermissionNetwork)[keyof typeof SpendPermissionNetwork];
|
|
362
|
+
|
|
363
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
364
|
+
export const SpendPermissionNetwork = {
|
|
365
|
+
base: "base",
|
|
366
|
+
"base-sepolia": "base-sepolia",
|
|
367
|
+
ethereum: "ethereum",
|
|
368
|
+
"ethereum-sepolia": "ethereum-sepolia",
|
|
369
|
+
optimism: "optimism",
|
|
370
|
+
arbitrum: "arbitrum",
|
|
371
|
+
avalanche: "avalanche",
|
|
372
|
+
polygon: "polygon",
|
|
373
|
+
} as const;
|
|
374
|
+
|
|
243
375
|
export interface CreateSpendPermissionRequest {
|
|
244
|
-
|
|
245
|
-
network: string;
|
|
246
|
-
/**
|
|
247
|
-
* Smart account this spend permission is valid for.
|
|
248
|
-
* @pattern ^0x[a-fA-F0-9]{40}$
|
|
249
|
-
*/
|
|
250
|
-
account: string;
|
|
376
|
+
network: SpendPermissionNetwork;
|
|
251
377
|
/**
|
|
252
|
-
* Entity that can spend account's tokens.
|
|
378
|
+
* Entity that can spend account's tokens. Can be either a Smart Account or an EOA.
|
|
253
379
|
* @pattern ^0x[a-fA-F0-9]{40}$
|
|
254
380
|
*/
|
|
255
381
|
spender: string;
|
|
256
382
|
/**
|
|
257
|
-
*
|
|
383
|
+
* ERC-7528 native token address (e.g. "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" for native ETH), or an ERC-20 contract address.
|
|
258
384
|
* @pattern ^0x[a-fA-F0-9]{40}$
|
|
259
385
|
*/
|
|
260
386
|
token: string;
|
|
@@ -296,32 +422,31 @@ export interface SpendPermission {
|
|
|
296
422
|
/** Maximum allowed value to spend, in atomic units for the specified token, within each period. */
|
|
297
423
|
allowance: string;
|
|
298
424
|
/** Time duration for resetting used allowance on a recurring basis (seconds). */
|
|
299
|
-
period
|
|
425
|
+
period: string;
|
|
300
426
|
/** The start time for this spend permission, in Unix seconds. */
|
|
301
|
-
start
|
|
427
|
+
start: string;
|
|
302
428
|
/** The expiration time for this spend permission, in Unix seconds. */
|
|
303
|
-
end
|
|
429
|
+
end: string;
|
|
304
430
|
/** An arbitrary salt to differentiate unique spend permissions with otherwise identical data. */
|
|
305
|
-
salt
|
|
431
|
+
salt: string;
|
|
306
432
|
/** Arbitrary data to include in the permission. */
|
|
307
|
-
extraData
|
|
433
|
+
extraData: string;
|
|
308
434
|
}
|
|
309
435
|
|
|
310
436
|
export interface SpendPermissionResponseObject {
|
|
311
|
-
permission
|
|
437
|
+
permission: SpendPermission;
|
|
312
438
|
/** Unique hash identifier for this permission. */
|
|
313
|
-
permissionHash
|
|
439
|
+
permissionHash: string;
|
|
314
440
|
/** Whether this permission has been revoked. */
|
|
315
|
-
revoked
|
|
441
|
+
revoked: boolean;
|
|
316
442
|
/** The UTC ISO 8601 timestamp when the permission was revoked (if applicable). */
|
|
317
443
|
revokedAt?: string;
|
|
318
444
|
/** The UTC ISO 8601 timestamp when the permission was created. */
|
|
319
|
-
createdAt
|
|
445
|
+
createdAt: string;
|
|
320
446
|
}
|
|
321
447
|
|
|
322
448
|
export interface RevokeSpendPermissionRequest {
|
|
323
|
-
|
|
324
|
-
network: string;
|
|
449
|
+
network: SpendPermissionNetwork;
|
|
325
450
|
/** The hash of the spend permission to revoke. */
|
|
326
451
|
permissionHash: string;
|
|
327
452
|
/** The paymaster URL of the spend permission. */
|
|
@@ -1032,6 +1157,14 @@ export type EvmNetworkCriterionNetworksItem =
|
|
|
1032
1157
|
export const EvmNetworkCriterionNetworksItem = {
|
|
1033
1158
|
"base-sepolia": "base-sepolia",
|
|
1034
1159
|
base: "base",
|
|
1160
|
+
ethereum: "ethereum",
|
|
1161
|
+
"ethereum-sepolia": "ethereum-sepolia",
|
|
1162
|
+
avalanche: "avalanche",
|
|
1163
|
+
polygon: "polygon",
|
|
1164
|
+
optimism: "optimism",
|
|
1165
|
+
arbitrum: "arbitrum",
|
|
1166
|
+
zora: "zora",
|
|
1167
|
+
bnb: "bnb",
|
|
1035
1168
|
} as const;
|
|
1036
1169
|
|
|
1037
1170
|
/**
|
|
@@ -1847,6 +1980,355 @@ export interface SolanaTokenBalance {
|
|
|
1847
1980
|
token: SolanaToken;
|
|
1848
1981
|
}
|
|
1849
1982
|
|
|
1983
|
+
/**
|
|
1984
|
+
* Request to execute a SQL query against indexed blockchain data.
|
|
1985
|
+
*/
|
|
1986
|
+
export interface OnchainDataQuery {
|
|
1987
|
+
/**
|
|
1988
|
+
* SQL query to execute against the indexed blockchain data.
|
|
1989
|
+
* @minLength 1
|
|
1990
|
+
* @maxLength 10000
|
|
1991
|
+
*/
|
|
1992
|
+
sql: string;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
/**
|
|
1996
|
+
* Row data with column names as keys.
|
|
1997
|
+
*/
|
|
1998
|
+
export type OnchainDataResultResultItem = { [key: string]: unknown };
|
|
1999
|
+
|
|
2000
|
+
/**
|
|
2001
|
+
* Column data type (ClickHouse types).
|
|
2002
|
+
*/
|
|
2003
|
+
export type OnchainDataResultSchemaColumnsItemType =
|
|
2004
|
+
(typeof OnchainDataResultSchemaColumnsItemType)[keyof typeof OnchainDataResultSchemaColumnsItemType];
|
|
2005
|
+
|
|
2006
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2007
|
+
export const OnchainDataResultSchemaColumnsItemType = {
|
|
2008
|
+
String: "String",
|
|
2009
|
+
UInt8: "UInt8",
|
|
2010
|
+
UInt16: "UInt16",
|
|
2011
|
+
UInt32: "UInt32",
|
|
2012
|
+
UInt64: "UInt64",
|
|
2013
|
+
UInt128: "UInt128",
|
|
2014
|
+
UInt256: "UInt256",
|
|
2015
|
+
Int8: "Int8",
|
|
2016
|
+
Int16: "Int16",
|
|
2017
|
+
Int32: "Int32",
|
|
2018
|
+
Int64: "Int64",
|
|
2019
|
+
Int128: "Int128",
|
|
2020
|
+
Int256: "Int256",
|
|
2021
|
+
Float32: "Float32",
|
|
2022
|
+
Float64: "Float64",
|
|
2023
|
+
Bool: "Bool",
|
|
2024
|
+
Date: "Date",
|
|
2025
|
+
DateTime: "DateTime",
|
|
2026
|
+
DateTime64: "DateTime64",
|
|
2027
|
+
UUID: "UUID",
|
|
2028
|
+
} as const;
|
|
2029
|
+
|
|
2030
|
+
export type OnchainDataResultSchemaColumnsItem = {
|
|
2031
|
+
/** Column name. */
|
|
2032
|
+
name?: string;
|
|
2033
|
+
/** Column data type (ClickHouse types). */
|
|
2034
|
+
type?: OnchainDataResultSchemaColumnsItemType;
|
|
2035
|
+
};
|
|
2036
|
+
|
|
2037
|
+
/**
|
|
2038
|
+
* Schema information for the query result. This is a derived schema from the query result, so types may not match the underlying table.
|
|
2039
|
+
|
|
2040
|
+
*/
|
|
2041
|
+
export type OnchainDataResultSchema = {
|
|
2042
|
+
/** Column definitions. */
|
|
2043
|
+
columns?: OnchainDataResultSchemaColumnsItem[];
|
|
2044
|
+
};
|
|
2045
|
+
|
|
2046
|
+
/**
|
|
2047
|
+
* Metadata about query execution.
|
|
2048
|
+
*/
|
|
2049
|
+
export type OnchainDataResultMetadata = {
|
|
2050
|
+
/** Whether the result was served from cache. */
|
|
2051
|
+
cached?: boolean;
|
|
2052
|
+
/** Query execution time in milliseconds. */
|
|
2053
|
+
executionTimeMs?: number;
|
|
2054
|
+
/** Number of rows returned. */
|
|
2055
|
+
rowCount?: number;
|
|
2056
|
+
};
|
|
2057
|
+
|
|
2058
|
+
/**
|
|
2059
|
+
* Result of executing a SQL query.
|
|
2060
|
+
*/
|
|
2061
|
+
export interface OnchainDataResult {
|
|
2062
|
+
/** Query result as an array of objects representing rows. */
|
|
2063
|
+
result?: OnchainDataResultResultItem[];
|
|
2064
|
+
/** Schema information for the query result. This is a derived schema from the query result, so types may not match the underlying table.
|
|
2065
|
+
*/
|
|
2066
|
+
schema?: OnchainDataResultSchema;
|
|
2067
|
+
/** Metadata about query execution. */
|
|
2068
|
+
metadata?: OnchainDataResultMetadata;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
/**
|
|
2072
|
+
* Response containing token addresses that an account has received.
|
|
2073
|
+
*/
|
|
2074
|
+
export interface AccountTokenAddressesResponse {
|
|
2075
|
+
/** The account address that was queried. */
|
|
2076
|
+
accountAddress?: string;
|
|
2077
|
+
/** List of token contract addresses that the account has received. */
|
|
2078
|
+
tokenAddresses?: string[];
|
|
2079
|
+
/**
|
|
2080
|
+
* Total number of unique token addresses discovered.
|
|
2081
|
+
* @minimum 0
|
|
2082
|
+
*/
|
|
2083
|
+
totalCount?: number;
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
/**
|
|
2087
|
+
* The version of the x402 protocol.
|
|
2088
|
+
*/
|
|
2089
|
+
export type X402Version = (typeof X402Version)[keyof typeof X402Version];
|
|
2090
|
+
|
|
2091
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2092
|
+
export const X402Version = {
|
|
2093
|
+
NUMBER_1: 1,
|
|
2094
|
+
} as const;
|
|
2095
|
+
|
|
2096
|
+
/**
|
|
2097
|
+
* The authorization data for the ERC-3009 authorization message.
|
|
2098
|
+
*/
|
|
2099
|
+
export type X402ExactEvmPayloadAuthorization = {
|
|
2100
|
+
/**
|
|
2101
|
+
* The 0x-prefixed, checksum EVM address of the sender of the payment.
|
|
2102
|
+
* @pattern ^0x[0-9a-fA-F]{40}$
|
|
2103
|
+
*/
|
|
2104
|
+
from: string;
|
|
2105
|
+
/**
|
|
2106
|
+
* The 0x-prefixed, checksum EVM address of the recipient of the payment.
|
|
2107
|
+
* @pattern ^0x[0-9a-fA-F]{40}$
|
|
2108
|
+
*/
|
|
2109
|
+
to: string;
|
|
2110
|
+
/** The value of the payment, in atomic units of the payment asset. */
|
|
2111
|
+
value: string;
|
|
2112
|
+
/** The unix timestamp after which the payment is valid. */
|
|
2113
|
+
validAfter: string;
|
|
2114
|
+
/** The unix timestamp before which the payment is valid. */
|
|
2115
|
+
validBefore: string;
|
|
2116
|
+
/** The hex-encoded nonce of the payment. */
|
|
2117
|
+
nonce: string;
|
|
2118
|
+
};
|
|
2119
|
+
|
|
2120
|
+
/**
|
|
2121
|
+
* The x402 protocol exact scheme payload for EVM networks. The scheme is implemented using ERC-3009. For more details, please see [EVM Exact Scheme Details](https://github.com/coinbase/x402/blob/main/specs/schemes/exact/scheme_exact_evm.md).
|
|
2122
|
+
*/
|
|
2123
|
+
export interface X402ExactEvmPayload {
|
|
2124
|
+
/** The EIP-712 hex-encoded signature of the ERC-3009 authorization message. */
|
|
2125
|
+
signature: string;
|
|
2126
|
+
/** The authorization data for the ERC-3009 authorization message. */
|
|
2127
|
+
authorization: X402ExactEvmPayloadAuthorization;
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
/**
|
|
2131
|
+
* The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`.
|
|
2132
|
+
*/
|
|
2133
|
+
export type X402PaymentPayloadScheme =
|
|
2134
|
+
(typeof X402PaymentPayloadScheme)[keyof typeof X402PaymentPayloadScheme];
|
|
2135
|
+
|
|
2136
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2137
|
+
export const X402PaymentPayloadScheme = {
|
|
2138
|
+
exact: "exact",
|
|
2139
|
+
} as const;
|
|
2140
|
+
|
|
2141
|
+
/**
|
|
2142
|
+
* The network of the blockchain to send payment on.
|
|
2143
|
+
*/
|
|
2144
|
+
export type X402PaymentPayloadNetwork =
|
|
2145
|
+
(typeof X402PaymentPayloadNetwork)[keyof typeof X402PaymentPayloadNetwork];
|
|
2146
|
+
|
|
2147
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2148
|
+
export const X402PaymentPayloadNetwork = {
|
|
2149
|
+
"base-sepolia": "base-sepolia",
|
|
2150
|
+
base: "base",
|
|
2151
|
+
} as const;
|
|
2152
|
+
|
|
2153
|
+
/**
|
|
2154
|
+
* The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header.
|
|
2155
|
+
*/
|
|
2156
|
+
export interface X402PaymentPayload {
|
|
2157
|
+
x402Version: X402Version;
|
|
2158
|
+
/** The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. */
|
|
2159
|
+
scheme: X402PaymentPayloadScheme;
|
|
2160
|
+
/** The network of the blockchain to send payment on. */
|
|
2161
|
+
network: X402PaymentPayloadNetwork;
|
|
2162
|
+
/** The payload of the payment depending on the x402Version, scheme, and network. */
|
|
2163
|
+
payload: X402ExactEvmPayload;
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
/**
|
|
2167
|
+
* The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`.
|
|
2168
|
+
*/
|
|
2169
|
+
export type X402PaymentRequirementsScheme =
|
|
2170
|
+
(typeof X402PaymentRequirementsScheme)[keyof typeof X402PaymentRequirementsScheme];
|
|
2171
|
+
|
|
2172
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2173
|
+
export const X402PaymentRequirementsScheme = {
|
|
2174
|
+
exact: "exact",
|
|
2175
|
+
} as const;
|
|
2176
|
+
|
|
2177
|
+
/**
|
|
2178
|
+
* The network of the blockchain to send payment on.
|
|
2179
|
+
*/
|
|
2180
|
+
export type X402PaymentRequirementsNetwork =
|
|
2181
|
+
(typeof X402PaymentRequirementsNetwork)[keyof typeof X402PaymentRequirementsNetwork];
|
|
2182
|
+
|
|
2183
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2184
|
+
export const X402PaymentRequirementsNetwork = {
|
|
2185
|
+
"base-sepolia": "base-sepolia",
|
|
2186
|
+
base: "base",
|
|
2187
|
+
} as const;
|
|
2188
|
+
|
|
2189
|
+
/**
|
|
2190
|
+
* The optional JSON schema describing the resource output.
|
|
2191
|
+
*/
|
|
2192
|
+
export type X402PaymentRequirementsOutputSchema = { [key: string]: unknown };
|
|
2193
|
+
|
|
2194
|
+
/**
|
|
2195
|
+
* The optional additional scheme-specific payment info.
|
|
2196
|
+
*/
|
|
2197
|
+
export type X402PaymentRequirementsExtra = { [key: string]: unknown };
|
|
2198
|
+
|
|
2199
|
+
/**
|
|
2200
|
+
* The x402 protocol payment requirements that the resource server expects the client's payment payload to meet.
|
|
2201
|
+
*/
|
|
2202
|
+
export interface X402PaymentRequirements {
|
|
2203
|
+
/** The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. */
|
|
2204
|
+
scheme: X402PaymentRequirementsScheme;
|
|
2205
|
+
/** The network of the blockchain to send payment on. */
|
|
2206
|
+
network: X402PaymentRequirementsNetwork;
|
|
2207
|
+
/** The maximum amount required to pay for the resource in atomic units of the payment asset. */
|
|
2208
|
+
maxAmountRequired: string;
|
|
2209
|
+
/** The URL of the resource to pay for. */
|
|
2210
|
+
resource: string;
|
|
2211
|
+
/** The description of the resource. */
|
|
2212
|
+
description: string;
|
|
2213
|
+
/** The MIME type of the resource response. */
|
|
2214
|
+
mimeType: string;
|
|
2215
|
+
/** The optional JSON schema describing the resource output. */
|
|
2216
|
+
outputSchema?: X402PaymentRequirementsOutputSchema;
|
|
2217
|
+
/**
|
|
2218
|
+
* The destination to pay value to.
|
|
2219
|
+
|
|
2220
|
+
For EVM networks, payTo will be a 0x-prefixed, checksum EVM address.
|
|
2221
|
+
|
|
2222
|
+
For Solana-based networks, payTo will be a base58-encoded Solana address.
|
|
2223
|
+
* @pattern ^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
|
|
2224
|
+
*/
|
|
2225
|
+
payTo: string;
|
|
2226
|
+
/** The maximum time in seconds for the resource server to respond. */
|
|
2227
|
+
maxTimeoutSeconds: number;
|
|
2228
|
+
/**
|
|
2229
|
+
* The asset to pay with.
|
|
2230
|
+
|
|
2231
|
+
For EVM networks, the asset will be a 0x-prefixed, checksum EVM address.
|
|
2232
|
+
|
|
2233
|
+
For Solana-based networks, the asset will be a base58-encoded Solana address.
|
|
2234
|
+
* @pattern ^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
|
|
2235
|
+
*/
|
|
2236
|
+
asset: string;
|
|
2237
|
+
/** The optional additional scheme-specific payment info. */
|
|
2238
|
+
extra?: X402PaymentRequirementsExtra;
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
/**
|
|
2242
|
+
* The reason the payment is invalid on the x402 protocol.
|
|
2243
|
+
*/
|
|
2244
|
+
export type X402VerifyInvalidReason =
|
|
2245
|
+
(typeof X402VerifyInvalidReason)[keyof typeof X402VerifyInvalidReason];
|
|
2246
|
+
|
|
2247
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2248
|
+
export const X402VerifyInvalidReason = {
|
|
2249
|
+
insufficient_funds: "insufficient_funds",
|
|
2250
|
+
invalid_scheme: "invalid_scheme",
|
|
2251
|
+
invalid_network: "invalid_network",
|
|
2252
|
+
invalid_x402_version: "invalid_x402_version",
|
|
2253
|
+
invalid_payment_requirements: "invalid_payment_requirements",
|
|
2254
|
+
invalid_payload: "invalid_payload",
|
|
2255
|
+
invalid_exact_evm_payload_authorization_value: "invalid_exact_evm_payload_authorization_value",
|
|
2256
|
+
invalid_exact_evm_payload_authorization_valid_after:
|
|
2257
|
+
"invalid_exact_evm_payload_authorization_valid_after",
|
|
2258
|
+
invalid_exact_evm_payload_authorization_valid_before:
|
|
2259
|
+
"invalid_exact_evm_payload_authorization_valid_before",
|
|
2260
|
+
invalid_exact_evm_payload_authorization_typed_data_message:
|
|
2261
|
+
"invalid_exact_evm_payload_authorization_typed_data_message",
|
|
2262
|
+
invalid_exact_evm_payload_authorization_from_address_kyt:
|
|
2263
|
+
"invalid_exact_evm_payload_authorization_from_address_kyt",
|
|
2264
|
+
invalid_exact_evm_payload_authorization_to_address_kyt:
|
|
2265
|
+
"invalid_exact_evm_payload_authorization_to_address_kyt",
|
|
2266
|
+
invalid_exact_evm_payload_signature: "invalid_exact_evm_payload_signature",
|
|
2267
|
+
invalid_exact_evm_payload_signature_address: "invalid_exact_evm_payload_signature_address",
|
|
2268
|
+
} as const;
|
|
2269
|
+
|
|
2270
|
+
/**
|
|
2271
|
+
* The reason the payment settlement errored on the x402 protocol.
|
|
2272
|
+
*/
|
|
2273
|
+
export type X402SettleErrorReason =
|
|
2274
|
+
(typeof X402SettleErrorReason)[keyof typeof X402SettleErrorReason];
|
|
2275
|
+
|
|
2276
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2277
|
+
export const X402SettleErrorReason = {
|
|
2278
|
+
insufficient_funds: "insufficient_funds",
|
|
2279
|
+
invalid_scheme: "invalid_scheme",
|
|
2280
|
+
invalid_network: "invalid_network",
|
|
2281
|
+
invalid_x402_version: "invalid_x402_version",
|
|
2282
|
+
invalid_payment_requirements: "invalid_payment_requirements",
|
|
2283
|
+
invalid_payload: "invalid_payload",
|
|
2284
|
+
invalid_exact_evm_payload_authorization_value: "invalid_exact_evm_payload_authorization_value",
|
|
2285
|
+
invalid_exact_evm_payload_authorization_valid_after:
|
|
2286
|
+
"invalid_exact_evm_payload_authorization_valid_after",
|
|
2287
|
+
invalid_exact_evm_payload_authorization_valid_before:
|
|
2288
|
+
"invalid_exact_evm_payload_authorization_valid_before",
|
|
2289
|
+
invalid_exact_evm_payload_authorization_typed_data_message:
|
|
2290
|
+
"invalid_exact_evm_payload_authorization_typed_data_message",
|
|
2291
|
+
invalid_exact_evm_payload_authorization_from_address_kyt:
|
|
2292
|
+
"invalid_exact_evm_payload_authorization_from_address_kyt",
|
|
2293
|
+
invalid_exact_evm_payload_authorization_to_address_kyt:
|
|
2294
|
+
"invalid_exact_evm_payload_authorization_to_address_kyt",
|
|
2295
|
+
invalid_exact_evm_payload_signature_address: "invalid_exact_evm_payload_signature_address",
|
|
2296
|
+
} as const;
|
|
2297
|
+
|
|
2298
|
+
/**
|
|
2299
|
+
* The scheme of the payment protocol.
|
|
2300
|
+
*/
|
|
2301
|
+
export type X402SupportedPaymentKindScheme =
|
|
2302
|
+
(typeof X402SupportedPaymentKindScheme)[keyof typeof X402SupportedPaymentKindScheme];
|
|
2303
|
+
|
|
2304
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2305
|
+
export const X402SupportedPaymentKindScheme = {
|
|
2306
|
+
exact: "exact",
|
|
2307
|
+
} as const;
|
|
2308
|
+
|
|
2309
|
+
/**
|
|
2310
|
+
* The network of the blockchain.
|
|
2311
|
+
*/
|
|
2312
|
+
export type X402SupportedPaymentKindNetwork =
|
|
2313
|
+
(typeof X402SupportedPaymentKindNetwork)[keyof typeof X402SupportedPaymentKindNetwork];
|
|
2314
|
+
|
|
2315
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2316
|
+
export const X402SupportedPaymentKindNetwork = {
|
|
2317
|
+
"base-sepolia": "base-sepolia",
|
|
2318
|
+
base: "base",
|
|
2319
|
+
} as const;
|
|
2320
|
+
|
|
2321
|
+
/**
|
|
2322
|
+
* The supported payment kind for the x402 protocol. A kind is comprised of a scheme and a network, which together uniquely identify a way to move money on the x402 protocol. For more details, please see [x402 Schemes](https://github.com/coinbase/x402?tab=readme-ov-file#schemes).
|
|
2323
|
+
*/
|
|
2324
|
+
export interface X402SupportedPaymentKind {
|
|
2325
|
+
x402Version: X402Version;
|
|
2326
|
+
/** The scheme of the payment protocol. */
|
|
2327
|
+
scheme: X402SupportedPaymentKindScheme;
|
|
2328
|
+
/** The network of the blockchain. */
|
|
2329
|
+
network: X402SupportedPaymentKindNetwork;
|
|
2330
|
+
}
|
|
2331
|
+
|
|
1850
2332
|
/**
|
|
1851
2333
|
* The action of the payment method.
|
|
1852
2334
|
*/
|
|
@@ -2211,11 +2693,65 @@ export type IdempotencyErrorResponse = Error;
|
|
|
2211
2693
|
*/
|
|
2212
2694
|
export type AlreadyExistsErrorResponse = Error;
|
|
2213
2695
|
|
|
2696
|
+
/**
|
|
2697
|
+
* The underlying SQL string is invalid.
|
|
2698
|
+
*/
|
|
2699
|
+
export type InvalidSQLQueryErrorResponse = Error;
|
|
2700
|
+
|
|
2214
2701
|
/**
|
|
2215
2702
|
* Unauthorized.
|
|
2216
2703
|
*/
|
|
2217
2704
|
export type UnauthorizedErrorResponse = Error;
|
|
2218
2705
|
|
|
2706
|
+
/**
|
|
2707
|
+
* The request timed out.
|
|
2708
|
+
*/
|
|
2709
|
+
export type TimedOutErrorResponse = Error;
|
|
2710
|
+
|
|
2711
|
+
export type X402VerifyResponseResponse = {
|
|
2712
|
+
/** Indicates whether the payment is valid. */
|
|
2713
|
+
isValid: boolean;
|
|
2714
|
+
invalidReason?: X402VerifyInvalidReason;
|
|
2715
|
+
/**
|
|
2716
|
+
* The onchain address of the client that is paying for the resource.
|
|
2717
|
+
|
|
2718
|
+
For EVM networks, the payer will be a 0x-prefixed, checksum EVM address.
|
|
2719
|
+
|
|
2720
|
+
For Solana-based networks, the payer will be a base58-encoded Solana address.
|
|
2721
|
+
* @pattern ^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
|
|
2722
|
+
*/
|
|
2723
|
+
payer: string;
|
|
2724
|
+
};
|
|
2725
|
+
|
|
2726
|
+
export type X402SettleResponseResponse = {
|
|
2727
|
+
/** Indicates whether the payment settlement is successful. */
|
|
2728
|
+
success: boolean;
|
|
2729
|
+
errorReason?: X402SettleErrorReason;
|
|
2730
|
+
/**
|
|
2731
|
+
* The onchain address of the client that is paying for the resource.
|
|
2732
|
+
|
|
2733
|
+
For EVM networks, the payer will be a 0x-prefixed, checksum EVM address.
|
|
2734
|
+
|
|
2735
|
+
For Solana-based networks, the payer will be a base58-encoded Solana address.
|
|
2736
|
+
* @pattern ^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
|
|
2737
|
+
*/
|
|
2738
|
+
payer: string;
|
|
2739
|
+
/**
|
|
2740
|
+
* The transaction of the settlement.
|
|
2741
|
+
For EVM networks, the transaction will be a 0x-prefixed, EVM transaction hash.
|
|
2742
|
+
For Solana-based networks, the transaction will be a base58-encoded Solana signature.
|
|
2743
|
+
* @pattern ^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
|
|
2744
|
+
*/
|
|
2745
|
+
transaction: string;
|
|
2746
|
+
/** The network where the settlement occurred. */
|
|
2747
|
+
network: string;
|
|
2748
|
+
};
|
|
2749
|
+
|
|
2750
|
+
export type X402SupportedPaymentKindsResponseResponse = {
|
|
2751
|
+
/** The list of supported payment kinds. */
|
|
2752
|
+
kinds: X402SupportedPaymentKind[];
|
|
2753
|
+
};
|
|
2754
|
+
|
|
2219
2755
|
/**
|
|
2220
2756
|
* Rate limit exceeded.
|
|
2221
2757
|
*/
|
|
@@ -2237,6 +2773,14 @@ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/i
|
|
|
2237
2773
|
*/
|
|
2238
2774
|
export type IdempotencyKeyParameter = string;
|
|
2239
2775
|
|
|
2776
|
+
/**
|
|
2777
|
+
* The request body for a developer to verify an end user's access token.
|
|
2778
|
+
*/
|
|
2779
|
+
export type ValidateEndUserAccessTokenBody = {
|
|
2780
|
+
/** The access token in JWT format to verify. */
|
|
2781
|
+
accessToken: string;
|
|
2782
|
+
};
|
|
2783
|
+
|
|
2240
2784
|
export type ListEvmAccountsParams = {
|
|
2241
2785
|
/**
|
|
2242
2786
|
* The number of accounts to return per page.
|
|
@@ -2806,6 +3350,36 @@ export type ListSolanaTokenBalances200AllOf = {
|
|
|
2806
3350
|
|
|
2807
3351
|
export type ListSolanaTokenBalances200 = ListSolanaTokenBalances200AllOf & ListResponse;
|
|
2808
3352
|
|
|
3353
|
+
export type ListDataTokenBalancesParams = {
|
|
3354
|
+
/**
|
|
3355
|
+
* The number of balances to return per page.
|
|
3356
|
+
*/
|
|
3357
|
+
pageSize?: number;
|
|
3358
|
+
/**
|
|
3359
|
+
* The token for the next page of balances. Will be empty if there are no more balances to fetch.
|
|
3360
|
+
*/
|
|
3361
|
+
pageToken?: string;
|
|
3362
|
+
};
|
|
3363
|
+
|
|
3364
|
+
export type ListDataTokenBalances200AllOf = {
|
|
3365
|
+
/** The list of EVM token balances. */
|
|
3366
|
+
balances: TokenBalance[];
|
|
3367
|
+
};
|
|
3368
|
+
|
|
3369
|
+
export type ListDataTokenBalances200 = ListDataTokenBalances200AllOf & ListResponse;
|
|
3370
|
+
|
|
3371
|
+
export type VerifyX402PaymentBody = {
|
|
3372
|
+
x402Version: X402Version;
|
|
3373
|
+
paymentPayload: X402PaymentPayload;
|
|
3374
|
+
paymentRequirements: X402PaymentRequirements;
|
|
3375
|
+
};
|
|
3376
|
+
|
|
3377
|
+
export type SettleX402PaymentBody = {
|
|
3378
|
+
x402Version: X402Version;
|
|
3379
|
+
paymentPayload: X402PaymentPayload;
|
|
3380
|
+
paymentRequirements: X402PaymentRequirements;
|
|
3381
|
+
};
|
|
3382
|
+
|
|
2809
3383
|
export type GetCryptoRailsParams = {
|
|
2810
3384
|
/**
|
|
2811
3385
|
* Comma separated list of networks to filter the rails by.
|