@gardenfi/utils 2.5.3-beta.2 → 2.5.3-beta.4
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 -14
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +26 -3
- package/dist/index102.cjs +2 -1
- package/dist/index102.js +23 -25
- package/dist/index103.cjs +1 -2
- package/dist/index103.js +9 -24
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +8 -9
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +10 -8
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +11 -10
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +13 -11
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +14 -13
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +4 -14
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +6 -4
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +18 -6
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +13 -18
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +6 -13
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +7 -6
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +21 -7
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +7 -21
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +21 -7
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +16 -20
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +38 -15
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +19 -38
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +79 -20
- package/dist/index122.cjs +1 -1
- package/dist/index122.js +10 -79
- package/dist/index123.cjs +1 -1
- package/dist/index123.js +57 -10
- package/dist/index124.cjs +1 -1
- package/dist/index124.js +12 -57
- package/dist/index125.cjs +1 -1
- package/dist/index125.js +8 -13
- package/dist/index126.cjs +1 -1
- package/dist/index126.js +20 -8
- package/dist/index127.cjs +1 -1
- package/dist/index127.js +6 -20
- package/dist/index128.cjs +1 -1
- package/dist/index128.js +35 -6
- package/dist/index129.cjs +1 -1
- package/dist/index129.js +31 -34
- package/dist/index130.cjs +1 -1
- package/dist/index130.js +8 -31
- package/dist/index131.cjs +1 -1
- package/dist/index131.js +50 -9
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +17 -48
- package/dist/index133.cjs +1 -1
- package/dist/index133.js +105 -18
- package/dist/index134.cjs +1 -1
- package/dist/index134.js +67 -105
- package/dist/index135.cjs +1 -1
- package/dist/index135.js +7 -66
- package/dist/index136.cjs +1 -1
- package/dist/index136.js +71 -9
- package/dist/index137.cjs +2 -1
- package/dist/index137.js +3 -72
- package/dist/index138.cjs +1 -2
- package/dist/index138.js +9 -3
- package/dist/index139.cjs +1 -1
- package/dist/index139.js +14 -9
- package/dist/index140.cjs +1 -1
- package/dist/index140.js +4 -13
- package/dist/index141.cjs +1 -1
- package/dist/index141.js +12 -4
- package/dist/index142.cjs +1 -1
- package/dist/index142.js +2 -13
- package/dist/index143.cjs +1 -1
- package/dist/index143.js +32 -2
- package/dist/index144.cjs +1 -1
- package/dist/index144.js +22 -32
- package/dist/index145.cjs +1 -1
- package/dist/index145.js +5 -21
- package/dist/index146.cjs +1 -1
- package/dist/index146.js +5 -5
- package/dist/index147.cjs +1 -1
- package/dist/index147.js +4 -4
- package/dist/index148.cjs +9 -1
- package/dist/index148.js +35 -5
- package/dist/index149.cjs +1 -9
- package/dist/index149.js +3 -36
- package/dist/index150.cjs +1 -1
- package/dist/index150.js +19 -3
- package/dist/index151.cjs +1 -1
- package/dist/index151.js +13 -11
- package/dist/index152.cjs +1 -1
- package/dist/index152.js +33 -18
- package/dist/index153.cjs +1 -1
- package/dist/index153.js +6 -33
- package/dist/index154.cjs +4 -1
- package/dist/index154.js +192 -6
- package/dist/index155.cjs +1 -4
- package/dist/index155.js +17 -184
- package/dist/index156.cjs +1 -1
- package/dist/index156.js +153 -19
- package/dist/index157.cjs +1 -1
- package/dist/index157.js +124 -158
- package/dist/index158.cjs +1 -1
- package/dist/index158.js +27 -127
- package/dist/index159.cjs +1 -1
- package/dist/index159.js +52 -24
- package/dist/index160.cjs +1 -1
- package/dist/index160.js +191 -55
- package/dist/index161.cjs +1 -1
- package/dist/index161.js +4 -192
- package/dist/index162.cjs +1 -1
- package/dist/index162.js +21 -4
- package/dist/index163.cjs +1 -1
- package/dist/index163.js +3 -21
- package/dist/index164.cjs +1 -1
- package/dist/index164.js +17 -3
- package/dist/index165.cjs +1 -1
- package/dist/index165.js +11 -16
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +34 -11
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +3 -35
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +28 -3
- package/dist/index169.cjs +1 -1
- package/dist/index169.js +8 -27
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +25 -8
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +23 -20
- package/dist/index172.cjs +1 -1
- package/dist/index172.js +3 -28
- package/dist/index173.cjs +1 -1
- package/dist/index173.js +6 -3
- package/dist/index174.cjs +1 -1
- package/dist/index174.js +6 -6
- package/dist/index175.cjs +1 -1
- package/dist/index175.js +32 -6
- package/dist/index176.cjs +1 -1
- package/dist/index176.js +5 -33
- package/dist/index177.cjs +1 -1
- package/dist/index177.js +38 -5
- package/dist/index178.cjs +1 -1
- package/dist/index178.js +39 -27
- package/dist/index179.cjs +1 -1
- package/dist/index179.js +31 -48
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +5 -5
- package/dist/index180.cjs +1 -1
- package/dist/index180.js +8 -32
- package/dist/index181.cjs +1 -1
- package/dist/index181.js +40 -6
- package/dist/index182.cjs +1 -1
- package/dist/index182.js +48 -39
- package/dist/index183.cjs +1 -1
- package/dist/index183.js +102 -49
- package/dist/index184.cjs +1 -1
- package/dist/index184.js +3 -105
- package/dist/index185.cjs +1 -1
- package/dist/index185.js +6 -3
- package/dist/index186.cjs +1 -1
- package/dist/index186.js +3 -5
- package/dist/index187.cjs +1 -1
- package/dist/index187.js +17 -3
- package/dist/index188.cjs +1 -1
- package/dist/index188.js +5 -17
- package/dist/index189.cjs +1 -1
- package/dist/index189.js +8 -5
- package/dist/index190.cjs +1 -1
- package/dist/index190.js +103 -8
- package/dist/index191.cjs +1 -1
- package/dist/index191.js +5 -103
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +6 -5
- package/dist/index193.cjs +1 -1
- package/dist/index193.js +27 -6
- package/dist/index194.cjs +1 -1
- package/dist/index194.js +34 -27
- package/dist/index195.cjs +1 -1
- package/dist/index195.js +13 -34
- package/dist/index196.cjs +1 -1
- package/dist/index196.js +78 -13
- package/dist/index197.cjs +1 -1
- package/dist/index197.js +2 -79
- package/dist/index198.cjs +1 -1
- package/dist/index198.js +19 -2
- package/dist/index199.cjs +1 -1
- package/dist/index199.js +170 -17
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +2 -2
- package/dist/index200.cjs +1 -1
- package/dist/index200.js +16 -170
- package/dist/index201.cjs +1 -1
- package/dist/index201.js +10 -17
- package/dist/index202.cjs +1 -1
- package/dist/index202.js +25 -10
- package/dist/index203.cjs +1 -1
- package/dist/index203.js +17 -24
- package/dist/index204.cjs +1 -1
- package/dist/index204.js +15 -18
- package/dist/index205.cjs +1 -1
- package/dist/index205.js +5 -15
- package/dist/index206.cjs +1 -1
- package/dist/index206.js +13 -5
- package/dist/index207.cjs +1 -1
- package/dist/index207.js +9 -12
- package/dist/index208.cjs +1 -1
- package/dist/index208.js +16 -10
- package/dist/index209.cjs +1 -1
- package/dist/index209.js +24 -16
- package/dist/index210.cjs +1 -1
- package/dist/index210.js +46 -24
- package/dist/index211.cjs +1 -1
- package/dist/index211.js +9 -46
- package/dist/index212.cjs +2 -1
- package/dist/index212.js +41 -9
- package/dist/index213.cjs +1 -2
- package/dist/index213.js +2 -42
- package/dist/index214.cjs +1 -1
- package/dist/index214.js +6 -2
- package/dist/index215.cjs +1 -1
- package/dist/index215.js +10 -5
- package/dist/index216.cjs +1 -1
- package/dist/index216.js +18 -9
- package/dist/index217.cjs +1 -1
- package/dist/index217.js +8 -19
- package/dist/index218.cjs +1 -1
- package/dist/index218.js +66 -8
- package/dist/index219.cjs +1 -1
- package/dist/index219.js +64 -65
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +8 -8
- package/dist/index220.cjs +1 -1
- package/dist/index220.js +183 -60
- package/dist/index221.cjs +1 -1
- package/dist/index221.js +25 -185
- package/dist/index222.cjs +1 -1
- package/dist/index222.js +61 -13
- package/dist/index223.cjs +1 -1
- package/dist/index223.js +18 -54
- package/dist/index224.cjs +1 -1
- package/dist/index224.js +10 -34
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +7 -10
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +11 -13
- package/dist/index227.cjs +1 -1
- package/dist/index227.js +12 -11
- package/dist/index228.cjs +1 -1
- package/dist/index228.js +19 -12
- package/dist/index229.cjs +1 -1
- package/dist/index229.js +108 -6
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +2 -2
- package/dist/index230.cjs +1 -1
- package/dist/index230.js +7 -7
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +7 -20
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +101 -106
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +24 -101
- package/dist/index234.cjs +1 -1
- package/dist/index234.js +16 -26
- package/dist/index235.cjs +1 -1
- package/dist/index235.js +211 -13
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +41 -213
- package/dist/index237.cjs +1 -1
- package/dist/index237.js +66 -30
- package/dist/index238.cjs +1 -1
- package/dist/index238.js +2 -79
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +12 -2
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +4 -4
- package/dist/index240.cjs +1 -1
- package/dist/index240.js +19 -11
- package/dist/index241.cjs +2 -1
- package/dist/index241.js +65 -18
- package/dist/index242.cjs +1 -2
- package/dist/index242.js +14 -66
- package/dist/index243.cjs +1 -1
- package/dist/index243.js +68 -14
- package/dist/index244.cjs +1 -1
- package/dist/index244.js +657 -68
- package/dist/index245.cjs +1 -1
- package/dist/index245.js +196 -647
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +172 -201
- package/dist/index247.cjs +1 -1
- package/dist/index247.js +4 -177
- package/dist/index248.cjs +1 -1
- package/dist/index248.js +2 -5
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +3 -3
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +9 -9
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +2 -2
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +1 -1
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +11 -11
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +3 -3
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +3 -3
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +3 -3
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +3 -3
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +2 -2
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +1 -1
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +4 -4
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +4 -4
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +3 -3
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +8 -8
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +3 -3
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +51 -74
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +1 -1
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +1 -1
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +2 -2
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +2 -2
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +3 -3
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +7 -7
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +23 -8
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +7 -23
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +21 -7
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +8 -21
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +31 -8
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +7 -31
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +16 -7
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +73 -16
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +34 -72
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +15 -34
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +65 -16
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +11 -65
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +14 -11
- package/dist/index78.cjs +3 -1
- package/dist/index78.js +95 -14
- package/dist/index79.cjs +1 -3
- package/dist/index79.js +24 -95
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +33 -24
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +41 -30
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +6 -44
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +151 -6
- package/dist/index84.cjs +20 -1
- package/dist/index84.js +325 -150
- package/dist/index85.cjs +3 -20
- package/dist/index85.js +383 -258
- package/dist/index86.cjs +1 -3
- package/dist/index86.js +64 -451
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +36 -63
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +14 -36
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +2 -16
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +17 -2
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +10 -16
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +125 -10
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +5 -125
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +21 -5
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +45 -21
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +37 -44
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +6 -38
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +88 -6
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +13 -87
- package/package.json +2 -2
- package/dist/index249.cjs +0 -1
- package/dist/index249.js +0 -4
package/dist/index81.js
CHANGED
|
@@ -1,36 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
args: o,
|
|
10
|
-
functionName: r
|
|
11
|
-
});
|
|
1
|
+
import { parseAccount as p } from "./index32.js";
|
|
2
|
+
import { decodeFunctionResult as h } from "./index38.js";
|
|
3
|
+
import { encodeFunctionData as x } from "./index40.js";
|
|
4
|
+
import { getContractError as b } from "./index54.js";
|
|
5
|
+
import { getAction as g } from "./index55.js";
|
|
6
|
+
import { call as A } from "./index29.js";
|
|
7
|
+
async function R(s, m) {
|
|
8
|
+
const { abi: o, address: n, args: a, dataSuffix: e, functionName: c, ...r } = m, t = r.account ? p(r.account) : s.account, u = x({ abi: o, args: a, functionName: c });
|
|
12
9
|
try {
|
|
13
|
-
const { data:
|
|
14
|
-
|
|
15
|
-
data:
|
|
16
|
-
to:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
const { data: i } = await g(s, A, "call")({
|
|
11
|
+
batch: !1,
|
|
12
|
+
data: `${u}${e ? e.replace("0x", "") : ""}`,
|
|
13
|
+
to: n,
|
|
14
|
+
...r,
|
|
15
|
+
account: t
|
|
16
|
+
}), l = h({
|
|
17
|
+
abi: o,
|
|
18
|
+
args: a,
|
|
19
|
+
functionName: c,
|
|
20
|
+
data: i || "0x"
|
|
21
|
+
}), f = o.filter((d) => "name" in d && d.name === m.functionName);
|
|
22
|
+
return {
|
|
23
|
+
result: l,
|
|
24
|
+
request: {
|
|
25
|
+
abi: f,
|
|
26
|
+
address: n,
|
|
27
|
+
args: a,
|
|
28
|
+
dataSuffix: e,
|
|
29
|
+
functionName: c,
|
|
30
|
+
...r,
|
|
31
|
+
account: t
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
} catch (i) {
|
|
35
|
+
throw b(i, {
|
|
36
|
+
abi: o,
|
|
37
|
+
address: n,
|
|
38
|
+
args: a,
|
|
39
|
+
docsPath: "/docs/contract/simulateContract",
|
|
40
|
+
functionName: c,
|
|
41
|
+
sender: t == null ? void 0 : t.address
|
|
31
42
|
});
|
|
32
43
|
}
|
|
33
44
|
}
|
|
34
45
|
export {
|
|
35
|
-
|
|
46
|
+
R as simulateContract
|
|
36
47
|
};
|
package/dist/index82.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function e(n,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}exports.uninstallFilter=e;
|
package/dist/index82.js
CHANGED
|
@@ -1,47 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { call as A } from "./index29.js";
|
|
7
|
-
async function R(s, m) {
|
|
8
|
-
const { abi: o, address: n, args: a, dataSuffix: e, functionName: c, ...r } = m, t = r.account ? p(r.account) : s.account, u = x({ abi: o, args: a, functionName: c });
|
|
9
|
-
try {
|
|
10
|
-
const { data: i } = await g(s, A, "call")({
|
|
11
|
-
batch: !1,
|
|
12
|
-
data: `${u}${e ? e.replace("0x", "") : ""}`,
|
|
13
|
-
to: n,
|
|
14
|
-
...r,
|
|
15
|
-
account: t
|
|
16
|
-
}), l = h({
|
|
17
|
-
abi: o,
|
|
18
|
-
args: a,
|
|
19
|
-
functionName: c,
|
|
20
|
-
data: i || "0x"
|
|
21
|
-
}), f = o.filter((d) => "name" in d && d.name === m.functionName);
|
|
22
|
-
return {
|
|
23
|
-
result: l,
|
|
24
|
-
request: {
|
|
25
|
-
abi: f,
|
|
26
|
-
address: n,
|
|
27
|
-
args: a,
|
|
28
|
-
dataSuffix: e,
|
|
29
|
-
functionName: c,
|
|
30
|
-
...r,
|
|
31
|
-
account: t
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
} catch (i) {
|
|
35
|
-
throw b(i, {
|
|
36
|
-
abi: o,
|
|
37
|
-
address: n,
|
|
38
|
-
args: a,
|
|
39
|
-
docsPath: "/docs/contract/simulateContract",
|
|
40
|
-
functionName: c,
|
|
41
|
-
sender: t == null ? void 0 : t.address
|
|
42
|
-
});
|
|
43
|
-
}
|
|
1
|
+
async function e(n, { filter: t }) {
|
|
2
|
+
return t.request({
|
|
3
|
+
method: "eth_uninstallFilter",
|
|
4
|
+
params: [t.id]
|
|
5
|
+
});
|
|
44
6
|
}
|
|
45
7
|
export {
|
|
46
|
-
|
|
8
|
+
e as uninstallFilter
|
|
47
9
|
};
|
package/dist/index83.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 B=require("./index84.cjs"),M=require("./index85.cjs"),P=require("./index86.cjs"),_=require("./index51.cjs"),I=require("./index76.cjs"),b=require("./index55.cjs"),A=require("./index87.cjs"),O=require("./index88.cjs"),S=require("./index89.cjs"),$=require("./index50.cjs"),j=require("./index68.cjs"),z=require("./index71.cjs"),R=require("./index74.cjs"),U=require("./index82.cjs");function G(t,D){const{abi:v,address:l,args:u,batch:C=!0,eventName:c,fromBlock:g,onError:f,onLogs:k,poll:L,pollingInterval:h=t.pollingInterval,strict:d}=D;return(typeof L<"u"?L:typeof g=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].config.type==="webSocket"||t.transport.transports[0].config.type==="ipc")))?(()=>{const p=d??!1,q=S.stringify(["watchContractEvent",l,u,C,t.uid,c,h,p,g]);return A.observe(q,{onLogs:k,onError:f},o=>{let s;g!==void 0&&(s=g-1n);let n,a=!1;const w=O.poll(async()=>{var y;if(!a){try{n=await b.getAction(t,$.createContractEventFilter,"createContractEventFilter")({abi:v,address:l,args:u,eventName:c,strict:p,fromBlock:g})}catch{}a=!0;return}try{let e;if(n)e=await b.getAction(t,R.getFilterChanges,"getFilterChanges")({filter:n});else{const r=await b.getAction(t,j.getBlockNumber,"getBlockNumber")({});s&&s<r?e=await b.getAction(t,z.getContractEvents,"getContractEvents")({abi:v,address:l,args:u,eventName:c,fromBlock:s+1n,toBlock:r,strict:p}):e=[],s=r}if(e.length===0)return;if(C)o.onLogs(e);else for(const r of e)o.onLogs([r])}catch(e){n&&e instanceof M.InvalidInputRpcError&&(a=!1),(y=o.onError)==null||y.call(o,e)}},{emitOnBegin:!0,interval:h});return async()=>{n&&await b.getAction(t,U.uninstallFilter,"uninstallFilter")({filter:n}),w()}})})():(()=>{const p=d??!1,q=S.stringify(["watchContractEvent",l,u,C,t.uid,c,h,p]);let o=!0,s=()=>o=!1;return A.observe(q,{onLogs:k,onError:f},n=>((async()=>{try{const a=(()=>{if(t.transport.type==="fallback"){const e=t.transport.transports.find(r=>r.config.type==="webSocket"||r.config.type==="ipc");return e?e.value:t.transport}return t.transport})(),w=c?_.encodeEventTopics({abi:v,eventName:c,args:u}):[],{unsubscribe:y}=await a.subscribe({params:["logs",{address:l,topics:w}],onData(e){var N;if(!o)return;const r=e.result;try{const{eventName:i,args:E}=P.decodeEventLog({abi:v,data:r.data,topics:r.topics,strict:d}),m=I.formatLog(r,{args:E,eventName:i});n.onLogs([m])}catch(i){let E,m;if(i instanceof B.DecodeLogDataMismatch||i instanceof B.DecodeLogTopicsMismatch){if(d)return;E=i.abiItem.name,m=(N=i.abiItem.inputs)==null?void 0:N.some(F=>!("name"in F&&F.name))}const T=I.formatLog(r,{args:m?[]:{},eventName:E});n.onLogs([T])}},onError(e){var r;(r=n.onError)==null||r.call(n,e)}});s=y,o||s()}catch(a){f==null||f(a)}})(),()=>s()))})()}exports.watchContractEvent=G;
|
package/dist/index83.js
CHANGED
|
@@ -1,9 +1,154 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { DecodeLogDataMismatch as P, DecodeLogTopicsMismatch as T } from "./index84.js";
|
|
2
|
+
import { InvalidInputRpcError as z } from "./index85.js";
|
|
3
|
+
import { decodeEventLog as A } from "./index86.js";
|
|
4
|
+
import { encodeEventTopics as O } from "./index51.js";
|
|
5
|
+
import { formatLog as F } from "./index76.js";
|
|
6
|
+
import { getAction as g } from "./index55.js";
|
|
7
|
+
import { observe as D } from "./index87.js";
|
|
8
|
+
import { poll as R } from "./index88.js";
|
|
9
|
+
import { stringify as S } from "./index89.js";
|
|
10
|
+
import { createContractEventFilter as U } from "./index50.js";
|
|
11
|
+
import { getBlockNumber as j } from "./index68.js";
|
|
12
|
+
import { getContractEvents as q } from "./index71.js";
|
|
13
|
+
import { getFilterChanges as x } from "./index74.js";
|
|
14
|
+
import { uninstallFilter as G } from "./index82.js";
|
|
15
|
+
function ct(t, _) {
|
|
16
|
+
const { abi: b, address: f, args: p, batch: h = !0, eventName: c, fromBlock: l, onError: u, onLogs: N, poll: L, pollingInterval: w = t.pollingInterval, strict: v } = _;
|
|
17
|
+
return (typeof L < "u" ? L : typeof l == "bigint" ? !0 : !(t.transport.type === "webSocket" || t.transport.type === "ipc" || t.transport.type === "fallback" && (t.transport.transports[0].config.type === "webSocket" || t.transport.transports[0].config.type === "ipc"))) ? (() => {
|
|
18
|
+
const m = v ?? !1, C = S([
|
|
19
|
+
"watchContractEvent",
|
|
20
|
+
f,
|
|
21
|
+
p,
|
|
22
|
+
h,
|
|
23
|
+
t.uid,
|
|
24
|
+
c,
|
|
25
|
+
w,
|
|
26
|
+
m,
|
|
27
|
+
l
|
|
28
|
+
]);
|
|
29
|
+
return D(C, { onLogs: N, onError: u }, (n) => {
|
|
30
|
+
let a;
|
|
31
|
+
l !== void 0 && (a = l - 1n);
|
|
32
|
+
let e, s = !1;
|
|
33
|
+
const k = R(async () => {
|
|
34
|
+
var d;
|
|
35
|
+
if (!s) {
|
|
36
|
+
try {
|
|
37
|
+
e = await g(t, U, "createContractEventFilter")({
|
|
38
|
+
abi: b,
|
|
39
|
+
address: f,
|
|
40
|
+
args: p,
|
|
41
|
+
eventName: c,
|
|
42
|
+
strict: m,
|
|
43
|
+
fromBlock: l
|
|
44
|
+
});
|
|
45
|
+
} catch {
|
|
46
|
+
}
|
|
47
|
+
s = !0;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
let r;
|
|
52
|
+
if (e)
|
|
53
|
+
r = await g(t, x, "getFilterChanges")({ filter: e });
|
|
54
|
+
else {
|
|
55
|
+
const o = await g(t, j, "getBlockNumber")({});
|
|
56
|
+
a && a < o ? r = await g(t, q, "getContractEvents")({
|
|
57
|
+
abi: b,
|
|
58
|
+
address: f,
|
|
59
|
+
args: p,
|
|
60
|
+
eventName: c,
|
|
61
|
+
fromBlock: a + 1n,
|
|
62
|
+
toBlock: o,
|
|
63
|
+
strict: m
|
|
64
|
+
}) : r = [], a = o;
|
|
65
|
+
}
|
|
66
|
+
if (r.length === 0)
|
|
67
|
+
return;
|
|
68
|
+
if (h)
|
|
69
|
+
n.onLogs(r);
|
|
70
|
+
else
|
|
71
|
+
for (const o of r)
|
|
72
|
+
n.onLogs([o]);
|
|
73
|
+
} catch (r) {
|
|
74
|
+
e && r instanceof z && (s = !1), (d = n.onError) == null || d.call(n, r);
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
emitOnBegin: !0,
|
|
78
|
+
interval: w
|
|
79
|
+
});
|
|
80
|
+
return async () => {
|
|
81
|
+
e && await g(t, G, "uninstallFilter")({ filter: e }), k();
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
})() : (() => {
|
|
85
|
+
const m = v ?? !1, C = S([
|
|
86
|
+
"watchContractEvent",
|
|
87
|
+
f,
|
|
88
|
+
p,
|
|
89
|
+
h,
|
|
90
|
+
t.uid,
|
|
91
|
+
c,
|
|
92
|
+
w,
|
|
93
|
+
m
|
|
94
|
+
]);
|
|
95
|
+
let n = !0, a = () => n = !1;
|
|
96
|
+
return D(C, { onLogs: N, onError: u }, (e) => ((async () => {
|
|
97
|
+
try {
|
|
98
|
+
const s = (() => {
|
|
99
|
+
if (t.transport.type === "fallback") {
|
|
100
|
+
const r = t.transport.transports.find((o) => o.config.type === "webSocket" || o.config.type === "ipc");
|
|
101
|
+
return r ? r.value : t.transport;
|
|
102
|
+
}
|
|
103
|
+
return t.transport;
|
|
104
|
+
})(), k = c ? O({
|
|
105
|
+
abi: b,
|
|
106
|
+
eventName: c,
|
|
107
|
+
args: p
|
|
108
|
+
}) : [], { unsubscribe: d } = await s.subscribe({
|
|
109
|
+
params: ["logs", { address: f, topics: k }],
|
|
110
|
+
onData(r) {
|
|
111
|
+
var I;
|
|
112
|
+
if (!n)
|
|
113
|
+
return;
|
|
114
|
+
const o = r.result;
|
|
115
|
+
try {
|
|
116
|
+
const { eventName: i, args: y } = A({
|
|
117
|
+
abi: b,
|
|
118
|
+
data: o.data,
|
|
119
|
+
topics: o.topics,
|
|
120
|
+
strict: v
|
|
121
|
+
}), E = F(o, {
|
|
122
|
+
args: y,
|
|
123
|
+
eventName: i
|
|
124
|
+
});
|
|
125
|
+
e.onLogs([E]);
|
|
126
|
+
} catch (i) {
|
|
127
|
+
let y, E;
|
|
128
|
+
if (i instanceof P || i instanceof T) {
|
|
129
|
+
if (v)
|
|
130
|
+
return;
|
|
131
|
+
y = i.abiItem.name, E = (I = i.abiItem.inputs) == null ? void 0 : I.some((B) => !("name" in B && B.name));
|
|
132
|
+
}
|
|
133
|
+
const M = F(o, {
|
|
134
|
+
args: E ? [] : {},
|
|
135
|
+
eventName: y
|
|
136
|
+
});
|
|
137
|
+
e.onLogs([M]);
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
onError(r) {
|
|
141
|
+
var o;
|
|
142
|
+
(o = e.onError) == null || o.call(e, r);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
a = d, n || a();
|
|
146
|
+
} catch (s) {
|
|
147
|
+
u == null || u(s);
|
|
148
|
+
}
|
|
149
|
+
})(), () => a()));
|
|
150
|
+
})();
|
|
6
151
|
}
|
|
7
152
|
export {
|
|
8
|
-
|
|
153
|
+
ct as watchContractEvent
|
|
9
154
|
};
|
package/dist/index84.cjs
CHANGED
|
@@ -1 +1,20 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index139.cjs"),s=require("./index140.cjs"),t=require("./index35.cjs");class u extends t.BaseError{constructor({docsPath:r}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
|
|
2
|
+
`),{docsPath:r,name:"AbiConstructorNotFoundError"})}}class c extends t.BaseError{constructor({docsPath:r}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
|
|
3
|
+
`),{docsPath:r,name:"AbiConstructorParamsNotFoundError"})}}class d extends t.BaseError{constructor({data:r,params:e,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(`
|
|
4
|
+
`),{metaMessages:[`Params: (${i.formatAbiParams(e,{includeName:!0})})`,`Data: ${r} (${n} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r,this.params=e,this.size=n}}class E extends t.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class b extends t.BaseError{constructor({expectedLength:r,givenLength:e,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${r}`,`Given length: ${e}`].join(`
|
|
5
|
+
`),{name:"AbiEncodingArrayLengthMismatchError"})}}class m extends t.BaseError{constructor({expectedSize:r,value:e}){super(`Size of bytes "${e}" (bytes${s.size(e)}) does not match expected size (bytes${r}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class l extends t.BaseError{constructor({expectedLength:r,givenLength:e}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${r}`,`Given length (values): ${e}`].join(`
|
|
6
|
+
`),{name:"AbiEncodingLengthMismatchError"})}}class p extends t.BaseError{constructor(r,{docsPath:e}){super([`Arguments (\`args\`) were provided to "${r}", but "${r}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
|
|
7
|
+
`),{docsPath:e,name:"AbiErrorInputsNotFoundError"})}}class h extends t.BaseError{constructor(r,{docsPath:e}={}){super([`Error ${r?`"${r}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
|
|
8
|
+
`),{docsPath:e,name:"AbiErrorNotFoundError"})}}class g extends t.BaseError{constructor(r,{docsPath:e}){super([`Encoded error signature "${r}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${r}.`].join(`
|
|
9
|
+
`),{docsPath:e,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=r}}class A extends t.BaseError{constructor({docsPath:r}){super("Cannot extract event signature from empty topics.",{docsPath:r,name:"AbiEventSignatureEmptyTopicsError"})}}class y extends t.BaseError{constructor(r,{docsPath:e}){super([`Encoded event signature "${r}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${r}.`].join(`
|
|
10
|
+
`),{docsPath:e,name:"AbiEventSignatureNotFoundError"})}}class v extends t.BaseError{constructor(r,{docsPath:e}={}){super([`Event ${r?`"${r}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
|
|
11
|
+
`),{docsPath:e,name:"AbiEventNotFoundError"})}}class B extends t.BaseError{constructor(r,{docsPath:e}={}){super([`Function ${r?`"${r}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
12
|
+
`),{docsPath:e,name:"AbiFunctionNotFoundError"})}}class I extends t.BaseError{constructor(r,{docsPath:e}){super([`Function "${r}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
13
|
+
`),{docsPath:e,name:"AbiFunctionOutputsNotFoundError"})}}class f extends t.BaseError{constructor(r,{docsPath:e}){super([`Encoded function signature "${r}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${r}.`].join(`
|
|
14
|
+
`),{docsPath:e,name:"AbiFunctionSignatureNotFoundError"})}}class x extends t.BaseError{constructor(r,e){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${r.type}\` in \`${i.formatAbiItem(r.abiItem)}\`, and`,`\`${e.type}\` in \`${i.formatAbiItem(e.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class $ extends t.BaseError{constructor({expectedSize:r,givenSize:e}){super(`Expected bytes${r}, got bytes${e}.`,{name:"BytesSizeMismatchError"})}}class F extends t.BaseError{constructor({abiItem:r,data:e,params:n,size:a}){super([`Data size of ${a} bytes is too small for non-indexed event parameters.`].join(`
|
|
15
|
+
`),{metaMessages:[`Params: (${i.formatAbiParams(n,{includeName:!0})})`,`Data: ${e} (${a} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=r,this.data=e,this.params=n,this.size=a}}class M extends t.BaseError{constructor({abiItem:r,param:e}){super([`Expected a topic for indexed event parameter${e.name?` "${e.name}"`:""} on event "${i.formatAbiItem(r,{includeName:!0})}".`].join(`
|
|
16
|
+
`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=r}}class D extends t.BaseError{constructor(r,{docsPath:e}){super([`Type "${r}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
|
|
17
|
+
`),{docsPath:e,name:"InvalidAbiEncodingType"})}}class j extends t.BaseError{constructor(r,{docsPath:e}){super([`Type "${r}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
|
|
18
|
+
`),{docsPath:e,name:"InvalidAbiDecodingType"})}}class N extends t.BaseError{constructor(r){super([`Value "${r}" is not a valid array.`].join(`
|
|
19
|
+
`),{name:"InvalidArrayError"})}}class S extends t.BaseError{constructor(r){super([`"${r}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
|
|
20
|
+
`),{name:"InvalidDefinitionTypeError"})}}exports.AbiConstructorNotFoundError=u;exports.AbiConstructorParamsNotFoundError=c;exports.AbiDecodingDataSizeTooSmallError=d;exports.AbiDecodingZeroDataError=E;exports.AbiEncodingArrayLengthMismatchError=b;exports.AbiEncodingBytesSizeMismatchError=m;exports.AbiEncodingLengthMismatchError=l;exports.AbiErrorInputsNotFoundError=p;exports.AbiErrorNotFoundError=h;exports.AbiErrorSignatureNotFoundError=g;exports.AbiEventNotFoundError=v;exports.AbiEventSignatureEmptyTopicsError=A;exports.AbiEventSignatureNotFoundError=y;exports.AbiFunctionNotFoundError=B;exports.AbiFunctionOutputsNotFoundError=I;exports.AbiFunctionSignatureNotFoundError=f;exports.AbiItemAmbiguityError=x;exports.BytesSizeMismatchError=$;exports.DecodeLogDataMismatch=F;exports.DecodeLogTopicsMismatch=M;exports.InvalidAbiDecodingTypeError=j;exports.InvalidAbiEncodingTypeError=D;exports.InvalidArrayError=N;exports.InvalidDefinitionTypeError=S;
|