@gardenfi/utils 2.1.3 → 2.2.0
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/index102.cjs +1 -1
- package/dist/index102.js +12 -8
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +1 -1
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +75 -34
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +45 -43
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +1 -1
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +1 -1
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +1 -1
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +1 -1
- package/dist/index125.cjs +1 -1
- package/dist/index125.js +1 -1
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +36 -34
- package/dist/index189.cjs +1 -1
- package/dist/index189.js +2 -2
- package/dist/index191.cjs +1 -1
- package/dist/index191.js +19 -15
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +27 -25
- package/dist/index203.cjs +1 -1
- package/dist/index203.js +16 -16
- package/dist/index222.cjs +1 -1
- package/dist/index222.js +2 -2
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +43 -43
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +3 -113
- package/dist/index228.cjs +1 -1
- package/dist/index228.js +14 -14
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +1 -1
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +1 -1
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +31 -2
- package/dist/index234.cjs +1 -1
- package/dist/index234.js +2 -14
- package/dist/index235.cjs +1 -1
- package/dist/index235.js +13 -12
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +10 -45
- package/dist/index237.cjs +1 -1
- package/dist/index237.js +46 -10
- package/dist/index238.cjs +1 -1
- package/dist/index238.js +11 -7
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +7 -9
- package/dist/index240.cjs +1 -1
- package/dist/index240.js +8 -12
- package/dist/index241.cjs +1 -1
- package/dist/index241.js +13 -14
- package/dist/index242.cjs +1 -1
- package/dist/index242.js +14 -9
- package/dist/index243.cjs +1 -1
- package/dist/index243.js +7 -28
- package/dist/index245.cjs +1 -1
- package/dist/index245.js +3 -3
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +3 -3
- package/dist/index247.cjs +1 -2
- package/dist/index247.js +13 -24
- package/dist/index248.cjs +1 -1
- package/dist/index248.js +15 -13
- package/dist/index249.cjs +2 -1
- package/dist/index249.js +23 -14
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +2 -2
- package/dist/index266.cjs +1 -1
- package/dist/index266.js +1 -1
- package/dist/index275.cjs +1 -1
- package/dist/index275.js +7 -6
- package/dist/index277.cjs +1 -1
- package/dist/index277.js +103 -16
- package/dist/index278.cjs +1 -1
- package/dist/index278.js +5 -222
- package/dist/index279.cjs +1 -1
- package/dist/index279.js +224 -6
- package/dist/index280.cjs +1 -1
- package/dist/index280.js +7 -7
- package/dist/index281.cjs +1 -1
- package/dist/index281.js +7 -27
- package/dist/index282.cjs +1 -1
- package/dist/index282.js +26 -34
- package/dist/index283.cjs +1 -1
- package/dist/index283.js +13 -12
- package/dist/index284.cjs +1 -1
- package/dist/index284.js +124 -48
- package/dist/index285.cjs +1 -1
- package/dist/index285.js +3 -67
- package/dist/index286.cjs +1 -1
- package/dist/index286.js +140 -3
- package/dist/index287.cjs +1 -1
- package/dist/index287.js +143 -128
- package/dist/index288.cjs +1 -1
- package/dist/index288.js +9 -155
- package/dist/index289.cjs +1 -1
- package/dist/index289.js +111 -7
- package/dist/index290.cjs +2 -1
- package/dist/index290.js +116 -95
- package/dist/index291.cjs +1 -2
- package/dist/index291.js +8 -131
- package/dist/index292.cjs +1 -1
- package/dist/index292.js +19 -11
- package/dist/index293.cjs +1 -1
- package/dist/index293.js +139 -19
- package/dist/index294.cjs +1 -1
- package/dist/index294.js +42 -28
- package/dist/index295.cjs +1 -1
- package/dist/index295.js +72 -32
- package/dist/index296.cjs +1 -1
- package/dist/index296.js +2 -69
- package/dist/index297.cjs +1 -1
- package/dist/index297.js +69 -2
- package/dist/index298.cjs +1 -1
- package/dist/index298.js +699 -41
- package/dist/index299.cjs +1 -1
- package/dist/index299.js +179 -620
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +1 -1
- package/dist/index300.cjs +2 -1
- package/dist/index300.js +63 -203
- package/dist/index301.cjs +1 -1
- package/dist/index301.js +4 -172
- package/dist/index302.cjs +1 -2
- package/dist/index302.js +39 -65
- package/dist/index303.cjs +1 -1
- package/dist/index303.js +7 -4
- package/dist/index304.cjs +1 -1
- package/dist/index304.js +60 -38
- package/dist/index305.cjs +1 -1
- package/dist/index305.js +77 -7
- package/dist/index306.cjs +1 -1
- package/dist/index306.js +4 -63
- package/dist/index307.cjs +1 -1
- package/dist/index307.js +181 -64
- package/dist/index308.cjs +1 -1
- package/dist/index308.js +64 -4
- package/dist/index309.cjs +1 -1
- package/dist/index309.js +44 -194
- package/dist/index310.cjs +1 -1
- package/dist/index310.js +4 -18
- package/dist/index311.cjs +1 -1
- package/dist/index311.js +5 -64
- package/dist/index312.cjs +1 -1
- package/dist/index312.js +2 -45
- package/dist/index313.cjs +1 -1
- package/dist/index313.js +21 -4
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +41 -41
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +1 -1
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +29 -24
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +40 -21
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +24 -24
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +111 -107
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +11 -11
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +1 -1
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +1 -1
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +1 -1
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +26 -26
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +3 -3
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +1 -1
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +8 -8
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +1 -1
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +8 -3
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +53 -51
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +55 -54
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +53 -57
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +44 -42
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +41 -41
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +48 -47
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +28 -28
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +26 -26
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +1 -1
- package/dist/src/lib/utils.d.ts +2 -1
- package/package.json +1 -1
- package/dist/index314.cjs +0 -1
- package/dist/index314.js +0 -107
- package/dist/index315.cjs +0 -1
- package/dist/index315.js +0 -7
- package/dist/index316.cjs +0 -1
- package/dist/index316.js +0 -4
- package/dist/index317.cjs +0 -1
- package/dist/index317.js +0 -24
package/dist/index35.js
CHANGED
|
@@ -12,35 +12,35 @@ import { getBlockNumber as j } from "./index69.js";
|
|
|
12
12
|
import { getContractEvents as q } from "./index32.js";
|
|
13
13
|
import { getFilterChanges as x } from "./index75.js";
|
|
14
14
|
import { uninstallFilter as G } from "./index87.js";
|
|
15
|
-
function ct(
|
|
16
|
-
const { abi: b, address: f, args:
|
|
17
|
-
return (typeof L < "u" ? L : typeof
|
|
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
18
|
const m = v ?? !1, C = S([
|
|
19
19
|
"watchContractEvent",
|
|
20
20
|
f,
|
|
21
|
-
|
|
21
|
+
p,
|
|
22
22
|
h,
|
|
23
|
-
|
|
23
|
+
t.uid,
|
|
24
24
|
c,
|
|
25
25
|
w,
|
|
26
26
|
m,
|
|
27
|
-
|
|
27
|
+
l
|
|
28
28
|
]);
|
|
29
29
|
return D(C, { onLogs: N, onError: u }, (n) => {
|
|
30
30
|
let a;
|
|
31
|
-
|
|
31
|
+
l !== void 0 && (a = l - 1n);
|
|
32
32
|
let e, s = !1;
|
|
33
33
|
const k = R(async () => {
|
|
34
34
|
var d;
|
|
35
35
|
if (!s) {
|
|
36
36
|
try {
|
|
37
|
-
e = await g(
|
|
37
|
+
e = await g(t, U, "createContractEventFilter")({
|
|
38
38
|
abi: b,
|
|
39
39
|
address: f,
|
|
40
|
-
args:
|
|
40
|
+
args: p,
|
|
41
41
|
eventName: c,
|
|
42
42
|
strict: m,
|
|
43
|
-
fromBlock:
|
|
43
|
+
fromBlock: l
|
|
44
44
|
});
|
|
45
45
|
} catch {
|
|
46
46
|
}
|
|
@@ -48,46 +48,46 @@ function ct(r, _) {
|
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
try {
|
|
51
|
-
let
|
|
51
|
+
let r;
|
|
52
52
|
if (e)
|
|
53
|
-
|
|
53
|
+
r = await g(t, x, "getFilterChanges")({ filter: e });
|
|
54
54
|
else {
|
|
55
|
-
const o = await g(
|
|
56
|
-
a && a < o ?
|
|
55
|
+
const o = await g(t, j, "getBlockNumber")({});
|
|
56
|
+
a && a < o ? r = await g(t, q, "getContractEvents")({
|
|
57
57
|
abi: b,
|
|
58
58
|
address: f,
|
|
59
|
-
args:
|
|
59
|
+
args: p,
|
|
60
60
|
eventName: c,
|
|
61
61
|
fromBlock: a + 1n,
|
|
62
62
|
toBlock: o,
|
|
63
63
|
strict: m
|
|
64
|
-
}) :
|
|
64
|
+
}) : r = [], a = o;
|
|
65
65
|
}
|
|
66
|
-
if (
|
|
66
|
+
if (r.length === 0)
|
|
67
67
|
return;
|
|
68
68
|
if (h)
|
|
69
|
-
n.onLogs(
|
|
69
|
+
n.onLogs(r);
|
|
70
70
|
else
|
|
71
|
-
for (const o of
|
|
71
|
+
for (const o of r)
|
|
72
72
|
n.onLogs([o]);
|
|
73
|
-
} catch (
|
|
74
|
-
e &&
|
|
73
|
+
} catch (r) {
|
|
74
|
+
e && r instanceof z && (s = !1), (d = n.onError) == null || d.call(n, r);
|
|
75
75
|
}
|
|
76
76
|
}, {
|
|
77
77
|
emitOnBegin: !0,
|
|
78
78
|
interval: w
|
|
79
79
|
});
|
|
80
80
|
return async () => {
|
|
81
|
-
e && await g(
|
|
81
|
+
e && await g(t, G, "uninstallFilter")({ filter: e }), k();
|
|
82
82
|
};
|
|
83
83
|
});
|
|
84
84
|
})() : (() => {
|
|
85
85
|
const m = v ?? !1, C = S([
|
|
86
86
|
"watchContractEvent",
|
|
87
87
|
f,
|
|
88
|
-
|
|
88
|
+
p,
|
|
89
89
|
h,
|
|
90
|
-
|
|
90
|
+
t.uid,
|
|
91
91
|
c,
|
|
92
92
|
w,
|
|
93
93
|
m
|
|
@@ -96,50 +96,50 @@ function ct(r, _) {
|
|
|
96
96
|
return D(C, { onLogs: N, onError: u }, (e) => ((async () => {
|
|
97
97
|
try {
|
|
98
98
|
const s = (() => {
|
|
99
|
-
if (
|
|
100
|
-
const
|
|
101
|
-
return
|
|
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
102
|
}
|
|
103
|
-
return
|
|
103
|
+
return t.transport;
|
|
104
104
|
})(), k = c ? O({
|
|
105
105
|
abi: b,
|
|
106
106
|
eventName: c,
|
|
107
|
-
args:
|
|
107
|
+
args: p
|
|
108
108
|
}) : [], { unsubscribe: d } = await s.subscribe({
|
|
109
109
|
params: ["logs", { address: f, topics: k }],
|
|
110
|
-
onData(
|
|
110
|
+
onData(r) {
|
|
111
111
|
var I;
|
|
112
112
|
if (!n)
|
|
113
113
|
return;
|
|
114
|
-
const o =
|
|
114
|
+
const o = r.result;
|
|
115
115
|
try {
|
|
116
|
-
const { eventName: i, args:
|
|
116
|
+
const { eventName: i, args: y } = A({
|
|
117
117
|
abi: b,
|
|
118
118
|
data: o.data,
|
|
119
119
|
topics: o.topics,
|
|
120
120
|
strict: v
|
|
121
|
-
}),
|
|
122
|
-
args:
|
|
121
|
+
}), E = F(o, {
|
|
122
|
+
args: y,
|
|
123
123
|
eventName: i
|
|
124
124
|
});
|
|
125
|
-
e.onLogs([
|
|
125
|
+
e.onLogs([E]);
|
|
126
126
|
} catch (i) {
|
|
127
|
-
let
|
|
127
|
+
let y, E;
|
|
128
128
|
if (i instanceof P || i instanceof T) {
|
|
129
129
|
if (v)
|
|
130
130
|
return;
|
|
131
|
-
|
|
131
|
+
y = i.abiItem.name, E = (I = i.abiItem.inputs) == null ? void 0 : I.some((B) => !("name" in B && B.name));
|
|
132
132
|
}
|
|
133
133
|
const M = F(o, {
|
|
134
|
-
args:
|
|
135
|
-
eventName:
|
|
134
|
+
args: E ? [] : {},
|
|
135
|
+
eventName: y
|
|
136
136
|
});
|
|
137
137
|
e.onLogs([M]);
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
|
-
onError(
|
|
140
|
+
onError(r) {
|
|
141
141
|
var o;
|
|
142
|
-
(o = e.onError) == null || o.call(e,
|
|
142
|
+
(o = e.onError) == null || o.call(e, r);
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
a = d, n || a();
|
package/dist/index36.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index45.cjs"),g=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index45.cjs"),g=require("./index249.cjs"),q=require("./index177.cjs"),C=require("./index221.cjs"),h=require("./index29.cjs"),l=require("./index108.cjs");async function p(n,i){const{abi:c,account:r=n.account,address:o,args:e,dataSuffix:a,functionName:s,...u}=i;if(typeof r>"u")throw new g.AccountNotFoundError({docsPath:"/docs/contract/writeContract"});const t=r?w.parseAccount(r):null,d=q.encodeFunctionData({abi:c,args:e,functionName:s});try{return await h.getAction(n,l.sendTransaction,"sendTransaction")({data:`${d}${a?a.replace("0x",""):""}`,to:o,account:t,...u})}catch(f){throw C.getContractError(f,{abi:c,address:o,args:e,docsPath:"/docs/contract/writeContract",functionName:s,sender:t==null?void 0:t.address})}}exports.writeContract=p;
|
package/dist/index36.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseAccount as u } from "./index45.js";
|
|
2
|
-
import { AccountNotFoundError as p } from "./
|
|
2
|
+
import { AccountNotFoundError as p } from "./index249.js";
|
|
3
3
|
import { encodeFunctionData as w } from "./index177.js";
|
|
4
4
|
import { getContractError as h } from "./index221.js";
|
|
5
5
|
import { getAction as C } from "./index29.js";
|
package/dist/index39.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=new Map,r=new Map;let
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=new Map,r=new Map;let b=0;function w(s,a,C){const o=++b,c=()=>i.get(s)||[],m=()=>{const t=c();i.set(s,t.filter(n=>n.id!==o))},f=()=>{const t=c();if(!t.some(e=>e.id===o))return;const n=r.get(s);if(t.length===1&&n){const e=n();e instanceof Promise&&e.catch(()=>{})}m()},l=c();if(i.set(s,[...l,{id:o,fns:a}]),l&&l.length>0)return f;const u={};for(const t in a)u[t]=(...n)=>{var p,g;const e=c();if(e.length!==0)for(const y of e)(g=(p=y.fns)[t])==null||g.call(p,...n)};const h=C(u);return typeof h=="function"&&r.set(s,h),f}exports.cleanupCache=r;exports.listenersCache=i;exports.observe=w;
|
package/dist/index39.js
CHANGED
|
@@ -1,35 +1,40 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
3
|
-
function y(
|
|
4
|
-
const i = ++
|
|
5
|
-
const n =
|
|
6
|
-
|
|
1
|
+
const f = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
|
|
2
|
+
let k = 0;
|
|
3
|
+
function y(s, l, m) {
|
|
4
|
+
const i = ++k, c = () => f.get(s) || [], w = () => {
|
|
5
|
+
const n = c();
|
|
6
|
+
f.set(s, n.filter((e) => e.id !== i));
|
|
7
7
|
}, r = () => {
|
|
8
|
-
const n =
|
|
9
|
-
if (!n.some((
|
|
8
|
+
const n = c();
|
|
9
|
+
if (!n.some((t) => t.id === i))
|
|
10
10
|
return;
|
|
11
|
-
const
|
|
12
|
-
n.length === 1 &&
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const e = g.get(s);
|
|
12
|
+
if (n.length === 1 && e) {
|
|
13
|
+
const t = e();
|
|
14
|
+
t instanceof Promise && t.catch(() => {
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
w();
|
|
18
|
+
}, o = c();
|
|
19
|
+
if (f.set(s, [
|
|
15
20
|
...o,
|
|
16
|
-
{ id: i, fns:
|
|
21
|
+
{ id: i, fns: l }
|
|
17
22
|
]), o && o.length > 0)
|
|
18
23
|
return r;
|
|
19
24
|
const u = {};
|
|
20
|
-
for (const n in
|
|
21
|
-
u[n] = (...
|
|
22
|
-
var p,
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
for (const
|
|
26
|
-
(
|
|
25
|
+
for (const n in l)
|
|
26
|
+
u[n] = (...e) => {
|
|
27
|
+
var p, h;
|
|
28
|
+
const t = c();
|
|
29
|
+
if (t.length !== 0)
|
|
30
|
+
for (const C of t)
|
|
31
|
+
(h = (p = C.fns)[n]) == null || h.call(p, ...e);
|
|
27
32
|
};
|
|
28
|
-
const a =
|
|
29
|
-
return typeof a == "function" &&
|
|
33
|
+
const a = m(u);
|
|
34
|
+
return typeof a == "function" && g.set(s, a), r;
|
|
30
35
|
}
|
|
31
36
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
g as cleanupCache,
|
|
38
|
+
f as listenersCache,
|
|
34
39
|
y as observe
|
|
35
40
|
};
|
package/dist/index43.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 c=require("./index161.cjs"),I=require("./index162.cjs"),n=require("./index182.cjs"),T=require("./index183.cjs"),o=require("./index107.cjs");async function q(r,l){async function d(e){if(e.endsWith(o.fallbackMagicIdentifier.slice(2))){const p=I.trim(c.sliceHex(e,-64,-32)),b=c.sliceHex(e,0,-64).slice(2).match(/.{1,64}/g),s=await Promise.all(b.map(t=>o.fallbackTransactionErrorMagicIdentifier.slice(2)!==t?r.request({method:"eth_getTransactionReceipt",params:[`0x${t}`]},{dedupe:!0}):void 0)),x=s.some(t=>t===null)?100:s.every(t=>(t==null?void 0:t.status)==="0x1")?200:s.every(t=>(t==null?void 0:t.status)==="0x0")?500:600;return{atomic:!1,chainId:n.hexToNumber(p),receipts:s.filter(Boolean),status:x,version:"2.0.0"}}return r.request({method:"wallet_getCallsStatus",params:[e]})}const{atomic:f=!1,chainId:i,receipts:a,version:m="2.0.0",...u}=await d(l.id),[g,h]=(()=>{const e=u.status;return e>=100&&e<200?["pending",e]:e>=200&&e<300?["success",e]:e>=300&&e<700?["failure",e]:e==="CONFIRMED"?["success",200]:e==="PENDING"?["pending",100]:[void 0,e]})();return{...u,atomic:f,chainId:i?n.hexToNumber(i):void 0,receipts:(a==null?void 0:a.map(e=>({...e,blockNumber:n.hexToBigInt(e.blockNumber),gasUsed:n.hexToBigInt(e.gasUsed),status:T.receiptStatuses[e.status]})))??[],statusCode:h,status:g,version:m}}exports.getCallsStatus=q;
|
package/dist/index43.js
CHANGED
|
@@ -1,29 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { sliceHex as o } from "./index161.js";
|
|
2
|
+
import { trim as x } from "./index162.js";
|
|
3
|
+
import { hexToNumber as u, hexToBigInt as c } from "./index182.js";
|
|
4
|
+
import { receiptStatuses as N } from "./index183.js";
|
|
5
|
+
import { fallbackMagicIdentifier as T, fallbackTransactionErrorMagicIdentifier as C } from "./index107.js";
|
|
6
|
+
async function M(a, f) {
|
|
7
|
+
async function m(t) {
|
|
8
|
+
if (t.endsWith(T.slice(2))) {
|
|
9
|
+
const h = x(o(t, -64, -32)), I = o(t, 0, -64).slice(2).match(/.{1,64}/g), s = await Promise.all(I.map((e) => C.slice(2) !== e ? a.request({
|
|
10
|
+
method: "eth_getTransactionReceipt",
|
|
11
|
+
params: [`0x${e}`]
|
|
12
|
+
}, { dedupe: !0 }) : void 0)), b = s.some((e) => e === null) ? 100 : s.every((e) => (e == null ? void 0 : e.status) === "0x1") ? 200 : s.every((e) => (e == null ? void 0 : e.status) === "0x0") ? 500 : 600;
|
|
13
|
+
return {
|
|
14
|
+
atomic: !1,
|
|
15
|
+
chainId: u(h),
|
|
16
|
+
receipts: s.filter(Boolean),
|
|
17
|
+
status: b,
|
|
18
|
+
version: "2.0.0"
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return a.request({
|
|
22
|
+
method: "wallet_getCallsStatus",
|
|
23
|
+
params: [t]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const { atomic: l = !1, chainId: r, receipts: n, version: d = "2.0.0", ...i } = await m(f.id), [p, g] = (() => {
|
|
27
|
+
const t = i.status;
|
|
28
|
+
return t >= 100 && t < 200 ? ["pending", t] : t >= 200 && t < 300 ? ["success", t] : t >= 300 && t < 700 ? ["failure", t] : t === "CONFIRMED" ? ["success", 200] : t === "PENDING" ? ["pending", 100] : [void 0, t];
|
|
10
29
|
})();
|
|
11
30
|
return {
|
|
12
|
-
...
|
|
13
|
-
atomic:
|
|
31
|
+
...i,
|
|
32
|
+
atomic: l,
|
|
14
33
|
// @ts-expect-error: for backwards compatibility
|
|
15
|
-
chainId:
|
|
16
|
-
receipts: (
|
|
17
|
-
...
|
|
18
|
-
blockNumber:
|
|
19
|
-
gasUsed:
|
|
20
|
-
status:
|
|
34
|
+
chainId: r ? u(r) : void 0,
|
|
35
|
+
receipts: (n == null ? void 0 : n.map((t) => ({
|
|
36
|
+
...t,
|
|
37
|
+
blockNumber: c(t.blockNumber),
|
|
38
|
+
gasUsed: c(t.gasUsed),
|
|
39
|
+
status: N[t.status]
|
|
21
40
|
}))) ?? [],
|
|
22
|
-
statusCode:
|
|
23
|
-
status:
|
|
24
|
-
version:
|
|
41
|
+
statusCode: g,
|
|
42
|
+
status: p,
|
|
43
|
+
version: d
|
|
25
44
|
};
|
|
26
45
|
}
|
|
27
46
|
export {
|
|
28
|
-
|
|
47
|
+
M as getCallsStatus
|
|
29
48
|
};
|
package/dist/index44.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 M=require("./index45.cjs"),j=require("./index46.cjs");function q(n){const{batch:u,chain:t,ccipRead:a,key:r="base",name:d="Base Client",type:b="base"}=n,f=(t==null?void 0:t.blockTime)??12e3,g=Math.min(Math.max(Math.floor(f/2),500),4e3),e=n.pollingInterval??g,h=n.cacheTime??e,v=n.account?M.parseAccount(n.account):void 0,{config:x,request:y,value:T}=n.transport({chain:t,pollingInterval:e}),k={...x,...T},c={account:v,batch:u,cacheTime:h,ccipRead:a,chain:t,key:r,name:d,pollingInterval:e,request:y,transport:k,type:b,uid:j.uid()};function o(i){return m=>{const l=m(i);for(const p in c)delete l[p];const s={...i,...l};return Object.assign(s,{extend:o(s)})}}return Object.assign(c,{extend:o(c)})}exports.createClient=q;
|
package/dist/index44.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { parseAccount as
|
|
2
|
-
import { uid as
|
|
1
|
+
import { parseAccount as I } from "./index45.js";
|
|
2
|
+
import { uid as M } from "./index46.js";
|
|
3
3
|
function O(n) {
|
|
4
|
-
const { batch:
|
|
5
|
-
chain:
|
|
6
|
-
pollingInterval:
|
|
7
|
-
}), v = { ...
|
|
8
|
-
account:
|
|
9
|
-
batch:
|
|
10
|
-
cacheTime:
|
|
11
|
-
ccipRead:
|
|
12
|
-
chain:
|
|
13
|
-
key:
|
|
14
|
-
name:
|
|
15
|
-
pollingInterval:
|
|
16
|
-
request:
|
|
4
|
+
const { batch: u, chain: t, ccipRead: a, key: d = "base", name: r = "Base Client", type: f = "base" } = n, b = (t == null ? void 0 : t.blockTime) ?? 12e3, m = Math.min(Math.max(Math.floor(b / 2), 500), 4e3), e = n.pollingInterval ?? m, g = n.cacheTime ?? e, x = n.account ? I(n.account) : void 0, { config: h, request: p, value: k } = n.transport({
|
|
5
|
+
chain: t,
|
|
6
|
+
pollingInterval: e
|
|
7
|
+
}), v = { ...h, ...k }, c = {
|
|
8
|
+
account: x,
|
|
9
|
+
batch: u,
|
|
10
|
+
cacheTime: g,
|
|
11
|
+
ccipRead: a,
|
|
12
|
+
chain: t,
|
|
13
|
+
key: d,
|
|
14
|
+
name: r,
|
|
15
|
+
pollingInterval: e,
|
|
16
|
+
request: p,
|
|
17
17
|
transport: v,
|
|
18
|
-
type:
|
|
19
|
-
uid:
|
|
18
|
+
type: f,
|
|
19
|
+
uid: M()
|
|
20
20
|
};
|
|
21
21
|
function o(i) {
|
|
22
|
-
return (
|
|
23
|
-
const
|
|
24
|
-
for (const
|
|
25
|
-
delete
|
|
26
|
-
const
|
|
27
|
-
return Object.assign(
|
|
22
|
+
return (T) => {
|
|
23
|
+
const l = T(i);
|
|
24
|
+
for (const y in c)
|
|
25
|
+
delete l[y];
|
|
26
|
+
const s = { ...i, ...l };
|
|
27
|
+
return Object.assign(s, { extend: o(s) });
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
return Object.assign(
|
|
30
|
+
return Object.assign(c, { extend: o(c) });
|
|
31
31
|
}
|
|
32
32
|
export {
|
|
33
33
|
O as createClient
|
package/dist/index58.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 X=require("./index233.cjs"),Y=require("./index45.cjs"),z=require("./index21.cjs"),Z=require("./index234.cjs"),j=require("./index118.cjs"),A=require("./index38.cjs"),R=require("./index139.cjs"),L=require("./index127.cjs"),ee=require("./index170.cjs"),$=require("./index174.cjs"),te=require("./index177.cjs"),ae=require("./index214.cjs"),G=require("./index150.cjs"),re=require("./index235.cjs"),oe=require("./index236.cjs"),ce=require("./index184.cjs"),ne=require("./index49.cjs"),se=require("./index237.cjs"),ie=require("./index197.cjs"),M=require("./index238.cjs");async function ue(e,t){var O,P,H,T;const{account:a=e.account,authorizationList:i,batch:r=!!((O=e.batch)!=null&&O.multicall),blockNumber:h,blockTag:C="latest",accessList:k,blobs:v,blockOverrides:f,code:y,data:n,factory:b,factoryData:u,gas:x,gasPrice:w,maxFeePerBlobGas:m,maxFeePerGas:p,maxPriorityFeePerGas:g,nonce:q,to:o,value:I,stateOverride:J,...K}=t,D=a?Y.parseAccount(a):void 0;if(y&&(b||u))throw new A.BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(y&&o)throw new A.BaseError("Cannot provide both `code` & `to` as parameters.");const E=y&&n,N=b&&u&&o&&n,S=E||N,Q=E?fe({code:y,data:n}):N?be({data:n,factory:b,factoryData:u,to:o}):n;try{ie.assertRequest(t);const c=(typeof h=="bigint"?G.numberToHex(h):void 0)||C,l=f?X.toRpc(f):void 0,d=se.serializeStateOverride(J),V=(T=(H=(P=e.chain)==null?void 0:P.formatters)==null?void 0:H.transactionRequest)==null?void 0:T.format,F=(V||ce.formatTransactionRequest)({...oe.extract(K,{format:V}),from:D==null?void 0:D.address,accessList:k,authorizationList:i,blobs:v,data:Q,gas:x,gasPrice:w,maxFeePerBlobGas:m,maxFeePerGas:p,maxPriorityFeePerGas:g,nonce:q,to:S?void 0:o,value:I});if(r&&le({request:F})&&!d&&!l)try{return await de(e,{...F,blockNumber:h,blockTag:C})}catch(s){if(!(s instanceof R.ClientChainNotConfiguredError)&&!(s instanceof R.ChainDoesNotSupportContract))throw s}const U=(()=>{const s=[F,c];return d&&l?[...s,d,l]:d?[...s,d]:l?[...s,{},l]:s})(),_=await e.request({method:"eth_call",params:U});return _==="0x"?{data:void 0}:{data:_}}catch(B){const c=W(B),{offchainLookup:l,offchainLookupSignature:d}=await Promise.resolve().then(()=>require("./index201.cjs"));if(e.ccipRead!==!1&&(c==null?void 0:c.slice(0,10))===d&&o)return{data:await l(e,{data:c,to:o})};throw S&&(c==null?void 0:c.slice(0,10))==="0x101bb98d"?new L.CounterfactualDeploymentFailedError({factory:b}):re.getCallError(B,{...t,account:D,chain:e.chain})}}function le({request:e}){const{data:t,to:a,...i}=e;return!(!t||t.startsWith(Z.aggregate3Signature)||!a||Object.values(i).filter(r=>typeof r<"u").length>0)}async function de(e,t){var w;const{batchSize:a=1024,wait:i=0}=typeof((w=e.batch)==null?void 0:w.multicall)=="object"?e.batch.multicall:{},{blockNumber:r,blockTag:h="latest",data:C,multicallAddress:k,to:v}=t;let f=k;if(!f){if(!e.chain)throw new R.ClientChainNotConfiguredError;f=ae.getChainContractAddress({blockNumber:r,chain:e.chain,contract:"multicall3"})}const n=(typeof r=="bigint"?G.numberToHex(r):void 0)||h,{schedule:b}=ne.createBatchScheduler({id:`${e.uid}.${n}`,wait:i,shouldSplitBatch(m){return m.reduce((g,{data:q})=>g+(q.length-2),0)>a*2},fn:async m=>{const p=m.map(o=>({allowFailure:!0,callData:o.data,target:o.to})),g=te.encodeFunctionData({abi:z.multicall3Abi,args:[p],functionName:"aggregate3"}),q=await e.request({method:"eth_call",params:[{data:g,to:f},n]});return ee.decodeFunctionResult({abi:z.multicall3Abi,args:[p],functionName:"aggregate3",data:q||"0x"})}}),[{returnData:u,success:x}]=await b({data:C,to:v});if(!x)throw new L.RawContractError({data:u});return u==="0x"?{data:void 0}:{data:u}}function fe(e){const{code:t,data:a}=e;return $.encodeDeployData({abi:M.parseAbi(["constructor(bytes, bytes)"]),bytecode:j.deploylessCallViaBytecodeBytecode,args:[t,a]})}function be(e){const{data:t,factory:a,factoryData:i,to:r}=e;return $.encodeDeployData({abi:M.parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:j.deploylessCallViaFactoryBytecode,args:[r,t,a,i]})}function W(e){var a;if(!(e instanceof A.BaseError))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(a=t.data)==null?void 0:a.data:t.data}exports.call=ue;exports.getRevertErrorData=W;
|