permissionless 0.0.33 → 0.0.35
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/privateKeyToBiconomySmartAccount.js +2 -3
- package/_cjs/accounts/biconomy/privateKeyToBiconomySmartAccount.js.map +1 -1
- package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -1
- package/_cjs/accounts/index.js +4 -4
- package/_cjs/accounts/index.js.map +1 -1
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -1
- package/_cjs/accounts/safe/privateKeyToSafeSmartAccount.js +14 -0
- package/_cjs/accounts/safe/privateKeyToSafeSmartAccount.js.map +1 -0
- package/_cjs/accounts/{signerToSafeSmartAccount.js → safe/signerToSafeSmartAccount.js} +3 -3
- package/_cjs/accounts/safe/signerToSafeSmartAccount.js.map +1 -0
- package/_cjs/accounts/{privateKeyToSimpleSmartAccount.js → simple/privateKeyToSimpleSmartAccount.js} +2 -4
- package/_cjs/accounts/simple/privateKeyToSimpleSmartAccount.js.map +1 -0
- package/_cjs/accounts/{signerToSimpleSmartAccount.js → simple/signerToSimpleSmartAccount.js} +5 -5
- package/_cjs/accounts/simple/signerToSimpleSmartAccount.js.map +1 -0
- package/_cjs/utils/errors/getBundlerError.js.map +1 -1
- package/_cjs/utils/getAction.js.map +1 -1
- package/_esm/accounts/biconomy/privateKeyToBiconomySmartAccount.js +2 -3
- package/_esm/accounts/biconomy/privateKeyToBiconomySmartAccount.js.map +1 -1
- package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -1
- package/_esm/accounts/index.js +4 -4
- package/_esm/accounts/index.js.map +1 -1
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -1
- package/_esm/accounts/safe/privateKeyToSafeSmartAccount.js +16 -0
- package/_esm/accounts/safe/privateKeyToSafeSmartAccount.js.map +1 -0
- package/_esm/accounts/{signerToSafeSmartAccount.js → safe/signerToSafeSmartAccount.js} +3 -3
- package/_esm/accounts/safe/signerToSafeSmartAccount.js.map +1 -0
- package/_esm/accounts/{privateKeyToSimpleSmartAccount.js → simple/privateKeyToSimpleSmartAccount.js} +2 -4
- package/_esm/accounts/simple/privateKeyToSimpleSmartAccount.js.map +1 -0
- package/_esm/accounts/{signerToSimpleSmartAccount.js → simple/signerToSimpleSmartAccount.js} +5 -5
- package/_esm/accounts/simple/signerToSimpleSmartAccount.js.map +1 -0
- package/_esm/utils/errors/getBundlerError.js.map +1 -1
- package/_esm/utils/getAction.js +1 -0
- package/_esm/utils/getAction.js.map +1 -1
- package/_types/accounts/biconomy/privateKeyToBiconomySmartAccount.d.ts +7 -7
- package/_types/accounts/biconomy/privateKeyToBiconomySmartAccount.d.ts.map +1 -1
- package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts +12 -10
- package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts.map +1 -1
- package/_types/accounts/index.d.ts +8 -8
- package/_types/accounts/index.d.ts.map +1 -1
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts +12 -10
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts.map +1 -1
- package/_types/accounts/safe/privateKeyToSafeSmartAccount.d.ts +13 -0
- package/_types/accounts/safe/privateKeyToSafeSmartAccount.d.ts.map +1 -0
- package/_types/accounts/{signerToSafeSmartAccount.d.ts → safe/signerToSafeSmartAccount.d.ts} +10 -8
- package/_types/accounts/safe/signerToSafeSmartAccount.d.ts.map +1 -0
- package/_types/accounts/simple/privateKeyToSimpleSmartAccount.d.ts +13 -0
- package/_types/accounts/simple/privateKeyToSimpleSmartAccount.d.ts.map +1 -0
- package/_types/accounts/{signerToSimpleSmartAccount.d.ts → simple/signerToSimpleSmartAccount.d.ts} +10 -8
- package/_types/accounts/simple/signerToSimpleSmartAccount.d.ts.map +1 -0
- package/_types/clients/decorators/bundler.d.ts +1 -1
- package/_types/clients/decorators/bundler.d.ts.map +1 -1
- package/_types/types/index.d.ts +1 -1
- package/_types/types/index.d.ts.map +1 -1
- package/_types/types/userOperation.d.ts +1 -1
- package/_types/types/userOperation.d.ts.map +1 -1
- package/_types/utils/errors/getBundlerError.d.ts +2 -2
- package/_types/utils/errors/getBundlerError.d.ts.map +1 -1
- package/_types/utils/getAction.d.ts.map +1 -1
- package/accounts/biconomy/privateKeyToBiconomySmartAccount.ts +11 -18
- package/accounts/biconomy/signerToBiconomySmartAccount.ts +17 -11
- package/accounts/index.ts +26 -6
- package/accounts/kernel/signerToEcdsaKernelSmartAccount.ts +16 -11
- package/accounts/safe/privateKeyToSafeSmartAccount.ts +34 -0
- package/accounts/{signerToSafeSmartAccount.ts → safe/signerToSafeSmartAccount.ts} +30 -24
- package/accounts/{privateKeyToSimpleSmartAccount.ts → simple/privateKeyToSimpleSmartAccount.ts} +11 -21
- package/accounts/{signerToSimpleSmartAccount.ts → simple/signerToSimpleSmartAccount.ts} +19 -13
- package/clients/decorators/bundler.ts +1 -1
- package/package.json +1 -1
- package/types/index.ts +1 -1
- package/types/userOperation.ts +1 -1
- package/utils/errors/getBundlerError.ts +16 -16
- package/utils/getAction.ts +1 -0
- package/_cjs/accounts/privateKeyToSafeSmartAccount.js +0 -24
- package/_cjs/accounts/privateKeyToSafeSmartAccount.js.map +0 -1
- package/_cjs/accounts/privateKeyToSimpleSmartAccount.js.map +0 -1
- package/_cjs/accounts/signerToSafeSmartAccount.js.map +0 -1
- package/_cjs/accounts/signerToSimpleSmartAccount.js.map +0 -1
- package/_esm/accounts/privateKeyToSafeSmartAccount.js +0 -26
- package/_esm/accounts/privateKeyToSafeSmartAccount.js.map +0 -1
- package/_esm/accounts/privateKeyToSimpleSmartAccount.js.map +0 -1
- package/_esm/accounts/signerToSafeSmartAccount.js.map +0 -1
- package/_esm/accounts/signerToSimpleSmartAccount.js.map +0 -1
- package/_types/accounts/privateKeyToSafeSmartAccount.d.ts +0 -26
- package/_types/accounts/privateKeyToSafeSmartAccount.d.ts.map +0 -1
- package/_types/accounts/privateKeyToSimpleSmartAccount.d.ts +0 -14
- package/_types/accounts/privateKeyToSimpleSmartAccount.d.ts.map +0 -1
- package/_types/accounts/signerToSafeSmartAccount.d.ts.map +0 -1
- package/_types/accounts/signerToSimpleSmartAccount.d.ts.map +0 -1
- package/accounts/privateKeyToSafeSmartAccount.ts +0 -73
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { type Address, type Chain, type Client, type Transport } from "viem";
|
|
2
|
+
import type { Prettify } from "../../types";
|
|
2
3
|
import { type SmartAccount, type SmartAccountSigner } from "../types";
|
|
3
4
|
export type BiconomySmartAccount<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined> = SmartAccount<"biconomySmartAccount", transport, chain>;
|
|
5
|
+
export type SignerToBiconomySmartAccountParameters<TSource extends string = "custom", TAddress extends Address = Address> = Prettify<{
|
|
6
|
+
signer: SmartAccountSigner<TSource, TAddress>;
|
|
7
|
+
entryPoint: Address;
|
|
8
|
+
address?: Address;
|
|
9
|
+
index?: bigint;
|
|
10
|
+
factoryAddress?: Address;
|
|
11
|
+
accountLogicAddress?: Address;
|
|
12
|
+
fallbackHandlerAddress?: Address;
|
|
13
|
+
ecdsaModuleAddress?: Address;
|
|
14
|
+
}>;
|
|
4
15
|
/**
|
|
5
16
|
* Build a Biconomy modular smart account from a private key, that use the ECDSA signer behind the scene
|
|
6
17
|
* @param client
|
|
@@ -11,14 +22,5 @@ export type BiconomySmartAccount<transport extends Transport = Transport, chain
|
|
|
11
22
|
* @param accountLogicAddress
|
|
12
23
|
* @param ecdsaModuleAddress
|
|
13
24
|
*/
|
|
14
|
-
export declare function signerToBiconomySmartAccount<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSource extends string = "custom", TAddress extends Address = Address>(client: Client<TTransport, TChain, undefined>, { signer, address, entryPoint, index, factoryAddress, accountLogicAddress, fallbackHandlerAddress, ecdsaModuleAddress }:
|
|
15
|
-
signer: SmartAccountSigner<TSource, TAddress>;
|
|
16
|
-
entryPoint: Address;
|
|
17
|
-
address?: Address;
|
|
18
|
-
index?: bigint;
|
|
19
|
-
factoryAddress?: Address;
|
|
20
|
-
accountLogicAddress?: Address;
|
|
21
|
-
fallbackHandlerAddress?: Address;
|
|
22
|
-
ecdsaModuleAddress?: Address;
|
|
23
|
-
}): Promise<BiconomySmartAccount<TTransport, TChain>>;
|
|
25
|
+
export declare function signerToBiconomySmartAccount<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSource extends string = "custom", TAddress extends Address = Address>(client: Client<TTransport, TChain, undefined>, { signer, address, entryPoint, index, factoryAddress, accountLogicAddress, fallbackHandlerAddress, ecdsaModuleAddress }: SignerToBiconomySmartAccountParameters<TSource, TAddress>): Promise<BiconomySmartAccount<TTransport, TChain>>;
|
|
24
26
|
//# sourceMappingURL=signerToBiconomySmartAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signerToBiconomySmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/biconomy/signerToBiconomySmartAccount.ts"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EAGX,KAAK,SAAS,EAUjB,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"signerToBiconomySmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/biconomy/signerToBiconomySmartAccount.ts"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EAGX,KAAK,SAAS,EAUjB,MAAM,MAAM,CAAA;AAIb,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG3C,OAAO,EAEH,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAC1B,MAAM,UAAU,CAAA;AAOjB,MAAM,MAAM,oBAAoB,CAC5B,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IACnD,YAAY,CAAC,sBAAsB,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;AAqJ1D,MAAM,MAAM,sCAAsC,CAC9C,OAAO,SAAS,MAAM,GAAG,QAAQ,EACjC,QAAQ,SAAS,OAAO,GAAG,OAAO,IAClC,QAAQ,CAAC;IACT,MAAM,EAAE,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IAC7C,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC/B,CAAC,CAAA;AAEF;;;;;;;;;GASG;AACH,wBAAsB,4BAA4B,CAC9C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,OAAO,SAAS,MAAM,GAAG,QAAQ,EACjC,QAAQ,SAAS,OAAO,GAAG,OAAO,EAElC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAC7C,EACI,MAAM,EACN,OAAO,EACP,UAAU,EACV,KAAU,EACV,cAAmD,EACnD,mBAA2D,EAC3D,sBAA4E,EAC5E,kBAAuE,EAC1E,EAAE,sCAAsC,CAAC,OAAO,EAAE,QAAQ,CAAC,GAC7D,OAAO,CAAC,oBAAoB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAiKnD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { privateKeyToSimpleSmartAccount } from "./privateKeyToSimpleSmartAccount";
|
|
2
|
-
import { type SimpleSmartAccount, signerToSimpleSmartAccount } from "./signerToSimpleSmartAccount";
|
|
3
|
-
import { privateKeyToSafeSmartAccount } from "./privateKeyToSafeSmartAccount";
|
|
4
|
-
import { type SafeSmartAccount, type SafeVersion, signerToSafeSmartAccount } from "./signerToSafeSmartAccount";
|
|
5
|
-
import { type KernelEcdsaSmartAccount, signerToEcdsaKernelSmartAccount } from "./kernel/signerToEcdsaKernelSmartAccount";
|
|
6
|
-
import { type BiconomySmartAccount, signerToBiconomySmartAccount } from "./biconomy/signerToBiconomySmartAccount";
|
|
7
|
-
import { privateKeyToBiconomySmartAccount } from "./biconomy/privateKeyToBiconomySmartAccount";
|
|
1
|
+
import { type PrivateKeyToSimpleSmartAccountParameters, privateKeyToSimpleSmartAccount } from "./simple/privateKeyToSimpleSmartAccount";
|
|
2
|
+
import { type SignerToSimpleSmartAccountParameters, type SimpleSmartAccount, signerToSimpleSmartAccount } from "./simple/signerToSimpleSmartAccount";
|
|
3
|
+
import { type PrivateKeyToSafeSmartAccountParameters, privateKeyToSafeSmartAccount } from "./safe/privateKeyToSafeSmartAccount";
|
|
4
|
+
import { type SafeSmartAccount, type SafeVersion, type SignerToSafeSmartAccountParameters, signerToSafeSmartAccount } from "./safe/signerToSafeSmartAccount";
|
|
5
|
+
import { type KernelEcdsaSmartAccount, type SignerToEcdsaKernelSmartAccountParameters, signerToEcdsaKernelSmartAccount } from "./kernel/signerToEcdsaKernelSmartAccount";
|
|
6
|
+
import { type BiconomySmartAccount, type SignerToBiconomySmartAccountParameters, signerToBiconomySmartAccount } from "./biconomy/signerToBiconomySmartAccount";
|
|
7
|
+
import { type PrivateKeyToBiconomySmartAccountParameters, privateKeyToBiconomySmartAccount } from "./biconomy/privateKeyToBiconomySmartAccount";
|
|
8
8
|
import { SignTransactionNotSupportedBySmartAccount, type SmartAccount, type SmartAccountSigner } from "./types";
|
|
9
|
-
export { type SafeVersion, type SmartAccountSigner, type SafeSmartAccount, signerToSafeSmartAccount, type SimpleSmartAccount, signerToSimpleSmartAccount, SignTransactionNotSupportedBySmartAccount, privateKeyToBiconomySmartAccount, privateKeyToSimpleSmartAccount, type SmartAccount, privateKeyToSafeSmartAccount, type KernelEcdsaSmartAccount, signerToEcdsaKernelSmartAccount, type BiconomySmartAccount, signerToBiconomySmartAccount };
|
|
9
|
+
export { type SafeVersion, type SmartAccountSigner, type SafeSmartAccount, signerToSafeSmartAccount, type SimpleSmartAccount, signerToSimpleSmartAccount, SignTransactionNotSupportedBySmartAccount, privateKeyToBiconomySmartAccount, privateKeyToSimpleSmartAccount, type SmartAccount, privateKeyToSafeSmartAccount, type KernelEcdsaSmartAccount, signerToEcdsaKernelSmartAccount, type BiconomySmartAccount, signerToBiconomySmartAccount, type SignerToSimpleSmartAccountParameters, type SignerToSafeSmartAccountParameters, type PrivateKeyToSimpleSmartAccountParameters, type PrivateKeyToSafeSmartAccountParameters, type SignerToEcdsaKernelSmartAccountParameters, type SignerToBiconomySmartAccountParameters, type PrivateKeyToBiconomySmartAccountParameters };
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,wCAAwC,EAC7C,8BAA8B,EACjC,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACH,KAAK,oCAAoC,EACzC,KAAK,kBAAkB,EACvB,0BAA0B,EAC7B,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,KAAK,sCAAsC,EAC3C,4BAA4B,EAC/B,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,kCAAkC,EACvC,wBAAwB,EAC3B,MAAM,iCAAiC,CAAA;AAExC,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,yCAAyC,EAC9C,+BAA+B,EAClC,MAAM,0CAA0C,CAAA;AAEjD,OAAO,EACH,KAAK,oBAAoB,EACzB,KAAK,sCAAsC,EAC3C,4BAA4B,EAC/B,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACH,KAAK,0CAA0C,EAC/C,gCAAgC,EACnC,MAAM,6CAA6C,CAAA;AAEpD,OAAO,EACH,yCAAyC,EACzC,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAC1B,MAAM,SAAS,CAAA;AAEhB,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,0BAA0B,EAC1B,yCAAyC,EACzC,gCAAgC,EAChC,8BAA8B,EAC9B,KAAK,YAAY,EACjB,4BAA4B,EAC5B,KAAK,uBAAuB,EAC5B,+BAA+B,EAC/B,KAAK,oBAAoB,EACzB,4BAA4B,EAC5B,KAAK,oCAAoC,EACzC,KAAK,kCAAkC,EACvC,KAAK,wCAAwC,EAC7C,KAAK,sCAAsC,EAC3C,KAAK,yCAAyC,EAC9C,KAAK,sCAAsC,EAC3C,KAAK,0CAA0C,EAClD,CAAA"}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { type Address, type Chain, type Client, type Transport } from "viem";
|
|
2
|
+
import type { Prettify } from "../../types";
|
|
2
3
|
import type { SmartAccount } from "../types";
|
|
3
4
|
import { type SmartAccountSigner } from "../types";
|
|
4
5
|
export type KernelEcdsaSmartAccount<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined> = SmartAccount<"kernelEcdsaSmartAccount", transport, chain>;
|
|
6
|
+
export type SignerToEcdsaKernelSmartAccountParameters<TSource extends string = "custom", TAddress extends Address = Address> = Prettify<{
|
|
7
|
+
signer: SmartAccountSigner<TSource, TAddress>;
|
|
8
|
+
entryPoint: Address;
|
|
9
|
+
address?: Address;
|
|
10
|
+
index?: bigint;
|
|
11
|
+
factoryAddress?: Address;
|
|
12
|
+
accountLogicAddress?: Address;
|
|
13
|
+
ecdsaValidatorAddress?: Address;
|
|
14
|
+
deployedAccountAddress?: Address;
|
|
15
|
+
}>;
|
|
5
16
|
/**
|
|
6
17
|
* Build a kernel smart account from a private key, that use the ECDSA signer behind the scene
|
|
7
18
|
* @param client
|
|
@@ -13,14 +24,5 @@ export type KernelEcdsaSmartAccount<transport extends Transport = Transport, cha
|
|
|
13
24
|
* @param ecdsaValidatorAddress
|
|
14
25
|
* @param deployedAccountAddress
|
|
15
26
|
*/
|
|
16
|
-
export declare function signerToEcdsaKernelSmartAccount<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSource extends string = "custom", TAddress extends Address = Address>(client: Client<TTransport, TChain, undefined>, { signer, address, entryPoint, index, factoryAddress, accountLogicAddress, ecdsaValidatorAddress, deployedAccountAddress }:
|
|
17
|
-
signer: SmartAccountSigner<TSource, TAddress>;
|
|
18
|
-
entryPoint: Address;
|
|
19
|
-
address?: Address;
|
|
20
|
-
index?: bigint;
|
|
21
|
-
factoryAddress?: Address;
|
|
22
|
-
accountLogicAddress?: Address;
|
|
23
|
-
ecdsaValidatorAddress?: Address;
|
|
24
|
-
deployedAccountAddress?: Address;
|
|
25
|
-
}): Promise<KernelEcdsaSmartAccount<TTransport, TChain>>;
|
|
27
|
+
export declare function signerToEcdsaKernelSmartAccount<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSource extends string = "custom", TAddress extends Address = Address>(client: Client<TTransport, TChain, undefined>, { signer, address, entryPoint, index, factoryAddress, accountLogicAddress, ecdsaValidatorAddress, deployedAccountAddress }: SignerToEcdsaKernelSmartAccountParameters<TSource, TAddress>): Promise<KernelEcdsaSmartAccount<TTransport, TChain>>;
|
|
26
28
|
//# sourceMappingURL=signerToEcdsaKernelSmartAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signerToEcdsaKernelSmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/kernel/signerToEcdsaKernelSmartAccount.ts"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EAGX,KAAK,SAAS,EAKjB,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"signerToEcdsaKernelSmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/kernel/signerToEcdsaKernelSmartAccount.ts"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EAGX,KAAK,SAAS,EAKjB,MAAM,MAAM,CAAA;AAUb,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAEH,KAAK,kBAAkB,EAC1B,MAAM,UAAU,CAAA;AAGjB,MAAM,MAAM,uBAAuB,CAC/B,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IACnD,YAAY,CAAC,yBAAyB,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;AAuK7D,MAAM,MAAM,yCAAyC,CACjD,OAAO,SAAS,MAAM,GAAG,QAAQ,EACjC,QAAQ,SAAS,OAAO,GAAG,OAAO,IAClC,QAAQ,CAAC;IACT,MAAM,EAAE,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IAC7C,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,sBAAsB,CAAC,EAAE,OAAO,CAAA;CACnC,CAAC,CAAA;AACF;;;;;;;;;;GAUG;AACH,wBAAsB,+BAA+B,CACjD,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,OAAO,SAAS,MAAM,GAAG,QAAQ,EACjC,QAAQ,SAAS,OAAO,GAAG,OAAO,EAElC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAC7C,EACI,MAAM,EACN,OAAO,EACP,UAAU,EACV,KAAU,EACV,cAAiD,EACjD,mBAAyD,EACzD,qBAAwD,EACxD,sBAAsB,EACzB,EAAE,yCAAyC,CAAC,OAAO,EAAE,QAAQ,CAAC,GAChE,OAAO,CAAC,uBAAuB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAkJtD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Chain, type Client, type Hex, type Transport } from "viem";
|
|
2
|
+
import type { Prettify } from "../../types";
|
|
3
|
+
import { type SafeSmartAccount, type SignerToSafeSmartAccountParameters } from "./signerToSafeSmartAccount";
|
|
4
|
+
export type PrivateKeyToSafeSmartAccountParameters = Prettify<{
|
|
5
|
+
privateKey: Hex;
|
|
6
|
+
} & Omit<SignerToSafeSmartAccountParameters, "signer">>;
|
|
7
|
+
/**
|
|
8
|
+
* @description Creates an Simple Account from a private key.
|
|
9
|
+
*
|
|
10
|
+
* @returns A Private Key Simple Account.
|
|
11
|
+
*/
|
|
12
|
+
export declare function privateKeyToSafeSmartAccount<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined>(client: Client<TTransport, TChain, undefined>, { privateKey, ...rest }: PrivateKeyToSafeSmartAccountParameters): Promise<SafeSmartAccount<TTransport, TChain>>;
|
|
13
|
+
//# sourceMappingURL=privateKeyToSafeSmartAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privateKeyToSafeSmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/safe/privateKeyToSafeSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAA;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,kCAAkC,EAE1C,MAAM,4BAA4B,CAAA;AAEnC,MAAM,MAAM,sCAAsC,GAAG,QAAQ,CACzD;IACI,UAAU,EAAE,GAAG,CAAA;CAClB,GAAG,IAAI,CAAC,kCAAkC,EAAE,QAAQ,CAAC,CACzD,CAAA;AAED;;;;GAIG;AACH,wBAAsB,4BAA4B,CAC9C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EAEpD,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAC7C,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,sCAAsC,GAChE,OAAO,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAO/C"}
|
package/_types/accounts/{signerToSafeSmartAccount.d.ts → safe/signerToSafeSmartAccount.d.ts}
RENAMED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { type Address, type Chain, type Client, type Transport } from "viem";
|
|
2
|
-
import
|
|
2
|
+
import type { Prettify } from "../../types";
|
|
3
|
+
import { type SmartAccount, type SmartAccountSigner } from "../types";
|
|
3
4
|
export type SafeVersion = "1.4.1";
|
|
4
5
|
export type SafeSmartAccount<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined> = SmartAccount<"SafeSmartAccount", transport, chain>;
|
|
5
|
-
|
|
6
|
-
* @description Creates an Simple Account from a private key.
|
|
7
|
-
*
|
|
8
|
-
* @returns A Private Key Simple Account.
|
|
9
|
-
*/
|
|
10
|
-
export declare function signerToSafeSmartAccount<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSource extends string = "custom", TAddress extends Address = Address>(client: Client<TTransport, TChain>, { signer, address, safeVersion, entryPoint, addModuleLibAddress: _addModuleLibAddress, safe4337ModuleAddress: _safe4337ModuleAddress, safeProxyFactoryAddress: _safeProxyFactoryAddress, safeSingletonAddress: _safeSingletonAddress, multiSendAddress: _multiSendAddress, multiSendCallOnlyAddress: _multiSendCallOnlyAddress, saltNonce, validUntil, validAfter, safeModules, setupTransactions }: {
|
|
6
|
+
export type SignerToSafeSmartAccountParameters<TSource extends string = "custom", TAddress extends Address = Address> = Prettify<{
|
|
11
7
|
signer: SmartAccountSigner<TSource, TAddress>;
|
|
12
8
|
safeVersion: SafeVersion;
|
|
13
9
|
entryPoint: Address;
|
|
@@ -27,5 +23,11 @@ export declare function signerToSafeSmartAccount<TTransport extends Transport =
|
|
|
27
23
|
value: bigint;
|
|
28
24
|
}[];
|
|
29
25
|
safeModules?: Address[];
|
|
30
|
-
}
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* @description Creates an Simple Account from a private key.
|
|
29
|
+
*
|
|
30
|
+
* @returns A Private Key Simple Account.
|
|
31
|
+
*/
|
|
32
|
+
export declare function signerToSafeSmartAccount<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSource extends string = "custom", TAddress extends Address = Address>(client: Client<TTransport, TChain>, { signer, address, safeVersion, entryPoint, addModuleLibAddress: _addModuleLibAddress, safe4337ModuleAddress: _safe4337ModuleAddress, safeProxyFactoryAddress: _safeProxyFactoryAddress, safeSingletonAddress: _safeSingletonAddress, multiSendAddress: _multiSendAddress, multiSendCallOnlyAddress: _multiSendCallOnlyAddress, saltNonce, validUntil, validAfter, safeModules, setupTransactions }: SignerToSafeSmartAccountParameters<TSource, TAddress>): Promise<SafeSmartAccount<TTransport, TChain>>;
|
|
31
33
|
//# sourceMappingURL=signerToSafeSmartAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signerToSafeSmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/safe/signerToSafeSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EAIX,KAAK,SAAS,EAcjB,MAAM,MAAM,CAAA;AASb,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,EAEH,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAC1B,MAAM,UAAU,CAAA;AAEjB,MAAM,MAAM,WAAW,GAAG,OAAO,CAAA;AAuIjC,MAAM,MAAM,gBAAgB,CACxB,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IACnD,YAAY,CAAC,kBAAkB,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;AA2TtD,MAAM,MAAM,kCAAkC,CAC1C,OAAO,SAAS,MAAM,GAAG,QAAQ,EACjC,QAAQ,SAAS,OAAO,GAAG,OAAO,IAClC,QAAQ,CAAC;IACT,MAAM,EAAE,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IAC7C,WAAW,EAAE,WAAW,CAAA;IACxB,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iBAAiB,CAAC,EAAE;QAChB,EAAE,EAAE,OAAO,CAAA;QACX,IAAI,EAAE,OAAO,CAAA;QACb,KAAK,EAAE,MAAM,CAAA;KAChB,EAAE,CAAA;IACH,WAAW,CAAC,EAAE,OAAO,EAAE,CAAA;CAC1B,CAAC,CAAA;AAEF;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC1C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,OAAO,SAAS,MAAM,GAAG,QAAQ,EACjC,QAAQ,SAAS,OAAO,GAAG,OAAO,EAElC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,EAClC,EACI,MAAM,EACN,OAAO,EACP,WAAW,EACX,UAAU,EACV,mBAAmB,EAAE,oBAAoB,EACzC,qBAAqB,EAAE,sBAAsB,EAC7C,uBAAuB,EAAE,wBAAwB,EACjD,oBAAoB,EAAE,qBAAqB,EAC3C,gBAAgB,EAAE,iBAAiB,EACnC,wBAAwB,EAAE,yBAAyB,EACnD,SAAc,EACd,UAAc,EACd,UAAc,EACd,WAAgB,EAChB,iBAAsB,EACzB,EAAE,kCAAkC,CAAC,OAAO,EAAE,QAAQ,CAAC,GACzD,OAAO,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CA+P/C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Chain, type Client, type Hex, type Transport } from "viem";
|
|
2
|
+
import type { Prettify } from "../../types";
|
|
3
|
+
import { type SignerToSimpleSmartAccountParameters, type SimpleSmartAccount } from "./signerToSimpleSmartAccount";
|
|
4
|
+
export type PrivateKeyToSimpleSmartAccountParameters = Prettify<{
|
|
5
|
+
privateKey: Hex;
|
|
6
|
+
} & Omit<SignerToSimpleSmartAccountParameters, "signer">>;
|
|
7
|
+
/**
|
|
8
|
+
* @description Creates an Simple Account from a private key.
|
|
9
|
+
*
|
|
10
|
+
* @returns A Private Key Simple Account.
|
|
11
|
+
*/
|
|
12
|
+
export declare function privateKeyToSimpleSmartAccount<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined>(client: Client<TTransport, TChain, undefined>, { privateKey, ...rest }: PrivateKeyToSimpleSmartAccountParameters): Promise<SimpleSmartAccount<TTransport, TChain>>;
|
|
13
|
+
//# sourceMappingURL=privateKeyToSimpleSmartAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privateKeyToSimpleSmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/simple/privateKeyToSimpleSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAA;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EACH,KAAK,oCAAoC,EACzC,KAAK,kBAAkB,EAE1B,MAAM,8BAA8B,CAAA;AAErC,MAAM,MAAM,wCAAwC,GAAG,QAAQ,CAC3D;IACI,UAAU,EAAE,GAAG,CAAA;CAClB,GAAG,IAAI,CAAC,oCAAoC,EAAE,QAAQ,CAAC,CAC3D,CAAA;AAED;;;;GAIG;AACH,wBAAsB,8BAA8B,CAChD,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EAEpD,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAC7C,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,wCAAwC,GAClE,OAAO,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAOjD"}
|
package/_types/accounts/{signerToSimpleSmartAccount.d.ts → simple/signerToSimpleSmartAccount.d.ts}
RENAMED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { type Address, type Chain, type Client, type Transport } from "viem";
|
|
2
|
-
import
|
|
2
|
+
import type { Prettify } from "../../types";
|
|
3
|
+
import { type SmartAccount, type SmartAccountSigner } from "../types";
|
|
3
4
|
export type SimpleSmartAccount<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined> = SmartAccount<"SimpleSmartAccount", transport, chain>;
|
|
4
|
-
|
|
5
|
-
* @description Creates an Simple Account from a private key.
|
|
6
|
-
*
|
|
7
|
-
* @returns A Private Key Simple Account.
|
|
8
|
-
*/
|
|
9
|
-
export declare function signerToSimpleSmartAccount<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSource extends string = "custom", TAddress extends Address = Address>(client: Client<TTransport, TChain, undefined>, { signer, factoryAddress, entryPoint, index, address }: {
|
|
5
|
+
export type SignerToSimpleSmartAccountParameters<TSource extends string = "custom", TAddress extends Address = Address> = Prettify<{
|
|
10
6
|
signer: SmartAccountSigner<TSource, TAddress>;
|
|
11
7
|
factoryAddress: Address;
|
|
12
8
|
entryPoint: Address;
|
|
13
9
|
index?: bigint;
|
|
14
10
|
address?: Address;
|
|
15
|
-
}
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* @description Creates an Simple Account from a private key.
|
|
14
|
+
*
|
|
15
|
+
* @returns A Private Key Simple Account.
|
|
16
|
+
*/
|
|
17
|
+
export declare function signerToSimpleSmartAccount<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSource extends string = "custom", TAddress extends Address = Address>(client: Client<TTransport, TChain, undefined>, { signer, factoryAddress, entryPoint, index, address }: SignerToSimpleSmartAccountParameters<TSource, TAddress>): Promise<SimpleSmartAccount<TTransport, TChain>>;
|
|
16
18
|
//# sourceMappingURL=signerToSimpleSmartAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signerToSimpleSmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/simple/signerToSimpleSmartAccount.ts"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EAGX,KAAK,SAAS,EAIjB,MAAM,MAAM,CAAA;AAKb,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG3C,OAAO,EAEH,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAC1B,MAAM,UAAU,CAAA;AAEjB,MAAM,MAAM,kBAAkB,CAC1B,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IACnD,YAAY,CAAC,oBAAoB,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;AAoExD,MAAM,MAAM,oCAAoC,CAC5C,OAAO,SAAS,MAAM,GAAG,QAAQ,EACjC,QAAQ,SAAS,OAAO,GAAG,OAAO,IAClC,QAAQ,CAAC;IACT,MAAM,EAAE,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IAC7C,cAAc,EAAE,OAAO,CAAA;IACvB,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB,CAAC,CAAA;AAEF;;;;GAIG;AACH,wBAAsB,0BAA0B,CAC5C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,OAAO,SAAS,MAAM,GAAG,QAAQ,EACjC,QAAQ,SAAS,OAAO,GAAG,OAAO,EAElC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAC7C,EACI,MAAM,EACN,cAAc,EACd,UAAU,EACV,KAAU,EACV,OAAO,EACV,EAAE,oCAAoC,CAAC,OAAO,EAAE,QAAQ,CAAC,GAC3D,OAAO,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAqKjD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Address } from "
|
|
1
|
+
import type { Address } from "viem";
|
|
2
2
|
import type { Client, Hash } from "viem";
|
|
3
3
|
import { type EstimateUserOperationGasParameters, type EstimateUserOperationGasReturnType } from "../../actions/bundler/estimateUserOperationGas";
|
|
4
4
|
import { type GetUserOperationByHashParameters, type GetUserOperationByHashReturnType } from "../../actions/bundler/getUserOperationByHash";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../../clients/decorators/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../../clients/decorators/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAExC,OAAO,EACH,KAAK,kCAAkC,EACvC,KAAK,kCAAkC,EAE1C,MAAM,gDAAgD,CAAA;AACvD,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EAExC,MAAM,8CAA8C,CAAA;AACrD,OAAO,EACH,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EAEzC,MAAM,+CAA+C,CAAA;AACtD,OAAO,EACH,KAAK,2BAA2B,EAEnC,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACH,KAAK,qCAAqC,EAE7C,MAAM,mDAAmD,CAAA;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGzD,MAAM,MAAM,cAAc,GAAG;IACzB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,iBAAiB,EAAE,CACf,IAAI,EAAE,QAAQ,CAAC,2BAA2B,CAAC,KAC1C,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,wBAAwB,EAAE,CACtB,IAAI,EAAE,QAAQ,CAAC,kCAAkC,CAAC,EAClD,cAAc,CAAC,EAAE,cAAc,KAC9B,OAAO,CAAC,QAAQ,CAAC,kCAAkC,CAAC,CAAC,CAAA;IAC1D;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,oBAAoB,EAAE,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IAC9C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IAC9B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,sBAAsB,EAAE,CACpB,IAAI,EAAE,QAAQ,CAAC,gCAAgC,CAAC,KAC/C,OAAO,CAAC,QAAQ,CAAC,gCAAgC,CAAC,GAAG,IAAI,CAAC,CAAA;IAC/D;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,uBAAuB,EAAE,CACrB,IAAI,EAAE,QAAQ,CAAC,iCAAiC,CAAC,KAChD,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAC,GAAG,IAAI,CAAC,CAAA;IAEhE;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,2BAA2B,EAAE,CACzB,IAAI,EAAE,QAAQ,CAAC,qCAAqC,CAAC,KACpD,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC,CAAA;CAC5D,CAAA;AAED,QAAA,MAAM,cAAc,WAAY,MAAM,KAAG,cAmBvC,CAAA;AAEF,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
package/_types/types/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Account, Chain, Client, Transport } from "viem";
|
|
|
2
2
|
import type { SmartAccount } from "../accounts/types";
|
|
3
3
|
import type { UserOperation } from "./userOperation";
|
|
4
4
|
export type { UserOperation };
|
|
5
|
-
type IsUndefined<T> = [undefined] extends [T] ? true : false;
|
|
5
|
+
export type IsUndefined<T> = [undefined] extends [T] ? true : false;
|
|
6
6
|
export type GetAccountParameterWithClient<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined> = IsUndefined<TAccount> extends true ? {
|
|
7
7
|
account: Account;
|
|
8
8
|
client?: Client<TTransport, TChain, TAccount>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,YAAY,EAAE,aAAa,EAAE,CAAA;AAE7B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,YAAY,EAAE,aAAa,EAAE,CAAA;AAE7B,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAA;AAEnE,MAAM,MAAM,6BAA6B,CACrC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,IAC1D,WAAW,CAAC,QAAQ,CAAC,SAAS,IAAI,GAChC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;CAAE,GACnE;IAAE,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAEzE,MAAM,MAAM,mBAAmB,CAC3B,QAAQ,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,IACpE,WAAW,CAAC,QAAQ,CAAC,SAAS,IAAI,GAChC;IAAE,OAAO,EAAE,YAAY,CAAA;CAAE,GACzB;IAAE,OAAO,CAAC,EAAE,YAAY,CAAA;CAAE,CAAA;AAEhC,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KACrB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACvB,GAAG,EAAE,CAAA;AAEN,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAG9E,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,IAAI,CAAC,SAAS,GAAG,GACvD,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACV,KAAK,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userOperation.d.ts","sourceRoot":"","sources":["../../types/userOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"userOperation.d.ts","sourceRoot":"","sources":["../../types/userOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAE/B,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,UAAU,CAAA;AAE5C,MAAM,MAAM,4BAA4B,GAAG;IACvC,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,GAAG,CAAA;IACV,QAAQ,EAAE,GAAG,CAAA;IACb,QAAQ,EAAE,GAAG,CAAA;IACb,YAAY,EAAE,GAAG,CAAA;IACjB,oBAAoB,EAAE,GAAG,CAAA;IACzB,kBAAkB,EAAE,GAAG,CAAA;IACvB,YAAY,EAAE,GAAG,CAAA;IACjB,oBAAoB,EAAE,GAAG,CAAA;IACzB,gBAAgB,EAAE,GAAG,CAAA;IACrB,SAAS,EAAE,GAAG,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IACxB,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,GAAG,CAAA;IACb,QAAQ,EAAE,GAAG,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,YAAY,EAAE,MAAM,CAAA;IACpB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,gBAAgB,EAAE,GAAG,CAAA;IACrB,SAAS,EAAE,GAAG,CAAA;CACjB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Address, BaseError, type ExecutionRevertedErrorType, type UnknownNodeErrorType } from "viem";
|
|
1
|
+
import { type Address, BaseError, type ExecutionRevertedErrorType, UnknownNodeError, type UnknownNodeErrorType } from "viem";
|
|
2
2
|
import { type InitCodeDidNotDeploySenderErrorType, type InitCodeRevertedErrorType, type InvalidSmartAccountNonceErrorType, type SenderAddressMismatchErrorType, type SenderAlreadyDeployedErrorType, type SenderNotDeployedErrorType, type SmartAccountInsufficientFundsErrorType, type SmartAccountSignatureValidityPeriodErrorType, type SmartAccountValidationRevertedErrorType } from "../../errors/account";
|
|
3
3
|
import { type PaymasterDataRejectedErrorType, type PaymasterDepositTooLowErrorType, type PaymasterNotDeployedErrorType, type PaymasterValidationRevertedErrorType, type PaymasterValidityPeriodErrorType } from "../../errors/paymaster";
|
|
4
4
|
import type { UserOperation } from "../../types";
|
|
@@ -7,5 +7,5 @@ export type GetBundlerErrorParameters = {
|
|
|
7
7
|
entryPoint: Address;
|
|
8
8
|
};
|
|
9
9
|
export type GetBundlerErrorReturnType = ExecutionRevertedErrorType | UnknownNodeErrorType | SenderAlreadyDeployedErrorType | InitCodeRevertedErrorType | SenderAddressMismatchErrorType | InitCodeDidNotDeploySenderErrorType | SenderNotDeployedErrorType | SmartAccountInsufficientFundsErrorType | SmartAccountSignatureValidityPeriodErrorType | SmartAccountValidationRevertedErrorType | InvalidSmartAccountNonceErrorType | PaymasterNotDeployedErrorType | PaymasterDepositTooLowErrorType | PaymasterValidityPeriodErrorType | PaymasterValidationRevertedErrorType | PaymasterDataRejectedErrorType;
|
|
10
|
-
export declare function getBundlerError(err: BaseError, args: GetBundlerErrorParameters):
|
|
10
|
+
export declare function getBundlerError(err: BaseError, args: GetBundlerErrorParameters): UnknownNodeError;
|
|
11
11
|
//# sourceMappingURL=getBundlerError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBundlerError.d.ts","sourceRoot":"","sources":["../../../utils/errors/getBundlerError.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,SAAS,EAET,KAAK,0BAA0B,
|
|
1
|
+
{"version":3,"file":"getBundlerError.d.ts","sourceRoot":"","sources":["../../../utils/errors/getBundlerError.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,SAAS,EAET,KAAK,0BAA0B,EAC/B,gBAAgB,EAChB,KAAK,oBAAoB,EAC5B,MAAM,MAAM,CAAA;AAEb,OAAO,EAEH,KAAK,mCAAmC,EAExC,KAAK,yBAAyB,EAE9B,KAAK,iCAAiC,EAEtC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EAEnC,KAAK,0BAA0B,EAE/B,KAAK,sCAAsC,EAE3C,KAAK,4CAA4C,EAEjD,KAAK,uCAAuC,EAC/C,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAEH,KAAK,8BAA8B,EAEnC,KAAK,+BAA+B,EAEpC,KAAK,6BAA6B,EAElC,KAAK,oCAAoC,EAEzC,KAAK,gCAAgC,EACxC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD,MAAM,MAAM,yBAAyB,GAAG;IACpC,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IACrC,UAAU,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAC/B,0BAA0B,GAC1B,oBAAoB,GACpB,8BAA8B,GAC9B,yBAAyB,GACzB,8BAA8B,GAC9B,mCAAmC,GACnC,0BAA0B,GAC1B,sCAAsC,GACtC,4CAA4C,GAC5C,uCAAuC,GACvC,iCAAiC,GACjC,6BAA6B,GAC7B,+BAA+B,GAC/B,gCAAgC,GAChC,oCAAoC,GACpC,8BAA8B,CAAA;AAEpC,wBAAgB,eAAe,CAC3B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,yBAAyB,oBAwJlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAction.d.ts","sourceRoot":"","sources":["../../utils/getAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"getAction.d.ts","sourceRoot":"","sources":["../../utils/getAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAGlC,wBAAgB,SAAS,CAAC,MAAM,SAAS,GAAG,EAAE,EAAE,UAAU,SAAS,EAAE,EACjE,MAAM,EAAE,MAAM,EAEd,MAAM,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,MAAM,EAAE,MAAM,KAAK,UAAU,EACjD,UAAU,GAAE,MAAoB,0BAEJ,UAAU,CAMzC"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type Address,
|
|
3
|
-
type Chain,
|
|
4
|
-
type Client,
|
|
5
|
-
type Hex,
|
|
6
|
-
type Transport
|
|
7
|
-
} from "viem"
|
|
1
|
+
import { type Chain, type Client, type Hex, type Transport } from "viem"
|
|
8
2
|
import { privateKeyToAccount } from "viem/accounts"
|
|
3
|
+
import type { Prettify } from "../../types"
|
|
9
4
|
import {
|
|
10
5
|
type BiconomySmartAccount,
|
|
6
|
+
type SignerToBiconomySmartAccountParameters,
|
|
11
7
|
signerToBiconomySmartAccount
|
|
12
8
|
} from "./signerToBiconomySmartAccount"
|
|
13
9
|
|
|
10
|
+
export type PrivateKeyToBiconomySmartAccountParameters = Prettify<
|
|
11
|
+
{
|
|
12
|
+
privateKey: Hex
|
|
13
|
+
} & Omit<SignerToBiconomySmartAccountParameters, "signer">
|
|
14
|
+
>
|
|
15
|
+
|
|
14
16
|
/**
|
|
15
17
|
* @description Creates a Biconomy Smart Account from a private key.
|
|
16
18
|
*
|
|
@@ -21,20 +23,11 @@ export async function privateKeyToBiconomySmartAccount<
|
|
|
21
23
|
TChain extends Chain | undefined = Chain | undefined
|
|
22
24
|
>(
|
|
23
25
|
client: Client<TTransport, TChain, undefined>,
|
|
24
|
-
{
|
|
25
|
-
privateKey,
|
|
26
|
-
entryPoint,
|
|
27
|
-
index = 0n
|
|
28
|
-
}: {
|
|
29
|
-
privateKey: Hex
|
|
30
|
-
entryPoint: Address
|
|
31
|
-
index?: bigint
|
|
32
|
-
}
|
|
26
|
+
{ privateKey, ...rest }: PrivateKeyToBiconomySmartAccountParameters
|
|
33
27
|
): Promise<BiconomySmartAccount<TTransport, TChain>> {
|
|
34
28
|
const privateKeyAccount = privateKeyToAccount(privateKey)
|
|
35
29
|
return signerToBiconomySmartAccount(client, {
|
|
36
30
|
signer: privateKeyAccount,
|
|
37
|
-
|
|
38
|
-
index
|
|
31
|
+
...rest
|
|
39
32
|
})
|
|
40
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TypedData } from "
|
|
1
|
+
import type { TypedData } from "viem"
|
|
2
2
|
import {
|
|
3
3
|
type Address,
|
|
4
4
|
type Chain,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
import { toAccount } from "viem/accounts"
|
|
20
20
|
import { getChainId, signMessage, signTypedData } from "viem/actions"
|
|
21
21
|
import { getAccountNonce } from "../../actions/public/getAccountNonce"
|
|
22
|
+
import type { Prettify } from "../../types"
|
|
22
23
|
import { getUserOperationHash } from "../../utils/getUserOperationHash"
|
|
23
24
|
import { isSmartAccountDeployed } from "../../utils/isSmartAccountDeployed"
|
|
24
25
|
import {
|
|
@@ -184,6 +185,20 @@ const getAccountAddress = async ({
|
|
|
184
185
|
})
|
|
185
186
|
}
|
|
186
187
|
|
|
188
|
+
export type SignerToBiconomySmartAccountParameters<
|
|
189
|
+
TSource extends string = "custom",
|
|
190
|
+
TAddress extends Address = Address
|
|
191
|
+
> = Prettify<{
|
|
192
|
+
signer: SmartAccountSigner<TSource, TAddress>
|
|
193
|
+
entryPoint: Address
|
|
194
|
+
address?: Address
|
|
195
|
+
index?: bigint
|
|
196
|
+
factoryAddress?: Address
|
|
197
|
+
accountLogicAddress?: Address
|
|
198
|
+
fallbackHandlerAddress?: Address
|
|
199
|
+
ecdsaModuleAddress?: Address
|
|
200
|
+
}>
|
|
201
|
+
|
|
187
202
|
/**
|
|
188
203
|
* Build a Biconomy modular smart account from a private key, that use the ECDSA signer behind the scene
|
|
189
204
|
* @param client
|
|
@@ -210,16 +225,7 @@ export async function signerToBiconomySmartAccount<
|
|
|
210
225
|
accountLogicAddress = BICONOMY_ADDRESSES.ACCOUNT_V2_0_LOGIC,
|
|
211
226
|
fallbackHandlerAddress = BICONOMY_ADDRESSES.DEFAULT_FALLBACK_HANDLER_ADDRESS,
|
|
212
227
|
ecdsaModuleAddress = BICONOMY_ADDRESSES.ECDSA_OWNERSHIP_REGISTRY_MODULE
|
|
213
|
-
}:
|
|
214
|
-
signer: SmartAccountSigner<TSource, TAddress>
|
|
215
|
-
entryPoint: Address
|
|
216
|
-
address?: Address
|
|
217
|
-
index?: bigint
|
|
218
|
-
factoryAddress?: Address
|
|
219
|
-
accountLogicAddress?: Address
|
|
220
|
-
fallbackHandlerAddress?: Address
|
|
221
|
-
ecdsaModuleAddress?: Address
|
|
222
|
-
}
|
|
228
|
+
}: SignerToBiconomySmartAccountParameters<TSource, TAddress>
|
|
223
229
|
): Promise<BiconomySmartAccount<TTransport, TChain>> {
|
|
224
230
|
// Get the private key related account
|
|
225
231
|
const viemSigner: LocalAccount = {
|
package/accounts/index.ts
CHANGED
|
@@ -1,29 +1,42 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type PrivateKeyToSimpleSmartAccountParameters,
|
|
3
|
+
privateKeyToSimpleSmartAccount
|
|
4
|
+
} from "./simple/privateKeyToSimpleSmartAccount"
|
|
2
5
|
|
|
3
6
|
import {
|
|
7
|
+
type SignerToSimpleSmartAccountParameters,
|
|
4
8
|
type SimpleSmartAccount,
|
|
5
9
|
signerToSimpleSmartAccount
|
|
6
|
-
} from "./signerToSimpleSmartAccount"
|
|
10
|
+
} from "./simple/signerToSimpleSmartAccount"
|
|
7
11
|
|
|
8
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
type PrivateKeyToSafeSmartAccountParameters,
|
|
14
|
+
privateKeyToSafeSmartAccount
|
|
15
|
+
} from "./safe/privateKeyToSafeSmartAccount"
|
|
9
16
|
|
|
10
17
|
import {
|
|
11
18
|
type SafeSmartAccount,
|
|
12
19
|
type SafeVersion,
|
|
20
|
+
type SignerToSafeSmartAccountParameters,
|
|
13
21
|
signerToSafeSmartAccount
|
|
14
|
-
} from "./signerToSafeSmartAccount"
|
|
22
|
+
} from "./safe/signerToSafeSmartAccount"
|
|
15
23
|
|
|
16
24
|
import {
|
|
17
25
|
type KernelEcdsaSmartAccount,
|
|
26
|
+
type SignerToEcdsaKernelSmartAccountParameters,
|
|
18
27
|
signerToEcdsaKernelSmartAccount
|
|
19
28
|
} from "./kernel/signerToEcdsaKernelSmartAccount"
|
|
20
29
|
|
|
21
30
|
import {
|
|
22
31
|
type BiconomySmartAccount,
|
|
32
|
+
type SignerToBiconomySmartAccountParameters,
|
|
23
33
|
signerToBiconomySmartAccount
|
|
24
34
|
} from "./biconomy/signerToBiconomySmartAccount"
|
|
25
35
|
|
|
26
|
-
import {
|
|
36
|
+
import {
|
|
37
|
+
type PrivateKeyToBiconomySmartAccountParameters,
|
|
38
|
+
privateKeyToBiconomySmartAccount
|
|
39
|
+
} from "./biconomy/privateKeyToBiconomySmartAccount"
|
|
27
40
|
|
|
28
41
|
import {
|
|
29
42
|
SignTransactionNotSupportedBySmartAccount,
|
|
@@ -46,5 +59,12 @@ export {
|
|
|
46
59
|
type KernelEcdsaSmartAccount,
|
|
47
60
|
signerToEcdsaKernelSmartAccount,
|
|
48
61
|
type BiconomySmartAccount,
|
|
49
|
-
signerToBiconomySmartAccount
|
|
62
|
+
signerToBiconomySmartAccount,
|
|
63
|
+
type SignerToSimpleSmartAccountParameters,
|
|
64
|
+
type SignerToSafeSmartAccountParameters,
|
|
65
|
+
type PrivateKeyToSimpleSmartAccountParameters,
|
|
66
|
+
type PrivateKeyToSafeSmartAccountParameters,
|
|
67
|
+
type SignerToEcdsaKernelSmartAccountParameters,
|
|
68
|
+
type SignerToBiconomySmartAccountParameters,
|
|
69
|
+
type PrivateKeyToBiconomySmartAccountParameters
|
|
50
70
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TypedData } from "
|
|
1
|
+
import type { TypedData } from "viem"
|
|
2
2
|
import {
|
|
3
3
|
type Address,
|
|
4
4
|
type Chain,
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
} from "viem/actions"
|
|
21
21
|
import { getAccountNonce } from "../../actions/public/getAccountNonce"
|
|
22
22
|
import { getSenderAddress } from "../../actions/public/getSenderAddress"
|
|
23
|
+
import type { Prettify } from "../../types"
|
|
23
24
|
import { getUserOperationHash } from "../../utils/getUserOperationHash"
|
|
24
25
|
import { isSmartAccountDeployed } from "../../utils/isSmartAccountDeployed"
|
|
25
26
|
import type { SmartAccount } from "../types"
|
|
@@ -199,6 +200,19 @@ const getAccountAddress = async <
|
|
|
199
200
|
})
|
|
200
201
|
}
|
|
201
202
|
|
|
203
|
+
export type SignerToEcdsaKernelSmartAccountParameters<
|
|
204
|
+
TSource extends string = "custom",
|
|
205
|
+
TAddress extends Address = Address
|
|
206
|
+
> = Prettify<{
|
|
207
|
+
signer: SmartAccountSigner<TSource, TAddress>
|
|
208
|
+
entryPoint: Address
|
|
209
|
+
address?: Address
|
|
210
|
+
index?: bigint
|
|
211
|
+
factoryAddress?: Address
|
|
212
|
+
accountLogicAddress?: Address
|
|
213
|
+
ecdsaValidatorAddress?: Address
|
|
214
|
+
deployedAccountAddress?: Address
|
|
215
|
+
}>
|
|
202
216
|
/**
|
|
203
217
|
* Build a kernel smart account from a private key, that use the ECDSA signer behind the scene
|
|
204
218
|
* @param client
|
|
@@ -226,16 +240,7 @@ export async function signerToEcdsaKernelSmartAccount<
|
|
|
226
240
|
accountLogicAddress = KERNEL_ADDRESSES.ACCOUNT_V2_2_LOGIC,
|
|
227
241
|
ecdsaValidatorAddress = KERNEL_ADDRESSES.ECDSA_VALIDATOR,
|
|
228
242
|
deployedAccountAddress
|
|
229
|
-
}:
|
|
230
|
-
signer: SmartAccountSigner<TSource, TAddress>
|
|
231
|
-
entryPoint: Address
|
|
232
|
-
address?: Address
|
|
233
|
-
index?: bigint
|
|
234
|
-
factoryAddress?: Address
|
|
235
|
-
accountLogicAddress?: Address
|
|
236
|
-
ecdsaValidatorAddress?: Address
|
|
237
|
-
deployedAccountAddress?: Address
|
|
238
|
-
}
|
|
243
|
+
}: SignerToEcdsaKernelSmartAccountParameters<TSource, TAddress>
|
|
239
244
|
): Promise<KernelEcdsaSmartAccount<TTransport, TChain>> {
|
|
240
245
|
// Get the private key related account
|
|
241
246
|
const viemSigner: LocalAccount = {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Chain, type Client, type Hex, type Transport } from "viem"
|
|
2
|
+
import { privateKeyToAccount } from "viem/accounts"
|
|
3
|
+
import type { Prettify } from "../../types"
|
|
4
|
+
import {
|
|
5
|
+
type SafeSmartAccount,
|
|
6
|
+
type SignerToSafeSmartAccountParameters,
|
|
7
|
+
signerToSafeSmartAccount
|
|
8
|
+
} from "./signerToSafeSmartAccount"
|
|
9
|
+
|
|
10
|
+
export type PrivateKeyToSafeSmartAccountParameters = Prettify<
|
|
11
|
+
{
|
|
12
|
+
privateKey: Hex
|
|
13
|
+
} & Omit<SignerToSafeSmartAccountParameters, "signer">
|
|
14
|
+
>
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @description Creates an Simple Account from a private key.
|
|
18
|
+
*
|
|
19
|
+
* @returns A Private Key Simple Account.
|
|
20
|
+
*/
|
|
21
|
+
export async function privateKeyToSafeSmartAccount<
|
|
22
|
+
TTransport extends Transport = Transport,
|
|
23
|
+
TChain extends Chain | undefined = Chain | undefined
|
|
24
|
+
>(
|
|
25
|
+
client: Client<TTransport, TChain, undefined>,
|
|
26
|
+
{ privateKey, ...rest }: PrivateKeyToSafeSmartAccountParameters
|
|
27
|
+
): Promise<SafeSmartAccount<TTransport, TChain>> {
|
|
28
|
+
const privateKeyAccount = privateKeyToAccount(privateKey)
|
|
29
|
+
|
|
30
|
+
return signerToSafeSmartAccount(client, {
|
|
31
|
+
signer: privateKeyAccount,
|
|
32
|
+
...rest
|
|
33
|
+
})
|
|
34
|
+
}
|