@gardenfi/core 0.2.0-beta.74 → 0.2.0-beta.76
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 +31 -1
- package/dist/index.js +7813 -27
- 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 +1 -1
- package/dist/index10.cjs +0 -1
- package/dist/index10.js +0 -101
- 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/index11.cjs +0 -20
- package/dist/index11.js +0 -380
- package/dist/index110.cjs +0 -1
- package/dist/index110.js +0 -37
- package/dist/index111.cjs +0 -1
- package/dist/index111.js +0 -7
- package/dist/index112.cjs +0 -1
- package/dist/index112.js +0 -4
- package/dist/index113.cjs +0 -1
- package/dist/index113.js +0 -60
- package/dist/index114.cjs +0 -1
- package/dist/index114.js +0 -4
- package/dist/index115.cjs +0 -1
- package/dist/index115.js +0 -42
- package/dist/index116.cjs +0 -1
- package/dist/index116.js +0 -45
- package/dist/index117.cjs +0 -1
- package/dist/index117.js +0 -20
- package/dist/index118.cjs +0 -1
- package/dist/index118.js +0 -111
- package/dist/index119.cjs +0 -1
- package/dist/index119.js +0 -23
- package/dist/index12.cjs +0 -1
- package/dist/index12.js +0 -22
- package/dist/index120.cjs +0 -1
- package/dist/index120.js +0 -228
- package/dist/index121.cjs +0 -1
- package/dist/index121.js +0 -6
- package/dist/index122.cjs +0 -1
- package/dist/index122.js +0 -160
- package/dist/index123.cjs +0 -1
- package/dist/index123.js +0 -4
- package/dist/index124.cjs +0 -1
- package/dist/index124.js +0 -75
- 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 -4
- package/dist/index129.cjs +0 -1
- package/dist/index129.js +0 -32
- package/dist/index13.cjs +0 -1
- package/dist/index13.js +0 -396
- 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/index14.cjs +0 -1
- package/dist/index14.js +0 -23
- 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/index15.cjs +0 -1
- package/dist/index15.js +0 -4
- package/dist/index16.cjs +0 -1
- package/dist/index16.js +0 -34
- package/dist/index17.cjs +0 -1
- package/dist/index17.js +0 -27
- package/dist/index18.cjs +0 -1
- package/dist/index18.js +0 -33
- package/dist/index19.cjs +0 -1
- package/dist/index19.js +0 -32
- package/dist/index2.cjs +0 -1
- package/dist/index2.js +0 -412
- package/dist/index20.cjs +0 -1
- package/dist/index20.js +0 -55
- package/dist/index21.cjs +0 -1
- package/dist/index21.js +0 -11
- package/dist/index22.cjs +0 -1
- package/dist/index22.js +0 -11
- package/dist/index23.cjs +0 -1
- package/dist/index23.js +0 -140
- package/dist/index24.cjs +0 -1
- package/dist/index24.js +0 -4
- package/dist/index25.cjs +0 -1
- package/dist/index25.js +0 -15
- package/dist/index26.cjs +0 -1
- package/dist/index26.js +0 -39
- package/dist/index27.cjs +0 -1
- package/dist/index27.js +0 -44
- package/dist/index28.cjs +0 -1
- package/dist/index28.js +0 -30
- package/dist/index29.cjs +0 -1
- package/dist/index29.js +0 -17
- package/dist/index3.cjs +0 -1
- package/dist/index3.js +0 -5
- package/dist/index30.cjs +0 -1
- package/dist/index30.js +0 -26
- package/dist/index31.cjs +0 -1
- package/dist/index31.js +0 -28
- package/dist/index32.cjs +0 -1
- package/dist/index32.js +0 -57
- package/dist/index33.cjs +0 -1
- package/dist/index33.js +0 -30
- package/dist/index34.cjs +0 -3
- package/dist/index34.js +0 -30
- package/dist/index35.cjs +0 -1
- package/dist/index35.js +0 -17
- package/dist/index36.cjs +0 -2
- package/dist/index36.js +0 -27
- package/dist/index37.cjs +0 -1
- package/dist/index37.js +0 -43
- package/dist/index38.cjs +0 -1
- package/dist/index38.js +0 -201
- package/dist/index39.cjs +0 -1
- package/dist/index39.js +0 -4
- package/dist/index4.cjs +0 -1
- package/dist/index4.js +0 -18
- package/dist/index40.cjs +0 -1
- package/dist/index40.js +0 -4
- package/dist/index41.cjs +0 -1
- package/dist/index41.js +0 -4
- package/dist/index42.cjs +0 -1
- package/dist/index42.js +0 -15
- package/dist/index43.cjs +0 -1
- package/dist/index43.js +0 -14
- package/dist/index44.cjs +0 -1
- package/dist/index44.js +0 -6
- package/dist/index45.cjs +0 -1
- package/dist/index45.js +0 -48
- package/dist/index46.cjs +0 -1
- package/dist/index46.js +0 -45
- package/dist/index47.cjs +0 -1
- package/dist/index47.js +0 -174
- package/dist/index48.cjs +0 -1
- package/dist/index48.js +0 -15
- package/dist/index49.cjs +0 -1
- package/dist/index49.js +0 -7
- package/dist/index5.cjs +0 -1
- package/dist/index5.js +0 -110
- package/dist/index50.cjs +0 -1
- package/dist/index50.js +0 -19
- package/dist/index51.cjs +0 -1
- package/dist/index51.js +0 -14
- package/dist/index52.cjs +0 -1
- package/dist/index52.js +0 -177
- package/dist/index53.cjs +0 -1
- package/dist/index53.js +0 -24
- package/dist/index54.cjs +0 -1
- package/dist/index54.js +0 -4
- package/dist/index55.cjs +0 -1
- package/dist/index55.js +0 -37
- package/dist/index56.cjs +0 -1
- package/dist/index56.js +0 -11
- package/dist/index57.cjs +0 -1
- package/dist/index57.js +0 -37
- package/dist/index58.cjs +0 -1
- package/dist/index58.js +0 -58
- package/dist/index59.cjs +0 -2
- package/dist/index59.js +0 -62
- package/dist/index6.cjs +0 -1
- package/dist/index6.js +0 -5
- package/dist/index60.cjs +0 -1
- package/dist/index60.js +0 -6
- package/dist/index61.cjs +0 -1
- package/dist/index61.js +0 -130
- package/dist/index62.cjs +0 -2
- package/dist/index62.js +0 -45
- package/dist/index63.cjs +0 -1
- package/dist/index63.js +0 -11
- package/dist/index64.cjs +0 -1
- package/dist/index64.js +0 -13
- package/dist/index65.cjs +0 -1
- package/dist/index65.js +0 -14
- package/dist/index66.cjs +0 -1
- package/dist/index66.js +0 -16
- package/dist/index67.cjs +0 -1
- package/dist/index67.js +0 -9
- package/dist/index68.cjs +0 -1
- package/dist/index68.js +0 -20
- package/dist/index69.cjs +0 -1
- package/dist/index69.js +0 -81
- package/dist/index7.cjs +0 -1
- package/dist/index7.js +0 -76
- package/dist/index70.cjs +0 -1
- package/dist/index70.js +0 -17
- package/dist/index71.cjs +0 -1
- package/dist/index71.js +0 -21
- package/dist/index72.cjs +0 -1
- package/dist/index72.js +0 -9
- package/dist/index73.cjs +0 -1
- package/dist/index73.js +0 -24
- package/dist/index74.cjs +0 -1
- package/dist/index74.js +0 -16
- package/dist/index75.cjs +0 -1
- package/dist/index75.js +0 -4
- package/dist/index76.cjs +0 -1
- package/dist/index76.js +0 -4
- package/dist/index77.cjs +0 -2
- package/dist/index77.js +0 -37
- package/dist/index78.cjs +0 -1
- package/dist/index78.js +0 -8
- package/dist/index79.cjs +0 -1
- package/dist/index79.js +0 -22
- package/dist/index8.cjs +0 -1
- package/dist/index8.js +0 -62
- package/dist/index80.cjs +0 -1
- package/dist/index80.js +0 -34
- package/dist/index81.cjs +0 -1
- package/dist/index81.js +0 -4
- package/dist/index82.cjs +0 -6
- package/dist/index82.js +0 -949
- package/dist/index83.cjs +0 -1
- package/dist/index83.js +0 -4
- package/dist/index84.cjs +0 -1
- package/dist/index84.js +0 -64
- package/dist/index85.cjs +0 -1
- package/dist/index85.js +0 -35
- 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/index9.cjs +0 -1
- package/dist/index9.js +0 -63
- 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/index5.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { Url as k, fetchEVMBlockNumber as v, with0x as u, checkAllowanceAndApprove as I, Authorization as h } from "@gardenfi/utils";
|
|
2
|
-
import { getContract as A } from "viem";
|
|
3
|
-
import { Err as r, Fetcher as f, Ok as y, trim0x as b } from "@catalogfi/utils";
|
|
4
|
-
import { ParseSwapStatus as N } from "./index7.js";
|
|
5
|
-
import { AtomicSwapABI as T } from "./index13.js";
|
|
6
|
-
import { SwapStatus as x } from "./index6.js";
|
|
7
|
-
class J {
|
|
8
|
-
constructor(t, s, a) {
|
|
9
|
-
this.url = new k("/relayer", s), this.auth = a, this.order = t;
|
|
10
|
-
}
|
|
11
|
-
async init(t, s) {
|
|
12
|
-
if (!t.account) return r("No account found");
|
|
13
|
-
if (t.account.address.toLowerCase() !== this.order.source_swap.initiator.toLowerCase())
|
|
14
|
-
return r("Account address and order initiator mismatch");
|
|
15
|
-
if (!s) {
|
|
16
|
-
const o = await v(t);
|
|
17
|
-
if (o.error) return r(o.error);
|
|
18
|
-
s = o.val;
|
|
19
|
-
}
|
|
20
|
-
if (N(
|
|
21
|
-
this.order.source_swap,
|
|
22
|
-
s
|
|
23
|
-
) !== x.Idle) return r("Invalid swap status");
|
|
24
|
-
const { create_order: e, source_swap: i } = this.order;
|
|
25
|
-
if (!i.amount || !i.redeemer || !e.timelock || !e.secret_hash)
|
|
26
|
-
return r("Invalid order");
|
|
27
|
-
const w = u(e.secret_hash), g = BigInt(e.timelock), l = u(i.redeemer), d = BigInt(i.amount);
|
|
28
|
-
try {
|
|
29
|
-
const o = await this.auth.getToken();
|
|
30
|
-
if (o.error) return r(o.error);
|
|
31
|
-
const m = A({
|
|
32
|
-
address: u(this.order.source_swap.asset),
|
|
33
|
-
abi: T,
|
|
34
|
-
client: t
|
|
35
|
-
}), S = await m.read.token(), p = await I(
|
|
36
|
-
Number(d),
|
|
37
|
-
S,
|
|
38
|
-
this.order.source_swap.asset,
|
|
39
|
-
t
|
|
40
|
-
);
|
|
41
|
-
if (p.error) return r(p.error);
|
|
42
|
-
const n = await m.read.eip712Domain(), _ = await t.signTypedData({
|
|
43
|
-
account: t.account,
|
|
44
|
-
domain: {
|
|
45
|
-
name: n[1],
|
|
46
|
-
version: n[2],
|
|
47
|
-
chainId: Number(n[3]),
|
|
48
|
-
verifyingContract: n[4]
|
|
49
|
-
},
|
|
50
|
-
types: {
|
|
51
|
-
Initiate: [
|
|
52
|
-
{ name: "redeemer", type: "address" },
|
|
53
|
-
{ name: "timelock", type: "uint256" },
|
|
54
|
-
{ name: "amount", type: "uint256" },
|
|
55
|
-
{ name: "secretHash", type: "bytes32" }
|
|
56
|
-
]
|
|
57
|
-
},
|
|
58
|
-
primaryType: "Initiate",
|
|
59
|
-
message: {
|
|
60
|
-
redeemer: l,
|
|
61
|
-
timelock: g,
|
|
62
|
-
amount: d,
|
|
63
|
-
secretHash: w
|
|
64
|
-
}
|
|
65
|
-
}), c = await f.post(
|
|
66
|
-
this.url.endpoint("initiate"),
|
|
67
|
-
{
|
|
68
|
-
body: JSON.stringify({
|
|
69
|
-
order_id: e.create_id,
|
|
70
|
-
signature: _,
|
|
71
|
-
perform_on: "Source"
|
|
72
|
-
}),
|
|
73
|
-
headers: {
|
|
74
|
-
Authorization: h(o.val),
|
|
75
|
-
"Content-Type": "application/json"
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
return c.error ? r(c.error) : c.result ? y(c.result) : r("Init: No result found");
|
|
80
|
-
} catch (o) {
|
|
81
|
-
return console.log("init error :", o), r(String(o));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
async redeem(t, s) {
|
|
85
|
-
try {
|
|
86
|
-
const a = await this.auth.getToken();
|
|
87
|
-
if (a.error) return r(a.error);
|
|
88
|
-
const e = await f.post(
|
|
89
|
-
this.url.endpoint("redeem"),
|
|
90
|
-
{
|
|
91
|
-
body: JSON.stringify({
|
|
92
|
-
order_id: t,
|
|
93
|
-
secret: b(s),
|
|
94
|
-
perform_on: "Destination"
|
|
95
|
-
}),
|
|
96
|
-
headers: {
|
|
97
|
-
Authorization: h(a.val),
|
|
98
|
-
"Content-Type": "application/json"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
);
|
|
102
|
-
return e.error ? r(e.error) : e.result ? y(e.result) : r("Redeem: No result found");
|
|
103
|
-
} catch (a) {
|
|
104
|
-
return r(String(a));
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
export {
|
|
109
|
-
J as EvmRelay
|
|
110
|
-
};
|
package/dist/index50.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function a(o,n){return({exclude:t,format:f})=>({exclude:t,format:e=>{const r=n(e);if(t)for(const i of t)delete r[i];return{...r,...f(e)}},type:o})}exports.defineFormatter=a;
|
package/dist/index50.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
function a(e, f) {
|
|
2
|
-
return ({ exclude: t, format: n }) => ({
|
|
3
|
-
exclude: t,
|
|
4
|
-
format: (r) => {
|
|
5
|
-
const o = f(r);
|
|
6
|
-
if (t)
|
|
7
|
-
for (const m of t)
|
|
8
|
-
delete o[m];
|
|
9
|
-
return {
|
|
10
|
-
...o,
|
|
11
|
-
...n(r)
|
|
12
|
-
};
|
|
13
|
-
},
|
|
14
|
-
type: e
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
a as defineFormatter
|
|
19
|
-
};
|
package/dist/index51.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(n,{args:a,eventName:t}={}){return{...n,blockHash:n.blockHash?n.blockHash:null,blockNumber:n.blockNumber?BigInt(n.blockNumber):null,logIndex:n.logIndex?Number(n.logIndex):null,transactionHash:n.transactionHash?n.transactionHash:null,transactionIndex:n.transactionIndex?Number(n.transactionIndex):null,...t?{args:a,eventName:t}:{}}}exports.formatLog=r;
|
package/dist/index51.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
function r(n, { args: t, eventName: a } = {}) {
|
|
2
|
-
return {
|
|
3
|
-
...n,
|
|
4
|
-
blockHash: n.blockHash ? n.blockHash : null,
|
|
5
|
-
blockNumber: n.blockNumber ? BigInt(n.blockNumber) : null,
|
|
6
|
-
logIndex: n.logIndex ? Number(n.logIndex) : null,
|
|
7
|
-
transactionHash: n.transactionHash ? n.transactionHash : null,
|
|
8
|
-
transactionIndex: n.transactionIndex ? Number(n.transactionIndex) : null,
|
|
9
|
-
...a ? { args: t, eventName: a } : {}
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
r as formatLog
|
|
14
|
-
};
|
package/dist/index52.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./index84.cjs"),J=require("./index85.cjs"),j=require("./index86.cjs");var d=_.errors,u=J.native,h=d.tfJSON,S=d.TfTypeError,b=d.TfPropertyTypeError,v=d.tfSubError,w=d.getValueTypeName,g={arrayOf:function(n,r){n=l(n),r=r||{};function t(f,i){return!u.Array(f)||u.Nil(f)||r.minLength!==void 0&&f.length<r.minLength||r.maxLength!==void 0&&f.length>r.maxLength||r.length!==void 0&&f.length!==r.length?!1:f.every(function(a,o){try{return c(n,a,i)}catch(m){throw v(m,o)}})}return t.toJSON=function(){var f="["+h(n)+"]";return r.length!==void 0?f+="{"+r.length+"}":(r.minLength!==void 0||r.maxLength!==void 0)&&(f+="{"+(r.minLength===void 0?0:r.minLength)+","+(r.maxLength===void 0?1/0:r.maxLength)+"}"),f},t},maybe:function e(n){n=l(n);function r(t,f){return u.Nil(t)||n(t,f,e)}return r.toJSON=function(){return"?"+h(n)},r},map:function(n,r){n=l(n),r&&(r=l(r));function t(f,i){if(!u.Object(f)||u.Nil(f))return!1;for(var a in f){try{r&&c(r,a,i)}catch(m){throw v(m,a,"key")}try{var o=f[a];c(n,o,i)}catch(m){throw v(m,a)}}return!0}return r?t.toJSON=function(){return"{"+h(r)+": "+h(n)+"}"}:t.toJSON=function(){return"{"+h(n)+"}"},t},object:function(n){var r={};for(var t in n)r[t]=l(n[t]);function f(i,a){if(!u.Object(i)||u.Nil(i))return!1;var o;try{for(o in r){var m=r[o],E=i[o];c(m,E,a)}}catch(L){throw v(L,o)}if(a){for(o in i)if(!r[o])throw new b(void 0,o)}return!0}return f.toJSON=function(){return h(r)},f},anyOf:function(){var n=[].slice.call(arguments).map(l);function r(t,f){return n.some(function(i){try{return c(i,t,f)}catch{return!1}})}return r.toJSON=function(){return n.map(h).join("|")},r},allOf:function(){var n=[].slice.call(arguments).map(l);function r(t,f){return n.every(function(i){try{return c(i,t,f)}catch{return!1}})}return r.toJSON=function(){return n.map(h).join(" & ")},r},quacksLike:function(n){function r(t){return n===w(t)}return r.toJSON=function(){return n},r},tuple:function(){var n=[].slice.call(arguments).map(l);function r(t,f){return u.Nil(t)||u.Nil(t.length)||f&&t.length!==n.length?!1:n.every(function(i,a){try{return c(i,t[a],f)}catch(o){throw v(o,a)}})}return r.toJSON=function(){return"("+n.map(h).join(", ")+")"},r},value:function(n){function r(t){return t===n}return r.toJSON=function(){return n},r}};g.oneOf=g.anyOf;function l(e){if(u.String(e))return e[0]==="?"?g.maybe(e.slice(1)):u[e]||g.quacksLike(e);if(e&&u.Object(e)){if(u.Array(e)){if(e.length!==1)throw new TypeError("Expected compile() parameter of type Array of length 1");return g.arrayOf(e[0])}return g.object(e)}else if(u.Function(e))return e;return g.value(e)}function c(e,n,r,t){if(u.Function(e)){if(e(n,r))return!0;throw new S(t||e,n)}return c(l(e),n,r)}for(var O in u)c[O]=u[O];for(O in g)c[O]=g[O];var s=j.__require();for(O in s)c[O]=s[O];c.compile=l;c.TfTypeError=S;c.TfPropertyTypeError=b;var N=c;exports.typeforce_1=N;
|
package/dist/index52.js
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { e as J } from "./index84.js";
|
|
2
|
-
import { n as _ } from "./index85.js";
|
|
3
|
-
import { __require as w } from "./index86.js";
|
|
4
|
-
var d = J, u = _, h = d.tfJSON, S = d.TfTypeError, E = d.TfPropertyTypeError, v = d.tfSubError, N = d.getValueTypeName, g = {
|
|
5
|
-
arrayOf: function(n, r) {
|
|
6
|
-
n = l(n), r = r || {};
|
|
7
|
-
function f(t, i) {
|
|
8
|
-
return !u.Array(t) || u.Nil(t) || r.minLength !== void 0 && t.length < r.minLength || r.maxLength !== void 0 && t.length > r.maxLength || r.length !== void 0 && t.length !== r.length ? !1 : t.every(function(c, o) {
|
|
9
|
-
try {
|
|
10
|
-
return a(n, c, i);
|
|
11
|
-
} catch (O) {
|
|
12
|
-
throw v(O, o);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return f.toJSON = function() {
|
|
17
|
-
var t = "[" + h(n) + "]";
|
|
18
|
-
return r.length !== void 0 ? t += "{" + r.length + "}" : (r.minLength !== void 0 || r.maxLength !== void 0) && (t += "{" + (r.minLength === void 0 ? 0 : r.minLength) + "," + (r.maxLength === void 0 ? 1 / 0 : r.maxLength) + "}"), t;
|
|
19
|
-
}, f;
|
|
20
|
-
},
|
|
21
|
-
maybe: function e(n) {
|
|
22
|
-
n = l(n);
|
|
23
|
-
function r(f, t) {
|
|
24
|
-
return u.Nil(f) || n(f, t, e);
|
|
25
|
-
}
|
|
26
|
-
return r.toJSON = function() {
|
|
27
|
-
return "?" + h(n);
|
|
28
|
-
}, r;
|
|
29
|
-
},
|
|
30
|
-
map: function(n, r) {
|
|
31
|
-
n = l(n), r && (r = l(r));
|
|
32
|
-
function f(t, i) {
|
|
33
|
-
if (!u.Object(t) || u.Nil(t)) return !1;
|
|
34
|
-
for (var c in t) {
|
|
35
|
-
try {
|
|
36
|
-
r && a(r, c, i);
|
|
37
|
-
} catch (O) {
|
|
38
|
-
throw v(O, c, "key");
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
var o = t[c];
|
|
42
|
-
a(n, o, i);
|
|
43
|
-
} catch (O) {
|
|
44
|
-
throw v(O, c);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return !0;
|
|
48
|
-
}
|
|
49
|
-
return r ? f.toJSON = function() {
|
|
50
|
-
return "{" + h(r) + ": " + h(n) + "}";
|
|
51
|
-
} : f.toJSON = function() {
|
|
52
|
-
return "{" + h(n) + "}";
|
|
53
|
-
}, f;
|
|
54
|
-
},
|
|
55
|
-
object: function(n) {
|
|
56
|
-
var r = {};
|
|
57
|
-
for (var f in n)
|
|
58
|
-
r[f] = l(n[f]);
|
|
59
|
-
function t(i, c) {
|
|
60
|
-
if (!u.Object(i) || u.Nil(i)) return !1;
|
|
61
|
-
var o;
|
|
62
|
-
try {
|
|
63
|
-
for (o in r) {
|
|
64
|
-
var O = r[o], L = i[o];
|
|
65
|
-
a(O, L, c);
|
|
66
|
-
}
|
|
67
|
-
} catch (b) {
|
|
68
|
-
throw v(b, o);
|
|
69
|
-
}
|
|
70
|
-
if (c) {
|
|
71
|
-
for (o in i)
|
|
72
|
-
if (!r[o])
|
|
73
|
-
throw new E(void 0, o);
|
|
74
|
-
}
|
|
75
|
-
return !0;
|
|
76
|
-
}
|
|
77
|
-
return t.toJSON = function() {
|
|
78
|
-
return h(r);
|
|
79
|
-
}, t;
|
|
80
|
-
},
|
|
81
|
-
anyOf: function() {
|
|
82
|
-
var n = [].slice.call(arguments).map(l);
|
|
83
|
-
function r(f, t) {
|
|
84
|
-
return n.some(function(i) {
|
|
85
|
-
try {
|
|
86
|
-
return a(i, f, t);
|
|
87
|
-
} catch {
|
|
88
|
-
return !1;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
return r.toJSON = function() {
|
|
93
|
-
return n.map(h).join("|");
|
|
94
|
-
}, r;
|
|
95
|
-
},
|
|
96
|
-
allOf: function() {
|
|
97
|
-
var n = [].slice.call(arguments).map(l);
|
|
98
|
-
function r(f, t) {
|
|
99
|
-
return n.every(function(i) {
|
|
100
|
-
try {
|
|
101
|
-
return a(i, f, t);
|
|
102
|
-
} catch {
|
|
103
|
-
return !1;
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
return r.toJSON = function() {
|
|
108
|
-
return n.map(h).join(" & ");
|
|
109
|
-
}, r;
|
|
110
|
-
},
|
|
111
|
-
quacksLike: function(n) {
|
|
112
|
-
function r(f) {
|
|
113
|
-
return n === N(f);
|
|
114
|
-
}
|
|
115
|
-
return r.toJSON = function() {
|
|
116
|
-
return n;
|
|
117
|
-
}, r;
|
|
118
|
-
},
|
|
119
|
-
tuple: function() {
|
|
120
|
-
var n = [].slice.call(arguments).map(l);
|
|
121
|
-
function r(f, t) {
|
|
122
|
-
return u.Nil(f) || u.Nil(f.length) || t && f.length !== n.length ? !1 : n.every(function(i, c) {
|
|
123
|
-
try {
|
|
124
|
-
return a(i, f[c], t);
|
|
125
|
-
} catch (o) {
|
|
126
|
-
throw v(o, c);
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
return r.toJSON = function() {
|
|
131
|
-
return "(" + n.map(h).join(", ") + ")";
|
|
132
|
-
}, r;
|
|
133
|
-
},
|
|
134
|
-
value: function(n) {
|
|
135
|
-
function r(f) {
|
|
136
|
-
return f === n;
|
|
137
|
-
}
|
|
138
|
-
return r.toJSON = function() {
|
|
139
|
-
return n;
|
|
140
|
-
}, r;
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
g.oneOf = g.anyOf;
|
|
144
|
-
function l(e) {
|
|
145
|
-
if (u.String(e))
|
|
146
|
-
return e[0] === "?" ? g.maybe(e.slice(1)) : u[e] || g.quacksLike(e);
|
|
147
|
-
if (e && u.Object(e)) {
|
|
148
|
-
if (u.Array(e)) {
|
|
149
|
-
if (e.length !== 1) throw new TypeError("Expected compile() parameter of type Array of length 1");
|
|
150
|
-
return g.arrayOf(e[0]);
|
|
151
|
-
}
|
|
152
|
-
return g.object(e);
|
|
153
|
-
} else if (u.Function(e))
|
|
154
|
-
return e;
|
|
155
|
-
return g.value(e);
|
|
156
|
-
}
|
|
157
|
-
function a(e, n, r, f) {
|
|
158
|
-
if (u.Function(e)) {
|
|
159
|
-
if (e(n, r)) return !0;
|
|
160
|
-
throw new S(f || e, n);
|
|
161
|
-
}
|
|
162
|
-
return a(l(e), n, r);
|
|
163
|
-
}
|
|
164
|
-
for (var m in u)
|
|
165
|
-
a[m] = u[m];
|
|
166
|
-
for (m in g)
|
|
167
|
-
a[m] = g[m];
|
|
168
|
-
var s = w();
|
|
169
|
-
for (m in s)
|
|
170
|
-
a[m] = s[m];
|
|
171
|
-
a.compile = l;
|
|
172
|
-
a.TfTypeError = S;
|
|
173
|
-
a.TfPropertyTypeError = E;
|
|
174
|
-
var x = a;
|
|
175
|
-
export {
|
|
176
|
-
x as t
|
|
177
|
-
};
|
package/dist/index53.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function f(e){if(e.__esModule)return e;var r=e.default;if(typeof r=="function"){var t=function o(){return this instanceof o?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}),t}exports.commonjsGlobal=u;exports.getAugmentedNamespace=f;
|
package/dist/index53.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var f = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
-
function u(e) {
|
|
3
|
-
if (e.__esModule) return e;
|
|
4
|
-
var r = e.default;
|
|
5
|
-
if (typeof r == "function") {
|
|
6
|
-
var t = function o() {
|
|
7
|
-
return this instanceof o ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
|
|
8
|
-
};
|
|
9
|
-
t.prototype = r.prototype;
|
|
10
|
-
} else t = {};
|
|
11
|
-
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(o) {
|
|
12
|
-
var n = Object.getOwnPropertyDescriptor(e, o);
|
|
13
|
-
Object.defineProperty(t, o, n.get ? n : {
|
|
14
|
-
enumerable: !0,
|
|
15
|
-
get: function() {
|
|
16
|
-
return e[o];
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}), t;
|
|
20
|
-
}
|
|
21
|
-
export {
|
|
22
|
-
f as commonjsGlobal,
|
|
23
|
-
u as getAugmentedNamespace
|
|
24
|
-
};
|
package/dist/index54.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
|
package/dist/index54.js
DELETED
package/dist/index55.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index81.cjs");require("./index82.cjs");const p=require("./index83.cjs");/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(m,a){var n=p.__exports,r=n.Buffer;function i(e,o){for(var t in e)o[t]=e[t]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?m.exports=n:(i(n,a),a.Buffer=f);function f(e,o,t){return r(e,o,t)}f.prototype=Object.create(r.prototype),i(r,f),f.from=function(e,o,t){if(typeof e=="number")throw new TypeError("Argument must not be a number");return r(e,o,t)},f.alloc=function(e,o,t){if(typeof e!="number")throw new TypeError("Argument must be a number");var u=r(e);return o!==void 0?typeof t=="string"?u.fill(o,t):u.fill(o):u.fill(0),u},f.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return r(e)},f.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}})(l.__module,l.__module.exports);var s=l.__module.exports;exports.safeBufferExports=s;
|
package/dist/index55.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { __module as a } from "./index81.js";
|
|
2
|
-
import "./index82.js";
|
|
3
|
-
import { __exports as s } from "./index83.js";
|
|
4
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
5
|
-
(function(l, m) {
|
|
6
|
-
var n = s, e = n.Buffer;
|
|
7
|
-
function p(r, f) {
|
|
8
|
-
for (var o in r)
|
|
9
|
-
f[o] = r[o];
|
|
10
|
-
}
|
|
11
|
-
e.from && e.alloc && e.allocUnsafe && e.allocUnsafeSlow ? l.exports = n : (p(n, m), m.Buffer = t);
|
|
12
|
-
function t(r, f, o) {
|
|
13
|
-
return e(r, f, o);
|
|
14
|
-
}
|
|
15
|
-
t.prototype = Object.create(e.prototype), p(e, t), t.from = function(r, f, o) {
|
|
16
|
-
if (typeof r == "number")
|
|
17
|
-
throw new TypeError("Argument must not be a number");
|
|
18
|
-
return e(r, f, o);
|
|
19
|
-
}, t.alloc = function(r, f, o) {
|
|
20
|
-
if (typeof r != "number")
|
|
21
|
-
throw new TypeError("Argument must be a number");
|
|
22
|
-
var u = e(r);
|
|
23
|
-
return f !== void 0 ? typeof o == "string" ? u.fill(f, o) : u.fill(f) : u.fill(0), u;
|
|
24
|
-
}, t.allocUnsafe = function(r) {
|
|
25
|
-
if (typeof r != "number")
|
|
26
|
-
throw new TypeError("Argument must be a number");
|
|
27
|
-
return e(r);
|
|
28
|
-
}, t.allocUnsafeSlow = function(r) {
|
|
29
|
-
if (typeof r != "number")
|
|
30
|
-
throw new TypeError("Argument must be a number");
|
|
31
|
-
return n.SlowBuffer(r);
|
|
32
|
-
};
|
|
33
|
-
})(a, a.exports);
|
|
34
|
-
var w = a.exports;
|
|
35
|
-
export {
|
|
36
|
-
w as s
|
|
37
|
-
};
|
package/dist/index56.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index79.cjs"),t=require("./index80.cjs");var e=a.browser,c=t.base;function b(r){var s=e("sha256").update(r).digest();return e("sha256").update(s).digest()}var o=c(b);exports.bs58check=o;
|
package/dist/index56.js
DELETED
package/dist/index57.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index87.cjs");function p(e,{dir:n,size:t=32}={}){return typeof e=="string"?o(e,{dir:n,size:t}):l(e,{dir:n,size:t})}function o(e,{dir:n,size:t=32}={}){if(t===null)return e;const r=e.replace("0x","");if(r.length>t*2)throw new i.SizeExceedsPaddingSizeError({size:Math.ceil(r.length/2),targetSize:t,type:"hex"});return`0x${r[n==="right"?"padEnd":"padStart"](t*2,"0")}`}function l(e,{dir:n,size:t=32}={}){if(t===null)return e;if(e.length>t)throw new i.SizeExceedsPaddingSizeError({size:e.length,targetSize:t,type:"bytes"});const r=new Uint8Array(t);for(let a=0;a<t;a++){const d=n==="right";r[d?a:t-a-1]=e[d?a:e.length-a-1]}return r}exports.pad=p;exports.padBytes=l;exports.padHex=o;
|
package/dist/index57.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { SizeExceedsPaddingSizeError as d } from "./index87.js";
|
|
2
|
-
function f(n, { dir: r, size: t = 32 } = {}) {
|
|
3
|
-
return typeof n == "string" ? p(n, { dir: r, size: t }) : i(n, { dir: r, size: t });
|
|
4
|
-
}
|
|
5
|
-
function p(n, { dir: r, size: t = 32 } = {}) {
|
|
6
|
-
if (t === null)
|
|
7
|
-
return n;
|
|
8
|
-
const e = n.replace("0x", "");
|
|
9
|
-
if (e.length > t * 2)
|
|
10
|
-
throw new d({
|
|
11
|
-
size: Math.ceil(e.length / 2),
|
|
12
|
-
targetSize: t,
|
|
13
|
-
type: "hex"
|
|
14
|
-
});
|
|
15
|
-
return `0x${e[r === "right" ? "padEnd" : "padStart"](t * 2, "0")}`;
|
|
16
|
-
}
|
|
17
|
-
function i(n, { dir: r, size: t = 32 } = {}) {
|
|
18
|
-
if (t === null)
|
|
19
|
-
return n;
|
|
20
|
-
if (n.length > t)
|
|
21
|
-
throw new d({
|
|
22
|
-
size: n.length,
|
|
23
|
-
targetSize: t,
|
|
24
|
-
type: "bytes"
|
|
25
|
-
});
|
|
26
|
-
const e = new Uint8Array(t);
|
|
27
|
-
for (let a = 0; a < t; a++) {
|
|
28
|
-
const o = r === "right";
|
|
29
|
-
e[o ? a : t - a - 1] = n[o ? a : n.length - a - 1];
|
|
30
|
-
}
|
|
31
|
-
return e;
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
f as pad,
|
|
35
|
-
i as padBytes,
|
|
36
|
-
p as padHex
|
|
37
|
-
};
|
package/dist/index58.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index59.cjs"),l=require("./index60.cjs"),u=require("./index57.cjs"),f=require("./index30.cjs"),m=require("./index45.cjs"),h=new TextEncoder;function A(e,n={}){return typeof e=="number"||typeof e=="bigint"?B(e,n):typeof e=="boolean"?x(e,n):l.isHex(e)?c(e,n):T(e,n)}function x(e,n={}){const t=new Uint8Array(1);return t[0]=Number(e),typeof n.size=="number"?(f.assertSize(t,{size:n.size}),u.pad(t,{size:n.size})):t}const i={zero:48,nine:57,A:65,F:70,a:97,f:102};function g(e){if(e>=i.zero&&e<=i.nine)return e-i.zero;if(e>=i.A&&e<=i.F)return e-(i.A-10);if(e>=i.a&&e<=i.f)return e-(i.a-10)}function c(e,n={}){let t=e;n.size&&(f.assertSize(t,{size:n.size}),t=u.pad(t,{dir:"right",size:n.size}));let r=t.slice(2);r.length%2&&(r=`0${r}`);const d=r.length/2,y=new Uint8Array(d);for(let s=0,o=0;s<d;s++){const b=g(r.charCodeAt(o++)),z=g(r.charCodeAt(o++));if(b===void 0||z===void 0)throw new a.BaseError(`Invalid byte sequence ("${r[o-2]}${r[o-1]}" in "${r}").`);y[s]=b*16+z}return y}function B(e,n){const t=m.numberToHex(e,n);return c(t)}function T(e,n={}){const t=h.encode(e);return typeof n.size=="number"?(f.assertSize(t,{size:n.size}),u.pad(t,{dir:"right",size:n.size})):t}exports.boolToBytes=x;exports.hexToBytes=c;exports.numberToBytes=B;exports.stringToBytes=T;exports.toBytes=A;
|
package/dist/index58.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { BaseError as g } from "./index59.js";
|
|
2
|
-
import { isHex as x } from "./index60.js";
|
|
3
|
-
import { pad as s } from "./index57.js";
|
|
4
|
-
import { assertSize as u } from "./index30.js";
|
|
5
|
-
import { numberToHex as h } from "./index45.js";
|
|
6
|
-
const A = /* @__PURE__ */ new TextEncoder();
|
|
7
|
-
function F(e, n = {}) {
|
|
8
|
-
return typeof e == "number" || typeof e == "bigint" ? T(e, n) : typeof e == "boolean" ? B(e, n) : x(e) ? y(e, n) : l(e, n);
|
|
9
|
-
}
|
|
10
|
-
function B(e, n = {}) {
|
|
11
|
-
const r = new Uint8Array(1);
|
|
12
|
-
return r[0] = Number(e), typeof n.size == "number" ? (u(r, { size: n.size }), s(r, { size: n.size })) : r;
|
|
13
|
-
}
|
|
14
|
-
const t = {
|
|
15
|
-
zero: 48,
|
|
16
|
-
nine: 57,
|
|
17
|
-
A: 65,
|
|
18
|
-
F: 70,
|
|
19
|
-
a: 97,
|
|
20
|
-
f: 102
|
|
21
|
-
};
|
|
22
|
-
function m(e) {
|
|
23
|
-
if (e >= t.zero && e <= t.nine)
|
|
24
|
-
return e - t.zero;
|
|
25
|
-
if (e >= t.A && e <= t.F)
|
|
26
|
-
return e - (t.A - 10);
|
|
27
|
-
if (e >= t.a && e <= t.f)
|
|
28
|
-
return e - (t.a - 10);
|
|
29
|
-
}
|
|
30
|
-
function y(e, n = {}) {
|
|
31
|
-
let r = e;
|
|
32
|
-
n.size && (u(r, { size: n.size }), r = s(r, { dir: "right", size: n.size }));
|
|
33
|
-
let i = r.slice(2);
|
|
34
|
-
i.length % 2 && (i = `0${i}`);
|
|
35
|
-
const z = i.length / 2, d = new Uint8Array(z);
|
|
36
|
-
for (let f = 0, o = 0; f < z; f++) {
|
|
37
|
-
const b = m(i.charCodeAt(o++)), c = m(i.charCodeAt(o++));
|
|
38
|
-
if (b === void 0 || c === void 0)
|
|
39
|
-
throw new g(`Invalid byte sequence ("${i[o - 2]}${i[o - 1]}" in "${i}").`);
|
|
40
|
-
d[f] = b * 16 + c;
|
|
41
|
-
}
|
|
42
|
-
return d;
|
|
43
|
-
}
|
|
44
|
-
function T(e, n) {
|
|
45
|
-
const r = h(e, n);
|
|
46
|
-
return y(r);
|
|
47
|
-
}
|
|
48
|
-
function l(e, n = {}) {
|
|
49
|
-
const r = A.encode(e);
|
|
50
|
-
return typeof n.size == "number" ? (u(r, { size: n.size }), s(r, { dir: "right", size: n.size })) : r;
|
|
51
|
-
}
|
|
52
|
-
export {
|
|
53
|
-
B as boolToBytes,
|
|
54
|
-
y as hexToBytes,
|
|
55
|
-
T as numberToBytes,
|
|
56
|
-
l as stringToBytes,
|
|
57
|
-
F as toBytes
|
|
58
|
-
};
|
package/dist/index59.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index76.cjs");let i={getDocsUrl:({docsBaseUrl:s,docsPath:t="",docsSlug:e})=>t?`${s??"https://viem.sh"}${t}${e?`#${e}`:""}`:void 0,version:`viem@${l.version}`};class r extends Error{constructor(t,e={}){var o;const u=(()=>{var c;return e.cause instanceof r?e.cause.details:(c=e.cause)!=null&&c.message?e.cause.message:e.details})(),a=e.cause instanceof r&&e.cause.docsPath||e.docsPath,n=(o=i.getDocsUrl)==null?void 0:o.call(i,{...e,docsPath:a}),b=[t||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...n?[`Docs: ${n}`]:[],...u?[`Details: ${u}`]:[],...i.version?[`Version: ${i.version}`]:[]].join(`
|
|
2
|
-
`);super(b,e.cause?{cause:e.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=u,this.docsPath=a,this.metaMessages=e.metaMessages,this.name=e.name??this.name,this.shortMessage=t,this.version=l.version}walk(t){return d(this,t)}}function d(s,t){return t!=null&&t(s)?s:s&&typeof s=="object"&&"cause"in s?d(s.cause,t):t?null:s}exports.BaseError=r;
|
package/dist/index59.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { version as l } from "./index76.js";
|
|
2
|
-
let i = {
|
|
3
|
-
getDocsUrl: ({ docsBaseUrl: s, docsPath: t = "", docsSlug: e }) => t ? `${s ?? "https://viem.sh"}${t}${e ? `#${e}` : ""}` : void 0,
|
|
4
|
-
version: `viem@${l}`
|
|
5
|
-
};
|
|
6
|
-
class r extends Error {
|
|
7
|
-
constructor(t, e = {}) {
|
|
8
|
-
var o;
|
|
9
|
-
const u = (() => {
|
|
10
|
-
var c;
|
|
11
|
-
return e.cause instanceof r ? e.cause.details : (c = e.cause) != null && c.message ? e.cause.message : e.details;
|
|
12
|
-
})(), a = e.cause instanceof r && e.cause.docsPath || e.docsPath, n = (o = i.getDocsUrl) == null ? void 0 : o.call(i, { ...e, docsPath: a }), b = [
|
|
13
|
-
t || "An error occurred.",
|
|
14
|
-
"",
|
|
15
|
-
...e.metaMessages ? [...e.metaMessages, ""] : [],
|
|
16
|
-
...n ? [`Docs: ${n}`] : [],
|
|
17
|
-
...u ? [`Details: ${u}`] : [],
|
|
18
|
-
...i.version ? [`Version: ${i.version}`] : []
|
|
19
|
-
].join(`
|
|
20
|
-
`);
|
|
21
|
-
super(b, e.cause ? { cause: e.cause } : void 0), Object.defineProperty(this, "details", {
|
|
22
|
-
enumerable: !0,
|
|
23
|
-
configurable: !0,
|
|
24
|
-
writable: !0,
|
|
25
|
-
value: void 0
|
|
26
|
-
}), Object.defineProperty(this, "docsPath", {
|
|
27
|
-
enumerable: !0,
|
|
28
|
-
configurable: !0,
|
|
29
|
-
writable: !0,
|
|
30
|
-
value: void 0
|
|
31
|
-
}), Object.defineProperty(this, "metaMessages", {
|
|
32
|
-
enumerable: !0,
|
|
33
|
-
configurable: !0,
|
|
34
|
-
writable: !0,
|
|
35
|
-
value: void 0
|
|
36
|
-
}), Object.defineProperty(this, "shortMessage", {
|
|
37
|
-
enumerable: !0,
|
|
38
|
-
configurable: !0,
|
|
39
|
-
writable: !0,
|
|
40
|
-
value: void 0
|
|
41
|
-
}), Object.defineProperty(this, "version", {
|
|
42
|
-
enumerable: !0,
|
|
43
|
-
configurable: !0,
|
|
44
|
-
writable: !0,
|
|
45
|
-
value: void 0
|
|
46
|
-
}), Object.defineProperty(this, "name", {
|
|
47
|
-
enumerable: !0,
|
|
48
|
-
configurable: !0,
|
|
49
|
-
writable: !0,
|
|
50
|
-
value: "BaseError"
|
|
51
|
-
}), this.details = u, this.docsPath = a, this.metaMessages = e.metaMessages, this.name = e.name ?? this.name, this.shortMessage = t, this.version = l;
|
|
52
|
-
}
|
|
53
|
-
walk(t) {
|
|
54
|
-
return d(this, t);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function d(s, t) {
|
|
58
|
-
return t != null && t(s) ? s : s && typeof s == "object" && "cause" in s ? d(s.cause, t) : t ? null : s;
|
|
59
|
-
}
|
|
60
|
-
export {
|
|
61
|
-
r as BaseError
|
|
62
|
-
};
|
package/dist/index6.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var d=(e=>(e.Created="Created",e.Matched="Matched",e.InitiateDetected="InitiateDetected",e.Initiated="Initiated",e.CounterPartyInitiateDetected="CounterPartyInitiateDetected",e.CounterPartyInitiated="CounterPartyInitiated",e.RedeemDetected="RedeemDetected",e.Redeemed="Redeemed",e.CounterPartyRedeemDetected="CounterPartyRedeemDetected",e.CounterPartyRedeemed="CounterPartyRedeemed",e.Completed="Completed",e.CounterPartySwapExpired="CounterPartySwapExpired",e.Expired="Expired",e.RefundDetected="RefundDetected",e.Refunded="Refunded",e.CounterPartyRefundDetected="CounterPartyRefundDetected",e.CounterPartyRefunded="CounterPartyRefunded",e.Cancelled="Cancelled",e.DeadLineExceeded="DeadLineExceeded",e))(d||{}),t=(e=>(e.Idle="Idle",e.InitiateDetected="InitiateDetected",e.Initiated="Initiated",e.RedeemDetected="RedeemDetected",e.Redeemed="Redeemed",e.RefundDetected="RefundDetected",e.Refunded="Refunded",e.Expired="Expired",e))(t||{});exports.OrderStatus=d;exports.SwapStatus=t;
|
package/dist/index6.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var d = /* @__PURE__ */ ((e) => (e.Created = "Created", e.Matched = "Matched", e.InitiateDetected = "InitiateDetected", e.Initiated = "Initiated", e.CounterPartyInitiateDetected = "CounterPartyInitiateDetected", e.CounterPartyInitiated = "CounterPartyInitiated", e.RedeemDetected = "RedeemDetected", e.Redeemed = "Redeemed", e.CounterPartyRedeemDetected = "CounterPartyRedeemDetected", e.CounterPartyRedeemed = "CounterPartyRedeemed", e.Completed = "Completed", e.CounterPartySwapExpired = "CounterPartySwapExpired", e.Expired = "Expired", e.RefundDetected = "RefundDetected", e.Refunded = "Refunded", e.CounterPartyRefundDetected = "CounterPartyRefundDetected", e.CounterPartyRefunded = "CounterPartyRefunded", e.Cancelled = "Cancelled", e.DeadLineExceeded = "DeadLineExceeded", e))(d || {}), t = /* @__PURE__ */ ((e) => (e.Idle = "Idle", e.InitiateDetected = "InitiateDetected", e.Initiated = "Initiated", e.RedeemDetected = "RedeemDetected", e.Redeemed = "Redeemed", e.RefundDetected = "RefundDetected", e.Refunded = "Refunded", e.Expired = "Expired", e))(t || {});
|
|
2
|
-
export {
|
|
3
|
-
d as OrderStatus,
|
|
4
|
-
t as SwapStatus
|
|
5
|
-
};
|
package/dist/index60.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}exports.isHex=r;
|
package/dist/index60.js
DELETED
package/dist/index61.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index95.cjs"),e={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new o.RecursiveReadLimitExceededError({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new o.PositionOutOfBoundsError({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new o.NegativeOffsetError({offset:t});const i=this.position-t;this.assertPosition(i),this.position=i},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new o.NegativeOffsetError({offset:t});const i=this.position+t;this.assertPosition(i),this.position=i},inspectByte(t){const i=t??this.position;return this.assertPosition(i),this.bytes[i]},inspectBytes(t,i){const s=i??this.position;return this.assertPosition(s+t-1),this.bytes.subarray(s,s+t)},inspectUint8(t){const i=t??this.position;return this.assertPosition(i),this.bytes[i]},inspectUint16(t){const i=t??this.position;return this.assertPosition(i+1),this.dataView.getUint16(i)},inspectUint24(t){const i=t??this.position;return this.assertPosition(i+2),(this.dataView.getUint16(i)<<8)+this.dataView.getUint8(i+2)},inspectUint32(t){const i=t??this.position;return this.assertPosition(i+3),this.dataView.getUint32(i)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,i){this.assertReadLimit(),this._touch();const s=this.inspectBytes(t);return this.position+=i??t,s},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const i=this.position;return this.assertPosition(t),this.position=t,()=>this.position=i},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function n(t,{recursiveReadLimit:i=8192}={}){const s=Object.create(e);return s.bytes=t,s.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),s.positionReadCount=new Map,s.recursiveReadLimit=i,s}exports.createCursor=n;
|