@wormhole-foundation/wormhole-connect 3.0.0-beta.7-development → 3.0.0-beta.9-development
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/main.js +48 -48
- package/dist/src/config/tokens.d.ts +0 -1
- package/dist/src/config/tokens.d.ts.map +1 -1
- package/dist/src/contexts/TokensContext.d.ts.map +1 -1
- package/dist/src/utils/errors.d.ts +1 -0
- package/dist/src/utils/errors.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/WalletConnector/Sidebar.d.ts.map +1 -1
- package/dist/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/lib/{account-QG_Hi4er.js → account-BSFuCEgk.js} +1 -1
- package/lib/{account-BK8xMTUI.mjs → account-y1ICRMSr.mjs} +1 -1
- package/lib/{address-B-_yHNB2.js → address-BwcXVurJ.js} +1 -1
- package/lib/{address-CNhzoegm.js → address-D8qNQEOW.js} +1 -1
- package/lib/{address-BWXkejmE.mjs → address-DaoiwqzU.mjs} +1 -1
- package/lib/{address-RcMobNYE.js → address-DnSRsubO.js} +7 -7
- package/lib/{address-CBux52Na.mjs → address-DqsMcbcT.mjs} +612 -588
- package/lib/{address-DKHa7TFU.mjs → address-S7wMItHX.mjs} +1 -1
- package/lib/{aptos-9aq-5gkF.mjs → aptos-CSVdIYqJ.mjs} +3 -3
- package/lib/{aptos-XxKO9242.js → aptos-C_j04MF5.js} +1 -1
- package/lib/{aptos-C180o9od.mjs → aptos-C_sLjrbm.mjs} +15 -15
- package/lib/{aptos-BZ2mcuTd.js → aptos-ma6bumqy.js} +2 -2
- package/lib/{base64-Dmj19Uvu.mjs → base64-B2xumR3a.mjs} +3 -2
- package/lib/{base64-BfY07bq5.js → base64-a1Dr6hMt.js} +1 -1
- package/lib/{blake2b-CgbIfNRX.mjs → blake2b-CR50AGep.mjs} +1 -1
- package/lib/{blake2b-CoM94_cH.js → blake2b-Dkm1d7Wp.js} +1 -1
- package/lib/{browser-ponyfill-BAEAyXvw.js → browser-ponyfill-BTt_ELXG.js} +1 -1
- package/lib/{browser-ponyfill-BecG2Lnb.mjs → browser-ponyfill-uCX78ltK.mjs} +1 -1
- package/lib/{ccip-CUqskd5M.mjs → ccip-69mFHkV9.mjs} +1 -1
- package/lib/{ccip-oytFtCzk.js → ccip-BFyWlloE.js} +1 -1
- package/lib/{chain-itK5uGYL.js → chain-Cio41-Lr.js} +1 -1
- package/lib/{chain-sKZNJgPZ.mjs → chain-DbmG-oEQ.mjs} +1 -1
- package/lib/{chunk-IMTC3J2M-DKLPKqnP.mjs → chunk-IMTC3J2M-CmFt3nz5.mjs} +137 -135
- package/lib/chunk-IMTC3J2M-NMBEZ4p8.js +471 -0
- package/lib/{constants-DrDsewBe.mjs → constants-JcrZQeMq.mjs} +3 -3
- package/lib/{constants-Bmrui4ZY.js → constants-lsjPx3va.js} +1 -1
- package/lib/{contract-MJZ8ZoSX.js → contract-CcVq6MSa.js} +1 -1
- package/lib/{contract-BVaUamai.mjs → contract-DrK81GRi.mjs} +109 -109
- package/lib/create-BtJgfMdJ.mjs +18 -0
- package/lib/{create-DO_-1_Hb.js → create-Q6N34YQz.js} +1 -1
- package/lib/{evm-IjnSHeSg.mjs → evm--hXXT-db.mjs} +9 -9
- package/lib/{evm-C-aa4dBG.mjs → evm-BBqhcxFC.mjs} +83 -83
- package/lib/{evm-D_r84vhS.js → evm-CNq2zXwl.js} +3 -3
- package/lib/{evm-ZSzF-61X.js → evm-l0300AWS.js} +2 -2
- package/lib/executor.js +470 -1
- package/lib/executor.mjs +7106 -560
- package/lib/hosted.js +1 -1
- package/lib/hosted.mjs +1 -1
- package/lib/{index-aA-2Ygs3.mjs → index-98w8rrCe.mjs} +1 -1
- package/lib/{index-Bb8InrQU.mjs → index-9dr91dtY.mjs} +2 -2
- package/lib/{index-DNaxNpBa.js → index-BABC5__9.js} +1 -1
- package/lib/{index-CapdlI6H.js → index-BAjc-UZH.js} +1 -1
- package/lib/{index-Cx-ODuWg.mjs → index-BN-aj3dN.mjs} +4 -4
- package/lib/{index-BeQ668oT.js → index-BV7XVrd8.js} +1 -1
- package/lib/{index-CKaF7Gzs.mjs → index-BbUxOO56.mjs} +14 -14
- package/lib/{index-D3cDkU4S.js → index-BfPE3vDw.js} +1 -1
- package/lib/{index-Batb-GTa.mjs → index-BlCHxlUD.mjs} +5 -5
- package/lib/{index-CZYUYK5K.js → index-BnCQiOiA.js} +1 -1
- package/lib/{index-CsdQttEt.mjs → index-BqmCeCU_.mjs} +5 -5
- package/lib/{index-Ce0EI1tW.mjs → index-BtrXSq3R.mjs} +5 -5
- package/lib/{index-CE0rxdUf.js → index-C-ORpsiU.js} +1 -1
- package/lib/{index-DyE-3pz1.js → index-C0un9IYm.js} +1 -1
- package/lib/{index-DdvRmaTh.mjs → index-C4HPXgbm.mjs} +7 -7
- package/lib/{index-DgIxcujP.mjs → index-COkYtNvE.mjs} +36 -36
- package/lib/{index-CLy98PXT.mjs → index-COs6VyCx.mjs} +13 -13
- package/lib/{index-43m4zMem.js → index-COsUDXFI.js} +1 -1
- package/lib/{index-B36we0ml.mjs → index-CUYHyKgr.mjs} +7 -7
- package/lib/{index-BcAXCy1h.js → index-CUyxr8OX.js} +1 -1
- package/lib/{index-DDBLdcME.mjs → index-CX0qxE9A.mjs} +11 -11
- package/lib/{index-C2Pe6i5V.js → index-CiFTvTwg.js} +1 -1
- package/lib/{index-DNcx7dMI.mjs → index-CofxOTyV.mjs} +5 -5
- package/lib/{index-BGqRY1Ww.js → index-CsR_y9ji.js} +1 -1
- package/lib/{index-CA5XKv-J.js → index-CuoxLyOv.js} +1 -1
- package/lib/{index-DRCX2iXw.js → index-CvEfOpn2.js} +1 -1
- package/lib/{index-CV3K6bKD.js → index-Cxwfq1al.js} +1 -1
- package/lib/{index-CjroDahP.mjs → index-D0tl0B36.mjs} +2 -2
- package/lib/{index-f_27F6WX.js → index-D4KtQtgE.js} +1 -1
- package/lib/{index-D2o0FZvZ.js → index-D74ZE0n9.js} +1 -1
- package/lib/{index-DkZjpCle.js → index-DLFGcXjy.js} +1 -1
- package/lib/{index-07cEoDZD.mjs → index-DNvr2HlM.mjs} +13 -13
- package/lib/{index-Cu7gFSJv.mjs → index-DPfKYdEf.mjs} +1 -1
- package/lib/{index-Bogu114a.js → index-Db3GFx2x.js} +1 -1
- package/lib/{index-Dt-63Ecw.js → index-DbJV-Hi3.js} +1 -1
- package/lib/{index-B-S6avdv.js → index-DebLDCcs.js} +1 -1
- package/lib/{index-DC1ot7tO.js → index-DjbQ-yfQ.js} +1 -1
- package/lib/{index-Cry2AYTm.mjs → index-DsKRmXnW.mjs} +3 -3
- package/lib/{index-FCA-cXcS.js → index-DtUeWT1n.js} +1 -1
- package/lib/{index-DyvQhGPY.mjs → index-DtfwfGsA.mjs} +2 -2
- package/lib/{index-DDBdrN7Y.mjs → index-DvozGHS-.mjs} +7070 -7093
- package/lib/{index-Cyo0tNu5.mjs → index-Dx7nqevs.mjs} +2 -2
- package/lib/{index-Blzzdktm.js → index-LJw0S70V.js} +1 -1
- package/lib/{index-rAnJYuJr.mjs → index-Nh2mSVy3.mjs} +9 -9
- package/lib/{index-B5XhLD_L.mjs → index-S_O9ybUy.mjs} +5 -5
- package/lib/{index-CIhJm6vf.js → index-S_dcknx7.js} +86 -86
- package/lib/{index-Dsaj5lf_.js → index-U1ceHkB6.js} +1 -1
- package/lib/{index-BUlzgqNa.mjs → index-Yp3NfcfI.mjs} +4 -4
- package/lib/{index-DRleG63r.mjs → index-Z48MvcFr.mjs} +1 -1
- package/lib/{index-B9hin5U8.mjs → index-ejTR4WLF.mjs} +5 -5
- package/lib/{index-BUfjw4S2.mjs → index-kyD2rWx8.mjs} +11 -11
- package/lib/{index-BL4H4RbP.js → index-lG1-neJv.js} +1 -1
- package/lib/{index-CuDLHfKb.mjs → index-sz4KACqf.mjs} +5 -5
- package/lib/{index-dpkTW-H8.js → index-vIUqmO0o.js} +1 -1
- package/lib/{index.es-MXzok_Dp.js → index.es-C4RhqFy8.js} +2 -2
- package/lib/{index.es-C6ziEcYX.mjs → index.es-D5O0G4Af.mjs} +7 -7
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/mayan.js +1 -1
- package/lib/mayan.mjs +10 -10
- package/lib/{mint-C3SdQH_S.mjs → mint-CKsi-DrV.mjs} +2 -2
- package/lib/{mint-BxtkCWBh.js → mint-DNcbNuI1.js} +1 -1
- package/lib/ntt.js +1 -1
- package/lib/ntt.mjs +10 -10
- package/lib/{platform-Czq0KkFa.mjs → platform-BCxJ-CNM.mjs} +7 -7
- package/lib/{platform-CG_VHRJU.js → platform-BqUizEYV.js} +1 -1
- package/lib/{platform-CUeBR_i4.mjs → platform-CB3TPh7I.mjs} +17 -17
- package/lib/{platform-CyTWPtDR.js → platform-CGIgJRY3.js} +1 -1
- package/lib/{platform-PNwsacZi.js → platform-D7pe3gG2.js} +1 -1
- package/lib/{platform-Droe0nZu.mjs → platform-DTVt42uH.mjs} +4 -4
- package/lib/provider-jsonrpc-DYBOGqdj.js +1 -0
- package/lib/{provider-jsonrpc-CVWSLk8g.mjs → provider-jsonrpc-MOE1VIOF.mjs} +155 -155
- package/lib/{sha3-BMK6V2DM.mjs → sha3-BZUtvEPh.mjs} +1 -1
- package/lib/{sha3-uufRWTnZ.js → sha3-c6o5MDKC.js} +1 -1
- package/lib/{signer-L9IdBy4K.js → signer-BAFbrQDv.js} +1 -1
- package/lib/{signer-CYkXKdE1.mjs → signer-CwtXMDcn.mjs} +25 -25
- package/lib/solana-Cg0N1W8e.js +1 -0
- package/lib/{solana-iU2xZ6yu.js → solana-DIO5mbHM.js} +1 -1
- package/lib/{solana-CE7DDmW7.mjs → solana-Dr5BmG1x.mjs} +6 -6
- package/lib/solana-mJ922Ek9.mjs +18 -0
- package/lib/{solanaEmbed.esm-BtaI5pum.mjs → solanaEmbed.esm-C4t2kCSL.mjs} +3 -3
- package/lib/{solanaEmbed.esm-DUsdVcC-.js → solanaEmbed.esm-D0xXx6VI.js} +1 -1
- package/lib/src/config/tokens.d.ts +0 -1
- package/lib/src/config/tokens.d.ts.map +1 -1
- package/lib/src/contexts/TokensContext.d.ts.map +1 -1
- package/lib/src/utils/errors.d.ts +1 -0
- package/lib/src/utils/errors.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/WalletConnector/Sidebar.d.ts.map +1 -1
- package/lib/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/lib/{sui-BIE_b_7o.mjs → sui-AbsMI4yt.mjs} +3 -3
- package/lib/{sui-CNPKXqM6.js → sui-BSJIqJNt.js} +1 -1
- package/lib/{sui-Dva2w10T.js → sui-Bzh8kAZm.js} +1 -1
- package/lib/{sui-BJsKaZg2.mjs → sui-CZTSBdD4.mjs} +16 -16
- package/lib/{tokens-D4usSvOD.js → tokens-BUeRxOcP.js} +1 -1
- package/lib/{tokens-CQnhplD_.mjs → tokens-Vm--egzg.mjs} +4 -4
- package/lib/{units-CPUigdwl.js → units-LPlUOt3D.js} +1 -1
- package/lib/{units-YkCOGDr9.mjs → units-b10-QTSu.mjs} +28 -28
- package/lib/{unsignedTransaction-C0WXQMmv.mjs → unsignedTransaction-BJw0T6uN.mjs} +28 -28
- package/lib/{unsignedTransaction-DFUF8DSp.js → unsignedTransaction-CIkLJt6N.js} +1 -1
- package/lib/{web3-B3Usc-Qj.mjs → web3-BHuP7CTp.mjs} +7 -7
- package/lib/{web3-CjTx3huW.js → web3-SO_UBSxv.js} +1 -1
- package/package.json +2 -2
- package/lib/chunk-IMTC3J2M-D-un3eDX.js +0 -471
- package/lib/create-CQ6n4Ga8.mjs +0 -18
- package/lib/provider-jsonrpc-1gjszS3Q.js +0 -1
- package/lib/solana-BRQmi9BN.js +0 -1
- package/lib/solana-Bs7_C3BS.mjs +0 -18
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
1
|
+
var q = Object.defineProperty;
|
|
2
2
|
var $ = (n) => {
|
|
3
3
|
throw TypeError(n);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var J = (n, t, i) => t in n ? q(n, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[t] = i;
|
|
6
|
+
var T = (n, t, i) => J(n, typeof t != "symbol" ? t + "" : t, i), E = (n, t, i) => t.has(n) || $("Cannot " + i);
|
|
7
7
|
var s = (n, t, i) => (E(n, t, "read from private field"), i ? i.call(n) : t.get(n)), F = (n, t, i) => t.has(n) ? $("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, i), y = (n, t, i, e) => (E(n, t, "write to private field"), e ? e.call(n, i) : t.set(n, i), i), u = (n, t, i) => (E(n, t, "access private method"), i);
|
|
8
|
-
import {
|
|
9
|
-
import { g as z, f as
|
|
8
|
+
import { bN as j, bI as D, bJ as b, bM as w, bA as G } from "./address-DqsMcbcT.mjs";
|
|
9
|
+
import { g as z, f as H, b as K, h as C, m as P } from "./contract-DrK81GRi.mjs";
|
|
10
10
|
const Q = BigInt(-1), m = BigInt(0), I = BigInt(1), W = BigInt(5), x = {};
|
|
11
11
|
let N = "0000";
|
|
12
12
|
for (; N.length < 80; )
|
|
@@ -25,7 +25,7 @@ function B(n, t, i) {
|
|
|
25
25
|
operation: i,
|
|
26
26
|
fault: "overflow",
|
|
27
27
|
value: n
|
|
28
|
-
}), n > m ? n =
|
|
28
|
+
}), n > m ? n = C(P(n, e), e) : n = -C(P(-n, e), e);
|
|
29
29
|
} else {
|
|
30
30
|
const r = I << e;
|
|
31
31
|
w(i == null || n >= 0 && n < r, "overflow", "NUMERIC_FAULT", {
|
|
@@ -36,7 +36,7 @@ function B(n, t, i) {
|
|
|
36
36
|
}
|
|
37
37
|
return n;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function M(n) {
|
|
40
40
|
typeof n == "number" && (n = `fixed128x${n}`);
|
|
41
41
|
let t = !0, i = 128, e = 18;
|
|
42
42
|
if (typeof n == "string") {
|
|
@@ -47,7 +47,7 @@ function C(n) {
|
|
|
47
47
|
b(a, "invalid fixed format", "format", n), t = a[1] !== "u", i = parseInt(a[2]), e = parseInt(a[3]);
|
|
48
48
|
}
|
|
49
49
|
} else if (n) {
|
|
50
|
-
const a = n, h = (d, S,
|
|
50
|
+
const a = n, h = (d, S, k) => a[d] == null ? k : (b(typeof a[d] === S, "invalid fixed format (" + d + " not " + S + ")", "format." + d, a[d]), a[d]);
|
|
51
51
|
t = h("signed", "boolean", t), i = h("width", "number", i), e = h("decimals", "number", e);
|
|
52
52
|
}
|
|
53
53
|
b(i % 8 === 0, "invalid FixedNumber width (not byte aligned)", "format.width", i), b(e <= 80, "invalid FixedNumber decimals (too large)", "format.decimals", e);
|
|
@@ -69,7 +69,7 @@ function X(n, t) {
|
|
|
69
69
|
e = e.substring(0, e.length - 1);
|
|
70
70
|
return i + e;
|
|
71
71
|
}
|
|
72
|
-
var g, l, f, o, U, c,
|
|
72
|
+
var g, l, f, o, U, c, L, R, V, _;
|
|
73
73
|
const p = class p {
|
|
74
74
|
// Use this when changing this file to get some typing info,
|
|
75
75
|
// but then switch to any to mask the internal type
|
|
@@ -82,7 +82,7 @@ const p = class p {
|
|
|
82
82
|
/**
|
|
83
83
|
* The specific fixed-point arithmetic field for this value.
|
|
84
84
|
*/
|
|
85
|
-
|
|
85
|
+
T(this, "format");
|
|
86
86
|
F(this, g);
|
|
87
87
|
// The actual value (accounting for decimals)
|
|
88
88
|
F(this, l);
|
|
@@ -93,10 +93,10 @@ const p = class p {
|
|
|
93
93
|
*
|
|
94
94
|
* @private
|
|
95
95
|
*/
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
T(this, "_value");
|
|
97
|
+
j(t, x, "FixedNumber"), y(this, l, i), y(this, g, e);
|
|
98
98
|
const r = X(i, e.decimals);
|
|
99
|
-
|
|
99
|
+
D(this, { format: e.name, _value: r }), y(this, f, v(e.decimals));
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
102
|
* If true, negative values are permitted, otherwise only
|
|
@@ -129,7 +129,7 @@ const p = class p {
|
|
|
129
129
|
* to %%other%%, ignoring overflow.
|
|
130
130
|
*/
|
|
131
131
|
addUnsafe(t) {
|
|
132
|
-
return u(this, o,
|
|
132
|
+
return u(this, o, L).call(this, t);
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
135
|
* Returns a new [[FixedNumber]] with the result of %%this%% added
|
|
@@ -137,7 +137,7 @@ const p = class p {
|
|
|
137
137
|
* occurs.
|
|
138
138
|
*/
|
|
139
139
|
add(t) {
|
|
140
|
-
return u(this, o,
|
|
140
|
+
return u(this, o, L).call(this, t, "add");
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
143
|
* Returns a new [[FixedNumber]] with the result of %%other%% subtracted
|
|
@@ -337,8 +337,8 @@ const p = class p {
|
|
|
337
337
|
* or underflow (precision loss).
|
|
338
338
|
*/
|
|
339
339
|
static fromValue(t, i, e) {
|
|
340
|
-
const r = i == null ? 0 : z(i), a =
|
|
341
|
-
let h =
|
|
340
|
+
const r = i == null ? 0 : z(i), a = M(e);
|
|
341
|
+
let h = H(t, "value");
|
|
342
342
|
const d = r - a.decimals;
|
|
343
343
|
if (d > 0) {
|
|
344
344
|
const S = v(d);
|
|
@@ -359,7 +359,7 @@ const p = class p {
|
|
|
359
359
|
static fromString(t, i) {
|
|
360
360
|
const e = t.match(/^(-?)([0-9]*)\.?([0-9]*)$/);
|
|
361
361
|
b(e && e[2].length + e[3].length > 0, "invalid FixedNumber string value", "value", t);
|
|
362
|
-
const r =
|
|
362
|
+
const r = M(i);
|
|
363
363
|
let a = e[2] || "0", h = e[3] || "";
|
|
364
364
|
for (; h.length < r.decimals; )
|
|
365
365
|
h += N;
|
|
@@ -379,16 +379,16 @@ const p = class p {
|
|
|
379
379
|
* in %%format%% due to overflow.
|
|
380
380
|
*/
|
|
381
381
|
static fromBytes(t, i) {
|
|
382
|
-
let e = K(
|
|
383
|
-
const r =
|
|
384
|
-
return r.signed && (e =
|
|
382
|
+
let e = K(G(t, "value"));
|
|
383
|
+
const r = M(i);
|
|
384
|
+
return r.signed && (e = C(e, r.width)), B(e, r, "fromBytes"), new p(x, e, r);
|
|
385
385
|
}
|
|
386
386
|
};
|
|
387
387
|
g = new WeakMap(), l = new WeakMap(), f = new WeakMap(), o = new WeakSet(), U = function(t) {
|
|
388
388
|
b(this.format === t.format, "incompatible format; use fixedNumber.toFormat", "other", t);
|
|
389
389
|
}, c = function(t, i) {
|
|
390
390
|
return t = B(t, s(this, g), i), new p(x, t, s(this, g));
|
|
391
|
-
},
|
|
391
|
+
}, L = function(t, i) {
|
|
392
392
|
return u(this, o, U).call(this, t), u(this, o, c).call(this, s(this, l) + s(t, l), i);
|
|
393
393
|
}, R = function(t, i) {
|
|
394
394
|
return u(this, o, U).call(this, t), u(this, o, c).call(this, s(this, l) - s(t, l), i);
|
|
@@ -401,8 +401,8 @@ g = new WeakMap(), l = new WeakMap(), f = new WeakMap(), o = new WeakSet(), U =
|
|
|
401
401
|
value: this
|
|
402
402
|
}), u(this, o, U).call(this, t), u(this, o, c).call(this, s(this, l) * s(this, f) / s(t, l), i);
|
|
403
403
|
};
|
|
404
|
-
let
|
|
405
|
-
const
|
|
404
|
+
let A = p;
|
|
405
|
+
const Z = [
|
|
406
406
|
"wei",
|
|
407
407
|
"kwei",
|
|
408
408
|
"mwei",
|
|
@@ -414,19 +414,19 @@ const P = [
|
|
|
414
414
|
function Y(n, t) {
|
|
415
415
|
let i = 18;
|
|
416
416
|
if (typeof t == "string") {
|
|
417
|
-
const e =
|
|
417
|
+
const e = Z.indexOf(t);
|
|
418
418
|
b(e >= 0, "invalid unit", "unit", t), i = 3 * e;
|
|
419
419
|
} else t != null && (i = z(t, "unit"));
|
|
420
|
-
return
|
|
420
|
+
return A.fromValue(n, i, { decimals: i, width: 512 }).toString();
|
|
421
421
|
}
|
|
422
422
|
function et(n, t) {
|
|
423
423
|
b(typeof n == "string", "value must be a string", "value", n);
|
|
424
424
|
let i = 18;
|
|
425
425
|
if (typeof t == "string") {
|
|
426
|
-
const e =
|
|
426
|
+
const e = Z.indexOf(t);
|
|
427
427
|
b(e >= 0, "invalid unit", "unit", t), i = 3 * e;
|
|
428
428
|
} else t != null && (i = z(t, "unit"));
|
|
429
|
-
return
|
|
429
|
+
return A.fromString(n, { decimals: i, width: 512 }).value;
|
|
430
430
|
}
|
|
431
431
|
function nt(n) {
|
|
432
432
|
return Y(n, 18);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var B = Object.defineProperty;
|
|
2
2
|
var P = (o, t, n) => t in o ? B(o, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[t] = n;
|
|
3
3
|
var d = (o, t, n) => P(o, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { b1 as w, ae as l, b3 as y,
|
|
5
|
-
import { C as L, P as O } from "./chain-
|
|
6
|
-
class
|
|
4
|
+
import { b1 as w, ae as l, b3 as y, bV as E, ad as S, W as N, cm as R, a5 as I, k as p, bX as x, bY as D } from "./address-DqsMcbcT.mjs";
|
|
5
|
+
import { C as L, P as O } from "./chain-DbmG-oEQ.mjs";
|
|
6
|
+
class V extends L {
|
|
7
7
|
async getTokenAccount(t, n) {
|
|
8
|
-
const { getAssociatedTokenAddress: e } = await import("./index-
|
|
8
|
+
const { getAssociatedTokenAddress: e } = await import("./index-BN-aj3dN.mjs"), i = new w(n).unwrap(), s = new w(t).unwrap(), r = await e(i, s);
|
|
9
9
|
return {
|
|
10
10
|
chain: this.chain,
|
|
11
11
|
address: new w(r.toString())
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const W = new l("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"), F = new l("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"), H = new l("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
|
|
16
16
|
new l("So11111111111111111111111111111111111111112");
|
|
17
17
|
new l("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");
|
|
18
18
|
const c = class c extends O {
|
|
@@ -29,7 +29,7 @@ const c = class c extends O {
|
|
|
29
29
|
}
|
|
30
30
|
getChain(t, n) {
|
|
31
31
|
if (t in this.config)
|
|
32
|
-
return new
|
|
32
|
+
return new V(t, this, n);
|
|
33
33
|
throw new Error("No configuration available for chain: " + t);
|
|
34
34
|
}
|
|
35
35
|
static nativeTokenId(t, n) {
|
|
@@ -58,28 +58,28 @@ const c = class c extends O {
|
|
|
58
58
|
return BigInt(await n.getBalance(s));
|
|
59
59
|
const r = await n.getTokenAccountsByOwner(s, {
|
|
60
60
|
mint: new w(i).unwrap()
|
|
61
|
-
}),
|
|
61
|
+
}), m = r.value.length > 0 ? r.value[0].pubkey : s, a = await n.getTokenAccountBalance(m);
|
|
62
62
|
return BigInt(a.value.amount);
|
|
63
63
|
}
|
|
64
64
|
static async getBalances(t, n, e, i) {
|
|
65
65
|
let s;
|
|
66
66
|
i.includes("native") && (s = BigInt(await n.getBalance(new l(e))));
|
|
67
|
-
const r = (await Promise.all([
|
|
67
|
+
const r = (await Promise.all([W, F].map((a) => new l(a)).map((a) => n.getParsedTokenAccountsByOwner(new l(e), { programId: a })))).reduce((a, u) => a.concat(u.value), []);
|
|
68
68
|
return i.map((a) => {
|
|
69
69
|
var f, k, T, b;
|
|
70
70
|
if (p(a))
|
|
71
71
|
return { native: s };
|
|
72
|
-
const u = new w(a).toString(),
|
|
73
|
-
var A,
|
|
74
|
-
return ((
|
|
72
|
+
const u = new w(a).toString(), h = (b = (T = (k = (f = r.find((g) => {
|
|
73
|
+
var A, C;
|
|
74
|
+
return ((C = (A = g == null ? void 0 : g.account.data.parsed) == null ? void 0 : A.info) == null ? void 0 : C.mint) === a.toString();
|
|
75
75
|
})) == null ? void 0 : f.account.data.parsed) == null ? void 0 : k.info) == null ? void 0 : T.tokenAmount) == null ? void 0 : b.amount;
|
|
76
|
-
return
|
|
76
|
+
return h ? { [u]: BigInt(h) } : { [u]: null };
|
|
77
77
|
}).reduce((a, u) => Object.assign(a, u), {});
|
|
78
78
|
}
|
|
79
79
|
static async sendWait(t, n, e, i) {
|
|
80
|
-
const s = await Promise.all(e.map((a) => this.sendTxWithRetry(n, a, i))), r = s.map((a) => a.signature),
|
|
81
|
-
if (
|
|
82
|
-
throw new Error(`Failed to confirm transaction: ${
|
|
80
|
+
const s = await Promise.all(e.map((a) => this.sendTxWithRetry(n, a, i))), r = s.map((a) => a.signature), m = s.filter((a) => a.response.value.err).map((a) => a.response.value.err);
|
|
81
|
+
if (m.length > 0)
|
|
82
|
+
throw new Error(`Failed to confirm transaction: ${m}`);
|
|
83
83
|
return r;
|
|
84
84
|
}
|
|
85
85
|
static async sendTxWithRetry(t, n, e = {}, i = 5e3) {
|
|
@@ -89,25 +89,25 @@ const c = class c extends O {
|
|
|
89
89
|
// The first send should not skip preflight to catch any errors
|
|
90
90
|
maxRetries: 0,
|
|
91
91
|
preflightCommitment: s
|
|
92
|
-
}), { blockhash:
|
|
92
|
+
}), { blockhash: m, lastValidBlockHeight: a } = await t.getLatestBlockhash(), u = t.confirmTransaction({
|
|
93
93
|
signature: r,
|
|
94
|
-
blockhash:
|
|
94
|
+
blockhash: m,
|
|
95
95
|
lastValidBlockHeight: a
|
|
96
96
|
}, s);
|
|
97
|
-
let
|
|
98
|
-
for (; !
|
|
97
|
+
let h = null;
|
|
98
|
+
for (; !h && (h = await Promise.race([
|
|
99
99
|
u,
|
|
100
100
|
new Promise((f) => setTimeout(() => {
|
|
101
101
|
f(null);
|
|
102
102
|
}, i))
|
|
103
|
-
]), !
|
|
103
|
+
]), !h); )
|
|
104
104
|
await t.sendRawTransaction(n, {
|
|
105
105
|
...e,
|
|
106
106
|
skipPreflight: !0,
|
|
107
107
|
maxRetries: 0,
|
|
108
108
|
preflightCommitment: s
|
|
109
109
|
});
|
|
110
|
-
return { signature: r, response:
|
|
110
|
+
return { signature: r, response: h };
|
|
111
111
|
}
|
|
112
112
|
static async latestBlock(t, n) {
|
|
113
113
|
return t.getLatestBlockhash(n ?? t.commitment);
|
|
@@ -138,7 +138,7 @@ const c = class c extends O {
|
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
140
|
d(c, "_platform", y);
|
|
141
|
-
let
|
|
141
|
+
let v = c;
|
|
142
142
|
class K {
|
|
143
143
|
constructor(t, n, e, i, s = !1) {
|
|
144
144
|
d(this, "transaction");
|
|
@@ -149,15 +149,15 @@ class K {
|
|
|
149
149
|
this.transaction = t, this.network = n, this.chain = e, this.description = i, this.parallelizable = s;
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function X(o) {
|
|
153
153
|
return o.signatures !== void 0 && o.message !== void 0;
|
|
154
154
|
}
|
|
155
155
|
export {
|
|
156
156
|
H as A,
|
|
157
157
|
K as S,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
W as T,
|
|
159
|
+
v as a,
|
|
160
|
+
V as b,
|
|
161
|
+
F as c,
|
|
162
|
+
X as i
|
|
163
163
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var C=Object.defineProperty;var B=(c,t,n)=>t in c?C(c,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):c[t]=n;var m=(c,t,n)=>B(c,typeof t!="symbol"?t+"":t,n);const e=require("./address-
|
|
1
|
+
"use strict";var C=Object.defineProperty;var B=(c,t,n)=>t in c?C(c,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):c[t]=n;var m=(c,t,n)=>B(c,typeof t!="symbol"?t+"":t,n);const e=require("./address-DnSRsubO.js"),b=require("./chain-Cio41-Lr.js");class y extends b.ChainContext{async getTokenAccount(t,n){const{getAssociatedTokenAddress:i}=await Promise.resolve().then(()=>require("./index-BnCQiOiA.js")),s=new e.SolanaAddress(n).unwrap(),r=new e.SolanaAddress(t).unwrap(),o=await i(s,r);return{chain:this.chain,address:new e.SolanaAddress(o.toString())}}}const v=new e.PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),S=new e.PublicKey("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"),E=new e.PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");new e.PublicKey("So11111111111111111111111111111111111111112");new e.PublicKey("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");const l=class l extends b.PlatformContext{constructor(t,n){super(t,n??e.networkPlatformConfigs(t,l._platform))}getRpc(t,n={commitment:"confirmed",disableRetryOnRateLimit:!0}){if(t in this.config)return new e.Connection(this.config[t].rpc,n);throw new Error("No configuration available for chain: "+t)}getChain(t,n){if(t in this.config)return new y(t,this,n);throw new Error("No configuration available for chain: "+t)}static nativeTokenId(t,n){if(!l.isSupportedChain(n))throw new Error(`invalid chain: ${n}`);return e.Wormhole.chainAddress(n,e.SolanaZeroAddress)}static isNativeTokenId(t,n,i){return!this.isSupportedChain(n)||i.chain!==n?!1:this.nativeTokenId(t,n)==i}static isSupportedChain(t){return e.chainToPlatform(t)===l._platform}static async getDecimals(t,n,i){if(e.isNative(i))return e.nativeDecimals(l._platform);let s=await n.getParsedAccountInfo(new e.SolanaAddress(i).unwrap());if(!s||!s.value)throw new Error("could not fetch token details");const{decimals:r}=s.value.data.parsed.info;return r}static async getBalance(t,n,i,s){const r=new e.PublicKey(i);if(e.isNative(s))return BigInt(await n.getBalance(r));const o=await n.getTokenAccountsByOwner(r,{mint:new e.SolanaAddress(s).unwrap()}),d=o.value.length>0?o.value[0].pubkey:r,a=await n.getTokenAccountBalance(d);return BigInt(a.value.amount)}static async getBalances(t,n,i,s){let r;s.includes("native")&&(r=BigInt(await n.getBalance(new e.PublicKey(i))));const o=(await Promise.all([v,S].map(a=>new e.PublicKey(a)).map(a=>n.getParsedTokenAccountsByOwner(new e.PublicKey(i),{programId:a})))).reduce((a,u)=>a.concat(u.value),[]);return s.map(a=>{var w,p,T,P;if(e.isNative(a))return{native:r};const u=new e.SolanaAddress(a).toString(),h=(P=(T=(p=(w=o.find(f=>{var A,k;return((k=(A=f==null?void 0:f.account.data.parsed)==null?void 0:A.info)==null?void 0:k.mint)===a.toString()}))==null?void 0:w.account.data.parsed)==null?void 0:p.info)==null?void 0:T.tokenAmount)==null?void 0:P.amount;return h?{[u]:BigInt(h)}:{[u]:null}}).reduce((a,u)=>Object.assign(a,u),{})}static async sendWait(t,n,i,s){const r=await Promise.all(i.map(a=>this.sendTxWithRetry(n,a,s))),o=r.map(a=>a.signature),d=r.filter(a=>a.response.value.err).map(a=>a.response.value.err);if(d.length>0)throw new Error(`Failed to confirm transaction: ${d}`);return o}static async sendTxWithRetry(t,n,i={},s=5e3){const r=i.preflightCommitment??t.commitment,o=await t.sendRawTransaction(n,{...i,skipPreflight:!1,maxRetries:0,preflightCommitment:r}),{blockhash:d,lastValidBlockHeight:a}=await t.getLatestBlockhash(),u=t.confirmTransaction({signature:o,blockhash:d,lastValidBlockHeight:a},r);let h=null;for(;!h&&(h=await Promise.race([u,new Promise(w=>setTimeout(()=>{w(null)},s))]),!h);)await t.sendRawTransaction(n,{...i,skipPreflight:!0,maxRetries:0,preflightCommitment:r});return{signature:o,response:h}}static async latestBlock(t,n){return t.getLatestBlockhash(n??t.commitment)}static async getLatestBlock(t){return await t.getSlot()}static async getLatestFinalizedBlock(t){const{lastValidBlockHeight:n}=await this.latestBlock(t,"finalized");return n}static chainFromChainId(t){const n=e.platformNativeChainIdToNetworkChain(l._platform,t);if(!n)throw new Error(`No matching genesis hash to determine network and chain: ${t}`);const[i,s]=n;return[i,s]}static async chainFromRpc(t){try{const n=await t.getGenesisHash();return l.chainFromChainId(n)}catch(n){if(t.rpcEndpoint.includes("http://127")||t.rpcEndpoint.includes("http://localhost")||t.rpcEndpoint==="http://solana-devnet:8899")return["Devnet","Solana"];throw n}}};m(l,"_platform",e._platform$1);let g=l;class R{constructor(t,n,i,s,r=!1){m(this,"transaction");m(this,"network");m(this,"chain");m(this,"description");m(this,"parallelizable");this.transaction=t,this.network=n,this.chain=i,this.description=s,this.parallelizable=r}}function N(c){return c.signatures!==void 0&&c.message!==void 0}exports.ASSOCIATED_TOKEN_PROGRAM_ID=E;exports.SolanaChain=y;exports.SolanaPlatform=g;exports.SolanaUnsignedTransaction=R;exports.TOKEN_2022_PROGRAM_ID=S;exports.TOKEN_PROGRAM_ID=v;exports.isVersionedTransaction=N;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { av as b,
|
|
1
|
+
import { av as b, cK as f, d as y, cL as L, au as l, ae as p } from "./address-DqsMcbcT.mjs";
|
|
2
2
|
const a = (e) => {
|
|
3
3
|
const t = e.decode.bind(e), r = e.encode.bind(e);
|
|
4
4
|
return { decode: t, encode: r };
|
|
@@ -8,11 +8,11 @@ const a = (e) => {
|
|
|
8
8
|
const d = s(c, n);
|
|
9
9
|
return f(y.Buffer.from(d));
|
|
10
10
|
}, o.encode = (c, n, d) => {
|
|
11
|
-
const i =
|
|
11
|
+
const i = L(c, e);
|
|
12
12
|
return u(i, n, d);
|
|
13
13
|
}, o;
|
|
14
|
-
},
|
|
15
|
-
const t =
|
|
14
|
+
}, K = m(8), I = (e) => {
|
|
15
|
+
const t = l(e), { encode: r, decode: u } = a(t), s = t;
|
|
16
16
|
return s.decode = (o, c) => !!u(o, c), s.encode = (o, c, n) => {
|
|
17
17
|
const d = Number(o);
|
|
18
18
|
return r(d, c, n);
|
|
@@ -21,14 +21,14 @@ const a = (e) => {
|
|
|
21
21
|
const t = b(32, e), { encode: r, decode: u } = a(t), s = t;
|
|
22
22
|
return s.decode = (o, c) => {
|
|
23
23
|
const n = u(o, c);
|
|
24
|
-
return new
|
|
24
|
+
return new p(n);
|
|
25
25
|
}, s.encode = (o, c, n) => {
|
|
26
26
|
const d = o.toBuffer();
|
|
27
27
|
return r(d, c, n);
|
|
28
28
|
}, s;
|
|
29
29
|
};
|
|
30
30
|
export {
|
|
31
|
-
|
|
31
|
+
I as b,
|
|
32
32
|
g as p,
|
|
33
|
-
|
|
33
|
+
K as u
|
|
34
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const u=require("./address-
|
|
1
|
+
"use strict";const u=require("./address-DnSRsubO.js"),i=e=>{const t=e.decode.bind(e),s=e.encode.bind(e);return{decode:t,encode:s}},f=e=>t=>{const s=u.blob(e,t),{encode:b,decode:r}=i(s),o=s;return o.decode=(c,n)=>{const d=r(c,n);return u.toBigIntLE_1(u.dist.Buffer.from(d))},o.encode=(c,n,d)=>{const l=u.toBufferLE_1(c,e);return b(l,n,d)},o},y=f(8),L=e=>{const t=u.u8(e),{encode:s,decode:b}=i(t),r=t;return r.decode=(o,c)=>!!b(o,c),r.encode=(o,c,n)=>{const d=Number(o);return s(d,c,n)},r},a=e=>{const t=u.blob(32,e),{encode:s,decode:b}=i(t),r=t;return r.decode=(o,c)=>{const n=b(o,c);return new u.PublicKey(n)},r.encode=(o,c,n)=>{const d=o.toBuffer();return s(d,c,n)},r};exports.bool=L;exports.publicKey=a;exports.u64=y;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wormhole-foundation/wormhole-connect",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.9-development",
|
|
4
4
|
"repository": "github:wormhole-foundation/wormhole-connect",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib/index.mjs",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@wormhole-foundation/sdk-icons": "^1.0.0",
|
|
67
67
|
"@wormhole-foundation/sdk-route-ntt": "^0.7.1",
|
|
68
68
|
"@wormhole-foundation/sdk-solana-ntt": "^0.7.1",
|
|
69
|
-
"@wormhole-labs/cctp-executor-route": "0.0
|
|
69
|
+
"@wormhole-labs/cctp-executor-route": "0.3.0",
|
|
70
70
|
"@xlabs-libs/wallet-aggregator-aptos": "1.0.0-alpha.2",
|
|
71
71
|
"@xlabs-libs/wallet-aggregator-core": "0.0.1-alpha.23",
|
|
72
72
|
"@xlabs-libs/wallet-aggregator-evm": "0.0.2-alpha.6",
|