@gardenfi/utils 3.1.1-beta.2 → 3.1.1-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/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/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 +24 -11
- package/dist/index218.cjs +1 -1
- package/dist/index218.js +45 -18
- package/dist/index219.cjs +1 -1
- package/dist/index219.js +9 -24
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +8 -8
- package/dist/index220.cjs +1 -1
- package/dist/index220.js +100 -43
- package/dist/index221.cjs +1 -1
- package/dist/index221.js +14 -7
- package/dist/index222.cjs +1 -2
- package/dist/index222.js +213 -40
- package/dist/index223.cjs +2 -1
- package/dist/index223.js +42 -2
- package/dist/index224.cjs +1 -1
- package/dist/index224.js +2 -6
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +5 -10
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +9 -18
- package/dist/index227.cjs +1 -1
- package/dist/index227.js +19 -8
- package/dist/index228.cjs +1 -1
- package/dist/index228.js +8 -66
- package/dist/index229.cjs +1 -1
- package/dist/index229.js +65 -64
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +2 -2
- package/dist/index230.cjs +1 -1
- package/dist/index230.js +60 -183
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +185 -25
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +13 -61
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +54 -18
- package/dist/index234.cjs +1 -1
- package/dist/index234.js +34 -10
- package/dist/index235.cjs +1 -1
- package/dist/index235.js +10 -7
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +13 -11
- package/dist/index237.cjs +1 -1
- package/dist/index237.js +109 -13
- package/dist/index238.cjs +1 -1
- package/dist/index238.js +205 -18
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +40 -106
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +4 -4
- package/dist/index240.cjs +1 -1
- package/dist/index240.js +78 -6
- package/dist/index241.cjs +1 -1
- package/dist/index241.js +2 -7
- package/dist/index242.cjs +1 -1
- package/dist/index242.js +11 -26
- package/dist/index243.cjs +1 -1
- package/dist/index243.js +11 -102
- package/dist/index244.cjs +1 -1
- package/dist/index244.js +18 -15
- package/dist/index245.cjs +1 -1
- package/dist/index245.js +6 -214
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +6 -206
- package/dist/index247.cjs +1 -1
- package/dist/index247.js +25 -41
- package/dist/index248.cjs +1 -1
- package/dist/index248.js +10 -77
- package/dist/index249.cjs +1 -1
- package/dist/index249.js +20 -2
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +2 -2
- package/dist/index251.cjs +1 -1
- package/dist/index251.js +1 -1
- 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 +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +6 -6
- 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 +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 +2 -2
- 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 +3 -3
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +2 -2
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +2 -2
- 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/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
|
};
|
package/dist/index154.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 F=require("./index81.cjs"),G=require("./index215.cjs"),R=require("./index112.cjs"),S=require("./index113.cjs"),B=require("./index114.cjs"),V=require("./index115.cjs"),L=require("./index120.cjs"),h=require("./index105.cjs"),r=require("./index42.cjs"),d=require("./index203.cjs"),y=require("./index212.cjs"),C=require("./index117.cjs"),v=require("./index214.cjs");function k(e,o){const n=C.getTransactionType(e);return n==="eip1559"?_(e,o):n==="eip2930"?j(e,o):n==="eip4844"?Y(e,o):n==="eip7702"?w(e,o):M(e,o)}function w(e,o){const{authorizationList:n,chainId:s,gas:i,nonce:c,to:a,value:x,maxFeePerGas:u,maxPriorityFeePerGas:t,accessList:l,data:T}=e;y.assertTransactionEIP7702(e);const b=v.serializeAccessList(l),m=G.serializeAuthorizationList(n);return L.concatHex(["0x04",d.toRlp([r.numberToHex(s),c?r.numberToHex(c):"0x",t?r.numberToHex(t):"0x",u?r.numberToHex(u):"0x",i?r.numberToHex(i):"0x",a??"0x",x?r.numberToHex(x):"0x",T??"0x",b,m,...z(e,o)])])}function Y(e,o){const{chainId:n,gas:s,nonce:i,to:c,value:a,maxFeePerBlobGas:x,maxFeePerGas:u,maxPriorityFeePerGas:t,accessList:l,data:T}=e;y.assertTransactionEIP4844(e);let b=e.blobVersionedHashes,m=e.sidecars;if(e.blobs&&(typeof b>"u"||typeof m>"u")){const f=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(p=>r.bytesToHex(p)),P=e.kzg,H=R.blobsToCommitments({blobs:f,kzg:P});if(typeof b>"u"&&(b=B.commitmentsToVersionedHashes({commitments:H})),typeof m>"u"){const p=S.blobsToProofs({blobs:f,commitments:H,kzg:P});m=V.toBlobSidecars({blobs:f,commitments:H,proofs:p})}}const I=v.serializeAccessList(l),A=[r.numberToHex(n),i?r.numberToHex(i):"0x",t?r.numberToHex(t):"0x",u?r.numberToHex(u):"0x",s?r.numberToHex(s):"0x",c??"0x",a?r.numberToHex(a):"0x",T??"0x",I,x?r.numberToHex(x):"0x",b??[],...z(e,o)],q=[],g=[],E=[];if(m)for(let f=0;f<m.length;f++){const{blob:P,commitment:H,proof:p}=m[f];q.push(P),g.push(H),E.push(p)}return L.concatHex(["0x03",m?d.toRlp([A,q,g,E]):d.toRlp(A)])}function _(e,o){const{chainId:n,gas:s,nonce:i,to:c,value:a,maxFeePerGas:x,maxPriorityFeePerGas:u,accessList:t,data:l}=e;y.assertTransactionEIP1559(e);const T=v.serializeAccessList(t),b=[r.numberToHex(n),i?r.numberToHex(i):"0x",u?r.numberToHex(u):"0x",x?r.numberToHex(x):"0x",s?r.numberToHex(s):"0x",c??"0x",a?r.numberToHex(a):"0x",l??"0x",T,...z(e,o)];return L.concatHex(["0x02",d.toRlp(b)])}function j(e,o){const{chainId:n,gas:s,data:i,nonce:c,to:a,value:x,accessList:u,gasPrice:t}=e;y.assertTransactionEIP2930(e);const l=v.serializeAccessList(u),T=[r.numberToHex(n),c?r.numberToHex(c):"0x",t?r.numberToHex(t):"0x",s?r.numberToHex(s):"0x",a??"0x",x?r.numberToHex(x):"0x",i??"0x",l,...z(e,o)];return L.concatHex(["0x01",d.toRlp(T)])}function M(e,o){const{chainId:n=0,gas:s,data:i,nonce:c,to:a,value:x,gasPrice:u}=e;y.assertTransactionLegacy(e);let t=[c?r.numberToHex(c):"0x",u?r.numberToHex(u):"0x",s?r.numberToHex(s):"0x",a??"0x",x?r.numberToHex(x):"0x",i??"0x"];if(o){const l=(()=>{if(o.v>=35n)return(o.v-35n)/2n>0?o.v:27n+(o.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+o.v-27n);const m=27n+(o.v===27n?0n:1n);if(o.v!==m)throw new F.InvalidLegacyVError({v:o.v});return m})(),T=h.trim(o.r),b=h.trim(o.s);t=[...t,r.numberToHex(l),T==="0x00"?"0x":T,b==="0x00"?"0x":b]}else n>0&&(t=[...t,r.numberToHex(n),"0x","0x"]);return d.toRlp(t)}function z(e,o){const n=o??e,{v:s,yParity:i}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof s>"u"&&typeof i>"u")return[];const c=h.trim(n.r),a=h.trim(n.s);return[typeof i=="number"?i?r.numberToHex(1):"0x":s===0n?"0x":s===1n?r.numberToHex(1):s===27n?"0x":r.numberToHex(1),c==="0x00"?"0x":c,a==="0x00"?"0x":a]}exports.serializeTransaction=k;exports.toYParitySignatureArray=z;
|