@coinbase/cdp-sdk 1.43.0 → 1.44.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.
Files changed (74) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +63 -0
  3. package/_cjs/actions/evm/sendUserOperation.js +23 -10
  4. package/_cjs/actions/evm/sendUserOperation.js.map +1 -1
  5. package/_cjs/actions/evm/transfer/utils.js +1 -1
  6. package/_cjs/actions/evm/transfer/utils.js.map +1 -1
  7. package/_cjs/auth/utils/hash.js +1 -1
  8. package/_cjs/auth/utils/hash.js.map +1 -1
  9. package/_cjs/auth/utils/http.js +4 -1
  10. package/_cjs/auth/utils/http.js.map +1 -1
  11. package/_cjs/client/end-user/endUser.js +88 -5
  12. package/_cjs/client/end-user/endUser.js.map +1 -1
  13. package/_cjs/client/end-user/toEndUserAccount.js +51 -0
  14. package/_cjs/client/end-user/toEndUserAccount.js.map +1 -0
  15. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +4 -2
  16. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  17. package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js +43 -1
  18. package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -1
  19. package/_cjs/openapi-client/generated/webhooks/webhooks.js +8 -1
  20. package/_cjs/openapi-client/generated/webhooks/webhooks.js.map +1 -1
  21. package/_cjs/version.js +1 -1
  22. package/_esm/actions/evm/sendUserOperation.js +23 -10
  23. package/_esm/actions/evm/sendUserOperation.js.map +1 -1
  24. package/_esm/actions/evm/transfer/utils.js +1 -1
  25. package/_esm/actions/evm/transfer/utils.js.map +1 -1
  26. package/_esm/auth/utils/hash.js +1 -1
  27. package/_esm/auth/utils/hash.js.map +1 -1
  28. package/_esm/auth/utils/http.js +4 -1
  29. package/_esm/auth/utils/http.js.map +1 -1
  30. package/_esm/client/end-user/endUser.js +89 -6
  31. package/_esm/client/end-user/endUser.js.map +1 -1
  32. package/_esm/client/end-user/toEndUserAccount.js +48 -0
  33. package/_esm/client/end-user/toEndUserAccount.js.map +1 -0
  34. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +4 -2
  35. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  36. package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js +39 -0
  37. package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -1
  38. package/_esm/openapi-client/generated/webhooks/webhooks.js +8 -1
  39. package/_esm/openapi-client/generated/webhooks/webhooks.js.map +1 -1
  40. package/_esm/version.js +1 -1
  41. package/_types/actions/evm/sendUserOperation.d.ts.map +1 -1
  42. package/_types/actions/evm/transfer/utils.d.ts +2 -1
  43. package/_types/actions/evm/transfer/utils.d.ts.map +1 -1
  44. package/_types/auth/utils/http.d.ts.map +1 -1
  45. package/_types/client/end-user/endUser.d.ts +64 -6
  46. package/_types/client/end-user/endUser.d.ts.map +1 -1
  47. package/_types/client/end-user/endUser.types.d.ts +124 -1
  48. package/_types/client/end-user/endUser.types.d.ts.map +1 -1
  49. package/_types/client/end-user/toEndUserAccount.d.ts +20 -0
  50. package/_types/client/end-user/toEndUserAccount.d.ts.map +1 -0
  51. package/_types/index.d.ts +1 -1
  52. package/_types/index.d.ts.map +1 -1
  53. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +62 -38
  54. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  55. package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.d.ts +22 -1
  56. package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.d.ts.map +1 -1
  57. package/_types/openapi-client/generated/webhooks/webhooks.d.ts +8 -1
  58. package/_types/openapi-client/generated/webhooks/webhooks.d.ts.map +1 -1
  59. package/_types/openapi-client/index.d.ts +3 -0
  60. package/_types/openapi-client/index.d.ts.map +1 -1
  61. package/_types/version.d.ts +1 -1
  62. package/actions/evm/sendUserOperation.ts +45 -11
  63. package/actions/evm/transfer/utils.ts +5 -3
  64. package/auth/utils/hash.ts +1 -1
  65. package/auth/utils/http.ts +5 -2
  66. package/client/end-user/endUser.ts +119 -14
  67. package/client/end-user/endUser.types.ts +140 -0
  68. package/client/end-user/toEndUserAccount.ts +80 -0
  69. package/index.ts +1 -1
  70. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +74 -41
  71. package/openapi-client/generated/end-user-accounts/end-user-accounts.ts +75 -0
  72. package/openapi-client/generated/webhooks/webhooks.ts +8 -1
  73. package/package.json +1 -1
  74. package/version.ts +1 -1
@@ -1,5 +1,5 @@
1
- import { type ValidateAccessTokenOptions, type ListEndUsersOptions, type CreateEndUserOptions, type GetEndUserOptions, type ImportEndUserOptions } from "./endUser.types.js";
2
- import { type EndUser, type ListEndUsers200 } from "../../openapi-client/index.js";
1
+ import { type ValidateAccessTokenOptions, type ListEndUsersOptions, type CreateEndUserOptions, type GetEndUserOptions, type ImportEndUserOptions, type AddEndUserEvmAccountOptions, type AddEndUserEvmAccountResult, type AddEndUserEvmSmartAccountOptions, type AddEndUserEvmSmartAccountResult, type AddEndUserSolanaAccountOptions, type AddEndUserSolanaAccountResult, type EndUserAccount } from "./endUser.types.js";
2
+ import { type ListEndUsers200 } from "../../openapi-client/index.js";
3
3
  /**
4
4
  * The CDP end user client.
5
5
  */
@@ -32,7 +32,7 @@ export declare class CDPEndUserClient {
32
32
  * });
33
33
  * ```
34
34
  */
35
- createEndUser(options: CreateEndUserOptions): Promise<EndUser>;
35
+ createEndUser(options: CreateEndUserOptions): Promise<EndUserAccount>;
36
36
  /**
37
37
  * Lists end users belonging to the developer's CDP Project.
38
38
  * By default, the response is sorted by creation date in ascending order and paginated to 20 users per page.
@@ -82,7 +82,65 @@ export declare class CDPEndUserClient {
82
82
  * console.log(endUser.userId);
83
83
  * ```
84
84
  */
85
- getEndUser(options: GetEndUserOptions): Promise<EndUser>;
85
+ getEndUser(options: GetEndUserOptions): Promise<EndUserAccount>;
86
+ /**
87
+ * Adds an EVM EOA (Externally Owned Account) to an existing end user. End users can have up to 10 EVM accounts.
88
+ *
89
+ * @param options - The options for adding an EVM account.
90
+ *
91
+ * @returns A promise that resolves to the newly created EVM EOA account.
92
+ *
93
+ * @example **Add an EVM EOA account to an existing end user**
94
+ * ```ts
95
+ * const result = await cdp.endUser.addEndUserEvmAccount({
96
+ * userId: "user-123"
97
+ * });
98
+ * console.log(result.evmAccount.address);
99
+ * ```
100
+ */
101
+ addEndUserEvmAccount(options: AddEndUserEvmAccountOptions): Promise<AddEndUserEvmAccountResult>;
102
+ /**
103
+ * Adds an EVM smart account to an existing end user. This also creates a new EVM EOA account to serve as the owner of the smart account.
104
+ *
105
+ * @param options - The options for adding an EVM smart account.
106
+ *
107
+ * @returns A promise that resolves to the newly created EVM smart account.
108
+ *
109
+ * @example **Add an EVM smart account to an existing end user**
110
+ * ```ts
111
+ * const result = await cdp.endUser.addEndUserEvmSmartAccount({
112
+ * userId: "user-123",
113
+ * enableSpendPermissions: false
114
+ * });
115
+ * console.log(result.evmSmartAccount.address);
116
+ * ```
117
+ *
118
+ * @example **Add an EVM smart account with spend permissions enabled**
119
+ * ```ts
120
+ * const result = await cdp.endUser.addEndUserEvmSmartAccount({
121
+ * userId: "user-123",
122
+ * enableSpendPermissions: true
123
+ * });
124
+ * console.log(result.evmSmartAccount.address);
125
+ * ```
126
+ */
127
+ addEndUserEvmSmartAccount(options: AddEndUserEvmSmartAccountOptions): Promise<AddEndUserEvmSmartAccountResult>;
128
+ /**
129
+ * Adds a Solana account to an existing end user. End users can have up to 10 Solana accounts.
130
+ *
131
+ * @param options - The options for adding a Solana account.
132
+ *
133
+ * @returns A promise that resolves to the newly created Solana account.
134
+ *
135
+ * @example **Add a Solana account to an existing end user**
136
+ * ```ts
137
+ * const result = await cdp.endUser.addEndUserSolanaAccount({
138
+ * userId: "user-123"
139
+ * });
140
+ * console.log(result.solanaAccount.address);
141
+ * ```
142
+ */
143
+ addEndUserSolanaAccount(options: AddEndUserSolanaAccountOptions): Promise<AddEndUserSolanaAccountResult>;
86
144
  /**
87
145
  * Validates an end user's access token. Throws an error if the access token is invalid.
88
146
  *
@@ -90,7 +148,7 @@ export declare class CDPEndUserClient {
90
148
  *
91
149
  * @returns The end user object if the access token is valid.
92
150
  */
93
- validateAccessToken(options: ValidateAccessTokenOptions): Promise<EndUser>;
151
+ validateAccessToken(options: ValidateAccessTokenOptions): Promise<EndUserAccount>;
94
152
  /**
95
153
  * Imports an existing private key for an end user.
96
154
  *
@@ -120,6 +178,6 @@ export declare class CDPEndUserClient {
120
178
  * });
121
179
  * ```
122
180
  */
123
- importEndUser(options: ImportEndUserOptions): Promise<EndUser>;
181
+ importEndUser(options: ImportEndUserOptions): Promise<EndUserAccount>;
124
182
  }
125
183
  //# sourceMappingURL=endUser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"endUser.d.ts","sourceRoot":"","sources":["../../../client/end-user/endUser.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,eAAe,EACrB,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,qBAAa,gBAAgB;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAapE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC;IAa/E;;;;;;;;;;;;;;OAcG;IACG,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAU9D;;;;;;OAMG;IACG,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,OAAO,CAAC;IAYhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;CAyDrE"}
1
+ {"version":3,"file":"endUser.d.ts","sourceRoot":"","sources":["../../../client/end-user/endUser.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEvF;;GAEG;AACH,qBAAa,gBAAgB;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAe3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC;IAa/E;;;;;;;;;;;;;;OAcG;IACG,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC;IAYrE;;;;;;;;;;;;;;OAcG;IACG,oBAAoB,CACxB,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,0BAA0B,CAAC;IAUtC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,yBAAyB,CAC7B,OAAO,EAAE,gCAAgC,GACxC,OAAO,CAAC,+BAA+B,CAAC;IAY3C;;;;;;;;;;;;;;OAcG;IACG,uBAAuB,CAC3B,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,6BAA6B,CAAC;IAUzC;;;;;;OAMG;IACG,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,cAAc,CAAC;IAcvF;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;CA2D5E"}
@@ -1,4 +1,5 @@
1
- import type { CreateEndUserBody, ListEndUsersParams, ImportEndUserBodyKeyType, AuthenticationMethods } from "../../openapi-client/index.js";
1
+ import type { CreateEndUserBody, ListEndUsersParams, ImportEndUserBodyKeyType, AuthenticationMethods, AddEndUserEvmAccount201, AddEndUserEvmSmartAccount201, AddEndUserSolanaAccount201, EndUser as OpenAPIEndUser } from "../../openapi-client/index.js";
2
+ import type { Prettify } from "../../types/utils.js";
2
3
  /**
3
4
  * The options for validating an access token.
4
5
  */
@@ -25,6 +26,49 @@ export type ListEndUsersOptions = ListEndUsersParams;
25
26
  * The options for creating an end user.
26
27
  */
27
28
  export type CreateEndUserOptions = CreateEndUserBody;
29
+ /**
30
+ * The options for adding an EVM account to an end user.
31
+ */
32
+ export interface AddEndUserEvmAccountOptions {
33
+ /**
34
+ * The unique identifier of the end user.
35
+ */
36
+ userId: string;
37
+ }
38
+ /**
39
+ * The result of adding an EVM account to an end user.
40
+ */
41
+ export type AddEndUserEvmAccountResult = AddEndUserEvmAccount201;
42
+ /**
43
+ * The options for adding an EVM smart account to an end user.
44
+ */
45
+ export interface AddEndUserEvmSmartAccountOptions {
46
+ /**
47
+ * The unique identifier of the end user.
48
+ */
49
+ userId: string;
50
+ /**
51
+ * If true, enables spend permissions for the EVM smart account.
52
+ */
53
+ enableSpendPermissions: boolean;
54
+ }
55
+ /**
56
+ * The result of adding an EVM smart account to an end user.
57
+ */
58
+ export type AddEndUserEvmSmartAccountResult = AddEndUserEvmSmartAccount201;
59
+ /**
60
+ * The options for adding a Solana account to an end user.
61
+ */
62
+ export interface AddEndUserSolanaAccountOptions {
63
+ /**
64
+ * The unique identifier of the end user.
65
+ */
66
+ userId: string;
67
+ }
68
+ /**
69
+ * The result of adding a Solana account to an end user.
70
+ */
71
+ export type AddEndUserSolanaAccountResult = AddEndUserSolanaAccount201;
28
72
  /**
29
73
  * The options for importing an end user.
30
74
  */
@@ -49,5 +93,84 @@ export interface ImportEndUserOptions {
49
93
  * The type of key being imported ("evm" or "solana").
50
94
  */
51
95
  keyType: ImportEndUserBodyKeyType;
96
+ /**
97
+ * Optional RSA public key to encrypt the private key.
98
+ * Defaults to the known CDP public key.
99
+ */
100
+ encryptionPublicKey?: string;
101
+ }
102
+ /**
103
+ * The options for adding an EVM smart account to an EndUser object.
104
+ */
105
+ export interface AddEvmSmartAccountOptions {
106
+ /**
107
+ * If true, enables spend permissions for the EVM smart account.
108
+ */
109
+ enableSpendPermissions: boolean;
52
110
  }
111
+ /**
112
+ * Actions that can be performed on an EndUser object.
113
+ */
114
+ export type EndUserAccountActions = {
115
+ /**
116
+ * Adds an EVM EOA (Externally Owned Account) to this end user.
117
+ * End users can have up to 10 EVM accounts.
118
+ *
119
+ * @returns A promise that resolves to the newly created EVM EOA account.
120
+ *
121
+ * @example
122
+ * ```ts
123
+ * const endUser = await cdp.endUser.createEndUser({
124
+ * authenticationMethods: [{ type: "email", email: "user@example.com" }]
125
+ * });
126
+ *
127
+ * const result = await endUser.addEvmAccount();
128
+ * console.log(result.evmAccount.address);
129
+ * ```
130
+ */
131
+ addEvmAccount: () => Promise<AddEndUserEvmAccountResult>;
132
+ /**
133
+ * Adds an EVM smart account to this end user.
134
+ * This also creates a new EVM EOA account to serve as the owner of the smart account.
135
+ *
136
+ * @param options - The options for adding the EVM smart account.
137
+ *
138
+ * @returns A promise that resolves to the newly created EVM smart account.
139
+ *
140
+ * @example
141
+ * ```ts
142
+ * const endUser = await cdp.endUser.createEndUser({
143
+ * authenticationMethods: [{ type: "email", email: "user@example.com" }]
144
+ * });
145
+ *
146
+ * const result = await endUser.addEvmSmartAccount({ enableSpendPermissions: true });
147
+ * console.log(result.evmSmartAccount.address);
148
+ * ```
149
+ */
150
+ addEvmSmartAccount: (options: AddEvmSmartAccountOptions) => Promise<AddEndUserEvmSmartAccountResult>;
151
+ /**
152
+ * Adds a Solana account to this end user.
153
+ * End users can have up to 10 Solana accounts.
154
+ *
155
+ * @returns A promise that resolves to the newly created Solana account.
156
+ *
157
+ * @example
158
+ * ```ts
159
+ * const endUser = await cdp.endUser.createEndUser({
160
+ * authenticationMethods: [{ type: "email", email: "user@example.com" }]
161
+ * });
162
+ *
163
+ * const result = await endUser.addSolanaAccount();
164
+ * console.log(result.solanaAccount.address);
165
+ * ```
166
+ */
167
+ addSolanaAccount: () => Promise<AddEndUserSolanaAccountResult>;
168
+ };
169
+ /**
170
+ * An end user with actions that can be performed directly on the object.
171
+ *
172
+ * @see {@link OpenAPIEndUser}
173
+ * @see {@link EndUserAccountActions}
174
+ */
175
+ export type EndUserAccount = Prettify<OpenAPIEndUser & EndUserAccountActions>;
53
176
  //# sourceMappingURL=endUser.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"endUser.types.d.ts","sourceRoot":"","sources":["../../../client/end-user/endUser.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C;;;;;OAKG;IACH,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC;IAChC;;OAEG;IACH,OAAO,EAAE,wBAAwB,CAAC;CACnC"}
1
+ {"version":3,"file":"endUser.types.d.ts","sourceRoot":"","sources":["../../../client/end-user/endUser.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,EAC5B,0BAA0B,EAC1B,OAAO,IAAI,cAAc,EAC1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,uBAAuB,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,4BAA4B,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,0BAA0B,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C;;;;;OAKG;IACH,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC;IAChC;;OAEG;IACH,OAAO,EAAE,wBAAwB,CAAC;IAClC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;;;;;;;;;;;;;OAeG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEzD;;;;;;;;;;;;;;;;;OAiBG;IACH,kBAAkB,EAAE,CAClB,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,+BAA+B,CAAC,CAAC;IAE9C;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,EAAE,MAAM,OAAO,CAAC,6BAA6B,CAAC,CAAC;CAChE,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,GAAG,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { EndUserAccount } from "./endUser.types.js";
2
+ import type { CdpOpenApiClientType, EndUser as OpenAPIEndUser } from "../../openapi-client/index.js";
3
+ /**
4
+ * Options for converting an OpenAPI EndUser to an EndUserAccount with actions.
5
+ */
6
+ export type ToEndUserAccountOptions = {
7
+ /** The end user from the API response. */
8
+ endUser: OpenAPIEndUser;
9
+ };
10
+ /**
11
+ * Creates an EndUserAccount instance with actions from an existing OpenAPI EndUser.
12
+ * This wraps the raw API response and adds convenience methods for adding accounts.
13
+ *
14
+ * @param apiClient - The API client.
15
+ * @param options - Configuration options.
16
+ * @param options.endUser - The end user from the API response.
17
+ * @returns An EndUserAccount instance with action methods.
18
+ */
19
+ export declare function toEndUserAccount(apiClient: CdpOpenApiClientType, options: ToEndUserAccountOptions): EndUserAccount;
20
+ //# sourceMappingURL=toEndUserAccount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toEndUserAccount.d.ts","sourceRoot":"","sources":["../../../client/end-user/toEndUserAccount.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EAKf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,oBAAoB,EACpB,OAAO,IAAI,cAAc,EAC1B,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,0CAA0C;IAC1C,OAAO,EAAE,cAAc,CAAC;CACzB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,uBAAuB,GAC/B,cAAc,CA6ChB"}
package/_types/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export { CreatePolicyBodySchema, UpdatePolicyBodySchema, type CreatePolicyBody,
5
5
  export { NetworkError } from "./openapi-client/errors.js";
6
6
  export type { SpendPermission, SpendPermissionInput } from "./spend-permissions/types.js";
7
7
  export type { SpendPermissionNetwork, ListEndUsers200, EndUser } from "./openapi-client/index.js";
8
- export type { ListEndUsersOptions } from "./client/end-user/endUser.types.js";
8
+ export type { ListEndUsersOptions, EndUserAccount } from "./client/end-user/endUser.types.js";
9
9
  export { SPEND_PERMISSION_MANAGER_ABI as spendPermissionManagerAbi, SPEND_PERMISSION_MANAGER_ADDRESS as spendPermissionManagerAddress, } from "./spend-permissions/constants.js";
10
10
  export { parseEther, parseUnits } from "viem";
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACjF,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,YAAY,EAAE,sBAAsB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAClG,YAAY,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EACL,4BAA4B,IAAI,yBAAyB,EACzD,gCAAgC,IAAI,6BAA6B,GAClE,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACjF,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,YAAY,EAAE,sBAAsB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAClG,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC9F,OAAO,EACL,4BAA4B,IAAI,yBAAyB,EACzD,gCAAgC,IAAI,6BAA6B,GAClE,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC"}
@@ -235,8 +235,6 @@ export declare const ErrorType: {
235
235
  readonly mfa_flow_expired: "mfa_flow_expired";
236
236
  readonly mfa_required: "mfa_required";
237
237
  readonly mfa_not_enrolled: "mfa_not_enrolled";
238
- readonly mfa_multiple_methods_available: "mfa_multiple_methods_available";
239
- readonly mfa_invalid_method: "mfa_invalid_method";
240
238
  };
241
239
  /**
242
240
  * A valid HTTP or HTTPS URL.
@@ -2086,6 +2084,18 @@ export interface AccountTokenAddressesResponse {
2086
2084
  */
2087
2085
  totalCount?: number;
2088
2086
  }
2087
+ /**
2088
+ * A human-readable description.
2089
+ * @minLength 0
2090
+ * @maxLength 500
2091
+ */
2092
+ export type Description = string;
2093
+ /**
2094
+ * Optional metadata as key-value pairs. Use this to store additional structured information on a resource, such as customer IDs, order references, or any application-specific data. Up to 50 key/value pairs may be provided. Keys and values are both strings. Keys must be ≤ 40 characters; values must be ≤ 500 characters.
2095
+ */
2096
+ export interface Metadata {
2097
+ [key: string]: string;
2098
+ }
2089
2099
  /**
2090
2100
  * Additional headers to include in webhook requests.
2091
2101
  */
@@ -2103,16 +2113,17 @@ export interface WebhookTarget {
2103
2113
  /** Additional headers to include in webhook requests. */
2104
2114
  headers?: WebhookTargetHeaders;
2105
2115
  }
2106
- /**
2107
- * Additional metadata for the subscription.
2108
- */
2109
- export type WebhookSubscriptionResponseMetadata = {
2116
+ export type WebhookSubscriptionResponseMetadataAllOf = {
2110
2117
  /**
2111
2118
  * Use the root-level `secret` field instead. Maintained for backward compatibility only.
2112
2119
  * @deprecated
2113
2120
  */
2114
2121
  secret?: string;
2115
2122
  };
2123
+ /**
2124
+ * Additional metadata for the subscription.
2125
+ */
2126
+ export type WebhookSubscriptionResponseMetadata = Metadata & WebhookSubscriptionResponseMetadataAllOf;
2116
2127
  /**
2117
2128
  * Multi-label filters using total overlap logic. Total overlap means the subscription only triggers when events contain ALL these key-value pairs.
2118
2129
  Present when subscription uses multi-label format.
@@ -2128,7 +2139,7 @@ export interface WebhookSubscriptionResponse {
2128
2139
  /** When the subscription was created. */
2129
2140
  createdAt: string;
2130
2141
  /** Description of the webhook subscription. */
2131
- description?: string;
2142
+ description?: Description;
2132
2143
  /** Types of events to subscribe to. Event types follow a three-part dot-separated format:
2133
2144
  service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
2134
2145
  */
@@ -2173,12 +2184,6 @@ export type WebhookSubscriptionListResponseAllOf = {
2173
2184
  subscriptions: WebhookSubscriptionResponse[];
2174
2185
  };
2175
2186
  export type WebhookSubscriptionListResponse = WebhookSubscriptionListResponseAllOf & ListResponse;
2176
- /**
2177
- * Additional metadata for the subscription.
2178
- */
2179
- export type WebhookSubscriptionRequestMetadata = {
2180
- [key: string]: unknown;
2181
- };
2182
2187
  /**
2183
2188
  * Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
2184
2189
  an event contains ALL the key-value pairs specified here. Additional labels on
@@ -2199,7 +2204,7 @@ and multi-label filtering formats.
2199
2204
  */
2200
2205
  export type WebhookSubscriptionRequest = (unknown & {
2201
2206
  /** Description of the webhook subscription. */
2202
- description?: string;
2207
+ description?: Description;
2203
2208
  /** Types of events to subscribe to. Event types follow a three-part dot-separated format:
2204
2209
  service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
2205
2210
  The subscription will only receive events matching these types AND the label filter(s).
@@ -2208,8 +2213,7 @@ The subscription will only receive events matching these types AND the label fil
2208
2213
  /** Whether the subscription is enabled. */
2209
2214
  isEnabled?: boolean;
2210
2215
  target?: WebhookTarget;
2211
- /** Additional metadata for the subscription. */
2212
- metadata?: WebhookSubscriptionRequestMetadata;
2216
+ metadata?: Metadata;
2213
2217
  /**
2214
2218
  * (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
2215
2219
 
@@ -2245,7 +2249,7 @@ See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-refe
2245
2249
  labels?: WebhookSubscriptionRequestLabels;
2246
2250
  }) | (unknown & {
2247
2251
  /** Description of the webhook subscription. */
2248
- description?: string;
2252
+ description?: Description;
2249
2253
  /** Types of events to subscribe to. Event types follow a three-part dot-separated format:
2250
2254
  service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
2251
2255
  The subscription will only receive events matching these types AND the label filter(s).
@@ -2254,8 +2258,7 @@ The subscription will only receive events matching these types AND the label fil
2254
2258
  /** Whether the subscription is enabled. */
2255
2259
  isEnabled?: boolean;
2256
2260
  target?: WebhookTarget;
2257
- /** Additional metadata for the subscription. */
2258
- metadata?: WebhookSubscriptionRequestMetadata;
2261
+ metadata?: Metadata;
2259
2262
  /**
2260
2263
  * (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
2261
2264
 
@@ -2290,12 +2293,6 @@ See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-refe
2290
2293
  */
2291
2294
  labels?: WebhookSubscriptionRequestLabels;
2292
2295
  });
2293
- /**
2294
- * Additional metadata for the subscription.
2295
- */
2296
- export type WebhookSubscriptionUpdateRequestMetadata = {
2297
- [key: string]: unknown;
2298
- };
2299
2296
  /**
2300
2297
  * Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
2301
2298
 
@@ -2314,7 +2311,7 @@ the original subscription format (traditional or multi-label).
2314
2311
  */
2315
2312
  export type WebhookSubscriptionUpdateRequest = (unknown & {
2316
2313
  /** Description of the webhook subscription. */
2317
- description?: string;
2314
+ description?: Description;
2318
2315
  /** Types of events to subscribe to. Event types follow a three-part dot-separated format:
2319
2316
  service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
2320
2317
  */
@@ -2322,8 +2319,7 @@ service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detec
2322
2319
  /** Whether the subscription is enabled. */
2323
2320
  isEnabled?: boolean;
2324
2321
  target?: WebhookTarget;
2325
- /** Additional metadata for the subscription. */
2326
- metadata?: WebhookSubscriptionUpdateRequestMetadata;
2322
+ metadata?: Metadata;
2327
2323
  /** Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
2328
2324
 
2329
2325
  **Note:** Currently, labels are supported for onchain webhooks only.
@@ -2351,7 +2347,7 @@ Maintained for backward compatibility only.
2351
2347
  labelValue?: string;
2352
2348
  }) | (unknown & {
2353
2349
  /** Description of the webhook subscription. */
2354
- description?: string;
2350
+ description?: Description;
2355
2351
  /** Types of events to subscribe to. Event types follow a three-part dot-separated format:
2356
2352
  service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
2357
2353
  */
@@ -2359,8 +2355,7 @@ service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detec
2359
2355
  /** Whether the subscription is enabled. */
2360
2356
  isEnabled?: boolean;
2361
2357
  target?: WebhookTarget;
2362
- /** Additional metadata for the subscription. */
2363
- metadata?: WebhookSubscriptionUpdateRequestMetadata;
2358
+ metadata?: Metadata;
2364
2359
  /** Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
2365
2360
 
2366
2361
  **Note:** Currently, labels are supported for onchain webhooks only.
@@ -2519,8 +2514,8 @@ export interface X402V2PaymentRequirements {
2519
2514
  export interface X402ResourceInfo {
2520
2515
  /** The URL of the resource. */
2521
2516
  url?: string;
2522
- /** The description of the resource. */
2523
- description?: string;
2517
+ /** A human-readable description of the resource. */
2518
+ description?: Description;
2524
2519
  /** The MIME type of the resource response. */
2525
2520
  mimeType?: string;
2526
2521
  }
@@ -2591,8 +2586,8 @@ export interface X402V1PaymentRequirements {
2591
2586
  maxAmountRequired: string;
2592
2587
  /** The URL of the resource to pay for. */
2593
2588
  resource: string;
2594
- /** The description of the resource. */
2595
- description: string;
2589
+ /** A human-readable description of the resource. */
2590
+ description: Description;
2596
2591
  /** The MIME type of the resource response. */
2597
2592
  mimeType: string;
2598
2593
  /** The optional JSON schema describing the resource output. */
@@ -2770,6 +2765,10 @@ export declare const X402SupportedPaymentKindNetwork: {
2770
2765
  readonly base: "base";
2771
2766
  readonly "solana-devnet": "solana-devnet";
2772
2767
  readonly solana: "solana";
2768
+ readonly "eip155:8453": "eip155:8453";
2769
+ readonly "eip155:84532": "eip155:84532";
2770
+ readonly "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
2771
+ readonly "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1";
2773
2772
  };
2774
2773
  /**
2775
2774
  * The optional additional scheme-specific payment info.
@@ -2789,6 +2788,12 @@ export interface X402SupportedPaymentKind {
2789
2788
  /** The optional additional scheme-specific payment info. */
2790
2789
  extra?: X402SupportedPaymentKindExtra;
2791
2790
  }
2791
+ /**
2792
+ * A blockchain address. Format varies by network (e.g., 0x-prefixed for EVM, base58 for Solana).
2793
+ * @minLength 1
2794
+ * @maxLength 128
2795
+ */
2796
+ export type BlockchainAddress = string;
2792
2797
  /**
2793
2798
  * The type of payment method to be used to complete an onramp order.
2794
2799
  */
@@ -2848,7 +2853,7 @@ export interface OnrampOrder {
2848
2853
  /** The exchange rate used to convert fiat to crypto i.e. the crypto value of one fiat. */
2849
2854
  exchangeRate: string;
2850
2855
  /** The destination address to send the crypto to. */
2851
- destinationAddress: string;
2856
+ destinationAddress: BlockchainAddress;
2852
2857
  /** The network to send the crypto on. */
2853
2858
  destinationNetwork: string;
2854
2859
  status: OnrampOrderStatus;
@@ -3107,6 +3112,25 @@ export type ValidateEndUserAccessTokenBody = {
3107
3112
  /** The access token in JWT format to verify. */
3108
3113
  accessToken: string;
3109
3114
  };
3115
+ export type AddEndUserEvmAccountBody = {
3116
+ [key: string]: unknown;
3117
+ };
3118
+ export type AddEndUserEvmAccount201 = {
3119
+ evmAccount: EndUserEvmAccount;
3120
+ };
3121
+ export type AddEndUserEvmSmartAccountBody = {
3122
+ /** If true, enables spend permissions for the EVM smart account. */
3123
+ enableSpendPermissions?: boolean;
3124
+ };
3125
+ export type AddEndUserEvmSmartAccount201 = {
3126
+ evmSmartAccount: EndUserEvmSmartAccount;
3127
+ };
3128
+ export type AddEndUserSolanaAccountBody = {
3129
+ [key: string]: unknown;
3130
+ };
3131
+ export type AddEndUserSolanaAccount201 = {
3132
+ solanaAccount: EndUserSolanaAccount;
3133
+ };
3110
3134
  /**
3111
3135
  * The type of key being imported. Determines what type of account will be associated for the end user.
3112
3136
  */
@@ -3658,7 +3682,7 @@ export type CreateOnrampOrderBody = {
3658
3682
  /** The timestamp of when the user acknowledged that by using Coinbase Onramp they are accepting the Coinbase Terms (https://www.coinbase.com/legal/guest-checkout/us), User Agreement (https://www.coinbase.com/legal/user_agreement), and Privacy Policy (https://www.coinbase.com/legal/privacy). */
3659
3683
  agreementAcceptedAt: string;
3660
3684
  /** The address the purchased crypto will be sent to. */
3661
- destinationAddress: string;
3685
+ destinationAddress: BlockchainAddress;
3662
3686
  /** The name of the crypto network the purchased currency will be sent on.
3663
3687
 
3664
3688
  Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location. */
@@ -3712,7 +3736,7 @@ export type CreateOnrampSessionBody = {
3712
3736
  Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location. */
3713
3737
  destinationNetwork: string;
3714
3738
  /** The address the purchased crypto will be sent to. */
3715
- destinationAddress: string;
3739
+ destinationAddress: BlockchainAddress;
3716
3740
  /** A string representing the amount of fiat the user wishes to pay in exchange for crypto. When using this parameter, the returned quote will be inclusive of fees i.e. the user will pay this exact amount of the payment currency. */
3717
3741
  paymentAmount?: string;
3718
3742
  /** A string representing the amount of crypto the user wishes to purchase. When using this parameter, the returned quote will be exclusive of fees i.e. the user will receive this exact amount of the purchase currency. */