@gardenfi/utils 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +3 -79
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +10 -17
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +19 -11
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +8 -19
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +16 -10
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +638 -33
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +173 -5
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +12 -10
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +128 -2
- package/dist/index109.cjs +2 -1
- package/dist/index109.js +3 -21
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +2 -128
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +2 -7
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +38 -2
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +34 -33
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +5 -5
- package/dist/index115.cjs +1 -2
- package/dist/index115.js +11 -3
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +6 -18
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +15 -638
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +5 -173
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +2 -2
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +11 -11
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +9 -9
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +18 -17
- package/dist/index21.cjs +16 -1
- package/dist/index21.js +112 -30
- package/dist/index22.cjs +1 -16
- package/dist/index22.js +30 -113
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +41 -17
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +44 -6
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +24 -44
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +6 -21
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +13 -8
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +15 -31
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +5 -26
- package/dist/index30.cjs +1 -2
- package/dist/index30.js +13 -65
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +10 -51
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +12 -12
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +11 -24
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +13 -75
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +2 -2
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +55 -7
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +16 -32
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +5 -15
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +9 -2
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +171 -8
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +102 -19
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +21 -41
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +17 -25
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +7 -6
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +20 -12
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +8 -15
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +31 -5
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +26 -13
- package/dist/index49.cjs +2 -1
- package/dist/index49.js +65 -10
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +51 -12
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +12 -11
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +24 -13
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +75 -55
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +7 -16
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +32 -5
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +15 -8
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +2 -172
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +7 -102
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +20 -21
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +38 -10
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +32 -32
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +69 -8
- package/dist/index63.cjs +1 -2
- package/dist/index63.js +110 -57
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +68 -2
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +2 -7
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +16 -6
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +223 -4
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +230 -10
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +12 -3
- package/dist/index70.cjs +1 -5
- package/dist/index70.js +29 -51
- package/dist/index71.cjs +2 -2
- package/dist/index71.js +57 -32
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +21 -5
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +18 -21
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +42 -8
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +8 -10
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +104 -11
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +3 -6
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +17 -13
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +8 -32
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +10 -14
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +11 -64
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +12 -26
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +7 -3
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +78 -3
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +14 -8
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +16 -189
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +191 -18
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +63 -39
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +4 -34
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +51 -43
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +2 -70
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +5 -111
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +11 -67
- package/dist/index93.cjs +5 -1
- package/dist/index93.js +57 -2
- package/dist/index94.cjs +2 -1
- package/dist/index94.js +33 -15
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +5 -223
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +3 -231
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +6 -42
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +30 -102
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +26 -16
- package/package.json +1 -1
package/dist/index22.js
CHANGED
|
@@ -1,116 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
field: "chainId",
|
|
10
|
-
metaMessages: [
|
|
11
|
-
"- Chain ID must be a EIP-155 chain ID.",
|
|
12
|
-
"- See https://eips.ethereum.org/EIPS/eip-155",
|
|
13
|
-
"",
|
|
14
|
-
`Provided value: ${i}`
|
|
15
|
-
]
|
|
16
|
-
});
|
|
17
|
-
if (!(p.test(s) || M.test(s) || x.test(s)))
|
|
18
|
-
throw new e({
|
|
19
|
-
field: "domain",
|
|
20
|
-
metaMessages: [
|
|
21
|
-
"- Domain must be an RFC 3986 authority.",
|
|
22
|
-
"- See https://www.rfc-editor.org/rfc/rfc3986",
|
|
23
|
-
"",
|
|
24
|
-
`Provided value: ${s}`
|
|
25
|
-
]
|
|
26
|
-
});
|
|
27
|
-
if (!A.test(a))
|
|
28
|
-
throw new e({
|
|
29
|
-
field: "nonce",
|
|
30
|
-
metaMessages: [
|
|
31
|
-
"- Nonce must be at least 8 characters.",
|
|
32
|
-
"- Nonce must be alphanumeric.",
|
|
33
|
-
"",
|
|
34
|
-
`Provided value: ${a}`
|
|
35
|
-
]
|
|
36
|
-
});
|
|
37
|
-
if (!$(c))
|
|
38
|
-
throw new e({
|
|
39
|
-
field: "uri",
|
|
40
|
-
metaMessages: [
|
|
41
|
-
"- URI must be a RFC 3986 URI referring to the resource that is the subject of the signing.",
|
|
42
|
-
"- See https://www.rfc-editor.org/rfc/rfc3986",
|
|
43
|
-
"",
|
|
44
|
-
`Provided value: ${c}`
|
|
45
|
-
]
|
|
46
|
-
});
|
|
47
|
-
if (f !== "1")
|
|
48
|
-
throw new e({
|
|
49
|
-
field: "version",
|
|
50
|
-
metaMessages: [
|
|
51
|
-
"- Version must be '1'.",
|
|
52
|
-
"",
|
|
53
|
-
`Provided value: ${f}`
|
|
54
|
-
]
|
|
55
|
-
});
|
|
56
|
-
if (o && !P.test(o))
|
|
57
|
-
throw new e({
|
|
58
|
-
field: "scheme",
|
|
59
|
-
metaMessages: [
|
|
60
|
-
"- Scheme must be an RFC 3986 URI scheme.",
|
|
61
|
-
"- See https://www.rfc-editor.org/rfc/rfc3986#section-3.1",
|
|
62
|
-
"",
|
|
63
|
-
`Provided value: ${o}`
|
|
64
|
-
]
|
|
65
|
-
});
|
|
66
|
-
const t = n.statement;
|
|
67
|
-
if (t != null && t.includes(`
|
|
68
|
-
`))
|
|
69
|
-
throw new e({
|
|
70
|
-
field: "statement",
|
|
71
|
-
metaMessages: [
|
|
72
|
-
"- Statement must not include '\\n'.",
|
|
73
|
-
"",
|
|
74
|
-
`Provided value: ${t}`
|
|
75
|
-
]
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
const l = S(n.address), v = o ? `${o}://${s}` : s, I = n.statement ? `${n.statement}
|
|
79
|
-
` : "", R = `${v} wants you to sign in with your Ethereum account:
|
|
80
|
-
${l}
|
|
81
|
-
|
|
82
|
-
${I}`;
|
|
83
|
-
let r = `URI: ${c}
|
|
84
|
-
Version: ${f}
|
|
85
|
-
Chain ID: ${i}
|
|
86
|
-
Nonce: ${a}
|
|
87
|
-
Issued At: ${g.toISOString()}`;
|
|
88
|
-
if (u && (r += `
|
|
89
|
-
Expiration Time: ${u.toISOString()}`), m && (r += `
|
|
90
|
-
Not Before: ${m.toISOString()}`), h && (r += `
|
|
91
|
-
Request ID: ${h}`), w) {
|
|
92
|
-
let t = `
|
|
93
|
-
Resources:`;
|
|
94
|
-
for (const d of w) {
|
|
95
|
-
if (!$(d))
|
|
96
|
-
throw new e({
|
|
97
|
-
field: "resources",
|
|
98
|
-
metaMessages: [
|
|
99
|
-
"- Every resource must be a RFC 3986 URI.",
|
|
100
|
-
"- See https://www.rfc-editor.org/rfc/rfc3986",
|
|
101
|
-
"",
|
|
102
|
-
`Provided value: ${d}`
|
|
103
|
-
]
|
|
104
|
-
});
|
|
105
|
-
t += `
|
|
106
|
-
- ${d}`;
|
|
1
|
+
import { defineChain as e } from "./index103.js";
|
|
2
|
+
const s = /* @__PURE__ */ e({
|
|
3
|
+
id: 11155111,
|
|
4
|
+
name: "Sepolia",
|
|
5
|
+
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
|
|
6
|
+
rpcUrls: {
|
|
7
|
+
default: {
|
|
8
|
+
http: ["https://sepolia.drpc.org"]
|
|
107
9
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
10
|
+
},
|
|
11
|
+
blockExplorers: {
|
|
12
|
+
default: {
|
|
13
|
+
name: "Etherscan",
|
|
14
|
+
url: "https://sepolia.etherscan.io",
|
|
15
|
+
apiUrl: "https://api-sepolia.etherscan.io/api"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
contracts: {
|
|
19
|
+
multicall3: {
|
|
20
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
21
|
+
blockCreated: 751532
|
|
22
|
+
},
|
|
23
|
+
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
24
|
+
ensUniversalResolver: {
|
|
25
|
+
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
|
26
|
+
blockCreated: 5317080
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
testnet: !0
|
|
30
|
+
});
|
|
114
31
|
export {
|
|
115
|
-
|
|
32
|
+
s as sepolia
|
|
116
33
|
};
|
package/dist/index23.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 j=require("./index63.cjs"),C=require("./index66.cjs"),n=require("./index67.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const k=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),x=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),G=BigInt(1),w=BigInt(2),h=(t,f)=>(t+f/w)/f;function M(t){const f=k,e=BigInt(3),r=BigInt(6),p=BigInt(11),a=BigInt(22),s=BigInt(23),i=BigInt(44),d=BigInt(88),o=t*t*t%f,c=o*o*t%f,g=n.pow2(c,e,f)*c%f,b=n.pow2(g,e,f)*c%f,l=n.pow2(b,w,f)*o%f,B=n.pow2(l,p,f)*l%f,I=n.pow2(B,a,f)*B%f,_=n.pow2(I,i,f)*I%f,P=n.pow2(_,d,f)*_%f,S=n.pow2(P,i,f)*I%f,v=n.pow2(S,e,f)*c%f,E=n.pow2(v,s,f)*B%f,F=n.pow2(E,r,f)*o%f,q=n.pow2(F,w,f);if(!u.eql(u.sqr(q),t))throw new Error("Cannot find square root");return q}const u=n.Field(k,void 0,void 0,{sqrt:M}),m=C.createCurve({a:BigInt(0),b:BigInt(7),Fp:u,n:x,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const f=x,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-G*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),p=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=e,s=BigInt("0x100000000000000000000000000000000"),i=h(a*t,f),d=h(-r*t,f);let o=n.mod(t-i*e-d*p,f),c=n.mod(-i*r-d*a,f);const g=o>s,b=c>s;if(g&&(o=f-o),b&&(c=f-c),o>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:g,k1:o,k2neg:b,k2:c}}}},j.sha256);BigInt(0);m.ProjectivePoint;exports.secp256k1=m;
|
package/dist/index23.js
CHANGED
|
@@ -1,20 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}, { dedupe: !0 }) : o = await e.request({
|
|
12
|
-
method: "eth_getBlockByNumber",
|
|
13
|
-
params: [n || d, a]
|
|
14
|
-
}, { dedupe: !!n }), !o)
|
|
15
|
-
throw new i({ blockHash: t, blockNumber: r });
|
|
16
|
-
return (((c = (s = (m = e.chain) == null ? void 0 : m.formatters) == null ? void 0 : s.block) == null ? void 0 : c.format) || p)(o);
|
|
1
|
+
import { sha256 as C } from "./index63.js";
|
|
2
|
+
import { createCurve as G } from "./index66.js";
|
|
3
|
+
import { Field as N, mod as k, pow2 as t } from "./index67.js";
|
|
4
|
+
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5
|
+
const q = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"), w = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), j = BigInt(1), _ = BigInt(2), h = (n, f) => (n + f / _) / f;
|
|
6
|
+
function M(n) {
|
|
7
|
+
const f = q, e = BigInt(3), r = BigInt(6), I = BigInt(11), a = BigInt(22), s = BigInt(23), i = BigInt(44), g = BigInt(88), o = n * n * n % f, c = o * o * n % f, d = t(c, e, f) * c % f, B = t(d, e, f) * c % f, m = t(B, _, f) * o % f, b = t(m, I, f) * m % f, p = t(b, a, f) * b % f, x = t(p, i, f) * p % f, P = t(x, g, f) * x % f, v = t(P, i, f) * p % f, E = t(v, e, f) * c % f, F = t(E, s, f) * b % f, S = t(F, r, f) * o % f, u = t(S, _, f);
|
|
8
|
+
if (!l.eql(l.sqr(u), n))
|
|
9
|
+
throw new Error("Cannot find square root");
|
|
10
|
+
return u;
|
|
17
11
|
}
|
|
12
|
+
const l = N(q, void 0, void 0, { sqrt: M }), O = G({
|
|
13
|
+
a: BigInt(0),
|
|
14
|
+
// equation params: a, b
|
|
15
|
+
b: BigInt(7),
|
|
16
|
+
Fp: l,
|
|
17
|
+
// Field's prime: 2n**256n - 2n**32n - 2n**9n - 2n**8n - 2n**7n - 2n**6n - 2n**4n - 1n
|
|
18
|
+
n: w,
|
|
19
|
+
// Curve order, total count of valid points in the field
|
|
20
|
+
// Base point (x, y) aka generator point
|
|
21
|
+
Gx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),
|
|
22
|
+
Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),
|
|
23
|
+
h: BigInt(1),
|
|
24
|
+
// Cofactor
|
|
25
|
+
lowS: !0,
|
|
26
|
+
// Allow only low-S signatures by default in sign() and verify()
|
|
27
|
+
endo: {
|
|
28
|
+
// Endomorphism, see above
|
|
29
|
+
beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),
|
|
30
|
+
splitScalar: (n) => {
|
|
31
|
+
const f = w, e = BigInt("0x3086d221a7d46bcde86c90e49284eb15"), r = -j * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"), I = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"), a = e, s = BigInt("0x100000000000000000000000000000000"), i = h(a * n, f), g = h(-r * n, f);
|
|
32
|
+
let o = k(n - i * e - g * I, f), c = k(-i * r - g * a, f);
|
|
33
|
+
const d = o > s, B = c > s;
|
|
34
|
+
if (d && (o = f - o), B && (c = f - c), o > s || c > s)
|
|
35
|
+
throw new Error("splitScalar: Endomorphism failed, k=" + n);
|
|
36
|
+
return { k1neg: d, k1: o, k2neg: B, k2: c };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}, C);
|
|
40
|
+
BigInt(0);
|
|
41
|
+
O.ProjectivePoint;
|
|
18
42
|
export {
|
|
19
|
-
|
|
43
|
+
O as secp256k1
|
|
20
44
|
};
|
package/dist/index24.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 y=require("./index69.cjs"),f=require("./index70.cjs"),x=require("./index35.cjs"),z=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function H(e,n={}){return typeof e=="number"||typeof e=="bigint"?d(e,n):typeof e=="string"?m(e,n):typeof e=="boolean"?b(e,n):u(e,n)}function b(e,n={}){const t=`0x${Number(e)}`;return typeof n.size=="number"?(x.assertSize(t,{size:n.size}),f.pad(t,{size:n.size})):t}function u(e,n={}){let t="";for(let i=0;i<e.length;i++)t+=z[e[i]];const r=`0x${t}`;return typeof n.size=="number"?(x.assertSize(r,{size:n.size}),f.pad(r,{dir:"right",size:n.size})):r}function d(e,n={}){const{signed:t,size:r}=n,i=BigInt(e);let o;r?t?o=(1n<<BigInt(r)*8n-1n)-1n:o=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const c=typeof o=="bigint"&&t?-o-1n:0;if(o&&i>o||i<c){const s=typeof e=="bigint"?"n":"";throw new y.IntegerOutOfRangeError({max:o?`${o}${s}`:void 0,min:`${c}${s}`,signed:t,size:r,value:`${e}${s}`})}const g=`0x${(t&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?f.pad(g,{size:r}):g}const T=new TextEncoder;function m(e,n={}){const t=T.encode(e);return u(t,n)}exports.boolToHex=b;exports.bytesToHex=u;exports.numberToHex=d;exports.stringToHex=m;exports.toHex=H;
|
package/dist/index24.js
CHANGED
|
@@ -1,10 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { IntegerOutOfRangeError as x } from "./index69.js";
|
|
2
|
+
import { pad as s } from "./index70.js";
|
|
3
|
+
import { assertSize as c } from "./index35.js";
|
|
4
|
+
const b = /* @__PURE__ */ Array.from({ length: 256 }, (n, e) => e.toString(16).padStart(2, "0"));
|
|
5
|
+
function B(n, e = {}) {
|
|
6
|
+
return typeof n == "number" || typeof n == "bigint" ? y(n, e) : typeof n == "string" ? $(n, e) : typeof n == "boolean" ? z(n, e) : m(n, e);
|
|
7
|
+
}
|
|
8
|
+
function z(n, e = {}) {
|
|
9
|
+
const t = `0x${Number(n)}`;
|
|
10
|
+
return typeof e.size == "number" ? (c(t, { size: e.size }), s(t, { size: e.size })) : t;
|
|
11
|
+
}
|
|
12
|
+
function m(n, e = {}) {
|
|
13
|
+
let t = "";
|
|
14
|
+
for (let i = 0; i < n.length; i++)
|
|
15
|
+
t += b[n[i]];
|
|
16
|
+
const r = `0x${t}`;
|
|
17
|
+
return typeof e.size == "number" ? (c(r, { size: e.size }), s(r, { dir: "right", size: e.size })) : r;
|
|
18
|
+
}
|
|
19
|
+
function y(n, e = {}) {
|
|
20
|
+
const { signed: t, size: r } = e, i = BigInt(n);
|
|
21
|
+
let o;
|
|
22
|
+
r ? t ? o = (1n << BigInt(r) * 8n - 1n) - 1n : o = 2n ** (BigInt(r) * 8n) - 1n : typeof n == "number" && (o = BigInt(Number.MAX_SAFE_INTEGER));
|
|
23
|
+
const g = typeof o == "bigint" && t ? -o - 1n : 0;
|
|
24
|
+
if (o && i > o || i < g) {
|
|
25
|
+
const f = typeof n == "bigint" ? "n" : "";
|
|
26
|
+
throw new x({
|
|
27
|
+
max: o ? `${o}${f}` : void 0,
|
|
28
|
+
min: `${g}${f}`,
|
|
29
|
+
signed: t,
|
|
30
|
+
size: r,
|
|
31
|
+
value: `${n}${f}`
|
|
32
|
+
});
|
|
6
33
|
}
|
|
34
|
+
const u = `0x${(t && i < 0 ? (1n << BigInt(r * 8)) + BigInt(i) : i).toString(16)}`;
|
|
35
|
+
return r ? s(u, { size: r }) : u;
|
|
36
|
+
}
|
|
37
|
+
const d = /* @__PURE__ */ new TextEncoder();
|
|
38
|
+
function $(n, e = {}) {
|
|
39
|
+
const t = d.encode(n);
|
|
40
|
+
return m(t, e);
|
|
7
41
|
}
|
|
8
42
|
export {
|
|
9
|
-
|
|
43
|
+
z as boolToHex,
|
|
44
|
+
m as bytesToHex,
|
|
45
|
+
y as numberToHex,
|
|
46
|
+
$ as stringToHex,
|
|
47
|
+
B as toHex
|
|
10
48
|
};
|
package/dist/index25.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 n=require("./index32.cjs"),t=require("./index33.cjs");function i(s){if(typeof s=="string"){if(!t.isAddress(s,{strict:!1}))throw new n.InvalidAddressError({address:s});return{address:s,type:"json-rpc"}}if(!t.isAddress(s.address,{strict:!1}))throw new n.InvalidAddressError({address:s.address});return{address:s.address,nonceManager:s.nonceManager,sign:s.sign,signAuthorization:s.signAuthorization,signMessage:s.signMessage,signTransaction:s.signTransaction,signTypedData:s.signTypedData,source:"custom",type:"local"}}exports.toAccount=i;
|
package/dist/index25.js
CHANGED
|
@@ -1,48 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
function m(n, e = {}) {
|
|
13
|
-
let t = "";
|
|
14
|
-
for (let i = 0; i < n.length; i++)
|
|
15
|
-
t += b[n[i]];
|
|
16
|
-
const r = `0x${t}`;
|
|
17
|
-
return typeof e.size == "number" ? (c(r, { size: e.size }), s(r, { dir: "right", size: e.size })) : r;
|
|
18
|
-
}
|
|
19
|
-
function y(n, e = {}) {
|
|
20
|
-
const { signed: t, size: r } = e, i = BigInt(n);
|
|
21
|
-
let o;
|
|
22
|
-
r ? t ? o = (1n << BigInt(r) * 8n - 1n) - 1n : o = 2n ** (BigInt(r) * 8n) - 1n : typeof n == "number" && (o = BigInt(Number.MAX_SAFE_INTEGER));
|
|
23
|
-
const g = typeof o == "bigint" && t ? -o - 1n : 0;
|
|
24
|
-
if (o && i > o || i < g) {
|
|
25
|
-
const f = typeof n == "bigint" ? "n" : "";
|
|
26
|
-
throw new x({
|
|
27
|
-
max: o ? `${o}${f}` : void 0,
|
|
28
|
-
min: `${g}${f}`,
|
|
29
|
-
signed: t,
|
|
30
|
-
size: r,
|
|
31
|
-
value: `${n}${f}`
|
|
32
|
-
});
|
|
1
|
+
import { InvalidAddressError as s } from "./index32.js";
|
|
2
|
+
import { isAddress as a } from "./index33.js";
|
|
3
|
+
function r(n) {
|
|
4
|
+
if (typeof n == "string") {
|
|
5
|
+
if (!a(n, { strict: !1 }))
|
|
6
|
+
throw new s({ address: n });
|
|
7
|
+
return {
|
|
8
|
+
address: n,
|
|
9
|
+
type: "json-rpc"
|
|
10
|
+
};
|
|
33
11
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
12
|
+
if (!a(n.address, { strict: !1 }))
|
|
13
|
+
throw new s({ address: n.address });
|
|
14
|
+
return {
|
|
15
|
+
address: n.address,
|
|
16
|
+
nonceManager: n.nonceManager,
|
|
17
|
+
sign: n.sign,
|
|
18
|
+
signAuthorization: n.signAuthorization,
|
|
19
|
+
signMessage: n.signMessage,
|
|
20
|
+
signTransaction: n.signTransaction,
|
|
21
|
+
signTypedData: n.signTypedData,
|
|
22
|
+
source: "custom",
|
|
23
|
+
type: "local"
|
|
24
|
+
};
|
|
41
25
|
}
|
|
42
26
|
export {
|
|
43
|
-
|
|
44
|
-
m as bytesToHex,
|
|
45
|
-
y as numberToHex,
|
|
46
|
-
$ as stringToHex,
|
|
47
|
-
B as toHex
|
|
27
|
+
r as toAccount
|
|
48
28
|
};
|
package/dist/index26.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("./index42.cjs"),c=require("./index39.cjs");function t(e){const s=c.keccak256(`0x${e.substring(4)}`).substring(26);return r.checksumAddress(`0x${s}`)}exports.publicKeyToAddress=t;
|
package/dist/index26.js
CHANGED
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
baseFeePerGas: e.baseFeePerGas ? BigInt(e.baseFeePerGas) : null,
|
|
7
|
-
blobGasUsed: e.blobGasUsed ? BigInt(e.blobGasUsed) : void 0,
|
|
8
|
-
difficulty: e.difficulty ? BigInt(e.difficulty) : void 0,
|
|
9
|
-
excessBlobGas: e.excessBlobGas ? BigInt(e.excessBlobGas) : void 0,
|
|
10
|
-
gasLimit: e.gasLimit ? BigInt(e.gasLimit) : void 0,
|
|
11
|
-
gasUsed: e.gasUsed ? BigInt(e.gasUsed) : void 0,
|
|
12
|
-
hash: e.hash ? e.hash : null,
|
|
13
|
-
logsBloom: e.logsBloom ? e.logsBloom : null,
|
|
14
|
-
nonce: e.nonce ? e.nonce : null,
|
|
15
|
-
number: e.number ? BigInt(e.number) : null,
|
|
16
|
-
size: e.size ? BigInt(e.size) : void 0,
|
|
17
|
-
timestamp: e.timestamp ? BigInt(e.timestamp) : void 0,
|
|
18
|
-
transactions: s,
|
|
19
|
-
totalDifficulty: e.totalDifficulty ? BigInt(e.totalDifficulty) : null
|
|
20
|
-
};
|
|
1
|
+
import { checksumAddress as e } from "./index42.js";
|
|
2
|
+
import { keccak256 as o } from "./index39.js";
|
|
3
|
+
function d(r) {
|
|
4
|
+
const s = o(`0x${r.substring(4)}`).substring(26);
|
|
5
|
+
return e(`0x${s}`);
|
|
21
6
|
}
|
|
22
7
|
export {
|
|
23
|
-
|
|
8
|
+
d as publicKeyToAddress
|
|
24
9
|
};
|
package/dist/index27.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index23.cjs"),s=require("./index24.cjs"),a=require("./index34.cjs");let l=!1;async function g({hash:t,privateKey:i,to:e="object"}){const{r:u,s:c,recovery:r}=o.secp256k1.sign(t.slice(2),i.slice(2),{lowS:!0,extraEntropy:l}),n={r:s.numberToHex(u,{size:32}),s:s.numberToHex(c,{size:32}),v:r?28n:27n,yParity:r};return e==="bytes"||e==="hex"?a.serializeSignature({...n,to:e}):n}exports.sign=g;
|
package/dist/index27.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { secp256k1 as u } from "./index23.js";
|
|
2
|
+
import { numberToHex as i } from "./index24.js";
|
|
3
|
+
import { serializeSignature as a } from "./index34.js";
|
|
4
|
+
let m = !1;
|
|
5
|
+
async function y({ hash: n, privateKey: s, to: r = "object" }) {
|
|
6
|
+
const { r: o, s: c, recovery: e } = u.sign(n.slice(2), s.slice(2), { lowS: !0, extraEntropy: m }), t = {
|
|
7
|
+
r: i(o, { size: 32 }),
|
|
8
|
+
s: i(c, { size: 32 }),
|
|
9
|
+
v: e ? 28n : 27n,
|
|
10
|
+
yParity: e
|
|
11
|
+
};
|
|
12
|
+
return r === "bytes" || r === "hex" ? a({ ...t, to: r }) : t;
|
|
8
13
|
}
|
|
9
14
|
export {
|
|
10
|
-
|
|
15
|
+
y as sign
|
|
11
16
|
};
|
package/dist/index28.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("./index37.cjs"),a=require("./index27.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/index28.js
CHANGED
|
@@ -1,34 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
async function l(o, { cacheKey: a, cacheTime: n = Number.POSITIVE_INFINITY }) {
|
|
17
|
-
const e = p(a), s = e.response.get();
|
|
18
|
-
if (s && n > 0 && (/* @__PURE__ */ new Date()).getTime() - s.created.getTime() < n)
|
|
19
|
-
return s.data;
|
|
20
|
-
let t = e.promise.get();
|
|
21
|
-
t || (t = o(), e.promise.set(t));
|
|
22
|
-
try {
|
|
23
|
-
const r = await t;
|
|
24
|
-
return e.response.set({ created: /* @__PURE__ */ new Date(), data: r }), r;
|
|
25
|
-
} finally {
|
|
26
|
-
e.promise.clear();
|
|
27
|
-
}
|
|
1
|
+
import { hashAuthorization as a } from "./index37.js";
|
|
2
|
+
import { sign as e } from "./index27.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;
|
|
28
15
|
}
|
|
29
16
|
export {
|
|
30
|
-
|
|
31
|
-
i as promiseCache,
|
|
32
|
-
c as responseCache,
|
|
33
|
-
l as withCache
|
|
17
|
+
u as signAuthorization
|
|
34
18
|
};
|
package/dist/index29.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("./index38.cjs"),n=require("./index27.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/index29.js
CHANGED
|
@@ -1,29 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var i, u, f;
|
|
6
|
-
const m = c || "latest", d = r !== void 0 ? s(r) : void 0;
|
|
7
|
-
let t = null;
|
|
8
|
-
if (o ? t = await e.request({
|
|
9
|
-
method: "eth_getTransactionByHash",
|
|
10
|
-
params: [o]
|
|
11
|
-
}, { dedupe: !0 }) : a ? t = await e.request({
|
|
12
|
-
method: "eth_getTransactionByBlockHashAndIndex",
|
|
13
|
-
params: [a, s(n)]
|
|
14
|
-
}, { dedupe: !0 }) : t = await e.request({
|
|
15
|
-
method: "eth_getTransactionByBlockNumberAndIndex",
|
|
16
|
-
params: [d || m, s(n)]
|
|
17
|
-
}, { dedupe: !!d }), !t)
|
|
18
|
-
throw new p({
|
|
19
|
-
blockHash: a,
|
|
20
|
-
blockNumber: r,
|
|
21
|
-
blockTag: m,
|
|
22
|
-
hash: o,
|
|
23
|
-
index: n
|
|
24
|
-
});
|
|
25
|
-
return (((f = (u = (i = e.chain) == null ? void 0 : i.formatters) == null ? void 0 : u.transaction) == null ? void 0 : f.format) || T)(t);
|
|
1
|
+
import { hashMessage as e } from "./index38.js";
|
|
2
|
+
import { sign as o } from "./index27.js";
|
|
3
|
+
async function i({ message: s, privateKey: a }) {
|
|
4
|
+
return await o({ hash: e(s), privateKey: a, to: "hex" });
|
|
26
5
|
}
|
|
27
6
|
export {
|
|
28
|
-
|
|
7
|
+
i as signMessage
|
|
29
8
|
};
|
package/dist/index30.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./
|
|
2
|
-
`)}class d extends o.BaseError{constructor({v:r}){super(`Invalid \`v\` value "${r}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class l extends o.BaseError{constructor({transaction:r}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",c(r),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class u extends o.BaseError{constructor({storageKey:r}){super(`Size for storage key "${r}" is invalid. Expected 32 bytes. Got ${Math.floor((r.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class T extends o.BaseError{constructor({blockHash:r,blockNumber:s,blockTag:a,hash:e,index:n}){let i="Transaction";a&&n!==void 0&&(i=`Transaction at block time "${a}" at index "${n}"`),r&&n!==void 0&&(i=`Transaction at block hash "${r}" at index "${n}"`),s&&n!==void 0&&(i=`Transaction at block number "${s}" at index "${n}"`),e&&(i=`Transaction with hash "${e}"`),super(`${i} could not be found.`,{name:"TransactionNotFoundError"})}}class E extends o.BaseError{constructor({hash:r}){super(`Transaction receipt with hash "${r}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class p extends o.BaseError{constructor({hash:r}){super(`Timed out while waiting for transaction with hash "${r}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}exports.InvalidLegacyVError=d;exports.InvalidSerializableTransactionError=l;exports.InvalidStorageKeySizeError=u;exports.TransactionNotFoundError=T;exports.TransactionReceiptNotFoundError=E;exports.WaitForTransactionReceiptTimeoutError=p;exports.prettyPrint=c;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index39.cjs"),c=require("./index40.cjs"),o=require("./index27.cjs");async function u(i){const{privateKey:r,transaction:e,serializer:n=c.serializeTransaction}=i,a=e.type==="eip4844"?{...e,sidecars:!1}:e,s=await o.sign({hash:t.keccak256(n(a)),privateKey:r});return n(e,s)}exports.signTransaction=u;
|
package/dist/index30.js
CHANGED
|
@@ -1,68 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
class l extends o {
|
|
15
|
-
constructor({ transaction: r }) {
|
|
16
|
-
super("Cannot infer a transaction type from provided transaction.", {
|
|
17
|
-
metaMessages: [
|
|
18
|
-
"Provided Transaction:",
|
|
19
|
-
"{",
|
|
20
|
-
c(r),
|
|
21
|
-
"}",
|
|
22
|
-
"",
|
|
23
|
-
"To infer the type, either provide:",
|
|
24
|
-
"- a `type` to the Transaction, or",
|
|
25
|
-
"- an EIP-1559 Transaction with `maxFeePerGas`, or",
|
|
26
|
-
"- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
|
|
27
|
-
"- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
|
|
28
|
-
"- an EIP-7702 Transaction with `authorizationList`, or",
|
|
29
|
-
"- a Legacy Transaction with `gasPrice`"
|
|
30
|
-
],
|
|
31
|
-
name: "InvalidSerializableTransactionError"
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
class T extends o {
|
|
36
|
-
constructor({ storageKey: r }) {
|
|
37
|
-
super(`Size for storage key "${r}" is invalid. Expected 32 bytes. Got ${Math.floor((r.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
class h extends o {
|
|
41
|
-
constructor({ blockHash: r, blockNumber: s, blockTag: t, hash: n, index: a }) {
|
|
42
|
-
let i = "Transaction";
|
|
43
|
-
t && a !== void 0 && (i = `Transaction at block time "${t}" at index "${a}"`), r && a !== void 0 && (i = `Transaction at block hash "${r}" at index "${a}"`), s && a !== void 0 && (i = `Transaction at block number "${s}" at index "${a}"`), n && (i = `Transaction with hash "${n}"`), super(`${i} could not be found.`, {
|
|
44
|
-
name: "TransactionNotFoundError"
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
class p extends o {
|
|
49
|
-
constructor({ hash: r }) {
|
|
50
|
-
super(`Transaction receipt with hash "${r}" could not be found. The Transaction may not be processed on a block yet.`, {
|
|
51
|
-
name: "TransactionReceiptNotFoundError"
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
class f extends o {
|
|
56
|
-
constructor({ hash: r }) {
|
|
57
|
-
super(`Timed out while waiting for transaction with hash "${r}" to be confirmed.`, { name: "WaitForTransactionReceiptTimeoutError" });
|
|
58
|
-
}
|
|
1
|
+
import { keccak256 as e } from "./index39.js";
|
|
2
|
+
import { serializeTransaction as o } from "./index40.js";
|
|
3
|
+
import { sign as c } from "./index27.js";
|
|
4
|
+
async function u(n) {
|
|
5
|
+
const { privateKey: a, transaction: r, serializer: i = o } = n, t = r.type === "eip4844" ? {
|
|
6
|
+
...r,
|
|
7
|
+
sidecars: !1
|
|
8
|
+
} : r, s = await c({
|
|
9
|
+
hash: e(i(t)),
|
|
10
|
+
privateKey: a
|
|
11
|
+
});
|
|
12
|
+
return i(r, s);
|
|
59
13
|
}
|
|
60
14
|
export {
|
|
61
|
-
u as
|
|
62
|
-
l as InvalidSerializableTransactionError,
|
|
63
|
-
T as InvalidStorageKeySizeError,
|
|
64
|
-
h as TransactionNotFoundError,
|
|
65
|
-
p as TransactionReceiptNotFoundError,
|
|
66
|
-
f as WaitForTransactionReceiptTimeoutError,
|
|
67
|
-
c as prettyPrint
|
|
15
|
+
u as signTransaction
|
|
68
16
|
};
|