@gardenfi/core 0.2.0-beta.70 → 0.2.0-beta.71
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/index.cjs +1 -31
- package/dist/index.js +27 -7808
- package/dist/index10.cjs +1 -0
- package/dist/index10.js +101 -0
- package/dist/index100.cjs +1 -0
- package/dist/index100.js +37 -0
- package/dist/index101.cjs +1 -0
- package/dist/index101.js +369 -0
- package/dist/index102.cjs +1 -0
- package/dist/index102.js +23 -0
- package/dist/index103.cjs +1 -0
- package/dist/index103.js +58 -0
- package/dist/index104.cjs +1 -0
- package/dist/index104.js +5 -0
- package/dist/index105.cjs +1 -0
- package/dist/index105.js +51 -0
- package/dist/index106.cjs +1 -0
- package/dist/index106.js +28 -0
- package/dist/index107.cjs +1 -0
- package/dist/index107.js +4 -0
- package/dist/index108.cjs +1 -0
- package/dist/index108.js +4 -0
- package/dist/index109.cjs +1 -0
- package/dist/index109.js +64 -0
- package/dist/index11.cjs +20 -0
- package/dist/index11.js +380 -0
- package/dist/index110.cjs +1 -0
- package/dist/index110.js +37 -0
- package/dist/index111.cjs +1 -0
- package/dist/index111.js +4 -0
- package/dist/index112.cjs +1 -0
- package/dist/index112.js +60 -0
- package/dist/index113.cjs +1 -0
- package/dist/index113.js +4 -0
- package/dist/index114.cjs +1 -0
- package/dist/index114.js +42 -0
- package/dist/index115.cjs +1 -0
- package/dist/index115.js +45 -0
- package/dist/index116.cjs +1 -0
- package/dist/index116.js +20 -0
- package/dist/index117.cjs +1 -0
- package/dist/index117.js +111 -0
- package/dist/index118.cjs +1 -0
- package/dist/index118.js +23 -0
- package/dist/index119.cjs +1 -0
- package/dist/index119.js +228 -0
- package/dist/index12.cjs +1 -0
- package/dist/index12.js +22 -0
- package/dist/index120.cjs +1 -0
- package/dist/index120.js +6 -0
- package/dist/index121.cjs +1 -0
- package/dist/index121.js +160 -0
- package/dist/index122.cjs +1 -0
- package/dist/index122.js +4 -0
- package/dist/index123.cjs +1 -0
- package/dist/index123.js +75 -0
- package/dist/index124.cjs +1 -0
- package/dist/index124.js +7 -0
- package/dist/index125.cjs +1 -0
- package/dist/index125.js +107 -0
- package/dist/index126.cjs +1 -0
- package/dist/index126.js +15 -0
- package/dist/index127.cjs +1 -0
- package/dist/index127.js +35 -0
- package/dist/index128.cjs +1 -0
- package/dist/index128.js +32 -0
- package/dist/index129.cjs +1 -0
- package/dist/index129.js +4 -0
- package/dist/index13.cjs +1 -0
- package/dist/index13.js +396 -0
- package/dist/index130.cjs +1 -0
- package/dist/index130.js +21 -0
- package/dist/index131.cjs +1 -0
- package/dist/index131.js +4 -0
- package/dist/index132.cjs +1 -0
- package/dist/index132.js +358 -0
- package/dist/index133.cjs +1 -0
- package/dist/index133.js +241 -0
- package/dist/index134.cjs +1 -0
- package/dist/index134.js +70 -0
- package/dist/index135.cjs +1 -0
- package/dist/index135.js +64 -0
- package/dist/index136.cjs +1 -0
- package/dist/index136.js +14 -0
- package/dist/index137.cjs +1 -0
- package/dist/index137.js +47 -0
- package/dist/index138.cjs +1 -0
- package/dist/index138.js +65 -0
- package/dist/index139.cjs +1 -0
- package/dist/index139.js +228 -0
- package/dist/index14.cjs +1 -0
- package/dist/index14.js +23 -0
- package/dist/index140.cjs +1 -0
- package/dist/index140.js +5 -0
- package/dist/index141.cjs +1 -0
- package/dist/index141.js +171 -0
- package/dist/index142.cjs +1 -0
- package/dist/index142.js +30 -0
- package/dist/index143.cjs +1 -0
- package/dist/index143.js +23 -0
- package/dist/index144.cjs +1 -0
- package/dist/index144.js +72 -0
- package/dist/index145.cjs +1 -0
- package/dist/index145.js +130 -0
- package/dist/index146.cjs +1 -0
- package/dist/index146.js +9 -0
- package/dist/index147.cjs +1 -0
- package/dist/index147.js +4 -0
- package/dist/index148.cjs +1 -0
- package/dist/index148.js +28 -0
- package/dist/index149.cjs +1 -0
- package/dist/index149.js +4 -0
- package/dist/index15.cjs +1 -0
- package/dist/index15.js +4 -0
- package/dist/index16.cjs +1 -0
- package/dist/index16.js +34 -0
- package/dist/index17.cjs +1 -0
- package/dist/index17.js +27 -0
- package/dist/index18.cjs +1 -0
- package/dist/index18.js +33 -0
- package/dist/index19.cjs +1 -0
- package/dist/index19.js +32 -0
- package/dist/index2.cjs +1 -0
- package/dist/index2.js +412 -0
- package/dist/index20.cjs +1 -0
- package/dist/index20.js +55 -0
- package/dist/index21.cjs +1 -0
- package/dist/index21.js +30 -0
- package/dist/index22.cjs +1 -0
- package/dist/index22.js +17 -0
- package/dist/index23.cjs +1 -0
- package/dist/index23.js +11 -0
- package/dist/index24.cjs +1 -0
- package/dist/index24.js +11 -0
- package/dist/index25.cjs +1 -0
- package/dist/index25.js +140 -0
- package/dist/index26.cjs +1 -0
- package/dist/index26.js +4 -0
- package/dist/index27.cjs +1 -0
- package/dist/index27.js +15 -0
- package/dist/index28.cjs +1 -0
- package/dist/index28.js +39 -0
- package/dist/index29.cjs +1 -0
- package/dist/index29.js +44 -0
- package/dist/index3.cjs +1 -0
- package/dist/index3.js +5 -0
- package/dist/index30.cjs +1 -0
- package/dist/index30.js +26 -0
- package/dist/index31.cjs +1 -0
- package/dist/index31.js +28 -0
- package/dist/index32.cjs +1 -0
- package/dist/index32.js +57 -0
- package/dist/index33.cjs +1 -0
- package/dist/index33.js +30 -0
- package/dist/index34.cjs +3 -0
- package/dist/index34.js +30 -0
- package/dist/index35.cjs +1 -0
- package/dist/index35.js +17 -0
- package/dist/index36.cjs +2 -0
- package/dist/index36.js +27 -0
- package/dist/index37.cjs +1 -0
- package/dist/index37.js +43 -0
- package/dist/index38.cjs +1 -0
- package/dist/index38.js +201 -0
- package/dist/index39.cjs +1 -0
- package/dist/index39.js +4 -0
- package/dist/index4.cjs +1 -0
- package/dist/index4.js +18 -0
- package/dist/index40.cjs +1 -0
- package/dist/index40.js +4 -0
- package/dist/index41.cjs +1 -0
- package/dist/index41.js +4 -0
- package/dist/index42.cjs +1 -0
- package/dist/index42.js +15 -0
- package/dist/index43.cjs +1 -0
- package/dist/index43.js +14 -0
- package/dist/index44.cjs +1 -0
- package/dist/index44.js +6 -0
- package/dist/index45.cjs +1 -0
- package/dist/index45.js +48 -0
- package/dist/index46.cjs +1 -0
- package/dist/index46.js +45 -0
- package/dist/index47.cjs +1 -0
- package/dist/index47.js +174 -0
- package/dist/index48.cjs +1 -0
- package/dist/index48.js +15 -0
- package/dist/index49.cjs +1 -0
- package/dist/index49.js +7 -0
- package/dist/index5.cjs +1 -0
- package/dist/index5.js +110 -0
- package/dist/index50.cjs +1 -0
- package/dist/index50.js +19 -0
- package/dist/index51.cjs +1 -0
- package/dist/index51.js +14 -0
- package/dist/index52.cjs +1 -0
- package/dist/index52.js +177 -0
- package/dist/index53.cjs +1 -0
- package/dist/index53.js +24 -0
- package/dist/index54.cjs +1 -0
- package/dist/index54.js +4 -0
- package/dist/index55.cjs +1 -0
- package/dist/index55.js +37 -0
- package/dist/index56.cjs +1 -0
- package/dist/index56.js +11 -0
- package/dist/index57.cjs +1 -0
- package/dist/index57.js +37 -0
- package/dist/index58.cjs +1 -0
- package/dist/index58.js +58 -0
- package/dist/index59.cjs +2 -0
- package/dist/index59.js +62 -0
- package/dist/index6.cjs +1 -0
- package/dist/index6.js +5 -0
- package/dist/index60.cjs +1 -0
- package/dist/index60.js +6 -0
- package/dist/index61.cjs +1 -0
- package/dist/index61.js +130 -0
- package/dist/index62.cjs +2 -0
- package/dist/index62.js +45 -0
- package/dist/index63.cjs +1 -0
- package/dist/index63.js +11 -0
- package/dist/index64.cjs +1 -0
- package/dist/index64.js +13 -0
- package/dist/index65.cjs +1 -0
- package/dist/index65.js +14 -0
- package/dist/index66.cjs +1 -0
- package/dist/index66.js +16 -0
- package/dist/index67.cjs +1 -0
- package/dist/index67.js +9 -0
- package/dist/index68.cjs +1 -0
- package/dist/index68.js +20 -0
- package/dist/index69.cjs +1 -0
- package/dist/index69.js +81 -0
- package/dist/index7.cjs +1 -0
- package/dist/index7.js +76 -0
- package/dist/index70.cjs +1 -0
- package/dist/index70.js +17 -0
- package/dist/index71.cjs +1 -0
- package/dist/index71.js +21 -0
- package/dist/index72.cjs +1 -0
- package/dist/index72.js +24 -0
- package/dist/index73.cjs +1 -0
- package/dist/index73.js +16 -0
- package/dist/index74.cjs +1 -0
- package/dist/index74.js +4 -0
- package/dist/index75.cjs +1 -0
- package/dist/index75.js +4 -0
- package/dist/index76.cjs +1 -0
- package/dist/index76.js +9 -0
- package/dist/index77.cjs +2 -0
- package/dist/index77.js +37 -0
- package/dist/index78.cjs +1 -0
- package/dist/index78.js +8 -0
- package/dist/index79.cjs +1 -0
- package/dist/index79.js +22 -0
- package/dist/index8.cjs +1 -0
- package/dist/index8.js +62 -0
- package/dist/index80.cjs +1 -0
- package/dist/index80.js +34 -0
- package/dist/index81.cjs +1 -0
- package/dist/index81.js +4 -0
- package/dist/index82.cjs +6 -0
- package/dist/index82.js +949 -0
- package/dist/index83.cjs +1 -0
- package/dist/index83.js +4 -0
- package/dist/index84.cjs +1 -0
- package/dist/index84.js +64 -0
- package/dist/index85.cjs +1 -0
- package/dist/index85.js +35 -0
- package/dist/index86.cjs +1 -0
- package/dist/index86.js +89 -0
- package/dist/index87.cjs +1 -0
- package/dist/index87.js +15 -0
- package/dist/index88.cjs +1 -0
- package/dist/index88.js +9 -0
- package/dist/index89.cjs +1 -0
- package/dist/index89.js +115 -0
- package/dist/index9.cjs +1 -0
- package/dist/index9.js +63 -0
- package/dist/index90.cjs +1 -0
- package/dist/index90.js +9 -0
- package/dist/index91.cjs +1 -0
- package/dist/index91.js +35 -0
- package/dist/index92.cjs +1 -0
- package/dist/index92.js +4 -0
- package/dist/index93.cjs +1 -0
- package/dist/index93.js +40 -0
- package/dist/index94.cjs +1 -0
- package/dist/index94.js +31 -0
- package/dist/index95.cjs +1 -0
- package/dist/index95.js +23 -0
- package/dist/index96.cjs +1 -0
- package/dist/index96.js +9 -0
- package/dist/index97.cjs +1 -0
- package/dist/index97.js +7 -0
- package/dist/index98.cjs +1 -0
- package/dist/index98.js +13 -0
- package/dist/index99.cjs +1 -0
- package/dist/index99.js +22 -0
- package/package.json +2 -2
package/dist/index25.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
var v = Object.defineProperty;
|
|
2
|
+
var k = (e, n, f) => n in e ? v(e, n, { enumerable: !0, configurable: !0, writable: !0, value: f }) : e[n] = f;
|
|
3
|
+
var y = (e, n, f) => k(e, typeof n != "symbol" ? n + "" : n, f);
|
|
4
|
+
import { __exports as p } from "./index26.js";
|
|
5
|
+
import "./index34.js";
|
|
6
|
+
import "./index35.js";
|
|
7
|
+
import { b } from "./index36.js";
|
|
8
|
+
import { w as P } from "./index37.js";
|
|
9
|
+
import "./index38.js";
|
|
10
|
+
import { __exports as K } from "./index39.js";
|
|
11
|
+
import { __exports as g } from "./index40.js";
|
|
12
|
+
import { __exports as E } from "./index41.js";
|
|
13
|
+
Object.defineProperty(p, "__esModule", { value: !0 });
|
|
14
|
+
p.ECPairFactory = p.networks = void 0;
|
|
15
|
+
const c = K;
|
|
16
|
+
p.networks = c;
|
|
17
|
+
const s = g, x = b, m = P, B = E, u = s.typeforce.maybe(
|
|
18
|
+
s.typeforce.compile({
|
|
19
|
+
compressed: s.maybe(s.Boolean),
|
|
20
|
+
network: s.maybe(s.Network)
|
|
21
|
+
})
|
|
22
|
+
), D = (e) => e.length === 32 ? e : e.slice(1, 33);
|
|
23
|
+
function F(e) {
|
|
24
|
+
(0, B.testEcc)(e);
|
|
25
|
+
function n(o) {
|
|
26
|
+
return e.isPoint(o);
|
|
27
|
+
}
|
|
28
|
+
function f(o, r) {
|
|
29
|
+
if (s.typeforce(s.Buffer256bit, o), !e.isPrivate(o))
|
|
30
|
+
throw new TypeError("Private key not in range [1, n)");
|
|
31
|
+
return s.typeforce(u, r), new d(o, void 0, r);
|
|
32
|
+
}
|
|
33
|
+
function h(o, r) {
|
|
34
|
+
return s.typeforce(e.isPoint, o), s.typeforce(u, r), new d(void 0, o, r);
|
|
35
|
+
}
|
|
36
|
+
function l(o, r) {
|
|
37
|
+
const t = m.decode(o), i = t.version;
|
|
38
|
+
if (s.Array(r)) {
|
|
39
|
+
if (r = r.filter((a) => i === a.wif).pop(), !r) throw new Error("Unknown network version");
|
|
40
|
+
} else if (r = r || c.bitcoin, i !== r.wif) throw new Error("Invalid network version");
|
|
41
|
+
return f(t.privateKey, {
|
|
42
|
+
compressed: t.compressed,
|
|
43
|
+
network: r
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function _(o) {
|
|
47
|
+
s.typeforce(u, o), o === void 0 && (o = {});
|
|
48
|
+
const r = o.rng || x;
|
|
49
|
+
let t;
|
|
50
|
+
do
|
|
51
|
+
t = r(32), s.typeforce(s.Buffer256bit, t);
|
|
52
|
+
while (!e.isPrivate(t));
|
|
53
|
+
return f(t, o);
|
|
54
|
+
}
|
|
55
|
+
class d {
|
|
56
|
+
constructor(r, t, i) {
|
|
57
|
+
y(this, "__D");
|
|
58
|
+
y(this, "__Q");
|
|
59
|
+
y(this, "compressed");
|
|
60
|
+
y(this, "network");
|
|
61
|
+
y(this, "lowR");
|
|
62
|
+
this.__D = r, this.__Q = t, this.lowR = !1, i === void 0 && (i = {}), this.compressed = i.compressed === void 0 ? !0 : i.compressed, this.network = i.network || c.bitcoin, t !== void 0 && (this.__Q = Buffer.from(e.pointCompress(t, this.compressed)));
|
|
63
|
+
}
|
|
64
|
+
get privateKey() {
|
|
65
|
+
return this.__D;
|
|
66
|
+
}
|
|
67
|
+
get publicKey() {
|
|
68
|
+
if (!this.__Q) {
|
|
69
|
+
const r = e.pointFromScalar(this.__D, this.compressed);
|
|
70
|
+
this.__Q = Buffer.from(r);
|
|
71
|
+
}
|
|
72
|
+
return this.__Q;
|
|
73
|
+
}
|
|
74
|
+
toWIF() {
|
|
75
|
+
if (!this.__D) throw new Error("Missing private key");
|
|
76
|
+
return m.encode(this.network.wif, this.__D, this.compressed);
|
|
77
|
+
}
|
|
78
|
+
tweak(r) {
|
|
79
|
+
return this.privateKey ? this.tweakFromPrivateKey(r) : this.tweakFromPublicKey(r);
|
|
80
|
+
}
|
|
81
|
+
sign(r, t) {
|
|
82
|
+
if (!this.__D) throw new Error("Missing private key");
|
|
83
|
+
if (t === void 0 && (t = this.lowR), t === !1)
|
|
84
|
+
return Buffer.from(e.sign(r, this.__D));
|
|
85
|
+
{
|
|
86
|
+
let i = e.sign(r, this.__D);
|
|
87
|
+
const a = Buffer.alloc(32, 0);
|
|
88
|
+
let w = 0;
|
|
89
|
+
for (; i[0] > 127; )
|
|
90
|
+
w++, a.writeUIntLE(w, 0, 6), i = e.sign(r, this.__D, a);
|
|
91
|
+
return Buffer.from(i);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
signSchnorr(r) {
|
|
95
|
+
if (!this.privateKey) throw new Error("Missing private key");
|
|
96
|
+
if (!e.signSchnorr)
|
|
97
|
+
throw new Error("signSchnorr not supported by ecc library");
|
|
98
|
+
return Buffer.from(e.signSchnorr(r, this.privateKey));
|
|
99
|
+
}
|
|
100
|
+
verify(r, t) {
|
|
101
|
+
return e.verify(r, this.publicKey, t);
|
|
102
|
+
}
|
|
103
|
+
verifySchnorr(r, t) {
|
|
104
|
+
if (!e.verifySchnorr)
|
|
105
|
+
throw new Error("verifySchnorr not supported by ecc library");
|
|
106
|
+
return e.verifySchnorr(r, this.publicKey.subarray(1, 33), t);
|
|
107
|
+
}
|
|
108
|
+
tweakFromPublicKey(r) {
|
|
109
|
+
const t = D(this.publicKey), i = e.xOnlyPointAddTweak(t, r);
|
|
110
|
+
if (!i || i.xOnlyPubkey === null)
|
|
111
|
+
throw new Error("Cannot tweak public key!");
|
|
112
|
+
const a = Buffer.from([
|
|
113
|
+
i.parity === 0 ? 2 : 3
|
|
114
|
+
]);
|
|
115
|
+
return h(
|
|
116
|
+
Buffer.concat([a, i.xOnlyPubkey]),
|
|
117
|
+
{ network: this.network, compressed: this.compressed }
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
tweakFromPrivateKey(r) {
|
|
121
|
+
const i = this.publicKey[0] === 3 || this.publicKey[0] === 4 && (this.publicKey[64] & 1) === 1 ? e.privateNegate(this.privateKey) : this.privateKey, a = e.privateAdd(i, r);
|
|
122
|
+
if (!a) throw new Error("Invalid tweaked private key!");
|
|
123
|
+
return f(Buffer.from(a), {
|
|
124
|
+
network: this.network,
|
|
125
|
+
compressed: this.compressed
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
isPoint: n,
|
|
131
|
+
fromPrivateKey: f,
|
|
132
|
+
fromPublicKey: h,
|
|
133
|
+
fromWIF: l,
|
|
134
|
+
makeRandom: _
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
p.ECPairFactory = F;
|
|
138
|
+
export {
|
|
139
|
+
p as default
|
|
140
|
+
};
|
package/dist/index26.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
package/dist/index26.js
ADDED
package/dist/index27.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}};exports.contracts=s;
|
package/dist/index27.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const s = {
|
|
2
|
+
gasPriceOracle: { address: "0x420000000000000000000000000000000000000F" },
|
|
3
|
+
l1Block: { address: "0x4200000000000000000000000000000000000015" },
|
|
4
|
+
l2CrossDomainMessenger: {
|
|
5
|
+
address: "0x4200000000000000000000000000000000000007"
|
|
6
|
+
},
|
|
7
|
+
l2Erc721Bridge: { address: "0x4200000000000000000000000000000000000014" },
|
|
8
|
+
l2StandardBridge: { address: "0x4200000000000000000000000000000000000010" },
|
|
9
|
+
l2ToL1MessagePasser: {
|
|
10
|
+
address: "0x4200000000000000000000000000000000000016"
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
s as contracts
|
|
15
|
+
};
|
package/dist/index28.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index30.cjs"),c=require("./index31.cjs"),r=require("./index32.cjs"),l=require("./index33.cjs"),a={block:c.defineBlock({format(e){var s;return{transactions:(s=e.transactions)==null?void 0:s.map(t=>{if(typeof t=="string")return t;const i=r.formatTransaction(t);return i.typeHex==="0x7e"&&(i.isSystemTx=t.isSystemTx,i.mint=t.mint?o.hexToBigInt(t.mint):void 0,i.sourceHash=t.sourceHash,i.type="deposit"),i}),stateRoot:e.stateRoot}}}),transaction:r.defineTransaction({format(e){const n={};return e.type==="0x7e"&&(n.isSystemTx=e.isSystemTx,n.mint=e.mint?o.hexToBigInt(e.mint):void 0,n.sourceHash=e.sourceHash,n.type="deposit"),n}}),transactionReceipt:l.defineTransactionReceipt({format(e){return{l1GasPrice:e.l1GasPrice?o.hexToBigInt(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?o.hexToBigInt(e.l1GasUsed):null,l1Fee:e.l1Fee?o.hexToBigInt(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};exports.formatters=a;
|
package/dist/index28.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { hexToBigInt as n } from "./index30.js";
|
|
2
|
+
import { defineBlock as s } from "./index31.js";
|
|
3
|
+
import { formatTransaction as m, defineTransaction as l } from "./index32.js";
|
|
4
|
+
import { defineTransactionReceipt as c } from "./index33.js";
|
|
5
|
+
const d = {
|
|
6
|
+
block: /* @__PURE__ */ s({
|
|
7
|
+
format(e) {
|
|
8
|
+
var r;
|
|
9
|
+
return {
|
|
10
|
+
transactions: (r = e.transactions) == null ? void 0 : r.map((t) => {
|
|
11
|
+
if (typeof t == "string")
|
|
12
|
+
return t;
|
|
13
|
+
const i = m(t);
|
|
14
|
+
return i.typeHex === "0x7e" && (i.isSystemTx = t.isSystemTx, i.mint = t.mint ? n(t.mint) : void 0, i.sourceHash = t.sourceHash, i.type = "deposit"), i;
|
|
15
|
+
}),
|
|
16
|
+
stateRoot: e.stateRoot
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}),
|
|
20
|
+
transaction: /* @__PURE__ */ l({
|
|
21
|
+
format(e) {
|
|
22
|
+
const o = {};
|
|
23
|
+
return e.type === "0x7e" && (o.isSystemTx = e.isSystemTx, o.mint = e.mint ? n(e.mint) : void 0, o.sourceHash = e.sourceHash, o.type = "deposit"), o;
|
|
24
|
+
}
|
|
25
|
+
}),
|
|
26
|
+
transactionReceipt: /* @__PURE__ */ c({
|
|
27
|
+
format(e) {
|
|
28
|
+
return {
|
|
29
|
+
l1GasPrice: e.l1GasPrice ? n(e.l1GasPrice) : null,
|
|
30
|
+
l1GasUsed: e.l1GasUsed ? n(e.l1GasUsed) : null,
|
|
31
|
+
l1Fee: e.l1Fee ? n(e.l1Fee) : null,
|
|
32
|
+
l1FeeScalar: e.l1FeeScalar ? Number(e.l1FeeScalar) : null
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
d as formatters
|
|
39
|
+
};
|
package/dist/index29.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index42.cjs"),c=require("./index43.cjs"),T=require("./index44.cjs"),t=require("./index45.cjs"),z=require("./index46.cjs"),H=require("./index47.cjs");function d(e,r){return y(e)?m(e):H.serializeTransaction(e,r)}const q={transaction:d};function m(e){u(e);const{sourceHash:r,data:s,from:l,gas:i,isSystemTx:f,mint:o,to:x,value:n}=e,p=[r,l,x??"0x",o?t.toHex(o):"0x",n?t.toHex(n):"0x",i?t.toHex(i):"0x",f?"0x1":"0x",s??"0x"];return T.concatHex(["0x7e",z.toRlp(p)])}function y(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function u(e){const{from:r,to:s}=e;if(r&&!c.isAddress(r))throw new a.InvalidAddressError({address:r});if(s&&!c.isAddress(s))throw new a.InvalidAddressError({address:s})}exports.assertTransactionDeposit=u;exports.serializeTransaction=d;exports.serializers=q;
|
package/dist/index29.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { InvalidAddressError as a } from "./index42.js";
|
|
2
|
+
import { isAddress as f } from "./index43.js";
|
|
3
|
+
import { concatHex as p } from "./index44.js";
|
|
4
|
+
import { toHex as i } from "./index45.js";
|
|
5
|
+
import { toRlp as x } from "./index46.js";
|
|
6
|
+
import { serializeTransaction as l } from "./index47.js";
|
|
7
|
+
function T(r, e) {
|
|
8
|
+
return h(r) ? z(r) : l(r, e);
|
|
9
|
+
}
|
|
10
|
+
const E = {
|
|
11
|
+
transaction: T
|
|
12
|
+
};
|
|
13
|
+
function z(r) {
|
|
14
|
+
w(r);
|
|
15
|
+
const { sourceHash: e, data: o, from: m, gas: t, isSystemTx: u, mint: s, to: c, value: n } = r, d = [
|
|
16
|
+
e,
|
|
17
|
+
m,
|
|
18
|
+
c ?? "0x",
|
|
19
|
+
s ? i(s) : "0x",
|
|
20
|
+
n ? i(n) : "0x",
|
|
21
|
+
t ? i(t) : "0x",
|
|
22
|
+
u ? "0x1" : "0x",
|
|
23
|
+
o ?? "0x"
|
|
24
|
+
];
|
|
25
|
+
return p([
|
|
26
|
+
"0x7e",
|
|
27
|
+
x(d)
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
function h(r) {
|
|
31
|
+
return r.type === "deposit" || typeof r.sourceHash < "u";
|
|
32
|
+
}
|
|
33
|
+
function w(r) {
|
|
34
|
+
const { from: e, to: o } = r;
|
|
35
|
+
if (e && !f(e))
|
|
36
|
+
throw new a({ address: e });
|
|
37
|
+
if (o && !f(o))
|
|
38
|
+
throw new a({ address: o });
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
w as assertTransactionDeposit,
|
|
42
|
+
T as serializeTransaction,
|
|
43
|
+
E as serializers
|
|
44
|
+
};
|
package/dist/index3.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t=(e=>(e[e.evm=14400]="evm",e[e.btc=288]="btc",e))(t||{}),u=(e=>(e.Idle="Idle",e.Initiate="Initiate",e.Redeem="Redeem",e.Refund="Refund",e))(u||{});exports.OrderActions=u;exports.TimeLocks=t;
|
package/dist/index3.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var t = /* @__PURE__ */ ((e) => (e[e.evm = 14400] = "evm", e[e.btc = 288] = "btc", e))(t || {}), a = /* @__PURE__ */ ((e) => (e.Idle = "Idle", e.Initiate = "Initiate", e.Redeem = "Redeem", e.Refund = "Refund", e))(a || {});
|
|
2
|
+
export {
|
|
3
|
+
a as OrderActions,
|
|
4
|
+
t as TimeLocks
|
|
5
|
+
};
|
package/dist/index30.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("./index48.cjs"),r=require("./index49.cjs");function o(e,{size:n}){if(r.size(e)>n)throw new z.SizeOverflowError({givenSize:r.size(e),maxSize:n})}function s(e,n={}){const{signed:u}=n;n.size&&o(e,{size:n.size});const i=BigInt(e);if(!u)return i;const t=(e.length-2)/2,c=(1n<<BigInt(t)*8n-1n)-1n;return i<=c?i:i-BigInt(`0x${"f".padStart(t*2,"f")}`)-1n}function f(e,n={}){return Number(s(e,n))}exports.assertSize=o;exports.hexToBigInt=s;exports.hexToNumber=f;
|
package/dist/index30.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SizeOverflowError as u } from "./index48.js";
|
|
2
|
+
import { size as t } from "./index49.js";
|
|
3
|
+
function s(n, { size: i }) {
|
|
4
|
+
if (t(n) > i)
|
|
5
|
+
throw new u({
|
|
6
|
+
givenSize: t(n),
|
|
7
|
+
maxSize: i
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function z(n, i = {}) {
|
|
11
|
+
const { signed: o } = i;
|
|
12
|
+
i.size && s(n, { size: i.size });
|
|
13
|
+
const e = BigInt(n);
|
|
14
|
+
if (!o)
|
|
15
|
+
return e;
|
|
16
|
+
const r = (n.length - 2) / 2, f = (1n << BigInt(r) * 8n - 1n) - 1n;
|
|
17
|
+
return e <= f ? e : e - BigInt(`0x${"f".padStart(r * 2, "f")}`) - 1n;
|
|
18
|
+
}
|
|
19
|
+
function g(n, i = {}) {
|
|
20
|
+
return Number(z(n, i));
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
s as assertSize,
|
|
24
|
+
z as hexToBigInt,
|
|
25
|
+
g as hexToNumber
|
|
26
|
+
};
|
package/dist/index31.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index50.cjs"),u=require("./index32.cjs");function i(e){var t;const s=(t=e.transactions)==null?void 0:t.map(n=>typeof n=="string"?n:u.formatTransaction(n));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:s,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const f=a.defineFormatter("block",i);exports.defineBlock=f;exports.formatBlock=i;
|
package/dist/index31.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineFormatter as t } from "./index50.js";
|
|
2
|
+
import { formatTransaction as a } from "./index32.js";
|
|
3
|
+
function f(e) {
|
|
4
|
+
var i;
|
|
5
|
+
const s = (i = e.transactions) == null ? void 0 : i.map((n) => typeof n == "string" ? n : a(n));
|
|
6
|
+
return {
|
|
7
|
+
...e,
|
|
8
|
+
baseFeePerGas: e.baseFeePerGas ? BigInt(e.baseFeePerGas) : null,
|
|
9
|
+
blobGasUsed: e.blobGasUsed ? BigInt(e.blobGasUsed) : void 0,
|
|
10
|
+
difficulty: e.difficulty ? BigInt(e.difficulty) : void 0,
|
|
11
|
+
excessBlobGas: e.excessBlobGas ? BigInt(e.excessBlobGas) : void 0,
|
|
12
|
+
gasLimit: e.gasLimit ? BigInt(e.gasLimit) : void 0,
|
|
13
|
+
gasUsed: e.gasUsed ? BigInt(e.gasUsed) : void 0,
|
|
14
|
+
hash: e.hash ? e.hash : null,
|
|
15
|
+
logsBloom: e.logsBloom ? e.logsBloom : null,
|
|
16
|
+
nonce: e.nonce ? e.nonce : null,
|
|
17
|
+
number: e.number ? BigInt(e.number) : null,
|
|
18
|
+
size: e.size ? BigInt(e.size) : void 0,
|
|
19
|
+
timestamp: e.timestamp ? BigInt(e.timestamp) : void 0,
|
|
20
|
+
transactions: s,
|
|
21
|
+
totalDifficulty: e.totalDifficulty ? BigInt(e.totalDifficulty) : null
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const m = /* @__PURE__ */ t("block", f);
|
|
25
|
+
export {
|
|
26
|
+
m as defineBlock,
|
|
27
|
+
f as formatBlock
|
|
28
|
+
};
|
package/dist/index32.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index30.cjs"),l=require("./index50.cjs"),d={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function u(e){const r={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?i.hexToNumber(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?i.hexToNumber(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?d[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(r.authorizationList=m(e.authorizationList)),r.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof r.v=="bigint"){if(r.v===0n||r.v===27n)return 0;if(r.v===1n||r.v===28n)return 1;if(r.v>=35n)return r.v%2n===0n?1:0}})(),r.type==="legacy"&&(delete r.accessList,delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.yParity),r.type==="eip2930"&&(delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas),r.type==="eip1559"&&delete r.maxFeePerBlobGas,r}const n=l.defineFormatter("transaction",u);function m(e){return e.map(r=>({contractAddress:r.address,chainId:Number(r.chainId),nonce:Number(r.nonce),r:r.r,s:r.s,yParity:Number(r.yParity)}))}exports.defineTransaction=n;exports.formatTransaction=u;exports.transactionType=d;
|
package/dist/index32.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { hexToNumber as r } from "./index30.js";
|
|
2
|
+
import { defineFormatter as i } from "./index50.js";
|
|
3
|
+
const u = {
|
|
4
|
+
"0x0": "legacy",
|
|
5
|
+
"0x1": "eip2930",
|
|
6
|
+
"0x2": "eip1559",
|
|
7
|
+
"0x3": "eip4844",
|
|
8
|
+
"0x4": "eip7702"
|
|
9
|
+
};
|
|
10
|
+
function l(e) {
|
|
11
|
+
const d = {
|
|
12
|
+
...e,
|
|
13
|
+
blockHash: e.blockHash ? e.blockHash : null,
|
|
14
|
+
blockNumber: e.blockNumber ? BigInt(e.blockNumber) : null,
|
|
15
|
+
chainId: e.chainId ? r(e.chainId) : void 0,
|
|
16
|
+
gas: e.gas ? BigInt(e.gas) : void 0,
|
|
17
|
+
gasPrice: e.gasPrice ? BigInt(e.gasPrice) : void 0,
|
|
18
|
+
maxFeePerBlobGas: e.maxFeePerBlobGas ? BigInt(e.maxFeePerBlobGas) : void 0,
|
|
19
|
+
maxFeePerGas: e.maxFeePerGas ? BigInt(e.maxFeePerGas) : void 0,
|
|
20
|
+
maxPriorityFeePerGas: e.maxPriorityFeePerGas ? BigInt(e.maxPriorityFeePerGas) : void 0,
|
|
21
|
+
nonce: e.nonce ? r(e.nonce) : void 0,
|
|
22
|
+
to: e.to ? e.to : null,
|
|
23
|
+
transactionIndex: e.transactionIndex ? Number(e.transactionIndex) : null,
|
|
24
|
+
type: e.type ? u[e.type] : void 0,
|
|
25
|
+
typeHex: e.type ? e.type : void 0,
|
|
26
|
+
value: e.value ? BigInt(e.value) : void 0,
|
|
27
|
+
v: e.v ? BigInt(e.v) : void 0
|
|
28
|
+
};
|
|
29
|
+
return e.authorizationList && (d.authorizationList = m(e.authorizationList)), d.yParity = (() => {
|
|
30
|
+
if (e.yParity)
|
|
31
|
+
return Number(e.yParity);
|
|
32
|
+
if (typeof d.v == "bigint") {
|
|
33
|
+
if (d.v === 0n || d.v === 27n)
|
|
34
|
+
return 0;
|
|
35
|
+
if (d.v === 1n || d.v === 28n)
|
|
36
|
+
return 1;
|
|
37
|
+
if (d.v >= 35n)
|
|
38
|
+
return d.v % 2n === 0n ? 1 : 0;
|
|
39
|
+
}
|
|
40
|
+
})(), d.type === "legacy" && (delete d.accessList, delete d.maxFeePerBlobGas, delete d.maxFeePerGas, delete d.maxPriorityFeePerGas, delete d.yParity), d.type === "eip2930" && (delete d.maxFeePerBlobGas, delete d.maxFeePerGas, delete d.maxPriorityFeePerGas), d.type === "eip1559" && delete d.maxFeePerBlobGas, d;
|
|
41
|
+
}
|
|
42
|
+
const P = /* @__PURE__ */ i("transaction", l);
|
|
43
|
+
function m(e) {
|
|
44
|
+
return e.map((d) => ({
|
|
45
|
+
contractAddress: d.address,
|
|
46
|
+
chainId: Number(d.chainId),
|
|
47
|
+
nonce: Number(d.nonce),
|
|
48
|
+
r: d.r,
|
|
49
|
+
s: d.s,
|
|
50
|
+
yParity: Number(d.yParity)
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
P as defineTransaction,
|
|
55
|
+
l as formatTransaction,
|
|
56
|
+
u as transactionType
|
|
57
|
+
};
|
package/dist/index33.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index30.cjs"),o=require("./index50.cjs"),b=require("./index51.cjs"),f=require("./index32.cjs"),l={"0x0":"reverted","0x1":"success"};function u(e){const s={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(r=>b.formatLog(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?d.hexToNumber(e.transactionIndex):null,status:e.status?l[e.status]:null,type:e.type?f.transactionType[e.type]||e.type:null};return e.blobGasPrice&&(s.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(s.blobGasUsed=BigInt(e.blobGasUsed)),s}const g=o.defineFormatter("transactionReceipt",u);exports.defineTransactionReceipt=g;exports.formatTransactionReceipt=u;exports.receiptStatuses=l;
|
package/dist/index33.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { hexToNumber as d } from "./index30.js";
|
|
2
|
+
import { defineFormatter as b } from "./index50.js";
|
|
3
|
+
import { formatLog as m } from "./index51.js";
|
|
4
|
+
import { transactionType as o } from "./index32.js";
|
|
5
|
+
const f = {
|
|
6
|
+
"0x0": "reverted",
|
|
7
|
+
"0x1": "success"
|
|
8
|
+
};
|
|
9
|
+
function r(l) {
|
|
10
|
+
const s = {
|
|
11
|
+
...l,
|
|
12
|
+
blockNumber: l.blockNumber ? BigInt(l.blockNumber) : null,
|
|
13
|
+
contractAddress: l.contractAddress ? l.contractAddress : null,
|
|
14
|
+
cumulativeGasUsed: l.cumulativeGasUsed ? BigInt(l.cumulativeGasUsed) : null,
|
|
15
|
+
effectiveGasPrice: l.effectiveGasPrice ? BigInt(l.effectiveGasPrice) : null,
|
|
16
|
+
gasUsed: l.gasUsed ? BigInt(l.gasUsed) : null,
|
|
17
|
+
logs: l.logs ? l.logs.map((u) => m(u)) : null,
|
|
18
|
+
to: l.to ? l.to : null,
|
|
19
|
+
transactionIndex: l.transactionIndex ? d(l.transactionIndex) : null,
|
|
20
|
+
status: l.status ? f[l.status] : null,
|
|
21
|
+
type: l.type ? o[l.type] || l.type : null
|
|
22
|
+
};
|
|
23
|
+
return l.blobGasPrice && (s.blobGasPrice = BigInt(l.blobGasPrice)), l.blobGasUsed && (s.blobGasUsed = BigInt(l.blobGasUsed)), s;
|
|
24
|
+
}
|
|
25
|
+
const U = /* @__PURE__ */ b("transactionReceipt", r);
|
|
26
|
+
export {
|
|
27
|
+
U as defineTransactionReceipt,
|
|
28
|
+
r as formatTransactionReceipt,
|
|
29
|
+
f as receiptStatuses
|
|
30
|
+
};
|
package/dist/index34.cjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";const e=require("./index39.cjs");Object.defineProperty(e.__exports,"__esModule",{value:!0});e.__exports.testnet=e.__exports.bitcoin=void 0;e.__exports.bitcoin={messagePrefix:`Bitcoin Signed Message:
|
|
2
|
+
`,bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128};e.__exports.testnet={messagePrefix:`Bitcoin Signed Message:
|
|
3
|
+
`,bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239};module.exports=e.__exports;
|
package/dist/index34.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { __exports as e } from "./index39.js";
|
|
2
|
+
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
3
|
+
e.testnet = e.bitcoin = void 0;
|
|
4
|
+
e.bitcoin = {
|
|
5
|
+
messagePrefix: `Bitcoin Signed Message:
|
|
6
|
+
`,
|
|
7
|
+
bech32: "bc",
|
|
8
|
+
bip32: {
|
|
9
|
+
public: 76067358,
|
|
10
|
+
private: 76066276
|
|
11
|
+
},
|
|
12
|
+
pubKeyHash: 0,
|
|
13
|
+
scriptHash: 5,
|
|
14
|
+
wif: 128
|
|
15
|
+
};
|
|
16
|
+
e.testnet = {
|
|
17
|
+
messagePrefix: `Bitcoin Signed Message:
|
|
18
|
+
`,
|
|
19
|
+
bech32: "tb",
|
|
20
|
+
bip32: {
|
|
21
|
+
public: 70617039,
|
|
22
|
+
private: 70615956
|
|
23
|
+
},
|
|
24
|
+
pubKeyHash: 111,
|
|
25
|
+
scriptHash: 196,
|
|
26
|
+
wif: 239
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
e as default
|
|
30
|
+
};
|
package/dist/index35.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const f=require("./index40.cjs"),y=require("./index52.cjs");(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.maybe=e.Boolean=e.Array=e.Buffer256bit=e.Network=e.typeforce=void 0,e.typeforce=y.typeforce_1,e.Network=e.typeforce.compile({messagePrefix:e.typeforce.oneOf(e.typeforce.Buffer,e.typeforce.String),bip32:{public:e.typeforce.UInt32,private:e.typeforce.UInt32},pubKeyHash:e.typeforce.UInt8,scriptHash:e.typeforce.UInt8,wif:e.typeforce.UInt8}),e.Buffer256bit=e.typeforce.BufferN(32),e.Array=e.typeforce.Array,e.Boolean=e.typeforce.Boolean,e.maybe=e.typeforce.maybe})(f.__exports);
|
package/dist/index35.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { __exports as f } from "./index40.js";
|
|
2
|
+
import { t as y } from "./index52.js";
|
|
3
|
+
(function(e) {
|
|
4
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.maybe = e.Boolean = e.Array = e.Buffer256bit = e.Network = e.typeforce = void 0, e.typeforce = y, e.Network = e.typeforce.compile({
|
|
5
|
+
messagePrefix: e.typeforce.oneOf(
|
|
6
|
+
e.typeforce.Buffer,
|
|
7
|
+
e.typeforce.String
|
|
8
|
+
),
|
|
9
|
+
bip32: {
|
|
10
|
+
public: e.typeforce.UInt32,
|
|
11
|
+
private: e.typeforce.UInt32
|
|
12
|
+
},
|
|
13
|
+
pubKeyHash: e.typeforce.UInt8,
|
|
14
|
+
scriptHash: e.typeforce.UInt8,
|
|
15
|
+
wif: e.typeforce.UInt8
|
|
16
|
+
}), e.Buffer256bit = e.typeforce.BufferN(32), e.Array = e.typeforce.Array, e.Boolean = e.typeforce.Boolean, e.maybe = e.typeforce.maybe;
|
|
17
|
+
})(f);
|
package/dist/index36.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index53.cjs"),s=require("./index54.cjs"),l=require("./index55.cjs");var n=65536,f=4294967295;function m(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
2
|
+
Use Chrome, Firefox or Internet Explorer 11`)}var c=l.safeBufferExports.Buffer,t=a.commonjsGlobal.crypto||a.commonjsGlobal.msCrypto;t&&t.getRandomValues?s.__module.exports=i:s.__module.exports=m;function i(r,u){if(r>f)throw new RangeError("requested too many random bytes");var o=c.allocUnsafe(r);if(r>0)if(r>n)for(var e=0;e<r;e+=n)t.getRandomValues(o.slice(e,e+n));else t.getRandomValues(o);return typeof u=="function"?process.nextTick(function(){u(null,o)}):o}var p=s.__module.exports;exports.browserExports=p;
|
package/dist/index36.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { commonjsGlobal as f } from "./index53.js";
|
|
2
|
+
import { __module as n } from "./index54.js";
|
|
3
|
+
import { s as m } from "./index55.js";
|
|
4
|
+
var s = 65536, u = 4294967295;
|
|
5
|
+
function p() {
|
|
6
|
+
throw new Error(`Secure random number generation is not supported by this browser.
|
|
7
|
+
Use Chrome, Firefox or Internet Explorer 11`);
|
|
8
|
+
}
|
|
9
|
+
var l = m.Buffer, t = f.crypto || f.msCrypto;
|
|
10
|
+
t && t.getRandomValues ? n.exports = i : n.exports = p;
|
|
11
|
+
function i(r, a) {
|
|
12
|
+
if (r > u) throw new RangeError("requested too many random bytes");
|
|
13
|
+
var o = l.allocUnsafe(r);
|
|
14
|
+
if (r > 0)
|
|
15
|
+
if (r > s)
|
|
16
|
+
for (var e = 0; e < r; e += s)
|
|
17
|
+
t.getRandomValues(o.slice(e, e + s));
|
|
18
|
+
else
|
|
19
|
+
t.getRandomValues(o);
|
|
20
|
+
return typeof a == "function" ? process.nextTick(function() {
|
|
21
|
+
a(null, o);
|
|
22
|
+
}) : o;
|
|
23
|
+
}
|
|
24
|
+
var b = n.exports;
|
|
25
|
+
export {
|
|
26
|
+
b
|
|
27
|
+
};
|
package/dist/index37.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index56.cjs");var t=d.bs58check;function i(e,n){if(n!==void 0&&e[0]!==n)throw new Error("Invalid network version");if(e.length===33)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(e.length!==34)throw new Error("Invalid WIF length");if(e[33]!==1)throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function c(e,n,r){var o=new Buffer(r?34:33);return o.writeUInt8(e,0),n.copy(o,1),r&&(o[33]=1),o}function a(e,n){return i(t.decode(e),n)}function w(e,n,r){return typeof e=="number"?t.encode(c(e,n,r)):t.encode(c(e.version,e.privateKey,e.compressed))}var l={decode:a,decodeRaw:i,encode:w,encodeRaw:c};exports.wif=l;
|
package/dist/index37.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { b as i } from "./index56.js";
|
|
2
|
+
var t = i;
|
|
3
|
+
function d(e, n) {
|
|
4
|
+
if (n !== void 0 && e[0] !== n) throw new Error("Invalid network version");
|
|
5
|
+
if (e.length === 33)
|
|
6
|
+
return {
|
|
7
|
+
version: e[0],
|
|
8
|
+
privateKey: e.slice(1, 33),
|
|
9
|
+
compressed: !1
|
|
10
|
+
};
|
|
11
|
+
if (e.length !== 34) throw new Error("Invalid WIF length");
|
|
12
|
+
if (e[33] !== 1) throw new Error("Invalid compression flag");
|
|
13
|
+
return {
|
|
14
|
+
version: e[0],
|
|
15
|
+
privateKey: e.slice(1, 33),
|
|
16
|
+
compressed: !0
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function c(e, n, r) {
|
|
20
|
+
var o = new Buffer(r ? 34 : 33);
|
|
21
|
+
return o.writeUInt8(e, 0), n.copy(o, 1), r && (o[33] = 1), o;
|
|
22
|
+
}
|
|
23
|
+
function a(e, n) {
|
|
24
|
+
return d(t.decode(e), n);
|
|
25
|
+
}
|
|
26
|
+
function w(e, n, r) {
|
|
27
|
+
return typeof e == "number" ? t.encode(c(e, n, r)) : t.encode(
|
|
28
|
+
c(
|
|
29
|
+
e.version,
|
|
30
|
+
e.privateKey,
|
|
31
|
+
e.compressed
|
|
32
|
+
)
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
var l = {
|
|
36
|
+
decode: a,
|
|
37
|
+
decodeRaw: d,
|
|
38
|
+
encode: w,
|
|
39
|
+
encodeRaw: c
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
l as w
|
|
43
|
+
};
|
package/dist/index38.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const d=require("./index41.cjs");Object.defineProperty(d.__exports,"__esModule",{value:!0});d.__exports.testEcc=void 0;const f=b=>Buffer.from(b,"hex");function c(b){a(b.isPoint(f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),a(!b.isPoint(f("030000000000000000000000000000000000000000000000000000000000000005"))),a(b.isPrivate(f("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),a(b.isPrivate(f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),a(!b.isPrivate(f("0000000000000000000000000000000000000000000000000000000000000000"))),a(!b.isPrivate(f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"))),a(!b.isPrivate(f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142"))),a(Buffer.from(b.privateAdd(f("0000000000000000000000000000000000000000000000000000000000000001"),f("0000000000000000000000000000000000000000000000000000000000000000"))).equals(f("0000000000000000000000000000000000000000000000000000000000000001"))),a(b.privateAdd(f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"),f("0000000000000000000000000000000000000000000000000000000000000003"))===null),a(Buffer.from(b.privateAdd(f("e211078564db65c3ce7704f08262b1f38f1ef412ad15b5ac2d76657a63b2c500"),f("b51fbb69051255d1becbd683de5848242a89c229348dd72896a87ada94ae8665"))).equals(f("9730c2ee69edbb958d42db7460bafa18fef9d955325aec99044c81c8282b0a24"))),a(Buffer.from(b.privateNegate(f("0000000000000000000000000000000000000000000000000000000000000001"))).equals(f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),a(Buffer.from(b.privateNegate(f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"))).equals(f("0000000000000000000000000000000000000000000000000000000000000003"))),a(Buffer.from(b.privateNegate(f("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(f("4eede1bf775995d70a494f0a7bb6bc11e0b8cccd41cce8009ab1132c8b0a3792"))),a(Buffer.from(b.pointCompress(f("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),!0)).equals(f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),a(Buffer.from(b.pointCompress(f("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),!1)).equals(f("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"))),a(Buffer.from(b.pointCompress(f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),!0)).equals(f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),a(Buffer.from(b.pointCompress(f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),!1)).equals(f("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"))),a(Buffer.from(b.pointFromScalar(f("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(f("02b07ba9dca9523b7ef4bd97703d43d20399eb698e194704791a25ce77a400df99"))),a(b.xOnlyPointAddTweak(f("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))===null);let e=b.xOnlyPointAddTweak(f("1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b"),f("a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac"));a(Buffer.from(e.xOnlyPubkey).equals(f("e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"))&&e.parity===1),e=b.xOnlyPointAddTweak(f("2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991"),f("823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47")),a(Buffer.from(e.xOnlyPubkey).equals(f("9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"))&&e.parity===0),a(Buffer.from(b.sign(f("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))).equals(f("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),a(b.verify(f("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),f("0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),f("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),b.signSchnorr&&a(Buffer.from(b.signSchnorr(f("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),f("c90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b14e5c9"),f("c87aa53824b4d7ae2eb035a2b5bbbccc080e76cdc6d1692c4b0b62d798e6d906"))).equals(f("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7"))),b.verifySchnorr&&a(b.verifySchnorr(f("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),f("dd308afec5777e13121fa72b9cc1b7cc0139715309b086c960e18fd969774eb8"),f("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7")))}d.__exports.testEcc=c;function a(b){if(!b)throw new Error("ecc library invalid")}module.exports=d.__exports;
|