@gardenfi/utils 2.4.5-beta.3 → 2.4.6-beta.1
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/index10.cjs +1 -1
- package/dist/index10.js +4 -4
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +2 -2
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +1 -1
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +2 -2
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +2 -2
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +12 -26
- package/dist/index242.cjs +1 -1
- package/dist/index242.js +3 -3
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +58 -8
- package/dist/index26.cjs +16 -1
- package/dist/index26.js +113 -12
- package/dist/index262.cjs +1 -1
- package/dist/index262.js +1 -1
- package/dist/index266.cjs +1 -1
- package/dist/index266.js +2 -2
- package/dist/index267.cjs +1 -2
- package/dist/index267.js +25 -40
- package/dist/index268.cjs +1 -1
- package/dist/index268.js +6 -2
- package/dist/index269.cjs +2 -1
- package/dist/index269.js +41 -5
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +32 -58
- package/dist/index270.cjs +1 -1
- package/dist/index270.js +2 -11
- package/dist/index271.cjs +1 -1
- package/dist/index271.js +9 -18
- package/dist/index272.cjs +1 -1
- package/dist/index272.js +19 -8
- package/dist/index273.cjs +1 -1
- package/dist/index273.js +8 -66
- package/dist/index274.cjs +1 -1
- package/dist/index274.js +65 -64
- package/dist/index275.cjs +1 -1
- package/dist/index275.js +60 -181
- package/dist/index276.cjs +1 -1
- package/dist/index276.js +184 -20
- package/dist/index277.cjs +1 -1
- package/dist/index277.js +21 -41
- package/dist/index278.cjs +1 -1
- package/dist/index278.js +20 -54
- package/dist/index279.cjs +1 -1
- package/dist/index279.js +54 -18
- package/dist/index28.cjs +1 -16
- package/dist/index28.js +24 -111
- package/dist/index280.cjs +1 -1
- package/dist/index280.js +34 -10
- package/dist/index281.cjs +1 -1
- package/dist/index281.js +10 -7
- package/dist/index282.cjs +1 -1
- package/dist/index282.js +13 -12
- package/dist/index283.cjs +1 -2
- package/dist/index283.js +10 -16
- package/dist/index284.cjs +2 -1
- package/dist/index284.js +18 -14
- package/dist/index285.cjs +1 -1
- package/dist/index285.js +14 -11
- package/dist/index286.cjs +1 -1
- package/dist/index286.js +11 -26
- package/dist/index288.cjs +1 -1
- package/dist/index288.js +1 -1
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +7 -31
- package/dist/index293.cjs +1 -1
- package/dist/index293.js +2 -2
- package/dist/index295.cjs +1 -1
- package/dist/index295.js +10 -41
- package/dist/index296.cjs +1 -1
- package/dist/index296.js +18 -77
- package/dist/index297.cjs +1 -1
- package/dist/index297.js +43 -2
- package/dist/index298.cjs +1 -1
- package/dist/index298.js +77 -10
- package/dist/index299.cjs +1 -1
- package/dist/index299.js +2 -20
- package/dist/index300.cjs +1 -1
- package/dist/index300.js +1 -1
- package/dist/index304.cjs +1 -1
- package/dist/index304.js +1 -1
- package/dist/index307.cjs +1 -1
- package/dist/index307.js +1 -1
- package/dist/index309.cjs +1 -1
- package/dist/index309.js +1 -1
- package/dist/index312.cjs +1 -1
- package/dist/index312.js +63 -4
- package/dist/index313.cjs +1 -1
- package/dist/index313.js +40 -59
- package/dist/index314.cjs +1 -1
- package/dist/index314.js +4 -44
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +1 -1
- package/package.json +1 -1
package/dist/index27.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 e=require("./index218.cjs"),t=e.defineChain({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});exports.mainnet=t;
|
package/dist/index27.js
CHANGED
|
@@ -1,60 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
sort: (t, H) => t.id - H.id
|
|
33
|
-
}), F = async (t) => o ? E(t) : [
|
|
34
|
-
await p.request({
|
|
35
|
-
body: t
|
|
36
|
-
})
|
|
37
|
-
], [{ error: s, result: l }] = await F(i);
|
|
38
|
-
if (R)
|
|
39
|
-
return { error: s, result: l };
|
|
40
|
-
if (s)
|
|
41
|
-
throw new O({
|
|
42
|
-
body: i,
|
|
43
|
-
error: s,
|
|
44
|
-
url: r
|
|
45
|
-
});
|
|
46
|
-
return l;
|
|
47
|
-
},
|
|
48
|
-
retryCount: b,
|
|
49
|
-
retryDelay: d,
|
|
50
|
-
timeout: c,
|
|
51
|
-
type: "http"
|
|
52
|
-
}, {
|
|
53
|
-
fetchOptions: u,
|
|
54
|
-
url: r
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
}
|
|
1
|
+
import { defineChain as e } from "./index218.js";
|
|
2
|
+
const t = /* @__PURE__ */ e({
|
|
3
|
+
id: 1,
|
|
4
|
+
name: "Ethereum",
|
|
5
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
6
|
+
rpcUrls: {
|
|
7
|
+
default: {
|
|
8
|
+
http: ["https://eth.merkle.io"]
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
blockExplorers: {
|
|
12
|
+
default: {
|
|
13
|
+
name: "Etherscan",
|
|
14
|
+
url: "https://etherscan.io",
|
|
15
|
+
apiUrl: "https://api.etherscan.io/api"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
contracts: {
|
|
19
|
+
ensRegistry: {
|
|
20
|
+
address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
|
|
21
|
+
},
|
|
22
|
+
ensUniversalResolver: {
|
|
23
|
+
address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67",
|
|
24
|
+
blockCreated: 19258213
|
|
25
|
+
},
|
|
26
|
+
multicall3: {
|
|
27
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
28
|
+
blockCreated: 14353601
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
58
32
|
export {
|
|
59
|
-
|
|
33
|
+
t as mainnet
|
|
60
34
|
};
|
package/dist/index270.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 e="1.0.8";exports.version=e;
|
package/dist/index270.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
function f(e) {
|
|
3
|
-
let r = "";
|
|
4
|
-
const o = e.length;
|
|
5
|
-
for (let t = 0; t < o; t++) {
|
|
6
|
-
const a = e[t];
|
|
7
|
-
r += m(a), t !== o - 1 && (r += ", ");
|
|
8
|
-
}
|
|
9
|
-
return r;
|
|
10
|
-
}
|
|
1
|
+
const o = "1.0.8";
|
|
11
2
|
export {
|
|
12
|
-
|
|
3
|
+
o as version
|
|
13
4
|
};
|
package/dist/index271.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 i=require("./index272.cjs");function m(r){let e="";const a=r.length;for(let t=0;t<a;t++){const o=r[t];e+=i.formatAbiParameter(o),t!==a-1&&(e+=", ")}return e}exports.formatAbiParameters=m;
|
package/dist/index271.js
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (let t = 0; t < p; t++) {
|
|
9
|
-
const f = n.components[t];
|
|
10
|
-
o += d(f), t < p - 1 && (o += ", ");
|
|
11
|
-
}
|
|
12
|
-
const e = s(c, n.type);
|
|
13
|
-
return o += `)${(e == null ? void 0 : e.array) ?? ""}`, d({
|
|
14
|
-
...n,
|
|
15
|
-
type: o
|
|
16
|
-
});
|
|
1
|
+
import { formatAbiParameter as m } from "./index272.js";
|
|
2
|
+
function f(e) {
|
|
3
|
+
let r = "";
|
|
4
|
+
const o = e.length;
|
|
5
|
+
for (let t = 0; t < o; t++) {
|
|
6
|
+
const a = e[t];
|
|
7
|
+
r += m(a), t !== o - 1 && (r += ", ");
|
|
17
8
|
}
|
|
18
|
-
return
|
|
9
|
+
return r;
|
|
19
10
|
}
|
|
20
11
|
export {
|
|
21
|
-
|
|
12
|
+
f as formatAbiParameters
|
|
22
13
|
};
|
package/dist/index272.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index273.cjs"),d=/^tuple(?<array>(\[(\d*)\])*)$/;function c(n){let e=n.type;if(d.test(n.type)&&"components"in n){e="(";const p=n.components.length;for(let t=0;t<p;t++){const s=n.components[t];e+=c(s),t<p-1&&(e+=", ")}const o=f.execTyped(d,n.type);return e+=`)${(o==null?void 0:o.array)??""}`,c({...n,type:e})}return"indexed"in n&&n.indexed&&(e=`${e} indexed`),n.name?`${e} ${n.name}`:e}exports.formatAbiParameter=c;
|
package/dist/index272.js
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { execTyped as s } from "./index273.js";
|
|
2
|
+
const c = /^tuple(?<array>(\[(\d*)\])*)$/;
|
|
3
|
+
function d(n) {
|
|
4
|
+
let o = n.type;
|
|
5
|
+
if (c.test(n.type) && "components" in n) {
|
|
6
|
+
o = "(";
|
|
7
|
+
const p = n.components.length;
|
|
8
|
+
for (let t = 0; t < p; t++) {
|
|
9
|
+
const f = n.components[t];
|
|
10
|
+
o += d(f), t < p - 1 && (o += ", ");
|
|
11
|
+
}
|
|
12
|
+
const e = s(c, n.type);
|
|
13
|
+
return o += `)${(e == null ? void 0 : e.array) ?? ""}`, d({
|
|
14
|
+
...n,
|
|
15
|
+
type: o
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return "indexed" in n && n.indexed && (o = `${o} indexed`), n.name ? `${o} ${n.name}` : o;
|
|
4
19
|
}
|
|
5
|
-
const o = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, c = /^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)?$/, x = /^\(.+?\).*?$/;
|
|
6
20
|
export {
|
|
7
|
-
|
|
8
|
-
s as execTyped,
|
|
9
|
-
c as integerRegex,
|
|
10
|
-
x as isTupleRegex
|
|
21
|
+
d as formatAbiParameter
|
|
11
22
|
};
|
package/dist/index273.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function s(t,n){const e=t.exec(n);return e==null?void 0:e.groups}const g=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,o=/^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)?$/,c=/^\(.+?\).*?$/;exports.bytesRegex=g;exports.execTyped=s;exports.integerRegex=o;exports.isTupleRegex=c;
|
package/dist/index273.js
CHANGED
|
@@ -1,69 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
return n.test(e);
|
|
1
|
+
function s(t, n) {
|
|
2
|
+
const e = t.exec(n);
|
|
3
|
+
return e == null ? void 0 : e.groups;
|
|
5
4
|
}
|
|
6
|
-
|
|
7
|
-
return t(n, e);
|
|
8
|
-
}
|
|
9
|
-
const r = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
10
|
-
function l(e) {
|
|
11
|
-
return r.test(e);
|
|
12
|
-
}
|
|
13
|
-
function f(e) {
|
|
14
|
-
return t(r, e);
|
|
15
|
-
}
|
|
16
|
-
const a = /^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;
|
|
17
|
-
function x(e) {
|
|
18
|
-
return a.test(e);
|
|
19
|
-
}
|
|
20
|
-
function p(e) {
|
|
21
|
-
return t(a, e);
|
|
22
|
-
}
|
|
23
|
-
const u = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;
|
|
24
|
-
function $(e) {
|
|
25
|
-
return u.test(e);
|
|
26
|
-
}
|
|
27
|
-
function b(e) {
|
|
28
|
-
return t(u, e);
|
|
29
|
-
}
|
|
30
|
-
const i = /^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;
|
|
31
|
-
function m(e) {
|
|
32
|
-
return i.test(e);
|
|
33
|
-
}
|
|
34
|
-
function y(e) {
|
|
35
|
-
return t(i, e);
|
|
36
|
-
}
|
|
37
|
-
const c = /^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;
|
|
38
|
-
function v(e) {
|
|
39
|
-
return c.test(e);
|
|
40
|
-
}
|
|
41
|
-
function z(e) {
|
|
42
|
-
return t(c, e);
|
|
43
|
-
}
|
|
44
|
-
const o = /^receive\(\) external payable$/;
|
|
45
|
-
function A(e) {
|
|
46
|
-
return o.test(e);
|
|
47
|
-
}
|
|
48
|
-
const R = /* @__PURE__ */ new Set(["indexed"]), Z = /* @__PURE__ */ new Set([
|
|
49
|
-
"calldata",
|
|
50
|
-
"memory",
|
|
51
|
-
"storage"
|
|
52
|
-
]);
|
|
5
|
+
const o = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, c = /^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)?$/, x = /^\(.+?\).*?$/;
|
|
53
6
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
z as execFallbackSignature,
|
|
59
|
-
p as execFunctionSignature,
|
|
60
|
-
b as execStructSignature,
|
|
61
|
-
Z as functionModifiers,
|
|
62
|
-
m as isConstructorSignature,
|
|
63
|
-
g as isErrorSignature,
|
|
64
|
-
l as isEventSignature,
|
|
65
|
-
v as isFallbackSignature,
|
|
66
|
-
x as isFunctionSignature,
|
|
67
|
-
A as isReceiveSignature,
|
|
68
|
-
$ as isStructSignature
|
|
7
|
+
o as bytesRegex,
|
|
8
|
+
s as execTyped,
|
|
9
|
+
c as integerRegex,
|
|
10
|
+
x as isTupleRegex
|
|
69
11
|
};
|
package/dist/index274.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("./index273.cjs"),n=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function o(e){return n.test(e)}function s(e){return t.execTyped(n,e)}const r=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function g(e){return r.test(e)}function S(e){return t.execTyped(r,e)}const i=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function x(e){return i.test(e)}function l(e){return t.execTyped(i,e)}const a=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function f(e){return a.test(e)}function p(e){return t.execTyped(a,e)}const u=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function b(e){return u.test(e)}function y(e){return t.execTyped(u,e)}const c=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function d(e){return c.test(e)}function $(e){return t.execTyped(c,e)}const v=/^receive\(\) external payable$/;function m(e){return v.test(e)}const R=new Set(["indexed"]),z=new Set(["calldata","memory","storage"]);exports.eventModifiers=R;exports.execConstructorSignature=y;exports.execErrorSignature=s;exports.execEventSignature=S;exports.execFallbackSignature=$;exports.execFunctionSignature=l;exports.execStructSignature=p;exports.functionModifiers=z;exports.isConstructorSignature=b;exports.isErrorSignature=o;exports.isEventSignature=g;exports.isFallbackSignature=d;exports.isFunctionSignature=x;exports.isReceiveSignature=m;exports.isStructSignature=f;
|
package/dist/index274.js
CHANGED
|
@@ -1,68 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { CircularReferenceError as x } from "./index281.js";
|
|
6
|
-
import { isStructSignature as E, execStructSignature as b } from "./index273.js";
|
|
7
|
-
import { parseAbiParameter as A, isSolidityType as $ } from "./index275.js";
|
|
8
|
-
function C(s) {
|
|
9
|
-
const n = {}, c = s.length;
|
|
10
|
-
for (let t = 0; t < c; t++) {
|
|
11
|
-
const i = s[t];
|
|
12
|
-
if (!E(i))
|
|
13
|
-
continue;
|
|
14
|
-
const r = b(i);
|
|
15
|
-
if (!r)
|
|
16
|
-
throw new T({ signature: i, type: "struct" });
|
|
17
|
-
const u = r.properties.split(";"), e = [], h = u.length;
|
|
18
|
-
for (let l = 0; l < h; l++) {
|
|
19
|
-
const m = u[l].trim();
|
|
20
|
-
if (!m)
|
|
21
|
-
continue;
|
|
22
|
-
const y = A(m, {
|
|
23
|
-
type: "struct"
|
|
24
|
-
});
|
|
25
|
-
e.push(y);
|
|
26
|
-
}
|
|
27
|
-
if (!e.length)
|
|
28
|
-
throw new v({ signature: i });
|
|
29
|
-
n[r.name] = e;
|
|
30
|
-
}
|
|
31
|
-
const o = {}, a = Object.entries(n), p = a.length;
|
|
32
|
-
for (let t = 0; t < p; t++) {
|
|
33
|
-
const [i, r] = a[t];
|
|
34
|
-
o[i] = f(r, n);
|
|
35
|
-
}
|
|
36
|
-
return o;
|
|
1
|
+
import { execTyped as t } from "./index273.js";
|
|
2
|
+
const n = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
3
|
+
function g(e) {
|
|
4
|
+
return n.test(e);
|
|
37
5
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const o = [], a = s.length;
|
|
41
|
-
for (let p = 0; p < a; p++) {
|
|
42
|
-
const t = s[p];
|
|
43
|
-
if (g.test(t.type))
|
|
44
|
-
o.push(t);
|
|
45
|
-
else {
|
|
46
|
-
const r = w(I, t.type);
|
|
47
|
-
if (!(r != null && r.type))
|
|
48
|
-
throw new d({ abiParameter: t });
|
|
49
|
-
const { array: u, type: e } = r;
|
|
50
|
-
if (e in n) {
|
|
51
|
-
if (c.has(e))
|
|
52
|
-
throw new x({ type: e });
|
|
53
|
-
o.push({
|
|
54
|
-
...t,
|
|
55
|
-
type: `tuple${u ?? ""}`,
|
|
56
|
-
components: f(n[e] ?? [], n, /* @__PURE__ */ new Set([...c, e]))
|
|
57
|
-
});
|
|
58
|
-
} else if ($(e))
|
|
59
|
-
o.push(t);
|
|
60
|
-
else
|
|
61
|
-
throw new S({ type: e });
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return o;
|
|
6
|
+
function S(e) {
|
|
7
|
+
return t(n, e);
|
|
65
8
|
}
|
|
9
|
+
const r = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
10
|
+
function l(e) {
|
|
11
|
+
return r.test(e);
|
|
12
|
+
}
|
|
13
|
+
function f(e) {
|
|
14
|
+
return t(r, e);
|
|
15
|
+
}
|
|
16
|
+
const a = /^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;
|
|
17
|
+
function x(e) {
|
|
18
|
+
return a.test(e);
|
|
19
|
+
}
|
|
20
|
+
function p(e) {
|
|
21
|
+
return t(a, e);
|
|
22
|
+
}
|
|
23
|
+
const u = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;
|
|
24
|
+
function $(e) {
|
|
25
|
+
return u.test(e);
|
|
26
|
+
}
|
|
27
|
+
function b(e) {
|
|
28
|
+
return t(u, e);
|
|
29
|
+
}
|
|
30
|
+
const i = /^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;
|
|
31
|
+
function m(e) {
|
|
32
|
+
return i.test(e);
|
|
33
|
+
}
|
|
34
|
+
function y(e) {
|
|
35
|
+
return t(i, e);
|
|
36
|
+
}
|
|
37
|
+
const c = /^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;
|
|
38
|
+
function v(e) {
|
|
39
|
+
return c.test(e);
|
|
40
|
+
}
|
|
41
|
+
function z(e) {
|
|
42
|
+
return t(c, e);
|
|
43
|
+
}
|
|
44
|
+
const o = /^receive\(\) external payable$/;
|
|
45
|
+
function A(e) {
|
|
46
|
+
return o.test(e);
|
|
47
|
+
}
|
|
48
|
+
const R = /* @__PURE__ */ new Set(["indexed"]), Z = /* @__PURE__ */ new Set([
|
|
49
|
+
"calldata",
|
|
50
|
+
"memory",
|
|
51
|
+
"storage"
|
|
52
|
+
]);
|
|
66
53
|
export {
|
|
67
|
-
|
|
54
|
+
R as eventModifiers,
|
|
55
|
+
y as execConstructorSignature,
|
|
56
|
+
S as execErrorSignature,
|
|
57
|
+
f as execEventSignature,
|
|
58
|
+
z as execFallbackSignature,
|
|
59
|
+
p as execFunctionSignature,
|
|
60
|
+
b as execStructSignature,
|
|
61
|
+
Z as functionModifiers,
|
|
62
|
+
m as isConstructorSignature,
|
|
63
|
+
g as isErrorSignature,
|
|
64
|
+
l as isEventSignature,
|
|
65
|
+
v as isFallbackSignature,
|
|
66
|
+
x as isFunctionSignature,
|
|
67
|
+
A as isReceiveSignature,
|
|
68
|
+
$ as isStructSignature
|
|
68
69
|
};
|
package/dist/index275.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 h=require("./index273.cjs"),b=require("./index278.cjs"),T=require("./index279.cjs"),y=require("./index280.cjs"),q=require("./index282.cjs"),f=require("./index274.cjs"),S=require("./index276.cjs");function v(i){const n={},u=i.length;for(let e=0;e<u;e++){const o=i[e];if(!f.isStructSignature(o))continue;const r=f.execStructSignature(o);if(!r)throw new y.InvalidSignatureError({signature:o,type:"struct"});const p=r.properties.split(";"),t=[],w=p.length;for(let l=0;l<w;l++){const g=p[l].trim();if(!g)continue;const d=S.parseAbiParameter(g,{type:"struct"});t.push(d)}if(!t.length)throw new y.InvalidStructSignatureError({signature:o});n[r.name]=t}const s={},a=Object.entries(n),c=a.length;for(let e=0;e<c;e++){const[o,r]=a[e];s[o]=m(r,n)}return s}const P=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function m(i,n,u=new Set){const s=[],a=i.length;for(let c=0;c<a;c++){const e=i[c];if(h.isTupleRegex.test(e.type))s.push(e);else{const r=h.execTyped(P,e.type);if(!(r!=null&&r.type))throw new T.InvalidAbiTypeParameterError({abiParameter:e});const{array:p,type:t}=r;if(t in n){if(u.has(t))throw new q.CircularReferenceError({type:t});s.push({...e,type:`tuple${p??""}`,components:m(n[t]??[],n,new Set([...u,t]))})}else if(S.isSolidityType(t))s.push(e);else throw new b.UnknownTypeError({type:t})}}return s}exports.parseStructs=v;
|