@coinbase/cdp-sdk 1.15.0 → 1.17.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 +20 -0
- package/README.md +82 -20
- package/_cjs/accounts/evm/toEvmServerAccount.js +20 -7
- package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_cjs/accounts/evm/toEvmSmartAccount.js +26 -0
- package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js +28 -0
- package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -0
- package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js +26 -0
- package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -0
- package/_cjs/actions/evm/signAndWrapTypedDataForSmartAccount.js +186 -0
- package/_cjs/actions/evm/signAndWrapTypedDataForSmartAccount.js.map +1 -0
- package/_cjs/actions/evm/swap/createSwapQuote.js +26 -8
- package/_cjs/actions/evm/swap/createSwapQuote.js.map +1 -1
- package/_cjs/actions/evm/swap/getSwapPrice.js +3 -2
- package/_cjs/actions/evm/swap/getSwapPrice.js.map +1 -1
- package/_cjs/actions/evm/swap/sendSwapOperation.js +153 -0
- package/_cjs/actions/evm/swap/sendSwapOperation.js.map +1 -0
- package/_cjs/actions/evm/swap/sendSwapTransaction.js +16 -2
- package/_cjs/actions/evm/swap/sendSwapTransaction.js.map +1 -1
- package/_cjs/client/evm/evm.js +13 -6
- package/_cjs/client/evm/evm.js.map +1 -1
- package/_cjs/client/policies/policies.js +6 -2
- package/_cjs/client/policies/policies.js.map +1 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +45 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.msw.js +48 -0
- package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +35 -0
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/index.msw.js +5 -5
- package/_cjs/openapi-client/generated/index.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js +342 -1
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.msw.js +40 -0
- package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -1
- package/_cjs/policies/schema.js +83 -2
- package/_cjs/policies/schema.js.map +1 -1
- package/_cjs/utils/uuidV4.js +26 -0
- package/_cjs/utils/uuidV4.js.map +1 -0
- package/_cjs/version.js +1 -1
- package/_esm/accounts/evm/toEvmServerAccount.js +21 -8
- package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_esm/accounts/evm/toEvmSmartAccount.js +26 -0
- package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js +25 -0
- package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -0
- package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js +23 -0
- package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -0
- package/_esm/actions/evm/signAndWrapTypedDataForSmartAccount.js +181 -0
- package/_esm/actions/evm/signAndWrapTypedDataForSmartAccount.js.map +1 -0
- package/_esm/actions/evm/swap/createSwapQuote.js +26 -8
- package/_esm/actions/evm/swap/createSwapQuote.js.map +1 -1
- package/_esm/actions/evm/swap/getSwapPrice.js +3 -2
- package/_esm/actions/evm/swap/getSwapPrice.js.map +1 -1
- package/_esm/actions/evm/swap/sendSwapOperation.js +150 -0
- package/_esm/actions/evm/swap/sendSwapOperation.js.map +1 -0
- package/_esm/actions/evm/swap/sendSwapTransaction.js +16 -2
- package/_esm/actions/evm/swap/sendSwapTransaction.js.map +1 -1
- package/_esm/client/evm/evm.js +14 -7
- package/_esm/client/evm/evm.js.map +1 -1
- package/_esm/client/policies/policies.js +7 -3
- package/_esm/client/policies/policies.js.map +1 -1
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +44 -0
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/openapi-client/generated/evm-accounts/evm-accounts.msw.js +48 -0
- package/_esm/openapi-client/generated/evm-accounts/evm-accounts.msw.js.map +1 -1
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +35 -0
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -1
- package/_esm/openapi-client/generated/index.msw.js +5 -5
- package/_esm/openapi-client/generated/index.msw.js.map +1 -1
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js +321 -0
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
- package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js +40 -0
- package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -1
- package/_esm/policies/schema.js +83 -2
- package/_esm/policies/schema.js.map +1 -1
- package/_esm/utils/uuidV4.js +23 -0
- package/_esm/utils/uuidV4.js.map +1 -0
- package/_esm/version.js +1 -1
- package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
- package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
- package/_types/accounts/evm/toNetworkScopedEvmServerAccount.d.ts +23 -0
- package/_types/accounts/evm/toNetworkScopedEvmServerAccount.d.ts.map +1 -0
- package/_types/accounts/evm/toNetworkScopedEvmSmartAccount.d.ts +27 -0
- package/_types/accounts/evm/toNetworkScopedEvmSmartAccount.d.ts.map +1 -0
- package/_types/accounts/evm/types.d.ts +26 -9
- package/_types/accounts/evm/types.d.ts.map +1 -1
- package/_types/actions/evm/signAndWrapTypedDataForSmartAccount.d.ts +133 -0
- package/_types/actions/evm/signAndWrapTypedDataForSmartAccount.d.ts.map +1 -0
- package/_types/actions/evm/swap/createSwapQuote.d.ts.map +1 -1
- package/_types/actions/evm/swap/getSwapPrice.d.ts +2 -1
- package/_types/actions/evm/swap/getSwapPrice.d.ts.map +1 -1
- package/_types/actions/evm/swap/sendSwapOperation.d.ts +64 -0
- package/_types/actions/evm/swap/sendSwapOperation.d.ts.map +1 -0
- package/_types/actions/evm/swap/sendSwapTransaction.d.ts.map +1 -1
- package/_types/actions/evm/swap/types.d.ts +131 -5
- package/_types/actions/evm/swap/types.d.ts.map +1 -1
- package/_types/actions/evm/types.d.ts +112 -21
- package/_types/actions/evm/types.d.ts.map +1 -1
- package/_types/client/evm/evm.d.ts.map +1 -1
- package/_types/client/evm/evm.types.d.ts +33 -7
- package/_types/client/evm/evm.types.d.ts.map +1 -1
- package/_types/client/policies/policies.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +182 -2
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
- package/_types/openapi-client/generated/evm-accounts/evm-accounts.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/index.msw.d.ts +5 -5
- package/_types/openapi-client/generated/index.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts +21 -1
- package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/solana-accounts/solana-accounts.msw.d.ts.map +1 -1
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/policies/schema.d.ts +3780 -7
- package/_types/policies/schema.d.ts.map +1 -1
- package/_types/utils/uuidV4.d.ts +10 -0
- package/_types/utils/uuidV4.d.ts.map +1 -0
- package/_types/version.d.ts +1 -1
- package/accounts/evm/toEvmServerAccount.ts +40 -15
- package/accounts/evm/toEvmSmartAccount.ts +33 -0
- package/accounts/evm/toNetworkScopedEvmServerAccount.ts +42 -0
- package/accounts/evm/toNetworkScopedEvmSmartAccount.ts +41 -0
- package/accounts/evm/types.ts +46 -17
- package/actions/evm/signAndWrapTypedDataForSmartAccount.ts +246 -0
- package/actions/evm/swap/createSwapQuote.ts +42 -17
- package/actions/evm/swap/getSwapPrice.ts +15 -11
- package/actions/evm/swap/sendSwapOperation.ts +182 -0
- package/actions/evm/swap/sendSwapTransaction.ts +18 -2
- package/actions/evm/swap/types.ts +154 -5
- package/actions/evm/types.ts +123 -21
- package/client/evm/evm.ts +19 -8
- package/client/evm/evm.types.ts +34 -7
- package/client/policies/policies.ts +12 -3
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +221 -2
- package/openapi-client/generated/evm-accounts/evm-accounts.msw.ts +48 -0
- package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.ts +35 -0
- package/openapi-client/generated/faucets/faucets.ts +4 -4
- package/openapi-client/generated/index.msw.ts +5 -5
- package/openapi-client/generated/policy-engine/policy-engine.msw.ts +434 -0
- package/openapi-client/generated/solana-accounts/solana-accounts.msw.ts +40 -0
- package/package.json +1 -1
- package/policies/schema.ts +94 -6
- package/utils/uuidV4.ts +23 -0
- package/version.ts +1 -1
|
@@ -38,6 +38,14 @@ export const getListEvmAccountsResponseMock = (): ListEvmAccounts200 => ({
|
|
|
38
38
|
),
|
|
39
39
|
undefined,
|
|
40
40
|
]),
|
|
41
|
+
createdAt: faker.helpers.arrayElement([
|
|
42
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
43
|
+
undefined,
|
|
44
|
+
]),
|
|
45
|
+
updatedAt: faker.helpers.arrayElement([
|
|
46
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
47
|
+
undefined,
|
|
48
|
+
]),
|
|
41
49
|
}),
|
|
42
50
|
),
|
|
43
51
|
},
|
|
@@ -60,6 +68,14 @@ export const getCreateEvmAccountResponseMock = (
|
|
|
60
68
|
),
|
|
61
69
|
undefined,
|
|
62
70
|
]),
|
|
71
|
+
createdAt: faker.helpers.arrayElement([
|
|
72
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
73
|
+
undefined,
|
|
74
|
+
]),
|
|
75
|
+
updatedAt: faker.helpers.arrayElement([
|
|
76
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
77
|
+
undefined,
|
|
78
|
+
]),
|
|
63
79
|
...overrideResponse,
|
|
64
80
|
});
|
|
65
81
|
|
|
@@ -79,6 +95,14 @@ export const getGetEvmAccountResponseMock = (
|
|
|
79
95
|
),
|
|
80
96
|
undefined,
|
|
81
97
|
]),
|
|
98
|
+
createdAt: faker.helpers.arrayElement([
|
|
99
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
100
|
+
undefined,
|
|
101
|
+
]),
|
|
102
|
+
updatedAt: faker.helpers.arrayElement([
|
|
103
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
104
|
+
undefined,
|
|
105
|
+
]),
|
|
82
106
|
...overrideResponse,
|
|
83
107
|
});
|
|
84
108
|
|
|
@@ -98,6 +122,14 @@ export const getUpdateEvmAccountResponseMock = (
|
|
|
98
122
|
),
|
|
99
123
|
undefined,
|
|
100
124
|
]),
|
|
125
|
+
createdAt: faker.helpers.arrayElement([
|
|
126
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
127
|
+
undefined,
|
|
128
|
+
]),
|
|
129
|
+
updatedAt: faker.helpers.arrayElement([
|
|
130
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
131
|
+
undefined,
|
|
132
|
+
]),
|
|
101
133
|
...overrideResponse,
|
|
102
134
|
});
|
|
103
135
|
|
|
@@ -117,6 +149,14 @@ export const getGetEvmAccountByNameResponseMock = (
|
|
|
117
149
|
),
|
|
118
150
|
undefined,
|
|
119
151
|
]),
|
|
152
|
+
createdAt: faker.helpers.arrayElement([
|
|
153
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
154
|
+
undefined,
|
|
155
|
+
]),
|
|
156
|
+
updatedAt: faker.helpers.arrayElement([
|
|
157
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
158
|
+
undefined,
|
|
159
|
+
]),
|
|
120
160
|
...overrideResponse,
|
|
121
161
|
});
|
|
122
162
|
|
|
@@ -156,6 +196,14 @@ export const getImportEvmAccountResponseMock = (
|
|
|
156
196
|
),
|
|
157
197
|
undefined,
|
|
158
198
|
]),
|
|
199
|
+
createdAt: faker.helpers.arrayElement([
|
|
200
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
201
|
+
undefined,
|
|
202
|
+
]),
|
|
203
|
+
updatedAt: faker.helpers.arrayElement([
|
|
204
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
205
|
+
undefined,
|
|
206
|
+
]),
|
|
159
207
|
...overrideResponse,
|
|
160
208
|
});
|
|
161
209
|
|
|
@@ -27,6 +27,14 @@ export const getListEvmSmartAccountsResponseMock = (): ListEvmSmartAccounts200 =
|
|
|
27
27
|
faker.helpers.fromRegExp("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$"),
|
|
28
28
|
undefined,
|
|
29
29
|
]),
|
|
30
|
+
createdAt: faker.helpers.arrayElement([
|
|
31
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
32
|
+
undefined,
|
|
33
|
+
]),
|
|
34
|
+
updatedAt: faker.helpers.arrayElement([
|
|
35
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
36
|
+
undefined,
|
|
37
|
+
]),
|
|
30
38
|
}),
|
|
31
39
|
),
|
|
32
40
|
},
|
|
@@ -44,6 +52,14 @@ export const getCreateEvmSmartAccountResponseMock = (
|
|
|
44
52
|
faker.helpers.fromRegExp("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$"),
|
|
45
53
|
undefined,
|
|
46
54
|
]),
|
|
55
|
+
createdAt: faker.helpers.arrayElement([
|
|
56
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
57
|
+
undefined,
|
|
58
|
+
]),
|
|
59
|
+
updatedAt: faker.helpers.arrayElement([
|
|
60
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
61
|
+
undefined,
|
|
62
|
+
]),
|
|
47
63
|
...overrideResponse,
|
|
48
64
|
});
|
|
49
65
|
|
|
@@ -58,6 +74,14 @@ export const getGetEvmSmartAccountByNameResponseMock = (
|
|
|
58
74
|
faker.helpers.fromRegExp("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$"),
|
|
59
75
|
undefined,
|
|
60
76
|
]),
|
|
77
|
+
createdAt: faker.helpers.arrayElement([
|
|
78
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
79
|
+
undefined,
|
|
80
|
+
]),
|
|
81
|
+
updatedAt: faker.helpers.arrayElement([
|
|
82
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
83
|
+
undefined,
|
|
84
|
+
]),
|
|
61
85
|
...overrideResponse,
|
|
62
86
|
});
|
|
63
87
|
|
|
@@ -72,6 +96,14 @@ export const getGetEvmSmartAccountResponseMock = (
|
|
|
72
96
|
faker.helpers.fromRegExp("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$"),
|
|
73
97
|
undefined,
|
|
74
98
|
]),
|
|
99
|
+
createdAt: faker.helpers.arrayElement([
|
|
100
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
101
|
+
undefined,
|
|
102
|
+
]),
|
|
103
|
+
updatedAt: faker.helpers.arrayElement([
|
|
104
|
+
`${faker.date.past().toISOString().split(".")[0]}Z`,
|
|
105
|
+
undefined,
|
|
106
|
+
]),
|
|
75
107
|
...overrideResponse,
|
|
76
108
|
});
|
|
77
109
|
|
|
@@ -90,6 +122,7 @@ export const getPrepareUserOperationResponseMock = (
|
|
|
90
122
|
"signed",
|
|
91
123
|
"broadcast",
|
|
92
124
|
"complete",
|
|
125
|
+
"dropped",
|
|
93
126
|
"failed",
|
|
94
127
|
] as const),
|
|
95
128
|
transactionHash: faker.helpers.arrayElement([
|
|
@@ -114,6 +147,7 @@ export const getGetUserOperationResponseMock = (
|
|
|
114
147
|
"signed",
|
|
115
148
|
"broadcast",
|
|
116
149
|
"complete",
|
|
150
|
+
"dropped",
|
|
117
151
|
"failed",
|
|
118
152
|
] as const),
|
|
119
153
|
transactionHash: faker.helpers.arrayElement([
|
|
@@ -138,6 +172,7 @@ export const getSendUserOperationResponseMock = (
|
|
|
138
172
|
"signed",
|
|
139
173
|
"broadcast",
|
|
140
174
|
"complete",
|
|
175
|
+
"dropped",
|
|
141
176
|
"failed",
|
|
142
177
|
] as const),
|
|
143
178
|
transactionHash: faker.helpers.arrayElement([
|
|
@@ -21,8 +21,8 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
|
21
21
|
|
|
22
22
|
Faucets are available for ETH, USDC, EURC, and cbBTC on Base Sepolia and Ethereum Sepolia, and for ETH only on Ethereum Hoodi.
|
|
23
23
|
|
|
24
|
-
To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested.
|
|
25
|
-
These limits are applied at both the CDP User level and the blockchain address level.
|
|
24
|
+
To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested.
|
|
25
|
+
These limits are applied at both the CDP User level and the blockchain address level.
|
|
26
26
|
A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address.
|
|
27
27
|
|
|
28
28
|
| Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits|
|
|
@@ -53,8 +53,8 @@ export const requestEvmFaucet = (
|
|
|
53
53
|
|
|
54
54
|
Faucets are available for SOL.
|
|
55
55
|
|
|
56
|
-
To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested.
|
|
57
|
-
These limits are applied at both the CDP User level and the blockchain address level.
|
|
56
|
+
To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested.
|
|
57
|
+
These limits are applied at both the CDP User level and the blockchain address level.
|
|
58
58
|
A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address.
|
|
59
59
|
|
|
60
60
|
| Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from "./evm-accounts/evm-accounts.msw.js";
|
|
2
|
-
export * from "./evm-swaps/evm-swaps.msw.js";
|
|
3
|
-
export * from "./solana-accounts/solana-accounts.msw.js";
|
|
4
|
-
export * from "./policy-engine/policy-engine.msw.js";
|
|
5
1
|
export * from "./evm-token-balances/evm-token-balances.msw.js";
|
|
2
|
+
export * from "./evm-accounts/evm-accounts.msw.js";
|
|
3
|
+
export * from "./evm-smart-accounts/evm-smart-accounts.msw.js";
|
|
6
4
|
export * from "./faucets/faucets.msw.js";
|
|
5
|
+
export * from "./evm-swaps/evm-swaps.msw.js";
|
|
7
6
|
export * from "./payments-alpha/payments-alpha.msw.js";
|
|
8
|
-
export * from "./
|
|
7
|
+
export * from "./policy-engine/policy-engine.msw.js";
|
|
8
|
+
export * from "./solana-accounts/solana-accounts.msw.js";
|