@aa-sdk/core 4.0.0-alpha.5 → 4.0.0-alpha.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/dist/cjs/account/smartContractAccount.d.ts +9 -3
- package/dist/cjs/account/smartContractAccount.js +11 -6
- package/dist/cjs/account/smartContractAccount.js.map +1 -1
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.js.map +1 -1
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -1
- package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
- package/dist/cjs/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
- package/dist/cjs/actions/smartAccount/internal/initUserOperation.js.map +1 -1
- package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -1
- package/dist/cjs/actions/smartAccount/internal/sendUserOperation.js.map +1 -1
- package/dist/cjs/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/dist/cjs/client/bundlerClient.js.map +1 -1
- package/dist/cjs/client/decorators/bundlerClient.js.map +1 -1
- package/dist/cjs/client/isSmartAccountClient.js.map +1 -1
- package/dist/cjs/client/types.d.ts +2 -7
- package/dist/cjs/client/types.js.map +1 -1
- package/dist/cjs/errors/account.js.map +1 -1
- package/dist/cjs/errors/client.js.map +1 -1
- package/dist/cjs/errors/entrypoint.js.map +1 -1
- package/dist/cjs/errors/signer.js.map +1 -1
- package/dist/cjs/errors/transaction.js.map +1 -1
- package/dist/cjs/errors/useroperation.js.map +1 -1
- package/dist/cjs/index.d.ts +3 -5
- package/dist/cjs/index.js +6 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logger.js.map +1 -1
- package/dist/cjs/middleware/actions.js +2 -18
- package/dist/cjs/middleware/actions.js.map +1 -1
- package/dist/cjs/middleware/defaults/gasEstimator.js +3 -2
- package/dist/cjs/middleware/defaults/gasEstimator.js.map +1 -1
- package/dist/cjs/middleware/erc7677middleware.d.ts +40 -0
- package/dist/cjs/middleware/erc7677middleware.js +77 -0
- package/dist/cjs/middleware/erc7677middleware.js.map +1 -0
- package/dist/cjs/middleware/noopMiddleware.d.ts +2 -1
- package/dist/cjs/middleware/noopMiddleware.js.map +1 -1
- package/dist/cjs/middleware/types.d.ts +3 -2
- package/dist/cjs/middleware/types.js.map +1 -1
- package/dist/cjs/signer/local-account.d.ts +46 -46
- package/dist/cjs/signer/local-account.js.map +1 -1
- package/dist/cjs/signer/wallet-client.d.ts +46 -46
- package/dist/cjs/signer/wallet-client.js.map +1 -1
- package/dist/cjs/transport/split.js.map +1 -1
- package/dist/cjs/utils/bigint.js.map +1 -1
- package/dist/cjs/utils/bytes.js.map +1 -1
- package/dist/cjs/utils/defaults.d.ts +1 -3
- package/dist/cjs/utils/defaults.js +1 -41
- package/dist/cjs/utils/defaults.js.map +1 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/types.js.map +1 -1
- package/dist/cjs/utils/userop.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/account/smartContractAccount.d.ts +9 -3
- package/dist/esm/account/smartContractAccount.js +6 -1
- package/dist/esm/account/smartContractAccount.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperationFromTx.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -1
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/initUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/sendUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/dist/esm/client/bundlerClient.js.map +1 -1
- package/dist/esm/client/decorators/bundlerClient.js.map +1 -1
- package/dist/esm/client/isSmartAccountClient.js.map +1 -1
- package/dist/esm/client/types.d.ts +2 -7
- package/dist/esm/client/types.js.map +1 -1
- package/dist/esm/errors/account.js.map +1 -1
- package/dist/esm/errors/client.js.map +1 -1
- package/dist/esm/errors/entrypoint.js.map +1 -1
- package/dist/esm/errors/signer.js.map +1 -1
- package/dist/esm/errors/transaction.js.map +1 -1
- package/dist/esm/errors/useroperation.js.map +1 -1
- package/dist/esm/index.d.ts +3 -5
- package/dist/esm/index.js +2 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/logger.js.map +1 -1
- package/dist/esm/middleware/actions.js +3 -18
- package/dist/esm/middleware/actions.js.map +1 -1
- package/dist/esm/middleware/defaults/gasEstimator.js +3 -2
- package/dist/esm/middleware/defaults/gasEstimator.js.map +1 -1
- package/dist/esm/middleware/erc7677middleware.d.ts +40 -0
- package/dist/esm/middleware/erc7677middleware.js +73 -0
- package/dist/esm/middleware/erc7677middleware.js.map +1 -0
- package/dist/esm/middleware/noopMiddleware.d.ts +2 -1
- package/dist/esm/middleware/noopMiddleware.js.map +1 -1
- package/dist/esm/middleware/types.d.ts +3 -2
- package/dist/esm/middleware/types.js.map +1 -1
- package/dist/esm/signer/local-account.d.ts +46 -46
- package/dist/esm/signer/local-account.js.map +1 -1
- package/dist/esm/signer/wallet-client.d.ts +46 -46
- package/dist/esm/signer/wallet-client.js.map +1 -1
- package/dist/esm/transport/split.js.map +1 -1
- package/dist/esm/utils/bigint.js.map +1 -1
- package/dist/esm/utils/bytes.js.map +1 -1
- package/dist/esm/utils/defaults.d.ts +1 -3
- package/dist/esm/utils/defaults.js +1 -40
- package/dist/esm/utils/defaults.js.map +1 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/types.js.map +1 -1
- package/dist/esm/utils/userop.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/account/smartContractAccount.d.ts +17 -11
- package/dist/types/account/smartContractAccount.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/buildUserOperationFromTx.d.ts +33 -33
- package/dist/types/actions/smartAccount/buildUserOperationFromTxs.d.ts +43 -59
- package/dist/types/actions/smartAccount/buildUserOperationFromTxs.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +18 -18
- package/dist/types/actions/smartAccount/estimateUserOperationGas.d.ts +3 -3
- package/dist/types/actions/smartAccount/internal/initUserOperation.d.ts +3 -4
- package/dist/types/actions/smartAccount/internal/initUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/internal/runMiddlewareStack.d.ts +0 -14
- package/dist/types/actions/smartAccount/internal/runMiddlewareStack.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/internal/sendUserOperation.d.ts +0 -7
- package/dist/types/actions/smartAccount/internal/sendUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/sendUserOperation.d.ts +17 -3
- package/dist/types/actions/smartAccount/sendUserOperation.d.ts.map +1 -1
- package/dist/types/client/bundlerClient.d.ts +2 -2
- package/dist/types/client/decorators/bundlerClient.d.ts +8 -8
- package/dist/types/client/isSmartAccountClient.d.ts +4 -4
- package/dist/types/client/types.d.ts +2 -7
- package/dist/types/client/types.d.ts.map +1 -1
- package/dist/types/errors/account.d.ts +53 -4
- package/dist/types/errors/account.d.ts.map +1 -1
- package/dist/types/errors/client.d.ts +15 -0
- package/dist/types/errors/client.d.ts.map +1 -1
- package/dist/types/errors/entrypoint.d.ts +12 -0
- package/dist/types/errors/entrypoint.d.ts.map +1 -1
- package/dist/types/errors/signer.d.ts +5 -0
- package/dist/types/errors/signer.d.ts.map +1 -1
- package/dist/types/errors/transaction.d.ts +8 -1
- package/dist/types/errors/transaction.d.ts.map +1 -1
- package/dist/types/errors/useroperation.d.ts +5 -5
- package/dist/types/errors/useroperation.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logger.d.ts +88 -0
- package/dist/types/logger.d.ts.map +1 -1
- package/dist/types/middleware/actions.d.ts +3 -3
- package/dist/types/middleware/actions.d.ts.map +1 -1
- package/dist/types/middleware/defaults/gasEstimator.d.ts +2 -2
- package/dist/types/middleware/defaults/gasEstimator.d.ts.map +1 -1
- package/dist/types/middleware/erc7677middleware.d.ts +62 -0
- package/dist/types/middleware/erc7677middleware.d.ts.map +1 -0
- package/dist/types/middleware/noopMiddleware.d.ts +4 -4
- package/dist/types/middleware/noopMiddleware.d.ts.map +1 -1
- package/dist/types/middleware/types.d.ts +3 -2
- package/dist/types/middleware/types.d.ts.map +1 -1
- package/dist/types/signer/local-account.d.ts +139 -47
- package/dist/types/signer/local-account.d.ts.map +1 -1
- package/dist/types/signer/wallet-client.d.ts +135 -46
- package/dist/types/signer/wallet-client.d.ts.map +1 -1
- package/dist/types/transport/split.d.ts +2 -2
- package/dist/types/utils/bigint.d.ts +14 -14
- package/dist/types/utils/bigint.d.ts.map +1 -1
- package/dist/types/utils/bytes.d.ts +5 -5
- package/dist/types/utils/defaults.d.ts +1 -11
- package/dist/types/utils/defaults.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +12 -12
- package/dist/types/utils/types.d.ts +2 -2
- package/dist/types/utils/userop.d.ts +33 -33
- package/dist/types/version.d.ts +1 -1
- package/package.json +3 -2
- package/src/account/smartContractAccount.ts +19 -12
- package/src/actions/smartAccount/buildUserOperationFromTx.ts +35 -35
- package/src/actions/smartAccount/buildUserOperationFromTxs.ts +44 -60
- package/src/actions/smartAccount/checkGasSponsorshipEligibility.ts +19 -19
- package/src/actions/smartAccount/estimateUserOperationGas.ts +3 -3
- package/src/actions/smartAccount/internal/initUserOperation.ts +3 -4
- package/src/actions/smartAccount/internal/runMiddlewareStack.ts +0 -22
- package/src/actions/smartAccount/internal/sendUserOperation.ts +0 -7
- package/src/actions/smartAccount/sendUserOperation.ts +17 -3
- package/src/client/bundlerClient.ts +2 -2
- package/src/client/decorators/bundlerClient.ts +8 -8
- package/src/client/isSmartAccountClient.ts +4 -4
- package/src/client/types.ts +2 -15
- package/src/errors/account.ts +64 -4
- package/src/errors/client.ts +18 -0
- package/src/errors/entrypoint.ts +12 -0
- package/src/errors/signer.ts +6 -0
- package/src/errors/transaction.ts +10 -1
- package/src/errors/useroperation.ts +5 -6
- package/src/index.ts +2 -8
- package/src/logger.ts +88 -0
- package/src/middleware/actions.ts +6 -27
- package/src/middleware/defaults/gasEstimator.ts +8 -5
- package/src/middleware/erc7677middleware.ts +201 -0
- package/src/middleware/noopMiddleware.ts +6 -4
- package/src/middleware/types.ts +16 -7
- package/src/signer/local-account.ts +94 -2
- package/src/signer/wallet-client.ts +89 -0
- package/src/transport/split.ts +2 -2
- package/src/utils/bigint.ts +15 -15
- package/src/utils/bytes.ts +5 -5
- package/src/utils/defaults.ts +2 -74
- package/src/utils/index.ts +12 -12
- package/src/utils/types.ts +2 -2
- package/src/utils/userop.ts +33 -33
- package/src/version.ts +1 -1
- package/dist/cjs/account/base.d.ts +0 -49
- package/dist/cjs/account/base.js +0 -257
- package/dist/cjs/account/base.js.map +0 -1
- package/dist/cjs/account/schema.d.ts +0 -100
- package/dist/cjs/account/schema.js +0 -43
- package/dist/cjs/account/schema.js.map +0 -1
- package/dist/cjs/account/simple.d.ts +0 -14
- package/dist/cjs/account/simple.js +0 -119
- package/dist/cjs/account/simple.js.map +0 -1
- package/dist/cjs/account/types.d.ts +0 -30
- package/dist/cjs/account/types.js +0 -3
- package/dist/cjs/account/types.js.map +0 -1
- package/dist/esm/account/base.d.ts +0 -49
- package/dist/esm/account/base.js +0 -253
- package/dist/esm/account/base.js.map +0 -1
- package/dist/esm/account/schema.d.ts +0 -100
- package/dist/esm/account/schema.js +0 -35
- package/dist/esm/account/schema.js.map +0 -1
- package/dist/esm/account/simple.d.ts +0 -14
- package/dist/esm/account/simple.js +0 -115
- package/dist/esm/account/simple.js.map +0 -1
- package/dist/esm/account/types.d.ts +0 -30
- package/dist/esm/account/types.js +0 -2
- package/dist/esm/account/types.js.map +0 -1
- package/dist/types/account/base.d.ts +0 -128
- package/dist/types/account/base.d.ts.map +0 -1
- package/dist/types/account/schema.d.ts +0 -101
- package/dist/types/account/schema.d.ts.map +0 -1
- package/dist/types/account/simple.d.ts +0 -15
- package/dist/types/account/simple.d.ts.map +0 -1
- package/dist/types/account/types.d.ts +0 -144
- package/dist/types/account/types.d.ts.map +0 -1
- package/src/account/base.ts +0 -415
- package/src/account/schema.ts +0 -51
- package/src/account/simple.ts +0 -221
- package/src/account/types.ts +0 -184
|
@@ -6,8 +6,58 @@ import type { SmartAccountSigner } from "./types.js";
|
|
|
6
6
|
export declare class LocalAccountSigner<T extends HDAccount | PrivateKeyAccount | LocalAccount> implements SmartAccountSigner<T> {
|
|
7
7
|
inner: T;
|
|
8
8
|
signerType: string;
|
|
9
|
+
/**
|
|
10
|
+
* A function to initialize an object with an inner parameter and derive a signerType from it.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
15
|
+
* import { privateKeyToAccount, generatePrivateKey } from "viem";
|
|
16
|
+
*
|
|
17
|
+
* const signer = new LocalAccountSigner(
|
|
18
|
+
* privateKeyToAccount(generatePrivateKey()),
|
|
19
|
+
* );
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param {T} inner The inner parameter containing the necessary data
|
|
23
|
+
*/
|
|
9
24
|
constructor(inner: T);
|
|
25
|
+
/**
|
|
26
|
+
* Signs the provided message using the inner signMessage function.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
31
|
+
* import { generatePrivateKey } from "viem";
|
|
32
|
+
*
|
|
33
|
+
* const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());
|
|
34
|
+
* const signature = await signer.signMessage("Hello, world!");
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @param {string} message The message to be signed
|
|
38
|
+
* @returns {Promise<any>} A promise that resolves to the signed message
|
|
39
|
+
*/
|
|
10
40
|
readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`>;
|
|
41
|
+
/**
|
|
42
|
+
* Signs typed data using the given parameters.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
47
|
+
* import { generatePrivateKey } from "viem";
|
|
48
|
+
*
|
|
49
|
+
* const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());
|
|
50
|
+
* const signature = await signer.signTypedData({
|
|
51
|
+
* domain: {},
|
|
52
|
+
* types: {},
|
|
53
|
+
* primaryType: "",
|
|
54
|
+
* message: {},
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @param {TypedDataDefinition<TTypedData, TPrimaryType>} params The parameters defining the typed data and primary type
|
|
59
|
+
* @returns {Promise<Hex>} A promise that resolves to the signed data in hexadecimal format
|
|
60
|
+
*/
|
|
11
61
|
readonly signTypedData: <const TTypedData extends {
|
|
12
62
|
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
13
63
|
[x: `string[${string}]`]: undefined;
|
|
@@ -35,31 +85,31 @@ export declare class LocalAccountSigner<T extends HDAccount | PrivateKeyAccount
|
|
|
35
85
|
[x: `bytes9[${string}]`]: undefined;
|
|
36
86
|
[x: `bytes10[${string}]`]: undefined;
|
|
37
87
|
[x: `bytes25[${string}]`]: undefined;
|
|
38
|
-
[x: `bytes12[${string}]`]: undefined;
|
|
39
|
-
[x: `bytes13[${string}]`]: undefined;
|
|
40
|
-
[x: `bytes14[${string}]`]: undefined;
|
|
41
|
-
[x: `bytes15[${string}]`]: undefined;
|
|
42
|
-
[x: `bytes16[${string}]`]: undefined;
|
|
43
|
-
[x: `bytes17[${string}]`]: undefined;
|
|
44
|
-
[x: `bytes18[${string}]`]: undefined;
|
|
45
|
-
[x: `bytes19[${string}]`]: undefined;
|
|
46
|
-
[x: `bytes20[${string}]`]: undefined;
|
|
47
|
-
[x: `bytes21[${string}]`]: undefined;
|
|
48
|
-
[x: `bytes22[${string}]`]: undefined;
|
|
49
|
-
[x: `bytes23[${string}]`]: undefined;
|
|
50
|
-
[x: `bytes24[${string}]`]: undefined;
|
|
51
|
-
[x: `bytes26[${string}]`]: undefined;
|
|
52
|
-
[x: `bytes27[${string}]`]: undefined;
|
|
53
|
-
[x: `bytes28[${string}]`]: undefined;
|
|
54
|
-
[x: `bytes29[${string}]`]: undefined;
|
|
55
|
-
[x: `bytes30[${string}]`]: undefined;
|
|
56
88
|
[x: `bytes31[${string}]`]: undefined;
|
|
89
|
+
[x: `bytes30[${string}]`]: undefined;
|
|
90
|
+
[x: `bytes29[${string}]`]: undefined;
|
|
91
|
+
[x: `bytes28[${string}]`]: undefined;
|
|
92
|
+
[x: `bytes27[${string}]`]: undefined;
|
|
93
|
+
[x: `bytes26[${string}]`]: undefined;
|
|
94
|
+
[x: `bytes24[${string}]`]: undefined;
|
|
95
|
+
[x: `bytes23[${string}]`]: undefined;
|
|
96
|
+
[x: `bytes22[${string}]`]: undefined;
|
|
97
|
+
[x: `bytes21[${string}]`]: undefined;
|
|
98
|
+
[x: `bytes20[${string}]`]: undefined;
|
|
99
|
+
[x: `bytes19[${string}]`]: undefined;
|
|
100
|
+
[x: `bytes18[${string}]`]: undefined;
|
|
101
|
+
[x: `bytes17[${string}]`]: undefined;
|
|
102
|
+
[x: `bytes16[${string}]`]: undefined;
|
|
103
|
+
[x: `bytes15[${string}]`]: undefined;
|
|
104
|
+
[x: `bytes14[${string}]`]: undefined;
|
|
105
|
+
[x: `bytes13[${string}]`]: undefined;
|
|
106
|
+
[x: `bytes12[${string}]`]: undefined;
|
|
57
107
|
[x: `int[${string}]`]: undefined;
|
|
58
108
|
[x: `int8[${string}]`]: undefined;
|
|
59
|
-
[x: `int16[${string}]`]: undefined;
|
|
60
|
-
[x: `int24[${string}]`]: undefined;
|
|
61
|
-
[x: `int32[${string}]`]: undefined;
|
|
62
109
|
[x: `int40[${string}]`]: undefined;
|
|
110
|
+
[x: `int32[${string}]`]: undefined;
|
|
111
|
+
[x: `int24[${string}]`]: undefined;
|
|
112
|
+
[x: `int16[${string}]`]: undefined;
|
|
63
113
|
[x: `int48[${string}]`]: undefined;
|
|
64
114
|
[x: `int56[${string}]`]: undefined;
|
|
65
115
|
[x: `int64[${string}]`]: undefined;
|
|
@@ -88,9 +138,9 @@ export declare class LocalAccountSigner<T extends HDAccount | PrivateKeyAccount
|
|
|
88
138
|
[x: `int248[${string}]`]: undefined;
|
|
89
139
|
[x: `int256[${string}]`]: undefined;
|
|
90
140
|
[x: `uint[${string}]`]: undefined;
|
|
91
|
-
[x: `uint16[${string}]`]: undefined;
|
|
92
|
-
[x: `uint24[${string}]`]: undefined;
|
|
93
141
|
[x: `uint40[${string}]`]: undefined;
|
|
142
|
+
[x: `uint24[${string}]`]: undefined;
|
|
143
|
+
[x: `uint16[${string}]`]: undefined;
|
|
94
144
|
[x: `uint56[${string}]`]: undefined;
|
|
95
145
|
[x: `uint72[${string}]`]: undefined;
|
|
96
146
|
[x: `uint80[${string}]`]: undefined;
|
|
@@ -137,30 +187,30 @@ export declare class LocalAccountSigner<T extends HDAccount | PrivateKeyAccount
|
|
|
137
187
|
bytes9?: undefined;
|
|
138
188
|
bytes10?: undefined;
|
|
139
189
|
bytes25?: undefined;
|
|
140
|
-
bytes12?: undefined;
|
|
141
|
-
bytes13?: undefined;
|
|
142
|
-
bytes14?: undefined;
|
|
143
|
-
bytes15?: undefined;
|
|
144
|
-
bytes16?: undefined;
|
|
145
|
-
bytes17?: undefined;
|
|
146
|
-
bytes18?: undefined;
|
|
147
|
-
bytes19?: undefined;
|
|
148
|
-
bytes20?: undefined;
|
|
149
|
-
bytes21?: undefined;
|
|
150
|
-
bytes22?: undefined;
|
|
151
|
-
bytes23?: undefined;
|
|
152
|
-
bytes24?: undefined;
|
|
153
|
-
bytes26?: undefined;
|
|
154
|
-
bytes27?: undefined;
|
|
155
|
-
bytes28?: undefined;
|
|
156
|
-
bytes29?: undefined;
|
|
157
|
-
bytes30?: undefined;
|
|
158
190
|
bytes31?: undefined;
|
|
191
|
+
bytes30?: undefined;
|
|
192
|
+
bytes29?: undefined;
|
|
193
|
+
bytes28?: undefined;
|
|
194
|
+
bytes27?: undefined;
|
|
195
|
+
bytes26?: undefined;
|
|
196
|
+
bytes24?: undefined;
|
|
197
|
+
bytes23?: undefined;
|
|
198
|
+
bytes22?: undefined;
|
|
199
|
+
bytes21?: undefined;
|
|
200
|
+
bytes20?: undefined;
|
|
201
|
+
bytes19?: undefined;
|
|
202
|
+
bytes18?: undefined;
|
|
203
|
+
bytes17?: undefined;
|
|
204
|
+
bytes16?: undefined;
|
|
205
|
+
bytes15?: undefined;
|
|
206
|
+
bytes14?: undefined;
|
|
207
|
+
bytes13?: undefined;
|
|
208
|
+
bytes12?: undefined;
|
|
159
209
|
int8?: undefined;
|
|
160
|
-
int16?: undefined;
|
|
161
|
-
int24?: undefined;
|
|
162
|
-
int32?: undefined;
|
|
163
210
|
int40?: undefined;
|
|
211
|
+
int32?: undefined;
|
|
212
|
+
int24?: undefined;
|
|
213
|
+
int16?: undefined;
|
|
164
214
|
int48?: undefined;
|
|
165
215
|
int56?: undefined;
|
|
166
216
|
int64?: undefined;
|
|
@@ -188,9 +238,9 @@ export declare class LocalAccountSigner<T extends HDAccount | PrivateKeyAccount
|
|
|
188
238
|
int240?: undefined;
|
|
189
239
|
int248?: undefined;
|
|
190
240
|
int256?: undefined;
|
|
191
|
-
uint16?: undefined;
|
|
192
|
-
uint24?: undefined;
|
|
193
241
|
uint40?: undefined;
|
|
242
|
+
uint24?: undefined;
|
|
243
|
+
uint16?: undefined;
|
|
194
244
|
uint56?: undefined;
|
|
195
245
|
uint72?: undefined;
|
|
196
246
|
uint80?: undefined;
|
|
@@ -216,8 +266,50 @@ export declare class LocalAccountSigner<T extends HDAccount | PrivateKeyAccount
|
|
|
216
266
|
} | {
|
|
217
267
|
[key: string]: unknown;
|
|
218
268
|
}, TPrimaryType extends string = string>(params: TypedDataDefinition<TTypedData, TPrimaryType>) => Promise<Hex>;
|
|
269
|
+
/**
|
|
270
|
+
* Returns the address of the inner object in a specific hexadecimal format.
|
|
271
|
+
*
|
|
272
|
+
* @example
|
|
273
|
+
* ```ts
|
|
274
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
275
|
+
* import { generatePrivateKey } from "viem";
|
|
276
|
+
*
|
|
277
|
+
* const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());
|
|
278
|
+
* const address = await signer.getAddress();
|
|
279
|
+
* ```
|
|
280
|
+
*
|
|
281
|
+
* @returns {Promise<Hex>} A promise that resolves to the address in the format `0x{string}`
|
|
282
|
+
*/
|
|
219
283
|
readonly getAddress: () => Promise<`0x${string}`>;
|
|
284
|
+
/**
|
|
285
|
+
* Creates a LocalAccountSigner using the provided mnemonic key and optional HD options.
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
* ```ts
|
|
289
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
290
|
+
* import { generateMnemonic } from "viem";
|
|
291
|
+
*
|
|
292
|
+
* const signer = LocalAccountSigner.mnemonicToAccountSigner(generateMnemonic());
|
|
293
|
+
* ```
|
|
294
|
+
*
|
|
295
|
+
* @param {string} key The mnemonic key to derive the account from.
|
|
296
|
+
* @param {HDOptions} [opts] Optional HD options for deriving the account.
|
|
297
|
+
* @returns {LocalAccountSigner<HDAccount>} A LocalAccountSigner object for the derived account.
|
|
298
|
+
*/
|
|
220
299
|
static mnemonicToAccountSigner(key: string, opts?: HDOptions): LocalAccountSigner<HDAccount>;
|
|
221
|
-
|
|
300
|
+
/**
|
|
301
|
+
* Creates a `LocalAccountSigner` instance using the provided private key.
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* ```ts
|
|
305
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
306
|
+
* import { generatePrivateKey } from "viem";
|
|
307
|
+
*
|
|
308
|
+
* const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());
|
|
309
|
+
* ```
|
|
310
|
+
*
|
|
311
|
+
* @param {Hex} key The private key in hexadecimal format
|
|
312
|
+
* @returns {LocalAccountSigner<PrivateKeyAccount>} An instance of `LocalAccountSigner` initialized with the provided private key
|
|
313
|
+
*/ static privateKeyToAccountSigner(key: Hex): LocalAccountSigner<PrivateKeyAccount>;
|
|
222
314
|
}
|
|
223
315
|
//# sourceMappingURL=local-account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-account.d.ts","sourceRoot":"","sources":["../../../src/signer/local-account.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,GAAG,EACR,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EAEpB,KAAK,mBAAmB,EACzB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;GAEG;AACH,qBAAa,kBAAkB,CAC7B,CAAC,SAAS,SAAS,GAAG,iBAAiB,GAAG,YAAY,CACtD,YAAW,kBAAkB,CAAC,CAAC,CAAC;IAEhC,KAAK,EAAE,CAAC,CAAC;IACT,UAAU,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"local-account.d.ts","sourceRoot":"","sources":["../../../src/signer/local-account.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,GAAG,EACR,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EAEpB,KAAK,mBAAmB,EACzB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;GAEG;AACH,qBAAa,kBAAkB,CAC7B,CAAC,SAAS,SAAS,GAAG,iBAAiB,GAAG,YAAY,CACtD,YAAW,kBAAkB,CAAC,CAAC,CAAC;IAEhC,KAAK,EAAE,CAAC,CAAC;IACT,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;;;;;OAcG;gBACS,KAAK,EAAE,CAAC;IAKpB;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAIxE;IAEF;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,CAAC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uGAKnB,QAAQ,GAAG,CAAC,CAEb;IAEF;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,UAAU,QAAa,QAAQ,KAAK,MAAM,EAAE,CAAC,CAEpD;IAEF;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,uBAAuB,CAC5B,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,SAAS,GACf,kBAAkB,CAAC,SAAS,CAAC;IAKhC;;;;;;;;;;;;;OAaG,CAAC,MAAM,CAAC,yBAAyB,CAClC,GAAG,EAAE,GAAG,GACP,kBAAkB,CAAC,iBAAiB,CAAC;CAIzC"}
|
|
@@ -6,9 +6,98 @@ import type { SmartAccountSigner } from "./types";
|
|
|
6
6
|
export declare class WalletClientSigner implements SmartAccountSigner<WalletClient> {
|
|
7
7
|
signerType: string;
|
|
8
8
|
inner: WalletClient;
|
|
9
|
+
/**
|
|
10
|
+
* Initializes a signer with a given wallet client and signer type.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { WalletClientSigner } from "@aa-sdk/core";
|
|
15
|
+
* import { createWalletClient, custom } from 'viem'
|
|
16
|
+
* import { mainnet } from 'viem/chains'
|
|
17
|
+
*
|
|
18
|
+
* const client = createWalletClient({
|
|
19
|
+
* chain: mainnet,
|
|
20
|
+
* transport: custom(window.ethereum!)
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* const signer = new WalletClientSigner(client, 'wallet');
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @param {WalletClient} client The wallet client to interact with
|
|
27
|
+
* @param {string} signerType The type of signer; must be a valid signer type, otherwise an error will be thrown
|
|
28
|
+
* @throws {InvalidSignerTypeError} If the signer type is invalid
|
|
29
|
+
*/
|
|
9
30
|
constructor(client: WalletClient, signerType: string);
|
|
31
|
+
/**
|
|
32
|
+
* Asynchronously retrieves addresses from the inner object and returns the first address after applying the `getAddress` function.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { WalletClientSigner } from "@aa-sdk/core";
|
|
37
|
+
* import { createWalletClient, custom } from 'viem'
|
|
38
|
+
* import { mainnet } from 'viem/chains'
|
|
39
|
+
*
|
|
40
|
+
* const client = createWalletClient({
|
|
41
|
+
* chain: mainnet,
|
|
42
|
+
* transport: custom(window.ethereum!)
|
|
43
|
+
* });
|
|
44
|
+
*
|
|
45
|
+
* const signer = new WalletClientSigner(client, 'wallet');
|
|
46
|
+
* console.log(await signer.getAddress());
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @returns {Promise<string>} A promise that resolves to the first address after being processed by the `getAddress` function.
|
|
50
|
+
*/
|
|
10
51
|
getAddress: () => Promise<`0x${string}`>;
|
|
52
|
+
/**
|
|
53
|
+
* Signs a message using the account's signing method.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* import { WalletClientSigner } from "@aa-sdk/core";
|
|
58
|
+
* import { createWalletClient, custom } from 'viem'
|
|
59
|
+
* import { mainnet } from 'viem/chains'
|
|
60
|
+
*
|
|
61
|
+
* const client = createWalletClient({
|
|
62
|
+
* chain: mainnet,
|
|
63
|
+
* transport: custom(window.ethereum!)
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* const signer = new WalletClientSigner(client, 'wallet');
|
|
67
|
+
* console.log(await signer.signMessage("hello"));
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @param {string} message the message string that needs to be signed
|
|
71
|
+
* @returns {Promise<string>} a promise that resolves to the signed message
|
|
72
|
+
*/
|
|
11
73
|
readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`>;
|
|
74
|
+
/**
|
|
75
|
+
* Signs the provided typed data using the account's private key.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* import { WalletClientSigner } from "@aa-sdk/core";
|
|
80
|
+
* import { createWalletClient, custom } from 'viem'
|
|
81
|
+
* import { mainnet } from 'viem/chains'
|
|
82
|
+
*
|
|
83
|
+
* const client = createWalletClient({
|
|
84
|
+
* chain: mainnet,
|
|
85
|
+
* transport: custom(window.ethereum!)
|
|
86
|
+
* });
|
|
87
|
+
*
|
|
88
|
+
* const signer = new WalletClientSigner(client, 'wallet');
|
|
89
|
+
* console.log(await signer.signTypedData({
|
|
90
|
+
* types: {
|
|
91
|
+
* "Message": [{ name: "content", type: "string" }]
|
|
92
|
+
* },
|
|
93
|
+
* primaryType: "Message",
|
|
94
|
+
* message: { content: "Hello" },
|
|
95
|
+
* }));
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @param {TypedDataDefinition<TTypedData, TPrimaryType>} typedData The typed data to be signed
|
|
99
|
+
* @returns {Promise<Hex>} A promise that resolves to a hex string representing the signed data
|
|
100
|
+
*/
|
|
12
101
|
signTypedData: <const TTypedData extends {
|
|
13
102
|
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
14
103
|
[x: `string[${string}]`]: undefined;
|
|
@@ -36,31 +125,31 @@ export declare class WalletClientSigner implements SmartAccountSigner<WalletClie
|
|
|
36
125
|
[x: `bytes9[${string}]`]: undefined;
|
|
37
126
|
[x: `bytes10[${string}]`]: undefined;
|
|
38
127
|
[x: `bytes25[${string}]`]: undefined;
|
|
39
|
-
[x: `bytes12[${string}]`]: undefined;
|
|
40
|
-
[x: `bytes13[${string}]`]: undefined;
|
|
41
|
-
[x: `bytes14[${string}]`]: undefined;
|
|
42
|
-
[x: `bytes15[${string}]`]: undefined;
|
|
43
|
-
[x: `bytes16[${string}]`]: undefined;
|
|
44
|
-
[x: `bytes17[${string}]`]: undefined;
|
|
45
|
-
[x: `bytes18[${string}]`]: undefined;
|
|
46
|
-
[x: `bytes19[${string}]`]: undefined;
|
|
47
|
-
[x: `bytes20[${string}]`]: undefined;
|
|
48
|
-
[x: `bytes21[${string}]`]: undefined;
|
|
49
|
-
[x: `bytes22[${string}]`]: undefined;
|
|
50
|
-
[x: `bytes23[${string}]`]: undefined;
|
|
51
|
-
[x: `bytes24[${string}]`]: undefined;
|
|
52
|
-
[x: `bytes26[${string}]`]: undefined;
|
|
53
|
-
[x: `bytes27[${string}]`]: undefined;
|
|
54
|
-
[x: `bytes28[${string}]`]: undefined;
|
|
55
|
-
[x: `bytes29[${string}]`]: undefined;
|
|
56
|
-
[x: `bytes30[${string}]`]: undefined;
|
|
57
128
|
[x: `bytes31[${string}]`]: undefined;
|
|
129
|
+
[x: `bytes30[${string}]`]: undefined;
|
|
130
|
+
[x: `bytes29[${string}]`]: undefined;
|
|
131
|
+
[x: `bytes28[${string}]`]: undefined;
|
|
132
|
+
[x: `bytes27[${string}]`]: undefined;
|
|
133
|
+
[x: `bytes26[${string}]`]: undefined;
|
|
134
|
+
[x: `bytes24[${string}]`]: undefined;
|
|
135
|
+
[x: `bytes23[${string}]`]: undefined;
|
|
136
|
+
[x: `bytes22[${string}]`]: undefined;
|
|
137
|
+
[x: `bytes21[${string}]`]: undefined;
|
|
138
|
+
[x: `bytes20[${string}]`]: undefined;
|
|
139
|
+
[x: `bytes19[${string}]`]: undefined;
|
|
140
|
+
[x: `bytes18[${string}]`]: undefined;
|
|
141
|
+
[x: `bytes17[${string}]`]: undefined;
|
|
142
|
+
[x: `bytes16[${string}]`]: undefined;
|
|
143
|
+
[x: `bytes15[${string}]`]: undefined;
|
|
144
|
+
[x: `bytes14[${string}]`]: undefined;
|
|
145
|
+
[x: `bytes13[${string}]`]: undefined;
|
|
146
|
+
[x: `bytes12[${string}]`]: undefined;
|
|
58
147
|
[x: `int[${string}]`]: undefined;
|
|
59
148
|
[x: `int8[${string}]`]: undefined;
|
|
60
|
-
[x: `int16[${string}]`]: undefined;
|
|
61
|
-
[x: `int24[${string}]`]: undefined;
|
|
62
|
-
[x: `int32[${string}]`]: undefined;
|
|
63
149
|
[x: `int40[${string}]`]: undefined;
|
|
150
|
+
[x: `int32[${string}]`]: undefined;
|
|
151
|
+
[x: `int24[${string}]`]: undefined;
|
|
152
|
+
[x: `int16[${string}]`]: undefined;
|
|
64
153
|
[x: `int48[${string}]`]: undefined;
|
|
65
154
|
[x: `int56[${string}]`]: undefined;
|
|
66
155
|
[x: `int64[${string}]`]: undefined;
|
|
@@ -89,9 +178,9 @@ export declare class WalletClientSigner implements SmartAccountSigner<WalletClie
|
|
|
89
178
|
[x: `int248[${string}]`]: undefined;
|
|
90
179
|
[x: `int256[${string}]`]: undefined;
|
|
91
180
|
[x: `uint[${string}]`]: undefined;
|
|
92
|
-
[x: `uint16[${string}]`]: undefined;
|
|
93
|
-
[x: `uint24[${string}]`]: undefined;
|
|
94
181
|
[x: `uint40[${string}]`]: undefined;
|
|
182
|
+
[x: `uint24[${string}]`]: undefined;
|
|
183
|
+
[x: `uint16[${string}]`]: undefined;
|
|
95
184
|
[x: `uint56[${string}]`]: undefined;
|
|
96
185
|
[x: `uint72[${string}]`]: undefined;
|
|
97
186
|
[x: `uint80[${string}]`]: undefined;
|
|
@@ -138,30 +227,30 @@ export declare class WalletClientSigner implements SmartAccountSigner<WalletClie
|
|
|
138
227
|
bytes9?: undefined;
|
|
139
228
|
bytes10?: undefined;
|
|
140
229
|
bytes25?: undefined;
|
|
141
|
-
bytes12?: undefined;
|
|
142
|
-
bytes13?: undefined;
|
|
143
|
-
bytes14?: undefined;
|
|
144
|
-
bytes15?: undefined;
|
|
145
|
-
bytes16?: undefined;
|
|
146
|
-
bytes17?: undefined;
|
|
147
|
-
bytes18?: undefined;
|
|
148
|
-
bytes19?: undefined;
|
|
149
|
-
bytes20?: undefined;
|
|
150
|
-
bytes21?: undefined;
|
|
151
|
-
bytes22?: undefined;
|
|
152
|
-
bytes23?: undefined;
|
|
153
|
-
bytes24?: undefined;
|
|
154
|
-
bytes26?: undefined;
|
|
155
|
-
bytes27?: undefined;
|
|
156
|
-
bytes28?: undefined;
|
|
157
|
-
bytes29?: undefined;
|
|
158
|
-
bytes30?: undefined;
|
|
159
230
|
bytes31?: undefined;
|
|
231
|
+
bytes30?: undefined;
|
|
232
|
+
bytes29?: undefined;
|
|
233
|
+
bytes28?: undefined;
|
|
234
|
+
bytes27?: undefined;
|
|
235
|
+
bytes26?: undefined;
|
|
236
|
+
bytes24?: undefined;
|
|
237
|
+
bytes23?: undefined;
|
|
238
|
+
bytes22?: undefined;
|
|
239
|
+
bytes21?: undefined;
|
|
240
|
+
bytes20?: undefined;
|
|
241
|
+
bytes19?: undefined;
|
|
242
|
+
bytes18?: undefined;
|
|
243
|
+
bytes17?: undefined;
|
|
244
|
+
bytes16?: undefined;
|
|
245
|
+
bytes15?: undefined;
|
|
246
|
+
bytes14?: undefined;
|
|
247
|
+
bytes13?: undefined;
|
|
248
|
+
bytes12?: undefined;
|
|
160
249
|
int8?: undefined;
|
|
161
|
-
int16?: undefined;
|
|
162
|
-
int24?: undefined;
|
|
163
|
-
int32?: undefined;
|
|
164
250
|
int40?: undefined;
|
|
251
|
+
int32?: undefined;
|
|
252
|
+
int24?: undefined;
|
|
253
|
+
int16?: undefined;
|
|
165
254
|
int48?: undefined;
|
|
166
255
|
int56?: undefined;
|
|
167
256
|
int64?: undefined;
|
|
@@ -189,9 +278,9 @@ export declare class WalletClientSigner implements SmartAccountSigner<WalletClie
|
|
|
189
278
|
int240?: undefined;
|
|
190
279
|
int248?: undefined;
|
|
191
280
|
int256?: undefined;
|
|
192
|
-
uint16?: undefined;
|
|
193
|
-
uint24?: undefined;
|
|
194
281
|
uint40?: undefined;
|
|
282
|
+
uint24?: undefined;
|
|
283
|
+
uint16?: undefined;
|
|
195
284
|
uint56?: undefined;
|
|
196
285
|
uint72?: undefined;
|
|
197
286
|
uint80?: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet-client.d.ts","sourceRoot":"","sources":["../../../src/signer/wallet-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,GAAG,EACR,KAAK,eAAe,EAEpB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;GAEG;AACH,qBAAa,kBAAmB,YAAW,kBAAkB,CAAC,YAAY,CAAC;IACzE,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"wallet-client.d.ts","sourceRoot":"","sources":["../../../src/signer/wallet-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,GAAG,EACR,KAAK,eAAe,EAEpB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;GAEG;AACH,qBAAa,kBAAmB,YAAW,kBAAkB,CAAC,YAAY,CAAC;IACzE,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;IAEpB;;;;;;;;;;;;;;;;;;;;OAoBG;gBACS,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM;IAQpD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAGtC;IAEF;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAKtE;IAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0GAKV,QAAQ,GAAG,CAAC,CAOb;CACH"}
|
|
@@ -35,8 +35,8 @@ export interface SplitTransportParams {
|
|
|
35
35
|
* });
|
|
36
36
|
* ```
|
|
37
37
|
*
|
|
38
|
-
* @param
|
|
39
|
-
* @returns
|
|
38
|
+
* @param {SplitTransportParams} params split transport configuration containing the methods overrides and fallback transport
|
|
39
|
+
* @returns {CustomTransport} a viem Transport that splits traffic
|
|
40
40
|
*/
|
|
41
41
|
export declare const split: (params: SplitTransportParams) => CustomTransport;
|
|
42
42
|
//# sourceMappingURL=split.d.ts.map
|
|
@@ -2,24 +2,24 @@ import type { BigNumberish, Multiplier } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* Returns the max bigint in a list of bigints
|
|
4
4
|
*
|
|
5
|
-
* @param args a list of bigints to get the max of
|
|
6
|
-
* @returns the max bigint in the list
|
|
5
|
+
* @param {bigint[]} args a list of bigints to get the max of
|
|
6
|
+
* @returns {bigint} the max bigint in the list
|
|
7
7
|
*/
|
|
8
8
|
export declare const bigIntMax: (...args: bigint[]) => bigint;
|
|
9
9
|
/**
|
|
10
10
|
* Returns the min bigint in a list of bigints
|
|
11
11
|
*
|
|
12
|
-
* @param args a list of bigints to get the max of
|
|
13
|
-
* @returns the min bigint in the list
|
|
12
|
+
* @param {bigint[]} args a list of bigints to get the max of
|
|
13
|
+
* @returns {bigint} the min bigint in the list
|
|
14
14
|
*/
|
|
15
15
|
export declare const bigIntMin: (...args: bigint[]) => bigint;
|
|
16
16
|
/**
|
|
17
17
|
* Given a bigint and a min-max range, returns the min-max clamped bigint value
|
|
18
18
|
*
|
|
19
|
-
* @param value a bigint value to clamp
|
|
20
|
-
* @param lower lower bound min max tuple value
|
|
21
|
-
* @param upper upper bound min max tuple value
|
|
22
|
-
* @returns the clamped bigint value per given range
|
|
19
|
+
* @param {BigNumberish} value a bigint value to clamp
|
|
20
|
+
* @param {BigNumberish | undefined} lower lower bound min max tuple value
|
|
21
|
+
* @param {BigNumberish | undefined} upper upper bound min max tuple value
|
|
22
|
+
* @returns {bigint} the clamped bigint value per given range
|
|
23
23
|
*/
|
|
24
24
|
export declare const bigIntClamp: (value: BigNumberish, lower: BigNumberish | null | undefined, upper: BigNumberish | null | undefined) => bigint;
|
|
25
25
|
export declare enum RoundingMode {
|
|
@@ -30,10 +30,10 @@ export declare enum RoundingMode {
|
|
|
30
30
|
* Given a bigint and a number (which can be a float), returns the bigint value.
|
|
31
31
|
* Note: this function has loss and will round down to the nearest integer.
|
|
32
32
|
*
|
|
33
|
-
* @param base - the number to be multiplied
|
|
34
|
-
* @param multiplier - the amount to multiply by
|
|
35
|
-
* @param roundingMode - the rounding mode to use when calculating the percent. defaults to ROUND_UP
|
|
36
|
-
* @returns the bigint value of the multiplication with the number rounded by the rounding mode
|
|
33
|
+
* @param {BigNumberish} base - the number to be multiplied
|
|
34
|
+
* @param {number} multiplier - the amount to multiply by
|
|
35
|
+
* @param {RoundingMode} roundingMode - the rounding mode to use when calculating the percent. defaults to ROUND_UP
|
|
36
|
+
* @returns {bigint} the bigint value of the multiplication with the number rounded by the rounding mode
|
|
37
37
|
*/
|
|
38
38
|
export declare const bigIntMultiply: (base: BigNumberish, multiplier: Multiplier["multiplier"], roundingMode?: RoundingMode) => bigint;
|
|
39
39
|
/**
|
|
@@ -49,8 +49,8 @@ export declare const bigIntMultiply: (base: BigNumberish, multiplier: Multiplier
|
|
|
49
49
|
* });
|
|
50
50
|
* ```
|
|
51
51
|
*
|
|
52
|
-
* @param phrase -- any string value.
|
|
53
|
-
* @returns the bigint value of the hashed string
|
|
52
|
+
* @param {string} phrase -- any string value.
|
|
53
|
+
* @returns {bigint} the bigint value of the hashed string
|
|
54
54
|
*/
|
|
55
55
|
export declare const stringToIndex: (phrase: string) => bigint;
|
|
56
56
|
//# sourceMappingURL=bigint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bigint.d.ts","sourceRoot":"","sources":["../../../src/utils/bigint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGzD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,YAAa,MAAM,EAAE,KAAG,MAM7C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,YAAa,MAAM,EAAE,KAAG,MAM7C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,UACf,YAAY,SACZ,YAAY,GAAG,IAAI,GAAG,SAAS,SAC/B,YAAY,GAAG,IAAI,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"bigint.d.ts","sourceRoot":"","sources":["../../../src/utils/bigint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGzD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,YAAa,MAAM,EAAE,KAAG,MAM7C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,YAAa,MAAM,EAAE,KAAG,MAM7C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,UACf,YAAY,SACZ,YAAY,GAAG,IAAI,GAAG,SAAS,SAC/B,YAAY,GAAG,IAAI,GAAG,SAAS,KACrC,MAkBF,CAAC;AAEF,oBAAY,YAAY;IACtB,UAAU,IAAI;IACd,QAAQ,IAAI;CACb;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,SACnB,YAAY,cACN,UAAU,CAAC,YAAY,CAAC,iBACtB,YAAY,WAiB3B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,WAAY,MAAM,KAAG,MACb,CAAC"}
|
|
@@ -6,11 +6,11 @@ type TakeBytesOpts = {
|
|
|
6
6
|
/**
|
|
7
7
|
* Given a bytes string, returns a slice of the bytes
|
|
8
8
|
*
|
|
9
|
-
* @param bytes - the hex string representing bytes
|
|
10
|
-
* @param opts - optional parameters for slicing the bytes
|
|
11
|
-
* @param opts.offset - the offset in bytes to start slicing from
|
|
12
|
-
* @param opts.count - the number of bytes to slice
|
|
13
|
-
* @returns the sliced bytes
|
|
9
|
+
* @param {Hex} bytes - the hex string representing bytes
|
|
10
|
+
* @param {TakeBytesOpts} opts - optional parameters for slicing the bytes
|
|
11
|
+
* @param {number} opts.offset - the offset in bytes to start slicing from
|
|
12
|
+
* @param {number} opts.count - the number of bytes to slice
|
|
13
|
+
* @returns {Hex} the sliced bytes
|
|
14
14
|
*/
|
|
15
15
|
export declare const takeBytes: (bytes: Hex, opts?: TakeBytesOpts) => Hex;
|
|
16
16
|
export {};
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type { EntryPointVersion } from "../entrypoint/types.js";
|
|
1
|
+
import { type Chain } from "viem";
|
|
3
2
|
import type { UserOperationFeeOptions } from "../types.js";
|
|
4
|
-
/**
|
|
5
|
-
* Utility method returning the default simple account factory address given a {@link Chain} object
|
|
6
|
-
*
|
|
7
|
-
* @param chain - a {@link Chain} object
|
|
8
|
-
* @param version - {@link EntryPointVersion} value that defaults to `defaultEntryPointVersion`
|
|
9
|
-
* @returns a {@link abi.Address} for the given chain
|
|
10
|
-
* @throws if the chain doesn't have an address currently deployed
|
|
11
|
-
*/
|
|
12
|
-
export declare const getDefaultSimpleAccountFactoryAddress: (chain: Chain, version?: EntryPointVersion) => Address;
|
|
13
3
|
export declare const minPriorityFeePerBidDefaults: Map<number, bigint>;
|
|
14
4
|
export declare const getDefaultUserOperationFeeOptions: (chain: Chain) => UserOperationFeeOptions;
|
|
15
5
|
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/utils/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/utils/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE3D,eAAO,MAAM,4BAA4B,qBAIvC,CAAC;AAEH,eAAO,MAAM,iCAAiC,UACrC,KAAK,KACX,uBAOF,CAAC"}
|
|
@@ -3,25 +3,25 @@ import type { RecordableKeys } from "./types.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Utility function that allows for piping a series of async functions together
|
|
5
5
|
*
|
|
6
|
-
* @param fns - functions to pipe
|
|
7
|
-
* @returns result of the pipe
|
|
6
|
+
* @param {((s: S, o?: O, f?: F) => Promise<S>)[]} fns - functions to pipe
|
|
7
|
+
* @returns {S} result of the pipe
|
|
8
8
|
*/
|
|
9
9
|
export declare const asyncPipe: <S, O, F>(...fns: ((s: S, o?: O | undefined, f?: F | undefined) => Promise<S>)[]) => (s: S, o?: O | undefined, f?: F | undefined) => Promise<S>;
|
|
10
10
|
export type Deferrable<T> = {
|
|
11
11
|
[K in keyof T]: PromiseOrValue<T[K]>;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
* Await all of the properties of a
|
|
14
|
+
* Await all of the properties of a Deferrable object
|
|
15
15
|
*
|
|
16
|
-
* @param object - a
|
|
17
|
-
* @returns the object with its properties resolved
|
|
16
|
+
* @param {Deferrable<T>} object - a Deferrable object
|
|
17
|
+
* @returns {Promise<T>} the object with its properties resolved
|
|
18
18
|
*/
|
|
19
19
|
export declare function resolveProperties<T>(object: Deferrable<T>): Promise<T>;
|
|
20
20
|
/**
|
|
21
21
|
* Recursively converts all values in an object to hex strings
|
|
22
22
|
*
|
|
23
|
-
* @param obj - obj to deep hexlify
|
|
24
|
-
* @returns object with all of its values hexlified
|
|
23
|
+
* @param {any} obj - obj to deep hexlify
|
|
24
|
+
* @returns {any} object with all of its values hexlified
|
|
25
25
|
*/
|
|
26
26
|
export declare function deepHexlify(obj: any): any;
|
|
27
27
|
/**
|
|
@@ -63,17 +63,17 @@ export declare function pick(obj: Record<string, unknown>, keys: string | string
|
|
|
63
63
|
/**
|
|
64
64
|
* Utility method for checking if the passed in values are all equal (strictly)
|
|
65
65
|
*
|
|
66
|
-
* @param params - values to check
|
|
67
|
-
* @returns a boolean indicating if all values are the same
|
|
66
|
+
* @param {...any[]} params - values to check
|
|
67
|
+
* @returns {boolean} a boolean indicating if all values are the same
|
|
68
68
|
* @throws if no values are passed in
|
|
69
69
|
*/
|
|
70
70
|
export declare const allEqual: (...params: any[]) => boolean;
|
|
71
71
|
/**
|
|
72
72
|
* Utility method for checking the condition and return the value if condition holds true, undefined if not.
|
|
73
73
|
*
|
|
74
|
-
* @param condition - condition to check
|
|
75
|
-
* @param value - value to return when condition holds true
|
|
76
|
-
* @returns the value if condition holds true, undefined if not
|
|
74
|
+
* @param {Promise<boolean>} condition - condition to check
|
|
75
|
+
* @param {() => Promise<T>} value - value to return when condition holds true
|
|
76
|
+
* @returns {Promise<T | undefined>} the value if condition holds true, undefined if not
|
|
77
77
|
*/
|
|
78
78
|
export declare const conditionalReturn: <T>(condition: Promise<boolean>, value: () => Promise<T>) => Promise<T | undefined>;
|
|
79
79
|
/**
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export type NoUndefined<T> = T extends undefined ? never : T;
|
|
9
9
|
/**
|
|
10
|
-
* @description Checks if
|
|
10
|
+
* @description Checks if T is `undefined`
|
|
11
11
|
* @param T - Type to check
|
|
12
12
|
* @example
|
|
13
13
|
* type Result = IsUndefined<undefined>
|
|
@@ -18,7 +18,7 @@ export type RequiredBy<TType, TKeys extends keyof TType> = Required<Pick<TType,
|
|
|
18
18
|
/**
|
|
19
19
|
* @description Combines members of an intersection into a readable type.
|
|
20
20
|
*
|
|
21
|
-
* @see
|
|
21
|
+
* @see https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg
|
|
22
22
|
* @example
|
|
23
23
|
* Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>
|
|
24
24
|
* => { a: string, b: string, c: number, d: bigint }
|