@coinbase/cdp-sdk 1.5.0 → 1.7.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 +25 -0
- package/README.md +101 -3
- package/_cjs/accounts/evm/toEvmServerAccount.js +21 -0
- package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_cjs/accounts/evm/toEvmSmartAccount.js +35 -0
- package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_cjs/accounts/{types.js.map → evm/types.js.map} +1 -1
- package/_cjs/accounts/solana/toSolanaAccount.js +41 -0
- package/_cjs/accounts/solana/toSolanaAccount.js.map +1 -0
- package/_cjs/accounts/solana/types.js +3 -0
- package/_cjs/accounts/solana/types.js.map +1 -0
- package/_cjs/actions/evm/getUserOperation.js +36 -0
- package/_cjs/actions/evm/getUserOperation.js.map +1 -0
- package/_cjs/actions/evm/listTokenBalances.js +33 -0
- package/_cjs/actions/evm/listTokenBalances.js.map +1 -0
- package/_cjs/actions/evm/requestFaucet.js +18 -0
- package/_cjs/actions/evm/requestFaucet.js.map +1 -0
- package/_cjs/actions/evm/sendTransaction.js +29 -0
- package/_cjs/actions/evm/sendTransaction.js.map +1 -0
- package/_cjs/actions/evm/sendUserOperation.js +5 -6
- package/_cjs/actions/evm/sendUserOperation.js.map +1 -1
- package/_cjs/actions/evm/transfer/accountTransferStrategy.js +11 -7
- package/_cjs/actions/evm/transfer/accountTransferStrategy.js.map +1 -1
- package/_cjs/actions/evm/transfer/smartAccountTransferStrategy.js +13 -8
- package/_cjs/actions/evm/transfer/smartAccountTransferStrategy.js.map +1 -1
- package/_cjs/actions/evm/transfer/transfer.js +7 -3
- package/_cjs/actions/evm/transfer/transfer.js.map +1 -1
- package/_cjs/actions/solana/requestFaucet.js +29 -0
- package/_cjs/actions/solana/requestFaucet.js.map +1 -0
- package/_cjs/actions/solana/signMessage.js +29 -0
- package/_cjs/actions/solana/signMessage.js.map +1 -0
- package/_cjs/actions/solana/signTransaction.js +46 -0
- package/_cjs/actions/solana/signTransaction.js.map +1 -0
- package/_cjs/actions/solana/types.js +3 -0
- package/_cjs/actions/solana/types.js.map +1 -0
- package/_cjs/client/evm/evm.js +10 -52
- package/_cjs/client/evm/evm.js.map +1 -1
- package/_cjs/client/solana/solana.js +22 -17
- package/_cjs/client/solana/solana.js.map +1 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +59 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/openapi-client/generated/index.msw.js +3 -2
- package/_cjs/openapi-client/generated/index.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.js +56 -0
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.js.map +1 -0
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js +284 -0
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -0
- package/_cjs/openapi-client/index.js +1 -0
- package/_cjs/openapi-client/index.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/accounts/evm/toEvmServerAccount.js +21 -0
- package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_esm/accounts/evm/toEvmSmartAccount.js +35 -0
- package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_esm/accounts/{types.js.map → evm/types.js.map} +1 -1
- package/_esm/accounts/solana/toSolanaAccount.js +38 -0
- package/_esm/accounts/solana/toSolanaAccount.js.map +1 -0
- package/_esm/accounts/solana/types.js +2 -0
- package/_esm/accounts/solana/types.js.map +1 -0
- package/_esm/actions/evm/getUserOperation.js +33 -0
- package/_esm/actions/evm/getUserOperation.js.map +1 -0
- package/_esm/actions/evm/listTokenBalances.js +30 -0
- package/_esm/actions/evm/listTokenBalances.js.map +1 -0
- package/_esm/actions/evm/requestFaucet.js +15 -0
- package/_esm/actions/evm/requestFaucet.js.map +1 -0
- package/_esm/actions/evm/sendTransaction.js +26 -0
- package/_esm/actions/evm/sendTransaction.js.map +1 -0
- package/_esm/actions/evm/sendUserOperation.js +5 -6
- package/_esm/actions/evm/sendUserOperation.js.map +1 -1
- package/_esm/actions/evm/transfer/accountTransferStrategy.js +11 -7
- package/_esm/actions/evm/transfer/accountTransferStrategy.js.map +1 -1
- package/_esm/actions/evm/transfer/smartAccountTransferStrategy.js +13 -8
- package/_esm/actions/evm/transfer/smartAccountTransferStrategy.js.map +1 -1
- package/_esm/actions/evm/transfer/transfer.js +7 -3
- package/_esm/actions/evm/transfer/transfer.js.map +1 -1
- package/_esm/actions/solana/requestFaucet.js +26 -0
- package/_esm/actions/solana/requestFaucet.js.map +1 -0
- package/_esm/actions/solana/signMessage.js +26 -0
- package/_esm/actions/solana/signMessage.js.map +1 -0
- package/_esm/actions/solana/signTransaction.js +43 -0
- package/_esm/actions/solana/signTransaction.js.map +1 -0
- package/_esm/actions/solana/types.js +2 -0
- package/_esm/actions/solana/types.js.map +1 -0
- package/_esm/client/evm/evm.js +10 -52
- package/_esm/client/evm/evm.js.map +1 -1
- package/_esm/client/solana/solana.js +22 -17
- package/_esm/client/solana/solana.js.map +1 -1
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +58 -0
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/openapi-client/generated/index.msw.js +3 -2
- package/_esm/openapi-client/generated/index.msw.js.map +1 -1
- package/_esm/openapi-client/generated/policy-engine/policy-engine.js +48 -0
- package/_esm/openapi-client/generated/policy-engine/policy-engine.js.map +1 -0
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js +259 -0
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -0
- package/_esm/openapi-client/index.js +1 -0
- package/_esm/openapi-client/index.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/accounts/evm/toEvmServerAccount.d.ts +1 -1
- package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
- package/_types/accounts/evm/toEvmSmartAccount.d.ts +1 -1
- package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
- package/_types/accounts/{types.d.ts → evm/types.d.ts} +5 -5
- package/_types/accounts/evm/types.d.ts.map +1 -0
- package/_types/accounts/solana/toSolanaAccount.d.ts +20 -0
- package/_types/accounts/solana/toSolanaAccount.d.ts.map +1 -0
- package/_types/accounts/solana/types.d.ts +12 -0
- package/_types/accounts/solana/types.d.ts.map +1 -0
- package/_types/actions/evm/getUserOperation.d.ts +22 -0
- package/_types/actions/evm/getUserOperation.d.ts.map +1 -0
- package/_types/actions/evm/listTokenBalances.d.ts +76 -0
- package/_types/actions/evm/listTokenBalances.d.ts.map +1 -0
- package/_types/actions/evm/requestFaucet.d.ts +34 -0
- package/_types/actions/evm/requestFaucet.d.ts.map +1 -0
- package/_types/actions/evm/sendTransaction.d.ts +42 -0
- package/_types/actions/evm/sendTransaction.d.ts.map +1 -0
- package/_types/actions/evm/sendUserOperation.d.ts +4 -3
- package/_types/actions/evm/sendUserOperation.d.ts.map +1 -1
- package/_types/actions/evm/transfer/accountTransferStrategy.d.ts +1 -1
- package/_types/actions/evm/transfer/accountTransferStrategy.d.ts.map +1 -1
- package/_types/actions/evm/transfer/smartAccountTransferStrategy.d.ts +1 -1
- package/_types/actions/evm/transfer/smartAccountTransferStrategy.d.ts.map +1 -1
- package/_types/actions/evm/transfer/transfer.d.ts +3 -3
- package/_types/actions/evm/transfer/transfer.d.ts.map +1 -1
- package/_types/actions/evm/transfer/types.d.ts +41 -7
- package/_types/actions/evm/transfer/types.d.ts.map +1 -1
- package/_types/actions/evm/types.d.ts +168 -3
- package/_types/actions/evm/types.d.ts.map +1 -1
- package/_types/actions/solana/requestFaucet.d.ts +23 -0
- package/_types/actions/solana/requestFaucet.d.ts.map +1 -0
- package/_types/actions/solana/signMessage.d.ts +23 -0
- package/_types/actions/solana/signMessage.d.ts.map +1 -0
- package/_types/actions/solana/signTransaction.d.ts +38 -0
- package/_types/actions/solana/signTransaction.d.ts.map +1 -0
- package/_types/actions/solana/types.d.ts +80 -0
- package/_types/actions/solana/types.d.ts.map +1 -0
- package/_types/client/evm/evm.d.ts +6 -3
- package/_types/client/evm/evm.d.ts.map +1 -1
- package/_types/client/evm/evm.types.d.ts +12 -138
- package/_types/client/evm/evm.types.d.ts.map +1 -1
- package/_types/client/solana/solana.d.ts +5 -4
- package/_types/client/solana/solana.d.ts.map +1 -1
- package/_types/client/solana/solana.types.d.ts +8 -11
- package/_types/client/solana/solana.types.d.ts.map +1 -1
- package/_types/index.d.ts +1 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +218 -0
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
- package/_types/openapi-client/generated/index.msw.d.ts +3 -2
- package/_types/openapi-client/generated/index.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/policy-engine/policy-engine.d.ts +43 -0
- package/_types/openapi-client/generated/policy-engine/policy-engine.d.ts.map +1 -0
- package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts +25 -0
- package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts.map +1 -0
- package/_types/openapi-client/index.d.ts +1 -0
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/accounts/evm/toEvmServerAccount.ts +35 -1
- package/accounts/evm/toEvmSmartAccount.ts +63 -1
- package/accounts/{types.ts → evm/types.ts} +5 -5
- package/accounts/solana/toSolanaAccount.ts +59 -0
- package/accounts/solana/types.ts +13 -0
- package/actions/evm/getUserOperation.ts +40 -0
- package/actions/evm/listTokenBalances.ts +107 -0
- package/actions/evm/requestFaucet.ts +46 -0
- package/actions/evm/sendTransaction.ts +73 -0
- package/actions/evm/sendUserOperation.ts +7 -7
- package/actions/evm/transfer/accountTransferStrategy.ts +12 -8
- package/actions/evm/transfer/smartAccountTransferStrategy.ts +14 -9
- package/actions/evm/transfer/transfer.ts +17 -6
- package/actions/evm/transfer/types.ts +55 -12
- package/actions/evm/types.ts +191 -3
- package/actions/solana/requestFaucet.ts +35 -0
- package/actions/solana/signMessage.ts +36 -0
- package/actions/solana/signTransaction.ts +53 -0
- package/actions/solana/types.ts +87 -0
- package/client/evm/evm.ts +28 -77
- package/client/evm/evm.types.ts +25 -151
- package/client/solana/solana.ts +32 -37
- package/client/solana/solana.types.ts +10 -15
- package/index.ts +1 -1
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +274 -0
- package/openapi-client/generated/index.msw.ts +3 -2
- package/openapi-client/generated/policy-engine/policy-engine.msw.ts +404 -0
- package/openapi-client/generated/policy-engine/policy-engine.ts +95 -0
- package/openapi-client/index.ts +1 -0
- package/package.json +1 -1
- package/version.ts +1 -1
- package/_types/accounts/types.d.ts.map +0 -1
- /package/_cjs/accounts/{types.js → evm/types.js} +0 -0
- /package/_esm/accounts/{types.js → evm/types.js} +0 -0
|
@@ -33,6 +33,7 @@ export type ErrorType = (typeof ErrorType)[keyof typeof ErrorType];
|
|
|
33
33
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
34
34
|
export const ErrorType = {
|
|
35
35
|
already_exists: "already_exists",
|
|
36
|
+
bad_gateway: "bad_gateway",
|
|
36
37
|
faucet_limit_exceeded: "faucet_limit_exceeded",
|
|
37
38
|
forbidden: "forbidden",
|
|
38
39
|
idempotency_error: "idempotency_error",
|
|
@@ -43,9 +44,11 @@ export const ErrorType = {
|
|
|
43
44
|
not_found: "not_found",
|
|
44
45
|
rate_limit_exceeded: "rate_limit_exceeded",
|
|
45
46
|
request_canceled: "request_canceled",
|
|
47
|
+
service_unavailable: "service_unavailable",
|
|
46
48
|
timed_out: "timed_out",
|
|
47
49
|
unauthorized: "unauthorized",
|
|
48
50
|
policy_violation: "policy_violation",
|
|
51
|
+
policy_in_use: "policy_in_use",
|
|
49
52
|
} as const;
|
|
50
53
|
|
|
51
54
|
/**
|
|
@@ -197,6 +200,201 @@ export interface TokenBalance {
|
|
|
197
200
|
token: Token;
|
|
198
201
|
}
|
|
199
202
|
|
|
203
|
+
/**
|
|
204
|
+
* The type of criterion to use. This should be `ethValue`.
|
|
205
|
+
*/
|
|
206
|
+
export type EthValueCriterionType =
|
|
207
|
+
(typeof EthValueCriterionType)[keyof typeof EthValueCriterionType];
|
|
208
|
+
|
|
209
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
210
|
+
export const EthValueCriterionType = {
|
|
211
|
+
ethValue: "ethValue",
|
|
212
|
+
} as const;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* The operator to use for the comparison. The transaction's `value` field will be on the left-hand side of the operator, and the `ethValue` field will be on the right-hand side.
|
|
216
|
+
*/
|
|
217
|
+
export type EthValueCriterionOperator =
|
|
218
|
+
(typeof EthValueCriterionOperator)[keyof typeof EthValueCriterionOperator];
|
|
219
|
+
|
|
220
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
221
|
+
export const EthValueCriterionOperator = {
|
|
222
|
+
">": ">",
|
|
223
|
+
">=": ">=",
|
|
224
|
+
"<": "<",
|
|
225
|
+
"<=": "<=",
|
|
226
|
+
"==": "==",
|
|
227
|
+
} as const;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* A schema for specifying a criterion for the `value` field of an EVM transaction.
|
|
231
|
+
*/
|
|
232
|
+
export interface EthValueCriterion {
|
|
233
|
+
/** The type of criterion to use. This should be `ethValue`. */
|
|
234
|
+
type: EthValueCriterionType;
|
|
235
|
+
/**
|
|
236
|
+
* The amount of ETH, in wei, that the transaction's `value` field should be compared to.
|
|
237
|
+
* @pattern ^[0-9]+$
|
|
238
|
+
*/
|
|
239
|
+
ethValue: string;
|
|
240
|
+
/** The operator to use for the comparison. The transaction's `value` field will be on the left-hand side of the operator, and the `ethValue` field will be on the right-hand side. */
|
|
241
|
+
operator: EthValueCriterionOperator;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* The type of criterion to use. This should be `evmAddress`.
|
|
246
|
+
*/
|
|
247
|
+
export type EvmAddressCriterionType =
|
|
248
|
+
(typeof EvmAddressCriterionType)[keyof typeof EvmAddressCriterionType];
|
|
249
|
+
|
|
250
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
251
|
+
export const EvmAddressCriterionType = {
|
|
252
|
+
evmAddress: "evmAddress",
|
|
253
|
+
} as const;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* The operator to use for the comparison. The transaction's `to` field will be on the left-hand side of the operator, and the `addresses` field will be on the right-hand side.
|
|
257
|
+
*/
|
|
258
|
+
export type EvmAddressCriterionOperator =
|
|
259
|
+
(typeof EvmAddressCriterionOperator)[keyof typeof EvmAddressCriterionOperator];
|
|
260
|
+
|
|
261
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
262
|
+
export const EvmAddressCriterionOperator = {
|
|
263
|
+
in: "in",
|
|
264
|
+
not_in: "not in",
|
|
265
|
+
} as const;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* A schema for specifying a criterion for the `to` field of an EVM transaction.
|
|
269
|
+
*/
|
|
270
|
+
export interface EvmAddressCriterion {
|
|
271
|
+
/** The type of criterion to use. This should be `evmAddress`. */
|
|
272
|
+
type: EvmAddressCriterionType;
|
|
273
|
+
/** A list of 0x-prefixed EVM addresses that the transaction's `to` field should be compared to. There is a limit of 100 addresses per criterion. */
|
|
274
|
+
addresses: string[];
|
|
275
|
+
/** The operator to use for the comparison. The transaction's `to` field will be on the left-hand side of the operator, and the `addresses` field will be on the right-hand side. */
|
|
276
|
+
operator: EvmAddressCriterionOperator;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export type SignEvmTransactionCriteriaItem = EthValueCriterion | EvmAddressCriterion;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* A schema for specifying the rejection criteria for the SignEvmTransaction operation.
|
|
283
|
+
*/
|
|
284
|
+
export type SignEvmTransactionCriteria = SignEvmTransactionCriteriaItem[];
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* The type of criterion to use. This should be `solAddress`.
|
|
288
|
+
*/
|
|
289
|
+
export type SolAddressCriterionType =
|
|
290
|
+
(typeof SolAddressCriterionType)[keyof typeof SolAddressCriterionType];
|
|
291
|
+
|
|
292
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
293
|
+
export const SolAddressCriterionType = {
|
|
294
|
+
solAddress: "solAddress",
|
|
295
|
+
} as const;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* The operator to use for the comparison. Each of the addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array will be on the left-hand side of the operator, and the addresses field will be on the right-hand side.
|
|
299
|
+
*/
|
|
300
|
+
export type SolAddressCriterionOperator =
|
|
301
|
+
(typeof SolAddressCriterionOperator)[keyof typeof SolAddressCriterionOperator];
|
|
302
|
+
|
|
303
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
304
|
+
export const SolAddressCriterionOperator = {
|
|
305
|
+
in: "in",
|
|
306
|
+
not_in: "not in",
|
|
307
|
+
} as const;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* The criterion for the recipient addresses of a Solana transaction.
|
|
311
|
+
*/
|
|
312
|
+
export interface SolAddressCriterion {
|
|
313
|
+
/** The type of criterion to use. This should be `solAddress`. */
|
|
314
|
+
type: SolAddressCriterionType;
|
|
315
|
+
/** The Solana addresses that are compared to the list of addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array. */
|
|
316
|
+
addresses: string[];
|
|
317
|
+
/** The operator to use for the comparison. Each of the addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array will be on the left-hand side of the operator, and the addresses field will be on the right-hand side. */
|
|
318
|
+
operator: SolAddressCriterionOperator;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* A schema for specifying the rejection criteria for the SignSolTransaction operation.
|
|
323
|
+
*/
|
|
324
|
+
export type SignSolTransactionCriteria = SolAddressCriterion[];
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Whether matching the rule will cause the request to be rejected or accepted.
|
|
328
|
+
*/
|
|
329
|
+
export type RuleAction = (typeof RuleAction)[keyof typeof RuleAction];
|
|
330
|
+
|
|
331
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
332
|
+
export const RuleAction = {
|
|
333
|
+
reject: "reject",
|
|
334
|
+
accept: "accept",
|
|
335
|
+
} as const;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* The operation to which the rule applies. Every element of the `criteria` array must match the specified operation.
|
|
339
|
+
*/
|
|
340
|
+
export type RuleOperation = (typeof RuleOperation)[keyof typeof RuleOperation];
|
|
341
|
+
|
|
342
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
343
|
+
export const RuleOperation = {
|
|
344
|
+
signEvmTransaction: "signEvmTransaction",
|
|
345
|
+
signSolTransaction: "signSolTransaction",
|
|
346
|
+
} as const;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* The set of criteria for the rule. There is a limit of 10 criteria per rule.
|
|
350
|
+
*/
|
|
351
|
+
export type RuleCriteria = SignEvmTransactionCriteria | SignSolTransactionCriteria;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* A rule that limits the behavior of an account.
|
|
355
|
+
*/
|
|
356
|
+
export interface Rule {
|
|
357
|
+
/** Whether matching the rule will cause the request to be rejected or accepted. */
|
|
358
|
+
action: RuleAction;
|
|
359
|
+
/** The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. */
|
|
360
|
+
operation: RuleOperation;
|
|
361
|
+
/** The set of criteria for the rule. There is a limit of 10 criteria per rule. */
|
|
362
|
+
criteria: RuleCriteria;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* The scope of the policy. Only one project-level policy can exist at any time.
|
|
367
|
+
*/
|
|
368
|
+
export type PolicyScope = (typeof PolicyScope)[keyof typeof PolicyScope];
|
|
369
|
+
|
|
370
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
371
|
+
export const PolicyScope = {
|
|
372
|
+
project: "project",
|
|
373
|
+
account: "account",
|
|
374
|
+
} as const;
|
|
375
|
+
|
|
376
|
+
export interface Policy {
|
|
377
|
+
/**
|
|
378
|
+
* The unique identifier for the policy.
|
|
379
|
+
* @pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
|
|
380
|
+
*/
|
|
381
|
+
id: string;
|
|
382
|
+
/**
|
|
383
|
+
* An optional human-readable description of the policy.
|
|
384
|
+
Policy descriptions can consist of alphanumeric characters, spaces, commas, and periods, and be 50 characters or less.
|
|
385
|
+
* @pattern ^[A-Za-z0-9 ,.]{1,50}$
|
|
386
|
+
*/
|
|
387
|
+
description?: string;
|
|
388
|
+
/** The scope of the policy. Only one project-level policy can exist at any time. */
|
|
389
|
+
scope: PolicyScope;
|
|
390
|
+
/** A list of rules that comprise the policy. */
|
|
391
|
+
rules: Rule[];
|
|
392
|
+
/** The ISO 8601 timestamp at which the Policy was created. */
|
|
393
|
+
createdAt: string;
|
|
394
|
+
/** The ISO 8601 timestamp at which the Policy was last updated. */
|
|
395
|
+
updatedAt: string;
|
|
396
|
+
}
|
|
397
|
+
|
|
200
398
|
export interface SolanaAccount {
|
|
201
399
|
/**
|
|
202
400
|
* The base58 encoded Solana address.
|
|
@@ -217,6 +415,16 @@ Account names are guaranteed to be unique across all Solana accounts in the deve
|
|
|
217
415
|
*/
|
|
218
416
|
export type InternalServerErrorResponse = Error;
|
|
219
417
|
|
|
418
|
+
/**
|
|
419
|
+
* Bad gateway.
|
|
420
|
+
*/
|
|
421
|
+
export type BadGatewayErrorResponse = Error;
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Service unavailable.
|
|
425
|
+
*/
|
|
426
|
+
export type ServiceUnavailableErrorResponse = Error;
|
|
427
|
+
|
|
220
428
|
/**
|
|
221
429
|
* Idempotency key conflict.
|
|
222
430
|
*/
|
|
@@ -436,6 +644,72 @@ export type RequestEvmFaucet200 = {
|
|
|
436
644
|
transactionHash: string;
|
|
437
645
|
};
|
|
438
646
|
|
|
647
|
+
export type ListPoliciesParams = {
|
|
648
|
+
/**
|
|
649
|
+
* The number of policies to return per page.
|
|
650
|
+
*/
|
|
651
|
+
pageSize?: number;
|
|
652
|
+
/**
|
|
653
|
+
* The token for the next page of policies, if any.
|
|
654
|
+
*/
|
|
655
|
+
pageToken?: string;
|
|
656
|
+
/**
|
|
657
|
+
* The scope of the policies to return. If `project`, the response will include exactly one policy, which is the project-level policy. If `account`, the response will include all account-level policies for the developer's CDP Project.
|
|
658
|
+
*/
|
|
659
|
+
scope?: ListPoliciesScope;
|
|
660
|
+
};
|
|
661
|
+
|
|
662
|
+
export type ListPoliciesScope = (typeof ListPoliciesScope)[keyof typeof ListPoliciesScope];
|
|
663
|
+
|
|
664
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
665
|
+
export const ListPoliciesScope = {
|
|
666
|
+
project: "project",
|
|
667
|
+
account: "account",
|
|
668
|
+
} as const;
|
|
669
|
+
|
|
670
|
+
export type ListPolicies200AllOf = {
|
|
671
|
+
/** The list of policies. */
|
|
672
|
+
policies: Policy[];
|
|
673
|
+
};
|
|
674
|
+
|
|
675
|
+
export type ListPolicies200 = ListPolicies200AllOf & ListResponse;
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* The scope of the policy.
|
|
679
|
+
*/
|
|
680
|
+
export type CreatePolicyBodyScope =
|
|
681
|
+
(typeof CreatePolicyBodyScope)[keyof typeof CreatePolicyBodyScope];
|
|
682
|
+
|
|
683
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
684
|
+
export const CreatePolicyBodyScope = {
|
|
685
|
+
project: "project",
|
|
686
|
+
account: "account",
|
|
687
|
+
} as const;
|
|
688
|
+
|
|
689
|
+
export type CreatePolicyBody = {
|
|
690
|
+
/** The scope of the policy. */
|
|
691
|
+
scope: CreatePolicyBodyScope;
|
|
692
|
+
/**
|
|
693
|
+
* An optional human-readable description for the policy.
|
|
694
|
+
Policy descriptions can consist of alphanumeric characters, spaces, commas, and periods, and be 50 characters or less.
|
|
695
|
+
* @pattern ^[A-Za-z0-9 ,.]{1,50}$
|
|
696
|
+
*/
|
|
697
|
+
description?: string;
|
|
698
|
+
/** A list of rules that comprise the policy. There is a limit of 10 rules per policy. */
|
|
699
|
+
rules: Rule[];
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
export type UpdatePolicyBody = {
|
|
703
|
+
/**
|
|
704
|
+
* An optional human-readable description for the policy.
|
|
705
|
+
Policy descriptions can consist of alphanumeric characters, spaces, commas, and periods, and be 50 characters or less.
|
|
706
|
+
* @pattern ^[A-Za-z0-9 ,.]{1,50}$
|
|
707
|
+
*/
|
|
708
|
+
description?: string;
|
|
709
|
+
/** A list of rules that comprise the policy. There is a limit of 10 rules per policy. */
|
|
710
|
+
rules: Rule[];
|
|
711
|
+
};
|
|
712
|
+
|
|
439
713
|
export type ListSolanaAccountsParams = {
|
|
440
714
|
/**
|
|
441
715
|
* The number of accounts to return per page.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export * from "./evm-accounts/evm-accounts.msw.js";
|
|
2
1
|
export * from "./faucets/faucets.msw.js";
|
|
3
|
-
export * from "./evm-
|
|
2
|
+
export * from "./evm-accounts/evm-accounts.msw.js";
|
|
4
3
|
export * from "./evm-token-balances/evm-token-balances.msw.js";
|
|
4
|
+
export * from "./evm-smart-accounts/evm-smart-accounts.msw.js";
|
|
5
|
+
export * from "./policy-engine/policy-engine.msw.js";
|
|
5
6
|
export * from "./solana-accounts/solana-accounts.msw.js";
|