@coinbase/cdp-sdk 1.11.0 → 1.13.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 +14 -0
- package/README.md +126 -0
- package/_cjs/accounts/evm/toEvmServerAccount.js +15 -0
- package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_cjs/actions/evm/swap/createSwapQuote.js +126 -0
- package/_cjs/actions/evm/swap/createSwapQuote.js.map +1 -0
- package/_cjs/actions/evm/swap/getSwapPrice.js +86 -0
- package/_cjs/actions/evm/swap/getSwapPrice.js.map +1 -0
- package/_cjs/actions/evm/swap/sendSwapTransaction.js +141 -0
- package/_cjs/actions/evm/swap/sendSwapTransaction.js.map +1 -0
- package/_cjs/actions/evm/swap/types.js +3 -0
- package/_cjs/actions/evm/swap/types.js.map +1 -0
- package/_cjs/client/evm/evm.js +46 -1
- package/_cjs/client/evm/evm.js.map +1 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +28 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/openapi-client/generated/evm-swaps/evm-swaps.js +26 -0
- package/_cjs/openapi-client/generated/evm-swaps/evm-swaps.js.map +1 -0
- package/_cjs/openapi-client/generated/evm-swaps/evm-swaps.msw.js +179 -0
- package/_cjs/openapi-client/generated/evm-swaps/evm-swaps.msw.js.map +1 -0
- package/_cjs/openapi-client/generated/index.msw.js +5 -4
- package/_cjs/openapi-client/generated/index.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js +59 -1
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
- package/_cjs/openapi-client/index.js +4 -0
- package/_cjs/openapi-client/index.js.map +1 -1
- package/_cjs/policies/schema.js +59 -1
- package/_cjs/policies/schema.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/accounts/evm/toEvmServerAccount.js +15 -0
- package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_esm/actions/evm/swap/createSwapQuote.js +123 -0
- package/_esm/actions/evm/swap/createSwapQuote.js.map +1 -0
- package/_esm/actions/evm/swap/getSwapPrice.js +83 -0
- package/_esm/actions/evm/swap/getSwapPrice.js.map +1 -0
- package/_esm/actions/evm/swap/sendSwapTransaction.js +138 -0
- package/_esm/actions/evm/swap/sendSwapTransaction.js.map +1 -0
- package/_esm/actions/evm/swap/types.js +2 -0
- package/_esm/actions/evm/swap/types.js.map +1 -0
- package/_esm/client/evm/evm.js +46 -1
- package/_esm/client/evm/evm.js.map +1 -1
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +27 -0
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/openapi-client/generated/evm-swaps/evm-swaps.js +21 -0
- package/_esm/openapi-client/generated/evm-swaps/evm-swaps.js.map +1 -0
- package/_esm/openapi-client/generated/evm-swaps/evm-swaps.msw.js +167 -0
- package/_esm/openapi-client/generated/evm-swaps/evm-swaps.msw.js.map +1 -0
- package/_esm/openapi-client/generated/index.msw.js +5 -4
- package/_esm/openapi-client/generated/index.msw.js.map +1 -1
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js +54 -0
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
- package/_esm/openapi-client/index.js +4 -0
- package/_esm/openapi-client/index.js.map +1 -1
- package/_esm/policies/schema.js +58 -0
- package/_esm/policies/schema.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
- package/_types/actions/evm/swap/createSwapQuote.d.ts +23 -0
- package/_types/actions/evm/swap/createSwapQuote.d.ts.map +1 -0
- package/_types/actions/evm/swap/getSwapPrice.d.ts +23 -0
- package/_types/actions/evm/swap/getSwapPrice.d.ts.map +1 -0
- package/_types/actions/evm/swap/sendSwapTransaction.d.ts +64 -0
- package/_types/actions/evm/swap/sendSwapTransaction.d.ts.map +1 -0
- package/_types/actions/evm/swap/types.d.ts +119 -0
- package/_types/actions/evm/swap/types.d.ts.map +1 -0
- package/_types/actions/evm/types.d.ts +86 -0
- package/_types/actions/evm/types.d.ts.map +1 -1
- package/_types/client/evm/evm.d.ts +39 -1
- package/_types/client/evm/evm.d.ts.map +1 -1
- package/_types/client/evm/evm.types.d.ts +207 -3
- package/_types/client/evm/evm.types.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +364 -4
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
- package/_types/openapi-client/generated/evm-swaps/evm-swaps.d.ts +24 -0
- package/_types/openapi-client/generated/evm-swaps/evm-swaps.d.ts.map +1 -0
- package/_types/openapi-client/generated/evm-swaps/evm-swaps.msw.d.ts +12 -0
- package/_types/openapi-client/generated/evm-swaps/evm-swaps.msw.d.ts.map +1 -0
- package/_types/openapi-client/generated/index.msw.d.ts +5 -4
- package/_types/openapi-client/generated/index.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts +5 -1
- package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts.map +1 -1
- package/_types/openapi-client/index.d.ts +5 -0
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/policies/schema.d.ts +338 -0
- package/_types/policies/schema.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/accounts/evm/toEvmServerAccount.ts +21 -0
- package/actions/evm/swap/createSwapQuote.ts +148 -0
- package/actions/evm/swap/getSwapPrice.ts +95 -0
- package/actions/evm/swap/sendSwapTransaction.ts +173 -0
- package/actions/evm/swap/types.ts +137 -0
- package/actions/evm/types.ts +88 -0
- package/client/evm/evm.ts +58 -1
- package/client/evm/evm.types.ts +225 -1
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +422 -4
- package/openapi-client/generated/evm-swaps/evm-swaps.msw.ts +217 -0
- package/openapi-client/generated/evm-swaps/evm-swaps.ts +51 -0
- package/openapi-client/generated/index.msw.ts +5 -4
- package/openapi-client/generated/policy-engine/policy-engine.msw.ts +87 -0
- package/openapi-client/index.ts +4 -0
- package/package.json +1 -1
- package/policies/schema.ts +70 -0
- package/version.ts +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./generated/coinbaseDeveloperPlatformAPIs.schemas.js";
|
|
2
2
|
export * from "./generated/evm-accounts/evm-accounts.js";
|
|
3
3
|
export * from "./generated/evm-smart-accounts/evm-smart-accounts.js";
|
|
4
|
+
export * from "./generated/evm-swaps/evm-swaps.js";
|
|
4
5
|
export * from "./generated/evm-token-balances/evm-token-balances.js";
|
|
5
6
|
export * from "./generated/solana-accounts/solana-accounts.js";
|
|
6
7
|
export * from "./generated/faucets/faucets.js";
|
|
@@ -28,6 +29,8 @@ export declare const CdpOpenApiClient: {
|
|
|
28
29
|
signSolanaTransaction: (address: string, signSolanaTransactionBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignSolanaTransactionBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignSolanaTransaction200>;
|
|
29
30
|
signSolanaMessage: (address: string, signSolanaMessageBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignSolanaMessageBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignSolanaMessage200>;
|
|
30
31
|
listEvmTokenBalances: (network: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmTokenBalancesNetwork, address: string, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmTokenBalancesParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmTokenBalances200>;
|
|
32
|
+
getEvmSwapPrice: (params: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").GetEvmSwapPriceParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").GetSwapPriceResponseWrapper>;
|
|
33
|
+
createEvmSwapQuote: (createEvmSwapQuoteBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEvmSwapQuoteBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateSwapQuoteResponseWrapper>;
|
|
31
34
|
listEvmSmartAccounts: (params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmSmartAccountsParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmSmartAccounts200>;
|
|
32
35
|
createEvmSmartAccount: (createEvmSmartAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEvmSmartAccountBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmSmartAccount>;
|
|
33
36
|
getEvmSmartAccount: (address: string, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmSmartAccount>;
|
|
@@ -49,6 +52,8 @@ export declare const CdpOpenApiClient: {
|
|
|
49
52
|
export declare const OpenApiEvmMethods: {
|
|
50
53
|
requestEvmFaucet: (requestEvmFaucetBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").RequestEvmFaucetBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").RequestEvmFaucet200>;
|
|
51
54
|
listEvmTokenBalances: (network: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmTokenBalancesNetwork, address: string, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmTokenBalancesParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmTokenBalances200>;
|
|
55
|
+
getEvmSwapPrice: (params: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").GetEvmSwapPriceParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").GetSwapPriceResponseWrapper>;
|
|
56
|
+
createEvmSwapQuote: (createEvmSwapQuoteBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEvmSwapQuoteBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateSwapQuoteResponseWrapper>;
|
|
52
57
|
listEvmSmartAccounts: (params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmSmartAccountsParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmSmartAccounts200>;
|
|
53
58
|
createEvmSmartAccount: (createEvmSmartAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEvmSmartAccountBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmSmartAccount>;
|
|
54
59
|
getEvmSmartAccount: (address: string, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmSmartAccount>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../openapi-client/index.ts"],"names":[],"mappings":"AAAA,cAAc,sDAAsD,CAAC;AACrE,cAAc,0CAA0C,CAAC;AACzD,cAAc,sDAAsD,CAAC;AACrE,cAAc,sDAAsD,CAAC;AACrE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../openapi-client/index.ts"],"names":[],"mappings":"AAAA,cAAc,sDAAsD,CAAC;AACrE,cAAc,0CAA0C,CAAC;AACzD,cAAc,sDAAsD,CAAC;AACrE,cAAc,oCAAoC,CAAC;AACnD,cAAc,sDAAsD,CAAC;AACrE,cAAc,gDAAg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AAiD;0BAAwT,eAAkB,EAAC,+GAAmD,EAAC,4BAAiD;6BAA6W,YAAe,EAAC,4BAAiD;4BAAwvB,eAAkB,EAAC,mHAAuD,EAAC,4BAAiD;wBAAijB,eAAkB,EAAC,2GAA+C,EAAC,4BAAiD;CAP17E,CAAC;AAEF,eAAO,MAAM,sBAAsB;mBAhCvB,0FAA8B,EAAC,4BACf;mBAIrB,iGAAoC,EAAC,4BAE1B;oBAoBjB,gBAAgB,EAAC,4BAEJ;mBAQiJ,gBAAgB,EAAC,4BAA+C;mBAAwU,gBAAmB,EAAC,iGAAqC,EAAC,4BAAiD;CAHjpB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,OAAO,gBAAgB,CAAC"}
|
|
@@ -121,6 +121,25 @@ export declare const EvmNetworkCriterionSchema: z.ZodObject<{
|
|
|
121
121
|
networks: ("base-sepolia" | "base")[];
|
|
122
122
|
}>;
|
|
123
123
|
export type EvmNetworkCriterion = z.infer<typeof EvmNetworkCriterionSchema>;
|
|
124
|
+
/**
|
|
125
|
+
* Schema for EVM message criterions
|
|
126
|
+
*/
|
|
127
|
+
export declare const EvmMessageCriterionSchema: z.ZodObject<{
|
|
128
|
+
/** The type of criterion, must be "evmMessage" for EVM message-based rules. */
|
|
129
|
+
type: z.ZodLiteral<"evmMessage">;
|
|
130
|
+
/**
|
|
131
|
+
* A regular expression the message is matched against.
|
|
132
|
+
* Accepts valid regular expression syntax described by [RE2](https://github.com/google/re2/wiki/Syntax).
|
|
133
|
+
*/
|
|
134
|
+
match: z.ZodString;
|
|
135
|
+
}, "strip", z.ZodTypeAny, {
|
|
136
|
+
type: "evmMessage";
|
|
137
|
+
match: string;
|
|
138
|
+
}, {
|
|
139
|
+
type: "evmMessage";
|
|
140
|
+
match: string;
|
|
141
|
+
}>;
|
|
142
|
+
export type EvmMessageCriterion = z.infer<typeof EvmMessageCriterionSchema>;
|
|
124
143
|
/**
|
|
125
144
|
* Schema for Solana address criterions
|
|
126
145
|
*/
|
|
@@ -198,6 +217,29 @@ export declare const SignEvmTransactionCriteriaSchema: z.ZodArray<z.ZodDiscrimin
|
|
|
198
217
|
* Can contain up to 10 individual criterion objects of ETH value or EVM address types.
|
|
199
218
|
*/
|
|
200
219
|
export type SignEvmTransactionCriteria = z.infer<typeof SignEvmTransactionCriteriaSchema>;
|
|
220
|
+
/**
|
|
221
|
+
* Schema for criteria used in SignEvmMessage operations
|
|
222
|
+
*/
|
|
223
|
+
export declare const SignEvmMessageCriteriaSchema: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
224
|
+
/** The type of criterion, must be "evmMessage" for EVM message-based rules. */
|
|
225
|
+
type: z.ZodLiteral<"evmMessage">;
|
|
226
|
+
/**
|
|
227
|
+
* A regular expression the message is matched against.
|
|
228
|
+
* Accepts valid regular expression syntax described by [RE2](https://github.com/google/re2/wiki/Syntax).
|
|
229
|
+
*/
|
|
230
|
+
match: z.ZodString;
|
|
231
|
+
}, "strip", z.ZodTypeAny, {
|
|
232
|
+
type: "evmMessage";
|
|
233
|
+
match: string;
|
|
234
|
+
}, {
|
|
235
|
+
type: "evmMessage";
|
|
236
|
+
match: string;
|
|
237
|
+
}>]>, "many">;
|
|
238
|
+
/**
|
|
239
|
+
* Type representing a set of criteria for the signEvmMessage operation.
|
|
240
|
+
* Can contain up to 10 individual EVM message criterion objects.
|
|
241
|
+
*/
|
|
242
|
+
export type SignEvmMessageCriteria = z.infer<typeof SignEvmMessageCriteriaSchema>;
|
|
201
243
|
/**
|
|
202
244
|
* Schema for criteria used in SendEvmTransaction operations
|
|
203
245
|
*/
|
|
@@ -415,6 +457,79 @@ export declare const SignEvmTransactionRuleSchema: z.ZodObject<{
|
|
|
415
457
|
})[];
|
|
416
458
|
}>;
|
|
417
459
|
export type SignEvmTransactionRule = z.infer<typeof SignEvmTransactionRuleSchema>;
|
|
460
|
+
/**
|
|
461
|
+
* Type representing a 'signEvmHash' policy rule that can accept or reject specific operations
|
|
462
|
+
* based on a set of criteria.
|
|
463
|
+
*/
|
|
464
|
+
export declare const SignEvmHashRuleSchema: z.ZodObject<{
|
|
465
|
+
/**
|
|
466
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
467
|
+
* "accept" will allow the signing, "reject" will block it.
|
|
468
|
+
*/
|
|
469
|
+
action: z.ZodEnum<["reject", "accept"]>;
|
|
470
|
+
/**
|
|
471
|
+
* The operation to which this rule applies.
|
|
472
|
+
* Must be "signEvmHash".
|
|
473
|
+
*/
|
|
474
|
+
operation: z.ZodLiteral<"signEvmHash">;
|
|
475
|
+
}, "strip", z.ZodTypeAny, {
|
|
476
|
+
action: "reject" | "accept";
|
|
477
|
+
operation: "signEvmHash";
|
|
478
|
+
}, {
|
|
479
|
+
action: "reject" | "accept";
|
|
480
|
+
operation: "signEvmHash";
|
|
481
|
+
}>;
|
|
482
|
+
export type SignEvmHashRule = z.infer<typeof SignEvmHashRuleSchema>;
|
|
483
|
+
/**
|
|
484
|
+
* Type representing a 'signEvmMessage' policy rule that can accept or reject specific operations
|
|
485
|
+
* based on a set of criteria.
|
|
486
|
+
*/
|
|
487
|
+
export declare const SignEvmMessageRuleSchema: z.ZodObject<{
|
|
488
|
+
/**
|
|
489
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
490
|
+
* "accept" will allow the signing, "reject" will block it.
|
|
491
|
+
*/
|
|
492
|
+
action: z.ZodEnum<["reject", "accept"]>;
|
|
493
|
+
/**
|
|
494
|
+
* The operation to which this rule applies.
|
|
495
|
+
* Must be "signEvmMessage".
|
|
496
|
+
*/
|
|
497
|
+
operation: z.ZodLiteral<"signEvmMessage">;
|
|
498
|
+
/**
|
|
499
|
+
* The set of criteria that must be matched for this rule to apply.
|
|
500
|
+
* Must be compatible with the specified operation type.
|
|
501
|
+
*/
|
|
502
|
+
criteria: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
503
|
+
/** The type of criterion, must be "evmMessage" for EVM message-based rules. */
|
|
504
|
+
type: z.ZodLiteral<"evmMessage">;
|
|
505
|
+
/**
|
|
506
|
+
* A regular expression the message is matched against.
|
|
507
|
+
* Accepts valid regular expression syntax described by [RE2](https://github.com/google/re2/wiki/Syntax).
|
|
508
|
+
*/
|
|
509
|
+
match: z.ZodString;
|
|
510
|
+
}, "strip", z.ZodTypeAny, {
|
|
511
|
+
type: "evmMessage";
|
|
512
|
+
match: string;
|
|
513
|
+
}, {
|
|
514
|
+
type: "evmMessage";
|
|
515
|
+
match: string;
|
|
516
|
+
}>]>, "many">;
|
|
517
|
+
}, "strip", z.ZodTypeAny, {
|
|
518
|
+
action: "reject" | "accept";
|
|
519
|
+
operation: "signEvmMessage";
|
|
520
|
+
criteria: {
|
|
521
|
+
type: "evmMessage";
|
|
522
|
+
match: string;
|
|
523
|
+
}[];
|
|
524
|
+
}, {
|
|
525
|
+
action: "reject" | "accept";
|
|
526
|
+
operation: "signEvmMessage";
|
|
527
|
+
criteria: {
|
|
528
|
+
type: "evmMessage";
|
|
529
|
+
match: string;
|
|
530
|
+
}[];
|
|
531
|
+
}>;
|
|
532
|
+
export type SignEvmMessageRule = z.infer<typeof SignEvmMessageRuleSchema>;
|
|
418
533
|
/**
|
|
419
534
|
* Type representing a 'sendEvmTransaction' policy rule that can accept or reject specific operations
|
|
420
535
|
* based on a set of criteria.
|
|
@@ -676,6 +791,67 @@ export declare const RuleSchema: z.ZodDiscriminatedUnion<"operation", [z.ZodObje
|
|
|
676
791
|
operator: "in" | "not in";
|
|
677
792
|
addresses: string[];
|
|
678
793
|
})[];
|
|
794
|
+
}>, z.ZodObject<{
|
|
795
|
+
/**
|
|
796
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
797
|
+
* "accept" will allow the signing, "reject" will block it.
|
|
798
|
+
*/
|
|
799
|
+
action: z.ZodEnum<["reject", "accept"]>;
|
|
800
|
+
/**
|
|
801
|
+
* The operation to which this rule applies.
|
|
802
|
+
* Must be "signEvmHash".
|
|
803
|
+
*/
|
|
804
|
+
operation: z.ZodLiteral<"signEvmHash">;
|
|
805
|
+
}, "strip", z.ZodTypeAny, {
|
|
806
|
+
action: "reject" | "accept";
|
|
807
|
+
operation: "signEvmHash";
|
|
808
|
+
}, {
|
|
809
|
+
action: "reject" | "accept";
|
|
810
|
+
operation: "signEvmHash";
|
|
811
|
+
}>, z.ZodObject<{
|
|
812
|
+
/**
|
|
813
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
814
|
+
* "accept" will allow the signing, "reject" will block it.
|
|
815
|
+
*/
|
|
816
|
+
action: z.ZodEnum<["reject", "accept"]>;
|
|
817
|
+
/**
|
|
818
|
+
* The operation to which this rule applies.
|
|
819
|
+
* Must be "signEvmMessage".
|
|
820
|
+
*/
|
|
821
|
+
operation: z.ZodLiteral<"signEvmMessage">;
|
|
822
|
+
/**
|
|
823
|
+
* The set of criteria that must be matched for this rule to apply.
|
|
824
|
+
* Must be compatible with the specified operation type.
|
|
825
|
+
*/
|
|
826
|
+
criteria: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
827
|
+
/** The type of criterion, must be "evmMessage" for EVM message-based rules. */
|
|
828
|
+
type: z.ZodLiteral<"evmMessage">;
|
|
829
|
+
/**
|
|
830
|
+
* A regular expression the message is matched against.
|
|
831
|
+
* Accepts valid regular expression syntax described by [RE2](https://github.com/google/re2/wiki/Syntax).
|
|
832
|
+
*/
|
|
833
|
+
match: z.ZodString;
|
|
834
|
+
}, "strip", z.ZodTypeAny, {
|
|
835
|
+
type: "evmMessage";
|
|
836
|
+
match: string;
|
|
837
|
+
}, {
|
|
838
|
+
type: "evmMessage";
|
|
839
|
+
match: string;
|
|
840
|
+
}>]>, "many">;
|
|
841
|
+
}, "strip", z.ZodTypeAny, {
|
|
842
|
+
action: "reject" | "accept";
|
|
843
|
+
operation: "signEvmMessage";
|
|
844
|
+
criteria: {
|
|
845
|
+
type: "evmMessage";
|
|
846
|
+
match: string;
|
|
847
|
+
}[];
|
|
848
|
+
}, {
|
|
849
|
+
action: "reject" | "accept";
|
|
850
|
+
operation: "signEvmMessage";
|
|
851
|
+
criteria: {
|
|
852
|
+
type: "evmMessage";
|
|
853
|
+
match: string;
|
|
854
|
+
}[];
|
|
679
855
|
}>, z.ZodObject<{
|
|
680
856
|
/**
|
|
681
857
|
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
@@ -955,6 +1131,67 @@ export declare const CreatePolicyBodySchema: z.ZodObject<{
|
|
|
955
1131
|
operator: "in" | "not in";
|
|
956
1132
|
addresses: string[];
|
|
957
1133
|
})[];
|
|
1134
|
+
}>, z.ZodObject<{
|
|
1135
|
+
/**
|
|
1136
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
1137
|
+
* "accept" will allow the signing, "reject" will block it.
|
|
1138
|
+
*/
|
|
1139
|
+
action: z.ZodEnum<["reject", "accept"]>;
|
|
1140
|
+
/**
|
|
1141
|
+
* The operation to which this rule applies.
|
|
1142
|
+
* Must be "signEvmHash".
|
|
1143
|
+
*/
|
|
1144
|
+
operation: z.ZodLiteral<"signEvmHash">;
|
|
1145
|
+
}, "strip", z.ZodTypeAny, {
|
|
1146
|
+
action: "reject" | "accept";
|
|
1147
|
+
operation: "signEvmHash";
|
|
1148
|
+
}, {
|
|
1149
|
+
action: "reject" | "accept";
|
|
1150
|
+
operation: "signEvmHash";
|
|
1151
|
+
}>, z.ZodObject<{
|
|
1152
|
+
/**
|
|
1153
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
1154
|
+
* "accept" will allow the signing, "reject" will block it.
|
|
1155
|
+
*/
|
|
1156
|
+
action: z.ZodEnum<["reject", "accept"]>;
|
|
1157
|
+
/**
|
|
1158
|
+
* The operation to which this rule applies.
|
|
1159
|
+
* Must be "signEvmMessage".
|
|
1160
|
+
*/
|
|
1161
|
+
operation: z.ZodLiteral<"signEvmMessage">;
|
|
1162
|
+
/**
|
|
1163
|
+
* The set of criteria that must be matched for this rule to apply.
|
|
1164
|
+
* Must be compatible with the specified operation type.
|
|
1165
|
+
*/
|
|
1166
|
+
criteria: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1167
|
+
/** The type of criterion, must be "evmMessage" for EVM message-based rules. */
|
|
1168
|
+
type: z.ZodLiteral<"evmMessage">;
|
|
1169
|
+
/**
|
|
1170
|
+
* A regular expression the message is matched against.
|
|
1171
|
+
* Accepts valid regular expression syntax described by [RE2](https://github.com/google/re2/wiki/Syntax).
|
|
1172
|
+
*/
|
|
1173
|
+
match: z.ZodString;
|
|
1174
|
+
}, "strip", z.ZodTypeAny, {
|
|
1175
|
+
type: "evmMessage";
|
|
1176
|
+
match: string;
|
|
1177
|
+
}, {
|
|
1178
|
+
type: "evmMessage";
|
|
1179
|
+
match: string;
|
|
1180
|
+
}>]>, "many">;
|
|
1181
|
+
}, "strip", z.ZodTypeAny, {
|
|
1182
|
+
action: "reject" | "accept";
|
|
1183
|
+
operation: "signEvmMessage";
|
|
1184
|
+
criteria: {
|
|
1185
|
+
type: "evmMessage";
|
|
1186
|
+
match: string;
|
|
1187
|
+
}[];
|
|
1188
|
+
}, {
|
|
1189
|
+
action: "reject" | "accept";
|
|
1190
|
+
operation: "signEvmMessage";
|
|
1191
|
+
criteria: {
|
|
1192
|
+
type: "evmMessage";
|
|
1193
|
+
match: string;
|
|
1194
|
+
}[];
|
|
958
1195
|
}>, z.ZodObject<{
|
|
959
1196
|
/**
|
|
960
1197
|
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
@@ -1135,6 +1372,16 @@ export declare const CreatePolicyBodySchema: z.ZodObject<{
|
|
|
1135
1372
|
operator: "in" | "not in";
|
|
1136
1373
|
addresses: `0x${string}`[];
|
|
1137
1374
|
})[];
|
|
1375
|
+
} | {
|
|
1376
|
+
action: "reject" | "accept";
|
|
1377
|
+
operation: "signEvmHash";
|
|
1378
|
+
} | {
|
|
1379
|
+
action: "reject" | "accept";
|
|
1380
|
+
operation: "signEvmMessage";
|
|
1381
|
+
criteria: {
|
|
1382
|
+
type: "evmMessage";
|
|
1383
|
+
match: string;
|
|
1384
|
+
}[];
|
|
1138
1385
|
} | {
|
|
1139
1386
|
action: "reject" | "accept";
|
|
1140
1387
|
operation: "sendEvmTransaction";
|
|
@@ -1175,6 +1422,16 @@ export declare const CreatePolicyBodySchema: z.ZodObject<{
|
|
|
1175
1422
|
operator: "in" | "not in";
|
|
1176
1423
|
addresses: string[];
|
|
1177
1424
|
})[];
|
|
1425
|
+
} | {
|
|
1426
|
+
action: "reject" | "accept";
|
|
1427
|
+
operation: "signEvmHash";
|
|
1428
|
+
} | {
|
|
1429
|
+
action: "reject" | "accept";
|
|
1430
|
+
operation: "signEvmMessage";
|
|
1431
|
+
criteria: {
|
|
1432
|
+
type: "evmMessage";
|
|
1433
|
+
match: string;
|
|
1434
|
+
}[];
|
|
1178
1435
|
} | {
|
|
1179
1436
|
action: "reject" | "accept";
|
|
1180
1437
|
operation: "sendEvmTransaction";
|
|
@@ -1298,6 +1555,67 @@ export declare const UpdatePolicyBodySchema: z.ZodObject<{
|
|
|
1298
1555
|
operator: "in" | "not in";
|
|
1299
1556
|
addresses: string[];
|
|
1300
1557
|
})[];
|
|
1558
|
+
}>, z.ZodObject<{
|
|
1559
|
+
/**
|
|
1560
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
1561
|
+
* "accept" will allow the signing, "reject" will block it.
|
|
1562
|
+
*/
|
|
1563
|
+
action: z.ZodEnum<["reject", "accept"]>;
|
|
1564
|
+
/**
|
|
1565
|
+
* The operation to which this rule applies.
|
|
1566
|
+
* Must be "signEvmHash".
|
|
1567
|
+
*/
|
|
1568
|
+
operation: z.ZodLiteral<"signEvmHash">;
|
|
1569
|
+
}, "strip", z.ZodTypeAny, {
|
|
1570
|
+
action: "reject" | "accept";
|
|
1571
|
+
operation: "signEvmHash";
|
|
1572
|
+
}, {
|
|
1573
|
+
action: "reject" | "accept";
|
|
1574
|
+
operation: "signEvmHash";
|
|
1575
|
+
}>, z.ZodObject<{
|
|
1576
|
+
/**
|
|
1577
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
1578
|
+
* "accept" will allow the signing, "reject" will block it.
|
|
1579
|
+
*/
|
|
1580
|
+
action: z.ZodEnum<["reject", "accept"]>;
|
|
1581
|
+
/**
|
|
1582
|
+
* The operation to which this rule applies.
|
|
1583
|
+
* Must be "signEvmMessage".
|
|
1584
|
+
*/
|
|
1585
|
+
operation: z.ZodLiteral<"signEvmMessage">;
|
|
1586
|
+
/**
|
|
1587
|
+
* The set of criteria that must be matched for this rule to apply.
|
|
1588
|
+
* Must be compatible with the specified operation type.
|
|
1589
|
+
*/
|
|
1590
|
+
criteria: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1591
|
+
/** The type of criterion, must be "evmMessage" for EVM message-based rules. */
|
|
1592
|
+
type: z.ZodLiteral<"evmMessage">;
|
|
1593
|
+
/**
|
|
1594
|
+
* A regular expression the message is matched against.
|
|
1595
|
+
* Accepts valid regular expression syntax described by [RE2](https://github.com/google/re2/wiki/Syntax).
|
|
1596
|
+
*/
|
|
1597
|
+
match: z.ZodString;
|
|
1598
|
+
}, "strip", z.ZodTypeAny, {
|
|
1599
|
+
type: "evmMessage";
|
|
1600
|
+
match: string;
|
|
1601
|
+
}, {
|
|
1602
|
+
type: "evmMessage";
|
|
1603
|
+
match: string;
|
|
1604
|
+
}>]>, "many">;
|
|
1605
|
+
}, "strip", z.ZodTypeAny, {
|
|
1606
|
+
action: "reject" | "accept";
|
|
1607
|
+
operation: "signEvmMessage";
|
|
1608
|
+
criteria: {
|
|
1609
|
+
type: "evmMessage";
|
|
1610
|
+
match: string;
|
|
1611
|
+
}[];
|
|
1612
|
+
}, {
|
|
1613
|
+
action: "reject" | "accept";
|
|
1614
|
+
operation: "signEvmMessage";
|
|
1615
|
+
criteria: {
|
|
1616
|
+
type: "evmMessage";
|
|
1617
|
+
match: string;
|
|
1618
|
+
}[];
|
|
1301
1619
|
}>, z.ZodObject<{
|
|
1302
1620
|
/**
|
|
1303
1621
|
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
@@ -1477,6 +1795,16 @@ export declare const UpdatePolicyBodySchema: z.ZodObject<{
|
|
|
1477
1795
|
operator: "in" | "not in";
|
|
1478
1796
|
addresses: `0x${string}`[];
|
|
1479
1797
|
})[];
|
|
1798
|
+
} | {
|
|
1799
|
+
action: "reject" | "accept";
|
|
1800
|
+
operation: "signEvmHash";
|
|
1801
|
+
} | {
|
|
1802
|
+
action: "reject" | "accept";
|
|
1803
|
+
operation: "signEvmMessage";
|
|
1804
|
+
criteria: {
|
|
1805
|
+
type: "evmMessage";
|
|
1806
|
+
match: string;
|
|
1807
|
+
}[];
|
|
1480
1808
|
} | {
|
|
1481
1809
|
action: "reject" | "accept";
|
|
1482
1810
|
operation: "sendEvmTransaction";
|
|
@@ -1516,6 +1844,16 @@ export declare const UpdatePolicyBodySchema: z.ZodObject<{
|
|
|
1516
1844
|
operator: "in" | "not in";
|
|
1517
1845
|
addresses: string[];
|
|
1518
1846
|
})[];
|
|
1847
|
+
} | {
|
|
1848
|
+
action: "reject" | "accept";
|
|
1849
|
+
operation: "signEvmHash";
|
|
1850
|
+
} | {
|
|
1851
|
+
action: "reject" | "accept";
|
|
1852
|
+
operation: "signEvmMessage";
|
|
1853
|
+
criteria: {
|
|
1854
|
+
type: "evmMessage";
|
|
1855
|
+
match: string;
|
|
1856
|
+
}[];
|
|
1519
1857
|
} | {
|
|
1520
1858
|
action: "reject" | "accept";
|
|
1521
1859
|
operation: "sendEvmTransaction";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../policies/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,oBAAoB,yCAAuC,CAAC;AACzE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,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;;;WAGG;;QAEH;;;WAGG;;QAEH;;;WAGG;;YA3QH,gFAAgF;;YAEhF;;;eAGG;;YAEH,8FAA8F;;;;;;;;;;;YAS9F,+EAA+E;;YAE/E;;;;eAIG;;YAEH;;;;eAIG;;;;;;;;;;;YAkBH,+EAA+E;;YAE/E;;;eAGG;;YAEH;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA4NH;;;WAGG;;QAEH;;;WAGG;;QAEH;;;WAGG;;YAlNH,kFAAkF;;YAElF;;;eAGG;;YAEH;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkRH,CAAC;AACH;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
package/_types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.
|
|
1
|
+
export declare const version = "1.13.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -20,6 +20,8 @@ import {
|
|
|
20
20
|
type RequestFaucetResult,
|
|
21
21
|
} from "../../actions/evm/requestFaucet.js";
|
|
22
22
|
import { sendTransaction } from "../../actions/evm/sendTransaction.js";
|
|
23
|
+
import { createSwapQuote } from "../../actions/evm/swap/createSwapQuote.js";
|
|
24
|
+
import { sendSwapTransaction } from "../../actions/evm/swap/sendSwapTransaction.js";
|
|
23
25
|
import { accountTransferStrategy } from "../../actions/evm/transfer/accountTransferStrategy.js";
|
|
24
26
|
import { transfer } from "../../actions/evm/transfer/transfer.js";
|
|
25
27
|
|
|
@@ -28,6 +30,12 @@ import type {
|
|
|
28
30
|
SendTransactionOptions,
|
|
29
31
|
TransactionResult,
|
|
30
32
|
} from "../../actions/evm/sendTransaction.js";
|
|
33
|
+
import type {
|
|
34
|
+
SwapOptions,
|
|
35
|
+
SwapResult,
|
|
36
|
+
QuoteSwapOptions,
|
|
37
|
+
QuoteSwapResult,
|
|
38
|
+
} from "../../actions/evm/swap/types.js";
|
|
31
39
|
import type { CdpOpenApiClientType, EvmAccount } from "../../openapi-client/index.js";
|
|
32
40
|
import type { Address, EIP712Message, Hash, Hex } from "../../types/misc.js";
|
|
33
41
|
|
|
@@ -121,6 +129,19 @@ export function toEvmServerAccount(
|
|
|
121
129
|
): Promise<WaitForFundOperationResult> {
|
|
122
130
|
return waitForFundOperationReceipt(apiClient, options);
|
|
123
131
|
},
|
|
132
|
+
async quoteSwap(options: QuoteSwapOptions): Promise<QuoteSwapResult> {
|
|
133
|
+
return createSwapQuote(apiClient, {
|
|
134
|
+
...options,
|
|
135
|
+
taker: this.address,
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
async swap(options: SwapOptions): Promise<SwapResult> {
|
|
139
|
+
return sendSwapTransaction(apiClient, {
|
|
140
|
+
...options,
|
|
141
|
+
address: this.address,
|
|
142
|
+
taker: this.address, // Always use account's address as taker
|
|
143
|
+
});
|
|
144
|
+
},
|
|
124
145
|
name: options.account.name,
|
|
125
146
|
type: "evm-server",
|
|
126
147
|
policies: options.account.policies,
|