viem 0.0.1-alpha.0 → 0.0.1-alpha.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/README.md +16 -0
- package/dist/actions/index.d.ts +3 -7
- package/dist/actions/index.js +4 -2
- package/dist/chains.d.ts +2 -2
- package/dist/chains.js +1 -1
- package/dist/{chunk-GI67STNV.js → chunk-3EOU525X.js} +603 -26
- package/dist/{chunk-JSYJDK4W.js → chunk-4HNVS7AM.js} +99 -33
- package/dist/{chunk-OPR6LKYX.js → chunk-YQRTXQ2G.js} +56 -36
- package/dist/clients/index.d.ts +2 -2
- package/dist/clients/index.js +6 -4
- package/dist/{createWalletClient-c40fef16.d.ts → createWalletClient-915223f3.d.ts} +5 -5
- package/dist/index.d.ts +5 -4
- package/dist/index.js +19 -5
- package/dist/{parseGwei-a7d0bcb2.d.ts → parseGwei-fd7a0f7d.d.ts} +83 -10
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +7 -1
- package/dist/{watchAsset-bb30848d.d.ts → watchAsset-04ab8db5.d.ts} +20 -22
- package/dist/{webSocket-14584a7e.d.ts → webSocket-c6e0d26f.d.ts} +25 -14
- package/package.json +61 -10
@@ -16,7 +16,7 @@ import {
|
|
16
16
|
numberToHex,
|
17
17
|
wait,
|
18
18
|
withCache
|
19
|
-
} from "./chunk-
|
19
|
+
} from "./chunk-3EOU525X.js";
|
20
20
|
|
21
21
|
// src/actions/wallet/addChain.ts
|
22
22
|
async function addChain(client, chain) {
|
@@ -62,17 +62,45 @@ async function requestPermissions(client, permissions) {
|
|
62
62
|
}
|
63
63
|
|
64
64
|
// src/actions/wallet/sendTransaction.ts
|
65
|
-
async function sendTransaction(client, {
|
66
|
-
|
65
|
+
async function sendTransaction(client, {
|
66
|
+
chain,
|
67
|
+
from,
|
68
|
+
accessList,
|
69
|
+
data,
|
70
|
+
gas,
|
71
|
+
gasPrice,
|
72
|
+
maxFeePerGas,
|
73
|
+
maxPriorityFeePerGas,
|
74
|
+
nonce,
|
75
|
+
to,
|
76
|
+
value,
|
77
|
+
...rest
|
78
|
+
}) {
|
79
|
+
if (maxFeePerGas !== void 0 && maxPriorityFeePerGas !== void 0 && maxFeePerGas < maxPriorityFeePerGas)
|
67
80
|
throw new InvalidGasArgumentsError();
|
68
|
-
const request_ = format(
|
69
|
-
|
70
|
-
|
81
|
+
const request_ = format(
|
82
|
+
{
|
83
|
+
from,
|
84
|
+
accessList,
|
85
|
+
data,
|
86
|
+
gas,
|
87
|
+
gasPrice,
|
88
|
+
maxFeePerGas,
|
89
|
+
maxPriorityFeePerGas,
|
90
|
+
nonce,
|
91
|
+
to,
|
92
|
+
value,
|
93
|
+
...rest
|
94
|
+
},
|
95
|
+
{
|
96
|
+
formatter: chain?.formatters?.transactionRequest || formatTransactionRequest
|
97
|
+
}
|
98
|
+
);
|
71
99
|
const hash = await client.request({
|
72
100
|
method: "eth_sendTransaction",
|
73
101
|
params: [request_]
|
74
102
|
});
|
75
|
-
return
|
103
|
+
return hash;
|
76
104
|
}
|
77
105
|
var InvalidGasArgumentsError = class extends BaseError {
|
78
106
|
constructor() {
|
@@ -125,20 +153,50 @@ async function watchAsset(client, params) {
|
|
125
153
|
}
|
126
154
|
|
127
155
|
// src/actions/public/call.ts
|
128
|
-
async function call(client, {
|
129
|
-
|
156
|
+
async function call(client, {
|
157
|
+
blockNumber,
|
158
|
+
blockTag = "latest",
|
159
|
+
chain,
|
160
|
+
from,
|
161
|
+
accessList,
|
162
|
+
data,
|
163
|
+
gas,
|
164
|
+
gasPrice,
|
165
|
+
maxFeePerGas,
|
166
|
+
maxPriorityFeePerGas,
|
167
|
+
nonce,
|
168
|
+
to,
|
169
|
+
value,
|
170
|
+
...rest
|
171
|
+
}) {
|
172
|
+
if (maxFeePerGas !== void 0 && maxPriorityFeePerGas !== void 0 && maxFeePerGas < maxPriorityFeePerGas)
|
130
173
|
throw new InvalidGasArgumentsError();
|
131
174
|
const blockNumberHex = blockNumber ? numberToHex(blockNumber) : void 0;
|
132
|
-
const request_ = format(
|
133
|
-
|
134
|
-
|
135
|
-
|
175
|
+
const request_ = format(
|
176
|
+
{
|
177
|
+
from,
|
178
|
+
accessList,
|
179
|
+
data,
|
180
|
+
gas,
|
181
|
+
gasPrice,
|
182
|
+
maxFeePerGas,
|
183
|
+
maxPriorityFeePerGas,
|
184
|
+
nonce,
|
185
|
+
to,
|
186
|
+
value,
|
187
|
+
...rest
|
188
|
+
},
|
189
|
+
{
|
190
|
+
formatter: chain?.formatters?.transactionRequest || formatTransactionRequest
|
191
|
+
}
|
192
|
+
);
|
193
|
+
const response = await client.request({
|
136
194
|
method: "eth_call",
|
137
195
|
params: [request_, blockNumberHex || blockTag]
|
138
196
|
});
|
139
|
-
if (
|
197
|
+
if (response === "0x")
|
140
198
|
return { data: void 0 };
|
141
|
-
return { data };
|
199
|
+
return { data: response };
|
142
200
|
}
|
143
201
|
|
144
202
|
// src/actions/public/createPendingTransactionFilter.ts
|
@@ -161,16 +219,14 @@ async function createBlockFilter(client) {
|
|
161
219
|
async function estimateGas(client, {
|
162
220
|
blockNumber,
|
163
221
|
blockTag = "latest",
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
value
|
173
|
-
}
|
222
|
+
data,
|
223
|
+
from,
|
224
|
+
gas,
|
225
|
+
gasPrice,
|
226
|
+
maxFeePerGas,
|
227
|
+
maxPriorityFeePerGas,
|
228
|
+
to,
|
229
|
+
value
|
174
230
|
}) {
|
175
231
|
const blockNumberHex = blockNumber ? numberToHex(blockNumber) : void 0;
|
176
232
|
const parameters = {
|
@@ -314,6 +370,15 @@ async function getFilterChanges(client, { filter }) {
|
|
314
370
|
);
|
315
371
|
}
|
316
372
|
|
373
|
+
// src/actions/public/getFilterLogs.ts
|
374
|
+
async function getFilterLogs(client, { filter }) {
|
375
|
+
const logs = await client.request({
|
376
|
+
method: "eth_getFilterLogs",
|
377
|
+
params: [filter.id]
|
378
|
+
});
|
379
|
+
return logs.map(formatLog);
|
380
|
+
}
|
381
|
+
|
317
382
|
// src/actions/public/getGasPrice.ts
|
318
383
|
async function getGasPrice(client) {
|
319
384
|
const gasPrice = await client.request({
|
@@ -768,14 +833,14 @@ async function getAutomine(client) {
|
|
768
833
|
// src/actions/test/getTxpoolContent.ts
|
769
834
|
async function getTxpoolContent(client) {
|
770
835
|
return await client.request({
|
771
|
-
method:
|
836
|
+
method: "txpool_content"
|
772
837
|
});
|
773
838
|
}
|
774
839
|
|
775
840
|
// src/actions/test/getTxpoolStatus.ts
|
776
841
|
async function getTxpoolStatus(client) {
|
777
842
|
const { pending, queued } = await client.request({
|
778
|
-
method:
|
843
|
+
method: "txpool_status"
|
779
844
|
});
|
780
845
|
return {
|
781
846
|
pending: hexToNumber(pending),
|
@@ -802,7 +867,7 @@ async function increaseTime(client, { seconds }) {
|
|
802
867
|
// src/actions/test/inspectTxpool.ts
|
803
868
|
async function inspectTxpool(client) {
|
804
869
|
return await client.request({
|
805
|
-
method:
|
870
|
+
method: "txpool_inspect"
|
806
871
|
});
|
807
872
|
}
|
808
873
|
|
@@ -832,19 +897,19 @@ async function reset(client, { blockNumber, jsonRpcUrl } = {}) {
|
|
832
897
|
// src/actions/test/revert.ts
|
833
898
|
async function revert(client, { id }) {
|
834
899
|
return await client.request({
|
835
|
-
method:
|
900
|
+
method: "evm_revert",
|
836
901
|
params: [id]
|
837
902
|
});
|
838
903
|
}
|
839
904
|
|
840
905
|
// src/actions/test/sendUnsignedTransaction.ts
|
841
|
-
async function sendUnsignedTransaction(client,
|
906
|
+
async function sendUnsignedTransaction(client, request) {
|
842
907
|
const request_ = formatTransactionRequest(request);
|
843
908
|
const hash = await client.request({
|
844
909
|
method: "eth_sendUnsignedTransaction",
|
845
910
|
params: [request_]
|
846
911
|
});
|
847
|
-
return
|
912
|
+
return hash;
|
848
913
|
}
|
849
914
|
|
850
915
|
// src/actions/test/setAutomine.ts
|
@@ -930,7 +995,7 @@ async function setNextBlockBaseFeePerGas(client, { baseFeePerGas }) {
|
|
930
995
|
// src/actions/test/setNextBlockTimestamp.ts
|
931
996
|
async function setNextBlockTimestamp(client, { timestamp }) {
|
932
997
|
return await client.request({
|
933
|
-
method:
|
998
|
+
method: "evm_setNextBlockTimestamp",
|
934
999
|
params: [numberToHex(timestamp)]
|
935
1000
|
});
|
936
1001
|
}
|
@@ -958,7 +1023,7 @@ async function setStorageAt(client, { address, index, value }) {
|
|
958
1023
|
// src/actions/test/snapshot.ts
|
959
1024
|
async function snapshot(client) {
|
960
1025
|
return await client.request({
|
961
|
-
method:
|
1026
|
+
method: "evm_snapshot"
|
962
1027
|
});
|
963
1028
|
}
|
964
1029
|
|
@@ -992,6 +1057,7 @@ export {
|
|
992
1057
|
getChainId,
|
993
1058
|
getFeeHistory,
|
994
1059
|
getFilterChanges,
|
1060
|
+
getFilterLogs,
|
995
1061
|
getGasPrice,
|
996
1062
|
getTransaction,
|
997
1063
|
getTransactionConfirmations,
|
@@ -3,7 +3,7 @@ import {
|
|
3
3
|
buildRequest,
|
4
4
|
getSocket,
|
5
5
|
rpc
|
6
|
-
} from "./chunk-
|
6
|
+
} from "./chunk-3EOU525X.js";
|
7
7
|
|
8
8
|
// src/clients/transports/createTransport.ts
|
9
9
|
function createTransport(config, value) {
|
@@ -25,26 +25,50 @@ var UrlRequiredError = class extends BaseError {
|
|
25
25
|
}
|
26
26
|
};
|
27
27
|
|
28
|
-
// src/clients/transports/
|
29
|
-
function
|
30
|
-
key = "ethereumProvider",
|
31
|
-
name = "Ethereum Provider",
|
32
|
-
provider
|
33
|
-
}) {
|
28
|
+
// src/clients/transports/custom.ts
|
29
|
+
function custom(provider, { key = "custom", name = "Custom Provider" } = {}) {
|
34
30
|
return () => createTransport({
|
35
31
|
key,
|
36
32
|
name,
|
37
33
|
request: provider.request.bind(provider),
|
38
|
-
type: "
|
34
|
+
type: "custom"
|
39
35
|
});
|
40
36
|
}
|
41
37
|
|
38
|
+
// src/clients/transports/fallback.ts
|
39
|
+
function fallback(transports, { key = "fallback", name = "Fallback" } = {}) {
|
40
|
+
return ({ chain }) => createTransport(
|
41
|
+
{
|
42
|
+
key,
|
43
|
+
name,
|
44
|
+
async request({ method, params }) {
|
45
|
+
const fetch = async (i = 0) => {
|
46
|
+
const transport = transports[i]({ chain });
|
47
|
+
try {
|
48
|
+
return await transport.config.request({
|
49
|
+
method,
|
50
|
+
params
|
51
|
+
});
|
52
|
+
} catch (err) {
|
53
|
+
if (i < transports.length - 1)
|
54
|
+
return fetch(i + 1);
|
55
|
+
throw err;
|
56
|
+
}
|
57
|
+
};
|
58
|
+
return fetch();
|
59
|
+
},
|
60
|
+
type: "fallback"
|
61
|
+
},
|
62
|
+
{
|
63
|
+
transports: transports.map(
|
64
|
+
(fn) => fn({ chain })
|
65
|
+
)
|
66
|
+
}
|
67
|
+
);
|
68
|
+
}
|
69
|
+
|
42
70
|
// src/clients/transports/http.ts
|
43
|
-
function http({
|
44
|
-
key = "http",
|
45
|
-
name = "HTTP JSON-RPC",
|
46
|
-
url
|
47
|
-
} = {}) {
|
71
|
+
function http(url, { key = "http", name = "HTTP JSON-RPC" } = {}) {
|
48
72
|
return ({ chain }) => {
|
49
73
|
const url_ = url || chain?.rpcUrls.default.http[0];
|
50
74
|
if (!url_)
|
@@ -72,10 +96,9 @@ function http({
|
|
72
96
|
}
|
73
97
|
|
74
98
|
// src/clients/transports/webSocket.ts
|
75
|
-
function webSocket({
|
99
|
+
function webSocket(url, {
|
76
100
|
key = "webSocket",
|
77
|
-
name = "WebSocket JSON-RPC"
|
78
|
-
url
|
101
|
+
name = "WebSocket JSON-RPC"
|
79
102
|
} = {}) {
|
80
103
|
return ({ chain }) => {
|
81
104
|
const url_ = url || chain?.rpcUrls.default.webSocket?.[0];
|
@@ -186,16 +209,14 @@ function createPublicClient({
|
|
186
209
|
pollingInterval
|
187
210
|
}) {
|
188
211
|
chain;
|
189
|
-
return {
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
})
|
198
|
-
};
|
212
|
+
return createClient({
|
213
|
+
chain,
|
214
|
+
key,
|
215
|
+
name,
|
216
|
+
pollingInterval,
|
217
|
+
transport,
|
218
|
+
type: "publicClient"
|
219
|
+
});
|
199
220
|
}
|
200
221
|
|
201
222
|
// src/clients/createTestClient.ts
|
@@ -227,21 +248,20 @@ function createWalletClient({
|
|
227
248
|
name = "Wallet Client",
|
228
249
|
pollingInterval
|
229
250
|
}) {
|
230
|
-
return {
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
})
|
238
|
-
};
|
251
|
+
return createClient({
|
252
|
+
key,
|
253
|
+
name,
|
254
|
+
pollingInterval,
|
255
|
+
transport,
|
256
|
+
type: "walletClient"
|
257
|
+
});
|
239
258
|
}
|
240
259
|
|
241
260
|
export {
|
242
261
|
createTransport,
|
243
262
|
UrlRequiredError,
|
244
|
-
|
263
|
+
custom,
|
264
|
+
fallback,
|
245
265
|
http,
|
246
266
|
webSocket,
|
247
267
|
createClient,
|
package/dist/clients/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
export { C as Client, a as ClientConfig, P as PublicClient, b as PublicClientConfig, T as TestClient, c as TestClientConfig, d as Transport, e as TransportConfig, W as WalletClient, f as WalletClientConfig, g as createClient, h as createPublicClient, i as createTestClient, j as createTransport, k as createWalletClient } from '../createWalletClient-
|
2
|
-
export {
|
1
|
+
export { C as Client, a as ClientConfig, P as PublicClient, b as PublicClientConfig, T as TestClient, c as TestClientConfig, d as Transport, e as TransportConfig, W as WalletClient, f as WalletClientConfig, g as createClient, h as createPublicClient, i as createTestClient, j as createTransport, k as createWalletClient } from '../createWalletClient-915223f3.js';
|
2
|
+
export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, U as UrlRequiredError, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from '../webSocket-c6e0d26f.js';
|
3
3
|
import '../chains.js';
|
4
4
|
import '../rpc-655c0ba4.js';
|
5
5
|
import '@wagmi/chains';
|
package/dist/clients/index.js
CHANGED
@@ -5,11 +5,12 @@ import {
|
|
5
5
|
createTestClient,
|
6
6
|
createTransport,
|
7
7
|
createWalletClient,
|
8
|
-
|
8
|
+
custom,
|
9
|
+
fallback,
|
9
10
|
http,
|
10
11
|
webSocket
|
11
|
-
} from "../chunk-
|
12
|
-
import "../chunk-
|
12
|
+
} from "../chunk-YQRTXQ2G.js";
|
13
|
+
import "../chunk-3EOU525X.js";
|
13
14
|
export {
|
14
15
|
UrlRequiredError,
|
15
16
|
createClient,
|
@@ -17,7 +18,8 @@ export {
|
|
17
18
|
createTestClient,
|
18
19
|
createTransport,
|
19
20
|
createWalletClient,
|
20
|
-
|
21
|
+
custom,
|
22
|
+
fallback,
|
21
23
|
http,
|
22
24
|
webSocket
|
23
25
|
};
|
@@ -36,7 +36,7 @@ type Client<TTransport extends Transport = Transport, TChain extends Chain = Cha
|
|
36
36
|
pollingInterval: number;
|
37
37
|
/** Request function wrapped with friendly error handling */
|
38
38
|
request: TRequests['request'];
|
39
|
-
/** The RPC transport (http, webSocket,
|
39
|
+
/** The RPC transport (http, webSocket, custom, etc) */
|
40
40
|
transport: ReturnType<TTransport>['config'] & ReturnType<TTransport>['value'];
|
41
41
|
/** The type of client. */
|
42
42
|
type: string;
|
@@ -96,9 +96,9 @@ type TestClient<TTransport extends Transport = Transport, TChain extends Chain =
|
|
96
96
|
* `evm_mine`, etc).
|
97
97
|
*
|
98
98
|
* @example
|
99
|
+
* import { createTestClient, http } from 'viem'
|
99
100
|
* import { local } from 'viem/chains'
|
100
|
-
*
|
101
|
-
* const client = createTestClient(http({ chain: local }), { mode: 'anvil' })
|
101
|
+
* const client = createTestClient({ chain: local, mode: 'anvil', transport: http() })
|
102
102
|
*/
|
103
103
|
declare function createTestClient<TTransport extends Transport, TChain extends Chain, TMode extends TestClientModes>({ chain, key, name, mode, pollingInterval, transport, }: TestClientConfig<TTransport, TChain, TMode>): TestClient<TTransport, TChain, TMode>;
|
104
104
|
|
@@ -120,9 +120,9 @@ type WalletClient<TTransport extends Transport = Transport, TChain extends Chain
|
|
120
120
|
* (ie. `eth_sendTransaction`, `eth_requestAccounts`, etc).
|
121
121
|
*
|
122
122
|
* @example
|
123
|
-
* import { createWalletClient,
|
123
|
+
* import { createWalletClient, custom } from 'viem'
|
124
124
|
* const client = createWalletClient(
|
125
|
-
*
|
125
|
+
* custom(window.ethereum)
|
126
126
|
* )
|
127
127
|
*/
|
128
128
|
declare function createWalletClient<TTransport extends Transport, TChain extends Chain>({ transport, key, name, pollingInterval, }: WalletClientConfig<TTransport, TChain>): WalletClient<TTransport, TChain>;
|
package/dist/index.d.ts
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as CreatePendingTransactionFilterResponse, D as DropTransactionArgs, E as EstimateGasArgs, d as EstimateGasResponse, G as GetBalanceArgs, e as GetBalanceResponse, f as GetBlockArgs, g as GetBlockNumberArgs, h as GetBlockNumberResponse, i as GetBlockResponse, j as GetBlockTransactionCountArgs, k as GetBlockTransactionCountResponse, l as GetFeeHistoryArgs, m as GetFeeHistoryResponse, n as GetFilterChangesArgs, o as GetFilterChangesResponse, p as
|
2
|
-
export { C as Client, a as ClientConfig, P as PublicClient, b as PublicClientConfig, T as TestClient, c as TestClientConfig, d as Transport, e as TransportConfig, W as WalletClient, f as WalletClientConfig, g as createClient, h as createPublicClient, i as createTestClient, j as createTransport, k as createWalletClient } from './createWalletClient-
|
3
|
-
export {
|
1
|
+
export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as CreatePendingTransactionFilterResponse, D as DropTransactionArgs, E as EstimateGasArgs, d as EstimateGasResponse, G as GetBalanceArgs, e as GetBalanceResponse, f as GetBlockArgs, g as GetBlockNumberArgs, h as GetBlockNumberResponse, i as GetBlockResponse, j as GetBlockTransactionCountArgs, k as GetBlockTransactionCountResponse, l as GetFeeHistoryArgs, m as GetFeeHistoryResponse, n as GetFilterChangesArgs, o as GetFilterChangesResponse, p as GetFilterLogsArgs, q as GetFilterLogsResponse, r as GetGasPriceResponse, s as GetPermissionsResponse, t as GetTransactionArgs, u as GetTransactionConfirmationsArgs, v as GetTransactionConfirmationsResponse, w as GetTransactionCountArgs, x as GetTransactionCountResponse, z as GetTransactionReceiptArgs, A as GetTransactionReceiptResponse, y as GetTransactionResponse, I as ImpersonateAccountArgs, B as IncreaseTimeArgs, M as MineArgs, O as OnBlock, F as OnBlockNumber, H as OnBlockNumberResponse, J as OnBlockResponse, K as OnTransactions, L as OnTransactionsResponse, N as RequestPermissionsResponse, R as ResetArgs, P as RevertArgs, S as SendTransactionArgs, Q as SendTransactionResponse, T as SendUnsignedTransactionArgs, U as SendUnsignedTransactionResponse, V as SetBalanceArgs, W as SetBlockGasLimitArgs, $ as SetBlockTimestampIntervalArgs, X as SetCodeArgs, Y as SetCoinbaseArgs, Z as SetIntervalMiningArgs, _ as SetMinGasPriceArgs, a1 as SetNextBlockBaseFeePerGasArgs, a0 as SetNextBlockTimestampArgs, a2 as SetNonceArgs, a3 as SetStorageAtArgs, a4 as SignMessageArgs, a5 as SignMessageResponse, a6 as StopImpersonatingAccountArgs, a7 as SwitchChainArgs, a8 as UninstallFilterArgs, a9 as UninstallFilterResponse, aa as WaitForTransactionReceiptArgs, ab as WaitForTransactionReceiptResponse, ac as WatchAssetArgs, ad as WatchAssetResponse, ae as WatchBlockNumberArgs, af as WatchBlocksArgs, ag as WatchPendingTransactionsArgs, ah as addChain, ai as call, aj as createBlockFilter, ak as createPendingTransactionFilter, am as dropTransaction, al as estimateGas, an as getAccounts, ao as getAutomine, ap as getBalance, aq as getBlock, ar as getBlockNumber, as as getBlockTransactionCount, at as getChainId, au as getFeeHistory, av as getFilterChanges, aw as getFilterLogs, ax as getGasPrice, ay as getPermissions, az as getTransaction, aA as getTransactionConfirmations, aB as getTransactionCount, aC as getTransactionReceipt, aD as getTxpoolContent, aE as getTxpoolStatus, aF as impersonateAccount, aG as increaseTime, aH as inspectTxpool, aI as mine, aJ as removeBlockTimestampInterval, aL as requestAccounts, aM as requestPermissions, aK as reset, aN as revert, aO as sendTransaction, aP as sendUnsignedTransaction, aQ as setAutomine, aR as setBalance, aS as setBlockGasLimit, aT as setBlockTimestampInterval, aU as setCode, aV as setCoinbase, aW as setIntervalMining, aX as setLoggingEnabled, aY as setMinGasPrice, aZ as setNextBlockBaseFeePerGas, a_ as setNextBlockTimestamp, a$ as setNonce, b0 as setStorageAt, b1 as signMessage, b2 as snapshot, b3 as stopImpersonatingAccount, b4 as switchChain, b5 as uninstallFilter, b6 as waitForTransactionReceipt, b7 as watchAsset, b8 as watchBlockNumber, b9 as watchBlocks, ba as watchPendingTransactions } from './watchAsset-04ab8db5.js';
|
2
|
+
export { C as Client, a as ClientConfig, P as PublicClient, b as PublicClientConfig, T as TestClient, c as TestClientConfig, d as Transport, e as TransportConfig, W as WalletClient, f as WalletClientConfig, g as createClient, h as createPublicClient, i as createTestClient, j as createTransport, k as createWalletClient } from './createWalletClient-915223f3.js';
|
3
|
+
export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, U as UrlRequiredError, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from './webSocket-c6e0d26f.js';
|
4
4
|
export { a as AccessList, A as Address, B as Block, b as BlockIdentifier, c as BlockNumber, d as BlockTag, f as ByteArray, F as FeeHistory, h as FeeValues, i as FeeValuesEIP1559, j as FeeValuesLegacy, k as Hash, H as Hex, L as Log, R as RpcBlock, l as RpcBlockIdentifier, m as RpcBlockNumber, n as RpcFeeHistory, o as RpcFeeValues, p as RpcLog, q as RpcTransaction, r as RpcTransactionReceipt, s as RpcTransactionRequest, u as RpcUncle, D as Transaction, E as TransactionBase, G as TransactionEIP1559, I as TransactionEIP2930, J as TransactionLegacy, T as TransactionReceipt, v as TransactionRequest, x as TransactionRequestBase, y as TransactionRequestEIP1559, z as TransactionRequestEIP2930, C as TransactionRequestLegacy, U as Uncle, e as etherUnits, g as gweiUnits, t as transactionType, w as weiUnits } from './rpc-655c0ba4.js';
|
5
|
-
export { E as EncodeRlpResponse, G as GetContractAddressOptions,
|
5
|
+
export { A as AbiDecodingDataSizeInvalidError, a as AbiEncodingArrayLengthMismatchError, b as AbiEncodingLengthMismatchError, E as EncodeRlpResponse, G as GetContractAddressOptions, d as GetCreate2AddressOptions, c as GetCreateAddressOptions, g as InternalRpcError, I as InvalidAbiDecodingTypeError, e as InvalidAbiEncodingTypeError, f as InvalidArrayError, h as InvalidInputRpcError, i as InvalidParamsRpcError, j as InvalidRequestRpcError, J as JsonRpcVersionUnsupportedError, L as LimitExceededRpcError, M as MethodNotFoundRpcError, k as MethodNotSupportedRpcError, P as ParseRpcError, R as ResourceNotFoundRpcError, l as ResourceUnavailableRpcError, m as RpcRequestError, T as TransactionRejectedRpcError, p as boolToBytes, q as boolToHex, r as bytesToBigint, s as bytesToBool, n as bytesToHex, t as bytesToNumber, o as bytesToString, u as decodeAbi, v as decodeBytes, w as decodeHex, x as decodeRlp, y as encodeAbi, z as encodeBytes, B as encodeFunctionParams, C as encodeHex, D as encodeRlp, S as formatEther, a8 as formatGwei, a9 as formatUnit, F as getAddress, H as getContractAddress, N as getCreate2Address, K as getCreateAddress, O as getEventSignature, Q as getFunctionSignature, Y as hexToBigInt, Z as hexToBool, _ as hexToBytes, aa as hexToNumber, $ as hexToString, U as isAddress, V as isAddressEqual, W as isBytes, X as isHex, a0 as keccak256, a1 as numberToBytes, ab as numberToHex, a2 as pad, a3 as padBytes, a4 as padHex, a5 as parseEther, a6 as parseGwei, a7 as parseUnit, ac as size, ad as slice, ae as sliceBytes, af as sliceHex, ag as stringToBytes, ah as stringToHex, ai as trim } from './parseGwei-fd7a0f7d.js';
|
6
6
|
export { B as BaseError } from './BaseError-7688f84e.js';
|
7
7
|
export { F as FormattedBlock, a as FormattedTransaction, b as FormattedTransactionRequest, f as formatBlock, c as formatTransaction, d as formatTransactionRequest } from './transactionRequest-ade896ac.js';
|
8
8
|
export { H as HttpRequestError, R as RpcError, T as TimeoutError } from './rpc-3c0e3985.js';
|
9
9
|
import './chains.js';
|
10
10
|
import '@wagmi/chains';
|
11
11
|
import './eip1193-8f7c22ce.js';
|
12
|
+
import 'abitype';
|
package/dist/index.js
CHANGED
@@ -5,6 +5,7 @@ import {
|
|
5
5
|
createPendingTransactionFilter,
|
6
6
|
dropTransaction,
|
7
7
|
estimateGas,
|
8
|
+
getAccounts,
|
8
9
|
getAutomine,
|
9
10
|
getBalance,
|
10
11
|
getBlock,
|
@@ -12,6 +13,8 @@ import {
|
|
12
13
|
getBlockTransactionCount,
|
13
14
|
getChainId,
|
14
15
|
getFeeHistory,
|
16
|
+
getFilterChanges,
|
17
|
+
getFilterLogs,
|
15
18
|
getGasPrice,
|
16
19
|
getPermissions,
|
17
20
|
getTransaction,
|
@@ -54,7 +57,7 @@ import {
|
|
54
57
|
watchBlockNumber,
|
55
58
|
watchBlocks,
|
56
59
|
watchPendingTransactions
|
57
|
-
} from "./chunk-
|
60
|
+
} from "./chunk-4HNVS7AM.js";
|
58
61
|
import {
|
59
62
|
UrlRequiredError,
|
60
63
|
createClient,
|
@@ -62,10 +65,11 @@ import {
|
|
62
65
|
createTestClient,
|
63
66
|
createTransport,
|
64
67
|
createWalletClient,
|
65
|
-
|
68
|
+
custom,
|
69
|
+
fallback,
|
66
70
|
http,
|
67
71
|
webSocket
|
68
|
-
} from "./chunk-
|
72
|
+
} from "./chunk-YQRTXQ2G.js";
|
69
73
|
import {
|
70
74
|
BaseError,
|
71
75
|
HttpRequestError,
|
@@ -91,10 +95,13 @@ import {
|
|
91
95
|
bytesToHex,
|
92
96
|
bytesToNumber,
|
93
97
|
bytesToString,
|
98
|
+
decodeAbi,
|
94
99
|
decodeBytes,
|
95
100
|
decodeHex,
|
96
101
|
decodeRlp,
|
102
|
+
encodeAbi,
|
97
103
|
encodeBytes,
|
104
|
+
encodeFunctionParams,
|
98
105
|
encodeHex,
|
99
106
|
encodeRlp,
|
100
107
|
etherUnits,
|
@@ -138,7 +145,7 @@ import {
|
|
138
145
|
transactionType,
|
139
146
|
trim,
|
140
147
|
weiUnits
|
141
|
-
} from "./chunk-
|
148
|
+
} from "./chunk-3EOU525X.js";
|
142
149
|
export {
|
143
150
|
BaseError,
|
144
151
|
HttpRequestError,
|
@@ -174,22 +181,27 @@ export {
|
|
174
181
|
createTestClient,
|
175
182
|
createTransport,
|
176
183
|
createWalletClient,
|
184
|
+
custom,
|
185
|
+
decodeAbi,
|
177
186
|
decodeBytes,
|
178
187
|
decodeHex,
|
179
188
|
decodeRlp,
|
180
189
|
dropTransaction,
|
190
|
+
encodeAbi,
|
181
191
|
encodeBytes,
|
192
|
+
encodeFunctionParams,
|
182
193
|
encodeHex,
|
183
194
|
encodeRlp,
|
184
195
|
estimateGas,
|
185
196
|
etherUnits,
|
186
|
-
|
197
|
+
fallback,
|
187
198
|
formatBlock,
|
188
199
|
formatEther,
|
189
200
|
formatGwei,
|
190
201
|
formatTransaction,
|
191
202
|
formatTransactionRequest,
|
192
203
|
formatUnit,
|
204
|
+
getAccounts,
|
193
205
|
getAddress,
|
194
206
|
getAutomine,
|
195
207
|
getBalance,
|
@@ -202,6 +214,8 @@ export {
|
|
202
214
|
getCreateAddress,
|
203
215
|
getEventSignature,
|
204
216
|
getFeeHistory,
|
217
|
+
getFilterChanges,
|
218
|
+
getFilterLogs,
|
205
219
|
getFunctionSignature,
|
206
220
|
getGasPrice,
|
207
221
|
getPermissions,
|