@aa-sdk/core 4.0.0-beta.0 → 4.0.0-beta.10
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/esm/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +9 -4
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js +17 -12
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
- package/dist/esm/actions/smartAccount/signMessage.js +1 -1
- package/dist/esm/actions/smartAccount/signMessage.js.map +1 -1
- package/dist/esm/actions/smartAccount/signTypedData.js +1 -1
- package/dist/esm/actions/smartAccount/signTypedData.js.map +1 -1
- package/dist/esm/client/decorators/smartAccountClient.d.ts +2 -5
- package/dist/esm/client/decorators/smartAccountClient.js +1 -5
- package/dist/esm/client/decorators/smartAccountClient.js.map +1 -1
- package/dist/esm/middleware/erc7677middleware.d.ts +4 -4
- package/dist/esm/middleware/erc7677middleware.js.map +1 -1
- package/dist/esm/signer/local-account.d.ts +17 -5
- package/dist/esm/signer/local-account.js +19 -2
- package/dist/esm/signer/local-account.js.map +1 -1
- package/dist/esm/signer/types.d.ts +1 -3
- package/dist/esm/signer/types.js.map +1 -1
- package/dist/esm/signer/wallet-client.d.ts +2 -4
- package/dist/esm/signer/wallet-client.js +3 -2
- package/dist/esm/signer/wallet-client.js.map +1 -1
- package/dist/esm/types.d.ts +0 -30
- package/dist/esm/types.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/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +9 -4
- package/dist/types/actions/smartAccount/checkGasSponsorshipEligibility.d.ts.map +1 -1
- package/dist/types/client/decorators/smartAccountClient.d.ts +2 -5
- package/dist/types/client/decorators/smartAccountClient.d.ts.map +1 -1
- package/dist/types/middleware/erc7677middleware.d.ts +4 -4
- package/dist/types/middleware/erc7677middleware.d.ts.map +1 -1
- package/dist/types/signer/local-account.d.ts +17 -5
- package/dist/types/signer/local-account.d.ts.map +1 -1
- package/dist/types/signer/types.d.ts +1 -3
- package/dist/types/signer/types.d.ts.map +1 -1
- package/dist/types/signer/wallet-client.d.ts +2 -4
- package/dist/types/signer/wallet-client.d.ts.map +1 -1
- package/dist/types/types.d.ts +0 -30
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +4 -6
- package/src/actions/smartAccount/checkGasSponsorshipEligibility.ts +33 -16
- package/src/actions/smartAccount/signMessage.ts +1 -1
- package/src/actions/smartAccount/signTypedData.ts +1 -1
- package/src/client/decorators/smartAccountClient.ts +9 -14
- package/src/middleware/erc7677middleware.ts +9 -9
- package/src/signer/local-account.ts +26 -4
- package/src/signer/types.ts +2 -2
- package/src/signer/wallet-client.ts +8 -4
- package/src/types.ts +0 -56
- package/src/version.ts +1 -1
- package/dist/esm/actions/smartAccount/signMessageWith6492.d.ts +0 -4
- package/dist/esm/actions/smartAccount/signMessageWith6492.js +0 -8
- package/dist/esm/actions/smartAccount/signMessageWith6492.js.map +0 -1
- package/dist/esm/actions/smartAccount/signTypedDataWith6492.d.ts +0 -6
- package/dist/esm/actions/smartAccount/signTypedDataWith6492.js +0 -8
- package/dist/esm/actions/smartAccount/signTypedDataWith6492.js.map +0 -1
- package/dist/types/actions/smartAccount/signMessageWith6492.d.ts +0 -5
- package/dist/types/actions/smartAccount/signMessageWith6492.d.ts.map +0 -1
- package/dist/types/actions/smartAccount/signTypedDataWith6492.d.ts +0 -7
- package/dist/types/actions/smartAccount/signTypedDataWith6492.d.ts.map +0 -1
- package/src/actions/smartAccount/signMessageWith6492.ts +0 -21
- package/src/actions/smartAccount/signTypedDataWith6492.ts +0 -23
|
@@ -15,7 +15,10 @@ import type {
|
|
|
15
15
|
import { buildUserOperation } from "../../actions/smartAccount/buildUserOperation.js";
|
|
16
16
|
import { buildUserOperationFromTx } from "../../actions/smartAccount/buildUserOperationFromTx.js";
|
|
17
17
|
import { buildUserOperationFromTxs } from "../../actions/smartAccount/buildUserOperationFromTxs.js";
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
checkGasSponsorshipEligibility,
|
|
20
|
+
type CheckGasSponsorshipEligibilityResult,
|
|
21
|
+
} from "../../actions/smartAccount/checkGasSponsorshipEligibility.js";
|
|
19
22
|
import { dropAndReplaceUserOperation } from "../../actions/smartAccount/dropAndReplaceUserOperation.js";
|
|
20
23
|
import { getAddress } from "../../actions/smartAccount/getAddress.js";
|
|
21
24
|
import { sendTransaction } from "../../actions/smartAccount/sendTransaction.js";
|
|
@@ -25,12 +28,10 @@ import {
|
|
|
25
28
|
signMessage,
|
|
26
29
|
type SignMessageParameters,
|
|
27
30
|
} from "../../actions/smartAccount/signMessage.js";
|
|
28
|
-
import { signMessageWith6492 } from "../../actions/smartAccount/signMessageWith6492.js";
|
|
29
31
|
import {
|
|
30
32
|
signTypedData,
|
|
31
33
|
type SignTypedDataParameters,
|
|
32
34
|
} from "../../actions/smartAccount/signTypedData.js";
|
|
33
|
-
import { signTypedDataWith6492 } from "../../actions/smartAccount/signTypedDataWith6492.js";
|
|
34
35
|
import { signUserOperation } from "../../actions/smartAccount/signUserOperation.js";
|
|
35
36
|
import type {
|
|
36
37
|
BuildTransactionParameters,
|
|
@@ -79,10 +80,13 @@ export type BaseSmartAccountClientActions<
|
|
|
79
80
|
checkGasSponsorshipEligibility: <
|
|
80
81
|
TContext extends UserOperationContext | undefined =
|
|
81
82
|
| UserOperationContext
|
|
82
|
-
| undefined
|
|
83
|
+
| undefined,
|
|
84
|
+
TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
|
|
83
85
|
>(
|
|
84
86
|
args: SendUserOperationParameters<TAccount, TContext>
|
|
85
|
-
) => Promise<
|
|
87
|
+
) => Promise<
|
|
88
|
+
CheckGasSponsorshipEligibilityResult<TAccount, TEntryPointVersion>
|
|
89
|
+
>;
|
|
86
90
|
signUserOperation: (
|
|
87
91
|
args: SignUserOperationParameters<TAccount, TEntryPointVersion, TContext>
|
|
88
92
|
) => Promise<UserOperationRequest<TEntryPointVersion>>;
|
|
@@ -119,13 +123,6 @@ export type BaseSmartAccountClientActions<
|
|
|
119
123
|
>(
|
|
120
124
|
args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>
|
|
121
125
|
) => Promise<Hex>;
|
|
122
|
-
signMessageWith6492: (args: SignMessageParameters<TAccount>) => Promise<Hex>;
|
|
123
|
-
signTypedDataWith6492: <
|
|
124
|
-
const TTypedData extends TypedData | { [key: string]: unknown },
|
|
125
|
-
TPrimaryType extends string = string
|
|
126
|
-
>(
|
|
127
|
-
args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>
|
|
128
|
-
) => Promise<Hex>;
|
|
129
126
|
} & (IsUndefined<TAccount> extends false
|
|
130
127
|
? { getAddress: () => Address }
|
|
131
128
|
: {
|
|
@@ -172,8 +169,6 @@ export const smartAccountClientActions: <
|
|
|
172
169
|
getAddress: (args) => getAddress(client, args),
|
|
173
170
|
signMessage: (args) => signMessage(client, args),
|
|
174
171
|
signTypedData: (args) => signTypedData(client, args),
|
|
175
|
-
signMessageWith6492: (args) => signMessageWith6492(client, args),
|
|
176
|
-
signTypedDataWith6492: (args) => signTypedDataWith6492(client, args),
|
|
177
172
|
});
|
|
178
173
|
|
|
179
174
|
export const smartAccountClientMethodKeys = Object.keys(
|
|
@@ -22,10 +22,12 @@ import {
|
|
|
22
22
|
} from "../utils/index.js";
|
|
23
23
|
import type { ClientMiddlewareFn } from "./types";
|
|
24
24
|
|
|
25
|
-
export type Erc7677RpcSchema
|
|
25
|
+
export type Erc7677RpcSchema<
|
|
26
|
+
TContext extends Record<string, any> = Record<string, any>
|
|
27
|
+
> = [
|
|
26
28
|
{
|
|
27
29
|
Method: "pm_getPaymasterStubData";
|
|
28
|
-
Parameters: [UserOperationRequest, Address, Hex,
|
|
30
|
+
Parameters: [UserOperationRequest, Address, Hex, TContext];
|
|
29
31
|
ReturnType: {
|
|
30
32
|
sponsor?: { name: string; icon?: string }; // Sponsor info
|
|
31
33
|
paymaster?: Address; // Paymaster address (entrypoint v0.7)
|
|
@@ -38,7 +40,7 @@ export type Erc7677RpcSchema = [
|
|
|
38
40
|
},
|
|
39
41
|
{
|
|
40
42
|
Method: "pm_getPaymasterData";
|
|
41
|
-
Parameters: [UserOperationRequest, Address, Hex,
|
|
43
|
+
Parameters: [UserOperationRequest, Address, Hex, TContext];
|
|
42
44
|
ReturnType: {
|
|
43
45
|
paymaster?: Address; // Paymaster address (entrypoint v0.7)
|
|
44
46
|
paymasterData?: Hex; // Paymaster data (entrypoint v0.7)
|
|
@@ -47,12 +49,10 @@ export type Erc7677RpcSchema = [
|
|
|
47
49
|
}
|
|
48
50
|
];
|
|
49
51
|
|
|
50
|
-
export type Erc7677Client<
|
|
51
|
-
T,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Erc7677RpcSchema
|
|
55
|
-
>;
|
|
52
|
+
export type Erc7677Client<
|
|
53
|
+
T extends Transport = Transport,
|
|
54
|
+
TContext extends Record<string, any> = Record<string, any>
|
|
55
|
+
> = Client<T, Chain, undefined, Erc7677RpcSchema<TContext>>;
|
|
56
56
|
|
|
57
57
|
export type Erc7677MiddlewareParams<
|
|
58
58
|
TContext extends Record<string, any> | undefined =
|
|
@@ -8,7 +8,11 @@ import {
|
|
|
8
8
|
type TypedData,
|
|
9
9
|
type TypedDataDefinition,
|
|
10
10
|
} from "viem";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
generatePrivateKey,
|
|
13
|
+
mnemonicToAccount,
|
|
14
|
+
privateKeyToAccount,
|
|
15
|
+
} from "viem/accounts";
|
|
12
16
|
import type { SmartAccountSigner } from "./types.js";
|
|
13
17
|
|
|
14
18
|
/**
|
|
@@ -83,8 +87,8 @@ export class LocalAccountSigner<
|
|
|
83
87
|
* @returns {Promise<Hex>} A promise that resolves to the signed data in hexadecimal format
|
|
84
88
|
*/
|
|
85
89
|
readonly signTypedData = async <
|
|
86
|
-
const TTypedData extends TypedData |
|
|
87
|
-
TPrimaryType extends
|
|
90
|
+
const TTypedData extends TypedData | Record<string, unknown>,
|
|
91
|
+
TPrimaryType extends keyof TTypedData | "EIP712Domain" = keyof TTypedData
|
|
88
92
|
>(
|
|
89
93
|
params: TypedDataDefinition<TTypedData, TPrimaryType>
|
|
90
94
|
): Promise<Hex> => {
|
|
@@ -145,10 +149,28 @@ export class LocalAccountSigner<
|
|
|
145
149
|
*
|
|
146
150
|
* @param {Hex} key The private key in hexadecimal format
|
|
147
151
|
* @returns {LocalAccountSigner<PrivateKeyAccount>} An instance of `LocalAccountSigner` initialized with the provided private key
|
|
148
|
-
*/
|
|
152
|
+
*/
|
|
153
|
+
static privateKeyToAccountSigner(
|
|
149
154
|
key: Hex
|
|
150
155
|
): LocalAccountSigner<PrivateKeyAccount> {
|
|
151
156
|
const signer = privateKeyToAccount(key);
|
|
152
157
|
return new LocalAccountSigner(signer);
|
|
153
158
|
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Generates a new private key and creates a `LocalAccountSigner` for a `PrivateKeyAccount`.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```ts
|
|
165
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
166
|
+
*
|
|
167
|
+
* const signer = LocalAccountSigner.generatePrivateKeySigner();
|
|
168
|
+
* ```
|
|
169
|
+
*
|
|
170
|
+
* @returns {LocalAccountSigner<PrivateKeyAccount>} A `LocalAccountSigner` instance initialized with the generated private key account
|
|
171
|
+
*/
|
|
172
|
+
static generatePrivateKeySigner(): LocalAccountSigner<PrivateKeyAccount> {
|
|
173
|
+
const signer = privateKeyToAccount(generatePrivateKey());
|
|
174
|
+
return new LocalAccountSigner(signer);
|
|
175
|
+
}
|
|
154
176
|
}
|
package/src/signer/types.ts
CHANGED
|
@@ -37,8 +37,8 @@ export interface SmartAccountSigner<Inner = any> {
|
|
|
37
37
|
signMessage: (message: SignableMessage) => Promise<Hex>;
|
|
38
38
|
|
|
39
39
|
signTypedData: <
|
|
40
|
-
const TTypedData extends TypedData |
|
|
41
|
-
TPrimaryType extends
|
|
40
|
+
const TTypedData extends TypedData | Record<string, unknown>,
|
|
41
|
+
TPrimaryType extends keyof TTypedData | "EIP712Domain" = keyof TTypedData
|
|
42
42
|
>(
|
|
43
43
|
params: TypedDataDefinition<TTypedData, TPrimaryType>
|
|
44
44
|
) => Promise<Hex>;
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
type TypedDataDefinition,
|
|
7
7
|
type WalletClient,
|
|
8
8
|
} from "viem";
|
|
9
|
+
import type { Account } from "viem/accounts";
|
|
10
|
+
import type { SignTypedDataParameters } from "viem/actions";
|
|
9
11
|
import { InvalidSignerTypeError } from "../errors/signer.js";
|
|
10
12
|
import type { SmartAccountSigner } from "./types";
|
|
11
13
|
|
|
@@ -126,16 +128,18 @@ export class WalletClientSigner implements SmartAccountSigner<WalletClient> {
|
|
|
126
128
|
* @returns {Promise<Hex>} A promise that resolves to a hex string representing the signed data
|
|
127
129
|
*/
|
|
128
130
|
signTypedData = async <
|
|
129
|
-
const TTypedData extends TypedData |
|
|
130
|
-
TPrimaryType extends string = string
|
|
131
|
+
const TTypedData extends TypedData | Record<string, unknown>,
|
|
132
|
+
TPrimaryType extends keyof TTypedData | "EIP712Domain" | string = string
|
|
131
133
|
>(
|
|
132
134
|
typedData: TypedDataDefinition<TTypedData, TPrimaryType>
|
|
133
135
|
): Promise<Hex> => {
|
|
134
136
|
const account = this.inner.account ?? (await this.getAddress());
|
|
135
137
|
|
|
136
|
-
|
|
138
|
+
const params = {
|
|
137
139
|
account,
|
|
138
140
|
...typedData,
|
|
139
|
-
}
|
|
141
|
+
} as SignTypedDataParameters<TTypedData, string, Account | undefined>;
|
|
142
|
+
|
|
143
|
+
return this.inner.signTypedData<TTypedData, string>(params);
|
|
140
144
|
};
|
|
141
145
|
}
|
package/src/types.ts
CHANGED
|
@@ -278,62 +278,6 @@ export interface UserOperationReceipt {
|
|
|
278
278
|
}
|
|
279
279
|
// [!endregion UserOperationReceipt]
|
|
280
280
|
|
|
281
|
-
/** @deprecated use viem type TransactionReceipt instead */
|
|
282
|
-
export interface UserOperationReceiptObject {
|
|
283
|
-
/* 32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log */
|
|
284
|
-
blockHash: Hash;
|
|
285
|
-
/* The block number where this log was in. null when its pending. null when its pending log. */
|
|
286
|
-
blockNumber: BigNumberish;
|
|
287
|
-
/* The index of the transaction within the block. */
|
|
288
|
-
transactionIndex: BigNumberish;
|
|
289
|
-
/* 32 Bytes - hash of the transaction. null when its pending. */
|
|
290
|
-
transactionHash: Hash;
|
|
291
|
-
/* 20 Bytes - address of the sender */
|
|
292
|
-
from: Address;
|
|
293
|
-
/* 20 Bytes - address of the receiver. null when its a contract creation transaction */
|
|
294
|
-
to: Address;
|
|
295
|
-
/* The total amount of gas used when this transaction was executed in the block. */
|
|
296
|
-
cumulativeGasUsed: BigNumberish;
|
|
297
|
-
/* The amount of gas used by this specific transaction alone */
|
|
298
|
-
gasUsed: BigNumberish;
|
|
299
|
-
/* 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null */
|
|
300
|
-
contractAddress: Address;
|
|
301
|
-
logs: UserOperationReceiptLog[];
|
|
302
|
-
/* 256 Bytes - Bloom filter for light clients to quickly retrieve related logs */
|
|
303
|
-
logsBloom: Hex;
|
|
304
|
-
/* 32 bytes of post-transaction stateroot. (pre Byzantium hard fork at block 4,370,000) */
|
|
305
|
-
root: Hex;
|
|
306
|
-
/* Either 1 (success) or 0 (failure). (post Byzantium hard fork at block 4,370,000) */
|
|
307
|
-
status: number;
|
|
308
|
-
/* The cumulative gas used in the block containing this UserOperation. */
|
|
309
|
-
effectiveGasPrice: BigNumberish;
|
|
310
|
-
/* The type of the recipt object */
|
|
311
|
-
type: string;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/** @deprecated use viem type Log instead */
|
|
315
|
-
/* https://github.com/wevm/viem/blob/6ef4ac131a878bf1dc4b335f5dc127e62618dda0/src/types/log.ts#L15 */
|
|
316
|
-
export interface UserOperationReceiptLog {
|
|
317
|
-
/* The hash of the block where the given transaction was included. */
|
|
318
|
-
blockHash: Hash;
|
|
319
|
-
/* The number of the block where the given transaction was included. */
|
|
320
|
-
blockNumber: BigNumberish;
|
|
321
|
-
/* The index of the transaction within the block. */
|
|
322
|
-
transactionIndex: BigNumberish;
|
|
323
|
-
/* 20 Bytes - address from which this log originated. */
|
|
324
|
-
address: Address;
|
|
325
|
-
/* Integer of the log index position in the block. null when its pending log. */
|
|
326
|
-
logIndex: BigNumberish;
|
|
327
|
-
/* Contains one or more 32 Bytes non-indexed arguments of the log. */
|
|
328
|
-
data: Hex;
|
|
329
|
-
/* true when the log was removed, due to a chain reorganization. false if its a valid log. */
|
|
330
|
-
removed: boolean;
|
|
331
|
-
/* Array of zero to four 32 Bytes DATA of indexed log arguments. */
|
|
332
|
-
topics: string[];
|
|
333
|
-
/* hash of the transaction */
|
|
334
|
-
transactionHash: Hash;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
281
|
// [!region UserOperationStruct_v6]
|
|
338
282
|
// https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.6/test/UserOperation.ts
|
|
339
283
|
// this is used for building requests for v0.6 entry point contract
|
package/src/version.ts
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Chain, Client, Hex, Transport } from "viem";
|
|
2
|
-
import type { SmartContractAccount } from "../../account/smartContractAccount";
|
|
3
|
-
import type { SignMessageParameters } from "./signMessage";
|
|
4
|
-
export declare const signMessageWith6492: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined>(client: Client<TTransport, TChain, TAccount>, args: SignMessageParameters<TAccount>) => Promise<Hex>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AccountNotFoundError } from "../../errors/account.js";
|
|
2
|
-
export const signMessageWith6492 = async (client, { account = client.account, message }) => {
|
|
3
|
-
if (!account) {
|
|
4
|
-
throw new AccountNotFoundError();
|
|
5
|
-
}
|
|
6
|
-
return account.signMessageWith6492({ message });
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=signMessageWith6492.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"signMessageWith6492.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/signMessageWith6492.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,MAAM,CAAC,MAAM,mBAAmB,GASZ,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;IAC1E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,OAAO,OAAO,CAAC,mBAAmB,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC","sourcesContent":["import type { Chain, Client, Hex, Transport } from \"viem\";\nimport type { SmartContractAccount } from \"../../account/smartContractAccount\";\nimport { AccountNotFoundError } from \"../../errors/account.js\";\nimport type { SignMessageParameters } from \"./signMessage\";\n\nexport const signMessageWith6492: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>,\n args: SignMessageParameters<TAccount>\n) => Promise<Hex> = async (client, { account = client.account, message }) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n return account.signMessageWith6492({ message });\n};\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Chain, Client, Hex, Transport, TypedData } from "viem";
|
|
2
|
-
import type { SmartContractAccount } from "../../account/smartContractAccount";
|
|
3
|
-
import type { SignTypedDataParameters } from "./signTypedData";
|
|
4
|
-
export declare const signTypedDataWith6492: <const TTypedData extends TypedData | {
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
}, TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TPrimaryType extends string = string>(client: Client<TTransport, TChain, TAccount>, args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>) => Promise<Hex>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AccountNotFoundError } from "../../errors/account.js";
|
|
2
|
-
export const signTypedDataWith6492 = async (client, { account = client.account, typedData }) => {
|
|
3
|
-
if (!account) {
|
|
4
|
-
throw new AccountNotFoundError();
|
|
5
|
-
}
|
|
6
|
-
return account.signTypedDataWith6492(typedData);
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=signTypedDataWith6492.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"signTypedDataWith6492.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/signTypedDataWith6492.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,MAAM,CAAC,MAAM,qBAAqB,GAWd,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;IAC5E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,OAAO,OAAO,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAClD,CAAC,CAAC","sourcesContent":["import type { Chain, Client, Hex, Transport, TypedData } from \"viem\";\nimport type { SmartContractAccount } from \"../../account/smartContractAccount\";\nimport { AccountNotFoundError } from \"../../errors/account.js\";\nimport type { SignTypedDataParameters } from \"./signTypedData\";\n\nexport const signTypedDataWith6492: <\n const TTypedData extends TypedData | { [key: string]: unknown },\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TPrimaryType extends string = string\n>(\n client: Client<TTransport, TChain, TAccount>,\n args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>\n) => Promise<Hex> = async (client, { account = client.account, typedData }) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n return account.signTypedDataWith6492(typedData);\n};\n"]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Chain, Client, Hex, Transport } from "viem";
|
|
2
|
-
import type { SmartContractAccount } from "../../account/smartContractAccount";
|
|
3
|
-
import type { SignMessageParameters } from "./signMessage";
|
|
4
|
-
export declare const signMessageWith6492: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined>(client: Client<TTransport, TChain, TAccount>, args: SignMessageParameters<TAccount>) => Promise<Hex>;
|
|
5
|
-
//# sourceMappingURL=signMessageWith6492.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"signMessageWith6492.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/signMessageWith6492.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE3D,eAAO,MAAM,mBAAmB,EAAE,CAChC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EAEb,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5C,IAAI,EAAE,qBAAqB,CAAC,QAAQ,CAAC,KAClC,OAAO,CAAC,GAAG,CAMf,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Chain, Client, Hex, Transport, TypedData } from "viem";
|
|
2
|
-
import type { SmartContractAccount } from "../../account/smartContractAccount";
|
|
3
|
-
import type { SignTypedDataParameters } from "./signTypedData";
|
|
4
|
-
export declare const signTypedDataWith6492: <const TTypedData extends TypedData | {
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
}, TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TPrimaryType extends string = string>(client: Client<TTransport, TChain, TAccount>, args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>) => Promise<Hex>;
|
|
7
|
-
//# sourceMappingURL=signTypedDataWith6492.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"signTypedDataWith6492.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/signTypedDataWith6492.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/D,eAAO,MAAM,qBAAqB,EAAE,CAClC,KAAK,CAAC,UAAU,SAAS,SAAS,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EAC/D,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,YAAY,SAAS,MAAM,GAAG,MAAM,EAEpC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5C,IAAI,EAAE,uBAAuB,CAAC,UAAU,EAAE,YAAY,EAAE,QAAQ,CAAC,KAC9D,OAAO,CAAC,GAAG,CAMf,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Chain, Client, Hex, Transport } from "viem";
|
|
2
|
-
import type { SmartContractAccount } from "../../account/smartContractAccount";
|
|
3
|
-
import { AccountNotFoundError } from "../../errors/account.js";
|
|
4
|
-
import type { SignMessageParameters } from "./signMessage";
|
|
5
|
-
|
|
6
|
-
export const signMessageWith6492: <
|
|
7
|
-
TTransport extends Transport = Transport,
|
|
8
|
-
TChain extends Chain | undefined = Chain | undefined,
|
|
9
|
-
TAccount extends SmartContractAccount | undefined =
|
|
10
|
-
| SmartContractAccount
|
|
11
|
-
| undefined
|
|
12
|
-
>(
|
|
13
|
-
client: Client<TTransport, TChain, TAccount>,
|
|
14
|
-
args: SignMessageParameters<TAccount>
|
|
15
|
-
) => Promise<Hex> = async (client, { account = client.account, message }) => {
|
|
16
|
-
if (!account) {
|
|
17
|
-
throw new AccountNotFoundError();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return account.signMessageWith6492({ message });
|
|
21
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Chain, Client, Hex, Transport, TypedData } from "viem";
|
|
2
|
-
import type { SmartContractAccount } from "../../account/smartContractAccount";
|
|
3
|
-
import { AccountNotFoundError } from "../../errors/account.js";
|
|
4
|
-
import type { SignTypedDataParameters } from "./signTypedData";
|
|
5
|
-
|
|
6
|
-
export const signTypedDataWith6492: <
|
|
7
|
-
const TTypedData extends TypedData | { [key: string]: unknown },
|
|
8
|
-
TTransport extends Transport = Transport,
|
|
9
|
-
TChain extends Chain | undefined = Chain | undefined,
|
|
10
|
-
TAccount extends SmartContractAccount | undefined =
|
|
11
|
-
| SmartContractAccount
|
|
12
|
-
| undefined,
|
|
13
|
-
TPrimaryType extends string = string
|
|
14
|
-
>(
|
|
15
|
-
client: Client<TTransport, TChain, TAccount>,
|
|
16
|
-
args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>
|
|
17
|
-
) => Promise<Hex> = async (client, { account = client.account, typedData }) => {
|
|
18
|
-
if (!account) {
|
|
19
|
-
throw new AccountNotFoundError();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return account.signTypedDataWith6492(typedData);
|
|
23
|
-
};
|