@gardenfi/utils 3.1.0-beta.2 → 3.1.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +4 -4
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +4 -4
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +3 -3
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +2 -2
- 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/index114.cjs +1 -1
- package/dist/index114.js +1 -1
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +1 -1
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +5 -5
- package/dist/index138.cjs +1 -1
- package/dist/index138.js +13 -33
- package/dist/index139.cjs +1 -1
- package/dist/index139.js +34 -9
- package/dist/index140.cjs +1 -1
- package/dist/index140.js +55 -60
- package/dist/index141.cjs +1 -1
- package/dist/index141.js +23 -17
- package/dist/index142.cjs +1 -1
- package/dist/index142.js +6 -106
- package/dist/index143.cjs +1 -1
- package/dist/index143.js +18 -78
- package/dist/index144.cjs +1 -1
- package/dist/index144.js +15 -9
- package/dist/index145.cjs +1 -1
- package/dist/index145.js +5 -90
- package/dist/index146.cjs +1 -2
- package/dist/index146.js +14 -3
- package/dist/index147.cjs +1 -1
- package/dist/index147.js +11 -9
- package/dist/index148.cjs +1 -1
- package/dist/index148.js +12 -13
- package/dist/index149.cjs +1 -1
- package/dist/index149.js +11 -4
- package/dist/index150.cjs +1 -1
- package/dist/index150.js +8 -12
- package/dist/index151.cjs +1 -1
- package/dist/index151.js +4 -2
- package/dist/index152.cjs +1 -1
- package/dist/index152.js +17 -32
- package/dist/index153.cjs +1 -1
- package/dist/index153.js +5 -21
- package/dist/index154.cjs +1 -1
- package/dist/index154.js +171 -5
- package/dist/index155.cjs +1 -1
- package/dist/index155.js +103 -5
- package/dist/index156.cjs +1 -1
- package/dist/index156.js +33 -5
- package/dist/index157.cjs +1 -9
- package/dist/index157.js +8 -34
- package/dist/index158.cjs +1 -1
- package/dist/index158.js +61 -3
- package/dist/index159.cjs +1 -1
- package/dist/index159.js +19 -18
- package/dist/index160.cjs +1 -1
- package/dist/index160.js +105 -19
- package/dist/index161.cjs +1 -1
- package/dist/index161.js +70 -27
- package/dist/index162.cjs +1 -1
- package/dist/index162.js +7 -6
- package/dist/index163.cjs +1 -4
- package/dist/index163.js +88 -192
- package/dist/index164.cjs +2 -1
- package/dist/index164.js +3 -28
- package/dist/index165.cjs +1 -1
- package/dist/index165.js +9 -162
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +13 -127
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +4 -27
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +2 -56
- package/dist/index169.cjs +1 -1
- package/dist/index169.js +31 -191
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +2 -2
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +22 -4
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +5 -20
- package/dist/index172.cjs +1 -1
- package/dist/index172.js +6 -3
- package/dist/index173.cjs +1 -1
- package/dist/index173.js +5 -16
- package/dist/index174.cjs +9 -1
- package/dist/index174.js +35 -11
- package/dist/index175.cjs +1 -1
- package/dist/index175.js +3 -35
- package/dist/index176.cjs +1 -1
- package/dist/index176.js +19 -3
- package/dist/index177.cjs +1 -1
- package/dist/index177.js +18 -25
- package/dist/index178.cjs +1 -1
- package/dist/index178.js +35 -8
- package/dist/index179.cjs +1 -1
- package/dist/index179.js +6 -23
- package/dist/index180.cjs +4 -1
- package/dist/index180.js +194 -28
- package/dist/index181.cjs +1 -1
- package/dist/index181.js +27 -3
- package/dist/index182.cjs +1 -1
- package/dist/index182.js +161 -6
- package/dist/index183.cjs +1 -1
- package/dist/index183.js +127 -6
- package/dist/index184.cjs +1 -1
- package/dist/index184.js +27 -32
- package/dist/index185.cjs +1 -1
- package/dist/index185.js +192 -5
- package/dist/index186.cjs +1 -1
- package/dist/index186.js +4 -38
- package/dist/index187.cjs +1 -1
- package/dist/index187.js +14 -43
- package/dist/index188.cjs +1 -1
- package/dist/index188.js +3 -33
- package/dist/index189.cjs +1 -1
- package/dist/index189.js +15 -16
- package/dist/index190.cjs +1 -1
- package/dist/index190.js +32 -40
- package/dist/index191.cjs +1 -1
- package/dist/index191.js +3 -105
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +28 -3
- package/dist/index193.cjs +1 -1
- package/dist/index193.js +25 -5
- package/dist/index194.cjs +1 -1
- package/dist/index194.js +28 -3
- package/dist/index195.cjs +1 -1
- package/dist/index195.js +6 -17
- package/dist/index196.cjs +1 -1
- package/dist/index196.js +6 -5
- package/dist/index197.cjs +1 -1
- package/dist/index197.js +32 -8
- package/dist/index198.cjs +1 -1
- package/dist/index198.js +5 -104
- package/dist/index199.cjs +1 -1
- package/dist/index199.js +37 -5
- package/dist/index200.cjs +1 -1
- package/dist/index200.js +49 -6
- package/dist/index201.cjs +1 -1
- package/dist/index201.js +30 -25
- package/dist/index202.cjs +1 -1
- package/dist/index202.js +17 -34
- package/dist/index203.cjs +1 -1
- package/dist/index203.js +42 -13
- package/dist/index204.cjs +1 -1
- package/dist/index204.js +100 -74
- package/dist/index205.cjs +1 -1
- package/dist/index205.js +3 -2
- package/dist/index206.cjs +1 -1
- package/dist/index206.js +4 -17
- package/dist/index207.cjs +1 -1
- package/dist/index207.js +3 -171
- package/dist/index208.cjs +1 -1
- package/dist/index208.js +17 -17
- package/dist/index209.cjs +1 -1
- package/dist/index209.js +8 -10
- package/dist/index210.cjs +1 -1
- package/dist/index210.js +5 -25
- package/dist/index211.cjs +1 -1
- package/dist/index211.js +27 -18
- package/dist/index212.cjs +1 -1
- package/dist/index212.js +78 -15
- package/dist/index213.cjs +1 -1
- package/dist/index213.js +2 -6
- package/dist/index214.cjs +1 -1
- package/dist/index214.js +18 -13
- package/dist/index215.cjs +1 -1
- package/dist/index215.js +17 -10
- package/dist/index216.cjs +1 -1
- package/dist/index216.js +10 -16
- package/dist/index217.cjs +1 -1
- package/dist/index217.js +1 -1
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +8 -8
- package/dist/index220.cjs +1 -2
- package/dist/index220.js +213 -40
- package/dist/index221.cjs +1 -1
- package/dist/index221.js +109 -2
- package/dist/index222.cjs +1 -1
- package/dist/index222.js +206 -5
- package/dist/index223.cjs +1 -1
- package/dist/index223.js +103 -10
- package/dist/index224.cjs +1 -1
- package/dist/index224.js +16 -19
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +42 -8
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +74 -62
- package/dist/index227.cjs +1 -1
- package/dist/index227.js +2 -66
- package/dist/index228.cjs +2 -1
- package/dist/index228.js +40 -187
- package/dist/index229.cjs +1 -1
- package/dist/index229.js +2 -29
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +26 -12
- package/dist/index230.cjs +1 -1
- package/dist/index230.js +5 -76
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +9 -39
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +17 -14
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +8 -13
- package/dist/index234.cjs +1 -1
- package/dist/index234.js +66 -11
- package/dist/index235.cjs +1 -1
- package/dist/index235.js +64 -11
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +187 -18
- package/dist/index237.cjs +1 -1
- package/dist/index237.js +26 -106
- package/dist/index238.cjs +1 -1
- package/dist/index238.js +77 -7
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +39 -25
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +8 -59
- package/dist/index240.cjs +1 -1
- package/dist/index240.js +16 -6
- package/dist/index241.cjs +1 -1
- package/dist/index241.js +12 -102
- package/dist/index242.cjs +1 -1
- package/dist/index242.js +11 -16
- package/dist/index243.cjs +1 -1
- package/dist/index243.js +10 -212
- package/dist/index244.cjs +1 -1
- package/dist/index244.js +18 -205
- package/dist/index245.cjs +1 -1
- package/dist/index245.js +6 -42
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +7 -79
- package/dist/index247.cjs +1 -1
- package/dist/index247.js +27 -2
- package/dist/index25.cjs +1 -16
- package/dist/index25.js +12 -113
- package/dist/index252.cjs +1 -1
- package/dist/index252.js +657 -68
- package/dist/index253.cjs +1 -1
- package/dist/index253.js +154 -634
- package/dist/index254.cjs +1 -1
- package/dist/index254.js +67 -176
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +59 -30
- package/dist/index27.cjs +16 -1
- package/dist/index27.js +111 -24
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +29 -7
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +6 -6
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +1 -1
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +8 -8
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +1 -1
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +2 -2
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +2 -2
- package/dist/index43.cjs +1 -1
- package/dist/index43.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 +3 -3
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +3 -3
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +6 -6
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +1 -1
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +1 -1
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +2 -2
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +2 -2
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +2 -2
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +1 -1
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +4 -4
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +3 -3
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +2 -2
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +1 -1
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +1 -1
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +2 -2
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +1 -1
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +5 -5
- package/package.json +1 -1
package/dist/index142.js
CHANGED
|
@@ -1,109 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { withRetry as W } from "./index90.js";
|
|
7
|
-
import { stringify as _ } from "./index91.js";
|
|
8
|
-
function te(r, A = {}) {
|
|
9
|
-
return async (n, F = {}) => {
|
|
10
|
-
var h;
|
|
11
|
-
const { dedupe: w = !1, methods: t, retryDelay: H = 150, retryCount: L = 3, uid: $ } = {
|
|
12
|
-
...A,
|
|
13
|
-
...F
|
|
14
|
-
}, { method: c } = n;
|
|
15
|
-
if ((h = t == null ? void 0 : t.exclude) != null && h.includes(c))
|
|
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 { checksumAddress as e } from "./index102.js";
|
|
2
|
+
import { keccak256 as o } from "./index150.js";
|
|
3
|
+
function d(r) {
|
|
4
|
+
const s = o(`0x${r.substring(4)}`).substring(26);
|
|
5
|
+
return e(`0x${s}`);
|
|
105
6
|
}
|
|
106
7
|
export {
|
|
107
|
-
|
|
108
|
-
G as shouldRetry
|
|
8
|
+
d as publicKeyToAddress
|
|
109
9
|
};
|
package/dist/index143.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 a=require("./index139.cjs"),l=require("./index151.cjs"),y=require("./index140.cjs"),i=require("./index42.cjs"),x=require("./index138.cjs");let r=!1;async function g({hash:n,privateKey:o,to:e="object"}){const{r:c,s:u,recovery:t}=a.secp256k1.sign(n.slice(2),o.slice(2),{lowS:!0,extraEntropy:l.isHex(r,{strict:!1})?y.hexToBytes(r):r}),s={r:i.numberToHex(c,{size:32}),s:i.numberToHex(u,{size:32}),v:t?28n:27n,yParity:t};return e==="bytes"||e==="hex"?x.serializeSignature({...s,to:e}):s}exports.sign=g;
|
package/dist/index143.js
CHANGED
|
@@ -1,81 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
writable: !0,
|
|
19
|
-
value: void 0
|
|
20
|
-
}), Object.defineProperty(this, "headers", {
|
|
21
|
-
enumerable: !0,
|
|
22
|
-
configurable: !0,
|
|
23
|
-
writable: !0,
|
|
24
|
-
value: void 0
|
|
25
|
-
}), Object.defineProperty(this, "status", {
|
|
26
|
-
enumerable: !0,
|
|
27
|
-
configurable: !0,
|
|
28
|
-
writable: !0,
|
|
29
|
-
value: void 0
|
|
30
|
-
}), Object.defineProperty(this, "url", {
|
|
31
|
-
enumerable: !0,
|
|
32
|
-
configurable: !0,
|
|
33
|
-
writable: !0,
|
|
34
|
-
value: void 0
|
|
35
|
-
}), this.body = t, this.headers = n, this.status = u, this.url = l;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
class f extends a {
|
|
39
|
-
constructor({ body: t, error: e, url: r }) {
|
|
40
|
-
super("RPC Request failed.", {
|
|
41
|
-
cause: e,
|
|
42
|
-
details: e.message,
|
|
43
|
-
metaMessages: [`URL: ${i(r)}`, `Request body: ${s(t)}`],
|
|
44
|
-
name: "RpcRequestError"
|
|
45
|
-
}), Object.defineProperty(this, "code", {
|
|
46
|
-
enumerable: !0,
|
|
47
|
-
configurable: !0,
|
|
48
|
-
writable: !0,
|
|
49
|
-
value: void 0
|
|
50
|
-
}), Object.defineProperty(this, "data", {
|
|
51
|
-
enumerable: !0,
|
|
52
|
-
configurable: !0,
|
|
53
|
-
writable: !0,
|
|
54
|
-
value: void 0
|
|
55
|
-
}), Object.defineProperty(this, "url", {
|
|
56
|
-
enumerable: !0,
|
|
57
|
-
configurable: !0,
|
|
58
|
-
writable: !0,
|
|
59
|
-
value: void 0
|
|
60
|
-
}), this.code = e.code, this.data = e.data, this.url = r;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
class h extends a {
|
|
64
|
-
constructor({ body: t, url: e }) {
|
|
65
|
-
super("The request took too long to respond.", {
|
|
66
|
-
details: "The request timed out.",
|
|
67
|
-
metaMessages: [`URL: ${i(e)}`, `Request body: ${s(t)}`],
|
|
68
|
-
name: "TimeoutError"
|
|
69
|
-
}), Object.defineProperty(this, "url", {
|
|
70
|
-
enumerable: !0,
|
|
71
|
-
configurable: !0,
|
|
72
|
-
writable: !0,
|
|
73
|
-
value: void 0
|
|
74
|
-
}), this.url = e;
|
|
75
|
-
}
|
|
1
|
+
import { secp256k1 as a } from "./index139.js";
|
|
2
|
+
import { isHex as f } from "./index151.js";
|
|
3
|
+
import { hexToBytes as p } from "./index140.js";
|
|
4
|
+
import { numberToHex as s } from "./index42.js";
|
|
5
|
+
import { serializeSignature as u } from "./index138.js";
|
|
6
|
+
let e = !1;
|
|
7
|
+
async function z({ hash: o, privateKey: n, to: r = "object" }) {
|
|
8
|
+
const { r: m, s: c, recovery: t } = a.sign(o.slice(2), n.slice(2), {
|
|
9
|
+
lowS: !0,
|
|
10
|
+
extraEntropy: f(e, { strict: !1 }) ? p(e) : e
|
|
11
|
+
}), i = {
|
|
12
|
+
r: s(m, { size: 32 }),
|
|
13
|
+
s: s(c, { size: 32 }),
|
|
14
|
+
v: t ? 28n : 27n,
|
|
15
|
+
yParity: t
|
|
16
|
+
};
|
|
17
|
+
return r === "bytes" || r === "hex" ? u({ ...i, to: r }) : i;
|
|
76
18
|
}
|
|
77
19
|
export {
|
|
78
|
-
|
|
79
|
-
f as RpcRequestError,
|
|
80
|
-
h as TimeoutError
|
|
20
|
+
z as sign
|
|
81
21
|
};
|
package/dist/index144.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("./index152.cjs"),a=require("./index143.cjs");async function u(t){const{chainId:n,nonce:i,privateKey:r,to:o="object"}=t,s=t.contractAddress??t.address,e=await a.sign({hash:c.hashAuthorization({address:s,chainId:n,nonce:i}),privateKey:r,to:o});return o==="object"?{address:s,chainId:n,nonce:i,...e}:e}exports.signAuthorization=u;
|
package/dist/index144.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
1
|
+
import { hashAuthorization as a } from "./index152.js";
|
|
2
|
+
import { sign as e } from "./index143.js";
|
|
3
|
+
async function u(t) {
|
|
4
|
+
const { chainId: o, nonce: n, privateKey: c, to: i = "object" } = t, r = t.contractAddress ?? t.address, s = await e({
|
|
5
|
+
hash: a({ address: r, chainId: o, nonce: n }),
|
|
6
|
+
privateKey: c,
|
|
7
|
+
to: i
|
|
8
|
+
});
|
|
9
|
+
return i === "object" ? {
|
|
10
|
+
address: r,
|
|
11
|
+
chainId: o,
|
|
12
|
+
nonce: n,
|
|
13
|
+
...s
|
|
14
|
+
} : s;
|
|
9
15
|
}
|
|
10
16
|
export {
|
|
11
|
-
|
|
17
|
+
u as signAuthorization
|
|
12
18
|
};
|
package/dist/index145.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 a=require("./index153.cjs"),n=require("./index143.cjs");async function t({message:e,privateKey:s}){return await n.sign({hash:a.hashMessage(e),privateKey:s,to:"hex"})}exports.signMessage=t;
|
package/dist/index145.js
CHANGED
|
@@ -1,93 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function E(o, e = {}) {
|
|
6
|
-
const { url: r, headers: a } = U(o);
|
|
7
|
-
return {
|
|
8
|
-
async request(d) {
|
|
9
|
-
var w;
|
|
10
|
-
const { body: s, fetchFn: T = e.fetchFn ?? fetch, onRequest: i = e.onRequest, onResponse: f = e.onResponse, timeout: l = e.timeout ?? 1e4 } = d, m = {
|
|
11
|
-
...e.fetchOptions ?? {},
|
|
12
|
-
...d.fetchOptions ?? {}
|
|
13
|
-
}, { headers: j, method: O, signal: k } = m;
|
|
14
|
-
try {
|
|
15
|
-
const t = await S(async ({ signal: c }) => {
|
|
16
|
-
const u = {
|
|
17
|
-
...m,
|
|
18
|
-
body: Array.isArray(s) ? p(s.map((g) => ({
|
|
19
|
-
jsonrpc: "2.0",
|
|
20
|
-
id: g.id ?? C.take(),
|
|
21
|
-
...g
|
|
22
|
-
}))) : p({
|
|
23
|
-
jsonrpc: "2.0",
|
|
24
|
-
id: s.id ?? C.take(),
|
|
25
|
-
...s
|
|
26
|
-
}),
|
|
27
|
-
headers: {
|
|
28
|
-
...a,
|
|
29
|
-
"Content-Type": "application/json",
|
|
30
|
-
...j
|
|
31
|
-
},
|
|
32
|
-
method: O || "POST",
|
|
33
|
-
signal: k || (l > 0 ? c : null)
|
|
34
|
-
}, q = new Request(r, u), y = await (i == null ? void 0 : i(q, u)) ?? { ...u, url: r };
|
|
35
|
-
return await T(y.url ?? r, y);
|
|
36
|
-
}, {
|
|
37
|
-
errorInstance: new R({ body: s, url: r }),
|
|
38
|
-
timeout: l,
|
|
39
|
-
signal: !0
|
|
40
|
-
});
|
|
41
|
-
f && await f(t);
|
|
42
|
-
let n;
|
|
43
|
-
if ((w = t.headers.get("Content-Type")) != null && w.startsWith("application/json"))
|
|
44
|
-
n = await t.json();
|
|
45
|
-
else {
|
|
46
|
-
n = await t.text();
|
|
47
|
-
try {
|
|
48
|
-
n = JSON.parse(n || "{}");
|
|
49
|
-
} catch (c) {
|
|
50
|
-
if (t.ok)
|
|
51
|
-
throw c;
|
|
52
|
-
n = { error: n };
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (!t.ok)
|
|
56
|
-
throw new h({
|
|
57
|
-
body: s,
|
|
58
|
-
details: p(n.error) || t.statusText,
|
|
59
|
-
headers: t.headers,
|
|
60
|
-
status: t.status,
|
|
61
|
-
url: r
|
|
62
|
-
});
|
|
63
|
-
return n;
|
|
64
|
-
} catch (t) {
|
|
65
|
-
throw t instanceof h || t instanceof R ? t : new h({
|
|
66
|
-
body: s,
|
|
67
|
-
cause: t,
|
|
68
|
-
url: r
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function U(o) {
|
|
75
|
-
try {
|
|
76
|
-
const e = new URL(o), r = (() => {
|
|
77
|
-
if (e.username) {
|
|
78
|
-
const a = `${decodeURIComponent(e.username)}:${decodeURIComponent(e.password)}`;
|
|
79
|
-
return e.username = "", e.password = "", {
|
|
80
|
-
url: e.toString(),
|
|
81
|
-
headers: { Authorization: `Basic ${btoa(a)}` }
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
})();
|
|
85
|
-
return { url: e.toString(), ...r };
|
|
86
|
-
} catch {
|
|
87
|
-
return { url: o };
|
|
88
|
-
}
|
|
1
|
+
import { hashMessage as e } from "./index153.js";
|
|
2
|
+
import { sign as o } from "./index143.js";
|
|
3
|
+
async function i({ message: s, privateKey: a }) {
|
|
4
|
+
return await o({ hash: e(s), privateKey: a, to: "hex" });
|
|
89
5
|
}
|
|
90
6
|
export {
|
|
91
|
-
|
|
92
|
-
U as parseUrl
|
|
7
|
+
i as signMessage
|
|
93
8
|
};
|
package/dist/index146.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e
|
|
2
|
-
`;exports.presignMessagePrefix=e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index150.cjs"),c=require("./index154.cjs"),o=require("./index143.cjs");async function u(i){const{privateKey:n,transaction:a,serializer:e=c.serializeTransaction}=i,r=a.type==="eip4844"?{...a,sidecars:!1}:a,t=await o.sign({hash:s.keccak256(await e(r)),privateKey:n});return await e(a,t)}exports.signTransaction=u;
|
package/dist/index146.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { keccak256 as e } from "./index150.js";
|
|
2
|
+
import { serializeTransaction as o } from "./index154.js";
|
|
3
|
+
import { sign as c } from "./index143.js";
|
|
4
|
+
async function u(r) {
|
|
5
|
+
const { privateKey: t, transaction: a, serializer: i = o } = r, n = a.type === "eip4844" ? {
|
|
6
|
+
...a,
|
|
7
|
+
sidecars: !1
|
|
8
|
+
} : a, s = await c({
|
|
9
|
+
hash: e(await i(n)),
|
|
10
|
+
privateKey: t
|
|
11
|
+
});
|
|
12
|
+
return await i(a, s);
|
|
13
|
+
}
|
|
3
14
|
export {
|
|
4
|
-
|
|
15
|
+
u as signTransaction
|
|
5
16
|
};
|
package/dist/index147.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index155.cjs"),s=require("./index143.cjs");async function i(e){const{privateKey:t,...a}=e;return await s.sign({hash:n.hashTypedData(a),privateKey:t,to:"hex"})}exports.signTypedData=i;
|
package/dist/index147.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { hashTypedData as o } from "./index155.js";
|
|
2
|
+
import { sign as r } from "./index143.js";
|
|
3
|
+
async function p(t) {
|
|
4
|
+
const { privateKey: a, ...e } = t;
|
|
5
|
+
return await r({
|
|
6
|
+
hash: o(e),
|
|
7
|
+
privateKey: a,
|
|
8
|
+
to: "hex"
|
|
9
|
+
});
|
|
10
|
+
}
|
|
8
11
|
export {
|
|
9
|
-
|
|
10
|
-
t as gweiUnits
|
|
12
|
+
p as signTypedData
|
|
11
13
|
};
|
package/dist/index148.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 s=require("./index35.cjs");class r extends s.BaseError{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}exports.InvalidAddressError=r;
|
package/dist/index148.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { BaseError as r } from "./index35.js";
|
|
2
|
+
class d extends r {
|
|
3
|
+
constructor({ address: s }) {
|
|
4
|
+
super(`Address "${s}" is invalid.`, {
|
|
5
|
+
metaMessages: [
|
|
6
|
+
"- Address must be a hex value of 20 bytes (40 hex characters).",
|
|
7
|
+
"- Address must match its checksum counterpart."
|
|
8
|
+
],
|
|
9
|
+
name: "InvalidAddressError"
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
12
|
}
|
|
13
13
|
export {
|
|
14
|
-
|
|
15
|
-
e as formatAbiParams
|
|
14
|
+
d as InvalidAddressError
|
|
16
15
|
};
|
package/dist/index149.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("./index116.cjs"),i=require("./index102.cjs"),o=/^0x[a-fA-F0-9]{40}$/,t=new c.LruMap(8192);function f(e,n){const{strict:s=!0}=n??{},r=`${e}.${s}`;if(t.has(r))return t.get(r);const u=o.test(e)?e.toLowerCase()===e?!0:s?i.checksumAddress(e)===e:!0:!1;return t.set(r,u),u}exports.isAddress=f;exports.isAddressCache=t;
|
package/dist/index149.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { LruMap as u } from "./index116.js";
|
|
2
|
+
import { checksumAddress as c } from "./index102.js";
|
|
3
|
+
const i = /^0x[a-fA-F0-9]{40}$/, r = /* @__PURE__ */ new u(8192);
|
|
4
|
+
function h(t, s) {
|
|
5
|
+
const { strict: n = !0 } = s ?? {}, e = `${t}.${n}`;
|
|
6
|
+
if (r.has(e))
|
|
7
|
+
return r.get(e);
|
|
8
|
+
const o = i.test(t) ? t.toLowerCase() === t ? !0 : n ? c(t) === t : !0 : !1;
|
|
9
|
+
return r.set(e, o), o;
|
|
4
10
|
}
|
|
5
11
|
export {
|
|
6
|
-
|
|
12
|
+
h as isAddress,
|
|
13
|
+
r as isAddressCache
|
|
7
14
|
};
|
package/dist/index150.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("./index204.cjs"),o=require("./index151.cjs"),i=require("./index140.cjs"),n=require("./index42.cjs");function u(e,r){const s=r||"hex",t=c.keccak_256(o.isHex(e,{strict:!1})?i.toBytes(e):e);return s==="bytes"?t:n.toHex(t)}exports.keccak256=u;
|
package/dist/index150.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
],
|
|
9
|
-
name: "InvalidAddressError"
|
|
10
|
-
});
|
|
11
|
-
}
|
|
1
|
+
import { keccak_256 as c } from "./index204.js";
|
|
2
|
+
import { isHex as i } from "./index151.js";
|
|
3
|
+
import { toBytes as m } from "./index140.js";
|
|
4
|
+
import { toHex as s } from "./index42.js";
|
|
5
|
+
function x(t, r) {
|
|
6
|
+
const e = r || "hex", o = c(i(t, { strict: !1 }) ? m(t) : t);
|
|
7
|
+
return e === "bytes" ? o : s(o);
|
|
12
8
|
}
|
|
13
9
|
export {
|
|
14
|
-
|
|
10
|
+
x as keccak256
|
|
15
11
|
};
|
package/dist/index151.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 r(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}exports.isHex=r;
|
package/dist/index151.js
CHANGED
package/dist/index152.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("./index120.cjs"),u=require("./index140.cjs"),c=require("./index42.cjs"),a=require("./index203.cjs"),h=require("./index150.cjs");function d(e){const{chainId:t,nonce:o,to:r}=e,s=e.contractAddress??e.address,n=h.keccak256(i.concatHex(["0x05",a.toRlp([t?c.numberToHex(t):"0x",s,o?c.numberToHex(o):"0x"])]));return r==="bytes"?u.hexToBytes(n):n}exports.hashAuthorization=d;
|
package/dist/index152.js
CHANGED
|
@@ -1,34 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
],
|
|
18
|
-
name: "Error",
|
|
19
|
-
type: "error"
|
|
20
|
-
}, t = {
|
|
21
|
-
inputs: [
|
|
22
|
-
{
|
|
23
|
-
name: "reason",
|
|
24
|
-
type: "uint256"
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
|
-
name: "Panic",
|
|
28
|
-
type: "error"
|
|
29
|
-
};
|
|
1
|
+
import { concatHex as i } from "./index120.js";
|
|
2
|
+
import { hexToBytes as m } from "./index140.js";
|
|
3
|
+
import { numberToHex as c } from "./index42.js";
|
|
4
|
+
import { toRlp as d } from "./index203.js";
|
|
5
|
+
import { keccak256 as f } from "./index150.js";
|
|
6
|
+
function b(o) {
|
|
7
|
+
const { chainId: t, nonce: r, to: s } = o, e = o.contractAddress ?? o.address, n = f(i([
|
|
8
|
+
"0x05",
|
|
9
|
+
d([
|
|
10
|
+
t ? c(t) : "0x",
|
|
11
|
+
e,
|
|
12
|
+
r ? c(r) : "0x"
|
|
13
|
+
])
|
|
14
|
+
]));
|
|
15
|
+
return s === "bytes" ? m(n) : n;
|
|
16
|
+
}
|
|
30
17
|
export {
|
|
31
|
-
|
|
32
|
-
o as solidityError,
|
|
33
|
-
t as solidityPanic
|
|
18
|
+
b as hashAuthorization
|
|
34
19
|
};
|
package/dist/index153.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 r=require("./index150.cjs"),t=require("./index209.cjs");function a(e,s){return r.keccak256(t.toPrefixedMessage(e),s)}exports.hashMessage=a;
|
package/dist/index153.js
CHANGED
|
@@ -1,24 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { decodeAbiParameters as f } from "./index165.js";
|
|
6
|
-
import { formatAbiItem as p } from "./index148.js";
|
|
7
|
-
function y(n) {
|
|
8
|
-
const { abi: a, data: t } = n, o = e(t, 0, 4);
|
|
9
|
-
if (o === "0x")
|
|
10
|
-
throw new c();
|
|
11
|
-
const r = [...a || [], m, s].find((i) => i.type === "error" && o === u(p(i)));
|
|
12
|
-
if (!r)
|
|
13
|
-
throw new d(o, {
|
|
14
|
-
docsPath: "/docs/contract/decodeErrorResult"
|
|
15
|
-
});
|
|
16
|
-
return {
|
|
17
|
-
abiItem: r,
|
|
18
|
-
args: "inputs" in r && r.inputs && r.inputs.length > 0 ? f(r.inputs, e(t, 4)) : void 0,
|
|
19
|
-
errorName: r.name
|
|
20
|
-
};
|
|
1
|
+
import { keccak256 as o } from "./index150.js";
|
|
2
|
+
import { toPrefixedMessage as t } from "./index209.js";
|
|
3
|
+
function f(e, r) {
|
|
4
|
+
return o(t(e), r);
|
|
21
5
|
}
|
|
22
6
|
export {
|
|
23
|
-
|
|
7
|
+
f as hashMessage
|
|
24
8
|
};
|