viem 0.0.1-alpha.1 → 0.0.1-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/index.d.ts +5 -6
- package/dist/actions/index.js +3 -2
- package/dist/chains.d.ts +3 -3
- package/dist/chains.js +2 -1
- package/dist/{chunk-Z6LRV6XI.js → chunk-SRDTRROA.js} +98 -862
- package/dist/{chunk-OQTFTQTO.js → chunk-TLEMV4T3.js} +44 -63
- package/dist/chunk-WZITKXV3.js +996 -0
- package/dist/{chunk-LLYFXUSV.js → chunk-YZEQFYZ3.js} +149 -200
- package/dist/clients/index.d.ts +5 -6
- package/dist/clients/index.js +2 -4
- package/dist/{createWalletClient-915223f3.d.ts → createWalletClient-15ad1601.d.ts} +1 -1
- package/dist/{eip1193-8f7c22ce.d.ts → eip1193-8b4d90ce.d.ts} +1 -1
- package/dist/index.d.ts +281 -9
- package/dist/index.js +75 -21
- package/dist/{parseGwei-bbc055e4.d.ts → parseGwei-0f85e8ca.d.ts} +35 -113
- package/dist/{rpc-655c0ba4.d.ts → rpc-15b85963.d.ts} +1 -1
- package/dist/{rpc-3c0e3985.d.ts → rpc-26932bae.d.ts} +1 -38
- package/dist/{transactionRequest-ade896ac.d.ts → transactionRequest-f538ea86.d.ts} +1 -1
- package/dist/utils/index.d.ts +7 -6
- package/dist/utils/index.js +9 -37
- package/dist/{watchAsset-04ab8db5.d.ts → watchAsset-0c9d01e2.d.ts} +5 -16
- package/dist/{webSocket-c6e0d26f.d.ts → webSocket-b55b0951.d.ts} +4 -9
- package/dist/window.d.ts +2 -2
- package/package.json +1 -1
- package/dist/BaseError-7688f84e.d.ts +0 -18
@@ -1,9 +1,9 @@
|
|
1
1
|
import {
|
2
|
-
|
2
|
+
UrlRequiredError,
|
3
3
|
buildRequest,
|
4
4
|
getSocket,
|
5
5
|
rpc
|
6
|
-
} from "./chunk-
|
6
|
+
} from "./chunk-WZITKXV3.js";
|
7
7
|
|
8
8
|
// src/clients/transports/createTransport.ts
|
9
9
|
function createTransport(config, value) {
|
@@ -13,18 +13,6 @@ function createTransport(config, value) {
|
|
13
13
|
};
|
14
14
|
}
|
15
15
|
|
16
|
-
// src/clients/transports/errors.ts
|
17
|
-
var UrlRequiredError = class extends BaseError {
|
18
|
-
constructor() {
|
19
|
-
super(
|
20
|
-
"No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",
|
21
|
-
{
|
22
|
-
docsPath: "/TODO"
|
23
|
-
}
|
24
|
-
);
|
25
|
-
}
|
26
|
-
};
|
27
|
-
|
28
16
|
// src/clients/transports/custom.ts
|
29
17
|
function custom(provider, { key = "custom", name = "Custom Provider" } = {}) {
|
30
18
|
return () => createTransport({
|
@@ -37,36 +25,34 @@ function custom(provider, { key = "custom", name = "Custom Provider" } = {}) {
|
|
37
25
|
|
38
26
|
// src/clients/transports/fallback.ts
|
39
27
|
function fallback(transports, { key = "fallback", name = "Fallback" } = {}) {
|
40
|
-
return ({ chain }) =>
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
async
|
46
|
-
const
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
return fetch();
|
60
|
-
},
|
61
|
-
type: "fallback"
|
28
|
+
return ({ chain }) => createTransport(
|
29
|
+
{
|
30
|
+
key,
|
31
|
+
name,
|
32
|
+
async request({ method, params }) {
|
33
|
+
const fetch = async (i = 0) => {
|
34
|
+
const transport = transports[i]({ chain });
|
35
|
+
try {
|
36
|
+
return await transport.config.request({
|
37
|
+
method,
|
38
|
+
params
|
39
|
+
});
|
40
|
+
} catch (err) {
|
41
|
+
if (i < transports.length - 1)
|
42
|
+
return fetch(i + 1);
|
43
|
+
throw err;
|
44
|
+
}
|
45
|
+
};
|
46
|
+
return fetch();
|
62
47
|
},
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
48
|
+
type: "fallback"
|
49
|
+
},
|
50
|
+
{
|
51
|
+
transports: transports.map(
|
52
|
+
(fn) => fn({ chain })
|
53
|
+
)
|
54
|
+
}
|
55
|
+
);
|
70
56
|
}
|
71
57
|
|
72
58
|
// src/clients/transports/http.ts
|
@@ -211,16 +197,14 @@ function createPublicClient({
|
|
211
197
|
pollingInterval
|
212
198
|
}) {
|
213
199
|
chain;
|
214
|
-
return {
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
})
|
223
|
-
};
|
200
|
+
return createClient({
|
201
|
+
chain,
|
202
|
+
key,
|
203
|
+
name,
|
204
|
+
pollingInterval,
|
205
|
+
transport,
|
206
|
+
type: "publicClient"
|
207
|
+
});
|
224
208
|
}
|
225
209
|
|
226
210
|
// src/clients/createTestClient.ts
|
@@ -252,20 +236,17 @@ function createWalletClient({
|
|
252
236
|
name = "Wallet Client",
|
253
237
|
pollingInterval
|
254
238
|
}) {
|
255
|
-
return {
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
})
|
263
|
-
};
|
239
|
+
return createClient({
|
240
|
+
key,
|
241
|
+
name,
|
242
|
+
pollingInterval,
|
243
|
+
transport,
|
244
|
+
type: "walletClient"
|
245
|
+
});
|
264
246
|
}
|
265
247
|
|
266
248
|
export {
|
267
249
|
createTransport,
|
268
|
-
UrlRequiredError,
|
269
250
|
custom,
|
270
251
|
fallback,
|
271
252
|
http,
|