@gardenfi/core 0.2.0-beta.71 → 0.2.0-beta.72
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 -1
- package/dist/index.js +14 -15
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +41 -55
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +2 -2
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +2 -2
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +136 -30
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +2 -25
- package/dist/index18.cjs +3 -1
- package/dist/index18.js +26 -29
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +17 -32
- package/dist/index20.cjs +2 -1
- package/dist/index20.js +25 -53
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +39 -26
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +199 -15
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +2 -9
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +2 -9
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +2 -138
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +28 -2
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +14 -12
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +174 -36
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +21 -41
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +2 -24
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +34 -25
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +8 -54
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +2 -28
- package/dist/index34.cjs +6 -3
- package/dist/index34.js +949 -30
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +4 -17
- package/dist/index36.cjs +1 -2
- package/dist/index36.js +18 -23
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +29 -38
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +60 -197
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +33 -2
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +87 -2
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +49 -2
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +25 -12
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +2 -12
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +2 -4
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +19 -45
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +30 -38
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +360 -165
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +21 -13
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +54 -3
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +3 -17
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +70 -9
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +2 -175
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +57 -21
- package/dist/index54.js +2 -2
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +39 -34
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +43 -9
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +17 -34
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +103 -50
- package/dist/index59.cjs +1 -2
- package/dist/index59.js +19 -58
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +225 -3
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +4 -128
- package/dist/index62.cjs +1 -2
- package/dist/index62.js +152 -37
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +2 -9
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +13 -11
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +2 -12
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +32 -13
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +2 -7
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +355 -17
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +235 -75
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +67 -14
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +60 -17
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +11 -21
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +44 -13
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +63 -2
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +226 -2
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +3 -7
- package/dist/index77.cjs +1 -2
- package/dist/index77.js +166 -32
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +27 -5
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +19 -18
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +68 -30
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +128 -2
- package/dist/index82.cjs +1 -6
- package/dist/index82.js +9 -949
- package/dist/index83.cjs +1 -1
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +25 -61
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +2 -33
- package/dist/src/index.d.ts +1 -1
- package/dist/src/lib/utils.d.ts +1 -3
- package/package.json +2 -2
- package/dist/index100.cjs +0 -1
- package/dist/index100.js +0 -37
- package/dist/index101.cjs +0 -1
- package/dist/index101.js +0 -369
- package/dist/index102.cjs +0 -1
- package/dist/index102.js +0 -23
- package/dist/index103.cjs +0 -1
- package/dist/index103.js +0 -58
- package/dist/index104.cjs +0 -1
- package/dist/index104.js +0 -5
- package/dist/index105.cjs +0 -1
- package/dist/index105.js +0 -51
- package/dist/index106.cjs +0 -1
- package/dist/index106.js +0 -28
- package/dist/index107.cjs +0 -1
- package/dist/index107.js +0 -4
- package/dist/index108.cjs +0 -1
- package/dist/index108.js +0 -4
- package/dist/index109.cjs +0 -1
- package/dist/index109.js +0 -64
- package/dist/index110.cjs +0 -1
- package/dist/index110.js +0 -37
- package/dist/index111.cjs +0 -1
- package/dist/index111.js +0 -4
- package/dist/index112.cjs +0 -1
- package/dist/index112.js +0 -60
- package/dist/index113.cjs +0 -1
- package/dist/index113.js +0 -4
- package/dist/index114.cjs +0 -1
- package/dist/index114.js +0 -42
- package/dist/index115.cjs +0 -1
- package/dist/index115.js +0 -45
- package/dist/index116.cjs +0 -1
- package/dist/index116.js +0 -20
- package/dist/index117.cjs +0 -1
- package/dist/index117.js +0 -111
- package/dist/index118.cjs +0 -1
- package/dist/index118.js +0 -23
- package/dist/index119.cjs +0 -1
- package/dist/index119.js +0 -228
- package/dist/index120.cjs +0 -1
- package/dist/index120.js +0 -6
- package/dist/index121.cjs +0 -1
- package/dist/index121.js +0 -160
- package/dist/index122.cjs +0 -1
- package/dist/index122.js +0 -4
- package/dist/index123.cjs +0 -1
- package/dist/index123.js +0 -75
- package/dist/index124.cjs +0 -1
- package/dist/index124.js +0 -7
- package/dist/index125.cjs +0 -1
- package/dist/index125.js +0 -107
- package/dist/index126.cjs +0 -1
- package/dist/index126.js +0 -15
- package/dist/index127.cjs +0 -1
- package/dist/index127.js +0 -35
- package/dist/index128.cjs +0 -1
- package/dist/index128.js +0 -32
- package/dist/index129.cjs +0 -1
- package/dist/index129.js +0 -4
- package/dist/index130.cjs +0 -1
- package/dist/index130.js +0 -21
- package/dist/index131.cjs +0 -1
- package/dist/index131.js +0 -4
- package/dist/index132.cjs +0 -1
- package/dist/index132.js +0 -358
- package/dist/index133.cjs +0 -1
- package/dist/index133.js +0 -241
- package/dist/index134.cjs +0 -1
- package/dist/index134.js +0 -70
- package/dist/index135.cjs +0 -1
- package/dist/index135.js +0 -64
- package/dist/index136.cjs +0 -1
- package/dist/index136.js +0 -14
- package/dist/index137.cjs +0 -1
- package/dist/index137.js +0 -47
- package/dist/index138.cjs +0 -1
- package/dist/index138.js +0 -65
- package/dist/index139.cjs +0 -1
- package/dist/index139.js +0 -228
- package/dist/index140.cjs +0 -1
- package/dist/index140.js +0 -5
- package/dist/index141.cjs +0 -1
- package/dist/index141.js +0 -171
- package/dist/index142.cjs +0 -1
- package/dist/index142.js +0 -30
- package/dist/index143.cjs +0 -1
- package/dist/index143.js +0 -23
- package/dist/index144.cjs +0 -1
- package/dist/index144.js +0 -72
- package/dist/index145.cjs +0 -1
- package/dist/index145.js +0 -130
- package/dist/index146.cjs +0 -1
- package/dist/index146.js +0 -9
- package/dist/index147.cjs +0 -1
- package/dist/index147.js +0 -4
- package/dist/index148.cjs +0 -1
- package/dist/index148.js +0 -28
- package/dist/index149.cjs +0 -1
- package/dist/index149.js +0 -4
- package/dist/index86.cjs +0 -1
- package/dist/index86.js +0 -89
- package/dist/index87.cjs +0 -1
- package/dist/index87.js +0 -15
- package/dist/index88.cjs +0 -1
- package/dist/index88.js +0 -9
- package/dist/index89.cjs +0 -1
- package/dist/index89.js +0 -115
- package/dist/index90.cjs +0 -1
- package/dist/index90.js +0 -9
- package/dist/index91.cjs +0 -1
- package/dist/index91.js +0 -35
- package/dist/index92.cjs +0 -1
- package/dist/index92.js +0 -4
- package/dist/index93.cjs +0 -1
- package/dist/index93.js +0 -40
- package/dist/index94.cjs +0 -1
- package/dist/index94.js +0 -31
- package/dist/index95.cjs +0 -1
- package/dist/index95.js +0 -23
- package/dist/index96.cjs +0 -1
- package/dist/index96.js +0 -9
- package/dist/index97.cjs +0 -1
- package/dist/index97.js +0 -7
- package/dist/index98.cjs +0 -1
- package/dist/index98.js +0 -13
- package/dist/index99.cjs +0 -1
- package/dist/index99.js +0 -22
package/dist/index.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("./index2.cjs"),r=require("./index3.cjs"),i=require("./index4.cjs"),o=require("./index5.cjs"),t=require("./index6.cjs"),e=require("./index7.cjs"),c=require("./index8.cjs"),u=require("./index9.cjs"),s=require("./index10.cjs");exports.Garden=a.Garden;exports.OrderActions=r.OrderActions;exports.TimeLocks=r.TimeLocks;exports.BlockNumberFetcher=i.BlockNumberFetcher;exports.EvmRelay=o.EvmRelay;exports.OrderStatus=t.OrderStatus;exports.SwapStatus=t.SwapStatus;exports.ParseOrderStatus=e.ParseOrderStatus;exports.ParseSwapStatus=e.ParseSwapStatus;exports.filterDeadlineExpiredOrders=e.filterDeadlineExpiredOrders;exports.isExpired=e.isExpired;exports.parseAction=e.parseAction;exports.parseActionFromStatus=e.parseActionFromStatus;exports.SecretManager=c.SecretManager;exports.Quote=u.Quote;exports.constructOrderPair=s.constructOrderPair;exports.switchOrAddNetwork=s.switchOrAddNetwork;
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import { Garden as t } from "./index2.js";
|
|
2
2
|
import { OrderActions as a, TimeLocks as p } from "./index3.js";
|
|
3
|
-
import { BlockNumberFetcher as
|
|
4
|
-
import { EvmRelay as
|
|
3
|
+
import { BlockNumberFetcher as m } from "./index4.js";
|
|
4
|
+
import { EvmRelay as i } from "./index5.js";
|
|
5
5
|
import { OrderStatus as c, SwapStatus as f } from "./index6.js";
|
|
6
|
-
import { ParseOrderStatus as
|
|
7
|
-
import { SecretManager as
|
|
8
|
-
import { Quote as
|
|
9
|
-
import { constructOrderPair as
|
|
6
|
+
import { ParseOrderStatus as S, ParseSwapStatus as n, filterDeadlineExpiredOrders as O, isExpired as l, parseAction as w, parseActionFromStatus as A } from "./index7.js";
|
|
7
|
+
import { SecretManager as E } from "./index8.js";
|
|
8
|
+
import { Quote as h } from "./index9.js";
|
|
9
|
+
import { constructOrderPair as N, switchOrAddNetwork as b } from "./index10.js";
|
|
10
10
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
m as BlockNumberFetcher,
|
|
12
|
+
i as EvmRelay,
|
|
13
13
|
t as Garden,
|
|
14
14
|
a as OrderActions,
|
|
15
15
|
c as OrderStatus,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
S as ParseOrderStatus,
|
|
17
|
+
n as ParseSwapStatus,
|
|
18
|
+
h as Quote,
|
|
19
|
+
E as SecretManager,
|
|
20
20
|
f as SwapStatus,
|
|
21
21
|
p as TimeLocks,
|
|
22
|
-
|
|
23
|
-
M as evmToViemChainMap,
|
|
22
|
+
N as constructOrderPair,
|
|
24
23
|
O as filterDeadlineExpiredOrders,
|
|
25
24
|
l as isExpired,
|
|
26
25
|
w as parseAction,
|
|
27
26
|
A as parseActionFromStatus,
|
|
28
|
-
|
|
27
|
+
b as switchOrAddNetwork
|
|
29
28
|
};
|
package/dist/index10.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@gardenfi/utils");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@gardenfi/utils");const f=require("@gardenfi/orderbook"),c=require("viem"),l=require("varuint-bitcoin"),o=require("@catalogfi/utils"),h=require("tiny-secp256k1");function u(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const s=u(l),m=u(h);function w(t){return typeof t=="string"&&(t=Buffer.from(t,"hex")),t.length===32?t:t.subarray(1,33)}function g(t,e){if(!t)throw new Error(e)}function O(t){return Buffer.concat([Uint8Array.from([192]),d(t)])}function d(t){const e=s.encodingLength(t.length),r=Buffer.allocUnsafe(e);return s.encode(t.length,r),Buffer.concat([r,t])}function p(t,e){if(t.compare(e)>0){const r=t;t=e,e=r}return[t,e]}const y=t=>t.length===64?t:t.slice(2),P=t=>{if(!t)return!1;try{const e=Buffer.from(t,"hex");return m.isPoint(e)}catch{return!1}},b=async(t,e)=>{var n;const r=f.evmToViemChainMap[t];if(r)try{if(r.id===((n=e.chain)==null?void 0:n.id))return o.Ok({message:"Already on the network",walletClient:e});await e.switchChain({id:r.id});const i=c.createWalletClient({account:e.account,chain:r,transport:c.custom(window.ethereum)});return o.Ok({message:"Switched chain",walletClient:i})}catch(i){if(v(i))try{await e.addChain({chain:r});const a=c.createWalletClient({account:e.account,chain:r,transport:c.custom(window.ethereum)});return o.Ok({message:"Added network",walletClient:a})}catch{return o.Err("Failed to add network")}else return o.Err("Failed to switch network")}else return o.Err("Chain not supported")},v=t=>typeof t=="object"&&t!==null&&"code"in t&&t.code===4902,S=(t,e,r,n)=>t+":"+e.toLowerCase()+"::"+r+":"+n.toLowerCase();exports.assert=g;exports.constructOrderPair=S;exports.isValidBitcoinPubKey=P;exports.prefixScriptLength=d;exports.serializeScript=O;exports.sortLeaves=p;exports.switchOrAddNetwork=b;exports.toXOnly=y;exports.xOnlyPubkey=w;
|
package/dist/index10.js
CHANGED
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
import "@gardenfi/utils";
|
|
2
|
-
import {
|
|
3
|
-
import { createWalletClient as s, custom as
|
|
2
|
+
import { evmToViemChainMap as h } from "@gardenfi/orderbook";
|
|
3
|
+
import { createWalletClient as s, custom as f } from "viem";
|
|
4
4
|
import * as u from "varuint-bitcoin";
|
|
5
|
-
import { Ok as i, Err as
|
|
5
|
+
import { Ok as i, Err as c } from "@catalogfi/utils";
|
|
6
6
|
import * as d from "tiny-secp256k1";
|
|
7
|
-
|
|
8
|
-
import { arbitrum as p } from "./index17.js";
|
|
9
|
-
import { sepolia as w } from "./index18.js";
|
|
10
|
-
import { arbitrumSepolia as g } from "./index19.js";
|
|
11
|
-
import { baseSepolia as L } from "./index20.js";
|
|
12
|
-
function F(t) {
|
|
7
|
+
function C(t) {
|
|
13
8
|
return typeof t == "string" && (t = Buffer.from(t, "hex")), t.length === 32 ? t : t.subarray(1, 33);
|
|
14
9
|
}
|
|
15
|
-
function
|
|
10
|
+
function y(t, r) {
|
|
16
11
|
if (!t) throw new Error(r);
|
|
17
12
|
}
|
|
18
|
-
function
|
|
13
|
+
function L(t) {
|
|
19
14
|
return Buffer.concat([
|
|
20
15
|
Uint8Array.from([192]),
|
|
21
|
-
|
|
16
|
+
m(t)
|
|
22
17
|
]);
|
|
23
18
|
}
|
|
24
|
-
function
|
|
25
|
-
const r = u.encodingLength(t.length),
|
|
26
|
-
return u.encode(t.length,
|
|
19
|
+
function m(t) {
|
|
20
|
+
const r = u.encodingLength(t.length), n = Buffer.allocUnsafe(r);
|
|
21
|
+
return u.encode(t.length, n), Buffer.concat([n, t]);
|
|
27
22
|
}
|
|
28
|
-
function
|
|
23
|
+
function x(t, r) {
|
|
29
24
|
if (t.compare(r) > 0) {
|
|
30
|
-
const
|
|
31
|
-
t = r, r =
|
|
25
|
+
const n = t;
|
|
26
|
+
t = r, r = n;
|
|
32
27
|
}
|
|
33
28
|
return [t, r];
|
|
34
29
|
}
|
|
35
|
-
const
|
|
30
|
+
const O = (t) => t.length === 64 ? t : t.slice(2), v = (t) => {
|
|
36
31
|
if (!t) return !1;
|
|
37
32
|
try {
|
|
38
33
|
const r = Buffer.from(t, "hex");
|
|
@@ -40,62 +35,53 @@ const U = (t) => t.length === 64 ? t : t.slice(2), V = (t) => {
|
|
|
40
35
|
} catch {
|
|
41
36
|
return !1;
|
|
42
37
|
}
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
arbitrum_sepolia: g,
|
|
48
|
-
ethereum_localnet: f,
|
|
49
|
-
arbitrum_localnet: h,
|
|
50
|
-
base_sepolia: L
|
|
51
|
-
}, j = async (t, r) => {
|
|
52
|
-
var n;
|
|
53
|
-
const e = C[t];
|
|
54
|
-
if (e)
|
|
38
|
+
}, A = async (t, r) => {
|
|
39
|
+
var e;
|
|
40
|
+
const n = h[t];
|
|
41
|
+
if (n)
|
|
55
42
|
try {
|
|
56
|
-
if (
|
|
43
|
+
if (n.id === ((e = r.chain) == null ? void 0 : e.id))
|
|
57
44
|
return i({ message: "Already on the network", walletClient: r });
|
|
58
|
-
await r.switchChain({ id:
|
|
45
|
+
await r.switchChain({ id: n.id });
|
|
59
46
|
const o = s({
|
|
60
47
|
account: r.account,
|
|
61
|
-
chain:
|
|
62
|
-
transport:
|
|
48
|
+
chain: n,
|
|
49
|
+
transport: f(window.ethereum)
|
|
63
50
|
});
|
|
64
51
|
return i({
|
|
65
52
|
message: "Switched chain",
|
|
66
53
|
walletClient: o
|
|
67
54
|
});
|
|
68
55
|
} catch (o) {
|
|
69
|
-
if (
|
|
56
|
+
if (w(o))
|
|
70
57
|
try {
|
|
71
|
-
await r.addChain({ chain:
|
|
72
|
-
const
|
|
58
|
+
await r.addChain({ chain: n });
|
|
59
|
+
const a = s({
|
|
73
60
|
account: r.account,
|
|
74
|
-
chain:
|
|
75
|
-
transport:
|
|
61
|
+
chain: n,
|
|
62
|
+
transport: f(window.ethereum)
|
|
76
63
|
});
|
|
77
64
|
return i({
|
|
78
65
|
message: "Added network",
|
|
79
|
-
walletClient:
|
|
66
|
+
walletClient: a
|
|
80
67
|
});
|
|
81
68
|
} catch {
|
|
82
|
-
return
|
|
69
|
+
return c("Failed to add network");
|
|
83
70
|
}
|
|
84
71
|
else
|
|
85
|
-
return
|
|
72
|
+
return c("Failed to switch network");
|
|
86
73
|
}
|
|
87
74
|
else
|
|
88
|
-
return
|
|
89
|
-
},
|
|
75
|
+
return c("Chain not supported");
|
|
76
|
+
}, w = (t) => typeof t == "object" && t !== null && "code" in t && t.code === 4902, E = (t, r, n, e) => t + ":" + r.toLowerCase() + "::" + n + ":" + e.toLowerCase();
|
|
90
77
|
export {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
F as xOnlyPubkey
|
|
78
|
+
y as assert,
|
|
79
|
+
E as constructOrderPair,
|
|
80
|
+
v as isValidBitcoinPubKey,
|
|
81
|
+
m as prefixScriptLength,
|
|
82
|
+
L as serializeScript,
|
|
83
|
+
x as sortLeaves,
|
|
84
|
+
A as switchOrAddNetwork,
|
|
85
|
+
O as toXOnly,
|
|
86
|
+
C as xOnlyPubkey
|
|
101
87
|
};
|
package/dist/index11.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("@catalogfi/wallets"),H=require("bitcoinjs-lib"),O=require("tiny-secp256k1"),P=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("@catalogfi/wallets"),H=require("bitcoinjs-lib"),O=require("tiny-secp256k1"),P=require("./index26.cjs"),f=require("./index10.cjs"),u=require("./index27.cjs");function S(p){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const r in p)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(p,r);Object.defineProperty(e,r,t.get?t:{enumerable:!0,get:()=>p[r]})}}return e.default=p,Object.freeze(e)}const h=S(H),k=S(O),m=192;h.initEccLib(k);class v{constructor(e,r,t,s,i,a,d,o){this.secretHash=t,this.redeemerPubkey=s,this.initiatorPubkey=i,this.expiry=a,this.signer=e,this.network=d,this.internalPubkey=P.generateInternalkey(),this.initiateAmount=r,this.utxoHashes=o}static async from(e,r,t,s,i,a,d){t=t.startsWith("0x")?t.slice(2):t,f.assert(t.length===64,u.htlcErrors.secretHashLenMismatch),f.assert(s.length===64||s.length===66,`initiator ${u.htlcErrors.pubkeyLenMismatch}`),f.assert(i.length===64||i.length===66,`redeemer ${u.htlcErrors.pubkeyLenMismatch}`),f.assert(a>0,u.htlcErrors.zeroOrNegativeExpiry);const o=await e.getNetwork();return new v(e,r,t,f.xOnlyPubkey(i).toString("hex"),f.xOnlyPubkey(s).toString("hex"),a,o,d)}address(){const{address:e}=h.payments.p2tr({internalPubkey:this.internalPubkey,network:this.network,scriptTree:this.leaves()});if(!e)throw new Error(u.htlcErrors.htlcAddressGenerationFailed);return e}id(){return this.address()}async _buildRawTx(e,r){const t=new h.Transaction;t.version=2;const s=this.address(),i=await this.signer.getProvider();let a=[];if(this.utxoHashes&&this.utxoHashes.length>0)for(const o of this.utxoHashes){const l=await i.getTransaction(o);for(let g=0;g<l.vout.length;g++){const n=l.vout[g];n.scriptpubkey_address===s&&a.push({txid:l.txid,vout:g,value:n.value,status:{confirmed:!1}})}}else a=await i.getUTXOs(s);const d=a.reduce((o,l)=>o+l.value,0);if(d===0)throw new Error(`${s} ${u.htlcErrors.notFunded}`);for(let o=0;o<a.length;o++)t.addInput(Buffer.from(a[o].txid,"hex").reverse(),a[o].vout);return r??(r=await i.suggestFee(s,d,b.Urgency.MEDIUM)),t.addOutput(h.address.toOutputScript(e,this.network),d-r),{tx:t,usedUtxos:a}}async buildRawTx(e){return await this._buildRawTx(await this.signer.getAddress(),e)}getOutputScript(){return h.address.toOutputScript(this.address(),this.network)}async init(e){return e??(e=await(await this.signer.getProvider()).suggestFee(await this.signer.getAddress(),this.initiateAmount,b.Urgency.MEDIUM)),await this.signer.send(this.address(),this.initiateAmount,e)}async instantRefund(e,r){f.assert(e.length>0,u.htlcErrors.noCounterpartySigs);const{tx:t,usedUtxos:s}=await this.buildRawTx(r);for(const n of s)if(!e.find(c=>c.utxo===n.txid))throw new Error(u.htlcErrors.counterPartySigNotFound(n.txid));const i=this.getOutputScript(),a=h.Transaction.SIGHASH_DEFAULT,d=this.leafHash(2),o=s.map(n=>n.value),l=y(i,s.length);for(let n=0;n<t.ins.length;n++){const c=t.hashForWitnessV1(n,l,o,a,d);if(!k.verifySchnorr(c,Buffer.from(this.redeemerPubkey,"hex"),Buffer.from(e[n].sig,"hex")))throw new Error(u.htlcErrors.invalidCounterpartySigForUTXO(e[n].utxo));const w=await this.signer.signSchnorr(c),x=Buffer.from(t.ins[n].hash).reverse().toString("hex"),E=e.find(L=>L.utxo===x);if(!E)throw new Error(u.htlcErrors.counterPartySigNotFound(x));t.setWitness(n,[Buffer.from(E.sig,"hex"),w,this.instantRefundLeaf(),this.generateControlBlockFor(2)])}return await(await this.signer.getProvider()).broadcast(t.toHex())}async redeem(e,r,t){f.assert(h.crypto.sha256(Buffer.from(e,"hex")).toString("hex")===this.secretHash,u.htlcErrors.secretMismatch);const{tx:s,usedUtxos:i}=await this._buildRawTx(r??await this.signer.getAddress(),t),a=this.leafHash(1),d=i.map(n=>n.value),o=y(this.getOutputScript(),i.length),l=h.Transaction.SIGHASH_DEFAULT;for(let n=0;n<s.ins.length;n++){const c=s.hashForWitnessV1(n,o,d,l,a),w=await this.signer.signSchnorr(c);s.setWitness(n,[w,Buffer.from(e,"hex"),this.redeemLeaf(),this.generateControlBlockFor(1)])}return await(await this.signer.getProvider()).broadcast(s.toHex())}async refund(e,r){const{tx:t,usedUtxos:s}=await this._buildRawTx(e??await this.signer.getAddress(),r),[i,a]=await this.canRefund(s);if(!i)throw new Error(u.htlcErrors.htlcNotExpired(a));const d=this.leafHash(0),o=s.map(c=>c.value),l=y(this.getOutputScript(),s.length),g=h.Transaction.SIGHASH_DEFAULT;for(let c=0;c<t.ins.length;c++){t.ins[c].sequence=this.expiry;const w=t.hashForWitnessV1(c,l,o,g,d),x=await this.signer.signSchnorr(w);t.setWitness(c,[x,this.refundLeaf(),this.generateControlBlockFor(0)])}return await(await this.signer.getProvider()).broadcast(t.toHex())}async canRefund(e){const t=await(await this.signer.getProvider()).getLatestTip();for(const s of e){let i=0;if(s.status.confirmed&&s.status.block_height+this.expiry>t?i=s.status.block_height+this.expiry-t+1:s.status.confirmed||(i=this.expiry+1),i>0)return[!1,i]}return[!0,0]}generateControlBlockFor(e){let r;switch(e){case 1:r=this.redeemLeaf();break;case 0:r=this.refundLeaf();break;case 2:r=this.instantRefundLeaf();break;default:throw new Error(u.htlcErrors.invalidLeaf)}const t=h.payments.p2tr({internalPubkey:this.internalPubkey,network:this.network,scriptTree:this.leaves(),redeem:{output:r,redeemVersion:m}});if(!t.witness)throw new Error(u.htlcErrors.controlBlockGenerationFailed);return t.witness[t.witness.length-1]}leafHash(e){let r=this.redeemLeaf();return e===0&&(r=this.refundLeaf()),e===2&&(r=this.instantRefundLeaf()),h.crypto.taggedHash("TapLeaf",f.serializeScript(r))}refundLeaf(){return h.script.fromASM(`
|
|
2
2
|
${h.script.number.encode(this.expiry).toString("hex")}
|
|
3
3
|
OP_CHECKSEQUENCEVERIFY
|
|
4
4
|
OP_DROP
|
package/dist/index11.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Urgency as y } from "@catalogfi/wallets";
|
|
2
2
|
import * as h from "bitcoinjs-lib";
|
|
3
3
|
import * as k from "tiny-secp256k1";
|
|
4
|
-
import { generateInternalkey as b } from "./
|
|
4
|
+
import { generateInternalkey as b } from "./index26.js";
|
|
5
5
|
import { assert as g, xOnlyPubkey as L, serializeScript as P, sortLeaves as O } from "./index10.js";
|
|
6
|
-
import { htlcErrors as u } from "./
|
|
6
|
+
import { htlcErrors as u } from "./index27.js";
|
|
7
7
|
const m = 192;
|
|
8
8
|
h.initEccLib(k);
|
|
9
9
|
class H {
|
package/dist/index14.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("./index15.cjs");require("./
|
|
1
|
+
"use strict";const t=require("./index15.cjs");require("./index16.cjs");const n=require("./index17.cjs");(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.networks=e.ECPairFactory=e.default=void 0;var r=n.__exports;Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r.ECPairFactory}}),Object.defineProperty(e,"ECPairFactory",{enumerable:!0,get:function(){return r.ECPairFactory}}),Object.defineProperty(e,"networks",{enumerable:!0,get:function(){return r.networks}})})(t.__exports);
|
package/dist/index14.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __exports as t } from "./index15.js";
|
|
2
|
-
import "./
|
|
3
|
-
import { __exports as n } from "./
|
|
2
|
+
import "./index16.js";
|
|
3
|
+
import { __exports as n } from "./index17.js";
|
|
4
4
|
(function(e) {
|
|
5
5
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.networks = e.ECPairFactory = e.default = void 0;
|
|
6
6
|
var r = n;
|
package/dist/index16.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(
|
|
1
|
+
"use strict";var v=Object.defineProperty;var k=(r,o,f)=>o in r?v(r,o,{enumerable:!0,configurable:!0,writable:!0,value:f}):r[o]=f;var a=(r,o,f)=>k(r,typeof o!="symbol"?o+"":o,f);const c=require("./index17.cjs");require("./index18.cjs");require("./index19.cjs");const b=require("./index20.cjs"),P=require("./index21.cjs");require("./index22.cjs");const K=require("./index23.cjs"),x=require("./index24.cjs"),g=require("./index25.cjs");Object.defineProperty(c.__exports,"__esModule",{value:!0});c.__exports.ECPairFactory=c.__exports.networks=void 0;const p=K.__exports;c.__exports.networks=p;const n=x.__exports,E=b.browserExports,_=P.wif,B=g.__exports,y=n.typeforce.maybe(n.typeforce.compile({compressed:n.maybe(n.Boolean),network:n.maybe(n.Network)})),D=r=>r.length===32?r:r.slice(1,33);function F(r){(0,B.testEcc)(r);function o(s){return r.isPoint(s)}function f(s,e){if(n.typeforce(n.Buffer256bit,s),!r.isPrivate(s))throw new TypeError("Private key not in range [1, n)");return n.typeforce(y,e),new d(s,void 0,e)}function h(s,e){return n.typeforce(r.isPoint,s),n.typeforce(y,e),new d(void 0,s,e)}function l(s,e){const t=_.decode(s),i=t.version;if(n.Array(e)){if(e=e.filter(u=>i===u.wif).pop(),!e)throw new Error("Unknown network version")}else if(e=e||p.bitcoin,i!==e.wif)throw new Error("Invalid network version");return f(t.privateKey,{compressed:t.compressed,network:e})}function m(s){n.typeforce(y,s),s===void 0&&(s={});const e=s.rng||E;let t;do t=e(32),n.typeforce(n.Buffer256bit,t);while(!r.isPrivate(t));return f(t,s)}class d{constructor(e,t,i){a(this,"__D");a(this,"__Q");a(this,"compressed");a(this,"network");a(this,"lowR");this.__D=e,this.__Q=t,this.lowR=!1,i===void 0&&(i={}),this.compressed=i.compressed===void 0?!0:i.compressed,this.network=i.network||p.bitcoin,t!==void 0&&(this.__Q=Buffer.from(r.pointCompress(t,this.compressed)))}get privateKey(){return this.__D}get publicKey(){if(!this.__Q){const e=r.pointFromScalar(this.__D,this.compressed);this.__Q=Buffer.from(e)}return this.__Q}toWIF(){if(!this.__D)throw new Error("Missing private key");return _.encode(this.network.wif,this.__D,this.compressed)}tweak(e){return this.privateKey?this.tweakFromPrivateKey(e):this.tweakFromPublicKey(e)}sign(e,t){if(!this.__D)throw new Error("Missing private key");if(t===void 0&&(t=this.lowR),t===!1)return Buffer.from(r.sign(e,this.__D));{let i=r.sign(e,this.__D);const u=Buffer.alloc(32,0);let w=0;for(;i[0]>127;)w++,u.writeUIntLE(w,0,6),i=r.sign(e,this.__D,u);return Buffer.from(i)}}signSchnorr(e){if(!this.privateKey)throw new Error("Missing private key");if(!r.signSchnorr)throw new Error("signSchnorr not supported by ecc library");return Buffer.from(r.signSchnorr(e,this.privateKey))}verify(e,t){return r.verify(e,this.publicKey,t)}verifySchnorr(e,t){if(!r.verifySchnorr)throw new Error("verifySchnorr not supported by ecc library");return r.verifySchnorr(e,this.publicKey.subarray(1,33),t)}tweakFromPublicKey(e){const t=D(this.publicKey),i=r.xOnlyPointAddTweak(t,e);if(!i||i.xOnlyPubkey===null)throw new Error("Cannot tweak public key!");const u=Buffer.from([i.parity===0?2:3]);return h(Buffer.concat([u,i.xOnlyPubkey]),{network:this.network,compressed:this.compressed})}tweakFromPrivateKey(e){const i=this.publicKey[0]===3||this.publicKey[0]===4&&(this.publicKey[64]&1)===1?r.privateNegate(this.privateKey):this.privateKey,u=r.privateAdd(i,e);if(!u)throw new Error("Invalid tweaked private key!");return f(Buffer.from(u),{network:this.network,compressed:this.compressed})}}return{isPoint:o,fromPrivateKey:f,fromPublicKey:h,fromWIF:l,makeRandom:m}}c.__exports.ECPairFactory=F;module.exports=c.__exports;
|
package/dist/index16.js
CHANGED
|
@@ -1,34 +1,140 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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 "./index17.js";
|
|
5
|
+
import "./index18.js";
|
|
6
|
+
import "./index19.js";
|
|
7
|
+
import { b } from "./index20.js";
|
|
8
|
+
import { w as P } from "./index21.js";
|
|
9
|
+
import "./index22.js";
|
|
10
|
+
import { __exports as K } from "./index23.js";
|
|
11
|
+
import { __exports as g } from "./index24.js";
|
|
12
|
+
import { __exports as E } from "./index25.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
|
+
});
|
|
29
127
|
}
|
|
30
128
|
}
|
|
31
|
-
|
|
129
|
+
return {
|
|
130
|
+
isPoint: n,
|
|
131
|
+
fromPrivateKey: f,
|
|
132
|
+
fromPublicKey: h,
|
|
133
|
+
fromWIF: l,
|
|
134
|
+
makeRandom: _
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
p.ECPairFactory = F;
|
|
32
138
|
export {
|
|
33
|
-
|
|
139
|
+
p as default
|
|
34
140
|
};
|
package/dist/index17.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
package/dist/index17.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const t = /* @__PURE__ */ a({
|
|
3
|
-
id: 42161,
|
|
4
|
-
name: "Arbitrum One",
|
|
5
|
-
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
6
|
-
rpcUrls: {
|
|
7
|
-
default: {
|
|
8
|
-
http: ["https://arb1.arbitrum.io/rpc"]
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
blockExplorers: {
|
|
12
|
-
default: {
|
|
13
|
-
name: "Arbiscan",
|
|
14
|
-
url: "https://arbiscan.io",
|
|
15
|
-
apiUrl: "https://api.arbiscan.io/api"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
contracts: {
|
|
19
|
-
multicall3: {
|
|
20
|
-
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
21
|
-
blockCreated: 7654707
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
});
|
|
1
|
+
var r = {};
|
|
25
2
|
export {
|
|
26
|
-
|
|
3
|
+
r as __exports
|
|
27
4
|
};
|
package/dist/index18.cjs
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const e=require("./index23.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/index18.js
CHANGED
|
@@ -1,33 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { __exports as e } from "./index23.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
|
|
10
11
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
24
|
-
ensUniversalResolver: {
|
|
25
|
-
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
|
26
|
-
blockCreated: 5317080
|
|
27
|
-
}
|
|
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
|
|
28
23
|
},
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
pubKeyHash: 111,
|
|
25
|
+
scriptHash: 196,
|
|
26
|
+
wif: 239
|
|
27
|
+
};
|
|
31
28
|
export {
|
|
32
|
-
|
|
29
|
+
e as default
|
|
33
30
|
};
|
package/dist/index19.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const f=require("./index24.cjs"),y=require("./index28.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/index19.js
CHANGED
|
@@ -1,32 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
url: "https://sepolia.arbiscan.io",
|
|
19
|
-
apiUrl: "https://api-sepolia.arbiscan.io/api"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
contracts: {
|
|
23
|
-
multicall3: {
|
|
24
|
-
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
25
|
-
blockCreated: 81930
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
testnet: !0
|
|
29
|
-
});
|
|
30
|
-
export {
|
|
31
|
-
e as arbitrumSepolia
|
|
32
|
-
};
|
|
1
|
+
import { __exports as f } from "./index24.js";
|
|
2
|
+
import { t as y } from "./index28.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/index20.cjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index29.cjs"),s=require("./index30.cjs"),l=require("./index31.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;
|