@coinbase/cdp-sdk 1.17.0 → 1.18.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 +6 -0
- package/_cjs/accounts/evm/resolveViemClients.js +204 -0
- package/_cjs/accounts/evm/resolveViemClients.js.map +1 -0
- package/_cjs/accounts/evm/toEvmServerAccount.js +1 -1
- package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js +32 -1
- package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/accounts/evm/resolveViemClients.js +168 -0
- package/_esm/accounts/evm/resolveViemClients.js.map +1 -0
- package/_esm/accounts/evm/toEvmServerAccount.js +1 -1
- package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js +32 -1
- package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/accounts/evm/resolveViemClients.d.ts +47 -0
- package/_types/accounts/evm/resolveViemClients.d.ts.map +1 -0
- package/_types/accounts/evm/toNetworkScopedEvmServerAccount.d.ts +1 -1
- package/_types/accounts/evm/toNetworkScopedEvmServerAccount.d.ts.map +1 -1
- package/_types/accounts/evm/types.d.ts +11 -4
- package/_types/accounts/evm/types.d.ts.map +1 -1
- package/_types/policies/schema.d.ts +96 -96
- package/_types/version.d.ts +1 -1
- package/accounts/evm/resolveViemClients.ts +215 -0
- package/accounts/evm/toEvmServerAccount.ts +1 -1
- package/accounts/evm/toNetworkScopedEvmServerAccount.ts +43 -3
- package/accounts/evm/types.ts +24 -6
- package/package.json +1 -1
- package/version.ts +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { RequestFaucetOptions, RequestFaucetResult } from "../../actions/evm/requestFaucet.js";
|
|
2
|
+
import { TransactionResult, SendTransactionOptions } from "../../actions/evm/sendTransaction.js";
|
|
1
3
|
import type { AccountActions, SmartAccountActions } from "../../actions/evm/types.js";
|
|
2
4
|
import type { Address, Hash, Hex } from "../../types/misc.js";
|
|
3
5
|
import type { Prettify } from "../../types/utils.js";
|
|
4
|
-
import type { SignableMessage, TransactionSerializable, TypedData, TypedDataDefinition } from "viem";
|
|
6
|
+
import type { SignableMessage, TransactionReceipt, TransactionSerializable, TypedData, TypedDataDefinition, WaitForTransactionReceiptParameters } from "viem";
|
|
5
7
|
/**
|
|
6
8
|
* Base type for any Ethereum account with signing capabilities.
|
|
7
9
|
* For example, this could be an EVM ServerAccount, or a viem LocalAccount.
|
|
@@ -32,8 +34,8 @@ export type EvmServerAccount = Prettify<EvmAccount & AccountActions & {
|
|
|
32
34
|
name?: string;
|
|
33
35
|
/** Indicates this is a server-managed account. */
|
|
34
36
|
type: "evm-server";
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
+
/** A function that returns a network-scoped server-managed account. */
|
|
38
|
+
useNetwork: (network: string) => Promise<NetworkScopedEvmServerAccount>;
|
|
37
39
|
}>;
|
|
38
40
|
type EvmSmartAccountProperties = {
|
|
39
41
|
/** The smart account's address. */
|
|
@@ -55,10 +57,15 @@ export type NetworkScopedEvmSmartAccount = Prettify<Omit<EvmSmartAccountProperti
|
|
|
55
57
|
/** The network to scope the smart account object to. */
|
|
56
58
|
network: string;
|
|
57
59
|
}>;
|
|
60
|
+
type NetworkScopedAccountActions = Prettify<{
|
|
61
|
+
requestFaucet: (options: Omit<RequestFaucetOptions, "address" | "network">) => Promise<RequestFaucetResult>;
|
|
62
|
+
sendTransaction: (options: Omit<SendTransactionOptions, "address" | "network">) => Promise<TransactionResult>;
|
|
63
|
+
waitForTransactionReceipt: (options: WaitForTransactionReceiptParameters) => Promise<TransactionReceipt>;
|
|
64
|
+
}>;
|
|
58
65
|
/**
|
|
59
66
|
* A network-scoped server-managed ethereum account
|
|
60
67
|
*/
|
|
61
|
-
export type NetworkScopedEvmServerAccount = Prettify<Omit<EvmServerAccount, keyof AccountActions | "
|
|
68
|
+
export type NetworkScopedEvmServerAccount = Prettify<Omit<EvmServerAccount, keyof AccountActions | "useNetwork"> & NetworkScopedAccountActions & {
|
|
62
69
|
/** The network this account is scoped to */
|
|
63
70
|
network: string;
|
|
64
71
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../accounts/evm/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EACV,eAAe,EACf,uBAAuB,EACvB,SAAS,EACT,mBAAmB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../accounts/evm/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEjG,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,SAAS,EACT,mBAAmB,EACnB,mCAAmC,EACpC,MAAM,MAAM,CAAC;AAEd;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,iCAAiC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,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