@wormhole-foundation/wormhole-connect 2.5.0-beta.8-development → 2.5.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/assets/aptos-Cutllx5i.js +3 -0
- package/dist/assets/{ccip-DoYNnipC.js → ccip-C6cz5NqJ.js} +1 -1
- package/dist/assets/events-MYC_Tkdh.js +1 -0
- package/dist/assets/{evm-Cg9_Z6ON.js → evm-DzwJdvcV.js} +2 -2
- package/dist/assets/{evm-DSNDNefN.js → evm-LJDXipdh.js} +3 -3
- package/dist/assets/{index-Bhi-Ol-W.js → index-BECoIARf.js} +1 -1
- package/dist/assets/{index-TVGCRxSf.js → index-BO5vFz_J.js} +1 -1
- package/dist/assets/{index-IFf5IHmZ.js → index-BVJL1orJ.js} +1 -1
- package/dist/assets/{index-CuW_tQti.js → index-BwNyYZxM.js} +1 -1
- package/dist/assets/{index-CLAfmegc.js → index-C6UKJUdm.js} +1 -1
- package/dist/assets/index-CJZzjIow.js +1 -0
- package/dist/assets/{index-CItGJ_dO.js → index-CSiH4dly.js} +1 -1
- package/dist/assets/{index-CrZXNnmG.js → index-CqEHg303.js} +1 -1
- package/dist/assets/{index-Ba5OrqB6.js → index-D3R8fZfr.js} +1 -1
- package/dist/assets/{index-DPi-hS0A.js → index-Ds_BlDdN.js} +2 -2
- package/dist/assets/{index-7lgoK4KP.js → index-DwJjUFus.js} +1 -1
- package/dist/assets/{index-mE5izIg0.js → index-Dxpp9NXJ.js} +1 -1
- package/dist/assets/{index-DShwbc4p.js → index-EvC_Tjca.js} +1 -1
- package/dist/assets/{index-TctZ2EQK.js → index-RZp63Yuv.js} +1 -1
- package/dist/assets/{index-CD-O7bSQ.js → index-iiAA6CTH.js} +1 -1
- package/dist/assets/{index-CmR0e8xk.js → index-m7pOREIu.js} +1 -1
- package/dist/assets/{index-D2Ev-0A_.js → index-wwvQRwKh.js} +1 -1
- package/dist/assets/{index.es-e2znZrg8.js → index.es-C9O0OD76.js} +6 -6
- package/dist/assets/solana-B0Eox3vZ.js +2 -0
- package/dist/assets/{solana-DCCw_nmt.js → solana-BGWrrBcM.js} +2 -2
- package/dist/assets/solanaEmbed.esm-C9Mwa0DJ.js +37 -0
- package/dist/assets/{sui-ByNmqUgP.js → sui-COEHPNCD.js} +2 -2
- package/dist/assets/{tokens-BSV7gluG.js → tokens-CzZADlQh.js} +1 -1
- package/dist/main.js +54 -54
- package/dist/src/AppRouter.d.ts.map +1 -1
- package/dist/src/components/v2/Button.d.ts.map +1 -1
- package/dist/src/config/tokens.d.ts +1 -2
- package/dist/src/config/tokens.d.ts.map +1 -1
- package/dist/src/icons/Chains/APT.d.ts.map +1 -1
- package/dist/src/icons/Chains/OSMO.d.ts.map +1 -1
- package/dist/src/icons/Chains/SOL.d.ts.map +1 -1
- package/dist/src/icons/Chains/SUI.d.ts.map +1 -1
- package/dist/src/icons/Chains/UNI.d.ts.map +1 -1
- package/dist/src/icons/Chains/XLAYER.d.ts.map +1 -1
- package/dist/src/icons/Routes/CCTP.d.ts.map +1 -1
- package/dist/src/icons/SvgDefs.d.ts +4 -0
- package/dist/src/icons/SvgDefs.d.ts.map +1 -0
- package/dist/src/icons/Tokens/BNB.d.ts.map +1 -1
- package/dist/src/icons/Tokens/BUSD.d.ts.map +1 -1
- package/dist/src/icons/Tokens/DAI.d.ts.map +1 -1
- package/dist/src/icons/Tokens/INJ.d.ts.map +1 -1
- package/dist/src/icons/Tokens/NTT.d.ts.map +1 -1
- package/dist/src/icons/Tokens/OSMO.d.ts.map +1 -1
- package/dist/src/icons/Tokens/POLY.d.ts.map +1 -1
- package/dist/src/icons/Tokens/SOL.d.ts.map +1 -1
- package/dist/src/icons/Tokens/USDT.d.ts.map +1 -1
- package/dist/src/icons/Tokens/WBTC.d.ts.map +1 -1
- package/dist/src/theme.d.ts +1 -0
- package/dist/src/theme.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AssetPicker/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/WalletConnector/index.d.ts.map +1 -1
- package/lib/{aptos-BG8ndPcW.mjs → aptos-CNOw8kcO.mjs} +58 -42
- package/lib/{aptos-DxDdKfid.js → aptos-CdOJRI0R.js} +1 -1
- package/lib/aptos-D_QSCYMR.js +2 -0
- package/lib/{aptos-CzXBQ5wx.mjs → aptos-tn2jO8K3.mjs} +2 -2
- package/lib/{base64-BFLeU3MK.mjs → base64-CNYMRf7S.mjs} +1 -1
- package/lib/{base64-B0sAJgP2.js → base64-Ds8M0J4c.js} +1 -1
- package/lib/{ccip-Cbpf1wJo.js → ccip-B1tGU3IZ.js} +1 -1
- package/lib/{ccip-Bm7IOUCL.mjs → ccip-CJG_3SRo.mjs} +1 -1
- package/lib/{chunk-IMTC3J2M-DwURKwAV.mjs → chunk-IMTC3J2M-C67AHEC7.mjs} +3 -3
- package/lib/{chunk-IMTC3J2M-BGGrA_WC.js → chunk-IMTC3J2M-DhIJb7y6.js} +1 -1
- package/lib/{evm-l6ukE6CV.mjs → evm-BBI017hN.mjs} +6 -6
- package/lib/{evm-DJcjc-_C.js → evm-Bb5iqY3o.js} +3 -3
- package/lib/{evm-1rdXpiv3.mjs → evm-Bx1LcD14.mjs} +5 -5
- package/lib/{evm-defRIE54.js → evm-CJNdFS0I.js} +2 -2
- package/lib/{index-B2xDzy7A.js → index-1pV294K4.js} +1 -1
- package/lib/{index-lPrZfOXi.mjs → index-4bm5RrMg.mjs} +2 -2
- package/lib/{index-BQqU6Wly.js → index-677G66rd.js} +1 -1
- package/lib/{index-CNIZSAFU.mjs → index-B8jKT8hS.mjs} +1 -1
- package/lib/{index-BloVXId9.js → index-BCRcCl3p.js} +1 -1
- package/lib/{index-BI7xYeBM.mjs → index-BHH4psXr.mjs} +34 -34
- package/lib/{index-B_MUS6zc.mjs → index-BILxmVr6.mjs} +1 -1
- package/lib/{index-BmCFLdEX.js → index-BJc9lWin.js} +1 -1
- package/lib/{index-EDktb6S4.js → index-BLlDozHI.js} +1 -1
- package/lib/{index-DtqirkNJ.js → index-BQirQqhY.js} +1 -1
- package/lib/{index-CFJ0wajU.mjs → index-BSUsUG2w.mjs} +1 -1
- package/lib/{index-5NBqfbfS.mjs → index-BhqL4iKE.mjs} +1 -1
- package/lib/{index-BegFjogX.mjs → index-BjKp2_FS.mjs} +1 -1
- package/lib/{index-BgOfWrzS.mjs → index-BkY7MdDS.mjs} +3 -3
- package/lib/{index-pNMjrl4H.js → index-BoSypod5.js} +1 -1
- package/lib/{index-BwAyuZmy.mjs → index-Bt5YpmVV.mjs} +1 -1
- package/lib/{index-OVEyrgEm.js → index-C2b7cmIz.js} +1 -1
- package/lib/{index-Dxs-J9dD.mjs → index-CEiBhm2k.mjs} +1 -1
- package/lib/{index-BWOiAGve.js → index-CF4eoE6Y.js} +1 -1
- package/lib/index-CPrRSa2B.js +374 -0
- package/lib/{index-8FtdcDhM.mjs → index-CRsKK4Wj.mjs} +3 -3
- package/lib/{index-DYb7vb-V.js → index-CS6zPhdi.js} +1 -1
- package/lib/index-CcRm6XfT.js +1 -0
- package/lib/{index-DcKSwYsA.js → index-CccxsNz1.js} +1 -1
- package/lib/{index-DicZFeR7.mjs → index-CdREsgaL.mjs} +2 -2
- package/lib/{index-D6N53skz.js → index-Cjmq0C8h.js} +1 -1
- package/lib/{index-CIC3ywMJ.js → index-CjuEl-J-.js} +1 -1
- package/lib/{index-IjHFzfzT.mjs → index-CkznFwK1.mjs} +6 -6
- package/lib/{index-CVoCwjDl.js → index-ClfCpirL.js} +1 -1
- package/lib/{index-BxQJKr_h.js → index-CpnIGxuI.js} +1 -1
- package/lib/{index-B2xZ6kt4.mjs → index-Cz7lvPUn.mjs} +29272 -27282
- package/lib/{index-CPcdt_MH.js → index-D0uASZTF.js} +1 -1
- package/lib/{index-mZitl_HA.mjs → index-D1VXS7yd.mjs} +2 -2
- package/lib/{index-Dh8BTmR_.mjs → index-DAYkgaNq.mjs} +2 -2
- package/lib/{index-EyD8yuwm.mjs → index-DDW07uFl.mjs} +2 -2
- package/lib/{index-CelSnuJI.mjs → index-DGr-Gzdg.mjs} +1 -1
- package/lib/{index-BMEVNQXB.js → index-DJrtKnre.js} +1 -1
- package/lib/{index-VhqEeF9I.mjs → index-DNZXTDXa.mjs} +2 -2
- package/lib/{index-Cx9TS0XH.mjs → index-DUOERLRj.mjs} +8 -10
- package/lib/{index-CDRjrfnz.mjs → index-DfWcL4P6.mjs} +1 -1
- package/lib/{index-C3dHeQ6j.js → index-OBs6XFzT.js} +1 -1
- package/lib/{index-BsOOcqS5.js → index-Snn4BI2R.js} +1 -1
- package/lib/{index-DJLQFXCy.js → index-aqgK4OhT.js} +1 -1
- package/lib/{index-CVlcHpc6.mjs → index-kYNBaZzW.mjs} +4 -4
- package/lib/{index-BtsATNxk.js → index-lmBnBbjj.js} +1 -1
- package/lib/{index-Bq9Xcog1.js → index-mBnUIOuA.js} +1 -1
- package/lib/{index-DW-aptRt.mjs → index-tGvYiLKw.mjs} +2 -2
- package/lib/{index-NgGkgCpa.mjs → index-wMpCRV7E.mjs} +1 -1
- package/lib/{index.es-B_1fLcW-.mjs → index.es-D5MZxe7R.mjs} +5 -5
- package/lib/{index.es-DCm0D4jx.js → index.es-Dvk4tueQ.js} +2 -2
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{signer-9vI5B7UW.mjs → signer-CNO6jgxp.mjs} +3 -3
- package/lib/{signer-BQc7Wphd.js → signer-aa3XAM1g.js} +1 -1
- package/lib/solana-CFESTPH_.js +1 -0
- package/lib/{solana-DuIMWd_Y.js → solana-CLTYTqZY.js} +1 -1
- package/lib/solana-DJmdwuns.mjs +17 -0
- package/lib/{solana-CjANz7Fi.mjs → solana-rVF30oAK.mjs} +4 -4
- package/lib/{solanaEmbed.esm-Ck3n8zZh.mjs → solanaEmbed.esm-BhoGryRA.mjs} +2 -2
- package/lib/{solanaEmbed.esm-CIh3hnnF.js → solanaEmbed.esm-D4kizK0g.js} +1 -1
- package/lib/src/AppRouter.d.ts.map +1 -1
- package/lib/src/components/v2/Button.d.ts.map +1 -1
- package/lib/src/config/tokens.d.ts +1 -2
- package/lib/src/config/tokens.d.ts.map +1 -1
- package/lib/src/icons/Chains/APT.d.ts.map +1 -1
- package/lib/src/icons/Chains/OSMO.d.ts.map +1 -1
- package/lib/src/icons/Chains/SOL.d.ts.map +1 -1
- package/lib/src/icons/Chains/SUI.d.ts.map +1 -1
- package/lib/src/icons/Chains/UNI.d.ts.map +1 -1
- package/lib/src/icons/Chains/XLAYER.d.ts.map +1 -1
- package/lib/src/icons/Routes/CCTP.d.ts.map +1 -1
- package/lib/src/icons/SvgDefs.d.ts +4 -0
- package/lib/src/icons/SvgDefs.d.ts.map +1 -0
- package/lib/src/icons/Tokens/BNB.d.ts.map +1 -1
- package/lib/src/icons/Tokens/BUSD.d.ts.map +1 -1
- package/lib/src/icons/Tokens/DAI.d.ts.map +1 -1
- package/lib/src/icons/Tokens/INJ.d.ts.map +1 -1
- package/lib/src/icons/Tokens/NTT.d.ts.map +1 -1
- package/lib/src/icons/Tokens/OSMO.d.ts.map +1 -1
- package/lib/src/icons/Tokens/POLY.d.ts.map +1 -1
- package/lib/src/icons/Tokens/SOL.d.ts.map +1 -1
- package/lib/src/icons/Tokens/USDT.d.ts.map +1 -1
- package/lib/src/icons/Tokens/WBTC.d.ts.map +1 -1
- package/lib/src/theme.d.ts +1 -0
- package/lib/src/theme.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AssetPicker/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/WalletConnector/index.d.ts.map +1 -1
- package/lib/{sui-DXobmCof.mjs → sui-BbBH_HT2.mjs} +1 -1
- package/lib/{sui-C3Hk0XoB.js → sui-CjVsY3mn.js} +1 -1
- package/lib/{sui-BDz0ND8Q.js → sui-DP2zgcH5.js} +1 -1
- package/lib/{sui-BaNlF5eU.mjs → sui-DPCoQlHx.mjs} +5 -5
- package/lib/{tokens-Dr0VPGjM.js → tokens-DbXdl7J8.js} +1 -1
- package/lib/{tokens-BMcb2BBp.mjs → tokens-TdYDSawW.mjs} +2 -2
- package/package.json +19 -18
- package/dist/assets/aptos-h3S6O6Gp.js +0 -3
- package/dist/assets/index-BMLcq4no.js +0 -1
- package/dist/assets/solana-BNhbIgt5.js +0 -2
- package/dist/assets/solanaEmbed.esm-D6aTKNPa.js +0 -37
- package/dist/src/utils/theme.d.ts +0 -11
- package/dist/src/utils/theme.d.ts.map +0 -1
- package/lib/aptos-BI3SOFlh.js +0 -2
- package/lib/index-B-3CdahH.js +0 -374
- package/lib/index-BjH74c5e.js +0 -1
- package/lib/solana-3AW1_2QL.js +0 -1
- package/lib/solana-DyGkYgAN.mjs +0 -17
- package/lib/src/utils/theme.d.ts +0 -11
- package/lib/src/utils/theme.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var oe = Object.defineProperty;
|
|
2
2
|
var se = (k, t, e) => t in k ? oe(k, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : k[t] = e;
|
|
3
|
-
var
|
|
4
|
-
import { cY as N, cZ as F, c_ as ae, c$ as Z, d0 as W, d1 as $, d2 as S, bM as ie, aD as I, c5 as R, d3 as b, c6 as q, bR as ce, bK as j, aF as O, am as v, bO as de, cb as H, c8 as le, d4 as _, d5 as C, d6 as ge, d7 as ue, d8 as M, d9 as fe, bS as V, da as D, db as Q, dc as
|
|
5
|
-
import "./index-
|
|
3
|
+
var h = (k, t, e) => se(k, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { cY as N, cZ as F, c_ as ae, c$ as Z, d0 as W, d1 as $, d2 as S, bM as ie, aD as I, c5 as R, d3 as b, c6 as q, bR as ce, bK as j, aF as O, am as v, bO as de, cb as H, c8 as le, d4 as _, d5 as C, d6 as ge, d7 as ue, d8 as M, d9 as fe, bS as V, da as D, db as Q, dc as pe, dd as x, de as he, df as we, ap as U, dg as ye, dh as X, cP as ke, di as me, cC as Y, dj as be, dk as Ie, dl as G, bW as ee } from "./index-Cz7lvPUn.mjs";
|
|
5
|
+
import "./index-BjKp2_FS.mjs";
|
|
6
6
|
const L = async (k, t, e) => {
|
|
7
7
|
var d, r, n;
|
|
8
8
|
if (!N(e))
|
|
@@ -60,13 +60,13 @@ const L = async (k, t, e) => {
|
|
|
60
60
|
};
|
|
61
61
|
class z {
|
|
62
62
|
constructor(t, e, i, o) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
h(this, "network");
|
|
64
|
+
h(this, "chain");
|
|
65
|
+
h(this, "provider");
|
|
66
|
+
h(this, "contracts");
|
|
67
|
+
h(this, "coreBridgeObjectId");
|
|
68
|
+
h(this, "tokenBridgeObjectId");
|
|
69
|
+
h(this, "chainId");
|
|
70
70
|
this.network = t, this.chain = e, this.provider = i, this.contracts = o, this.chainId = ie.get(t, e);
|
|
71
71
|
const a = this.contracts.tokenBridge;
|
|
72
72
|
if (!a)
|
|
@@ -226,15 +226,15 @@ class z {
|
|
|
226
226
|
yield this.createUnsignedTx(n, "Sui.TokenBridge.PrepareCreateWrapped");
|
|
227
227
|
let l = "", s = "", u = "", f = "", w = "", y = !1;
|
|
228
228
|
for (; !y; ) {
|
|
229
|
-
await new Promise((
|
|
229
|
+
await new Promise((p) => setTimeout(p, 500));
|
|
230
230
|
const B = await this.provider.queryTransactionBlocks({
|
|
231
231
|
filter: { FromAddress: a },
|
|
232
232
|
options: { showObjectChanges: !0 },
|
|
233
233
|
limit: 3
|
|
234
234
|
});
|
|
235
|
-
for (const
|
|
236
|
-
if ("objectChanges" in
|
|
237
|
-
for (const g of
|
|
235
|
+
for (const p of B.data)
|
|
236
|
+
if ("objectChanges" in p) {
|
|
237
|
+
for (const g of p.objectChanges)
|
|
238
238
|
ue(g) && g.packageId !== void 0 ? l = g.packageId : M(g) && g.objectType.includes("WrappedAssetSetup") ? (s = g.objectId, w = g.objectType.split(", ")[1].replace(">", "")) : M(g) && g.objectType.includes("UpgradeCap") ? u = g.objectId : M(g) && g.objectType.includes("CoinMetadata") && (f = g.objectId);
|
|
239
239
|
if (l !== "" && s !== "" && u !== "" && f !== "") {
|
|
240
240
|
y = !0;
|
|
@@ -267,15 +267,15 @@ class z {
|
|
|
267
267
|
}), yield this.createUnsignedTx(c, "Sui.TokenBridge.SubmitAttestation");
|
|
268
268
|
}
|
|
269
269
|
async *transfer(t, e, i, o, a) {
|
|
270
|
-
const d = 0n, r = 0n, l = t.toString(), s = (v(i) ? D : i).toString(), u = await I.getCoins(this.provider, t, s), [f, ...w] = u.filter((
|
|
270
|
+
const d = 0n, r = 0n, l = t.toString(), s = (v(i) ? D : i).toString(), u = await I.getCoins(this.provider, t, s), [f, ...w] = u.filter((p) => Q(p.coinType, s));
|
|
271
271
|
if (f === void 0)
|
|
272
272
|
throw new Error(`Coins array doesn't contain any coins of type ${s}`);
|
|
273
273
|
const [y, m] = await this.getPackageIds(), c = new _(), [A] = (() => {
|
|
274
274
|
if (s === D)
|
|
275
275
|
return c.splitCoins(c.gas, [c.pure.u64(o)]);
|
|
276
276
|
{
|
|
277
|
-
const
|
|
278
|
-
return w.length && c.mergeCoins(
|
|
277
|
+
const p = c.object(f.coinObjectId);
|
|
278
|
+
return w.length && c.mergeCoins(p, w.map((g) => c.object(g.coinObjectId))), c.splitCoins(p, [c.pure.u64(o)]);
|
|
279
279
|
}
|
|
280
280
|
})(), [E] = c.splitCoins(c.gas, [c.pure.u64(d)]), [B] = c.moveCall({
|
|
281
281
|
target: `${m}::state::verified_asset`,
|
|
@@ -285,9 +285,9 @@ class z {
|
|
|
285
285
|
if (a) {
|
|
286
286
|
if (!l)
|
|
287
287
|
throw new Error("senderAddress is required for transfer with payload");
|
|
288
|
-
let
|
|
288
|
+
let p = !1;
|
|
289
289
|
const g = await (async () => {
|
|
290
|
-
const K = await
|
|
290
|
+
const K = await pe(this.provider, y, l);
|
|
291
291
|
if (K !== null)
|
|
292
292
|
return c.object(K);
|
|
293
293
|
{
|
|
@@ -295,7 +295,7 @@ class z {
|
|
|
295
295
|
target: `${y}::emitter::new`,
|
|
296
296
|
arguments: [c.object(this.coreBridgeObjectId)]
|
|
297
297
|
});
|
|
298
|
-
return
|
|
298
|
+
return p = !0, ne;
|
|
299
299
|
}
|
|
300
300
|
})(), [T, te] = c.moveCall({
|
|
301
301
|
target: `${m}::transfer_tokens_with_payload::prepare_transfer`,
|
|
@@ -328,9 +328,9 @@ class z {
|
|
|
328
328
|
re,
|
|
329
329
|
c.object(C)
|
|
330
330
|
]
|
|
331
|
-
}),
|
|
331
|
+
}), p && c.transferObjects([g], c.pure.address(l)), yield this.createUnsignedTx(c, "Sui.TokenBridge.TransferWithPayload");
|
|
332
332
|
} else {
|
|
333
|
-
const [
|
|
333
|
+
const [p, g] = c.moveCall({
|
|
334
334
|
target: `${m}::transfer_tokens::prepare_transfer`,
|
|
335
335
|
arguments: [
|
|
336
336
|
B,
|
|
@@ -349,7 +349,7 @@ class z {
|
|
|
349
349
|
});
|
|
350
350
|
const [T] = c.moveCall({
|
|
351
351
|
target: `${m}::transfer_tokens::transfer_tokens`,
|
|
352
|
-
arguments: [c.object(this.tokenBridgeObjectId),
|
|
352
|
+
arguments: [c.object(this.tokenBridgeObjectId), p],
|
|
353
353
|
typeArguments: [s]
|
|
354
354
|
});
|
|
355
355
|
c.moveCall({
|
|
@@ -405,7 +405,7 @@ class z {
|
|
|
405
405
|
var r;
|
|
406
406
|
if (i > 8)
|
|
407
407
|
throw new Error("Decimals is capped at 8");
|
|
408
|
-
const o = (r = await
|
|
408
|
+
const o = (r = await he(this.provider, this.tokenBridgeObjectId)) == null ? void 0 : r.replace("0x", "");
|
|
409
409
|
if (!o)
|
|
410
410
|
throw new Error(`Original token bridge package ID not found for object ID ${this.tokenBridgeObjectId}`);
|
|
411
411
|
const a = "a11ceb0b060000000901000a020a14031e1704350405392d07669f01088502600ae502050cea02160004010b010c0205020d000002000201020003030c020001000104020700000700010001090801010c020a050600030803040202000302010702080007080100020800080303090002070801010b020209000901010608010105010b0202080008030209000504434f494e095478436f6e7465787408565f5f305f325f3011577261707065644173736574536574757004636f696e0e6372656174655f777261707065640b64756d6d795f6669656c6404696e697414707265706172655f726567697374726174696f6e0f7075626c69635f7472616e736665720673656e646572087472616e736665720a74785f636f6e746578740f76657273696f6e5f636f6e74726f6c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002" + o + "00020106010000000001090b0031" + i.toString(16).padStart(2, "0") + "0a0138000b012e110238010200";
|
|
@@ -420,14 +420,14 @@ class z {
|
|
|
420
420
|
}
|
|
421
421
|
class J {
|
|
422
422
|
constructor(t, e, i, o) {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
423
|
+
h(this, "network");
|
|
424
|
+
h(this, "chain");
|
|
425
|
+
h(this, "connection");
|
|
426
|
+
h(this, "contracts");
|
|
427
|
+
h(this, "tokenBridgeRelayerObjectId");
|
|
428
|
+
h(this, "coreBridgeObjectId");
|
|
429
|
+
h(this, "tokenBridgeObjectId");
|
|
430
|
+
h(this, "fields");
|
|
431
431
|
this.network = t, this.chain = e, this.connection = i, this.contracts = o;
|
|
432
432
|
const { tokenBridge: a, tokenBridgeRelayer: d, coreBridge: r } = o;
|
|
433
433
|
if (!a || !d || !r)
|
|
@@ -445,11 +445,11 @@ class J {
|
|
|
445
445
|
if (v(i))
|
|
446
446
|
return s.splitCoins(s.gas, [s.pure.u64(o)]);
|
|
447
447
|
{
|
|
448
|
-
const E = await I.getCoins(this.connection, t, r), [B, ...
|
|
448
|
+
const E = await I.getCoins(this.connection, t, r), [B, ...p] = E.filter((T) => T.coinType === r);
|
|
449
449
|
if (B === void 0)
|
|
450
450
|
throw new Error(`Coins array doesn't contain any coins of type ${r}`);
|
|
451
451
|
const g = s.object(B.coinObjectId);
|
|
452
|
-
return
|
|
452
|
+
return p.length && s.mergeCoins(g, p.map((T) => s.object(T.coinObjectId))), s.splitCoins(g, [s.pure.u64(o)]);
|
|
453
453
|
}
|
|
454
454
|
})(), [y] = s.moveCall({
|
|
455
455
|
target: `${l}::state::verified_asset`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Pt = Object.defineProperty;
|
|
2
2
|
var _t = (e, t, r) => t in e ? Pt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var f = (e, t, r) => _t(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import { P as c, d as l, bC as A, T as le, bG as z, bF as U, bH as G, bE as S, bD as V, cv as Ge, cw as He, cx as Wt, cy as It, cz as Ut, cA as Nt, cq as O, cd as E, bK as y, cB as T, cC as Ft, cD as ye, c6 as dt, cE as xt, ce as lt, cf as zt, cF as Ot, cG as Q, cH as Lt, ct as H, cu as Z, cI as Dt, cr as qt, cJ as Kt, cK as Vt, cL as Se, cM as Gt, ch as v, cs as Ht, ad as oe, ae as k, c5 as Ce, bR as Zt, am as $, cb as Be, cN as Yt, cO as Qt, K as se, a$ as L, cP as Xt, ci as ft, bW as mt, af as gt } from "./index-
|
|
4
|
+
import { P as c, d as l, bC as A, T as le, bG as z, bF as U, bH as G, bE as S, bD as V, cv as Ge, cw as He, cx as Wt, cy as It, cz as Ut, cA as Nt, cq as O, cd as E, bK as y, cB as T, cC as Ft, cD as ye, c6 as dt, cE as xt, ce as lt, cf as zt, cF as Ot, cG as Q, cH as Lt, ct as H, cu as Z, cI as Dt, cr as qt, cJ as Kt, cK as Vt, cL as Se, cM as Gt, ch as v, cs as Ht, ad as oe, ae as k, c5 as Ce, bR as Zt, am as $, cb as Be, cN as Yt, cO as Qt, K as se, a$ as L, cP as Xt, ci as ft, bW as mt, af as gt } from "./index-Cz7lvPUn.mjs";
|
|
5
5
|
const M = new c("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
|
|
6
6
|
new c("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
|
|
7
7
|
const Ae = new c("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"), D = new c("So11111111111111111111111111111111111111112");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var I=Object.defineProperty;var k=(g,s,t)=>s in g?I(g,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):g[s]=t;var o=(g,s,t)=>k(g,typeof s!="symbol"?s+"":s,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-
|
|
1
|
+
"use strict";var I=Object.defineProperty;var k=(g,s,t)=>s in g?I(g,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):g[s]=t;var o=(g,s,t)=>k(g,typeof s!="symbol"?s+"":s,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CPrRSa2B.js"),w=[["Testnet",{tokenMessengerState:"0x5252abd1137094ed1db3e0d75bc36abcd287aee4bc310f8e047727ef5682e7c2",messageTransmitterState:"0x98234bd0fa9ac12cc0a20a144a22e36d6a32f7e0a97baaeaf9c76cdc6d122d2e",usdcTreasury:"0x7170137d4a6431bf83351ac025baf462909bffe2877d87716374fb42b9629ebe"}],["Mainnet",{tokenMessengerState:"0x45993eecc0382f37419864992c12faee2238f5cfe22b98ad3bf455baf65c8a2f",messageTransmitterState:"0xf68268c3d9b1df3215f2439400c1c4ea08ac4ef4bb7d6f3ca6a2a239e17510af",usdcTreasury:"0x57d6725e7a8b49a7b2a612f6bd66ab5f39fc95332ca48be421c3229d514a6de7"}]],b=a.constMap(w,[0,1]);class l{constructor(s,t,r,e){o(this,"network");o(this,"chain");o(this,"provider");o(this,"contracts");o(this,"usdcId");o(this,"usdcTreasuryId");o(this,"tokenMessengerId");o(this,"tokenMessengerStateId");o(this,"messageTransmitterId");o(this,"messageTransmitterStateId");var u,m,h,f;if(this.network=s,this.chain=t,this.provider=r,this.contracts=e,s==="Devnet")throw new Error("CircleBridge not supported on Devnet");const n=a.usdcContract.get(this.network,this.chain);if(!n)throw new Error(`No USDC contract configured for network=${this.network} chain=${this.chain}`);const{tokenMessengerState:c,messageTransmitterState:i,usdcTreasury:d}=b(s);if(!((u=e.cctp)!=null&&u.tokenMessenger))throw new Error(`Circle Token Messenger contract for domain ${t} not found`);if(!((m=e.cctp)!=null&&m.messageTransmitter))throw new Error(`Circle Message Transmitter contract for domain ${t} not found`);this.usdcId=n,this.usdcTreasuryId=d,this.tokenMessengerId=(h=e.cctp)==null?void 0:h.tokenMessenger,this.messageTransmitterId=(f=e.cctp)==null?void 0:f.messageTransmitter,this.tokenMessengerStateId=c,this.messageTransmitterStateId=i}async*transfer(s,t,r){const e=new a.Transaction$2,n=a.circleChainId.get(this.network,t.chain),[c,...i]=await a.SuiPlatform.getCoins(this.provider,s,this.usdcId);if(c===void 0)throw new Error("No USDC in wallet");const d=e.object(c.coinObjectId);i.length>0&&e.mergeCoins(d,i.map(m=>e.object(m.coinObjectId)));const[u]=e.splitCoins(d,[r]);e.moveCall({target:`${this.tokenMessengerId}::deposit_for_burn::deposit_for_burn`,arguments:[u,e.pure.u32(n),e.pure.address(t.address.toUniversalAddress().toString()),e.object(this.tokenMessengerStateId),e.object(this.messageTransmitterStateId),e.object("0x403"),e.object(this.usdcTreasuryId)],typeArguments:[this.usdcId]}),yield this.createUnsignedTx(e,"Sui.CircleBridge.Transfer")}async isTransferCompleted(s){const t=new a.Transaction$2;t.moveCall({target:`${this.messageTransmitterId}::state::is_nonce_used`,arguments:[t.object(this.messageTransmitterStateId),t.pure.u32(s.sourceDomain),t.pure.u64(s.nonce)]});const r=await this.provider.devInspectTransactionBlock({sender:"0x0000000000000000000000000000000000000000000000000000000000000000",transactionBlock:t});try{return!!r.results[0].returnValues[0][0][0]}catch(e){return console.error(`Error reading if nonce was used: ${e}`),!1}}async*redeem(s,t,r){const e=new a.Transaction$2,[n]=e.moveCall({target:`${this.messageTransmitterId}::receive_message::receive_message`,arguments:[e.pure.vector("u8",a.CircleBridge.serialize(t)),e.pure.vector("u8",a.hex.decode(r)),e.object(this.messageTransmitterStateId)]});if(!n)throw new Error("Failed to produce receipt");const[c]=e.moveCall({target:`${this.tokenMessengerId}::handle_receive_message::handle_receive_message`,arguments:[n,e.object(this.tokenMessengerStateId),e.object("0x403"),e.object(this.usdcTreasuryId)],typeArguments:[this.usdcId]});if(!c)throw new Error("Failed to produce stamp receipt ticket with burn message");const[i]=e.moveCall({target:`${this.tokenMessengerId}::handle_receive_message::deconstruct_stamp_receipt_ticket_with_burn_message`,arguments:[c]});if(!i)throw new Error("Failed to produce stamp receipt ticket");const[d]=e.moveCall({target:`${this.messageTransmitterId}::receive_message::stamp_receipt`,arguments:[i,e.object(this.messageTransmitterStateId)],typeArguments:[`${this.tokenMessengerId}::message_transmitter_authenticator::MessageTransmitterAuthenticator`]});if(!d)throw new Error("Failed to produce stamped receipt");e.moveCall({target:`${this.messageTransmitterId}::receive_message::complete_receive_message`,arguments:[d,e.object(this.messageTransmitterStateId)]}),yield this.createUnsignedTx(e,"Sui.CircleBridge.Redeem")}async parseTransactionDetails(s){var p;const t=await this.provider.waitForTransaction({digest:s,options:{showEvents:!0,showEffects:!0,showInput:!0}});if(!t)throw new Error("Transaction not found");if(!t.events)throw new Error("Transaction events not found");const r=(p=t.events)==null?void 0:p.find(T=>T.type.includes("send_message::MessageSent"));if(!r)throw new Error("No MessageSent event found");const e=new Uint8Array((r==null?void 0:r.parsedJson).message),[n,c]=a.CircleBridge.deserialize(e),{payload:i}=n,d=i.messageSender,u=i.mintRecipient,m=a.toCircleChain(this.network,n.sourceDomain),h=a.toCircleChain(this.network,n.destinationDomain),f={chain:m,address:i.burnToken};return{from:{chain:m,address:d},to:{chain:h,address:u},token:f,amount:i.amount,message:n,id:{hash:c}}}static async fromRpc(s,t){const[r,e]=await a.SuiPlatform.chainFromRpc(s),n=t[e];if(n.network!==r)throw new Error(`Network mismatch: ${n.network} != ${r}`);return new l(r,e,s,n.contracts)}createUnsignedTx(s,t,r=!1){return new a.SuiUnsignedTransaction(s,this.network,this.chain,t,r)}}a.registerProtocol("Sui","CircleBridge",l);exports.SuiCircleBridge=l;exports._suiCircleObjects=w;exports.suiCircleObjects=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var h=Object.defineProperty;var m=(a,e,r)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var o=(a,e,r)=>m(a,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-
|
|
1
|
+
"use strict";var h=Object.defineProperty;var m=(a,e,r)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var o=(a,e,r)=>m(a,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-CPrRSa2B.js");class d{constructor(e,r,t,n){o(this,"network");o(this,"chain");o(this,"provider");o(this,"contracts");o(this,"chainId");o(this,"coreBridgePackageId");this.network=e,this.chain=r,this.provider=t,this.contracts=n,this.chainId=c.toChainId(r);const s=n.coreBridge;if(!s)throw new Error(`CoreBridge contract Address for chain ${r} not found`);this.coreBridgePackageId=s}getGuardianSet(e){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,r){const[t,n]=await c.SuiPlatform.chainFromRpc(e),s=r[n];if(s.network!==t)throw new Error(`Network mismatch: ${s.network} !== ${t}`);return new d(t,n,e,s.contracts)}async*verifyMessage(e,r){throw new Error("Method not implemented.")}async*publishMessage(e,r){throw new Error("Method not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(t=>({emitter:t.emitterAddress,sequence:t.sequence,chain:this.chain}))}async getGuardianSetIndex(){throw new Error("Method not implemented.")}async parseMessages(e){var n;const t=(n=(await this.provider.getTransactionBlock({digest:e,options:{showEvents:!0,showEffects:!0,showInput:!0}})).events)==null?void 0:n.filter(s=>s.type.endsWith("WormholeMessage"));if(!t||t.length==0)throw new Error("WormholeMessage not found");return t.map(s=>{const i=s.parsedJson;return c.createVAA("Uint8Array",{emitterChain:this.chain,emitterAddress:new c.SuiAddress(i.sender).toUniversalAddress(),sequence:BigInt(i.sequence),guardianSet:0,timestamp:Number(i.timestamp),consistencyLevel:i.consistency_level,nonce:i.nonce,signatures:[],payload:new Uint8Array(i.payload)})})}}c.registerProtocol("Sui","WormholeCore",d);exports.SuiWormholeCore=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CPrRSa2B.js");class o extends Error{constructor(r){super(r)}}class s extends o{constructor(){super(...arguments),this.name="TokenOwnerOffCurveError"}}const n=e.struct([e.u32$1("mintAuthorityOption"),e.publicKey("mintAuthority"),e.u64("supply"),e.u8("decimals"),e.bool("isInitialized"),e.u32$1("freezeAuthorityOption"),e.publicKey("freezeAuthority")]);n.span;async function c(t,r,u=!1,i=e.TOKEN_PROGRAM_ID,O=e.ASSOCIATED_TOKEN_PROGRAM_ID){if(!u&&!e.PublicKey.isOnCurve(r.toBuffer()))throw new s;const[A]=await e.PublicKey.findProgramAddress([r.toBuffer(),i.toBuffer(),t.toBuffer()],O);return A}exports.ASSOCIATED_TOKEN_PROGRAM_ID=e.ASSOCIATED_TOKEN_PROGRAM_ID;exports.TOKEN_2022_PROGRAM_ID=e.TOKEN_2022_PROGRAM_ID;exports.TOKEN_PROGRAM_ID=e.TOKEN_PROGRAM_ID;exports.MintLayout=n;exports.TokenError=o;exports.TokenOwnerOffCurveError=s;exports.getAssociatedTokenAddress=c;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var k = Object.defineProperty;
|
|
2
2
|
var v = (u, s, t) => s in u ? k(u, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[s] = t;
|
|
3
3
|
var i = (u, s, t) => v(u, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
-
import { cX as C, c1 as S, d4 as f, b$ as _, aD as w, c0 as b,
|
|
4
|
+
import { cX as C, c1 as S, d4 as f, b$ as _, aD as w, c0 as b, ap as y, c2 as T, dh as M, bW as x } from "./index-Cz7lvPUn.mjs";
|
|
5
5
|
const j = [
|
|
6
6
|
[
|
|
7
7
|
"Testnet",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var d = Object.defineProperty;
|
|
2
2
|
var h = (i, e, r) => e in i ? d(i, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : i[e] = r;
|
|
3
3
|
var o = (i, e, r) => h(i, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { bK as m, aD as w, cQ as g, aF as p, bW as u } from "./index-
|
|
4
|
+
import { bK as m, aD as w, cQ as g, aF as p, bW as u } from "./index-Cz7lvPUn.mjs";
|
|
5
5
|
class c {
|
|
6
6
|
constructor(e, r, t, n) {
|
|
7
7
|
o(this, "network");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { bv as Do, dm as uy, d as De, dn as Zy, aI as Pv, dp as eg, dq as tg, bd as ng } from "./index-
|
|
2
|
-
import { e as iy, d as ag } from "./base64-
|
|
1
|
+
import { bv as Do, dm as uy, d as De, dn as Zy, aI as Pv, dp as eg, dq as tg, bd as ng } from "./index-Cz7lvPUn.mjs";
|
|
2
|
+
import { e as iy, d as ag } from "./base64-CNYMRf7S.mjs";
|
|
3
3
|
import * as Wf from "react";
|
|
4
4
|
import d1, { createContext as lg, useState as is, useEffect as Ky, useCallback as ug, useContext as ig } from "react";
|
|
5
|
-
import { L as ot, B as mn, d as i2, a as o0, h as U2, b as og, c as w9, g as od, e as Jy, k as cd, f as wr, i as cg, j as Tr, D as vs } from "./index-
|
|
5
|
+
import { L as ot, B as mn, d as i2, a as o0, h as U2, b as og, c as w9, g as od, e as Jy, k as cd, f as wr, i as cg, j as Tr, D as vs } from "./index-B8jKT8hS.mjs";
|
|
6
6
|
function rd(c, i) {
|
|
7
7
|
(i == null || i > c.length) && (i = c.length);
|
|
8
8
|
for (var d = 0, f = new Array(i); d < i; d++) f[d] = c[d];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var h=Object.defineProperty;var m=(a,e,t)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var s=(a,e,t)=>m(a,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-
|
|
1
|
+
"use strict";var h=Object.defineProperty;var m=(a,e,t)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var s=(a,e,t)=>m(a,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CPrRSa2B.js"),w=require("./aptos-D_QSCYMR.js");class c{constructor(e,t,r,o){s(this,"network");s(this,"chain");s(this,"connection");s(this,"contracts");s(this,"chainId");s(this,"coreBridge");this.network=e,this.chain=t,this.connection=r,this.contracts=o,this.chainId=i.toChainId(t);const n=o.coreBridge;if(!n)throw new Error(`CoreBridge contract Address for chain ${t} not found`);this.coreBridge=n}getGuardianSet(e){throw new Error("Method not implemented.")}getGuardianSetIndex(){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,t){const[r,o]=await w.AptosPlatform.chainFromRpc(e),n=t[o];if(n.network!==r)throw new Error(`Network mismatch: ${n.network} !== ${r}`);return new c(r,o,e,n.contracts)}async*publishMessage(e,t){throw new Error("Method not implemented.")}async*verifyMessage(e,t){throw new Error("Not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(r=>({chain:r.emitterChain,emitter:r.emitterAddress,sequence:r.sequence}))}async parseMessages(e){const t=await this.connection.getTransactionByHash({transactionHash:e});if(t.type!=="user_transaction")throw new Error(`${e} is not a user_transaction`);const r=t.events.filter(o=>o.type.endsWith("WormholeMessage"));if(!r||r.length===0)throw new Error(`WormholeMessage not found for ${e}`);return r.map(o=>{const n=o.data,d=new i.UniversalAddress(BigInt(n.sender).toString(16).padStart(64,"0"));return i.createVAA("Uint8Array",{guardianSet:0,emitterChain:this.chain,emitterAddress:d,sequence:BigInt(n.sequence),timestamp:Number(n.timestamp),consistencyLevel:n.consistency_level,nonce:Number(n.nonce),signatures:[],payload:i.hex.decode(n.payload)})})}}i.registerProtocol("Aptos","WormholeCore",c);exports.AptosWormholeCore=c;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Z = Object.defineProperty;
|
|
2
2
|
var j = (t, e, s) => e in t ? Z(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
3
|
var y = (t, e, s) => j(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
-
import { P as u, bC as Y, bD as I, bE as x, bF as ee, bG as ne, bH as se, d as M, cd as O, T as ae, ce as E, cf as N, cg as B, ch as _, c0 as U,
|
|
4
|
+
import { P as u, bC as Y, bD as I, bE as x, bF as ee, bG as ne, bH as se, d as M, cd as O, T as ae, ce as E, cf as N, cg as B, ch as _, c0 as U, ap as te, ae as b, ad as ie, c1 as D, a$ as v, b$ as re, K as me, c2 as C, ci as oe, bW as ue, af as le } from "./index-Cz7lvPUn.mjs";
|
|
5
5
|
const h = new u("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
|
|
6
6
|
new u("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
|
|
7
7
|
const A = new u("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var h=Object.defineProperty;var w=(o,t,e)=>t in o?h(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var s=(o,t,e)=>w(o,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-
|
|
1
|
+
"use strict";var h=Object.defineProperty;var w=(o,t,e)=>t in o?h(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var s=(o,t,e)=>w(o,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CPrRSa2B.js");class c{constructor(t,e,a,r){s(this,"network");s(this,"chain");s(this,"provider");s(this,"contracts");s(this,"chainId");s(this,"core");s(this,"gatewayAddress");s(this,"gateway");s(this,"tbtcTokenAddr");if(this.network=t,this.chain=e,this.provider=a,this.contracts=r,this.network!=="Mainnet")throw new Error("TBTC is only supported on Mainnet");if(!this.contracts.tbtc)throw new Error("TBTC contract address is required");const i=n.TBTCBridge.getNativeTbtcToken(this.chain);if(!i)throw new Error("Native tbtc token not found");this.chainId=n.networkChainToNativeChainId.get(t,e),this.core=new n.EvmWormholeCore(t,e,a,r),this.gatewayAddress=this.contracts.tbtc,this.gateway=new n.Contract(this.gatewayAddress,["function sendTbtc(uint256 amount, uint16 recipientChain, bytes32 recipient, uint256 arbiterFee, uint32 nonce) payable returns (uint64)","function receiveTbtc(bytes calldata encodedVm)"],a),this.tbtcTokenAddr=n.canonicalAddress(i)}static async fromRpc(t,e){const[a,r]=await n.EvmPlatform.chainFromRpc(t),i=e[r];if(i.network!==a)throw new Error(`Network mismatch: ${i.network} != ${a}`);return new c(a,r,t,i.contracts)}async*transfer(t,e,a){const r=new n.EvmAddress(t).toString(),i=await this.gateway.sendTbtc.populateTransaction(a,n.toChainId(e.chain),e.address.toUniversalAddress().toUint8Array(),0n,0n);i.value=await this.core.getMessageFee(),yield*this.approve(r,a,this.gatewayAddress),yield this.createUnsignedTransaction(n.addFrom(i,r),"TBTCBridge.Send")}async*redeem(t,e){if(e.payloadName!=="GatewayTransfer")throw new Error("Invalid VAA payload");const a=new n.EvmAddress(t).toString(),r=await this.gateway.receiveTbtc.populateTransaction(n.serialize(e));yield this.createUnsignedTransaction(n.addFrom(r,a),"TBTCBridge.Redeem")}async*approve(t,e,a){const r=n.EvmPlatform.getTokenImplementation(this.provider,this.tbtcTokenAddr);if(await r.allowance(t,a)<e){const d=await r.approve.populateTransaction(a,e);yield this.createUnsignedTransaction(n.addFrom(d,t),"TBTC.Approve")}}createUnsignedTransaction(t,e){return new n.EvmUnsignedTransaction(n.addChainId(t,this.chainId),this.network,this.chain,e,!1)}}n.registerProtocol(n._platform,"TBTCBridge",c);exports.EvmTBTCBridge=c;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as _e, dr as yf, b as or, dw as zi, d as ne, dx as ou, dy as vt, dz as ha, aI as Qr, dC as fu } from "./index-
|
|
1
|
+
import { c as _e, dr as yf, b as or, dw as zi, d as ne, dx as ou, dy as vt, dz as ha, aI as Qr, dC as fu } from "./index-Cz7lvPUn.mjs";
|
|
2
2
|
var Zi = {}, vf = { exports: {} }, Hi = {};
|
|
3
3
|
(function(e) {
|
|
4
4
|
e.fetch = i(_e.fetch) && i(_e.ReadableStream), e.writableStream = i(_e.WritableStream), e.abortController = i(_e.AbortController);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var S=Object.defineProperty;var P=(l,o,t)=>o in l?S(l,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[o]=t;var h=(l,o,t)=>P(l,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";var S=Object.defineProperty;var P=(l,o,t)=>o in l?S(l,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[o]=t;var h=(l,o,t)=>P(l,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CPrRSa2B.js"),U=require("./index-CcRm6XfT.js"),A=new e.Interface(["function start((bytes32,address,address,address,address,address,uint256,uint256,uint256,uint256)) returns (address,uint16,uint64)","function receiveMessageAndSwap(bytes)"]),q=new e.Interface(["function quoteExactInputSingle((address,address,uint256,uint24,uint160)) public view returns (uint256,uint160,uint32,uint256)"]),N="https://gfx.relayers.xlabs.xyz/api/v1/swap/quote";class R{static async quoteRelayer(o,t,r){var a;if(e.isNative(t)||e.isNative(r))throw new Error("how did you get here tho?");const n=e.hex.encode(t.toUniversalAddress().toUint8Array(),!1),s=e.hex.encode(r.toUniversalAddress().toUint8Array(),!1),i={targetChain:e.toChainId(o),sourceToken:n,targetToken:s};try{const c=await e.axios.post(N,i);return BigInt(c.data.fee)}catch(c){throw e.axios.isAxiosError(c)?new Error(`Error getting relayer fee: ${(a=c.response)==null?void 0:a.statusText}`):c}}}const m=100,E={ETH:[e.Wormhole.tokenId("Arbitrum","native"),e.Wormhole.tokenId("Base","native"),e.Wormhole.tokenId("Ethereum","native"),e.Wormhole.tokenId("Optimism","native")],WETH:[e.Wormhole.tokenId("Arbitrum","0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),e.Wormhole.tokenId("Avalanche","0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB"),e.Wormhole.tokenId("Base","0x4200000000000000000000000000000000000006"),e.Wormhole.tokenId("Bsc","0x2170Ed0880ac9A755fd29B2688956BD959F933F8"),e.Wormhole.tokenId("Ethereum","0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),e.Wormhole.tokenId("Optimism","0x4200000000000000000000000000000000000006"),e.Wormhole.tokenId("Polygon","0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619")],wstETH:[e.Wormhole.tokenId("Arbitrum","0x5979D7b546E38E414F7E9822514be443A4800529"),e.Wormhole.tokenId("Base","0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452"),e.Wormhole.tokenId("Ethereum","0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"),e.Wormhole.tokenId("Optimism","0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb"),e.Wormhole.tokenId("Polygon","0x03b54A6e9a984069379fae1a4fC4dBAE93B3bCCD")],USDT:[e.Wormhole.tokenId("Arbitrum","0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),e.Wormhole.tokenId("Avalanche","0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7"),e.Wormhole.tokenId("Base","0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2"),e.Wormhole.tokenId("Bsc","0x55d398326f99059fF775485246999027B3197955"),e.Wormhole.tokenId("Ethereum","0xdAC17F958D2ee523a2206206994597C13D831ec7"),e.Wormhole.tokenId("Optimism","0x94b008aA00579c1307B0EF2c499aD98a8ce58e58"),e.Wormhole.tokenId("Polygon","0xc2132D05D31c914a87C6611C10748AEb04B58e8F"),e.Wormhole.tokenId("Celo","0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e")]};class p{constructor(o,t,r,n){h(this,"network");h(this,"chain");h(this,"provider");h(this,"contracts");h(this,"chainId");h(this,"core");h(this,"tokenBridge");if(this.network=o,this.chain=t,this.provider=r,this.contracts=n,!n.portico)throw new Error("Unsupported chain, no contract addresses for: "+t);this.core=new e.EvmWormholeCore(o,t,r,n),this.tokenBridge=new U.EvmTokenBridge(o,t,r,n),this.chainId=e.networkChainToNativeChainId.get(o,t)}static async fromRpc(o,t){const[r,n]=await e.EvmPlatform.chainFromRpc(o),s=t[n];if(s.network!==r)throw new Error(`Network mismatch: ${s.network} != ${r}`);return new p(r,n,o,s.contracts)}async*transfer(o,t,r,n,s,d,i){const{minAmountStart:a,minAmountFinish:c}=i.swapAmounts;if(a===0n)throw new Error("Invalid min swap amount");if(c===0n)throw new Error("Invalid min swap amount");const f=new e.EvmAddress(o).toString(),[u,g]=e.resolveWrappedToken(this.network,this.chain,r),[T,C]=e.resolveWrappedToken(this.network,t.chain,s),k=e.canonicalAddress(g),I=e.canonicalAddress(await this.getTransferrableToken(k)),b=e.canonicalAddress(t),v=e.canonicalAddress(C),F=new Date().valueOf()%2**4,B=e.PorticoBridge.serializeFlagSet({flags:{shouldWrapNative:u,shouldUnwrapNative:T},recipientChain:e.toChainId(t.chain),bridgeNonce:F,feeTierStart:m,feeTierFinish:m,padding:new Uint8Array(19)}),y=A.encodeFunctionData("start",[[B,k.toLowerCase(),I,v.toLowerCase(),b,d,n.toString(),a.toString(),c.toString(),i.relayerFee.toString()]]),x=this.getTokenGroup(g.address.toString()),w=this.getPorticoAddress(x);u||(yield*this.approve(k,f,n,w));const W=await this.core.getMessageFee(),D={to:w,data:y,value:W+(u?n:0n)};yield this.createUnsignedTransaction(e.addFrom(D,f),"PorticoBridge.Transfer")}async*redeem(o,t){const r=e.toChain(t.payload.payload.flagSet.recipientChain),n=t.payload.payload.finalTokenAddress.toNative(r).toString(),s=this.getTokenGroup(n),d=this.getPorticoAddress(s),a=await new e.Contract(d,A.fragments,this.provider).getFunction("receiveMessageAndSwap").populateTransaction(e.serialize(t)),c=new e.EvmAddress(o).toString();yield this.createUnsignedTransaction(e.addFrom(a,c),"PorticoBridge.Redeem")}async isTransferCompleted(o){return await this.tokenBridge.tokenBridge.isTransferCompleted(e.keccak256(o.hash))}async quoteSwap(o,t,r,n){const[,s]=e.resolveWrappedToken(this.network,this.chain,o),[,d]=e.resolveWrappedToken(this.network,this.chain,t),i=e.canonicalAddress(s),a=e.canonicalAddress(d);if(e.isEqualCaseInsensitive(i,a))return n;const c=this.getQuoterAddress(r);return(await new e.Contract(c,q.fragments,this.provider).getFunction("quoteExactInputSingle").staticCall([i,a,n,m,0]))[0]}async quoteRelay(o,t){return await R.quoteRelayer(this.chain,o,t)}async getTransferrableToken(o){const t=e.Wormhole.tokenId(this.chain,o),[,r]=e.resolveWrappedToken(this.network,this.chain,t);if(this.chain==="Ethereum")return r;const n=Object.values(E).find(i=>i.find(a=>a.chain===this.chain&&e.canonicalAddress(a)===e.canonicalAddress(r)));if(!n)throw new Error(`No token group found for ${o} on ${this.chain}`);const s=n.find(i=>i.chain==="Ethereum");if(!s)throw new Error(`No Ethereum origin token found for ${o} on ${this.chain}`);const d=await this.tokenBridge.getWrappedAsset(s);return e.Wormhole.tokenId(this.chain,d.toString())}supportedTokens(){const o=[];for(const[t,r]of Object.entries(E))for(const n of r)n.chain===this.chain&&o.push({group:t,token:n});return o}getTokenGroup(o){const r=this.supportedTokens().find(n=>e.canonicalAddress(n.token)===o);if(!r)throw new Error("Token not found");return r.group}async*approve(o,t,r,n){const s=e.EvmPlatform.getTokenImplementation(this.provider,o);if(await s.allowance(t,n)<r){const i=await s.approve.populateTransaction(n,r);yield this.createUnsignedTransaction(e.addFrom(i,t),"PorticoBridge.Approve")}}createUnsignedTransaction(o,t){return new e.EvmUnsignedTransaction(e.addChainId(o,this.chainId),this.network,this.chain,t,!1)}getPorticoAddress(o){const t=this.contracts.portico;return o==="USDT"&&t.porticoPancakeSwap||t.porticoUniswap}getQuoterAddress(o){const t=this.contracts.portico;return o==="USDT"&&t.pancakeSwapQuoterV2||t.uniswapQuoterV2}}e.registerProtocol(e._platform,"PorticoBridge",p);exports.EvmPorticoBridge=p;
|