@permissionless/wagmi 0.0.0 → 0.0.2
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 +7 -0
- package/_cjs/connectors/smartAccount.js +51 -0
- package/_cjs/connectors/smartAccount.js.map +1 -0
- package/_cjs/index.js +6 -0
- package/_cjs/index.js.map +1 -0
- package/_cjs/package.json +1 -0
- package/_esm/connectors/smartAccount.js +53 -0
- package/_esm/connectors/smartAccount.js.map +1 -0
- package/_esm/index.js +3 -0
- package/_esm/index.js.map +1 -0
- package/_esm/package.json +1 -0
- package/_types/connectors/smartAccount.d.ts +294 -0
- package/_types/connectors/smartAccount.d.ts.map +1 -0
- package/_types/index.d.ts +3 -0
- package/_types/index.d.ts.map +1 -0
- package/package.json +25 -41
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.smartAccount = void 0;
|
|
4
|
+
const permissionless_1 = require("permissionless");
|
|
5
|
+
const wagmi_1 = require("wagmi");
|
|
6
|
+
function smartAccount({ smartAccountClient, id = smartAccountClient.uid, name = smartAccountClient.name, type = "smart-account" }) {
|
|
7
|
+
smartAccountClient.estimateGas = () => {
|
|
8
|
+
return undefined;
|
|
9
|
+
};
|
|
10
|
+
return (0, wagmi_1.createConnector)((config) => ({
|
|
11
|
+
id,
|
|
12
|
+
name,
|
|
13
|
+
type,
|
|
14
|
+
async connect({ chainId } = {}) {
|
|
15
|
+
if (chainId && chainId !== (await this.getChainId())) {
|
|
16
|
+
throw new Error(`Invalid chainId ${chainId} requested`);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
accounts: [smartAccountClient.account.address],
|
|
20
|
+
chainId: await this.getChainId()
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
async disconnect() { },
|
|
24
|
+
async getAccounts() {
|
|
25
|
+
return [smartAccountClient.account.address];
|
|
26
|
+
},
|
|
27
|
+
getChainId() {
|
|
28
|
+
return (0, permissionless_1.chainId)(smartAccountClient);
|
|
29
|
+
},
|
|
30
|
+
async getProvider() { },
|
|
31
|
+
async isAuthorized() {
|
|
32
|
+
return !!smartAccountClient.account.address;
|
|
33
|
+
},
|
|
34
|
+
onAccountsChanged() {
|
|
35
|
+
},
|
|
36
|
+
onChainChanged() {
|
|
37
|
+
},
|
|
38
|
+
onDisconnect() {
|
|
39
|
+
config.emitter.emit("disconnect");
|
|
40
|
+
},
|
|
41
|
+
async getClient({ chainId: requestedChainId }) {
|
|
42
|
+
const chainId = await this.getChainId();
|
|
43
|
+
if (requestedChainId !== chainId) {
|
|
44
|
+
throw new Error(`Invalid chainId ${chainId} requested`);
|
|
45
|
+
}
|
|
46
|
+
return smartAccountClient;
|
|
47
|
+
}
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
exports.smartAccount = smartAccount;
|
|
51
|
+
//# sourceMappingURL=smartAccount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smartAccount.js","sourceRoot":"","sources":["../../connectors/smartAccount.ts"],"names":[],"mappings":";;;AAAA,mDAAiE;AAGjE,iCAAuC;AAEvC,SAAgB,YAAY,CAI1B,EACE,kBAAkB,EAClB,EAAE,GAAG,kBAAkB,CAAC,GAAG,EAC3B,IAAI,GAAG,kBAAkB,CAAC,IAAI,EAC9B,IAAI,GAAG,eAAe,EAQzB;IAGG,kBAAkB,CAAC,WAAW,GAAG,GAAG,EAAE;QAClC,OAAO,SAAS,CAAA;IACpB,CAAC,CAAA;IAED,OAAO,IAAA,uBAAe,EAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAChC,EAAE;QACF,IAAI;QACJ,IAAI;QAEJ,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE;YAC1B,IAAI,OAAO,IAAI,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC;gBACnD,MAAM,IAAI,KAAK,CAAC,mBAAmB,OAAO,YAAY,CAAC,CAAA;YAC3D,CAAC;YAED,OAAO;gBACH,QAAQ,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC;gBAC9C,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE;aACnC,CAAA;QACL,CAAC;QACD,KAAK,CAAC,UAAU,KAAI,CAAC;QACrB,KAAK,CAAC,WAAW;YACb,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAC/C,CAAC;QACD,UAAU;YACN,OAAO,IAAA,wBAAO,EAAC,kBAAkB,CAAC,CAAA;QACtC,CAAC;QACD,KAAK,CAAC,WAAW,KAAI,CAAC;QACtB,KAAK,CAAC,YAAY;YACd,OAAO,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAA;QAC/C,CAAC;QACD,iBAAiB;QAEjB,CAAC;QACD,cAAc;QAEd,CAAC;QACD,YAAY;YACR,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QACrC,CAAC;QACD,KAAK,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAuB;YAC9D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAA;YACvC,IAAI,gBAAgB,KAAK,OAAO,EAAE,CAAC;gBAC/B,MAAM,IAAI,KAAK,CAAC,mBAAmB,OAAO,YAAY,CAAC,CAAA;YAC3D,CAAC;YACD,OAAO,kBAAkB,CAAA;QAC7B,CAAC;KACJ,CAAC,CAAC,CAAA;AACP,CAAC;AAlED,oCAkEC"}
|
package/_cjs/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.smartAccount = void 0;
|
|
4
|
+
const smartAccount_1 = require("./connectors/smartAccount.js");
|
|
5
|
+
Object.defineProperty(exports, "smartAccount", { enumerable: true, get: function () { return smartAccount_1.smartAccount; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,4DAAwD;AAE/C,6FAFA,2BAAY,OAEA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { chainId } from "permissionless";
|
|
2
|
+
import {} from "permissionless/accounts";
|
|
3
|
+
import { createConnector } from "wagmi";
|
|
4
|
+
export function smartAccount({ smartAccountClient, id = smartAccountClient.uid, name = smartAccountClient.name, type = "smart-account" }) {
|
|
5
|
+
// Don't remove this, it is needed because wagmi has an opinion on always estimating gas:
|
|
6
|
+
// https://github.com/wevm/wagmi/blob/main/packages/core/src/actions/sendTransaction.ts#L77
|
|
7
|
+
smartAccountClient.estimateGas = () => {
|
|
8
|
+
return undefined;
|
|
9
|
+
};
|
|
10
|
+
return createConnector((config) => ({
|
|
11
|
+
id,
|
|
12
|
+
name,
|
|
13
|
+
type,
|
|
14
|
+
// async setup() {},
|
|
15
|
+
async connect({ chainId } = {}) {
|
|
16
|
+
if (chainId && chainId !== (await this.getChainId())) {
|
|
17
|
+
throw new Error(`Invalid chainId ${chainId} requested`);
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
accounts: [smartAccountClient.account.address],
|
|
21
|
+
chainId: await this.getChainId()
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
async disconnect() { },
|
|
25
|
+
async getAccounts() {
|
|
26
|
+
return [smartAccountClient.account.address];
|
|
27
|
+
},
|
|
28
|
+
getChainId() {
|
|
29
|
+
return chainId(smartAccountClient);
|
|
30
|
+
},
|
|
31
|
+
async getProvider() { },
|
|
32
|
+
async isAuthorized() {
|
|
33
|
+
return !!smartAccountClient.account.address;
|
|
34
|
+
},
|
|
35
|
+
onAccountsChanged() {
|
|
36
|
+
// Not relevant
|
|
37
|
+
},
|
|
38
|
+
onChainChanged() {
|
|
39
|
+
// Not relevant because smart accounts only exist on single chain.
|
|
40
|
+
},
|
|
41
|
+
onDisconnect() {
|
|
42
|
+
config.emitter.emit("disconnect");
|
|
43
|
+
},
|
|
44
|
+
async getClient({ chainId: requestedChainId }) {
|
|
45
|
+
const chainId = await this.getChainId();
|
|
46
|
+
if (requestedChainId !== chainId) {
|
|
47
|
+
throw new Error(`Invalid chainId ${chainId} requested`);
|
|
48
|
+
}
|
|
49
|
+
return smartAccountClient;
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=smartAccount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smartAccount.js","sourceRoot":"","sources":["../../connectors/smartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAqB,MAAM,yBAAyB,CAAA;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;AAEvC,MAAM,UAAU,YAAY,CAI1B,EACE,kBAAkB,EAClB,EAAE,GAAG,kBAAkB,CAAC,GAAG,EAC3B,IAAI,GAAG,kBAAkB,CAAC,IAAI,EAC9B,IAAI,GAAG,eAAe,EAQzB;IACG,yFAAyF;IACzF,2FAA2F;IAC3F,kBAAkB,CAAC,WAAW,GAAG,GAAG,EAAE;QAClC,OAAO,SAAS,CAAA;IACpB,CAAC,CAAA;IAED,OAAO,eAAe,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAChC,EAAE;QACF,IAAI;QACJ,IAAI;QACJ,oBAAoB;QACpB,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE;YAC1B,IAAI,OAAO,IAAI,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC,UAAU,E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E,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type": "module","sideEffects":false}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { type SmartAccountClient, chainId } from "permissionless";
|
|
2
|
+
import { type SmartAccount } from "permissionless/accounts";
|
|
3
|
+
import type { Chain, Transport } from "viem";
|
|
4
|
+
export declare function smartAccount<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartAccount = SmartAccount>({ smartAccountClient, id, name, type }: {
|
|
5
|
+
smartAccountClient: SmartAccountClient<transport, chain, account> & {
|
|
6
|
+
estimateGas?: () => undefined | bigint;
|
|
7
|
+
};
|
|
8
|
+
id?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
}): import("wagmi").CreateConnectorFn<unknown, {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
type: string;
|
|
15
|
+
connect: ({ chainId }?: {
|
|
16
|
+
chainId?: number | undefined;
|
|
17
|
+
isReconnecting?: boolean | undefined;
|
|
18
|
+
} | undefined) => Promise<{
|
|
19
|
+
accounts: `0x${string}`[];
|
|
20
|
+
chainId: number;
|
|
21
|
+
}>;
|
|
22
|
+
disconnect: () => Promise<void>;
|
|
23
|
+
getAccounts: () => Promise<`0x${string}`[]>;
|
|
24
|
+
getChainId: () => Promise<number>;
|
|
25
|
+
getProvider: () => Promise<void>;
|
|
26
|
+
isAuthorized: () => Promise<true>;
|
|
27
|
+
onAccountsChanged: () => void;
|
|
28
|
+
onChainChanged: () => void;
|
|
29
|
+
onDisconnect: () => void;
|
|
30
|
+
getClient: ({ chainId: requestedChainId }: {
|
|
31
|
+
chainId: number;
|
|
32
|
+
}) => Promise<{
|
|
33
|
+
account: account;
|
|
34
|
+
batch?: {
|
|
35
|
+
multicall?: boolean | {
|
|
36
|
+
batchSize?: number | undefined;
|
|
37
|
+
wait?: number | undefined;
|
|
38
|
+
} | undefined;
|
|
39
|
+
} | undefined;
|
|
40
|
+
cacheTime: number;
|
|
41
|
+
chain: chain;
|
|
42
|
+
key: string;
|
|
43
|
+
name: string;
|
|
44
|
+
pollingInterval: number;
|
|
45
|
+
request: import("viem").EIP1193RequestFn<import("permissionless/_types/types/bundler").BundlerRpcSchema>;
|
|
46
|
+
transport: ReturnType<transport>["config"] & ReturnType<transport>["value"];
|
|
47
|
+
type: string;
|
|
48
|
+
uid: string;
|
|
49
|
+
sendTransaction: <TChainOverride extends Chain | undefined>(args: import("viem").SendTransactionParameters<chain, account, TChainOverride>) => Promise<`0x${string}`>;
|
|
50
|
+
signMessage: (args: import("viem").SignMessageParameters<account>) => Promise<`0x${string}`>;
|
|
51
|
+
signTypedData: <const TTypedData extends {
|
|
52
|
+
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
53
|
+
[x: `string[${string}]`]: undefined;
|
|
54
|
+
[x: `function[${string}]`]: undefined;
|
|
55
|
+
[x: `address[${string}]`]: undefined;
|
|
56
|
+
[x: `bool[${string}]`]: undefined;
|
|
57
|
+
[x: `bytes[${string}]`]: undefined;
|
|
58
|
+
[x: `bytes1[${string}]`]: undefined;
|
|
59
|
+
[x: `bytes16[${string}]`]: undefined;
|
|
60
|
+
[x: `bytes2[${string}]`]: undefined;
|
|
61
|
+
[x: `bytes3[${string}]`]: undefined;
|
|
62
|
+
[x: `bytes4[${string}]`]: undefined;
|
|
63
|
+
[x: `bytes5[${string}]`]: undefined;
|
|
64
|
+
[x: `bytes6[${string}]`]: undefined;
|
|
65
|
+
[x: `bytes7[${string}]`]: undefined;
|
|
66
|
+
[x: `bytes8[${string}]`]: undefined;
|
|
67
|
+
[x: `bytes9[${string}]`]: undefined;
|
|
68
|
+
[x: `bytes10[${string}]`]: undefined;
|
|
69
|
+
[x: `bytes11[${string}]`]: undefined;
|
|
70
|
+
[x: `bytes12[${string}]`]: undefined;
|
|
71
|
+
[x: `bytes13[${string}]`]: undefined;
|
|
72
|
+
[x: `bytes14[${string}]`]: undefined;
|
|
73
|
+
[x: `bytes15[${string}]`]: undefined;
|
|
74
|
+
[x: `bytes17[${string}]`]: undefined;
|
|
75
|
+
[x: `bytes18[${string}]`]: undefined;
|
|
76
|
+
[x: `bytes19[${string}]`]: undefined;
|
|
77
|
+
[x: `bytes20[${string}]`]: undefined;
|
|
78
|
+
[x: `bytes21[${string}]`]: undefined;
|
|
79
|
+
[x: `bytes22[${string}]`]: undefined;
|
|
80
|
+
[x: `bytes23[${string}]`]: undefined;
|
|
81
|
+
[x: `bytes24[${string}]`]: undefined;
|
|
82
|
+
[x: `bytes25[${string}]`]: undefined;
|
|
83
|
+
[x: `bytes26[${string}]`]: undefined;
|
|
84
|
+
[x: `bytes27[${string}]`]: undefined;
|
|
85
|
+
[x: `bytes28[${string}]`]: undefined;
|
|
86
|
+
[x: `bytes29[${string}]`]: undefined;
|
|
87
|
+
[x: `bytes30[${string}]`]: undefined;
|
|
88
|
+
[x: `bytes31[${string}]`]: undefined;
|
|
89
|
+
[x: `bytes32[${string}]`]: undefined;
|
|
90
|
+
[x: `int[${string}]`]: undefined;
|
|
91
|
+
[x: `int40[${string}]`]: undefined;
|
|
92
|
+
[x: `int16[${string}]`]: undefined;
|
|
93
|
+
[x: `int56[${string}]`]: undefined;
|
|
94
|
+
[x: `int8[${string}]`]: undefined;
|
|
95
|
+
[x: `int24[${string}]`]: undefined;
|
|
96
|
+
[x: `int32[${string}]`]: undefined;
|
|
97
|
+
[x: `int48[${string}]`]: undefined;
|
|
98
|
+
[x: `int64[${string}]`]: undefined;
|
|
99
|
+
[x: `int72[${string}]`]: undefined;
|
|
100
|
+
[x: `int80[${string}]`]: undefined;
|
|
101
|
+
[x: `int88[${string}]`]: undefined;
|
|
102
|
+
[x: `int96[${string}]`]: undefined;
|
|
103
|
+
[x: `int104[${string}]`]: undefined;
|
|
104
|
+
[x: `int112[${string}]`]: undefined;
|
|
105
|
+
[x: `int120[${string}]`]: undefined;
|
|
106
|
+
[x: `int128[${string}]`]: undefined;
|
|
107
|
+
[x: `int136[${string}]`]: undefined;
|
|
108
|
+
[x: `int144[${string}]`]: undefined;
|
|
109
|
+
[x: `int152[${string}]`]: undefined;
|
|
110
|
+
[x: `int160[${string}]`]: undefined;
|
|
111
|
+
[x: `int168[${string}]`]: undefined;
|
|
112
|
+
[x: `int176[${string}]`]: undefined;
|
|
113
|
+
[x: `int184[${string}]`]: undefined;
|
|
114
|
+
[x: `int192[${string}]`]: undefined;
|
|
115
|
+
[x: `int200[${string}]`]: undefined;
|
|
116
|
+
[x: `int208[${string}]`]: undefined;
|
|
117
|
+
[x: `int216[${string}]`]: undefined;
|
|
118
|
+
[x: `int224[${string}]`]: undefined;
|
|
119
|
+
[x: `int232[${string}]`]: undefined;
|
|
120
|
+
[x: `int240[${string}]`]: undefined;
|
|
121
|
+
[x: `int248[${string}]`]: undefined;
|
|
122
|
+
[x: `int256[${string}]`]: undefined;
|
|
123
|
+
[x: `uint[${string}]`]: undefined;
|
|
124
|
+
[x: `uint40[${string}]`]: undefined;
|
|
125
|
+
[x: `uint16[${string}]`]: undefined;
|
|
126
|
+
[x: `uint56[${string}]`]: undefined;
|
|
127
|
+
[x: `uint8[${string}]`]: undefined;
|
|
128
|
+
[x: `uint24[${string}]`]: undefined;
|
|
129
|
+
[x: `uint32[${string}]`]: undefined;
|
|
130
|
+
[x: `uint48[${string}]`]: undefined;
|
|
131
|
+
[x: `uint64[${string}]`]: undefined;
|
|
132
|
+
[x: `uint72[${string}]`]: undefined;
|
|
133
|
+
[x: `uint80[${string}]`]: undefined;
|
|
134
|
+
[x: `uint88[${string}]`]: undefined;
|
|
135
|
+
[x: `uint96[${string}]`]: undefined;
|
|
136
|
+
[x: `uint104[${string}]`]: undefined;
|
|
137
|
+
[x: `uint112[${string}]`]: undefined;
|
|
138
|
+
[x: `uint120[${string}]`]: undefined;
|
|
139
|
+
[x: `uint128[${string}]`]: undefined;
|
|
140
|
+
[x: `uint136[${string}]`]: undefined;
|
|
141
|
+
[x: `uint144[${string}]`]: undefined;
|
|
142
|
+
[x: `uint152[${string}]`]: undefined;
|
|
143
|
+
[x: `uint160[${string}]`]: undefined;
|
|
144
|
+
[x: `uint168[${string}]`]: undefined;
|
|
145
|
+
[x: `uint176[${string}]`]: undefined;
|
|
146
|
+
[x: `uint184[${string}]`]: undefined;
|
|
147
|
+
[x: `uint192[${string}]`]: undefined;
|
|
148
|
+
[x: `uint200[${string}]`]: undefined;
|
|
149
|
+
[x: `uint208[${string}]`]: undefined;
|
|
150
|
+
[x: `uint216[${string}]`]: undefined;
|
|
151
|
+
[x: `uint224[${string}]`]: undefined;
|
|
152
|
+
[x: `uint232[${string}]`]: undefined;
|
|
153
|
+
[x: `uint240[${string}]`]: undefined;
|
|
154
|
+
[x: `uint248[${string}]`]: undefined;
|
|
155
|
+
[x: `uint256[${string}]`]: undefined;
|
|
156
|
+
string?: undefined;
|
|
157
|
+
address?: undefined;
|
|
158
|
+
bool?: undefined;
|
|
159
|
+
bytes?: undefined;
|
|
160
|
+
bytes1?: undefined;
|
|
161
|
+
bytes16?: undefined;
|
|
162
|
+
bytes2?: undefined;
|
|
163
|
+
bytes3?: undefined;
|
|
164
|
+
bytes4?: undefined;
|
|
165
|
+
bytes5?: undefined;
|
|
166
|
+
bytes6?: undefined;
|
|
167
|
+
bytes7?: undefined;
|
|
168
|
+
bytes8?: undefined;
|
|
169
|
+
bytes9?: undefined;
|
|
170
|
+
bytes10?: undefined;
|
|
171
|
+
bytes11?: undefined;
|
|
172
|
+
bytes12?: undefined;
|
|
173
|
+
bytes13?: undefined;
|
|
174
|
+
bytes14?: undefined;
|
|
175
|
+
bytes15?: undefined;
|
|
176
|
+
bytes17?: undefined;
|
|
177
|
+
bytes18?: undefined;
|
|
178
|
+
bytes19?: undefined;
|
|
179
|
+
bytes20?: undefined;
|
|
180
|
+
bytes21?: undefined;
|
|
181
|
+
bytes22?: undefined;
|
|
182
|
+
bytes23?: undefined;
|
|
183
|
+
bytes24?: undefined;
|
|
184
|
+
bytes25?: undefined;
|
|
185
|
+
bytes26?: undefined;
|
|
186
|
+
bytes27?: undefined;
|
|
187
|
+
bytes28?: undefined;
|
|
188
|
+
bytes29?: undefined;
|
|
189
|
+
bytes30?: undefined;
|
|
190
|
+
bytes31?: undefined;
|
|
191
|
+
bytes32?: undefined;
|
|
192
|
+
int40?: undefined;
|
|
193
|
+
int16?: undefined;
|
|
194
|
+
int56?: undefined;
|
|
195
|
+
int8?: undefined;
|
|
196
|
+
int24?: undefined;
|
|
197
|
+
int32?: undefined;
|
|
198
|
+
int48?: undefined;
|
|
199
|
+
int64?: undefined;
|
|
200
|
+
int72?: undefined;
|
|
201
|
+
int80?: undefined;
|
|
202
|
+
int88?: undefined;
|
|
203
|
+
int96?: undefined;
|
|
204
|
+
int104?: undefined;
|
|
205
|
+
int112?: undefined;
|
|
206
|
+
int120?: undefined;
|
|
207
|
+
int128?: undefined;
|
|
208
|
+
int136?: undefined;
|
|
209
|
+
int144?: undefined;
|
|
210
|
+
int152?: undefined;
|
|
211
|
+
int160?: undefined;
|
|
212
|
+
int168?: undefined;
|
|
213
|
+
int176?: undefined;
|
|
214
|
+
int184?: undefined;
|
|
215
|
+
int192?: undefined;
|
|
216
|
+
int200?: undefined;
|
|
217
|
+
int208?: undefined;
|
|
218
|
+
int216?: undefined;
|
|
219
|
+
int224?: undefined;
|
|
220
|
+
int232?: undefined;
|
|
221
|
+
int240?: undefined;
|
|
222
|
+
int248?: undefined;
|
|
223
|
+
int256?: undefined;
|
|
224
|
+
uint40?: undefined;
|
|
225
|
+
uint16?: undefined;
|
|
226
|
+
uint56?: undefined;
|
|
227
|
+
uint8?: undefined;
|
|
228
|
+
uint24?: undefined;
|
|
229
|
+
uint32?: undefined;
|
|
230
|
+
uint48?: undefined;
|
|
231
|
+
uint64?: undefined;
|
|
232
|
+
uint72?: undefined;
|
|
233
|
+
uint80?: undefined;
|
|
234
|
+
uint88?: undefined;
|
|
235
|
+
uint96?: undefined;
|
|
236
|
+
uint104?: undefined;
|
|
237
|
+
uint112?: undefined;
|
|
238
|
+
uint120?: undefined;
|
|
239
|
+
uint128?: undefined;
|
|
240
|
+
uint136?: undefined;
|
|
241
|
+
uint144?: undefined;
|
|
242
|
+
uint152?: undefined;
|
|
243
|
+
uint160?: undefined;
|
|
244
|
+
uint168?: undefined;
|
|
245
|
+
uint176?: undefined;
|
|
246
|
+
uint184?: undefined;
|
|
247
|
+
uint192?: undefined;
|
|
248
|
+
uint200?: undefined;
|
|
249
|
+
uint208?: undefined;
|
|
250
|
+
uint216?: undefined;
|
|
251
|
+
uint224?: undefined;
|
|
252
|
+
uint232?: undefined;
|
|
253
|
+
uint240?: undefined;
|
|
254
|
+
uint248?: undefined;
|
|
255
|
+
uint256?: undefined;
|
|
256
|
+
} | {
|
|
257
|
+
[key: string]: unknown;
|
|
258
|
+
}, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType, account>) => Promise<`0x${string}`>;
|
|
259
|
+
deployContract: <const TAbi extends readonly unknown[] | import("viem").Abi, TChainOverride_1 extends Chain | undefined = undefined>(args: import("viem").DeployContractParameters<TAbi, chain, account, TChainOverride_1> extends infer T ? { [K in keyof T]: import("viem").DeployContractParameters<TAbi, chain, account, TChainOverride_1>[K]; } : never) => Promise<`0x${string}`>;
|
|
260
|
+
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, chain, account, TChainOverride_2>) => Promise<`0x${string}`>;
|
|
261
|
+
prepareUserOperationRequest: <TTransport extends Transport>(args: (import("permissionless/_types/actions/smartAccount").PrepareUserOperationRequestParameters<account> extends infer T_3 ? { [K_2 in keyof T_3]: import("permissionless/_types/actions/smartAccount").PrepareUserOperationRequestParameters<account>[K_2]; } : never) extends infer T_1 ? { [K_1 in keyof T_1]: (import("permissionless/_types/actions/smartAccount").PrepareUserOperationRequestParameters<account> extends infer T_2 ? { [K_2 in keyof T_2]: import("permissionless/_types/actions/smartAccount").PrepareUserOperationRequestParameters<account>[K_2]; } : never)[K_1]; } : never, stateOverrides?: import("permissionless/_types/types/bundler").StateOverrides | undefined) => Promise<{
|
|
262
|
+
sender: `0x${string}`;
|
|
263
|
+
nonce: bigint;
|
|
264
|
+
initCode: `0x${string}`;
|
|
265
|
+
callData: `0x${string}`;
|
|
266
|
+
callGasLimit: bigint;
|
|
267
|
+
verificationGasLimit: bigint;
|
|
268
|
+
preVerificationGas: bigint;
|
|
269
|
+
maxFeePerGas: bigint;
|
|
270
|
+
maxPriorityFeePerGas: bigint;
|
|
271
|
+
paymasterAndData: `0x${string}`;
|
|
272
|
+
signature: `0x${string}`;
|
|
273
|
+
}>;
|
|
274
|
+
sendUserOperation: <TTransport_1 extends Transport>(args: (import("permissionless/_types/actions/smartAccount").SendUserOperationParameters<account> extends infer T_6 ? { [K_4 in keyof T_6]: import("permissionless/_types/actions/smartAccount").SendUserOperationParameters<account>[K_4]; } : never) extends infer T_4 ? { [K_3 in keyof T_4]: (import("permissionless/_types/actions/smartAccount").SendUserOperationParameters<account> extends infer T_5 ? { [K_4 in keyof T_5]: import("permissionless/_types/actions/smartAccount").SendUserOperationParameters<account>[K_4]; } : never)[K_3]; } : never) => Promise<`0x${string}`>;
|
|
275
|
+
sendTransactions: (args: import("permissionless/_types/actions/smartAccount").SendTransactionsWithPaymasterParameters<account> extends infer T_7 ? { [K_5 in keyof T_7]: import("permissionless/_types/actions/smartAccount").SendTransactionsWithPaymasterParameters<account>[K_5]; } : never) => Promise<`0x${string}`>;
|
|
276
|
+
extend: <const client extends {
|
|
277
|
+
[x: string]: unknown;
|
|
278
|
+
account?: undefined;
|
|
279
|
+
batch?: undefined;
|
|
280
|
+
cacheTime?: undefined;
|
|
281
|
+
chain?: undefined;
|
|
282
|
+
key?: undefined;
|
|
283
|
+
name?: undefined;
|
|
284
|
+
pollingInterval?: undefined;
|
|
285
|
+
request?: undefined;
|
|
286
|
+
transport?: undefined;
|
|
287
|
+
type?: undefined;
|
|
288
|
+
uid?: undefined;
|
|
289
|
+
} & 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: import("viem").Client<transport, chain, account, import("permissionless/_types/types/bundler").BundlerRpcSchema, import("permissionless").SmartAccountActions<chain, account>>) => client) => import("viem").Client<transport, chain, account, import("permissionless/_types/types/bundler").BundlerRpcSchema, { [K_6 in keyof client]: client[K_6]; } & import("permissionless").SmartAccountActions<chain, account>>;
|
|
290
|
+
} & {
|
|
291
|
+
estimateGas?: (() => undefined | bigint) | undefined;
|
|
292
|
+
}>;
|
|
293
|
+
}, {}>;
|
|
294
|
+
//# sourceMappingURL=smartAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smartAccount.d.ts","sourceRoot":"","sources":["../../connectors/smartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAG5C,wBAAgB,YAAY,CACxB,SAAS,SAAS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|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"types": "./_types/index.d.ts",
|
|
28
|
-
"import": "./_esm/index.js",
|
|
29
|
-
"default": "./_cjs/index.js"
|
|
2
|
+
"name": "@permissionless/wagmi",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"author": "Pimlico",
|
|
5
|
+
"homepage": "https://docs.pimlico.io/permissionless/wagmi",
|
|
6
|
+
"repository": "github:pimlicolabs/permissionless.js",
|
|
7
|
+
"main": "./_cjs/index.js",
|
|
8
|
+
"module": "./_esm/index.js",
|
|
9
|
+
"types": "./_types/index.d.ts",
|
|
10
|
+
"typings": "./_types/index.d.ts",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"description": "A utility library for working with ERC-4337",
|
|
14
|
+
"keywords": ["ethereum", "erc-4337", "eip-4337", "paymaster", "bundler"],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./_types/index.d.ts",
|
|
19
|
+
"import": "./_esm/index.js",
|
|
20
|
+
"default": "./_cjs/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"wagmi": "^0.0.0-canary-20240123224806",
|
|
25
|
+
"viem": "^2.0.0",
|
|
26
|
+
"permissionless": "^0.0.30"
|
|
30
27
|
}
|
|
31
|
-
},
|
|
32
|
-
"peerDependencies": {
|
|
33
|
-
"typescript": "^5.0.0"
|
|
34
|
-
},
|
|
35
|
-
"bugs": {
|
|
36
|
-
"url": "https://github.com/pimlicolabs/permissionless.js/issues"
|
|
37
|
-
},
|
|
38
|
-
"scripts": {
|
|
39
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@types/bun": "latest"
|
|
43
|
-
}
|
|
44
28
|
}
|