permissionless 0.0.25 → 0.0.26
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 +6 -0
- package/_cjs/clients/createSmartAccountClient.js +2 -2
- package/_cjs/clients/createSmartAccountClient.js.map +1 -1
- package/_esm/clients/createSmartAccountClient.js +2 -21
- package/_esm/clients/createSmartAccountClient.js.map +1 -1
- package/_types/clients/createSmartAccountClient.d.ts +2 -256
- package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
- package/clients/createSmartAccountClient.ts +10 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createSmartAccountClient = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
const smartAccount_js_1 = require("./decorators/smartAccount.js");
|
|
6
|
-
|
|
6
|
+
function createSmartAccountClient(parameters) {
|
|
7
7
|
const { key = "Account", name = "Smart Account Client", transport } = parameters;
|
|
8
8
|
const client = (0, viem_1.createClient)({
|
|
9
9
|
...parameters,
|
|
@@ -15,6 +15,6 @@ const createSmartAccountClient = (parameters) => {
|
|
|
15
15
|
return client.extend((0, smartAccount_js_1.smartAccountActions)({
|
|
16
16
|
sponsorUserOperation: parameters.sponsorUserOperation
|
|
17
17
|
}));
|
|
18
|
-
}
|
|
18
|
+
}
|
|
19
19
|
exports.createSmartAccountClient = createSmartAccountClient;
|
|
20
20
|
//# sourceMappingURL=createSmartAccountClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSmartAccountClient.js","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":";;;AAQA,+BAAmC;AAKnC,kEAGqC;
|
|
1
|
+
{"version":3,"file":"createSmartAccountClient.js","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":";;;AAQA,+BAAmC;AAKnC,kEAGqC;AAmErC,SAAgB,wBAAwB,CACpC,UAAoC;IAEpC,MAAM,EACF,GAAG,GAAG,SAAS,EACf,IAAI,GAAG,sBAAsB,EAC7B,SAAS,EACZ,GAAG,UAAU,CAAA;IACd,MAAM,MAAM,GAAG,IAAA,mBAAY,EAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;QAC1D,IAAI,EAAE,oBAAoB;KAC7B,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,MAAM,CAChB,IAAA,qCAAmB,EAAC;QAChB,oBAAoB,EAAE,UAAU,CAAC,oBAAoB;KACxD,CAAC,CACL,CAAA;AACL,CAAC;AArBD,4DAqBC"}
|
|
@@ -3,26 +3,7 @@ import {} from "../accounts/types.js";
|
|
|
3
3
|
import {} from "../actions/smartAccount/prepareUserOperationRequest.js";
|
|
4
4
|
import {} from "../types/bundler.js";
|
|
5
5
|
import { smartAccountActions } from "./decorators/smartAccount.js";
|
|
6
|
-
|
|
7
|
-
* Creates a EIP-4337 compliant Bundler Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
|
|
8
|
-
*
|
|
9
|
-
* - Docs: https://docs.pimlico.io/permissionless/reference/clients/smartAccountClient
|
|
10
|
-
*
|
|
11
|
-
* A Bundler Client is an interface to "erc 4337" [JSON-RPC API](https://eips.ethereum.org/EIPS/eip-4337#rpc-methods-eth-namespace) methods such as sending user operation, estimating gas for a user operation, get user operation receipt, etc through Bundler Actions.
|
|
12
|
-
*
|
|
13
|
-
* @param parameters - {@link WalletClientConfig}
|
|
14
|
-
* @returns A Bundler Client. {@link SmartAccountClient}
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* import { createPublicClient, http } from 'viem'
|
|
18
|
-
* import { mainnet } from 'viem/chains'
|
|
19
|
-
*
|
|
20
|
-
* const smartAccountClient = createSmartAccountClient({
|
|
21
|
-
* chain: mainnet,
|
|
22
|
-
* transport: http(BUNDLER_URL),
|
|
23
|
-
* })
|
|
24
|
-
*/
|
|
25
|
-
export const createSmartAccountClient = (parameters) => {
|
|
6
|
+
export function createSmartAccountClient(parameters) {
|
|
26
7
|
const { key = "Account", name = "Smart Account Client", transport } = parameters;
|
|
27
8
|
const client = createClient({
|
|
28
9
|
...parameters,
|
|
@@ -34,5 +15,5 @@ export const createSmartAccountClient = (parameters) => {
|
|
|
34
15
|
return client.extend(smartAccountActions({
|
|
35
16
|
sponsorUserOperation: parameters.sponsorUserOperation
|
|
36
17
|
}));
|
|
37
|
-
}
|
|
18
|
+
}
|
|
38
19
|
//# sourceMappingURL=createSmartAccountClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSmartAccountClient.js","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EAAqB,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAuC,MAAM,wDAAwD,CAAA;AAC5G,OAAO,EAAyB,MAAM,qBAAqB,CAAA;AAE3D,OAAO,EAEH,mBAAmB,EACtB,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"createSmartAccountClient.js","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EAAqB,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAuC,MAAM,wDAAwD,CAAA;AAC5G,OAAO,EAAyB,MAAM,qBAAqB,CAAA;AAE3D,OAAO,EAEH,mBAAmB,EACtB,MAAM,8BAA8B,CAAA;AAmErC,MAAM,UAAU,wBAAwB,CACpC,UAAoC;IAEpC,MAAM,EACF,GAAG,GAAG,SAAS,EACf,IAAI,GAAG,sBAAsB,EAC7B,SAAS,EACZ,GAAG,UAAU,CAAA;IACd,MAAM,MAAM,GAAG,YAAY,CAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;QAC1D,IAAI,EAAE,oBAAoB;KAC7B,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,MAAM,CAChB,mBAAmB,CAAC;QAChB,oBAAoB,EAAE,UAAU,CAAC,oBAAoB;KACxD,CAAC,CACL,CAAA;AACL,CAAC"}
|
|
@@ -10,7 +10,7 @@ import { type SmartAccountActions } from "./decorators/smartAccount.js";
|
|
|
10
10
|
* - Fix typing, 'accounts' is required to signMessage, signTypedData, signTransaction, but not needed here, since account is embedded in the client
|
|
11
11
|
*/
|
|
12
12
|
export type SmartAccountClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartAccount | undefined = SmartAccount | undefined> = Prettify<Client<transport, chain, account, BundlerRpcSchema, SmartAccountActions<chain, account>>>;
|
|
13
|
-
export type SmartAccountClientConfig<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, TAccount extends SmartAccount | undefined = SmartAccount | undefined> = Prettify<Pick<ClientConfig<transport, chain, TAccount>, "account" | "cacheTime" | "chain" | "key" | "name" | "pollingInterval" | "transport"
|
|
13
|
+
export type SmartAccountClientConfig<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, TAccount extends SmartAccount | undefined = SmartAccount | undefined> = Prettify<Pick<ClientConfig<transport, chain, TAccount>, "account" | "cacheTime" | "chain" | "key" | "name" | "pollingInterval" | "transport">> & SponsorUserOperationMiddleware;
|
|
14
14
|
/**
|
|
15
15
|
* Creates a EIP-4337 compliant Bundler Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
|
|
16
16
|
*
|
|
@@ -30,259 +30,5 @@ export type SmartAccountClientConfig<transport extends Transport = Transport, ch
|
|
|
30
30
|
* transport: http(BUNDLER_URL),
|
|
31
31
|
* })
|
|
32
32
|
*/
|
|
33
|
-
export declare
|
|
34
|
-
account?: `0x${string}` | import("viem").Account | TSmartAccount | undefined;
|
|
35
|
-
cacheTime?: number | undefined;
|
|
36
|
-
chain?: Chain | TChain | undefined;
|
|
37
|
-
key?: string | undefined;
|
|
38
|
-
name?: string | undefined;
|
|
39
|
-
pollingInterval?: number | undefined;
|
|
40
|
-
transport: TTransport;
|
|
41
|
-
} & SponsorUserOperationMiddleware) => {
|
|
42
|
-
account: ParseAccount<TSmartAccount>;
|
|
43
|
-
batch?: {
|
|
44
|
-
multicall?: boolean | {
|
|
45
|
-
batchSize?: number | undefined;
|
|
46
|
-
wait?: number | undefined;
|
|
47
|
-
} | undefined;
|
|
48
|
-
} | undefined;
|
|
49
|
-
cacheTime: number;
|
|
50
|
-
chain: TChain;
|
|
51
|
-
key: string;
|
|
52
|
-
name: string;
|
|
53
|
-
pollingInterval: number;
|
|
54
|
-
request: import("viem").EIP1193RequestFn<BundlerRpcSchema>;
|
|
55
|
-
transport: ReturnType<TTransport>["config"] & ReturnType<TTransport>["value"];
|
|
56
|
-
type: string;
|
|
57
|
-
uid: string;
|
|
58
|
-
sendTransaction: <TChainOverride extends Chain | undefined>(args: import("viem").SendTransactionParameters<TChain, ParseAccount<TSmartAccount>, TChainOverride>) => Promise<`0x${string}`>;
|
|
59
|
-
signMessage: (args: import("viem").SignMessageParameters<ParseAccount<TSmartAccount>>) => Promise<`0x${string}`>;
|
|
60
|
-
signTypedData: <const TTypedData extends {
|
|
61
|
-
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
62
|
-
[x: `string[${string}]`]: undefined;
|
|
63
|
-
[x: `function[${string}]`]: undefined;
|
|
64
|
-
[x: `address[${string}]`]: undefined;
|
|
65
|
-
[x: `bool[${string}]`]: undefined;
|
|
66
|
-
[x: `bytes[${string}]`]: undefined;
|
|
67
|
-
[x: `bytes1[${string}]`]: undefined;
|
|
68
|
-
[x: `bytes2[${string}]`]: undefined;
|
|
69
|
-
[x: `bytes6[${string}]`]: undefined;
|
|
70
|
-
[x: `bytes16[${string}]`]: undefined;
|
|
71
|
-
[x: `bytes3[${string}]`]: undefined;
|
|
72
|
-
[x: `bytes4[${string}]`]: undefined;
|
|
73
|
-
[x: `bytes5[${string}]`]: undefined;
|
|
74
|
-
[x: `bytes7[${string}]`]: undefined;
|
|
75
|
-
[x: `bytes8[${string}]`]: undefined;
|
|
76
|
-
[x: `bytes9[${string}]`]: undefined;
|
|
77
|
-
[x: `bytes10[${string}]`]: undefined;
|
|
78
|
-
[x: `bytes11[${string}]`]: undefined;
|
|
79
|
-
[x: `bytes12[${string}]`]: undefined;
|
|
80
|
-
[x: `bytes13[${string}]`]: undefined;
|
|
81
|
-
[x: `bytes14[${string}]`]: undefined;
|
|
82
|
-
[x: `bytes15[${string}]`]: undefined;
|
|
83
|
-
[x: `bytes17[${string}]`]: undefined;
|
|
84
|
-
[x: `bytes18[${string}]`]: undefined;
|
|
85
|
-
[x: `bytes19[${string}]`]: undefined;
|
|
86
|
-
[x: `bytes20[${string}]`]: undefined;
|
|
87
|
-
[x: `bytes21[${string}]`]: undefined;
|
|
88
|
-
[x: `bytes22[${string}]`]: undefined;
|
|
89
|
-
[x: `bytes23[${string}]`]: undefined;
|
|
90
|
-
[x: `bytes24[${string}]`]: undefined;
|
|
91
|
-
[x: `bytes25[${string}]`]: undefined;
|
|
92
|
-
[x: `bytes26[${string}]`]: undefined;
|
|
93
|
-
[x: `bytes27[${string}]`]: undefined;
|
|
94
|
-
[x: `bytes28[${string}]`]: undefined;
|
|
95
|
-
[x: `bytes29[${string}]`]: undefined;
|
|
96
|
-
[x: `bytes30[${string}]`]: undefined;
|
|
97
|
-
[x: `bytes31[${string}]`]: undefined;
|
|
98
|
-
[x: `bytes32[${string}]`]: undefined;
|
|
99
|
-
[x: `int[${string}]`]: undefined;
|
|
100
|
-
[x: `int40[${string}]`]: undefined;
|
|
101
|
-
[x: `int16[${string}]`]: undefined;
|
|
102
|
-
[x: `int56[${string}]`]: undefined;
|
|
103
|
-
[x: `int8[${string}]`]: undefined;
|
|
104
|
-
[x: `int24[${string}]`]: undefined;
|
|
105
|
-
[x: `int32[${string}]`]: undefined;
|
|
106
|
-
[x: `int48[${string}]`]: undefined;
|
|
107
|
-
[x: `int64[${string}]`]: undefined;
|
|
108
|
-
[x: `int72[${string}]`]: undefined;
|
|
109
|
-
[x: `int80[${string}]`]: undefined;
|
|
110
|
-
[x: `int88[${string}]`]: undefined;
|
|
111
|
-
[x: `int96[${string}]`]: undefined;
|
|
112
|
-
[x: `int104[${string}]`]: undefined;
|
|
113
|
-
[x: `int112[${string}]`]: undefined;
|
|
114
|
-
[x: `int120[${string}]`]: undefined;
|
|
115
|
-
[x: `int128[${string}]`]: undefined;
|
|
116
|
-
[x: `int136[${string}]`]: undefined;
|
|
117
|
-
[x: `int144[${string}]`]: undefined;
|
|
118
|
-
[x: `int152[${string}]`]: undefined;
|
|
119
|
-
[x: `int160[${string}]`]: undefined;
|
|
120
|
-
[x: `int168[${string}]`]: undefined;
|
|
121
|
-
[x: `int176[${string}]`]: undefined;
|
|
122
|
-
[x: `int184[${string}]`]: undefined;
|
|
123
|
-
[x: `int192[${string}]`]: undefined;
|
|
124
|
-
[x: `int200[${string}]`]: undefined;
|
|
125
|
-
[x: `int208[${string}]`]: undefined;
|
|
126
|
-
[x: `int216[${string}]`]: undefined;
|
|
127
|
-
[x: `int224[${string}]`]: undefined;
|
|
128
|
-
[x: `int232[${string}]`]: undefined;
|
|
129
|
-
[x: `int240[${string}]`]: undefined;
|
|
130
|
-
[x: `int248[${string}]`]: undefined;
|
|
131
|
-
[x: `int256[${string}]`]: undefined;
|
|
132
|
-
[x: `uint[${string}]`]: undefined;
|
|
133
|
-
[x: `uint40[${string}]`]: undefined;
|
|
134
|
-
[x: `uint16[${string}]`]: undefined;
|
|
135
|
-
[x: `uint56[${string}]`]: undefined;
|
|
136
|
-
[x: `uint8[${string}]`]: undefined;
|
|
137
|
-
[x: `uint24[${string}]`]: undefined;
|
|
138
|
-
[x: `uint32[${string}]`]: undefined;
|
|
139
|
-
[x: `uint48[${string}]`]: undefined;
|
|
140
|
-
[x: `uint64[${string}]`]: undefined;
|
|
141
|
-
[x: `uint72[${string}]`]: undefined;
|
|
142
|
-
[x: `uint80[${string}]`]: undefined;
|
|
143
|
-
[x: `uint88[${string}]`]: undefined;
|
|
144
|
-
[x: `uint96[${string}]`]: undefined;
|
|
145
|
-
[x: `uint104[${string}]`]: undefined;
|
|
146
|
-
[x: `uint112[${string}]`]: undefined;
|
|
147
|
-
[x: `uint120[${string}]`]: undefined;
|
|
148
|
-
[x: `uint128[${string}]`]: undefined;
|
|
149
|
-
[x: `uint136[${string}]`]: undefined;
|
|
150
|
-
[x: `uint144[${string}]`]: undefined;
|
|
151
|
-
[x: `uint152[${string}]`]: undefined;
|
|
152
|
-
[x: `uint160[${string}]`]: undefined;
|
|
153
|
-
[x: `uint168[${string}]`]: undefined;
|
|
154
|
-
[x: `uint176[${string}]`]: undefined;
|
|
155
|
-
[x: `uint184[${string}]`]: undefined;
|
|
156
|
-
[x: `uint192[${string}]`]: undefined;
|
|
157
|
-
[x: `uint200[${string}]`]: undefined;
|
|
158
|
-
[x: `uint208[${string}]`]: undefined;
|
|
159
|
-
[x: `uint216[${string}]`]: undefined;
|
|
160
|
-
[x: `uint224[${string}]`]: undefined;
|
|
161
|
-
[x: `uint232[${string}]`]: undefined;
|
|
162
|
-
[x: `uint240[${string}]`]: undefined;
|
|
163
|
-
[x: `uint248[${string}]`]: undefined;
|
|
164
|
-
[x: `uint256[${string}]`]: undefined;
|
|
165
|
-
string?: undefined;
|
|
166
|
-
address?: undefined;
|
|
167
|
-
bool?: undefined;
|
|
168
|
-
bytes?: undefined;
|
|
169
|
-
bytes1?: undefined;
|
|
170
|
-
bytes2?: undefined;
|
|
171
|
-
bytes6?: undefined;
|
|
172
|
-
bytes16?: undefined;
|
|
173
|
-
bytes3?: undefined;
|
|
174
|
-
bytes4?: undefined;
|
|
175
|
-
bytes5?: undefined;
|
|
176
|
-
bytes7?: undefined;
|
|
177
|
-
bytes8?: undefined;
|
|
178
|
-
bytes9?: undefined;
|
|
179
|
-
bytes10?: undefined;
|
|
180
|
-
bytes11?: undefined;
|
|
181
|
-
bytes12?: undefined;
|
|
182
|
-
bytes13?: undefined;
|
|
183
|
-
bytes14?: undefined;
|
|
184
|
-
bytes15?: undefined;
|
|
185
|
-
bytes17?: undefined;
|
|
186
|
-
bytes18?: undefined;
|
|
187
|
-
bytes19?: undefined;
|
|
188
|
-
bytes20?: undefined;
|
|
189
|
-
bytes21?: undefined;
|
|
190
|
-
bytes22?: undefined;
|
|
191
|
-
bytes23?: undefined;
|
|
192
|
-
bytes24?: undefined;
|
|
193
|
-
bytes25?: undefined;
|
|
194
|
-
bytes26?: undefined;
|
|
195
|
-
bytes27?: undefined;
|
|
196
|
-
bytes28?: undefined;
|
|
197
|
-
bytes29?: undefined;
|
|
198
|
-
bytes30?: undefined;
|
|
199
|
-
bytes31?: undefined;
|
|
200
|
-
bytes32?: undefined;
|
|
201
|
-
int40?: undefined;
|
|
202
|
-
int16?: undefined;
|
|
203
|
-
int56?: undefined;
|
|
204
|
-
int8?: undefined;
|
|
205
|
-
int24?: undefined;
|
|
206
|
-
int32?: undefined;
|
|
207
|
-
int48?: undefined;
|
|
208
|
-
int64?: undefined;
|
|
209
|
-
int72?: undefined;
|
|
210
|
-
int80?: undefined;
|
|
211
|
-
int88?: undefined;
|
|
212
|
-
int96?: undefined;
|
|
213
|
-
int104?: undefined;
|
|
214
|
-
int112?: undefined;
|
|
215
|
-
int120?: undefined;
|
|
216
|
-
int128?: undefined;
|
|
217
|
-
int136?: undefined;
|
|
218
|
-
int144?: undefined;
|
|
219
|
-
int152?: undefined;
|
|
220
|
-
int160?: undefined;
|
|
221
|
-
int168?: undefined;
|
|
222
|
-
int176?: undefined;
|
|
223
|
-
int184?: undefined;
|
|
224
|
-
int192?: undefined;
|
|
225
|
-
int200?: undefined;
|
|
226
|
-
int208?: undefined;
|
|
227
|
-
int216?: undefined;
|
|
228
|
-
int224?: undefined;
|
|
229
|
-
int232?: undefined;
|
|
230
|
-
int240?: undefined;
|
|
231
|
-
int248?: undefined;
|
|
232
|
-
int256?: undefined;
|
|
233
|
-
uint40?: undefined;
|
|
234
|
-
uint16?: undefined;
|
|
235
|
-
uint56?: undefined;
|
|
236
|
-
uint8?: undefined;
|
|
237
|
-
uint24?: undefined;
|
|
238
|
-
uint32?: undefined;
|
|
239
|
-
uint48?: undefined;
|
|
240
|
-
uint64?: undefined;
|
|
241
|
-
uint72?: undefined;
|
|
242
|
-
uint80?: undefined;
|
|
243
|
-
uint88?: undefined;
|
|
244
|
-
uint96?: undefined;
|
|
245
|
-
uint104?: undefined;
|
|
246
|
-
uint112?: undefined;
|
|
247
|
-
uint120?: undefined;
|
|
248
|
-
uint128?: undefined;
|
|
249
|
-
uint136?: undefined;
|
|
250
|
-
uint144?: undefined;
|
|
251
|
-
uint152?: undefined;
|
|
252
|
-
uint160?: undefined;
|
|
253
|
-
uint168?: undefined;
|
|
254
|
-
uint176?: undefined;
|
|
255
|
-
uint184?: undefined;
|
|
256
|
-
uint192?: undefined;
|
|
257
|
-
uint200?: undefined;
|
|
258
|
-
uint208?: undefined;
|
|
259
|
-
uint216?: undefined;
|
|
260
|
-
uint224?: undefined;
|
|
261
|
-
uint232?: undefined;
|
|
262
|
-
uint240?: undefined;
|
|
263
|
-
uint248?: undefined;
|
|
264
|
-
uint256?: undefined;
|
|
265
|
-
} | {
|
|
266
|
-
[key: string]: unknown;
|
|
267
|
-
}, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType, ParseAccount<TSmartAccount>>) => Promise<`0x${string}`>;
|
|
268
|
-
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}`>;
|
|
269
|
-
writeContract: <const TAbi_1 extends readonly unknown[] | import("viem").Abi, TFunctionName extends import("viem").ContractFunctionName<TAbi_1, "nonpayable" | "payable"> = import("viem").ContractFunctionName<TAbi_1, "nonpayable" | "payable">, TArgs extends import("viem").ContractFunctionArgs<TAbi_1, "nonpayable" | "payable", TFunctionName> = import("viem").ContractFunctionArgs<TAbi_1, "nonpayable" | "payable", TFunctionName>, TChainOverride_2 extends Chain | undefined = undefined>(args: import("viem").WriteContractParameters<TAbi_1, TFunctionName, TArgs, TChain, ParseAccount<TSmartAccount>, TChainOverride_2>) => Promise<`0x${string}`>;
|
|
270
|
-
prepareUserOperationRequest: <TTransport_1 extends Transport>(args: import("../actions/smartAccount/prepareUserOperationRequest.js").PrepareUserOperationRequestParameters<ParseAccount<TSmartAccount>>) => Promise<import("../types/userOperation.js").UserOperation>;
|
|
271
|
-
sendUserOperation: <TTransport_2 extends Transport>(args: import("../actions/smartAccount.js").SendUserOperationParameters<ParseAccount<TSmartAccount>>) => Promise<`0x${string}`>;
|
|
272
|
-
sendTransactions: (args: import("../actions/smartAccount.js").SendTransactionsWithPaymasterParameters<ParseAccount<TSmartAccount>>) => Promise<`0x${string}`>;
|
|
273
|
-
extend: <const client extends {
|
|
274
|
-
[x: string]: unknown;
|
|
275
|
-
account?: undefined;
|
|
276
|
-
batch?: undefined;
|
|
277
|
-
cacheTime?: undefined;
|
|
278
|
-
chain?: undefined;
|
|
279
|
-
key?: undefined;
|
|
280
|
-
name?: undefined;
|
|
281
|
-
pollingInterval?: undefined;
|
|
282
|
-
request?: undefined;
|
|
283
|
-
transport?: undefined;
|
|
284
|
-
type?: undefined;
|
|
285
|
-
uid?: undefined;
|
|
286
|
-
} & Partial<Pick<import("viem").PublicActions, "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getChainId" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "prepareTransactionRequest" | "readContract" | "sendRawTransaction" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions, "sendTransaction" | "writeContract">>>(fn: (client: Client<TTransport, TChain, ParseAccount<TSmartAccount>, BundlerRpcSchema, SmartAccountActions<TChain, ParseAccount<TSmartAccount>>>) => client) => Client<TTransport, TChain, ParseAccount<TSmartAccount>, BundlerRpcSchema, { [K in keyof client]: client[K]; } & SmartAccountActions<TChain, ParseAccount<TSmartAccount>>>;
|
|
287
|
-
};
|
|
33
|
+
export declare function createSmartAccountClient<TTransport extends Transport, TChain extends Chain | undefined = Chain | undefined, TSmartAccount extends SmartAccount | undefined = SmartAccount | undefined>(parameters: SmartAccountClientConfig<TTransport, TChain, TSmartAccount>): SmartAccountClient<TTransport, TChain, ParseAccount<TSmartAccount>>;
|
|
288
34
|
//# sourceMappingURL=createSmartAccountClient.d.ts.map
|
|
@@ -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;;;;GAIG;AACH,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;
|
|
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;;;;GAIG;AACH,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,GACG,8BAA8B,CAAA;AAElC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wBAAgB,wBAAwB,CACpC,UAAU,SAAS,SAAS,EAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,aAAa,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,EAEzE,UAAU,EAAE,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,GACxE,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC,CAAA"}
|
|
@@ -50,7 +50,8 @@ export type SmartAccountClientConfig<
|
|
|
50
50
|
| "pollingInterval"
|
|
51
51
|
| "transport"
|
|
52
52
|
>
|
|
53
|
-
>
|
|
53
|
+
> &
|
|
54
|
+
SponsorUserOperationMiddleware
|
|
54
55
|
|
|
55
56
|
/**
|
|
56
57
|
* Creates a EIP-4337 compliant Bundler Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
|
|
@@ -71,14 +72,18 @@ export type SmartAccountClientConfig<
|
|
|
71
72
|
* transport: http(BUNDLER_URL),
|
|
72
73
|
* })
|
|
73
74
|
*/
|
|
74
|
-
|
|
75
|
+
|
|
76
|
+
export function createSmartAccountClient<
|
|
75
77
|
TTransport extends Transport,
|
|
76
78
|
TChain extends Chain | undefined = Chain | undefined,
|
|
77
79
|
TSmartAccount extends SmartAccount | undefined = SmartAccount | undefined
|
|
78
80
|
>(
|
|
79
|
-
parameters: SmartAccountClientConfig<TTransport, TChain, TSmartAccount>
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
parameters: SmartAccountClientConfig<TTransport, TChain, TSmartAccount>
|
|
82
|
+
): SmartAccountClient<TTransport, TChain, ParseAccount<TSmartAccount>>
|
|
83
|
+
|
|
84
|
+
export function createSmartAccountClient(
|
|
85
|
+
parameters: SmartAccountClientConfig
|
|
86
|
+
): SmartAccountClient {
|
|
82
87
|
const {
|
|
83
88
|
key = "Account",
|
|
84
89
|
name = "Smart Account Client",
|