@gardenfi/core 0.2.0-beta.73 → 0.2.0-beta.75
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 +16 -15
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +42 -31
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +18 -32
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +6 -366
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +33 -21
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +2 -56
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +38 -3
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +25 -45
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +7 -26
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +5 -2
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +11 -2
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +2 -62
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +2 -2
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +55 -32
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +2 -5
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +40 -2
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +38 -53
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +18 -2
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +101 -32
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +17 -39
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +224 -16
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +4 -109
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +155 -18
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +2 -226
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +73 -4
- package/dist/index122.cjs +1 -1
- package/dist/index122.js +55 -151
- package/dist/index123.cjs +1 -1
- package/dist/index123.js +35 -2
- package/dist/index124.cjs +1 -1
- package/dist/index124.js +5 -73
- package/dist/index125.cjs +1 -1
- package/dist/index125.js +2 -2
- package/dist/index126.cjs +1 -1
- package/dist/index126.js +8 -8
- package/dist/index127.cjs +1 -1
- package/dist/index127.js +1 -1
- package/dist/index130.cjs +1 -1
- package/dist/index130.js +2 -19
- package/dist/index131.cjs +1 -1
- package/dist/index131.js +356 -2
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +206 -323
- package/dist/index133.cjs +1 -1
- package/dist/index133.js +37 -208
- package/dist/index134.cjs +1 -1
- package/dist/index134.js +59 -65
- package/dist/index135.cjs +1 -1
- package/dist/index135.js +10 -60
- package/dist/index136.cjs +1 -1
- package/dist/index136.js +45 -12
- package/dist/index137.cjs +1 -1
- package/dist/index137.js +56 -38
- package/dist/index138.cjs +1 -1
- package/dist/index138.js +19 -63
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +9 -4
- package/dist/index141.cjs +1 -1
- package/dist/index141.js +3 -3
- package/dist/index145.cjs +1 -1
- package/dist/index145.js +1 -1
- package/dist/index148.cjs +1 -1
- package/dist/index148.js +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +32 -2
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +10 -17
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +18 -12
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +15 -16
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +39 -16
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +25 -52
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +2 -9
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +138 -9
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +2 -138
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +9 -2
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +7 -11
- package/dist/index26.cjs +3 -1
- package/dist/index26.js +27 -36
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +17 -44
- package/dist/index28.cjs +2 -1
- package/dist/index28.js +24 -27
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +40 -14
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +197 -22
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +2 -26
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +2 -55
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +2 -28
- package/dist/index34.cjs +1 -3
- package/dist/index34.js +11 -26
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +39 -17
- package/dist/index36.cjs +1 -2
- package/dist/index36.js +40 -23
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +26 -39
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +15 -199
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +24 -2
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +26 -2
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +55 -2
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +27 -12
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +174 -11
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +2 -4
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +34 -45
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +9 -43
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +10 -169
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +11 -12
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +3 -4
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +48 -59
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +45 -16
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +40 -9
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +167 -170
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +12 -21
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +5 -2
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +17 -35
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +11 -8
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +19 -34
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +31 -55
- package/dist/index59.cjs +1 -2
- package/dist/index59.js +2 -60
- package/dist/index60.cjs +6 -1
- package/dist/index60.js +949 -6
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +2 -128
- package/dist/index62.cjs +1 -2
- package/dist/index62.js +61 -42
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +33 -9
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +86 -10
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +55 -11
- package/dist/index66.cjs +2 -1
- package/dist/index66.js +59 -13
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +3 -6
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +33 -16
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +126 -77
- package/dist/index70.cjs +2 -1
- package/dist/index70.js +42 -14
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +8 -18
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +9 -5
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +11 -21
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +13 -13
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +7 -2
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +18 -2
- package/dist/index77.cjs +1 -2
- package/dist/index77.js +76 -32
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +14 -5
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +18 -19
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +5 -6
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +19 -29
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +14 -2
- package/dist/index82.cjs +1 -6
- package/dist/index82.js +9 -949
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +2 -2
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +2 -62
- package/dist/index85.cjs +2 -1
- package/dist/index85.js +34 -32
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +5 -86
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +19 -12
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +34 -6
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +365 -111
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +21 -7
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +55 -32
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +3 -2
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +45 -34
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +26 -29
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +2 -21
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +2 -7
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +13 -5
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +6 -10
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +111 -18
- package/dist/src/index.d.ts +1 -1
- package/dist/src/lib/evm/relay/evmRelay.d.ts +1 -1
- package/dist/src/lib/evm/relay/evmRelay.types.d.ts +1 -1
- package/dist/src/lib/utils.d.ts +2 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index2.cjs"),t=require("./index3.cjs"),i=require("./index4.cjs"),o=require("./index5.cjs"),a=require("./index6.cjs"),e=require("./index7.cjs"),c=require("./index8.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index2.cjs"),t=require("./index3.cjs"),i=require("./index4.cjs"),o=require("./index5.cjs"),a=require("./index6.cjs"),e=require("./index7.cjs"),c=require("./index8.cjs"),d=require("./index9.cjs"),r=require("./index10.cjs");exports.Garden=s.Garden;exports.OrderActions=t.OrderActions;exports.TimeLocks=t.TimeLocks;exports.BlockNumberFetcher=i.BlockNumberFetcher;exports.EvmRelay=o.EvmRelay;exports.OrderStatus=a.OrderStatus;exports.SwapStatus=a.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=d.Quote;exports.constructOrderPair=r.constructOrderPair;exports.evmToViemChainMap=r.evmToViemChainMap;exports.switchOrAddNetwork=r.switchOrAddNetwork;exports.validateBTCAddress=r.validateBTCAddress;
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { Garden as t } from "./index2.js";
|
|
2
|
-
import { OrderActions as a, TimeLocks as
|
|
3
|
-
import { BlockNumberFetcher as
|
|
4
|
-
import { EvmRelay as
|
|
2
|
+
import { OrderActions as a, TimeLocks as s } from "./index3.js";
|
|
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 u, ParseSwapStatus as S, filterDeadlineExpiredOrders as O, isExpired as l, parseAction as
|
|
6
|
+
import { ParseOrderStatus as u, ParseSwapStatus as S, filterDeadlineExpiredOrders as O, isExpired as l, parseAction as A, parseActionFromStatus as w } from "./index7.js";
|
|
7
7
|
import { SecretManager as k } from "./index8.js";
|
|
8
|
-
import { Quote as
|
|
9
|
-
import { constructOrderPair as
|
|
8
|
+
import { Quote as E } from "./index9.js";
|
|
9
|
+
import { constructOrderPair as T, evmToViemChainMap as B, switchOrAddNetwork as C, validateBTCAddress as F } 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
16
|
u as ParseOrderStatus,
|
|
17
17
|
S as ParseSwapStatus,
|
|
18
|
-
|
|
18
|
+
E as Quote,
|
|
19
19
|
k as SecretManager,
|
|
20
20
|
f as SwapStatus,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
s as TimeLocks,
|
|
22
|
+
T as constructOrderPair,
|
|
23
|
+
B as evmToViemChainMap,
|
|
24
24
|
O as filterDeadlineExpiredOrders,
|
|
25
25
|
l as isExpired,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
A as parseAction,
|
|
27
|
+
w as parseActionFromStatus,
|
|
28
|
+
C as switchOrAddNetwork,
|
|
29
|
+
F as validateBTCAddress
|
|
29
30
|
};
|
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 u=require("@gardenfi/orderbook"),o=require("viem"),p=require("varuint-bitcoin"),i=require("@catalogfi/utils"),b=require("tiny-secp256k1"),w=require("bitcoinjs-lib"),g=require("./index15.cjs"),O=require("./index16.cjs"),y=require("./index17.cjs"),S=require("./index18.cjs"),_=require("./index19.cjs");function a(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const l=a(p),f=a(b),d=a(w);function q(e){return typeof e=="string"&&(e=Buffer.from(e,"hex")),e.length===32?e:e.subarray(1,33)}function v(e,t){if(!e)throw new Error(t)}function C(e){return Buffer.concat([Uint8Array.from([192]),h(e)])}function h(e){const t=l.encodingLength(e.length),r=Buffer.allocUnsafe(t);return l.encode(e.length,r),Buffer.concat([r,e])}function L(e,t){if(e.compare(t)>0){const r=e;e=t,t=r}return[e,t]}const B=e=>e.length===64?e:e.slice(2),P=e=>{if(!e)return!1;try{const t=Buffer.from(e,"hex");return f.isPoint(t)}catch{return!1}},m={ethereum:g.mainnet,ethereum_arbitrum:O.arbitrum,ethereum_sepolia:y.sepolia,arbitrum_sepolia:S.arbitrumSepolia,ethereum_localnet:u.EthereumLocalnet,arbitrum_localnet:u.ArbitrumLocalnet,base_sepolia:_.baseSepolia},k=async(e,t)=>{var n;const r=m[e];if(r)try{if(r.id===((n=t.chain)==null?void 0:n.id))return i.Ok({message:"Already on the network",walletClient:t});await t.switchChain({id:r.id});const c=o.createWalletClient({account:t.account,chain:r,transport:o.custom(window.ethereum)});return i.Ok({message:"Switched chain",walletClient:c})}catch(c){if(A(c))try{await t.addChain({chain:r});const s=o.createWalletClient({account:t.account,chain:r,transport:o.custom(window.ethereum)});return i.Ok({message:"Added network",walletClient:s})}catch{return i.Err("Failed to add network")}else return i.Err("Failed to switch network")}else return i.Err("Chain not supported")},A=e=>typeof e=="object"&&e!==null&&"code"in e&&e.code===4902,E=(e,t,r,n)=>e+":"+t.toLowerCase()+"::"+r+":"+n.toLowerCase();function j(e,t){if(!e)return!1;d.initEccLib(f);try{return d.address.toOutputScript(e,t),!0}catch{return!1}}exports.assert=v;exports.constructOrderPair=E;exports.evmToViemChainMap=m;exports.isValidBitcoinPubKey=P;exports.prefixScriptLength=h;exports.serializeScript=C;exports.sortLeaves=L;exports.switchOrAddNetwork=k;exports.toXOnly=B;exports.validateBTCAddress=j;exports.xOnlyPubkey=q;
|
package/dist/index10.js
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
import "@gardenfi/utils";
|
|
2
|
-
import { EthereumLocalnet as
|
|
3
|
-
import { createWalletClient as s, custom as
|
|
4
|
-
import * as
|
|
2
|
+
import { EthereumLocalnet as d, ArbitrumLocalnet as l } from "@gardenfi/orderbook";
|
|
3
|
+
import { createWalletClient as s, custom as u } from "viem";
|
|
4
|
+
import * as m from "varuint-bitcoin";
|
|
5
5
|
import { Ok as i, Err as a } from "@catalogfi/utils";
|
|
6
|
-
import * as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
6
|
+
import * as h from "tiny-secp256k1";
|
|
7
|
+
import * as f from "bitcoinjs-lib";
|
|
8
|
+
import { mainnet as p } from "./index15.js";
|
|
9
|
+
import { arbitrum as w } from "./index16.js";
|
|
10
|
+
import { sepolia as g } from "./index17.js";
|
|
11
|
+
import { arbitrumSepolia as L } from "./index18.js";
|
|
12
|
+
import { baseSepolia as b } from "./index19.js";
|
|
13
|
+
function W(t) {
|
|
13
14
|
return typeof t == "string" && (t = Buffer.from(t, "hex")), t.length === 32 ? t : t.subarray(1, 33);
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function k(t, r) {
|
|
16
17
|
if (!t) throw new Error(r);
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function N(t) {
|
|
19
20
|
return Buffer.concat([
|
|
20
21
|
Uint8Array.from([192]),
|
|
21
22
|
B(t)
|
|
22
23
|
]);
|
|
23
24
|
}
|
|
24
25
|
function B(t) {
|
|
25
|
-
const r =
|
|
26
|
-
return
|
|
26
|
+
const r = m.encodingLength(t.length), e = Buffer.allocUnsafe(r);
|
|
27
|
+
return m.encode(t.length, e), Buffer.concat([e, t]);
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function T(t, r) {
|
|
29
30
|
if (t.compare(r) > 0) {
|
|
30
31
|
const e = t;
|
|
31
32
|
t = r, r = e;
|
|
@@ -36,18 +37,18 @@ const U = (t) => t.length === 64 ? t : t.slice(2), V = (t) => {
|
|
|
36
37
|
if (!t) return !1;
|
|
37
38
|
try {
|
|
38
39
|
const r = Buffer.from(t, "hex");
|
|
39
|
-
return
|
|
40
|
+
return h.isPoint(r);
|
|
40
41
|
} catch {
|
|
41
42
|
return !1;
|
|
42
43
|
}
|
|
43
44
|
}, C = {
|
|
44
|
-
ethereum:
|
|
45
|
-
ethereum_arbitrum:
|
|
46
|
-
ethereum_sepolia:
|
|
47
|
-
arbitrum_sepolia:
|
|
48
|
-
ethereum_localnet:
|
|
49
|
-
arbitrum_localnet:
|
|
50
|
-
base_sepolia:
|
|
45
|
+
ethereum: p,
|
|
46
|
+
ethereum_arbitrum: w,
|
|
47
|
+
ethereum_sepolia: g,
|
|
48
|
+
arbitrum_sepolia: L,
|
|
49
|
+
ethereum_localnet: d,
|
|
50
|
+
arbitrum_localnet: l,
|
|
51
|
+
base_sepolia: b
|
|
51
52
|
}, j = async (t, r) => {
|
|
52
53
|
var n;
|
|
53
54
|
const e = C[t];
|
|
@@ -59,20 +60,20 @@ const U = (t) => t.length === 64 ? t : t.slice(2), V = (t) => {
|
|
|
59
60
|
const o = s({
|
|
60
61
|
account: r.account,
|
|
61
62
|
chain: e,
|
|
62
|
-
transport:
|
|
63
|
+
transport: u(window.ethereum)
|
|
63
64
|
});
|
|
64
65
|
return i({
|
|
65
66
|
message: "Switched chain",
|
|
66
67
|
walletClient: o
|
|
67
68
|
});
|
|
68
69
|
} catch (o) {
|
|
69
|
-
if (
|
|
70
|
+
if (y(o))
|
|
70
71
|
try {
|
|
71
72
|
await r.addChain({ chain: e });
|
|
72
73
|
const c = s({
|
|
73
74
|
account: r.account,
|
|
74
75
|
chain: e,
|
|
75
|
-
transport:
|
|
76
|
+
transport: u(window.ethereum)
|
|
76
77
|
});
|
|
77
78
|
return i({
|
|
78
79
|
message: "Added network",
|
|
@@ -86,16 +87,26 @@ const U = (t) => t.length === 64 ? t : t.slice(2), V = (t) => {
|
|
|
86
87
|
}
|
|
87
88
|
else
|
|
88
89
|
return a("Chain not supported");
|
|
89
|
-
},
|
|
90
|
+
}, y = (t) => typeof t == "object" && t !== null && "code" in t && t.code === 4902, z = (t, r, e, n) => t + ":" + r.toLowerCase() + "::" + e + ":" + n.toLowerCase();
|
|
91
|
+
function D(t, r) {
|
|
92
|
+
if (!t) return !1;
|
|
93
|
+
f.initEccLib(h);
|
|
94
|
+
try {
|
|
95
|
+
return f.address.toOutputScript(t, r), !0;
|
|
96
|
+
} catch {
|
|
97
|
+
return !1;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
90
100
|
export {
|
|
91
|
-
|
|
101
|
+
k as assert,
|
|
92
102
|
z as constructOrderPair,
|
|
93
103
|
C as evmToViemChainMap,
|
|
94
104
|
V as isValidBitcoinPubKey,
|
|
95
105
|
B as prefixScriptLength,
|
|
96
|
-
|
|
97
|
-
|
|
106
|
+
N as serializeScript,
|
|
107
|
+
T as sortLeaves,
|
|
98
108
|
j as switchOrAddNetwork,
|
|
99
109
|
U as toXOnly,
|
|
100
|
-
|
|
110
|
+
D as validateBTCAddress,
|
|
111
|
+
W as xOnlyPubkey
|
|
101
112
|
};
|
package/dist/index100.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("./index66.cjs");class t extends o.BaseError{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class i extends o.BaseError{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class n extends o.BaseError{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}exports.NegativeOffsetError=t;exports.PositionOutOfBoundsError=i;exports.RecursiveReadLimitExceededError=n;
|
package/dist/index100.js
CHANGED
|
@@ -1,37 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { BaseError as o } from "./index66.js";
|
|
2
|
+
class i extends o {
|
|
3
|
+
constructor({ offset: e }) {
|
|
4
|
+
super(`Offset \`${e}\` cannot be negative.`, {
|
|
5
|
+
name: "NegativeOffsetError"
|
|
6
|
+
});
|
|
7
|
+
}
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
f = s(f, t, e, a, x[0], 3614090360, 7), a = s(a, f, t, e, x[1], 3905402710, 12), e = s(e, a, f, t, x[2], 606105819, 17), t = s(t, e, a, f, x[3], 3250441966, 22), f = s(f, t, e, a, x[4], 4118548399, 7), a = s(a, f, t, e, x[5], 1200080426, 12), e = s(e, a, f, t, x[6], 2821735955, 17), t = s(t, e, a, f, x[7], 4249261313, 22), f = s(f, t, e, a, x[8], 1770035416, 7), a = s(a, f, t, e, x[9], 2336552879, 12), e = s(e, a, f, t, x[10], 4294925233, 17), t = s(t, e, a, f, x[11], 2304563134, 22), f = s(f, t, e, a, x[12], 1804603682, 7), a = s(a, f, t, e, x[13], 4254626195, 12), e = s(e, a, f, t, x[14], 2792965006, 17), t = s(t, e, a, f, x[15], 1236535329, 22), f = c(f, t, e, a, x[1], 4129170786, 5), a = c(a, f, t, e, x[6], 3225465664, 9), e = c(e, a, f, t, x[11], 643717713, 14), t = c(t, e, a, f, x[0], 3921069994, 20), f = c(f, t, e, a, x[5], 3593408605, 5), a = c(a, f, t, e, x[10], 38016083, 9), e = c(e, a, f, t, x[15], 3634488961, 14), t = c(t, e, a, f, x[4], 3889429448, 20), f = c(f, t, e, a, x[9], 568446438, 5), a = c(a, f, t, e, x[14], 3275163606, 9), e = c(e, a, f, t, x[3], 4107603335, 14), t = c(t, e, a, f, x[8], 1163531501, 20), f = c(f, t, e, a, x[13], 2850285829, 5), a = c(a, f, t, e, x[2], 4243563512, 9), e = c(e, a, f, t, x[7], 1735328473, 14), t = c(t, e, a, f, x[12], 2368359562, 20), f = r(f, t, e, a, x[5], 4294588738, 4), a = r(a, f, t, e, x[8], 2272392833, 11), e = r(e, a, f, t, x[11], 1839030562, 16), t = r(t, e, a, f, x[14], 4259657740, 23), f = r(f, t, e, a, x[1], 2763975236, 4), a = r(a, f, t, e, x[4], 1272893353, 11), e = r(e, a, f, t, x[7], 4139469664, 16), t = r(t, e, a, f, x[10], 3200236656, 23), f = r(f, t, e, a, x[13], 681279174, 4), a = r(a, f, t, e, x[0], 3936430074, 11), e = r(e, a, f, t, x[3], 3572445317, 16), t = r(t, e, a, f, x[6], 76029189, 23), f = r(f, t, e, a, x[9], 3654602809, 4), a = r(a, f, t, e, x[12], 3873151461, 11), e = r(e, a, f, t, x[15], 530742520, 16), t = r(t, e, a, f, x[2], 3299628645, 23), f = d(f, t, e, a, x[0], 4096336452, 6), a = d(a, f, t, e, x[7], 1126891415, 10), e = d(e, a, f, t, x[14], 2878612391, 15), t = d(t, e, a, f, x[5], 4237533241, 21), f = d(f, t, e, a, x[12], 1700485571, 6), a = d(a, f, t, e, x[3], 2399980690, 10), e = d(e, a, f, t, x[10], 4293915773, 15), t = d(t, e, a, f, x[1], 2240044497, 21), f = d(f, t, e, a, x[8], 1873313359, 6), a = d(a, f, t, e, x[15], 4264355552, 10), e = d(e, a, f, t, x[6], 2734768916, 15), t = d(t, e, a, f, x[13], 1309151649, 21), f = d(f, t, e, a, x[4], 4149444226, 6), a = d(a, f, t, e, x[11], 3174756917, 10), e = d(e, a, f, t, x[2], 718787259, 15), t = d(t, e, a, f, x[9], 3951481745, 21), this._a = this._a + f | 0, this._b = this._b + t | 0, this._c = this._c + e | 0, this._d = this._d + a | 0;
|
|
13
|
-
};
|
|
14
|
-
h.prototype._digest = function() {
|
|
15
|
-
this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();
|
|
16
|
-
var x = v.allocUnsafe(16);
|
|
17
|
-
return x.writeInt32LE(this._a, 0), x.writeInt32LE(this._b, 4), x.writeInt32LE(this._c, 8), x.writeInt32LE(this._d, 12), x;
|
|
18
|
-
};
|
|
19
|
-
function _(x, i) {
|
|
20
|
-
return x << i | x >>> 32 - i;
|
|
21
|
-
}
|
|
22
|
-
function s(x, i, f, t, e, a, b) {
|
|
23
|
-
return _(x + (i & f | ~i & t) + e + a | 0, b) + i | 0;
|
|
24
|
-
}
|
|
25
|
-
function c(x, i, f, t, e, a, b) {
|
|
26
|
-
return _(x + (i & t | f & ~t) + e + a | 0, b) + i | 0;
|
|
27
|
-
}
|
|
28
|
-
function r(x, i, f, t, e, a, b) {
|
|
29
|
-
return _(x + (i ^ f ^ t) + e + a | 0, b) + i | 0;
|
|
9
|
+
class n extends o {
|
|
10
|
+
constructor({ length: e, position: r }) {
|
|
11
|
+
super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`, { name: "PositionOutOfBoundsError" });
|
|
12
|
+
}
|
|
30
13
|
}
|
|
31
|
-
|
|
32
|
-
|
|
14
|
+
class c extends o {
|
|
15
|
+
constructor({ count: e, limit: r }) {
|
|
16
|
+
super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`, { name: "RecursiveReadLimitExceededError" });
|
|
17
|
+
}
|
|
33
18
|
}
|
|
34
|
-
var I = h;
|
|
35
19
|
export {
|
|
36
|
-
|
|
20
|
+
i as NegativeOffsetError,
|
|
21
|
+
n as PositionOutOfBoundsError,
|
|
22
|
+
c as RecursiveReadLimitExceededError
|
|
37
23
|
};
|
package/dist/index101.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index50.cjs"),r=require("./index98.cjs");function c(t){const{commitment:o,version:s=1}=t,n=t.to??(typeof o=="string"?"hex":"bytes"),e=r.sha256(o);return e.set([s],0),n==="bytes"?e:i.bytesToHex(e)}exports.commitmentToVersionedHash=c;
|
package/dist/index101.js
CHANGED
|
@@ -1,369 +1,9 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
0,
|
|
7
|
-
1,
|
|
8
|
-
2,
|
|
9
|
-
3,
|
|
10
|
-
4,
|
|
11
|
-
5,
|
|
12
|
-
6,
|
|
13
|
-
7,
|
|
14
|
-
8,
|
|
15
|
-
9,
|
|
16
|
-
10,
|
|
17
|
-
11,
|
|
18
|
-
12,
|
|
19
|
-
13,
|
|
20
|
-
14,
|
|
21
|
-
15,
|
|
22
|
-
7,
|
|
23
|
-
4,
|
|
24
|
-
13,
|
|
25
|
-
1,
|
|
26
|
-
10,
|
|
27
|
-
6,
|
|
28
|
-
15,
|
|
29
|
-
3,
|
|
30
|
-
12,
|
|
31
|
-
0,
|
|
32
|
-
9,
|
|
33
|
-
5,
|
|
34
|
-
2,
|
|
35
|
-
14,
|
|
36
|
-
11,
|
|
37
|
-
8,
|
|
38
|
-
3,
|
|
39
|
-
10,
|
|
40
|
-
14,
|
|
41
|
-
4,
|
|
42
|
-
9,
|
|
43
|
-
15,
|
|
44
|
-
8,
|
|
45
|
-
1,
|
|
46
|
-
2,
|
|
47
|
-
7,
|
|
48
|
-
0,
|
|
49
|
-
6,
|
|
50
|
-
13,
|
|
51
|
-
11,
|
|
52
|
-
5,
|
|
53
|
-
12,
|
|
54
|
-
1,
|
|
55
|
-
9,
|
|
56
|
-
11,
|
|
57
|
-
10,
|
|
58
|
-
0,
|
|
59
|
-
8,
|
|
60
|
-
12,
|
|
61
|
-
4,
|
|
62
|
-
13,
|
|
63
|
-
3,
|
|
64
|
-
7,
|
|
65
|
-
15,
|
|
66
|
-
14,
|
|
67
|
-
5,
|
|
68
|
-
6,
|
|
69
|
-
2,
|
|
70
|
-
4,
|
|
71
|
-
0,
|
|
72
|
-
5,
|
|
73
|
-
9,
|
|
74
|
-
7,
|
|
75
|
-
12,
|
|
76
|
-
2,
|
|
77
|
-
10,
|
|
78
|
-
14,
|
|
79
|
-
1,
|
|
80
|
-
3,
|
|
81
|
-
8,
|
|
82
|
-
11,
|
|
83
|
-
6,
|
|
84
|
-
15,
|
|
85
|
-
13
|
|
86
|
-
], x = [
|
|
87
|
-
5,
|
|
88
|
-
14,
|
|
89
|
-
7,
|
|
90
|
-
0,
|
|
91
|
-
9,
|
|
92
|
-
2,
|
|
93
|
-
11,
|
|
94
|
-
4,
|
|
95
|
-
13,
|
|
96
|
-
6,
|
|
97
|
-
15,
|
|
98
|
-
8,
|
|
99
|
-
1,
|
|
100
|
-
10,
|
|
101
|
-
3,
|
|
102
|
-
12,
|
|
103
|
-
6,
|
|
104
|
-
11,
|
|
105
|
-
3,
|
|
106
|
-
7,
|
|
107
|
-
0,
|
|
108
|
-
13,
|
|
109
|
-
5,
|
|
110
|
-
10,
|
|
111
|
-
14,
|
|
112
|
-
15,
|
|
113
|
-
8,
|
|
114
|
-
12,
|
|
115
|
-
4,
|
|
116
|
-
9,
|
|
117
|
-
1,
|
|
118
|
-
2,
|
|
119
|
-
15,
|
|
120
|
-
5,
|
|
121
|
-
1,
|
|
122
|
-
3,
|
|
123
|
-
7,
|
|
124
|
-
14,
|
|
125
|
-
6,
|
|
126
|
-
9,
|
|
127
|
-
11,
|
|
128
|
-
8,
|
|
129
|
-
12,
|
|
130
|
-
2,
|
|
131
|
-
10,
|
|
132
|
-
0,
|
|
133
|
-
4,
|
|
134
|
-
13,
|
|
135
|
-
8,
|
|
136
|
-
6,
|
|
137
|
-
4,
|
|
138
|
-
1,
|
|
139
|
-
3,
|
|
140
|
-
11,
|
|
141
|
-
15,
|
|
142
|
-
0,
|
|
143
|
-
5,
|
|
144
|
-
12,
|
|
145
|
-
2,
|
|
146
|
-
13,
|
|
147
|
-
9,
|
|
148
|
-
7,
|
|
149
|
-
10,
|
|
150
|
-
14,
|
|
151
|
-
12,
|
|
152
|
-
15,
|
|
153
|
-
10,
|
|
154
|
-
4,
|
|
155
|
-
1,
|
|
156
|
-
5,
|
|
157
|
-
8,
|
|
158
|
-
7,
|
|
159
|
-
6,
|
|
160
|
-
2,
|
|
161
|
-
13,
|
|
162
|
-
14,
|
|
163
|
-
0,
|
|
164
|
-
3,
|
|
165
|
-
9,
|
|
166
|
-
11
|
|
167
|
-
], p = [
|
|
168
|
-
11,
|
|
169
|
-
14,
|
|
170
|
-
15,
|
|
171
|
-
12,
|
|
172
|
-
5,
|
|
173
|
-
8,
|
|
174
|
-
7,
|
|
175
|
-
9,
|
|
176
|
-
11,
|
|
177
|
-
13,
|
|
178
|
-
14,
|
|
179
|
-
15,
|
|
180
|
-
6,
|
|
181
|
-
7,
|
|
182
|
-
9,
|
|
183
|
-
8,
|
|
184
|
-
7,
|
|
185
|
-
6,
|
|
186
|
-
8,
|
|
187
|
-
13,
|
|
188
|
-
11,
|
|
189
|
-
9,
|
|
190
|
-
7,
|
|
191
|
-
15,
|
|
192
|
-
7,
|
|
193
|
-
12,
|
|
194
|
-
15,
|
|
195
|
-
9,
|
|
196
|
-
11,
|
|
197
|
-
7,
|
|
198
|
-
13,
|
|
199
|
-
12,
|
|
200
|
-
11,
|
|
201
|
-
13,
|
|
202
|
-
6,
|
|
203
|
-
7,
|
|
204
|
-
14,
|
|
205
|
-
9,
|
|
206
|
-
13,
|
|
207
|
-
15,
|
|
208
|
-
14,
|
|
209
|
-
8,
|
|
210
|
-
13,
|
|
211
|
-
6,
|
|
212
|
-
5,
|
|
213
|
-
12,
|
|
214
|
-
7,
|
|
215
|
-
5,
|
|
216
|
-
11,
|
|
217
|
-
12,
|
|
218
|
-
14,
|
|
219
|
-
15,
|
|
220
|
-
14,
|
|
221
|
-
15,
|
|
222
|
-
9,
|
|
223
|
-
8,
|
|
224
|
-
9,
|
|
225
|
-
14,
|
|
226
|
-
5,
|
|
227
|
-
6,
|
|
228
|
-
8,
|
|
229
|
-
6,
|
|
230
|
-
5,
|
|
231
|
-
12,
|
|
232
|
-
9,
|
|
233
|
-
15,
|
|
234
|
-
5,
|
|
235
|
-
11,
|
|
236
|
-
6,
|
|
237
|
-
8,
|
|
238
|
-
13,
|
|
239
|
-
12,
|
|
240
|
-
5,
|
|
241
|
-
12,
|
|
242
|
-
13,
|
|
243
|
-
14,
|
|
244
|
-
11,
|
|
245
|
-
8,
|
|
246
|
-
5,
|
|
247
|
-
6
|
|
248
|
-
], k = [
|
|
249
|
-
8,
|
|
250
|
-
9,
|
|
251
|
-
9,
|
|
252
|
-
11,
|
|
253
|
-
13,
|
|
254
|
-
15,
|
|
255
|
-
15,
|
|
256
|
-
5,
|
|
257
|
-
7,
|
|
258
|
-
7,
|
|
259
|
-
8,
|
|
260
|
-
11,
|
|
261
|
-
14,
|
|
262
|
-
14,
|
|
263
|
-
12,
|
|
264
|
-
6,
|
|
265
|
-
9,
|
|
266
|
-
13,
|
|
267
|
-
15,
|
|
268
|
-
7,
|
|
269
|
-
12,
|
|
270
|
-
8,
|
|
271
|
-
9,
|
|
272
|
-
11,
|
|
273
|
-
7,
|
|
274
|
-
7,
|
|
275
|
-
12,
|
|
276
|
-
7,
|
|
277
|
-
6,
|
|
278
|
-
15,
|
|
279
|
-
13,
|
|
280
|
-
11,
|
|
281
|
-
9,
|
|
282
|
-
7,
|
|
283
|
-
15,
|
|
284
|
-
11,
|
|
285
|
-
8,
|
|
286
|
-
6,
|
|
287
|
-
6,
|
|
288
|
-
14,
|
|
289
|
-
12,
|
|
290
|
-
13,
|
|
291
|
-
5,
|
|
292
|
-
14,
|
|
293
|
-
13,
|
|
294
|
-
13,
|
|
295
|
-
7,
|
|
296
|
-
5,
|
|
297
|
-
15,
|
|
298
|
-
5,
|
|
299
|
-
8,
|
|
300
|
-
11,
|
|
301
|
-
14,
|
|
302
|
-
14,
|
|
303
|
-
6,
|
|
304
|
-
14,
|
|
305
|
-
6,
|
|
306
|
-
9,
|
|
307
|
-
12,
|
|
308
|
-
9,
|
|
309
|
-
12,
|
|
310
|
-
5,
|
|
311
|
-
15,
|
|
312
|
-
8,
|
|
313
|
-
8,
|
|
314
|
-
5,
|
|
315
|
-
12,
|
|
316
|
-
9,
|
|
317
|
-
12,
|
|
318
|
-
5,
|
|
319
|
-
14,
|
|
320
|
-
6,
|
|
321
|
-
8,
|
|
322
|
-
13,
|
|
323
|
-
6,
|
|
324
|
-
5,
|
|
325
|
-
15,
|
|
326
|
-
13,
|
|
327
|
-
11,
|
|
328
|
-
11
|
|
329
|
-
], w = [0, 1518500249, 1859775393, 2400959708, 2840853838], E = [1352829926, 1548603684, 1836072691, 2053994217, 0];
|
|
330
|
-
function I() {
|
|
331
|
-
A.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520;
|
|
1
|
+
import { bytesToHex as i } from "./index50.js";
|
|
2
|
+
import { sha256 as m } from "./index98.js";
|
|
3
|
+
function f(t) {
|
|
4
|
+
const { commitment: e, version: s = 1 } = t, n = t.to ?? (typeof e == "string" ? "hex" : "bytes"), o = m(e);
|
|
5
|
+
return o.set([s], 0), n === "bytes" ? o : i(o);
|
|
332
6
|
}
|
|
333
|
-
H(I, A);
|
|
334
|
-
I.prototype._update = function() {
|
|
335
|
-
for (var t = M, e = 0; e < 16; ++e) t[e] = this._block.readInt32LE(e * 4);
|
|
336
|
-
for (var f = this._a | 0, s = this._b | 0, a = this._c | 0, h = this._d | 0, i = this._e | 0, _ = this._a | 0, n = this._b | 0, o = this._c | 0, c = this._d | 0, l = this._e | 0, r = 0; r < 80; r += 1) {
|
|
337
|
-
var b, d;
|
|
338
|
-
r < 16 ? (b = L(f, s, a, h, i, t[u[r]], w[0], p[r]), d = y(_, n, o, c, l, t[x[r]], E[0], k[r])) : r < 32 ? (b = O(f, s, a, h, i, t[u[r]], w[1], p[r]), d = g(_, n, o, c, l, t[x[r]], E[1], k[r])) : r < 48 ? (b = B(f, s, a, h, i, t[u[r]], w[2], p[r]), d = B(_, n, o, c, l, t[x[r]], E[2], k[r])) : r < 64 ? (b = g(f, s, a, h, i, t[u[r]], w[3], p[r]), d = O(_, n, o, c, l, t[x[r]], E[3], k[r])) : (b = y(f, s, a, h, i, t[u[r]], w[4], p[r]), d = L(_, n, o, c, l, t[x[r]], E[4], k[r])), f = i, i = h, h = v(a, 10), a = s, s = b, _ = l, l = c, c = v(o, 10), o = n, n = d;
|
|
339
|
-
}
|
|
340
|
-
var R = this._b + a + c | 0;
|
|
341
|
-
this._b = this._c + h + l | 0, this._c = this._d + i + _ | 0, this._d = this._e + f + n | 0, this._e = this._a + s + o | 0, this._a = R;
|
|
342
|
-
};
|
|
343
|
-
I.prototype._digest = function() {
|
|
344
|
-
this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();
|
|
345
|
-
var t = m.alloc ? m.alloc(20) : new m(20);
|
|
346
|
-
return t.writeInt32LE(this._a, 0), t.writeInt32LE(this._b, 4), t.writeInt32LE(this._c, 8), t.writeInt32LE(this._d, 12), t.writeInt32LE(this._e, 16), t;
|
|
347
|
-
};
|
|
348
|
-
function v(t, e) {
|
|
349
|
-
return t << e | t >>> 32 - e;
|
|
350
|
-
}
|
|
351
|
-
function L(t, e, f, s, a, h, i, _) {
|
|
352
|
-
return v(t + (e ^ f ^ s) + h + i | 0, _) + a | 0;
|
|
353
|
-
}
|
|
354
|
-
function O(t, e, f, s, a, h, i, _) {
|
|
355
|
-
return v(t + (e & f | ~e & s) + h + i | 0, _) + a | 0;
|
|
356
|
-
}
|
|
357
|
-
function B(t, e, f, s, a, h, i, _) {
|
|
358
|
-
return v(t + ((e | ~f) ^ s) + h + i | 0, _) + a | 0;
|
|
359
|
-
}
|
|
360
|
-
function g(t, e, f, s, a, h, i, _) {
|
|
361
|
-
return v(t + (e & s | f & ~s) + h + i | 0, _) + a | 0;
|
|
362
|
-
}
|
|
363
|
-
function y(t, e, f, s, a, h, i, _) {
|
|
364
|
-
return v(t + (e ^ (f | ~s)) + h + i | 0, _) + a | 0;
|
|
365
|
-
}
|
|
366
|
-
var F = I;
|
|
367
7
|
export {
|
|
368
|
-
|
|
8
|
+
f as commitmentToVersionedHash
|
|
369
9
|
};
|
package/dist/index102.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 o=require("./index124.cjs"),y=require("./index104.cjs"),u=require("./index69.cjs"),B=require("./index54.cjs"),h=require("./index65.cjs"),d=require("./index50.cjs");function f(t){const a=t.to??(typeof t.data=="string"?"hex":"bytes"),n=typeof t.data=="string"?h.hexToBytes(t.data):t.data,s=B.size(n);if(!s)throw new y.EmptyBlobError;if(s>o.maxBytesPerTransaction)throw new y.BlobSizeTooLargeError({maxSize:o.maxBytesPerTransaction,size:s});const r=[];let b=!0,i=0;for(;b;){const e=u.createCursor(new Uint8Array(o.bytesPerBlob));let l=0;for(;l<o.fieldElementsPerBlob;){const c=n.slice(i,i+(o.bytesPerFieldElement-1));if(e.pushByte(0),e.pushBytes(c),c.length<31){e.pushByte(128),b=!1;break}l++,i+=31}r.push(e)}return a==="bytes"?r.map(e=>e.bytes):r.map(e=>d.bytesToHex(e.bytes))}exports.toBlobs=f;
|