@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/index93.js
CHANGED
|
@@ -1,40 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { __exports as l } from "./index95.js";
|
|
2
|
+
l.byteLength = p;
|
|
3
|
+
l.toByteArray = C;
|
|
4
|
+
l.fromByteArray = i;
|
|
5
|
+
var F = [], f = [], u = typeof Uint8Array < "u" ? Uint8Array : Array, x = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
6
|
+
for (var c = 0, A = x.length; c < A; ++c)
|
|
7
|
+
F[c] = x[c], f[x.charCodeAt(c)] = c;
|
|
8
|
+
f[45] = 62;
|
|
9
|
+
f[95] = 63;
|
|
10
|
+
function s(r) {
|
|
11
|
+
var e = r.length;
|
|
12
|
+
if (e % 4 > 0)
|
|
13
|
+
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
14
|
+
var a = r.indexOf("=");
|
|
15
|
+
a === -1 && (a = e);
|
|
16
|
+
var o = a === e ? 0 : 4 - a % 4;
|
|
17
|
+
return [a, o];
|
|
10
18
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
19
|
+
function p(r) {
|
|
20
|
+
var e = s(r), a = e[0], o = e[1];
|
|
21
|
+
return (a + o) * 3 / 4 - o;
|
|
15
22
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
super(`Versioned hash "${e}" size is invalid.`, {
|
|
19
|
-
metaMessages: ["Expected: 32", `Received: ${r}`],
|
|
20
|
-
name: "InvalidVersionedHashSizeError"
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
+
function y(r, e, a) {
|
|
24
|
+
return (e + a) * 3 / 4 - a;
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
function C(r) {
|
|
27
|
+
var e, a = s(r), o = a[0], n = a[1], t = new u(y(r, o, n)), v = 0, d = n > 0 ? o - 4 : o, h;
|
|
28
|
+
for (h = 0; h < d; h += 4)
|
|
29
|
+
e = f[r.charCodeAt(h)] << 18 | f[r.charCodeAt(h + 1)] << 12 | f[r.charCodeAt(h + 2)] << 6 | f[r.charCodeAt(h + 3)], t[v++] = e >> 16 & 255, t[v++] = e >> 8 & 255, t[v++] = e & 255;
|
|
30
|
+
return n === 2 && (e = f[r.charCodeAt(h)] << 2 | f[r.charCodeAt(h + 1)] >> 4, t[v++] = e & 255), n === 1 && (e = f[r.charCodeAt(h)] << 10 | f[r.charCodeAt(h + 1)] << 4 | f[r.charCodeAt(h + 2)] >> 2, t[v++] = e >> 8 & 255, t[v++] = e & 255), t;
|
|
31
|
+
}
|
|
32
|
+
function L(r) {
|
|
33
|
+
return F[r >> 18 & 63] + F[r >> 12 & 63] + F[r >> 6 & 63] + F[r & 63];
|
|
34
|
+
}
|
|
35
|
+
function g(r, e, a) {
|
|
36
|
+
for (var o, n = [], t = e; t < a; t += 3)
|
|
37
|
+
o = (r[t] << 16 & 16711680) + (r[t + 1] << 8 & 65280) + (r[t + 2] & 255), n.push(L(o));
|
|
38
|
+
return n.join("");
|
|
39
|
+
}
|
|
40
|
+
function i(r) {
|
|
41
|
+
for (var e, a = r.length, o = a % 3, n = [], t = 16383, v = 0, d = a - o; v < d; v += t)
|
|
42
|
+
n.push(g(r, v, v + t > d ? d : v + t));
|
|
43
|
+
return o === 1 ? (e = r[a - 1], n.push(
|
|
44
|
+
F[e >> 2] + F[e << 4 & 63] + "=="
|
|
45
|
+
)) : o === 2 && (e = (r[a - 2] << 8) + r[a - 1], n.push(
|
|
46
|
+
F[e >> 10] + F[e >> 4 & 63] + F[e << 2 & 63] + "="
|
|
47
|
+
)), n.join("");
|
|
34
48
|
}
|
|
35
49
|
export {
|
|
36
|
-
|
|
37
|
-
d as EmptyBlobError,
|
|
38
|
-
l as InvalidVersionedHashSizeError,
|
|
39
|
-
c as InvalidVersionedHashVersionError
|
|
50
|
+
l as default
|
|
40
51
|
};
|
package/dist/index94.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const d=require("./index96.cjs");/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */d.__exports.read=function(w,a,_,x,M){var t,r,h=M*8-x-1,s=(1<<h)-1,N=s>>1,i=-7,o=_?M-1:0,c=_?-1:1,p=w[a+o];for(o+=c,t=p&(1<<-i)-1,p>>=-i,i+=h;i>0;t=t*256+w[a+o],o+=c,i-=8);for(r=t&(1<<-i)-1,t>>=-i,i+=x;i>0;r=r*256+w[a+o],o+=c,i-=8);if(t===0)t=1-N;else{if(t===s)return r?NaN:(p?-1:1)*(1/0);r=r+Math.pow(2,x),t=t-N}return(p?-1:1)*r*Math.pow(2,t-x)};d.__exports.write=function(w,a,_,x,M,t){var r,h,s,N=t*8-M-1,i=(1<<N)-1,o=i>>1,c=M===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=x?0:t-1,f=x?1:-1,n=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(h=isNaN(a)?1:0,r=i):(r=Math.floor(Math.log(a)/Math.LN2),a*(s=Math.pow(2,-r))<1&&(r--,s*=2),r+o>=1?a+=c/s:a+=c*Math.pow(2,1-o),a*s>=2&&(r++,s/=2),r+o>=i?(h=0,r=i):r+o>=1?(h=(a*s-1)*Math.pow(2,M),r=r+o):(h=a*Math.pow(2,o-1)*Math.pow(2,M),r=0));M>=8;w[_+p]=h&255,p+=f,h/=256,M-=8);for(r=r<<M|h,N+=M;N>0;w[_+p]=r&255,p+=f,r/=256,N-=8);w[_+p-f]|=n*128};module.exports=d.__exports;
|
package/dist/index94.js
CHANGED
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
import {
|
|
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
|
-
}
|
|
1
|
+
import { __exports as v } from "./index96.js";
|
|
2
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
3
|
+
v.read = function(s, a, x, f, M) {
|
|
4
|
+
var t, r, h = M * 8 - f - 1, w = (1 << h) - 1, N = w >> 1, i = -7, o = x ? M - 1 : 0, d = x ? -1 : 1, p = s[a + o];
|
|
5
|
+
for (o += d, t = p & (1 << -i) - 1, p >>= -i, i += h; i > 0; t = t * 256 + s[a + o], o += d, i -= 8)
|
|
6
|
+
;
|
|
7
|
+
for (r = t & (1 << -i) - 1, t >>= -i, i += f; i > 0; r = r * 256 + s[a + o], o += d, i -= 8)
|
|
8
|
+
;
|
|
9
|
+
if (t === 0)
|
|
10
|
+
t = 1 - N;
|
|
11
|
+
else {
|
|
12
|
+
if (t === w)
|
|
13
|
+
return r ? NaN : (p ? -1 : 1) * (1 / 0);
|
|
14
|
+
r = r + Math.pow(2, f), t = t - N;
|
|
15
|
+
}
|
|
16
|
+
return (p ? -1 : 1) * r * Math.pow(2, t - f);
|
|
17
|
+
};
|
|
18
|
+
v.write = function(s, a, x, f, M, t) {
|
|
19
|
+
var r, h, w, N = t * 8 - M - 1, i = (1 << N) - 1, o = i >> 1, d = M === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = f ? 0 : t - 1, c = f ? 1 : -1, I = a < 0 || a === 0 && 1 / a < 0 ? 1 : 0;
|
|
20
|
+
for (a = Math.abs(a), isNaN(a) || a === 1 / 0 ? (h = isNaN(a) ? 1 : 0, r = i) : (r = Math.floor(Math.log(a) / Math.LN2), a * (w = Math.pow(2, -r)) < 1 && (r--, w *= 2), r + o >= 1 ? a += d / w : a += d * Math.pow(2, 1 - o), a * w >= 2 && (r++, w /= 2), r + o >= i ? (h = 0, r = i) : r + o >= 1 ? (h = (a * w - 1) * Math.pow(2, M), r = r + o) : (h = a * Math.pow(2, o - 1) * Math.pow(2, M), r = 0)); M >= 8; s[x + p] = h & 255, p += c, h /= 256, M -= 8)
|
|
21
|
+
;
|
|
22
|
+
for (r = r << M | h, N += M; N > 0; s[x + p] = r & 255, p += c, r /= 256, N -= 8)
|
|
23
|
+
;
|
|
24
|
+
s[x + p - c] |= I * 128;
|
|
25
|
+
};
|
|
27
26
|
export {
|
|
28
|
-
|
|
29
|
-
u as sliceBytes,
|
|
30
|
-
l as sliceHex
|
|
27
|
+
v as default
|
|
31
28
|
};
|
package/dist/index95.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/index95.js
CHANGED
|
@@ -1,23 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
class i extends o {
|
|
3
|
-
constructor({ offset: e }) {
|
|
4
|
-
super(`Offset \`${e}\` cannot be negative.`, {
|
|
5
|
-
name: "NegativeOffsetError"
|
|
6
|
-
});
|
|
7
|
-
}
|
|
8
|
-
}
|
|
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
|
-
}
|
|
13
|
-
}
|
|
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
|
-
}
|
|
18
|
-
}
|
|
1
|
+
var s = {};
|
|
19
2
|
export {
|
|
20
|
-
|
|
21
|
-
n as PositionOutOfBoundsError,
|
|
22
|
-
c as RecursiveReadLimitExceededError
|
|
3
|
+
s as __exports
|
|
23
4
|
};
|
package/dist/index96.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/index96.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { isHex as r } from "./index60.js";
|
|
3
|
-
import { toBytes as c } from "./index58.js";
|
|
4
|
-
function k(t, e) {
|
|
5
|
-
return o(r(t, { strict: !1 }) ? c(t) : t);
|
|
6
|
-
}
|
|
1
|
+
var e = {};
|
|
7
2
|
export {
|
|
8
|
-
|
|
3
|
+
e as __exports
|
|
9
4
|
};
|
package/dist/index97.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 t=require("./index66.cjs");class i extends t.BaseError{constructor({offset:r,position:s,size:e}){super(`Slice ${s==="start"?"starting":"ending"} at offset "${r}" is out-of-bounds (size: ${e}).`,{name:"SliceOffsetOutOfBoundsError"})}}class d extends t.BaseError{constructor({size:r,targetSize:s,type:e}){super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (${r}) exceeds padding size (${s}).`,{name:"SizeExceedsPaddingSizeError"})}}exports.SizeExceedsPaddingSizeError=d;exports.SliceOffsetOutOfBoundsError=i;
|
package/dist/index97.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
1
|
+
import { BaseError as o } from "./index66.js";
|
|
2
|
+
class d extends o {
|
|
3
|
+
constructor({ offset: r, position: s, size: e }) {
|
|
4
|
+
super(`Slice ${s === "start" ? "starting" : "ending"} at offset "${r}" is out-of-bounds (size: ${e}).`, { name: "SliceOffsetOutOfBoundsError" });
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
class n extends o {
|
|
8
|
+
constructor({ size: r, targetSize: s, type: e }) {
|
|
9
|
+
super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (${r}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
10
|
+
}
|
|
11
|
+
}
|
|
5
12
|
export {
|
|
6
|
-
|
|
13
|
+
n as SizeExceedsPaddingSizeError,
|
|
14
|
+
d as SliceOffsetOutOfBoundsError
|
|
7
15
|
};
|
package/dist/index98.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 e=require("./index99.cjs"),s=require("./index67.cjs"),r=require("./index65.cjs");function o(t,i){return e.sha256(s.isHex(t,{strict:!1})?r.toBytes(t):t)}exports.sha256=o;
|
package/dist/index98.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
t.slice(0, t.length - n),
|
|
7
|
-
t.slice(t.length - n)
|
|
8
|
-
];
|
|
9
|
-
return e = e.replace(/(0+)$/, ""), `${i ? "-" : ""}${l || "0"}${e ? `.${e}` : ""}`;
|
|
1
|
+
import { sha256 as o } from "./index99.js";
|
|
2
|
+
import { isHex as s } from "./index67.js";
|
|
3
|
+
import { toBytes as r } from "./index65.js";
|
|
4
|
+
function p(t, i) {
|
|
5
|
+
return o(s(t, { strict: !1 }) ? r(t) : t);
|
|
10
6
|
}
|
|
11
7
|
export {
|
|
12
|
-
|
|
8
|
+
p as sha256
|
|
13
9
|
};
|
package/dist/index99.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 H=require("./index122.cjs"),s=require("./index123.cjs"),S=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),b=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),f=new Uint32Array(64);class g extends H.HashMD{constructor(){super(64,32,8,!1),this.A=b[0]|0,this.B=b[1]|0,this.C=b[2]|0,this.D=b[3]|0,this.E=b[4]|0,this.F=b[5]|0,this.G=b[6]|0,this.H=b[7]|0}get(){const{A:d,B:o,C:x,D:e,E:a,F:i,G:c,H:r}=this;return[d,o,x,e,a,i,c,r]}set(d,o,x,e,a,i,c,r){this.A=d|0,this.B=o|0,this.C=x|0,this.D=e|0,this.E=a|0,this.F=i|0,this.G=c|0,this.H=r|0}process(d,o){for(let t=0;t<16;t++,o+=4)f[t]=d.getUint32(o,!1);for(let t=16;t<64;t++){const A=f[t-15],n=f[t-2],C=s.rotr(A,7)^s.rotr(A,18)^A>>>3,u=s.rotr(n,17)^s.rotr(n,19)^n>>>10;f[t]=u+f[t-7]+C+f[t-16]|0}let{A:x,B:e,C:a,D:i,E:c,F:r,G:h,H:l}=this;for(let t=0;t<64;t++){const A=s.rotr(c,6)^s.rotr(c,11)^s.rotr(c,25),n=l+A+H.Chi(c,r,h)+S[t]+f[t]|0,u=(s.rotr(x,2)^s.rotr(x,13)^s.rotr(x,22))+H.Maj(x,e,a)|0;l=h,h=r,r=c,c=i+n|0,i=a,a=e,e=x,x=n+u|0}x=x+this.A|0,e=e+this.B|0,a=a+this.C|0,i=i+this.D|0,c=c+this.E|0,r=r+this.F|0,h=h+this.G|0,l=l+this.H|0,this.set(x,e,a,i,c,r,h,l)}roundClean(){f.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const y=s.wrapConstructor(()=>new g);exports.SHA256=g;exports.sha256=y;
|
package/dist/index99.js
CHANGED
|
@@ -1,22 +1,115 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { HashMD as m, Chi as p, Maj as u } from "./index122.js";
|
|
2
|
+
import { wrapConstructor as D, rotr as i } from "./index123.js";
|
|
3
|
+
const g = /* @__PURE__ */ new Uint32Array([
|
|
4
|
+
1116352408,
|
|
5
|
+
1899447441,
|
|
6
|
+
3049323471,
|
|
7
|
+
3921009573,
|
|
8
|
+
961987163,
|
|
9
|
+
1508970993,
|
|
10
|
+
2453635748,
|
|
11
|
+
2870763221,
|
|
12
|
+
3624381080,
|
|
13
|
+
310598401,
|
|
14
|
+
607225278,
|
|
15
|
+
1426881987,
|
|
16
|
+
1925078388,
|
|
17
|
+
2162078206,
|
|
18
|
+
2614888103,
|
|
19
|
+
3248222580,
|
|
20
|
+
3835390401,
|
|
21
|
+
4022224774,
|
|
22
|
+
264347078,
|
|
23
|
+
604807628,
|
|
24
|
+
770255983,
|
|
25
|
+
1249150122,
|
|
26
|
+
1555081692,
|
|
27
|
+
1996064986,
|
|
28
|
+
2554220882,
|
|
29
|
+
2821834349,
|
|
30
|
+
2952996808,
|
|
31
|
+
3210313671,
|
|
32
|
+
3336571891,
|
|
33
|
+
3584528711,
|
|
34
|
+
113926993,
|
|
35
|
+
338241895,
|
|
36
|
+
666307205,
|
|
37
|
+
773529912,
|
|
38
|
+
1294757372,
|
|
39
|
+
1396182291,
|
|
40
|
+
1695183700,
|
|
41
|
+
1986661051,
|
|
42
|
+
2177026350,
|
|
43
|
+
2456956037,
|
|
44
|
+
2730485921,
|
|
45
|
+
2820302411,
|
|
46
|
+
3259730800,
|
|
47
|
+
3345764771,
|
|
48
|
+
3516065817,
|
|
49
|
+
3600352804,
|
|
50
|
+
4094571909,
|
|
51
|
+
275423344,
|
|
52
|
+
430227734,
|
|
53
|
+
506948616,
|
|
54
|
+
659060556,
|
|
55
|
+
883997877,
|
|
56
|
+
958139571,
|
|
57
|
+
1322822218,
|
|
58
|
+
1537002063,
|
|
59
|
+
1747873779,
|
|
60
|
+
1955562222,
|
|
61
|
+
2024104815,
|
|
62
|
+
2227730452,
|
|
63
|
+
2361852424,
|
|
64
|
+
2428436474,
|
|
65
|
+
2756734187,
|
|
66
|
+
3204031479,
|
|
67
|
+
3329325298
|
|
68
|
+
]), b = /* @__PURE__ */ new Uint32Array([
|
|
69
|
+
1779033703,
|
|
70
|
+
3144134277,
|
|
71
|
+
1013904242,
|
|
72
|
+
2773480762,
|
|
73
|
+
1359893119,
|
|
74
|
+
2600822924,
|
|
75
|
+
528734635,
|
|
76
|
+
1541459225
|
|
77
|
+
]), h = /* @__PURE__ */ new Uint32Array(64);
|
|
78
|
+
class w extends m {
|
|
79
|
+
constructor() {
|
|
80
|
+
super(64, 32, 8, !1), this.A = b[0] | 0, this.B = b[1] | 0, this.C = b[2] | 0, this.D = b[3] | 0, this.E = b[4] | 0, this.F = b[5] | 0, this.G = b[6] | 0, this.H = b[7] | 0;
|
|
81
|
+
}
|
|
82
|
+
get() {
|
|
83
|
+
const { A: d, B: o, C: t, D: s, E: a, F: f, G: c, H: e } = this;
|
|
84
|
+
return [d, o, t, s, a, f, c, e];
|
|
85
|
+
}
|
|
86
|
+
// prettier-ignore
|
|
87
|
+
set(d, o, t, s, a, f, c, e) {
|
|
88
|
+
this.A = d | 0, this.B = o | 0, this.C = t | 0, this.D = s | 0, this.E = a | 0, this.F = f | 0, this.G = c | 0, this.H = e | 0;
|
|
89
|
+
}
|
|
90
|
+
process(d, o) {
|
|
91
|
+
for (let x = 0; x < 16; x++, o += 4)
|
|
92
|
+
h[x] = d.getUint32(o, !1);
|
|
93
|
+
for (let x = 16; x < 64; x++) {
|
|
94
|
+
const A = h[x - 15], n = h[x - 2], C = i(A, 7) ^ i(A, 18) ^ A >>> 3, H = i(n, 17) ^ i(n, 19) ^ n >>> 10;
|
|
95
|
+
h[x] = H + h[x - 7] + C + h[x - 16] | 0;
|
|
96
|
+
}
|
|
97
|
+
let { A: t, B: s, C: a, D: f, E: c, F: e, G: r, H: l } = this;
|
|
98
|
+
for (let x = 0; x < 64; x++) {
|
|
99
|
+
const A = i(c, 6) ^ i(c, 11) ^ i(c, 25), n = l + A + p(c, e, r) + g[x] + h[x] | 0, H = (i(t, 2) ^ i(t, 13) ^ i(t, 22)) + u(t, s, a) | 0;
|
|
100
|
+
l = r, r = e, e = c, c = f + n | 0, f = a, a = s, s = t, t = n + H | 0;
|
|
9
101
|
}
|
|
10
|
-
|
|
11
|
-
} : o.exports = function(e, t) {
|
|
12
|
-
if (t) {
|
|
13
|
-
e.super_ = t;
|
|
14
|
-
var r = function() {
|
|
15
|
-
};
|
|
16
|
-
r.prototype = t.prototype, e.prototype = new r(), e.prototype.constructor = e;
|
|
102
|
+
t = t + this.A | 0, s = s + this.B | 0, a = a + this.C | 0, f = f + this.D | 0, c = c + this.E | 0, e = e + this.F | 0, r = r + this.G | 0, l = l + this.H | 0, this.set(t, s, a, f, c, e, r, l);
|
|
17
103
|
}
|
|
18
|
-
|
|
19
|
-
|
|
104
|
+
roundClean() {
|
|
105
|
+
h.fill(0);
|
|
106
|
+
}
|
|
107
|
+
destroy() {
|
|
108
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), this.buffer.fill(0);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const G = /* @__PURE__ */ D(() => new w());
|
|
20
112
|
export {
|
|
21
|
-
|
|
113
|
+
w as SHA256,
|
|
114
|
+
G as sha256
|
|
22
115
|
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ export { SecretManager } from './lib/secretManager/secretManager';
|
|
|
11
11
|
export type { ISecretManager, Secret, } from './lib/secretManager/secretManager.types';
|
|
12
12
|
export { Quote } from './lib/quote/quote';
|
|
13
13
|
export type { IQuote, QuoteResponse, Strategies, } from './lib/quote/quote.types';
|
|
14
|
-
export { switchOrAddNetwork, constructOrderPair, evmToViemChainMap, } from './lib/utils';
|
|
14
|
+
export { switchOrAddNetwork, constructOrderPair, evmToViemChainMap, validateBTCAddress, } from './lib/utils';
|
|
@@ -9,6 +9,6 @@ export declare class EvmRelay implements IEVMRelay {
|
|
|
9
9
|
private auth;
|
|
10
10
|
private order;
|
|
11
11
|
constructor(order: MatchedOrder, url: string, auth: IAuth);
|
|
12
|
-
init(walletClient: WalletClient
|
|
12
|
+
init(walletClient: WalletClient): AsyncResult<string, string>;
|
|
13
13
|
redeem(orderId: string, secret: string): AsyncResult<string, string>;
|
|
14
14
|
}
|
|
@@ -15,7 +15,7 @@ export interface IEVMRelay {
|
|
|
15
15
|
* @NOTE send the current block number of the L1 chain, if the order is on L2 chain (arbitrum).
|
|
16
16
|
* @returns txHash of Initiation
|
|
17
17
|
*/
|
|
18
|
-
init(walletClient: WalletClient
|
|
18
|
+
init(walletClient: WalletClient): AsyncResult<string, string>;
|
|
19
19
|
/**
|
|
20
20
|
* Redeems funds from the EVM atomic swap contract using relay service.
|
|
21
21
|
* Sends the secret to the relay service.
|
package/dist/src/lib/utils.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Chain, EvmChain } from '@gardenfi/orderbook';
|
|
|
4
4
|
import { WalletClient } from 'viem';
|
|
5
5
|
import { AsyncResult } from '@catalogfi/utils';
|
|
6
6
|
|
|
7
|
+
import * as bitcoin from 'bitcoinjs-lib';
|
|
7
8
|
export declare const computeSecret: (fromChain: Chain, toChain: Chain, wallets: Partial<Record<Chain, IBaseWallet>>, nonce: number) => Promise<string>;
|
|
8
9
|
export declare const isFromChainBitcoin: (chain: Chain) => chain is "bitcoin" | "bitcoin_testnet" | "bitcoin_regtest";
|
|
9
10
|
/**
|
|
@@ -34,3 +35,4 @@ export declare const switchOrAddNetwork: (chain: Chain, walletClient: WalletClie
|
|
|
34
35
|
walletClient: WalletClient;
|
|
35
36
|
}, string>;
|
|
36
37
|
export declare const constructOrderPair: (sourceChain: Chain, sourceAsset: string, destChain: Chain, destAsset: string) => string;
|
|
38
|
+
export declare function validateBTCAddress(address: string, network: bitcoin.networks.Network): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gardenfi/core",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.75",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@catalogfi/utils": "^0.1.6",
|
|
30
30
|
"@catalogfi/wallets": "^0.2.51",
|
|
31
|
-
"@gardenfi/orderbook": "^0.2.0-beta.
|
|
31
|
+
"@gardenfi/orderbook": "^0.2.0-beta.19",
|
|
32
32
|
"@gardenfi/utils": "^0.0.1-beta.18",
|
|
33
33
|
"bignumber.js": "^9.1.2",
|
|
34
34
|
"bitcoinjs-lib": "^6.1.6",
|