@gardenfi/utils 2.5.3-beta.6 → 2.5.3-beta.8
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/index100.cjs +1 -1
- package/dist/index100.js +3 -8
- package/dist/index101.cjs +1 -4
- package/dist/index101.js +26 -194
- package/dist/index102.cjs +2 -3
- package/dist/index102.js +19 -446
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +9 -27
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +8 -161
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +10 -21
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +11 -127
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +12 -37
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +14 -6
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +4 -27
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +6 -55
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +16 -43
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +12 -190
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +7 -4
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +7 -64
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +18 -17
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +8 -3
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +20 -15
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +17 -23
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +40 -11
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +21 -18
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +78 -32
- package/dist/index122.cjs +1 -1
- package/dist/index122.js +12 -3
- package/dist/index123.cjs +1 -1
- package/dist/index123.js +58 -18
- package/dist/index124.cjs +1 -1
- package/dist/index124.js +12 -26
- package/dist/index125.cjs +1 -1
- package/dist/index125.js +8 -36
- package/dist/index126.cjs +1 -1
- package/dist/index126.js +20 -8
- package/dist/index127.cjs +1 -1
- package/dist/index127.js +6 -10
- package/dist/index128.cjs +1 -1
- package/dist/index128.js +32 -22
- package/dist/index129.cjs +1 -1
- package/dist/index129.js +31 -27
- package/dist/index130.cjs +1 -1
- package/dist/index130.js +9 -3
- package/dist/index131.cjs +1 -1
- package/dist/index131.js +50 -65
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +19 -9
- package/dist/index133.cjs +1 -1
- package/dist/index133.js +106 -21
- package/dist/index134.cjs +1 -1
- package/dist/index134.js +68 -8
- package/dist/index135.cjs +1 -1
- package/dist/index135.js +8 -9
- package/dist/index136.cjs +1 -1
- package/dist/index136.js +71 -11
- package/dist/index137.cjs +2 -1
- package/dist/index137.js +3 -7
- package/dist/index138.cjs +1 -1
- package/dist/index138.js +9 -7
- package/dist/index139.cjs +1 -1
- package/dist/index139.js +13 -13
- package/dist/index140.cjs +1 -1
- package/dist/index140.js +4 -32
- package/dist/index141.cjs +1 -1
- package/dist/index141.js +13 -5
- package/dist/index142.cjs +1 -1
- package/dist/index142.js +2 -38
- package/dist/index143.cjs +1 -1
- package/dist/index143.js +27 -107
- package/dist/index144.cjs +1 -1
- package/dist/index144.js +20 -170
- package/dist/index145.cjs +1 -1
- package/dist/index145.js +5 -49
- package/dist/index146.cjs +1 -1
- package/dist/index146.js +5 -32
- package/dist/index147.cjs +1 -1
- package/dist/index147.js +5 -7
- package/dist/index148.cjs +9 -1
- package/dist/index148.js +35 -8
- package/dist/index149.cjs +1 -1
- package/dist/index149.js +3 -21
- package/dist/index150.cjs +1 -1
- package/dist/index150.js +16 -21
- package/dist/index151.cjs +1 -1
- package/dist/index151.js +18 -40
- package/dist/index152.cjs +1 -1
- package/dist/index152.js +35 -22
- package/dist/index153.cjs +1 -1
- package/dist/index153.js +8 -21
- package/dist/index154.cjs +4 -1
- package/dist/index154.js +194 -51
- package/dist/index155.cjs +1 -1
- package/dist/index155.js +27 -11
- package/dist/index156.cjs +1 -1
- package/dist/index156.js +161 -24
- package/dist/index157.cjs +1 -1
- package/dist/index157.js +126 -23
- package/dist/index158.cjs +1 -1
- package/dist/index158.js +25 -102
- package/dist/index159.cjs +1 -1
- package/dist/index159.js +56 -3
- package/dist/index160.cjs +1 -1
- package/dist/index160.js +191 -5
- package/dist/index161.cjs +1 -1
- package/dist/index161.js +4 -32
- package/dist/index162.cjs +1 -1
- package/dist/index162.js +20 -3
- package/dist/index163.cjs +1 -1
- package/dist/index163.js +3 -18
- package/dist/index164.cjs +1 -1
- package/dist/index164.js +16 -5
- package/dist/index165.cjs +1 -1
- package/dist/index165.js +11 -8
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +31 -100
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +3 -81
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +27 -5
- package/dist/index169.cjs +1 -1
- package/dist/index169.js +8 -6
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +25 -27
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +28 -34
- package/dist/index172.cjs +1 -1
- package/dist/index172.js +3 -13
- package/dist/index173.cjs +1 -1
- package/dist/index173.js +6 -19
- package/dist/index174.cjs +1 -1
- package/dist/index174.js +6 -78
- package/dist/index175.cjs +1 -1
- package/dist/index175.js +33 -2
- package/dist/index176.cjs +1 -1
- package/dist/index176.js +5 -15
- package/dist/index177.cjs +1 -1
- package/dist/index177.js +36 -17
- package/dist/index178.cjs +1 -1
- package/dist/index178.js +45 -167
- package/dist/index179.cjs +1 -1
- package/dist/index179.js +32 -17
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +8 -8
- package/dist/index180.cjs +1 -1
- package/dist/index180.js +8 -10
- package/dist/index181.cjs +1 -1
- package/dist/index181.js +39 -27
- package/dist/index182.cjs +1 -1
- package/dist/index182.js +52 -2
- package/dist/index183.cjs +1 -1
- package/dist/index183.js +104 -13
- package/dist/index184.cjs +1 -1
- package/dist/index184.js +3 -13
- package/dist/index185.cjs +1 -1
- package/dist/index185.js +5 -47
- package/dist/index186.cjs +1 -1
- package/dist/index186.js +3 -11
- package/dist/index187.cjs +1 -1
- package/dist/index187.js +17 -7
- package/dist/index188.cjs +1 -1
- package/dist/index188.js +5 -66
- package/dist/index189.cjs +1 -1
- package/dist/index189.js +8 -46
- package/dist/index190.cjs +1 -1
- package/dist/index190.js +101 -35
- package/dist/index191.cjs +1 -1
- package/dist/index191.js +5 -17
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +6 -6
- package/dist/index193.cjs +1 -1
- package/dist/index193.js +27 -9
- package/dist/index194.cjs +1 -1
- package/dist/index194.js +34 -13
- package/dist/index195.cjs +1 -1
- package/dist/index195.js +13 -8
- package/dist/index196.cjs +1 -1
- package/dist/index196.js +78 -35
- package/dist/index197.cjs +1 -1
- package/dist/index197.js +2 -17
- package/dist/index198.cjs +1 -1
- package/dist/index198.js +18 -14
- package/dist/index199.cjs +1 -1
- package/dist/index199.js +171 -6
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +2 -2
- package/dist/index200.cjs +1 -2
- package/dist/index200.js +16 -23
- package/dist/index201.cjs +1 -1
- package/dist/index201.js +10 -13
- package/dist/index202.cjs +1 -1
- package/dist/index202.js +2 -2
- package/dist/index203.cjs +1 -1
- package/dist/index203.js +5 -5
- package/dist/index205.cjs +1 -1
- package/dist/index205.js +1 -1
- package/dist/index206.cjs +1 -1
- package/dist/index206.js +2 -2
- package/dist/index207.cjs +1 -1
- package/dist/index207.js +1 -1
- package/dist/index208.cjs +1 -1
- package/dist/index208.js +5 -5
- package/dist/index209.cjs +1 -2
- package/dist/index209.js +24 -41
- package/dist/index210.cjs +1 -1
- package/dist/index210.js +47 -2
- package/dist/index211.cjs +1 -1
- package/dist/index211.js +9 -5
- package/dist/index212.cjs +2 -1
- package/dist/index212.js +40 -9
- package/dist/index213.cjs +1 -1
- package/dist/index213.js +2 -20
- package/dist/index214.cjs +1 -1
- package/dist/index214.js +5 -8
- package/dist/index215.cjs +1 -1
- package/dist/index215.js +9 -65
- package/dist/index216.cjs +1 -1
- package/dist/index216.js +17 -63
- package/dist/index217.cjs +1 -1
- package/dist/index217.js +8 -188
- package/dist/index218.cjs +1 -1
- package/dist/index218.js +66 -28
- package/dist/index219.cjs +1 -1
- package/dist/index219.js +61 -72
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +3 -3
- package/dist/index220.cjs +1 -1
- package/dist/index220.js +183 -35
- package/dist/index221.cjs +1 -1
- package/dist/index221.js +21 -9
- package/dist/index222.cjs +1 -1
- package/dist/index222.js +70 -7
- package/dist/index223.cjs +1 -1
- package/dist/index223.js +40 -11
- package/dist/index224.cjs +1 -1
- package/dist/index224.js +16 -12
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +13 -6
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +12 -7
- package/dist/index227.cjs +1 -1
- package/dist/index227.js +12 -19
- package/dist/index228.cjs +1 -1
- package/dist/index228.js +101 -106
- package/dist/index229.cjs +1 -1
- package/dist/index229.js +6 -103
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +2 -2
- package/dist/index230.cjs +1 -1
- package/dist/index230.js +7 -27
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +26 -16
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +18 -213
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +108 -24
- package/dist/index234.cjs +1 -1
- package/dist/index234.js +15 -45
- package/dist/index235.cjs +1 -1
- package/dist/index235.js +213 -8
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +1 -1
- package/dist/index237.cjs +1 -1
- package/dist/index237.js +1 -1
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +1 -1
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +5 -5
- package/dist/index241.cjs +2 -1
- package/dist/index241.js +66 -68
- package/dist/index242.cjs +1 -1
- package/dist/index242.js +14 -657
- package/dist/index243.cjs +1 -1
- package/dist/index243.js +68 -206
- package/dist/index244.cjs +1 -1
- package/dist/index244.js +634 -154
- package/dist/index245.cjs +1 -2
- package/dist/index245.js +203 -63
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +177 -14
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +1 -1
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +1 -1
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +171 -7
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +110 -30
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +30 -29
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +3 -16
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +2 -34
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +4 -45
- package/dist/index35.cjs +2 -1
- package/dist/index35.js +59 -151
- package/dist/index36.cjs +2 -1
- package/dist/index36.js +50 -31
- package/dist/index37.cjs +3 -1
- package/dist/index37.js +210 -53
- package/dist/index38.cjs +1 -2
- package/dist/index38.js +22 -58
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +18 -13
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +10 -37
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +20 -15
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +45 -8
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +12 -19
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +13 -2
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +24 -45
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +27 -31
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +47 -3
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +19 -9
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +11 -50
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +31 -7
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +36 -16
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +7 -10
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +29 -5
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +22 -14
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +7 -3
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +65 -25
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +44 -107
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +23 -4
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +37 -6
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +17 -88
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +6 -6
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +9 -125
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +12 -6
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +109 -21
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +22 -16
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +7 -40
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +20 -20
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +8 -11
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +31 -6
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +7 -19
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +16 -106
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +68 -63
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +35 -9
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +16 -28
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +63 -69
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +12 -4
- package/dist/index77.cjs +1 -2
- package/dist/index77.js +15 -3
- package/dist/index78.cjs +3 -1
- package/dist/index78.js +96 -9
- package/dist/index79.cjs +1 -20
- package/dist/index79.js +24 -326
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +33 -13
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +44 -4
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +6 -12
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +152 -2
- package/dist/index84.cjs +20 -1
- package/dist/index84.js +325 -6
- package/dist/index85.cjs +3 -2
- package/dist/index85.js +438 -41
- package/dist/index86.cjs +1 -3
- package/dist/index86.js +58 -209
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +37 -31
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +15 -21
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +2 -6
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +15 -72
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +10 -5
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +125 -5
- package/dist/index93.cjs +1 -9
- package/dist/index93.js +5 -35
- package/dist/index94.cjs +1 -3
- package/dist/index94.js +20 -94
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +46 -3
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +36 -16
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +6 -20
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +86 -33
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +13 -22
- package/package.json +1 -1
package/dist/index64.js
CHANGED
|
@@ -1,24 +1,112 @@
|
|
|
1
|
-
import { parseAccount as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { parseAccount as F } from "./index32.js";
|
|
2
|
+
import { internal_estimateFeesPerGas as b } from "./index57.js";
|
|
3
|
+
import { estimateGas as k } from "./index56.js";
|
|
4
|
+
import { getBlock as I } from "./index60.js";
|
|
5
|
+
import { getTransactionCount as T } from "./index77.js";
|
|
6
|
+
import { MaxFeePerGasTooLowError as C, Eip1559FeesNotSupportedError as H } from "./index58.js";
|
|
7
|
+
import { blobsToCommitments as q } from "./index104.js";
|
|
8
|
+
import { blobsToProofs as V } from "./index105.js";
|
|
9
|
+
import { commitmentsToVersionedHashes as _ } from "./index106.js";
|
|
10
|
+
import { toBlobSidecars as B } from "./index107.js";
|
|
11
|
+
import { getAction as p } from "./index55.js";
|
|
12
|
+
import { assertRequest as E } from "./index48.js";
|
|
13
|
+
import { getTransactionType as M } from "./index108.js";
|
|
14
|
+
import { getChainId as N } from "./index70.js";
|
|
15
|
+
const A = [
|
|
16
|
+
"blobVersionedHashes",
|
|
17
|
+
"chainId",
|
|
18
|
+
"fees",
|
|
19
|
+
"gas",
|
|
20
|
+
"nonce",
|
|
21
|
+
"type"
|
|
22
|
+
], w = /* @__PURE__ */ new Map();
|
|
23
|
+
async function X(s, a) {
|
|
24
|
+
const { account: u = s.account, blobs: c, chain: d, gas: g, kzg: y, nonce: G, nonceManager: h, parameters: i = A, type: x } = a, n = u && F(u), e = { ...a, ...n ? { from: n == null ? void 0 : n.address } : {} };
|
|
25
|
+
let f;
|
|
26
|
+
async function l() {
|
|
27
|
+
return f || (f = await p(s, I, "getBlock")({ blockTag: "latest" }), f);
|
|
28
|
+
}
|
|
29
|
+
let m;
|
|
30
|
+
async function P() {
|
|
31
|
+
return m || (d ? d.id : typeof a.chainId < "u" ? a.chainId : (m = await p(s, N, "getChainId")({}), m));
|
|
32
|
+
}
|
|
33
|
+
if (i.includes("nonce") && typeof G > "u" && n)
|
|
34
|
+
if (h) {
|
|
35
|
+
const t = await P();
|
|
36
|
+
e.nonce = await h.consume({
|
|
37
|
+
address: n.address,
|
|
38
|
+
chainId: t,
|
|
39
|
+
client: s
|
|
40
|
+
});
|
|
41
|
+
} else
|
|
42
|
+
e.nonce = await p(s, T, "getTransactionCount")({
|
|
43
|
+
address: n.address,
|
|
44
|
+
blockTag: "pending"
|
|
45
|
+
});
|
|
46
|
+
if ((i.includes("blobVersionedHashes") || i.includes("sidecars")) && c && y) {
|
|
47
|
+
const t = q({ blobs: c, kzg: y });
|
|
48
|
+
if (i.includes("blobVersionedHashes")) {
|
|
49
|
+
const o = _({
|
|
50
|
+
commitments: t,
|
|
51
|
+
to: "hex"
|
|
52
|
+
});
|
|
53
|
+
e.blobVersionedHashes = o;
|
|
54
|
+
}
|
|
55
|
+
if (i.includes("sidecars")) {
|
|
56
|
+
const o = V({ blobs: c, commitments: t, kzg: y }), r = B({
|
|
57
|
+
blobs: c,
|
|
58
|
+
commitments: t,
|
|
59
|
+
proofs: o,
|
|
60
|
+
to: "hex"
|
|
61
|
+
});
|
|
62
|
+
e.sidecars = r;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (i.includes("chainId") && (e.chainId = await P()), (i.includes("fees") || i.includes("type")) && typeof x > "u")
|
|
66
|
+
try {
|
|
67
|
+
e.type = M(e);
|
|
68
|
+
} catch {
|
|
69
|
+
let t = w.get(s.uid);
|
|
70
|
+
if (typeof t > "u") {
|
|
71
|
+
const o = await l();
|
|
72
|
+
t = typeof (o == null ? void 0 : o.baseFeePerGas) == "bigint", w.set(s.uid, t);
|
|
73
|
+
}
|
|
74
|
+
e.type = t ? "eip1559" : "legacy";
|
|
75
|
+
}
|
|
76
|
+
if (i.includes("fees"))
|
|
77
|
+
if (e.type !== "legacy" && e.type !== "eip2930") {
|
|
78
|
+
if (typeof e.maxFeePerGas > "u" || typeof e.maxPriorityFeePerGas > "u") {
|
|
79
|
+
const t = await l(), { maxFeePerGas: o, maxPriorityFeePerGas: r } = await b(s, {
|
|
80
|
+
block: t,
|
|
81
|
+
chain: d,
|
|
82
|
+
request: e
|
|
83
|
+
});
|
|
84
|
+
if (typeof a.maxPriorityFeePerGas > "u" && a.maxFeePerGas && a.maxFeePerGas < r)
|
|
85
|
+
throw new C({
|
|
86
|
+
maxPriorityFeePerGas: r
|
|
87
|
+
});
|
|
88
|
+
e.maxPriorityFeePerGas = r, e.maxFeePerGas = o;
|
|
89
|
+
}
|
|
90
|
+
} else {
|
|
91
|
+
if (typeof a.maxFeePerGas < "u" || typeof a.maxPriorityFeePerGas < "u")
|
|
92
|
+
throw new H();
|
|
93
|
+
if (typeof a.gasPrice > "u") {
|
|
94
|
+
const t = await l(), { gasPrice: o } = await b(s, {
|
|
95
|
+
block: t,
|
|
96
|
+
chain: d,
|
|
97
|
+
request: e,
|
|
98
|
+
type: "legacy"
|
|
99
|
+
});
|
|
100
|
+
e.gasPrice = o;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return i.includes("gas") && typeof g > "u" && (e.gas = await p(s, k, "estimateGas")({
|
|
104
|
+
...e,
|
|
105
|
+
account: n && { address: n.address, type: "json-rpc" }
|
|
106
|
+
})), E(e), delete e.parameters, e;
|
|
21
107
|
}
|
|
22
108
|
export {
|
|
23
|
-
A as
|
|
109
|
+
A as defaultParameters,
|
|
110
|
+
w as eip1559NetworkCache,
|
|
111
|
+
X as prepareTransactionRequest
|
|
24
112
|
};
|
package/dist/index65.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("./index151.cjs"),r=require("./index140.cjs");function o(e,{size:n}){if(r.size(e)>n)throw new z.SizeOverflowError({givenSize:r.size(e),maxSize:n})}function s(e,n={}){const{signed:u}=n;n.size&&o(e,{size:n.size});const i=BigInt(e);if(!u)return i;const t=(e.length-2)/2,c=(1n<<BigInt(t)*8n-1n)-1n;return i<=c?i:i-BigInt(`0x${"f".padStart(t*2,"f")}`)-1n}function f(e,n={}){return Number(s(e,n))}exports.assertSize=o;exports.hexToBigInt=s;exports.hexToNumber=f;
|
package/dist/index65.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { SizeOverflowError as u } from "./index151.js";
|
|
2
|
+
import { size as t } from "./index140.js";
|
|
3
|
+
function s(n, { size: i }) {
|
|
4
|
+
if (t(n) > i)
|
|
5
|
+
throw new u({
|
|
6
|
+
givenSize: t(n),
|
|
7
|
+
maxSize: i
|
|
8
8
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
}
|
|
10
|
+
function z(n, i = {}) {
|
|
11
|
+
const { signed: o } = i;
|
|
12
|
+
i.size && s(n, { size: i.size });
|
|
13
|
+
const e = BigInt(n);
|
|
14
|
+
if (!o)
|
|
15
|
+
return e;
|
|
16
|
+
const r = (n.length - 2) / 2, f = (1n << BigInt(r) * 8n - 1n) - 1n;
|
|
17
|
+
return e <= f ? e : e - BigInt(`0x${"f".padStart(r * 2, "f")}`) - 1n;
|
|
18
|
+
}
|
|
19
|
+
function g(n, i = {}) {
|
|
20
|
+
return Number(z(n, i));
|
|
17
21
|
}
|
|
18
22
|
export {
|
|
19
|
-
|
|
23
|
+
s as assertSize,
|
|
24
|
+
z as hexToBigInt,
|
|
25
|
+
g as hexToNumber
|
|
20
26
|
};
|
package/dist/index66.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index35.cjs");class n extends t.BaseError{constructor({blockHash:r,blockNumber:e}){let o="Block";r&&(o=`Block at hash "${r}"`),e&&(o=`Block at number "${e}"`),super(`${o} could not be found.`,{name:"BlockNotFoundError"})}}exports.BlockNotFoundError=n;
|
package/dist/index66.js
CHANGED
|
@@ -1,43 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { assertRequest as I } from "./index173.js";
|
|
8
|
-
import { getChainId as q } from "./index50.js";
|
|
9
|
-
async function E(t, s) {
|
|
10
|
-
var e, m, u, f;
|
|
11
|
-
const { account: i = t.account, chain: r = t.chain, ...c } = s;
|
|
12
|
-
if (!i)
|
|
13
|
-
throw new p({
|
|
14
|
-
docsPath: "/docs/actions/wallet/signTransaction"
|
|
15
|
-
});
|
|
16
|
-
const o = d(i);
|
|
17
|
-
I({
|
|
18
|
-
account: o,
|
|
19
|
-
...s
|
|
20
|
-
});
|
|
21
|
-
const n = await w(t, q, "getChainId")({});
|
|
22
|
-
r !== null && g({
|
|
23
|
-
currentChainId: n,
|
|
24
|
-
chain: r
|
|
25
|
-
});
|
|
26
|
-
const a = (r == null ? void 0 : r.formatters) || ((e = t.chain) == null ? void 0 : e.formatters), h = ((m = a == null ? void 0 : a.transactionRequest) == null ? void 0 : m.format) || C;
|
|
27
|
-
return o.signTransaction ? o.signTransaction({
|
|
28
|
-
...c,
|
|
29
|
-
chainId: n
|
|
30
|
-
}, { serializer: (f = (u = t.chain) == null ? void 0 : u.serializers) == null ? void 0 : f.transaction }) : await t.request({
|
|
31
|
-
method: "eth_signTransaction",
|
|
32
|
-
params: [
|
|
33
|
-
{
|
|
34
|
-
...h(c),
|
|
35
|
-
chainId: T(n),
|
|
36
|
-
from: o.address
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
}, { retryCount: 0 });
|
|
1
|
+
import { BaseError as e } from "./index35.js";
|
|
2
|
+
class d extends e {
|
|
3
|
+
constructor({ blockHash: r, blockNumber: t }) {
|
|
4
|
+
let o = "Block";
|
|
5
|
+
r && (o = `Block at hash "${r}"`), t && (o = `Block at number "${t}"`), super(`${o} could not be found.`, { name: "BlockNotFoundError" });
|
|
6
|
+
}
|
|
40
7
|
}
|
|
41
8
|
export {
|
|
42
|
-
|
|
9
|
+
d as BlockNotFoundError
|
|
43
10
|
};
|
package/dist/index67.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index182.cjs");function i(e){const s=(e.transactions??[]).map(n=>typeof n=="string"?n:t.formatTransaction(n));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:s,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}exports.formatBlock=i;
|
package/dist/index67.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { formatTransaction as i } from "./index182.js";
|
|
2
|
+
function a(e) {
|
|
3
|
+
const s = (e.transactions ?? []).map((n) => typeof n == "string" ? n : i(n));
|
|
4
|
+
return {
|
|
5
|
+
...e,
|
|
6
|
+
baseFeePerGas: e.baseFeePerGas ? BigInt(e.baseFeePerGas) : null,
|
|
7
|
+
blobGasUsed: e.blobGasUsed ? BigInt(e.blobGasUsed) : void 0,
|
|
8
|
+
difficulty: e.difficulty ? BigInt(e.difficulty) : void 0,
|
|
9
|
+
excessBlobGas: e.excessBlobGas ? BigInt(e.excessBlobGas) : void 0,
|
|
10
|
+
gasLimit: e.gasLimit ? BigInt(e.gasLimit) : void 0,
|
|
11
|
+
gasUsed: e.gasUsed ? BigInt(e.gasUsed) : void 0,
|
|
12
|
+
hash: e.hash ? e.hash : null,
|
|
13
|
+
logsBloom: e.logsBloom ? e.logsBloom : null,
|
|
14
|
+
nonce: e.nonce ? e.nonce : null,
|
|
15
|
+
number: e.number ? BigInt(e.number) : null,
|
|
16
|
+
size: e.size ? BigInt(e.size) : void 0,
|
|
17
|
+
timestamp: e.timestamp ? BigInt(e.timestamp) : void 0,
|
|
18
|
+
transactions: s,
|
|
19
|
+
totalDifficulty: e.totalDifficulty ? BigInt(e.totalDifficulty) : null
|
|
13
20
|
};
|
|
14
|
-
if (m({ domain: t, message: a, primaryType: o, types: n }), e.signTypedData)
|
|
15
|
-
return e.signTypedData({ domain: t, message: a, primaryType: o, types: n });
|
|
16
|
-
const i = u({ domain: t, message: a, primaryType: o, types: n });
|
|
17
|
-
return r.request({
|
|
18
|
-
method: "eth_signTypedData_v4",
|
|
19
|
-
params: [e.address, i]
|
|
20
|
-
}, { retryCount: 0 });
|
|
21
21
|
}
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
a as formatBlock
|
|
24
24
|
};
|
package/dist/index68.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index69.cjs"),r=e=>`blockNumber.${e}`;async function u(e,{cacheTime:c=e.cacheTime}={}){const t=await o.withCache(()=>e.request({method:"eth_blockNumber"}),{cacheKey:r(e.uid),cacheTime:c});return BigInt(t)}exports.getBlockNumber=u;
|
package/dist/index68.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
]
|
|
10
|
-
}, { retryCount: 0 });
|
|
1
|
+
import { withCache as t } from "./index69.js";
|
|
2
|
+
const r = (e) => `blockNumber.${e}`;
|
|
3
|
+
async function u(e, { cacheTime: c = e.cacheTime } = {}) {
|
|
4
|
+
const o = await t(() => e.request({
|
|
5
|
+
method: "eth_blockNumber"
|
|
6
|
+
}), { cacheKey: r(e.uid), cacheTime: c });
|
|
7
|
+
return BigInt(o);
|
|
11
8
|
}
|
|
12
9
|
export {
|
|
13
|
-
|
|
10
|
+
u as getBlockNumber
|
|
14
11
|
};
|
package/dist/index69.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=new Map,i=new Map;function p(o){const a=(s,t)=>({clear:()=>t.delete(s),get:()=>t.get(s),set:n=>t.set(s,n)}),r=a(o,c),e=a(o,i);return{clear:()=>{r.clear(),e.clear()},promise:r,response:e}}async function l(o,{cacheKey:a,cacheTime:r=Number.POSITIVE_INFINITY}){const e=p(a),s=e.response.get();if(s&&r>0&&Date.now()-s.created.getTime()<r)return s.data;let t=e.promise.get();t||(t=o(),e.promise.set(t));try{const n=await t;return e.response.set({created:new Date,data:n}),n}finally{e.promise.clear()}}exports.getCache=p;exports.promiseCache=c;exports.responseCache=i;exports.withCache=l;
|
package/dist/index69.js
CHANGED
|
@@ -1,9 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
const i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
|
|
2
|
+
function p(o) {
|
|
3
|
+
const a = (s, t) => ({
|
|
4
|
+
clear: () => t.delete(s),
|
|
5
|
+
get: () => t.get(s),
|
|
6
|
+
set: (r) => t.set(s, r)
|
|
7
|
+
}), n = a(o, i), e = a(o, c);
|
|
8
|
+
return {
|
|
9
|
+
clear: () => {
|
|
10
|
+
n.clear(), e.clear();
|
|
11
|
+
},
|
|
12
|
+
promise: n,
|
|
13
|
+
response: e
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
async function l(o, { cacheKey: a, cacheTime: n = Number.POSITIVE_INFINITY }) {
|
|
17
|
+
const e = p(a), s = e.response.get();
|
|
18
|
+
if (s && n > 0 && Date.now() - s.created.getTime() < n)
|
|
19
|
+
return s.data;
|
|
20
|
+
let t = e.promise.get();
|
|
21
|
+
t || (t = o(), e.promise.set(t));
|
|
22
|
+
try {
|
|
23
|
+
const r = await t;
|
|
24
|
+
return e.response.set({ created: /* @__PURE__ */ new Date(), data: r }), r;
|
|
25
|
+
} finally {
|
|
26
|
+
e.promise.clear();
|
|
27
|
+
}
|
|
6
28
|
}
|
|
7
29
|
export {
|
|
8
|
-
|
|
30
|
+
p as getCache,
|
|
31
|
+
i as promiseCache,
|
|
32
|
+
c as responseCache,
|
|
33
|
+
l as withCache
|
|
9
34
|
};
|
package/dist/index70.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index65.cjs");async function r(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return n.hexToNumber(t)}exports.getChainId=r;
|
package/dist/index70.js
CHANGED
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
key: n,
|
|
8
|
-
methods: i,
|
|
9
|
-
name: t,
|
|
10
|
-
request: o,
|
|
11
|
-
retryCount: r,
|
|
12
|
-
retryDelay: u,
|
|
13
|
-
timeout: c,
|
|
14
|
-
type: f
|
|
15
|
-
},
|
|
16
|
-
request: m(o, { methods: i, retryCount: r, retryDelay: u, uid: d }),
|
|
17
|
-
value: p
|
|
18
|
-
};
|
|
1
|
+
import { hexToNumber as n } from "./index65.js";
|
|
2
|
+
async function o(e) {
|
|
3
|
+
const t = await e.request({
|
|
4
|
+
method: "eth_chainId"
|
|
5
|
+
}, { dedupe: !0 });
|
|
6
|
+
return n(t);
|
|
19
7
|
}
|
|
20
8
|
export {
|
|
21
|
-
|
|
9
|
+
o as getChainId
|
|
22
10
|
};
|
package/dist/index71.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index72.cjs"),b=require("./index55.cjs"),f=require("./index73.cjs");async function m(o,s){const{abi:e,address:r,args:c,blockHash:i,eventName:t,fromBlock:g,toBlock:a,strict:u}=s,n=t?v.getAbiItem({abi:e,name:t}):void 0,d=n?void 0:e.filter(l=>l.type==="event");return b.getAction(o,f.getLogs,"getLogs")({address:r,args:c,blockHash:i,event:n,events:d,fromBlock:g,toBlock:a,strict:u})}exports.getContractEvents=m;
|
package/dist/index71.js
CHANGED
|
@@ -1,109 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
throw new s(new Error("method not supported"), {
|
|
17
|
-
method: c
|
|
18
|
-
});
|
|
19
|
-
if (t != null && t.include && !t.include.includes(c))
|
|
20
|
-
throw new s(new Error("method not supported"), {
|
|
21
|
-
method: c
|
|
22
|
-
});
|
|
23
|
-
const g = w ? O(`${$}.${_(n)}`) : void 0;
|
|
24
|
-
return V(() => W(async () => {
|
|
25
|
-
try {
|
|
26
|
-
return await r(n);
|
|
27
|
-
} catch (o) {
|
|
28
|
-
const e = o;
|
|
29
|
-
switch (e.code) {
|
|
30
|
-
case T.code:
|
|
31
|
-
throw new T(e);
|
|
32
|
-
case S.code:
|
|
33
|
-
throw new S(e);
|
|
34
|
-
case M.code:
|
|
35
|
-
throw new M(e, { method: n.method });
|
|
36
|
-
case B.code:
|
|
37
|
-
throw new B(e);
|
|
38
|
-
case i.code:
|
|
39
|
-
throw new i(e);
|
|
40
|
-
case j.code:
|
|
41
|
-
throw new j(e);
|
|
42
|
-
case x.code:
|
|
43
|
-
throw new x(e);
|
|
44
|
-
case P.code:
|
|
45
|
-
throw new P(e);
|
|
46
|
-
case D.code:
|
|
47
|
-
throw new D(e);
|
|
48
|
-
case s.code:
|
|
49
|
-
throw new s(e, {
|
|
50
|
-
method: n.method
|
|
51
|
-
});
|
|
52
|
-
case a.code:
|
|
53
|
-
throw new a(e);
|
|
54
|
-
case C.code:
|
|
55
|
-
throw new C(e);
|
|
56
|
-
case u.code:
|
|
57
|
-
throw new u(e);
|
|
58
|
-
case q.code:
|
|
59
|
-
throw new q(e);
|
|
60
|
-
case N.code:
|
|
61
|
-
throw new N(e);
|
|
62
|
-
case b.code:
|
|
63
|
-
throw new b(e);
|
|
64
|
-
case v.code:
|
|
65
|
-
throw new v(e);
|
|
66
|
-
case U.code:
|
|
67
|
-
throw new U(e);
|
|
68
|
-
case I.code:
|
|
69
|
-
throw new I(e);
|
|
70
|
-
case y.code:
|
|
71
|
-
throw new y(e);
|
|
72
|
-
case m.code:
|
|
73
|
-
throw new m(e);
|
|
74
|
-
case R.code:
|
|
75
|
-
throw new R(e);
|
|
76
|
-
case l.code:
|
|
77
|
-
throw new l(e);
|
|
78
|
-
case E.code:
|
|
79
|
-
throw new E(e);
|
|
80
|
-
case f.code:
|
|
81
|
-
throw new f(e);
|
|
82
|
-
case 5e3:
|
|
83
|
-
throw new u(e);
|
|
84
|
-
default:
|
|
85
|
-
throw o instanceof z ? o : new J(e);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}, {
|
|
89
|
-
delay: ({ count: o, error: e }) => {
|
|
90
|
-
var p;
|
|
91
|
-
if (e && e instanceof k) {
|
|
92
|
-
const d = (p = e == null ? void 0 : e.headers) == null ? void 0 : p.get("Retry-After");
|
|
93
|
-
if (d != null && d.match(/\d/))
|
|
94
|
-
return Number.parseInt(d, 10) * 1e3;
|
|
95
|
-
}
|
|
96
|
-
return ~~(1 << o) * H;
|
|
97
|
-
},
|
|
98
|
-
retryCount: L,
|
|
99
|
-
shouldRetry: ({ error: o }) => G(o)
|
|
100
|
-
}), { enabled: w, id: g });
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
function G(r) {
|
|
104
|
-
return "code" in r && typeof r.code == "number" ? r.code === -1 || r.code === a.code || r.code === i.code : r instanceof k && r.status ? r.status === 403 || r.status === 408 || r.status === 413 || r.status === 429 || r.status === 500 || r.status === 502 || r.status === 503 || r.status === 504 : !0;
|
|
1
|
+
import { getAbiItem as p } from "./index72.js";
|
|
2
|
+
import { getAction as v } from "./index55.js";
|
|
3
|
+
import { getLogs as l } from "./index73.js";
|
|
4
|
+
async function y(n, r) {
|
|
5
|
+
const { abi: t, address: s, args: c, blockHash: i, eventName: e, fromBlock: m, toBlock: a, strict: f } = r, o = e ? p({ abi: t, name: e }) : void 0, g = o ? void 0 : t.filter((d) => d.type === "event");
|
|
6
|
+
return v(n, l, "getLogs")({
|
|
7
|
+
address: s,
|
|
8
|
+
args: c,
|
|
9
|
+
blockHash: i,
|
|
10
|
+
event: o,
|
|
11
|
+
events: g,
|
|
12
|
+
fromBlock: m,
|
|
13
|
+
toBlock: a,
|
|
14
|
+
strict: f
|
|
15
|
+
});
|
|
105
16
|
}
|
|
106
17
|
export {
|
|
107
|
-
|
|
108
|
-
G as shouldRetry
|
|
18
|
+
y as getContractEvents
|
|
109
19
|
};
|
package/dist/index72.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index84.cjs"),g=require("./index172.cjs"),p=require("./index165.cjs"),m=require("./index163.cjs"),b=require("./index161.cjs");function A(i){const{abi:o,args:n=[],name:t}=i,u=g.isHex(t,{strict:!1}),s=o.filter(e=>u?e.type==="function"?b.toFunctionSelector(e)===t:e.type==="event"?m.toEventSelector(e)===t:!1:"name"in e&&e.name===t);if(s.length===0)return;if(s.length===1)return s[0];let r;for(const e of s){if(!("inputs"in e))continue;if(!n||n.length===0){if(!e.inputs||e.inputs.length===0)return e;continue}if(!e.inputs||e.inputs.length===0||e.inputs.length!==n.length)continue;if(n.every((c,d)=>{const a="inputs"in e&&e.inputs[d];return a?f(c,a):!1})){if(r&&"inputs"in r&&r.inputs){const c=l(e.inputs,r.inputs,n);if(c)throw new y.AbiItemAmbiguityError({abiItem:e,type:c[0]},{abiItem:r,type:c[1]})}r=e}}return r||s[0]}function f(i,o){const n=typeof i,t=o.type;switch(t){case"address":return p.isAddress(i,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return t==="tuple"&&"components"in o?Object.values(o.components).every((u,s)=>f(Object.values(i)[s],u)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(t)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(t)?n==="string"||i instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(t)?Array.isArray(i)&&i.every(u=>f(u,{...o,type:t.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function l(i,o,n){for(const t in i){const u=i[t],s=o[t];if(u.type==="tuple"&&s.type==="tuple"&&"components"in u&&"components"in s)return l(u.components,s.components,n[t]);const r=[u.type,s.type];if(r.includes("address")&&r.includes("bytes20")?!0:r.includes("address")&&r.includes("string")?p.isAddress(n[t],{strict:!1}):r.includes("address")&&r.includes("bytes")?p.isAddress(n[t],{strict:!1}):!1)return r}}exports.getAbiItem=A;exports.getAmbiguousTypes=l;exports.isArgOfType=f;
|