permissionless 0.3.4 → 0.3.6
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 +12 -0
- package/_cjs/accounts/biconomy/index.js +8 -0
- package/_cjs/accounts/biconomy/index.js.map +1 -0
- package/_cjs/accounts/etherspot/index.js +8 -0
- package/_cjs/accounts/etherspot/index.js.map +1 -0
- package/_cjs/accounts/kernel/index.js +18 -0
- package/_cjs/accounts/kernel/index.js.map +1 -0
- package/_cjs/accounts/kernel/toKernelSmartAccount.js +6 -6
- package/_cjs/accounts/kernel/toKernelSmartAccount.js.map +1 -1
- package/_cjs/accounts/kernel/utils/signMessage.js +9 -7
- package/_cjs/accounts/kernel/utils/signMessage.js.map +1 -1
- package/_cjs/accounts/kernel/utils/signTypedData.js +7 -6
- package/_cjs/accounts/kernel/utils/signTypedData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/wrapMessageHash.js +3 -3
- package/_cjs/accounts/kernel/utils/wrapMessageHash.js.map +1 -1
- package/_cjs/accounts/light/index.js +8 -0
- package/_cjs/accounts/light/index.js.map +1 -0
- package/_cjs/accounts/nexus/index.js +8 -0
- package/_cjs/accounts/nexus/index.js.map +1 -0
- package/_cjs/accounts/safe/toSafeSmartAccount.js +24 -4
- package/_cjs/accounts/safe/toSafeSmartAccount.js.map +1 -1
- package/_cjs/accounts/simple/index.js +10 -0
- package/_cjs/accounts/simple/index.js.map +1 -0
- package/_cjs/accounts/thirdweb/index.js +8 -0
- package/_cjs/accounts/thirdweb/index.js.map +1 -0
- package/_cjs/accounts/trust/index.js +8 -0
- package/_cjs/accounts/trust/index.js.map +1 -0
- package/_esm/accounts/biconomy/index.js +5 -0
- package/_esm/accounts/biconomy/index.js.map +1 -0
- package/_esm/accounts/etherspot/index.js +5 -0
- package/_esm/accounts/etherspot/index.js.map +1 -0
- package/_esm/accounts/kernel/index.js +15 -0
- package/_esm/accounts/kernel/index.js.map +1 -0
- package/_esm/accounts/kernel/toKernelSmartAccount.js +6 -6
- package/_esm/accounts/kernel/toKernelSmartAccount.js.map +1 -1
- package/_esm/accounts/kernel/utils/signMessage.js +9 -7
- package/_esm/accounts/kernel/utils/signMessage.js.map +1 -1
- package/_esm/accounts/kernel/utils/signTypedData.js +7 -6
- package/_esm/accounts/kernel/utils/signTypedData.js.map +1 -1
- package/_esm/accounts/kernel/utils/wrapMessageHash.js +3 -3
- package/_esm/accounts/kernel/utils/wrapMessageHash.js.map +1 -1
- package/_esm/accounts/light/index.js +5 -0
- package/_esm/accounts/light/index.js.map +1 -0
- package/_esm/accounts/nexus/index.js +5 -0
- package/_esm/accounts/nexus/index.js.map +1 -0
- package/_esm/accounts/safe/toSafeSmartAccount.js +24 -4
- package/_esm/accounts/safe/toSafeSmartAccount.js.map +1 -1
- package/_esm/accounts/simple/index.js +7 -0
- package/_esm/accounts/simple/index.js.map +1 -0
- package/_esm/accounts/thirdweb/index.js +5 -0
- package/_esm/accounts/thirdweb/index.js.map +1 -0
- package/_esm/accounts/trust/index.js +5 -0
- package/_esm/accounts/trust/index.js.map +1 -0
- package/_types/accounts/biconomy/index.d.ts +6 -0
- package/_types/accounts/biconomy/index.d.ts.map +1 -0
- package/_types/accounts/etherspot/index.d.ts +6 -0
- package/_types/accounts/etherspot/index.d.ts.map +1 -0
- package/_types/accounts/kernel/index.d.ts +22 -0
- package/_types/accounts/kernel/index.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/signMessage.d.ts +4 -5
- package/_types/accounts/kernel/utils/signMessage.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/signTypedData.d.ts +4 -4
- package/_types/accounts/kernel/utils/signTypedData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/wrapMessageHash.d.ts +8 -3
- package/_types/accounts/kernel/utils/wrapMessageHash.d.ts.map +1 -1
- package/_types/accounts/light/index.d.ts +6 -0
- package/_types/accounts/light/index.d.ts.map +1 -0
- package/_types/accounts/nexus/index.d.ts +6 -0
- package/_types/accounts/nexus/index.d.ts.map +1 -0
- package/_types/accounts/safe/toSafeSmartAccount.d.ts +9 -0
- package/_types/accounts/safe/toSafeSmartAccount.d.ts.map +1 -1
- package/_types/accounts/simple/index.d.ts +9 -0
- package/_types/accounts/simple/index.d.ts.map +1 -0
- package/_types/accounts/thirdweb/index.d.ts +6 -0
- package/_types/accounts/thirdweb/index.d.ts.map +1 -0
- package/_types/accounts/trust/index.d.ts +6 -0
- package/_types/accounts/trust/index.d.ts.map +1 -0
- package/accounts/biconomy/index.ts +11 -0
- package/accounts/etherspot/index.ts +11 -0
- package/accounts/kernel/index.ts +33 -0
- package/accounts/kernel/toKernelSmartAccount.ts +6 -6
- package/accounts/kernel/utils/signMessage.ts +19 -15
- package/accounts/kernel/utils/signTypedData.ts +14 -11
- package/accounts/kernel/utils/wrapMessageHash.ts +11 -8
- package/accounts/light/index.ts +12 -0
- package/accounts/nexus/index.ts +11 -0
- package/accounts/safe/toSafeSmartAccount.ts +38 -1
- package/accounts/simple/index.ts +18 -0
- package/accounts/thirdweb/index.ts +11 -0
- package/accounts/trust/index.ts +11 -0
- package/actions/erc7579/installModule.test.ts +4 -6
- package/actions/erc7579/installModules.test.ts +4 -6
- package/actions/erc7579/uninstallModule.test.ts +2 -3
- package/actions/pimlico/getUserOperationStatus.test.ts +40 -16
- package/actions/smartAccount/getCallsStatus.test.ts +2 -4
- package/actions/smartAccount/sendCalls.test.ts +2 -4
- package/actions/smartAccount/sendTransaction.test.ts +2 -4
- package/actions/smartAccount/signMessage.test.ts +2 -4
- package/actions/smartAccount/signTypedData.test.ts +2 -4
- package/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.test.ts +76 -25
- package/package.json +41 -1
- package/vitest.config.ts +11 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { to7702KernelSmartAccount } from "./to7702KernelSmartAccount.js";
|
|
2
|
+
import { toKernelSmartAccount } from "./toKernelSmartAccount.js";
|
|
3
|
+
import { signMessage } from "./utils/signMessage.js";
|
|
4
|
+
import { signTypedData } from "./utils/signTypedData.js";
|
|
5
|
+
export declare const KernelSmartAccount: {
|
|
6
|
+
toKernelSmartAccount: typeof toKernelSmartAccount;
|
|
7
|
+
to7702KernelSmartAccount: typeof to7702KernelSmartAccount;
|
|
8
|
+
wrapMessageHash: ({ hash, address: accountAddress, version: kernelVersion, chainId }: {
|
|
9
|
+
version: import("./toKernelSmartAccount.js").KernelVersion<"0.6" | "0.7">;
|
|
10
|
+
address: `0x${string}`;
|
|
11
|
+
chainId: number;
|
|
12
|
+
hash: `0x${string}`;
|
|
13
|
+
}) => `0x${string}`;
|
|
14
|
+
signMessage: typeof signMessage;
|
|
15
|
+
signTypedData: typeof signTypedData;
|
|
16
|
+
isKernelV2: (version: import("./toKernelSmartAccount.js").KernelVersion<"0.6" | "0.7">) => boolean;
|
|
17
|
+
};
|
|
18
|
+
export type { KernelSmartAccountImplementation, KernelVersion, ToKernelSmartAccountParameters, ToKernelSmartAccountReturnType } from "./toKernelSmartAccount.js";
|
|
19
|
+
export type { EcdsaKernelSmartAccountImplementation, ToEcdsaKernelSmartAccountParameters, ToEcdsaKernelSmartAccountReturnType } from "./toEcdsaKernelSmartAccount.js";
|
|
20
|
+
export type { To7702KernelSmartAccountImplementation, To7702KernelSmartAccountParameters, To7702KernelSmartAccountReturnType } from "./to7702KernelSmartAccount.js";
|
|
21
|
+
export type { WrapMessageHashParams } from "./utils/wrapMessageHash.js";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/kernel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAGxD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;CAO9B,CAAA;AAED,YAAY,EACR,gCAAgC,EAChC,aAAa,EACb,8BAA8B,EAC9B,8BAA8B,EACjC,MAAM,2BAA2B,CAAA;AAClC,YAAY,EACR,qCAAqC,EACrC,mCAAmC,EACnC,mCAAmC,EACtC,MAAM,gCAAgC,CAAA;AACvC,YAAY,EACR,sCAAsC,EACtC,kCAAkC,EAClC,kCAAkC,EACrC,MAAM,+BAA+B,CAAA;AACtC,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { type LocalAccount, type SignMessageReturnType, type SignableMessage } from "viem";
|
|
1
|
+
import { type LocalAccount, type Prettify, type SignMessageReturnType, type SignableMessage } from "viem";
|
|
2
2
|
import type { WebAuthnAccount } from "viem/account-abstraction";
|
|
3
3
|
import { type WrapMessageHashParams } from "./wrapMessageHash.js";
|
|
4
|
-
export declare function signMessage({ message, owner, accountAddress,
|
|
5
|
-
chainId: number;
|
|
4
|
+
export declare function signMessage({ message, owner, address: accountAddress, version: accountVersion, chainId, eip7702 }: Prettify<{
|
|
6
5
|
message: SignableMessage;
|
|
7
6
|
owner: LocalAccount | WebAuthnAccount;
|
|
8
|
-
eip7702
|
|
9
|
-
} & WrapMessageHashParams): Promise<SignMessageReturnType>;
|
|
7
|
+
eip7702?: boolean;
|
|
8
|
+
} & WrapMessageHashParams>): Promise<SignMessageReturnType>;
|
|
10
9
|
//# sourceMappingURL=signMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signMessage.d.ts","sourceRoot":"","sources":["../../../../accounts/kernel/utils/signMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EAGvB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAI/D,OAAO,EACH,KAAK,qBAAqB,EAE7B,MAAM,sBAAsB,CAAA;AAE7B,wBAAsB,WAAW,CAAC,EAC9B,OAAO,EACP,KAAK,EACL,cAAc,
|
|
1
|
+
{"version":3,"file":"signMessage.d.ts","sourceRoot":"","sources":["../../../../accounts/kernel/utils/signMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EAGvB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAI/D,OAAO,EACH,KAAK,qBAAqB,EAE7B,MAAM,sBAAsB,CAAA;AAE7B,wBAAsB,WAAW,CAAC,EAC9B,OAAO,EACP,KAAK,EACL,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,cAAc,EACvB,OAAO,EACP,OAAe,EAClB,EAAE,QAAQ,CACP;IACI,OAAO,EAAE,eAAe,CAAA;IACxB,KAAK,EAAE,YAAY,GAAG,eAAe,CAAA;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,qBAAqB,CAC5B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuFjC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type LocalAccount, type SignTypedDataReturnType, type TypedDataDefinition } from "viem";
|
|
1
|
+
import { type LocalAccount, type Prettify, type SignTypedDataReturnType, type TypedDataDefinition } from "viem";
|
|
2
2
|
import type { WebAuthnAccount } from "viem/account-abstraction";
|
|
3
3
|
import { type WrapMessageHashParams } from "./wrapMessageHash.js";
|
|
4
|
-
export declare function signTypedData(parameters:
|
|
4
|
+
export declare function signTypedData(parameters: Prettify<WrapMessageHashParams & {
|
|
5
5
|
owner: LocalAccount | WebAuthnAccount;
|
|
6
|
-
eip7702
|
|
7
|
-
}): Promise<SignTypedDataReturnType>;
|
|
6
|
+
eip7702?: boolean;
|
|
7
|
+
} & TypedDataDefinition>): Promise<SignTypedDataReturnType>;
|
|
8
8
|
//# sourceMappingURL=signTypedData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signTypedData.d.ts","sourceRoot":"","sources":["../../../../accounts/kernel/utils/signTypedData.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EAI3B,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAG/D,OAAO,EACH,KAAK,qBAAqB,EAE7B,MAAM,sBAAsB,CAAA;AAE7B,wBAAsB,aAAa,CAC/B,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"signTypedData.d.ts","sourceRoot":"","sources":["../../../../accounts/kernel/utils/signTypedData.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EAI3B,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAG/D,OAAO,EACH,KAAK,qBAAqB,EAE7B,MAAM,sBAAsB,CAAA;AAE7B,wBAAsB,aAAa,CAC/B,UAAU,EAAE,QAAQ,CAChB,qBAAqB,GAAG;IACpB,KAAK,EAAE,YAAY,GAAG,eAAe,CAAA;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,mBAAmB,CAC1B,GACF,OAAO,CAAC,uBAAuB,CAAC,CA2ElC"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
2
|
import type { KernelVersion } from "../toKernelSmartAccount.js";
|
|
3
3
|
export type WrapMessageHashParams = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
version: KernelVersion<"0.6" | "0.7">;
|
|
5
|
+
address: Address;
|
|
6
6
|
chainId: number;
|
|
7
7
|
};
|
|
8
|
-
export declare const wrapMessageHash: (
|
|
8
|
+
export declare const wrapMessageHash: ({ hash, address: accountAddress, version: kernelVersion, chainId }: {
|
|
9
|
+
version: KernelVersion<"0.6" | "0.7">;
|
|
10
|
+
address: `0x${string}`;
|
|
11
|
+
chainId: number;
|
|
12
|
+
hash: `0x${string}`;
|
|
13
|
+
}) => `0x${string}`;
|
|
9
14
|
//# sourceMappingURL=wrapMessageHash.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapMessageHash.d.ts","sourceRoot":"","sources":["../../../../accounts/kernel/utils/wrapMessageHash.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"wrapMessageHash.d.ts","sourceRoot":"","sources":["../../../../accounts/kernel/utils/wrapMessageHash.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EAQf,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAG/D,MAAM,MAAM,qBAAqB,GAAG;IAChC,OAAO,EAAE,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,CAAA;IACrC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,eAAe;;;;;mBA2B3B,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { toLightSmartAccount } from "./toLightSmartAccount.js";
|
|
2
|
+
export declare const LightSmartAccount: {
|
|
3
|
+
toLightSmartAccount: typeof toLightSmartAccount;
|
|
4
|
+
};
|
|
5
|
+
export type { LightAccountVersion, LightSmartAccountImplementation, ToLightSmartAccountParameters, ToLightSmartAccountReturnType } from "./toLightSmartAccount.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/light/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,eAAO,MAAM,iBAAiB;;CAE7B,CAAA;AAED,YAAY,EACR,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,EAC7B,6BAA6B,EAChC,MAAM,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { toNexusSmartAccount } from "./toNexusSmartAccount.js";
|
|
2
|
+
export declare const NexusSmartAccount: {
|
|
3
|
+
toNexusSmartAccount: typeof toNexusSmartAccount;
|
|
4
|
+
};
|
|
5
|
+
export type { NexusSmartAccountImplementation, ToNexusSmartAccountParameters, ToNexusSmartAccountReturnType } from "./toNexusSmartAccount.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/nexus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,eAAO,MAAM,iBAAiB;;CAE7B,CAAA;AAED,YAAY,EACR,+BAA+B,EAC/B,6BAA6B,EAC7B,6BAA6B,EAChC,MAAM,0BAA0B,CAAA"}
|
|
@@ -93,6 +93,15 @@ export type ToSafeSmartAccountParameters<entryPointVersion extends "0.6" | "0.7"
|
|
|
93
93
|
payment?: bigint;
|
|
94
94
|
paymentReceiver?: Address;
|
|
95
95
|
onchainIdentifier?: Hex;
|
|
96
|
+
/**
|
|
97
|
+
* When true (default), the Safe setup always routes through MultiSend,
|
|
98
|
+
* even for a single setup transaction. When false, a single setup
|
|
99
|
+
* transaction (e.g. just enableModules) is called directly without
|
|
100
|
+
* MultiSend wrapping. This produces a different counterfactual address
|
|
101
|
+
* and is compatible with Safe Protocol Kit / relay-kit address derivation.
|
|
102
|
+
* @default true
|
|
103
|
+
*/
|
|
104
|
+
useMultiSendForSetup?: boolean;
|
|
96
105
|
} & GetErc7579Params<TErc7579>;
|
|
97
106
|
export type SafeSmartAccountImplementation<entryPointVersion extends "0.6" | "0.7" = "0.7"> = Assign<SmartAccountImplementation<entryPointVersion extends "0.6" ? typeof entryPoint06Abi : typeof entryPoint07Abi, entryPointVersion>, {
|
|
98
107
|
sign: NonNullable<SmartAccountImplementation["sign"]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toSafeSmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/safe/toSafeSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,cAAc,EACnB,KAAK,YAAY,EAGjB,KAAK,SAAS,EAGd,KAAK,YAAY,EAkBpB,MAAM,MAAM,CAAA;AACb,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,eAAe,EACf,eAAe,EAGlB,MAAM,0BAA0B,CAAA;AAQjC,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,wBAAwB,CAAA;AAOvE,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,OAAO,CAAA;AAkW3C,eAAO,MAAM,8BAA8B;;;;;CAgB1C,CAAA;AAED,eAAO,MAAM,8BAA8B;;;;;CAgB1C,CAAA;AAmPD,eAAO,MAAM,iBAAiB,qEAI7B,CAAA;
|
|
1
|
+
{"version":3,"file":"toSafeSmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/safe/toSafeSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,cAAc,EACnB,KAAK,YAAY,EAGjB,KAAK,SAAS,EAGd,KAAK,YAAY,EAk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AAiB,SAAS,KAAK,GAAG,KAAK,EACvC,QAAQ,SAAS,OAAO,GAAG,SAAS,EAEpC,UAAU,EAAE,4BAA4B,CAAC,iBAAiB,EAAE,QAAQ,CAAC,GACtE,OAAO,CAAC,4BAA4B,CAAC,iBAAiB,CAAC,CAAC,CA0nB1D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { to7702SimpleSmartAccount } from "./to7702SimpleSmartAccount.js";
|
|
2
|
+
import { toSimpleSmartAccount } from "./toSimpleSmartAccount.js";
|
|
3
|
+
export declare const SimpleSmartAccount: {
|
|
4
|
+
toSimpleSmartAccount: typeof toSimpleSmartAccount;
|
|
5
|
+
to7702SimpleSmartAccount: typeof to7702SimpleSmartAccount;
|
|
6
|
+
};
|
|
7
|
+
export type { SimpleSmartAccountImplementation, ToSimpleSmartAccountParameters, ToSimpleSmartAccountReturnType } from "./toSimpleSmartAccount.js";
|
|
8
|
+
export type { To7702SimpleSmartAccountImplementation, To7702SimpleSmartAccountParameters, To7702SimpleSmartAccountReturnType } from "./to7702SimpleSmartAccount.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/simple/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhE,eAAO,MAAM,kBAAkB;;;CAG9B,CAAA;AAED,YAAY,EACR,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,EACjC,MAAM,2BAA2B,CAAA;AAClC,YAAY,EACR,sCAAsC,EACtC,kCAAkC,EAClC,kCAAkC,EACrC,MAAM,+BAA+B,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { toThirdwebSmartAccount } from "./toThirdwebSmartAccount.js";
|
|
2
|
+
export declare const ThirdwebSmartAccount: {
|
|
3
|
+
toThirdwebSmartAccount: typeof toThirdwebSmartAccount;
|
|
4
|
+
};
|
|
5
|
+
export type { ThirdwebSmartAccountImplementation, ToThirdwebSmartAccountParameters, ToThirdwebSmartAccountReturnType } from "./toThirdwebSmartAccount.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/thirdweb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE,eAAO,MAAM,oBAAoB;;CAEhC,CAAA;AAED,YAAY,EACR,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EACnC,MAAM,6BAA6B,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { toTrustSmartAccount } from "./toTrustSmartAccount.js";
|
|
2
|
+
export declare const TrustSmartAccount: {
|
|
3
|
+
toTrustSmartAccount: typeof toTrustSmartAccount;
|
|
4
|
+
};
|
|
5
|
+
export type { ToTrustSmartAccountParameters, ToTrustSmartAccountReturnType, TrustSmartAccountImplementation } from "./toTrustSmartAccount.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/trust/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,eAAO,MAAM,iBAAiB;;CAE7B,CAAA;AAED,YAAY,EACR,6BAA6B,EAC7B,6BAA6B,EAC7B,+BAA+B,EAClC,MAAM,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { toBiconomySmartAccount } from "./toBiconomySmartAccount.js"
|
|
2
|
+
|
|
3
|
+
export const BiconomySmartAccount = {
|
|
4
|
+
toBiconomySmartAccount
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type {
|
|
8
|
+
BiconomySmartAccountImplementation,
|
|
9
|
+
ToBiconomySmartAccountParameters,
|
|
10
|
+
ToBiconomySmartAccountReturnType
|
|
11
|
+
} from "./toBiconomySmartAccount.js"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { toEtherspotSmartAccount } from "./toEtherspotSmartAccount.js"
|
|
2
|
+
|
|
3
|
+
export const EtherspotSmartAccount = {
|
|
4
|
+
toEtherspotSmartAccount
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type {
|
|
8
|
+
EtherspotSmartAccountImplementation,
|
|
9
|
+
ToEtherspotSmartAccountParameters,
|
|
10
|
+
ToEtherspotSmartAccountReturnType
|
|
11
|
+
} from "./toEtherspotSmartAccount.js"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { to7702KernelSmartAccount } from "./to7702KernelSmartAccount.js"
|
|
2
|
+
import { toKernelSmartAccount } from "./toKernelSmartAccount.js"
|
|
3
|
+
import { isKernelV2 } from "./utils/isKernelV2.js"
|
|
4
|
+
import { signMessage } from "./utils/signMessage.js"
|
|
5
|
+
import { signTypedData } from "./utils/signTypedData.js"
|
|
6
|
+
import { wrapMessageHash } from "./utils/wrapMessageHash.js"
|
|
7
|
+
|
|
8
|
+
export const KernelSmartAccount = {
|
|
9
|
+
toKernelSmartAccount,
|
|
10
|
+
to7702KernelSmartAccount,
|
|
11
|
+
wrapMessageHash,
|
|
12
|
+
signMessage,
|
|
13
|
+
signTypedData,
|
|
14
|
+
isKernelV2
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type {
|
|
18
|
+
KernelSmartAccountImplementation,
|
|
19
|
+
KernelVersion,
|
|
20
|
+
ToKernelSmartAccountParameters,
|
|
21
|
+
ToKernelSmartAccountReturnType
|
|
22
|
+
} from "./toKernelSmartAccount.js"
|
|
23
|
+
export type {
|
|
24
|
+
EcdsaKernelSmartAccountImplementation,
|
|
25
|
+
ToEcdsaKernelSmartAccountParameters,
|
|
26
|
+
ToEcdsaKernelSmartAccountReturnType
|
|
27
|
+
} from "./toEcdsaKernelSmartAccount.js"
|
|
28
|
+
export type {
|
|
29
|
+
To7702KernelSmartAccountImplementation,
|
|
30
|
+
To7702KernelSmartAccountParameters,
|
|
31
|
+
To7702KernelSmartAccountReturnType
|
|
32
|
+
} from "./to7702KernelSmartAccount.js"
|
|
33
|
+
export type { WrapMessageHashParams } from "./utils/wrapMessageHash.js"
|
|
@@ -901,8 +901,8 @@ export async function toKernelSmartAccount<
|
|
|
901
901
|
const signature = await signMessage({
|
|
902
902
|
owner,
|
|
903
903
|
message,
|
|
904
|
-
|
|
905
|
-
|
|
904
|
+
address: await this.getAddress(),
|
|
905
|
+
version: kernelVersion,
|
|
906
906
|
chainId: await getMemoizedChainId(),
|
|
907
907
|
eip7702: eip7702
|
|
908
908
|
})
|
|
@@ -931,8 +931,8 @@ export async function toKernelSmartAccount<
|
|
|
931
931
|
owner: owner,
|
|
932
932
|
chainId: await getMemoizedChainId(),
|
|
933
933
|
...(typedData as TypedDataDefinition),
|
|
934
|
-
|
|
935
|
-
|
|
934
|
+
address: await this.getAddress(),
|
|
935
|
+
version: kernelVersion,
|
|
936
936
|
eip7702
|
|
937
937
|
})
|
|
938
938
|
|
|
@@ -966,8 +966,8 @@ export async function toKernelSmartAccount<
|
|
|
966
966
|
owner,
|
|
967
967
|
message: { raw: hash },
|
|
968
968
|
chainId,
|
|
969
|
-
|
|
970
|
-
kernelVersion,
|
|
969
|
+
address: await this.getAddress(),
|
|
970
|
+
version: kernelVersion,
|
|
971
971
|
eip7702: false
|
|
972
972
|
})
|
|
973
973
|
: await owner.signMessage({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type Hash,
|
|
3
3
|
type LocalAccount,
|
|
4
|
+
type Prettify,
|
|
4
5
|
type SignMessageReturnType,
|
|
5
6
|
type SignableMessage,
|
|
6
7
|
encodeAbiParameters,
|
|
@@ -18,23 +19,25 @@ import {
|
|
|
18
19
|
export async function signMessage({
|
|
19
20
|
message,
|
|
20
21
|
owner,
|
|
21
|
-
accountAddress,
|
|
22
|
-
|
|
22
|
+
address: accountAddress,
|
|
23
|
+
version: accountVersion,
|
|
23
24
|
chainId,
|
|
24
|
-
eip7702
|
|
25
|
-
}:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} & WrapMessageHashParams
|
|
25
|
+
eip7702 = false
|
|
26
|
+
}: Prettify<
|
|
27
|
+
{
|
|
28
|
+
message: SignableMessage
|
|
29
|
+
owner: LocalAccount | WebAuthnAccount
|
|
30
|
+
eip7702?: boolean
|
|
31
|
+
} & WrapMessageHashParams
|
|
32
|
+
>): Promise<SignMessageReturnType> {
|
|
31
33
|
if (isWebAuthnAccount(owner)) {
|
|
32
34
|
let messageContent: string
|
|
33
35
|
if (typeof message === "string") {
|
|
34
36
|
// message is a string
|
|
35
|
-
messageContent = wrapMessageHash(
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
messageContent = wrapMessageHash({
|
|
38
|
+
hash: hashMessage(message),
|
|
39
|
+
version: accountVersion,
|
|
40
|
+
address: accountAddress,
|
|
38
41
|
chainId
|
|
39
42
|
// chainId: client.chain
|
|
40
43
|
// ? client.chain.id
|
|
@@ -100,9 +103,10 @@ export async function signMessage({
|
|
|
100
103
|
})
|
|
101
104
|
}
|
|
102
105
|
|
|
103
|
-
const wrappedMessageHash = wrapMessageHash(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
const wrappedMessageHash = wrapMessageHash({
|
|
107
|
+
hash: hashMessage(message),
|
|
108
|
+
version: accountVersion,
|
|
109
|
+
address: accountAddress,
|
|
106
110
|
chainId
|
|
107
111
|
// chainId: client.chain
|
|
108
112
|
// ? client.chain.id
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type LocalAccount,
|
|
3
|
+
type Prettify,
|
|
3
4
|
type SignTypedDataReturnType,
|
|
4
5
|
type TypedDataDefinition,
|
|
5
6
|
getTypesForEIP712Domain,
|
|
@@ -15,18 +16,19 @@ import {
|
|
|
15
16
|
} from "./wrapMessageHash.js"
|
|
16
17
|
|
|
17
18
|
export async function signTypedData(
|
|
18
|
-
parameters:
|
|
19
|
+
parameters: Prettify<
|
|
19
20
|
WrapMessageHashParams & {
|
|
20
21
|
owner: LocalAccount | WebAuthnAccount
|
|
21
|
-
eip7702
|
|
22
|
-
}
|
|
22
|
+
eip7702?: boolean
|
|
23
|
+
} & TypedDataDefinition
|
|
24
|
+
>
|
|
23
25
|
): Promise<SignTypedDataReturnType> {
|
|
24
26
|
const {
|
|
25
27
|
owner,
|
|
26
|
-
accountAddress,
|
|
27
|
-
|
|
28
|
+
address: accountAddress,
|
|
29
|
+
version: accountVersion,
|
|
28
30
|
chainId,
|
|
29
|
-
eip7702,
|
|
31
|
+
eip7702 = false,
|
|
30
32
|
...typedData
|
|
31
33
|
} = parameters
|
|
32
34
|
|
|
@@ -74,9 +76,10 @@ export async function signTypedData(
|
|
|
74
76
|
})
|
|
75
77
|
}
|
|
76
78
|
|
|
77
|
-
const wrappedMessageHash = wrapMessageHash(
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
const wrappedMessageHash = wrapMessageHash({
|
|
80
|
+
hash: typedHash,
|
|
81
|
+
version: accountVersion,
|
|
82
|
+
address: accountAddress,
|
|
80
83
|
chainId: chainId
|
|
81
84
|
})
|
|
82
85
|
|
|
@@ -84,8 +87,8 @@ export async function signTypedData(
|
|
|
84
87
|
return signMessage({
|
|
85
88
|
message: { raw: wrappedMessageHash },
|
|
86
89
|
owner,
|
|
87
|
-
accountAddress,
|
|
88
|
-
|
|
90
|
+
address: accountAddress,
|
|
91
|
+
version: accountVersion,
|
|
89
92
|
chainId,
|
|
90
93
|
eip7702: false
|
|
91
94
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type Address,
|
|
3
3
|
type Hex,
|
|
4
|
+
type Prettify,
|
|
4
5
|
concatHex,
|
|
5
6
|
domainSeparator,
|
|
6
7
|
encodeAbiParameters,
|
|
@@ -11,15 +12,17 @@ import type { KernelVersion } from "../toKernelSmartAccount.js"
|
|
|
11
12
|
import { isKernelV2 } from "./isKernelV2.js"
|
|
12
13
|
|
|
13
14
|
export type WrapMessageHashParams = {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
version: KernelVersion<"0.6" | "0.7">
|
|
16
|
+
address: Address
|
|
16
17
|
chainId: number
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
export const wrapMessageHash = (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
export const wrapMessageHash = ({
|
|
21
|
+
hash,
|
|
22
|
+
address: accountAddress,
|
|
23
|
+
version: kernelVersion,
|
|
24
|
+
chainId
|
|
25
|
+
}: Prettify<{ hash: Hex } & WrapMessageHashParams>) => {
|
|
23
26
|
const _domainSeparator = domainSeparator({
|
|
24
27
|
domain: {
|
|
25
28
|
name: "Kernel",
|
|
@@ -29,11 +32,11 @@ export const wrapMessageHash = (
|
|
|
29
32
|
}
|
|
30
33
|
})
|
|
31
34
|
const wrappedMessageHash = isKernelV2(kernelVersion)
|
|
32
|
-
?
|
|
35
|
+
? hash
|
|
33
36
|
: keccak256(
|
|
34
37
|
encodeAbiParameters(
|
|
35
38
|
[{ type: "bytes32" }, { type: "bytes32" }],
|
|
36
|
-
[keccak256(stringToHex("Kernel(bytes32 hash)")),
|
|
39
|
+
[keccak256(stringToHex("Kernel(bytes32 hash)")), hash]
|
|
37
40
|
)
|
|
38
41
|
)
|
|
39
42
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { toLightSmartAccount } from "./toLightSmartAccount.js"
|
|
2
|
+
|
|
3
|
+
export const LightSmartAccount = {
|
|
4
|
+
toLightSmartAccount
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type {
|
|
8
|
+
LightAccountVersion,
|
|
9
|
+
LightSmartAccountImplementation,
|
|
10
|
+
ToLightSmartAccountParameters,
|
|
11
|
+
ToLightSmartAccountReturnType
|
|
12
|
+
} from "./toLightSmartAccount.js"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { toNexusSmartAccount } from "./toNexusSmartAccount.js"
|
|
2
|
+
|
|
3
|
+
export const NexusSmartAccount = {
|
|
4
|
+
toNexusSmartAccount
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type {
|
|
8
|
+
NexusSmartAccountImplementation,
|
|
9
|
+
ToNexusSmartAccountParameters,
|
|
10
|
+
ToNexusSmartAccountReturnType
|
|
11
|
+
} from "./toNexusSmartAccount.js"
|
|
@@ -704,6 +704,7 @@ const getInitializerCode = async ({
|
|
|
704
704
|
erc7579LaunchpadAddress,
|
|
705
705
|
setupTransactions = [],
|
|
706
706
|
safeModules = [],
|
|
707
|
+
useMultiSendForSetup = true,
|
|
707
708
|
validators = [],
|
|
708
709
|
executors = [],
|
|
709
710
|
fallbacks = [],
|
|
@@ -729,6 +730,7 @@ const getInitializerCode = async ({
|
|
|
729
730
|
value: bigint
|
|
730
731
|
}[]
|
|
731
732
|
safeModules?: Address[]
|
|
733
|
+
useMultiSendForSetup?: boolean
|
|
732
734
|
validators?: { address: Address; context: Address }[]
|
|
733
735
|
executors?: {
|
|
734
736
|
address: Address
|
|
@@ -902,6 +904,23 @@ const getInitializerCode = async ({
|
|
|
902
904
|
})
|
|
903
905
|
}
|
|
904
906
|
|
|
907
|
+
if (!useMultiSendForSetup && multiCalls.length === 1) {
|
|
908
|
+
return encodeFunctionData({
|
|
909
|
+
abi: setupAbi,
|
|
910
|
+
functionName: "setup",
|
|
911
|
+
args: [
|
|
912
|
+
ownerAddresses,
|
|
913
|
+
threshold,
|
|
914
|
+
multiCalls[0].to,
|
|
915
|
+
multiCalls[0].data,
|
|
916
|
+
safe4337ModuleAddress,
|
|
917
|
+
paymentToken,
|
|
918
|
+
payment,
|
|
919
|
+
paymentReceiver
|
|
920
|
+
]
|
|
921
|
+
})
|
|
922
|
+
}
|
|
923
|
+
|
|
905
924
|
const multiSendCallData = encodeMultiSend(multiCalls)
|
|
906
925
|
|
|
907
926
|
return encodeFunctionData({
|
|
@@ -962,6 +981,7 @@ const getAccountInitCode = async ({
|
|
|
962
981
|
saltNonce = BigInt(0),
|
|
963
982
|
setupTransactions = [],
|
|
964
983
|
safeModules = [],
|
|
984
|
+
useMultiSendForSetup = true,
|
|
965
985
|
validators = [],
|
|
966
986
|
executors = [],
|
|
967
987
|
fallbacks = [],
|
|
@@ -985,6 +1005,7 @@ const getAccountInitCode = async ({
|
|
|
985
1005
|
value: bigint
|
|
986
1006
|
}[]
|
|
987
1007
|
safeModules?: Address[]
|
|
1008
|
+
useMultiSendForSetup?: boolean
|
|
988
1009
|
validators?: { address: Address; context: Address }[]
|
|
989
1010
|
executors?: {
|
|
990
1011
|
address: Address
|
|
@@ -1009,6 +1030,7 @@ const getAccountInitCode = async ({
|
|
|
1009
1030
|
setupTransactions,
|
|
1010
1031
|
safeSingletonAddress,
|
|
1011
1032
|
safeModules,
|
|
1033
|
+
useMultiSendForSetup,
|
|
1012
1034
|
erc7579LaunchpadAddress,
|
|
1013
1035
|
validators,
|
|
1014
1036
|
executors,
|
|
@@ -1183,6 +1205,15 @@ export type ToSafeSmartAccountParameters<
|
|
|
1183
1205
|
payment?: bigint
|
|
1184
1206
|
paymentReceiver?: Address
|
|
1185
1207
|
onchainIdentifier?: Hex
|
|
1208
|
+
/**
|
|
1209
|
+
* When true (default), the Safe setup always routes through MultiSend,
|
|
1210
|
+
* even for a single setup transaction. When false, a single setup
|
|
1211
|
+
* transaction (e.g. just enableModules) is called directly without
|
|
1212
|
+
* MultiSend wrapping. This produces a different counterfactual address
|
|
1213
|
+
* and is compatible with Safe Protocol Kit / relay-kit address derivation.
|
|
1214
|
+
* @default true
|
|
1215
|
+
*/
|
|
1216
|
+
useMultiSendForSetup?: boolean
|
|
1186
1217
|
} & GetErc7579Params<TErc7579>
|
|
1187
1218
|
|
|
1188
1219
|
function isErc7579Args<entryPointVersion extends "0.6" | "0.7" = "0.7">(
|
|
@@ -1224,6 +1255,7 @@ const getAccountAddress = async ({
|
|
|
1224
1255
|
paymentReceiver,
|
|
1225
1256
|
setupTransactions = [],
|
|
1226
1257
|
safeModules = [],
|
|
1258
|
+
useMultiSendForSetup = true,
|
|
1227
1259
|
saltNonce = BigInt(0),
|
|
1228
1260
|
validators = [],
|
|
1229
1261
|
executors = [],
|
|
@@ -1251,6 +1283,7 @@ const getAccountAddress = async ({
|
|
|
1251
1283
|
payment?: bigint
|
|
1252
1284
|
paymentReceiver?: Address
|
|
1253
1285
|
safeModules?: Address[]
|
|
1286
|
+
useMultiSendForSetup?: boolean
|
|
1254
1287
|
saltNonce?: bigint
|
|
1255
1288
|
erc7579LaunchpadAddress?: Address
|
|
1256
1289
|
validators?: { address: Address; context: Address }[]
|
|
@@ -1280,6 +1313,7 @@ const getAccountAddress = async ({
|
|
|
1280
1313
|
setupTransactions,
|
|
1281
1314
|
safeSingletonAddress,
|
|
1282
1315
|
safeModules,
|
|
1316
|
+
useMultiSendForSetup,
|
|
1283
1317
|
erc7579LaunchpadAddress,
|
|
1284
1318
|
validators,
|
|
1285
1319
|
executors,
|
|
@@ -1364,7 +1398,8 @@ export async function toSafeSmartAccount<
|
|
|
1364
1398
|
paymentToken,
|
|
1365
1399
|
payment,
|
|
1366
1400
|
paymentReceiver,
|
|
1367
|
-
onchainIdentifier
|
|
1401
|
+
onchainIdentifier,
|
|
1402
|
+
useMultiSendForSetup = true
|
|
1368
1403
|
} = parameters
|
|
1369
1404
|
|
|
1370
1405
|
const owners = await Promise.all(
|
|
@@ -1511,6 +1546,7 @@ export async function toSafeSmartAccount<
|
|
|
1511
1546
|
saltNonce,
|
|
1512
1547
|
setupTransactions,
|
|
1513
1548
|
safeModules,
|
|
1549
|
+
useMultiSendForSetup,
|
|
1514
1550
|
validators,
|
|
1515
1551
|
executors,
|
|
1516
1552
|
fallbacks,
|
|
@@ -1547,6 +1583,7 @@ export async function toSafeSmartAccount<
|
|
|
1547
1583
|
saltNonce,
|
|
1548
1584
|
setupTransactions,
|
|
1549
1585
|
safeModules,
|
|
1586
|
+
useMultiSendForSetup,
|
|
1550
1587
|
validators,
|
|
1551
1588
|
executors,
|
|
1552
1589
|
fallbacks,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { to7702SimpleSmartAccount } from "./to7702SimpleSmartAccount.js"
|
|
2
|
+
import { toSimpleSmartAccount } from "./toSimpleSmartAccount.js"
|
|
3
|
+
|
|
4
|
+
export const SimpleSmartAccount = {
|
|
5
|
+
toSimpleSmartAccount,
|
|
6
|
+
to7702SimpleSmartAccount
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type {
|
|
10
|
+
SimpleSmartAccountImplementation,
|
|
11
|
+
ToSimpleSmartAccountParameters,
|
|
12
|
+
ToSimpleSmartAccountReturnType
|
|
13
|
+
} from "./toSimpleSmartAccount.js"
|
|
14
|
+
export type {
|
|
15
|
+
To7702SimpleSmartAccountImplementation,
|
|
16
|
+
To7702SimpleSmartAccountParameters,
|
|
17
|
+
To7702SimpleSmartAccountReturnType
|
|
18
|
+
} from "./to7702SimpleSmartAccount.js"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { toThirdwebSmartAccount } from "./toThirdwebSmartAccount.js"
|
|
2
|
+
|
|
3
|
+
export const ThirdwebSmartAccount = {
|
|
4
|
+
toThirdwebSmartAccount
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type {
|
|
8
|
+
ThirdwebSmartAccountImplementation,
|
|
9
|
+
ToThirdwebSmartAccountParameters,
|
|
10
|
+
ToThirdwebSmartAccountReturnType
|
|
11
|
+
} from "./toThirdwebSmartAccount.js"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { toTrustSmartAccount } from "./toTrustSmartAccount.js"
|
|
2
|
+
|
|
3
|
+
export const TrustSmartAccount = {
|
|
4
|
+
toTrustSmartAccount
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type {
|
|
8
|
+
ToTrustSmartAccountParameters,
|
|
9
|
+
ToTrustSmartAccountReturnType,
|
|
10
|
+
TrustSmartAccountImplementation
|
|
11
|
+
} from "./toTrustSmartAccount.js"
|