permissionless 0.0.12 → 0.0.13
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 +10 -0
- package/_cjs/accounts/index.js +9 -2
- package/_cjs/accounts/index.js.map +1 -1
- package/_cjs/accounts/privateKeyToSafeSmartAccount.js +24 -0
- package/_cjs/accounts/privateKeyToSafeSmartAccount.js.map +1 -0
- package/_cjs/accounts/privateKeyToSimpleSmartAccount.js +8 -160
- package/_cjs/accounts/privateKeyToSimpleSmartAccount.js.map +1 -1
- package/_cjs/accounts/signerToSafeSmartAccount.js +492 -0
- package/_cjs/accounts/signerToSafeSmartAccount.js.map +1 -0
- package/_cjs/accounts/signerToSimpleSmartAccount.js +190 -0
- package/_cjs/accounts/signerToSimpleSmartAccount.js.map +1 -0
- package/_cjs/accounts/types.js +20 -0
- package/_cjs/accounts/types.js.map +1 -1
- package/_cjs/actions/bundler/chainId.js.map +1 -1
- package/_cjs/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_cjs/actions/bundler/getUserOperationByHash.js.map +1 -1
- package/_cjs/actions/bundler/getUserOperationReceipt.js.map +1 -1
- package/_cjs/actions/bundler/sendUserOperation.js.map +1 -1
- package/_cjs/actions/bundler/supportedEntryPoints.js.map +1 -1
- package/_cjs/actions/bundler/waitForUserOperationReceipt.js.map +1 -1
- package/_cjs/actions/smartAccount/prepareUserOperationRequest.js +3 -1
- package/_cjs/actions/smartAccount/prepareUserOperationRequest.js.map +1 -1
- package/_cjs/actions/smartAccount/sendTransaction.js +3 -2
- package/_cjs/actions/smartAccount/sendTransaction.js.map +1 -1
- package/_cjs/actions/smartAccount/sendTransactions.js +46 -0
- package/_cjs/actions/smartAccount/sendTransactions.js.map +1 -0
- package/_cjs/actions/smartAccount.js +3 -1
- package/_cjs/actions/smartAccount.js.map +1 -1
- package/_cjs/clients/decorators/smartAccount.js +5 -0
- package/_cjs/clients/decorators/smartAccount.js.map +1 -1
- package/_esm/accounts/index.js +6 -3
- package/_esm/accounts/index.js.map +1 -1
- package/_esm/accounts/privateKeyToSafeSmartAccount.js +26 -0
- package/_esm/accounts/privateKeyToSafeSmartAccount.js.map +1 -0
- package/_esm/accounts/privateKeyToSimpleSmartAccount.js +9 -160
- package/_esm/accounts/privateKeyToSimpleSmartAccount.js.map +1 -1
- package/_esm/accounts/signerToSafeSmartAccount.js +499 -0
- package/_esm/accounts/signerToSafeSmartAccount.js.map +1 -0
- package/_esm/accounts/signerToSimpleSmartAccount.js +191 -0
- package/_esm/accounts/signerToSimpleSmartAccount.js.map +1 -0
- package/_esm/accounts/types.js +18 -0
- package/_esm/accounts/types.js.map +1 -1
- package/_esm/actions/bundler/chainId.js.map +1 -1
- package/_esm/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_esm/actions/bundler/getUserOperationByHash.js.map +1 -1
- package/_esm/actions/bundler/getUserOperationReceipt.js.map +1 -1
- package/_esm/actions/bundler/sendUserOperation.js.map +1 -1
- package/_esm/actions/bundler/supportedEntryPoints.js.map +1 -1
- package/_esm/actions/bundler/waitForUserOperationReceipt.js.map +1 -1
- package/_esm/actions/pimlico/getUserOperationGasPrice.js +1 -1
- package/_esm/actions/pimlico/getUserOperationStatus.js +1 -1
- package/_esm/actions/smartAccount/prepareUserOperationRequest.js +3 -1
- package/_esm/actions/smartAccount/prepareUserOperationRequest.js.map +1 -1
- package/_esm/actions/smartAccount/sendTransaction.js +3 -2
- package/_esm/actions/smartAccount/sendTransaction.js.map +1 -1
- package/_esm/actions/smartAccount/sendTransactions.js +90 -0
- package/_esm/actions/smartAccount/sendTransactions.js.map +1 -0
- package/_esm/actions/smartAccount.js +2 -1
- package/_esm/actions/smartAccount.js.map +1 -1
- package/_esm/actions/stackup/accounts.js +1 -1
- package/_esm/actions/stackup/sponsorUserOperation.js +1 -1
- package/_esm/clients/decorators/pimlico.js +1 -1
- package/_esm/clients/decorators/smartAccount.js +5 -0
- package/_esm/clients/decorators/smartAccount.js.map +1 -1
- package/_esm/clients/pimlico.js +1 -1
- package/_esm/clients/stackup.js +1 -1
- package/_types/accounts/index.d.ts +6 -3
- package/_types/accounts/index.d.ts.map +1 -1
- package/_types/accounts/privateKeyToSafeSmartAccount.d.ts +26 -0
- package/_types/accounts/privateKeyToSafeSmartAccount.d.ts.map +1 -0
- package/_types/accounts/privateKeyToSimpleSmartAccount.d.ts +5 -11
- package/_types/accounts/privateKeyToSimpleSmartAccount.d.ts.map +1 -1
- package/_types/accounts/signerToSafeSmartAccount.d.ts +28 -0
- package/_types/accounts/signerToSafeSmartAccount.d.ts.map +1 -0
- package/_types/accounts/signerToSimpleSmartAccount.d.ts +15 -0
- package/_types/accounts/signerToSimpleSmartAccount.d.ts.map +1 -0
- package/_types/accounts/types.d.ts +14 -3
- package/_types/accounts/types.d.ts.map +1 -1
- package/_types/actions/bundler/chainId.d.ts +3 -2
- package/_types/actions/bundler/chainId.d.ts.map +1 -1
- package/_types/actions/bundler/estimateUserOperationGas.d.ts +3 -3
- package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -1
- package/_types/actions/bundler/getUserOperationByHash.d.ts +3 -3
- package/_types/actions/bundler/getUserOperationByHash.d.ts.map +1 -1
- package/_types/actions/bundler/getUserOperationReceipt.d.ts +3 -3
- package/_types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -1
- package/_types/actions/bundler/sendUserOperation.d.ts +3 -3
- package/_types/actions/bundler/sendUserOperation.d.ts.map +1 -1
- package/_types/actions/bundler/supportedEntryPoints.d.ts +3 -3
- package/_types/actions/bundler/supportedEntryPoints.d.ts.map +1 -1
- package/_types/actions/bundler/waitForUserOperationReceipt.d.ts +2 -3
- package/_types/actions/bundler/waitForUserOperationReceipt.d.ts.map +1 -1
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts +1 -1
- package/_types/actions/pimlico/getUserOperationStatus.d.ts +1 -1
- package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts.map +1 -1
- package/_types/actions/smartAccount/sendTransaction.d.ts.map +1 -1
- package/_types/actions/smartAccount/sendTransactions.d.ts +63 -0
- package/_types/actions/smartAccount/sendTransactions.d.ts.map +1 -0
- package/_types/actions/smartAccount.d.ts +2 -1
- package/_types/actions/smartAccount.d.ts.map +1 -1
- package/_types/actions/stackup/accounts.d.ts +1 -1
- package/_types/actions/stackup/sponsorUserOperation.d.ts +1 -1
- package/_types/clients/createSmartAccountClient.d.ts +1 -0
- package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
- package/_types/clients/decorators/bundler.d.ts +1 -1
- package/_types/clients/decorators/pimlico.d.ts +3 -3
- package/_types/clients/decorators/smartAccount.d.ts +51 -0
- package/_types/clients/decorators/smartAccount.d.ts.map +1 -1
- package/_types/clients/pimlico.d.ts +1 -1
- package/_types/clients/stackup.d.ts +1 -1
- package/_types/types/index.d.ts +1 -0
- package/_types/types/index.d.ts.map +1 -1
- package/accounts/index.ts +26 -7
- package/accounts/privateKeyToSafeSmartAccount.ts +73 -0
- package/accounts/privateKeyToSimpleSmartAccount.ts +15 -191
- package/accounts/signerToSafeSmartAccount.ts +775 -0
- package/accounts/signerToSimpleSmartAccount.ts +267 -0
- package/accounts/types.ts +43 -12
- package/actions/bundler/chainId.ts +9 -1
- package/actions/bundler/estimateUserOperationGas.ts +8 -3
- package/actions/bundler/getUserOperationByHash.ts +8 -3
- package/actions/bundler/getUserOperationReceipt.ts +16 -3
- package/actions/bundler/sendUserOperation.ts +8 -3
- package/actions/bundler/supportedEntryPoints.ts +8 -3
- package/actions/bundler/waitForUserOperationReceipt.ts +15 -4
- package/actions/pimlico/getUserOperationGasPrice.ts +1 -1
- package/actions/pimlico/getUserOperationStatus.ts +1 -1
- package/actions/smartAccount/prepareUserOperationRequest.ts +3 -1
- package/actions/smartAccount/sendTransaction.ts +3 -1
- package/actions/smartAccount/sendTransactions.ts +141 -0
- package/actions/smartAccount.ts +8 -1
- package/actions/stackup/accounts.ts +1 -1
- package/actions/stackup/sponsorUserOperation.ts +1 -1
- package/clients/decorators/bundler.ts +1 -1
- package/clients/decorators/pimlico.ts +3 -3
- package/clients/decorators/smartAccount.ts +61 -0
- package/clients/pimlico.ts +1 -1
- package/clients/stackup.ts +1 -1
- package/package.json +2 -2
- package/types/index.ts +5 -0
- package/tsconfig.build.tsbuildinfo +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Address, type Chain, type Client, type Hex, type Transport } from "viem";
|
|
2
|
+
import { type SafeSmartAccount, type SafeVersion } from "./signerToSafeSmartAccount.js";
|
|
3
|
+
/**
|
|
4
|
+
* @description Creates an Simple Account from a private key.
|
|
5
|
+
*
|
|
6
|
+
* @returns A Private Key Simple Account.
|
|
7
|
+
*/
|
|
8
|
+
export declare function privateKeyToSafeSmartAccount<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined>(client: Client<TTransport, TChain>, { privateKey, safeVersion, entryPoint, addModuleLibAddress: _addModuleLibAddress, safe4337ModuleAddress: _safe4337ModuleAddress, safeProxyFactoryAddress: _safeProxyFactoryAddress, safeSingletonAddress: _safeSingletonAddress, multiSendAddress: _multiSendAddress, multiSendCallOnlyAddress: _multiSendCallOnlyAddress, saltNonce, safeModules, setupTransactions }: {
|
|
9
|
+
safeVersion: SafeVersion;
|
|
10
|
+
privateKey: Hex;
|
|
11
|
+
entryPoint: Address;
|
|
12
|
+
addModuleLibAddress?: Address;
|
|
13
|
+
safe4337ModuleAddress?: Address;
|
|
14
|
+
safeProxyFactoryAddress?: Address;
|
|
15
|
+
safeSingletonAddress?: Address;
|
|
16
|
+
multiSendAddress?: Address;
|
|
17
|
+
multiSendCallOnlyAddress?: Address;
|
|
18
|
+
saltNonce?: bigint;
|
|
19
|
+
setupTransactions?: {
|
|
20
|
+
to: Address;
|
|
21
|
+
data: Address;
|
|
22
|
+
value: bigint;
|
|
23
|
+
}[];
|
|
24
|
+
safeModules?: Address[];
|
|
25
|
+
}): Promise<SafeSmartAccount<TTransport, TChain>>;
|
|
26
|
+
//# sourceMappingURL=privateKeyToSafeSmartAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privateKeyToSafeSmartAccount.d.ts","sourceRoot":"","sources":["../../accounts/privateKeyToSafeSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,SAAS,EACjB,MAAM,MAAM,CAAA;AAEb,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAEnB,MAAM,+BAA+B,CAAA;AAEtC;;;;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,CAAC,EAClC,EACI,UAAU,EACV,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,WAAgB,EAChB,iBAAsB,EACzB,EAAE;IACC,WAAW,EAAE,WAAW,CAAA;IACxB,UAAU,EAAE,GAAG,CAAA;IACf,UAAU,EAAE,OAAO,CAAA;IACnB,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,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,GACF,OAAO,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAiB/C"}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import { type Address,
|
|
2
|
-
import { type
|
|
3
|
-
export declare class SignTransactionNotSupportedBySmartAccount extends BaseError {
|
|
4
|
-
name: string;
|
|
5
|
-
constructor({ docsPath }?: {
|
|
6
|
-
docsPath?: string;
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
export type PrivateKeySimpleSmartAccount<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined> = SmartAccount<"privateKeySimpleSmartAccount", transport, chain>;
|
|
1
|
+
import { type Address, type Chain, type Client, type Hex, type Transport } from "viem";
|
|
2
|
+
import { type SimpleSmartAccount } from "./signerToSimpleSmartAccount.js";
|
|
10
3
|
/**
|
|
11
4
|
* @description Creates an Simple Account from a private key.
|
|
12
5
|
*
|
|
13
6
|
* @returns A Private Key Simple Account.
|
|
14
7
|
*/
|
|
15
|
-
export declare function privateKeyToSimpleSmartAccount<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined>(client: Client<TTransport, TChain>, { privateKey, factoryAddress, entryPoint }: {
|
|
8
|
+
export declare function privateKeyToSimpleSmartAccount<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined>(client: Client<TTransport, TChain>, { privateKey, factoryAddress, entryPoint, index }: {
|
|
16
9
|
privateKey: Hex;
|
|
17
10
|
factoryAddress: Address;
|
|
18
11
|
entryPoint: Address;
|
|
19
|
-
|
|
12
|
+
index?: bigint;
|
|
13
|
+
}): Promise<SimpleSmartAccount<TTransport, TChain>>;
|
|
20
14
|
//# sourceMappingURL=privateKeyToSimpleSmartAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"privateKeyToSimpleSmartAccount.d.ts","sourceRoot":"","sources":["../../accounts/privateKeyToSimpleSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,
|
|
1
|
+
{"version":3,"file":"privateKeyToSimpleSmartAccount.d.ts","sourceRoot":"","sources":["../../accounts/privateKeyToSimpleSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,SAAS,EACjB,MAAM,MAAM,CAAA;AAEb,OAAO,EACH,KAAK,kBAAkB,EAE1B,MAAM,iCAAiC,CAAA;AAExC;;;;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,CAAC,EAClC,EACI,UAAU,EACV,cAAc,EACd,UAAU,EACV,KAAU,EACb,EAAE;IACC,UAAU,EAAE,GAAG,CAAA;IACf,cAAc,EAAE,OAAO,CAAA;IACvB,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB,GACF,OAAO,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CASjD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type Address, type Chain, type Client, type Transport } from "viem";
|
|
2
|
+
import { type SmartAccount, type SmartAccountSigner } from "./types.js";
|
|
3
|
+
export type SafeVersion = "1.4.1";
|
|
4
|
+
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>(client: Client<TTransport, TChain>, { signer, safeVersion, entryPoint, addModuleLibAddress: _addModuleLibAddress, safe4337ModuleAddress: _safe4337ModuleAddress, safeProxyFactoryAddress: _safeProxyFactoryAddress, safeSingletonAddress: _safeSingletonAddress, multiSendAddress: _multiSendAddress, multiSendCallOnlyAddress: _multiSendCallOnlyAddress, saltNonce, safeModules, setupTransactions }: {
|
|
11
|
+
safeVersion: SafeVersion;
|
|
12
|
+
signer: SmartAccountSigner;
|
|
13
|
+
entryPoint: Address;
|
|
14
|
+
addModuleLibAddress?: Address;
|
|
15
|
+
safe4337ModuleAddress?: Address;
|
|
16
|
+
safeProxyFactoryAddress?: Address;
|
|
17
|
+
safeSingletonAddress?: Address;
|
|
18
|
+
multiSendAddress?: Address;
|
|
19
|
+
multiSendCallOnlyAddress?: Address;
|
|
20
|
+
saltNonce?: bigint;
|
|
21
|
+
setupTransactions?: {
|
|
22
|
+
to: Address;
|
|
23
|
+
data: Address;
|
|
24
|
+
value: bigint;
|
|
25
|
+
}[];
|
|
26
|
+
safeModules?: Address[];
|
|
27
|
+
}): Promise<SafeSmartAccount<TTransport, TChain>>;
|
|
28
|
+
//# sourceMappingURL=signerToSafeSmartAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signerToSafeSmartAccount.d.ts","sourceRoot":"","sources":["../../accounts/signerToSafeSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EAGX,KAAK,SAAS,EAajB,MAAM,MAAM,CAAA;AAUb,OAAO,EAEH,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAC1B,MAAM,YAAY,CAAA;AAEnB,MAAM,MAAM,WAAW,GAAG,OAAO,CAAA;AAmIjC,MAAM,MAAM,gBAAgB,CACxB,SAAS,SAAS,SAAS,GAAG,S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1
|
+
import { type Address, type Chain, type Client, type Transport } from "viem";
|
|
2
|
+
import { type SmartAccount, type SmartAccountSigner } from "./types.js";
|
|
3
|
+
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>(client: Client<TTransport, TChain>, { signer, factoryAddress, entryPoint, index }: {
|
|
10
|
+
signer: SmartAccountSigner;
|
|
11
|
+
factoryAddress: Address;
|
|
12
|
+
entryPoint: Address;
|
|
13
|
+
index?: bigint;
|
|
14
|
+
}): Promise<SimpleSmartAccount<TTransport, TChain>>;
|
|
15
|
+
//# sourceMappingURL=signerToSimpleSmartAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signerToSimpleSmartAccount.d.ts","sourceRoot":"","sources":["../../accounts/signerToSimpleSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EAEX,KAAK,SAAS,EAGjB,MAAM,MAAM,CAAA;AAWb,OAAO,EAEH,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAC1B,MAAM,YAAY,CAAA;AAEnB,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;;;;GAIG;AACH,wBAAsB,0BAA0B,CAC5C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EAEpD,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,EAClC,EACI,MAAM,EACN,cAAc,EACd,UAAU,EACV,KAAU,EACb,EAAE;IACC,MAAM,EAAE,kBAAkB,CAAA;IAC1B,cAAc,EAAE,OAAO,CAAA;IACvB,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB,GACF,OAAO,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAoJjD"}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Abi, type Account, type Address, BaseError, type Client, type GetConstructorArgs, type Hex, type LocalAccount } from "viem";
|
|
2
2
|
import type { Chain, Transport } from "viem";
|
|
3
3
|
import { type UserOperation } from "../types/index.js";
|
|
4
|
+
export declare class SignTransactionNotSupportedBySmartAccount extends BaseError {
|
|
5
|
+
name: string;
|
|
6
|
+
constructor({ docsPath }?: {
|
|
7
|
+
docsPath?: string;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
4
10
|
export type SmartAccount<Name extends string = string, transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined> = LocalAccount<Name> & {
|
|
5
11
|
client: Client<transport, chain>;
|
|
6
12
|
entryPoint: Address;
|
|
7
13
|
getNonce: () => Promise<bigint>;
|
|
8
14
|
getInitCode: () => Promise<Hex>;
|
|
9
|
-
encodeCallData: (
|
|
15
|
+
encodeCallData: (args: {
|
|
10
16
|
to: Address;
|
|
11
17
|
value: bigint;
|
|
12
18
|
data: Hex;
|
|
13
|
-
}
|
|
19
|
+
} | {
|
|
20
|
+
to: Address;
|
|
21
|
+
value: bigint;
|
|
22
|
+
data: Hex;
|
|
23
|
+
}[]) => Promise<Hex>;
|
|
14
24
|
getDummySignature(): Promise<Hex>;
|
|
15
25
|
encodeDeployCallData: <TAbi extends Abi | readonly unknown[] = Abi>({ abi, args, bytecode }: {
|
|
16
26
|
abi: TAbi;
|
|
@@ -18,4 +28,5 @@ export type SmartAccount<Name extends string = string, transport extends Transpo
|
|
|
18
28
|
} & GetConstructorArgs<TAbi>) => Promise<Hex>;
|
|
19
29
|
signUserOperation: (UserOperation: UserOperation) => Promise<Hex>;
|
|
20
30
|
};
|
|
31
|
+
export type SmartAccountSigner<TAddress extends Address = Address> = Omit<Account<TAddress>, "signTransaction">;
|
|
21
32
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../accounts/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../accounts/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,SAAS,EACT,KAAK,MAAM,EACX,KAAK,kBAAkB,EACvB,KAAK,GAAG,EACR,KAAK,YAAY,EACpB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAC5C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEtD,qBAAa,yCAA0C,SAAQ,SAAS;IAC3D,IAAI,SAA8C;gBAC/C,EAAE,QAAQ,EAAE,GAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO;CAYvD;AAED,MAAM,MAAM,YAAY,CACpB,IAAI,SAAS,MAAM,GAAG,MAAM,EAC5B,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IACnD,YAAY,CAAC,IAAI,CAAC,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;IAChC,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IAC/B,WAAW,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAA;IAC/B,cAAc,EAAE,CACZ,IAAI,EACE;QACI,EAAE,EAAE,OAAO,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,IAAI,EAAE,GAAG,CAAA;KACZ,GACD;QACI,EAAE,EAAE,OAAO,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,IAAI,EAAE,GAAG,CAAA;KACZ,EAAE,KACR,OAAO,CAAC,GAAG,CAAC,CAAA;IACjB,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAA;IACjC,oBAAoB,EAAE,CAAC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAAE,EAChE,GAAG,EACH,IAAI,EACJ,QAAQ,EACX,EAAE;QAAE,GAAG,EAAE,IAAI,CAAC;QAAC,QAAQ,EAAE,GAAG,CAAA;KAAE,GAAG,kBAAkB,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IAC3E,iBAAiB,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;CACpE,CAAA;AAED,MAAM,MAAM,kBAAkB,CAAC,QAAQ,SAAS,OAAO,GAAG,OAAO,IAAI,IAAI,CACrE,OAAO,CAAC,QAAQ,CAAC,EACjB,iBAAiB,CACpB,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Account, Chain, Client, Transport } from "viem";
|
|
2
|
+
import type { BundlerRpcSchema } from "../../types/bundler.js";
|
|
2
3
|
/**
|
|
3
4
|
* Returns the supported chain id by the bundler service
|
|
4
5
|
*
|
|
@@ -21,5 +22,5 @@ import type { BundlerClient } from "../../clients/createBundlerClient.js";
|
|
|
21
22
|
* // Return 5n for Goerli
|
|
22
23
|
*
|
|
23
24
|
*/
|
|
24
|
-
export declare const chainId: (client:
|
|
25
|
+
export declare const chainId: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>(client: Client<TTransport, TChain, TAccount, BundlerRpcSchema>) => Promise<number>;
|
|
25
26
|
//# sourceMappingURL=chainId.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chainId.d.ts","sourceRoot":"","sources":["../../../actions/bundler/chainId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"chainId.d.ts","sourceRoot":"","sources":["../../../actions/bundler/chainId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,OAAO,iPAanB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Address } from "viem";
|
|
1
|
+
import type { Account, Address, Chain, Client, Transport } from "viem";
|
|
2
2
|
import type { PartialBy } from "viem/types/utils";
|
|
3
|
-
import type {
|
|
3
|
+
import type { BundlerRpcSchema } from "../../types/bundler.js";
|
|
4
4
|
import type { UserOperation } from "../../types/userOperation.js";
|
|
5
5
|
export type EstimateUserOperationGasParameters = {
|
|
6
6
|
userOperation: PartialBy<UserOperation, "callGasLimit" | "preVerificationGas" | "verificationGasLimit">;
|
|
@@ -38,5 +38,5 @@ export type EstimateUserOperationGasReturnType = {
|
|
|
38
38
|
* // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
|
|
39
39
|
*
|
|
40
40
|
*/
|
|
41
|
-
export declare const estimateUserOperationGas: (client:
|
|
41
|
+
export declare const estimateUserOperationGas: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>(client: Client<TTransport, TChain, TAccount, BundlerRpcSchema>, args: EstimateUserOperationGasParameters) => Promise<EstimateUserOperationGasReturnType>;
|
|
42
42
|
//# sourceMappingURL=estimateUserOperationGas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"estimateUserOperationGas.d.ts","sourceRoot":"","sources":["../../../actions/bundler/estimateUserOperationGas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"estimateUserOperationGas.d.ts","sourceRoot":"","sources":["../../../actions/bundler/estimateUserOperationGas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAIjE,MAAM,MAAM,kCAAkC,GAAG;IAC7C,aAAa,EAAE,SAAS,CACpB,aAAa,EACb,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,CACjE,CAAA;IACD,UAAU,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,kCAAkC,GAAG;IAC7C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,YAAY,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,wBAAwB,qOAM3B,kCAAkC,KACzC,QAAQ,kCAAkC,CAgB5C,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Address, Hash } from "viem";
|
|
2
|
-
import type {
|
|
1
|
+
import type { Account, Address, Chain, Client, Hash, Transport } from "viem";
|
|
2
|
+
import type { BundlerRpcSchema } from "../../types/bundler.js";
|
|
3
3
|
import type { UserOperation } from "../../types/userOperation.js";
|
|
4
4
|
export type GetUserOperationByHashParameters = {
|
|
5
5
|
hash: Hash;
|
|
@@ -33,5 +33,5 @@ export type GetUserOperationByHashReturnType = {
|
|
|
33
33
|
* getUserOperationByHash(bundlerClient, {hash: userOpHash})
|
|
34
34
|
*
|
|
35
35
|
*/
|
|
36
|
-
export declare const getUserOperationByHash: (client:
|
|
36
|
+
export declare const getUserOperationByHash: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>(client: Client<TTransport, TChain, TAccount, BundlerRpcSchema>, { hash }: GetUserOperationByHashParameters) => Promise<GetUserOperationByHashReturnType>;
|
|
37
37
|
//# sourceMappingURL=getUserOperationByHash.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserOperationByHash.d.ts","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationByHash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"getUserOperationByHash.d.ts","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationByHash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAE5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAEjE,MAAM,MAAM,gCAAgC,GAAG;IAC3C,IAAI,EAAE,IAAI,CAAA;CACb,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC3C,aAAa,EAAE,aAAa,CAAA;IAC5B,UAAU,EAAE,OAAO,CAAA;IACnB,eAAe,EAAE,IAAI,CAAA;IACrB,SAAS,EAAE,IAAI,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;CACtB,GAAG,IAAI,CAAA;AAER;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB,yOAMrB,gCAAgC,KAC3C,QAAQ,gCAAgC,CAiC1C,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Address, Hash, Hex } from "viem";
|
|
2
|
-
import type {
|
|
1
|
+
import type { Account, Address, Chain, Client, Hash, Hex, Transport } from "viem";
|
|
2
|
+
import type { BundlerRpcSchema } from "../../types/bundler.js";
|
|
3
3
|
import type { TStatus } from "../../types/userOperation.js";
|
|
4
4
|
export type GetUserOperationReceiptParameters = {
|
|
5
5
|
hash: Hash;
|
|
@@ -58,5 +58,5 @@ export type GetUserOperationReceiptReturnType = {
|
|
|
58
58
|
* getUserOperationReceipt(bundlerClient, {hash: userOpHash})
|
|
59
59
|
*
|
|
60
60
|
*/
|
|
61
|
-
export declare const getUserOperationReceipt: (client:
|
|
61
|
+
export declare const getUserOperationReceipt: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>(client: Client<TTransport, TChain, TAccount, BundlerRpcSchema>, { hash }: GetUserOperationReceiptParameters) => Promise<GetUserOperationReceiptReturnType | null>;
|
|
62
62
|
//# sourceMappingURL=getUserOperationReceipt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserOperationReceipt.d.ts","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"getUserOperationReceipt.d.ts","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,OAAO,EACP,KAAK,EACL,MAAM,EACN,IAAI,EACJ,GAAG,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,QAAQ,iCAAiC,GAAG,IAAI,CA4ClD,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Address, Hash } from "viem";
|
|
2
|
-
import type {
|
|
1
|
+
import type { Account, Address, Chain, Client, Hash, Transport } from "viem";
|
|
2
|
+
import type { BundlerRpcSchema } from "../../types/bundler.js";
|
|
3
3
|
import type { UserOperation } from "../../types/userOperation.js";
|
|
4
4
|
export type SendUserOperationParameters = {
|
|
5
5
|
userOperation: UserOperation;
|
|
@@ -30,5 +30,5 @@ export type SendUserOperationParameters = {
|
|
|
30
30
|
*
|
|
31
31
|
* // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
|
|
32
32
|
*/
|
|
33
|
-
export declare const sendUserOperation: (client:
|
|
33
|
+
export declare const sendUserOperation: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>(client: Client<TTransport, TChain, TAccount, BundlerRpcSchema>, args: SendUserOperationParameters) => Promise<Hash>;
|
|
34
34
|
//# sourceMappingURL=sendUserOperation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/bundler/sendUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"sendUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/bundler/sendUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAE5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EACR,aAAa,EAEhB,MAAM,8BAA8B,CAAA;AAGrC,MAAM,MAAM,2BAA2B,GAAG;IACtC,aAAa,EAAE,aAAa,CAAA;IAC5B,UAAU,EAAE,OAAO,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,iBAAiB,qOAMpB,2BAA2B,KAClC,QAAQ,IAAI,CAUd,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Address } from "viem";
|
|
2
|
-
import type {
|
|
1
|
+
import type { Account, Address, Chain, Client, Transport } from "viem";
|
|
2
|
+
import type { BundlerRpcSchema } from "../../types/bundler.js";
|
|
3
3
|
/**
|
|
4
4
|
* Returns the supported entrypoints by the bundler service
|
|
5
5
|
*
|
|
@@ -22,5 +22,5 @@ import type { BundlerClient } from "../../clients/createBundlerClient.js";
|
|
|
22
22
|
* // Return ['0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789']
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
|
-
export declare const supportedEntryPoints: (client:
|
|
25
|
+
export declare const supportedEntryPoints: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>(client: Client<TTransport, TChain, TAccount, BundlerRpcSchema>) => Promise<Address[]>;
|
|
26
26
|
//# sourceMappingURL=supportedEntryPoints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supportedEntryPoints.d.ts","sourceRoot":"","sources":["../../../actions/bundler/supportedEntryPoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"supportedEntryPoints.d.ts","sourceRoot":"","sources":["../../../actions/bundler/supportedEntryPoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAEtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,oBAAoB,kOAM9B,QAAQ,OAAO,EAAE,CAKnB,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BaseError, type Chain, type Hash } from "viem";
|
|
2
|
-
import type { BundlerClient } from "../../clients/createBundlerClient.js";
|
|
1
|
+
import { type Account, BaseError, type Chain, type Client, type Hash, type Transport } from "viem";
|
|
3
2
|
import { type GetUserOperationReceiptReturnType } from "./getUserOperationReceipt.js";
|
|
4
3
|
export declare class WaitForUserOperationReceiptTimeoutError extends BaseError {
|
|
5
4
|
name: string;
|
|
@@ -39,5 +38,5 @@ export type WaitForUserOperationReceiptParameters = {
|
|
|
39
38
|
* hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
|
|
40
39
|
* })
|
|
41
40
|
*/
|
|
42
|
-
export declare const waitForUserOperationReceipt: <TChain extends Chain | undefined>(bundlerClient:
|
|
41
|
+
export declare const waitForUserOperationReceipt: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>(bundlerClient: Client<TTransport, TChain, TAccount>, { hash, pollingInterval, timeout }: WaitForUserOperationReceiptParameters) => Promise<GetUserOperationReceiptReturnType>;
|
|
43
42
|
//# sourceMappingURL=waitForUserOperationReceipt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForUserOperationReceipt.d.ts","sourceRoot":"","sources":["../../../actions/bundler/waitForUserOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"waitForUserOperationReceipt.d.ts","sourceRoot":"","sources":["../../../actions/bundler/waitForUserOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,SAAS,EACT,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,SAAS,EAEjB,MAAM,MAAM,CAAA;AAGb,OAAO,EACH,KAAK,iCAAiC,EAEzC,MAAM,8BAA8B,CAAA;AAErC,qBAAa,uCAAwC,SAAQ,SAAS;IACzD,IAAI,SAA4C;gBAC7C,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE;CAKvC;AAED,MAAM,MAAM,qCAAqC,GAAG;IAChD,mCAAmC;IACnC,IAAI,EAAE,IAAI,CAAA;IACV;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,2BAA2B,wPAUjC,qCAAqC,KACzC,QAAQ,iCAAiC,CAgD3C,CAAA"}
|
|
@@ -29,7 +29,7 @@ export type GetUserOperationGasPriceReturnType = {
|
|
|
29
29
|
*
|
|
30
30
|
* const bundlerClient = createClient({
|
|
31
31
|
* chain: goerli,
|
|
32
|
-
* transport: http("https://api.pimlico.io/
|
|
32
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
33
33
|
* })
|
|
34
34
|
*
|
|
35
35
|
* await getUserOperationGasPrice(bundlerClient)
|
|
@@ -20,7 +20,7 @@ export type GetUserOperationStatusReturnType = PimlicoUserOperationStatus;
|
|
|
20
20
|
*
|
|
21
21
|
* const bundlerClient = createClient({
|
|
22
22
|
* chain: goerli,
|
|
23
|
-
* transport: http("https://api.pimlico.io/
|
|
23
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
24
24
|
* })
|
|
25
25
|
*
|
|
26
26
|
* await getUserOperationStatus(bundlerClient, { hash: userOpHash })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareUserOperationRequest.d.ts","sourceRoot":"","sources":["../../../actions/smartAccount/prepareUserOperationRequest.ts"],"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QAAQ,CAAC,GACtD,OAAO,CAAC,qCAAqC,CAAC,
|
|
1
|
+
{"version":3,"file":"prepareUserOperationRequest.d.ts","sourceRoot":"","sources":["../../../actions/smartAccount/prepareUserOperationRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EACR,mBAAmB,EACnB,SAAS,EACT,aAAa,EAChB,MAAM,sBAAsB,CAAA;AAQ7B,MAAM,MAAM,8BAA8B,GAAG;IACzC,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE;QAC1B,aAAa,EAAE,aAAa,CAAA;QAC5B,UAAU,EAAE,OAAO,CAAA;KACtB,KAAK,OAAO,CAAC;QACV,gBAAgB,EAAE,GAAG,CAAA;QACrB,kBAAkB,EAAE,MAAM,CAAA;QAC1B,oBAAoB,EAAE,MAAM,CAAA;QAC5B,YAAY,EAAE,MAAM,CAAA;KACvB,CAAC,CAAA;CACL,CAAA;AAED,MAAM,MAAM,qCAAqC,CAC7C,QAAQ,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,IACpE;IACA,aAAa,EAAE,SAAS,CACpB,aAAa,EACX,OAAO,GACP,QAAQ,GACR,UAAU,GACV,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,cAAc,GACd,sBAAsB,GACtB,kBAAkB,GAClB,WAAW,CAChB,CAAA;CACJ,GAAG,mBAAmB,CAAC,QAAQ,CAAC,GAC7B,8BAA8B,CAAA;AAElC,MAAM,MAAM,qCAAqC,GAAG,aAAa,CAAA;AAEjE,wBAAsB,2BAA2B,CAC7C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,EAEpE,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5C,IAAI,EAAE,qCAAqC,CAAC,QAAQ,CAAC,GACtD,OAAO,CAAC,qCAAqC,CAAC,CAoFhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendTransaction.d.ts","sourceRoot":"","sources":["../../../actions/smartAccount/sendTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,KAAK,EACL,MAAM,EACN,yBAAyB,EACzB,yBAAyB,EACzB,SAAS,EACZ,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAO3D,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,kCAAkC,CAAA;AAGtF,MAAM,MAAM,sCAAsC,CAC9C,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,EACpE,cAAc,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IAC5D,yBAAyB,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,GAC3D,8BAA8B,CAAA;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAsB,eAAe,CACjC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,YAAY,GAAG,SAAS,EACzC,cAAc,SAAS,KAAK,GAAG,SAAS,EAExC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,IAAI,EAAE,sCAAsC,CACxC,MAAM,EACN,QAAQ,EACR,cAAc,CACjB,GACF,OAAO,CAAC,yBAAyB,CAAC,
|
|
1
|
+
{"version":3,"file":"sendTransaction.d.ts","sourceRoot":"","sources":["../../../actions/smartAccount/sendTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,KAAK,EACL,MAAM,EACN,yBAAyB,EACzB,yBAAyB,EACzB,SAAS,EACZ,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAO3D,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,kCAAkC,CAAA;AAGtF,MAAM,MAAM,sCAAsC,CAC9C,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,EACpE,cAAc,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IAC5D,yBAAyB,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,GAC3D,8BAA8B,CAAA;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAsB,eAAe,CACjC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,YAAY,GAAG,SAAS,EACzC,cAAc,SAAS,KAAK,GAAG,SAAS,EAExC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,IAAI,EAAE,sCAAsC,CACxC,MAAM,EACN,QAAQ,EACR,cAAc,CACjB,GACF,OAAO,CAAC,yBAAyB,CAAC,CAwDpC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Address, Chain, Client, Hex, SendTransactionReturnType, Transport } from "viem";
|
|
2
|
+
import { type SmartAccount } from "../../accounts/types.js";
|
|
3
|
+
import type { GetAccountParameter } from "../../types/index.js";
|
|
4
|
+
import { type SponsorUserOperationMiddleware } from "./prepareUserOperationRequest.js";
|
|
5
|
+
export type SendTransactionsWithPaymasterParameters<TAccount extends SmartAccount | undefined = SmartAccount | undefined> = {
|
|
6
|
+
transactions: {
|
|
7
|
+
to: Address;
|
|
8
|
+
value: bigint;
|
|
9
|
+
data: Hex;
|
|
10
|
+
}[];
|
|
11
|
+
} & GetAccountParameter<TAccount> & SponsorUserOperationMiddleware & {
|
|
12
|
+
maxFeePerGas?: bigint;
|
|
13
|
+
maxPriorityFeePerGas?: bigint;
|
|
14
|
+
nonce?: bigint;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Creates, signs, and sends a new transactions to the network.
|
|
18
|
+
* This function also allows you to sponsor this transaction if sender is a smartAccount
|
|
19
|
+
*
|
|
20
|
+
* @param client - Client to use
|
|
21
|
+
* @param parameters - {@link SendTransactionParameters}
|
|
22
|
+
* @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link SendTransactionReturnType}
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* import { createWalletClient, custom } from 'viem'
|
|
26
|
+
* import { mainnet } from 'viem/chains'
|
|
27
|
+
* import { sendTransaction } from 'viem/wallet'
|
|
28
|
+
*
|
|
29
|
+
* const client = createWalletClient({
|
|
30
|
+
* chain: mainnet,
|
|
31
|
+
* transport: custom(window.ethereum),
|
|
32
|
+
* })
|
|
33
|
+
* const hash = await sendTransaction(client, [{
|
|
34
|
+
* account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
|
35
|
+
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
36
|
+
* value: 1000000000000000000n,
|
|
37
|
+
* }, {
|
|
38
|
+
* to: '0x61897970c51812dc3a010c7d01b50e0d17dc1234',
|
|
39
|
+
* value: 10000000000000000n,
|
|
40
|
+
* }])
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* // Account Hoisting
|
|
44
|
+
* import { createWalletClient, http } from 'viem'
|
|
45
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
46
|
+
* import { mainnet } from 'viem/chains'
|
|
47
|
+
* import { sendTransaction } from 'viem/wallet'
|
|
48
|
+
*
|
|
49
|
+
* const client = createWalletClient({
|
|
50
|
+
* account: privateKeyToAccount('0x…'),
|
|
51
|
+
* chain: mainnet,
|
|
52
|
+
* transport: http(),
|
|
53
|
+
* })
|
|
54
|
+
* const hash = await sendTransactions(client, [{
|
|
55
|
+
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
56
|
+
* value: 1000000000000000000n,
|
|
57
|
+
* }, {
|
|
58
|
+
* to: '0x61897970c51812dc3a010c7d01b50e0d17dc1234',
|
|
59
|
+
* value: 10000000000000000n,
|
|
60
|
+
* }])
|
|
61
|
+
*/
|
|
62
|
+
export declare function sendTransactions<TChain extends Chain | undefined, TAccount extends SmartAccount | undefined>(client: Client<Transport, TChain, TAccount>, args: SendTransactionsWithPaymasterParameters<TAccount>): Promise<SendTransactionReturnType>;
|
|
63
|
+
//# sourceMappingURL=sendTransactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendTransactions.d.ts","sourceRoot":"","sources":["../../../actions/smartAccount/sendTransactions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,KAAK,EACL,MAAM,EACN,GAAG,EAEH,yBAAyB,EACzB,SAAS,EACZ,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAO/D,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,kCAAkC,CAAA;AAGtF,MAAM,MAAM,uCAAuC,CAC/C,QAAQ,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,IACpE;IACA,YAAY,EAAE;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE,EAAE,CAAA;CAC5D,GAAG,mBAAmB,CAAC,QAAQ,CAAC,GAC7B,8BAA8B,GAAG;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAEL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAsB,gBAAgB,CAClC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,YAAY,GAAG,SAAS,EAEzC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,IAAI,EAAE,uCAAuC,CAAC,QAAQ,CAAC,GACxD,OAAO,CAAC,yBAAyB,CAAC,CAyDpC"}
|
|
@@ -4,5 +4,6 @@ import { type SendTransactionWithPaymasterParameters, sendTransaction } from "./
|
|
|
4
4
|
import { type SendUserOperationParameters, type SendUserOperationReturnType, sendUserOperation } from "./smartAccount/sendUserOperation.js";
|
|
5
5
|
import { signMessage } from "./smartAccount/signMessage.js";
|
|
6
6
|
import { signTypedData } from "./smartAccount/signTypedData.js";
|
|
7
|
-
|
|
7
|
+
import { type SendTransactionsWithPaymasterParameters, sendTransactions } from "./smartAccount/sendTransactions.js";
|
|
8
|
+
export { deployContract, type DeployContractParametersWithPaymaster, prepareUserOperationRequest, type PrepareUserOperationRequestParameters, type PrepareUserOperationRequestReturnType, sendTransaction, sendUserOperation, type SendUserOperationParameters, type SendUserOperationReturnType, signMessage, signTypedData, type SendTransactionWithPaymasterParameters, type SponsorUserOperationMiddleware, sendTransactions, type SendTransactionsWithPaymasterParameters };
|
|
8
9
|
//# sourceMappingURL=smartAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartAccount.d.ts","sourceRoot":"","sources":["../../actions/smartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,qCAAqC,EAC1C,cAAc,EACjB,MAAM,kCAAkC,CAAA;AAEzC,OA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E3C,OAAO,EACH,cAAc,EACd,KAAK,qCAAqC,EAC1C,2BAA2B,EAC3B,KAAK,qCAAqC,EAC1C,KAAK,qCAAqC,EAC1C,eAAe,EACf,iBAAiB,EACjB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,WAAW,EACX,aAAa,EACb,KAAK,sCAAsC,EAC3C,KAAK,8BAA8B,EACnC,gBAAgB,EAChB,KAAK,uCAAuC,EAC/C,CAAA"}
|
|
@@ -17,7 +17,7 @@ export type AccountsParameters = {
|
|
|
17
17
|
*
|
|
18
18
|
* const bundlerClient = createClient({
|
|
19
19
|
* chain: goerli,
|
|
20
|
-
* transport: http("https://api.stackup.sh/
|
|
20
|
+
* transport: http("https://api.stackup.sh/v2/paymaster/YOUR_API_KEY_HERE")
|
|
21
21
|
* })
|
|
22
22
|
*
|
|
23
23
|
* await accounts(bundlerClient, {
|
|
@@ -30,7 +30,7 @@ export type SponsorUserOperationReturnType = {
|
|
|
30
30
|
*
|
|
31
31
|
* const bundlerClient = createClient({
|
|
32
32
|
* chain: goerli,
|
|
33
|
-
* transport: http("https://api.stackup.sh/
|
|
33
|
+
* transport: http("https://api.stackup.sh/v2/paymaster/YOUR_API_KEY_HERE")
|
|
34
34
|
* })
|
|
35
35
|
*
|
|
36
36
|
* await sponsorUserOperation(bundlerClient, {
|
|
@@ -263,6 +263,7 @@ export declare const createSmartAccountClient: <TTransport extends Transport, TC
|
|
|
263
263
|
deployContract: <const TAbi extends readonly unknown[] | import("viem").Abi, TChainOverride_1 extends Chain | undefined = undefined>(args: import("viem").DeployContractParameters<TAbi, TChain, ParseAccount<TSmartAccount>, TChainOverride_1>) => Promise<`0x${string}`>;
|
|
264
264
|
writeContract: <const TAbi_1 extends readonly unknown[] | import("viem").Abi, TFunctionName extends string, TChainOverride_2 extends Chain | undefined = undefined>(args: import("viem").WriteContractParameters<TAbi_1, TFunctionName, TChain, ParseAccount<TSmartAccount>, TChainOverride_2>) => Promise<`0x${string}`>;
|
|
265
265
|
prepareUserOperationRequest: <TTransport_1 extends Transport>(args: import("../actions/smartAccount/prepareUserOperationRequest.js").PrepareUserOperationRequestParameters<ParseAccount<TSmartAccount>>) => Promise<import("../types/userOperation.js").UserOperation>;
|
|
266
|
+
sendTransactions: (args: import("../actions/smartAccount.js").SendTransactionsWithPaymasterParameters<ParseAccount<TSmartAccount>>) => Promise<`0x${string}`>;
|
|
266
267
|
extend: <const client extends {
|
|
267
268
|
[x: string]: unknown;
|
|
268
269
|
account?: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSmartAccountClient.d.ts","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,KAAK,EACL,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,SAAS,EAEZ,MAAM,MAAM,CAAA;AAEb,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,wDAAwD,CAAA;AAC5G,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EACH,KAAK,mBAAmB,EAE3B,MAAM,8BAA8B,CAAA;AAErC,MAAM,MAAM,kBAAkB,CAC1B,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,OAAO,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,IACnE,QAAQ,CACR,MAAM,CACF,SAAS,EACT,KAAK,EACL,OAAO,EACP,gBAAgB,EAChB,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CACtC,CACJ,CAAA;AAED,MAAM,MAAM,wBAAwB,CAChC,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,QAAQ,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,IACpE,QAAQ,CACR,IAAI,CACA,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,EACtC,SAAS,GACT,WAAW,GACX,OAAO,GACP,KAAK,GACL,MAAM,GACN,iBAAiB,GACjB,WAAW,CAChB,CACJ,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"createSmartAccountClient.d.ts","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,KAAK,EACL,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,SAAS,EAEZ,MAAM,MAAM,CAAA;AAEb,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,wDAAwD,CAAA;AAC5G,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EACH,KAAK,mBAAmB,EAE3B,MAAM,8BAA8B,CAAA;AAErC,MAAM,MAAM,kBAAkB,CAC1B,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,OAAO,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,IACnE,QAAQ,CACR,MAAM,CACF,SAAS,EACT,KAAK,EACL,OAAO,EACP,gBAAgB,EAChB,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CACtC,CACJ,CAAA;AAED,MAAM,MAAM,wBAAwB,CAChC,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,QAAQ,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,IACpE,QAAQ,CACR,IAAI,CACA,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,EACtC,SAAS,GACT,WAAW,GACX,OAAO,GACP,KAAK,GACL,MAAM,GACN,iBAAiB,GACjB,WAAW,CAChB,CACJ,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BpC,CAAA"}
|
|
@@ -21,7 +21,7 @@ export type BundlerActions = {
|
|
|
21
21
|
*
|
|
22
22
|
* const bundlerClient = createClient({
|
|
23
23
|
* chain: goerli,
|
|
24
|
-
* transport: http("https://api.pimlico.io/
|
|
24
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
25
25
|
* }).extend(bundlerActions)
|
|
26
26
|
*
|
|
27
27
|
* const userOpHash = await bundlerClient.sendUserOperation({
|
|
@@ -17,7 +17,7 @@ export type PimlicoBundlerActions = {
|
|
|
17
17
|
*
|
|
18
18
|
* const bundlerClient = createClient({
|
|
19
19
|
* chain: goerli,
|
|
20
|
-
* transport: http("https://api.pimlico.io/
|
|
20
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
21
21
|
* }).extend(pimlicoBundlerActions)
|
|
22
22
|
*
|
|
23
23
|
* await bundlerClient.getUserOperationGasPrice()
|
|
@@ -37,7 +37,7 @@ export type PimlicoBundlerActions = {
|
|
|
37
37
|
*
|
|
38
38
|
* const bundlerClient = createClient({
|
|
39
39
|
* chain: goerli,
|
|
40
|
-
* transport: http("https://api.pimlico.io/
|
|
40
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
41
41
|
* }).extend(pimlicoBundlerActions)
|
|
42
42
|
*
|
|
43
43
|
* await bundlerClient.getUserOperationStatus({ hash: userOpHash })
|
|
@@ -73,6 +73,6 @@ export type PimlicoPaymasterClientActions = {
|
|
|
73
73
|
};
|
|
74
74
|
export declare const pimlicoPaymasterActions: (client: Client) => PimlicoPaymasterClientActions;
|
|
75
75
|
/**
|
|
76
|
-
* TODO: Add support for pimlicoActions after we support all the actions of
|
|
76
|
+
* TODO: Add support for pimlicoActions after we support all the actions of v2 of the Pimlico API.
|
|
77
77
|
*/
|
|
78
78
|
//# sourceMappingURL=pimlico.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Abi, Chain, Client, DeployContractParameters, SendTransactionParameters, Transport, TypedData, WriteContractParameters } from "viem";
|
|
2
2
|
import type { SmartAccount } from "../../accounts/types.js";
|
|
3
|
+
import { type SendTransactionsWithPaymasterParameters, sendTransactions } from "../../actions/smartAccount.js";
|
|
3
4
|
import { deployContract } from "../../actions/smartAccount/deployContract.js";
|
|
4
5
|
import { type PrepareUserOperationRequestReturnType, type SponsorUserOperationMiddleware, prepareUserOperationRequest } from "../../actions/smartAccount/prepareUserOperationRequest.js";
|
|
5
6
|
import { sendTransaction } from "../../actions/smartAccount/sendTransaction.js";
|
|
@@ -271,6 +272,56 @@ export type SmartAccountActions<TChain extends Chain | undefined = Chain | undef
|
|
|
271
272
|
*/
|
|
272
273
|
writeContract: <const TAbi extends Abi | readonly unknown[], TFunctionName extends string, TChainOverride extends Chain | undefined = undefined>(args: WriteContractParameters<TAbi, TFunctionName, TChain, TSmartAccount, TChainOverride>) => ReturnType<typeof writeContract<TChain, TSmartAccount, TAbi, TFunctionName, TChainOverride>>;
|
|
273
274
|
prepareUserOperationRequest: <TTransport extends Transport>(args: Parameters<typeof prepareUserOperationRequest<TTransport, TChain, TSmartAccount>>[1]) => Promise<PrepareUserOperationRequestReturnType>;
|
|
275
|
+
/**
|
|
276
|
+
* Creates, signs, and sends a new transaction to the network.
|
|
277
|
+
* This function also allows you to sponsor this transaction if sender is a smartAccount
|
|
278
|
+
*
|
|
279
|
+
* - Docs: https://viem.sh/docs/actions/wallet/sendTransaction.html
|
|
280
|
+
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions
|
|
281
|
+
* - JSON-RPC Methods:
|
|
282
|
+
* - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction)
|
|
283
|
+
* - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction)
|
|
284
|
+
*
|
|
285
|
+
* @param args - {@link SendTransactionParameters}
|
|
286
|
+
* @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link SendTransactionReturnType}
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* import { createWalletClient, custom } from 'viem'
|
|
290
|
+
* import { mainnet } from 'viem/chains'
|
|
291
|
+
*
|
|
292
|
+
* const client = createWalletClient({
|
|
293
|
+
* chain: mainnet,
|
|
294
|
+
* transport: custom(window.ethereum),
|
|
295
|
+
* })
|
|
296
|
+
* const hash = await client.sendTransaction([{
|
|
297
|
+
* account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
|
298
|
+
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
299
|
+
* value: 1000000000000000000n
|
|
300
|
+
* }, {
|
|
301
|
+
* to: '0x61897970c51812dc3a010c7d01b50e0d17dc1234',
|
|
302
|
+
* value: 10000000000000000n
|
|
303
|
+
* })
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* // Account Hoisting
|
|
307
|
+
* import { createWalletClient, http } from 'viem'
|
|
308
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
309
|
+
* import { mainnet } from 'viem/chains'
|
|
310
|
+
*
|
|
311
|
+
* const client = createWalletClient({
|
|
312
|
+
* account: privateKeyToAccount('0x…'),
|
|
313
|
+
* chain: mainnet,
|
|
314
|
+
* transport: http(),
|
|
315
|
+
* })
|
|
316
|
+
* const hash = await client.sendTransaction([{
|
|
317
|
+
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
318
|
+
* value: 1000000000000000000n
|
|
319
|
+
* }, {
|
|
320
|
+
* to: '0x61897970c51812dc3a010c7d01b50e0d17dc1234',
|
|
321
|
+
* value: 10000000000000000n
|
|
322
|
+
* }])
|
|
323
|
+
*/
|
|
324
|
+
sendTransactions: (args: SendTransactionsWithPaymasterParameters<TSmartAccount>) => ReturnType<typeof sendTransactions<TChain, TSmartAccount>>;
|
|
274
325
|
};
|
|
275
326
|
export declare const smartAccountActions: ({ sponsorUserOperation }: SponsorUserOperationMiddleware) => <TTransport extends Transport, TChain extends Chain | undefined = Chain | undefined, TSmartAccount extends SmartAccount | undefined = SmartAccount | undefined>(client: Client<TTransport, TChain, TSmartAccount>) => SmartAccountActions<TChain, TSmartAccount>;
|
|
276
327
|
//# sourceMappingURL=smartAccount.d.ts.map
|