@wormhole-foundation/wormhole-connect 1.1.8-beta.2-development → 1.1.8
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/{ccip-B5VfDKOr.js → ccip-atE20ZEL.js} +1 -1
- package/dist/assets/{evm-CkbZddI4.js → evm-DiRlPnyB.js} +4 -4
- package/dist/assets/{index-BVl4T3LK.js → index-C6qclzFA.js} +1 -1
- package/dist/assets/index-CKe5Sopa.js +2 -0
- package/dist/assets/{index-CPZCe6ys.js → index-DOuohql9.js} +1 -1
- package/dist/assets/{index.es-D_CMbICm.js → index.es-BxGbRBbk.js} +2 -2
- package/dist/main.js +3 -3
- package/lib/{algorand-tXcNTbqw.js → algorand-BvtlkYvW.js} +1 -1
- package/lib/{algorand-DgpF_mXd.mjs → algorand-DUcbNcTT.mjs} +5 -5
- package/lib/{aptos-CTr4u3up.mjs → aptos-B4rlOyU6.mjs} +3 -3
- package/lib/{aptos-Cbmld6H3.js → aptos-BhgRAjHC.js} +2 -2
- package/lib/{aptos-CR0OcDBV.js → aptos-DhzeFi4o.js} +1 -1
- package/lib/{aptos-M_shWERr.mjs → aptos-nQowjIcb.mjs} +1 -1
- package/lib/{ccip-DaRd1xyq.js → ccip-BGUsNrsA.js} +1 -1
- package/lib/{ccip-C0KpO3UY.mjs → ccip-jzRXPLFO.mjs} +1 -1
- package/lib/{cosmwasm-u__X419O.js → cosmwasm-CGeqw6cI.js} +4 -4
- package/lib/{cosmwasm-BrumI-4g.mjs → cosmwasm-DrywDSkp.mjs} +10 -10
- package/lib/{events-B3M_mwnv.js → events-COjha8bx.js} +1 -1
- package/lib/{events-CpI6THlG.mjs → events-DuoZYNKO.mjs} +1 -1
- package/lib/{evm-Blf-_XHQ.js → evm-BBDClE2g.js} +4 -4
- package/lib/{evm-DTv3ll5g.mjs → evm-BuIItcEA.mjs} +12 -12
- package/lib/{evm-CcAiiNiN.mjs → evm-CEj34i-Y.mjs} +7 -7
- package/lib/{evm-B8QV0WMy.js → evm-CYnUn08H.js} +1 -1
- package/lib/{index-BWadlVxP.js → index-8IabBseN.js} +1 -1
- package/lib/{index-C24awnH1.mjs → index-A72nDBhY.mjs} +11 -11
- package/lib/{index-BLT1iLJO.js → index-B-LwhonE.js} +1 -1
- package/lib/{index-D_WLQWCk.js → index-B2JFHCjY.js} +1 -1
- package/lib/{index-CrvMtWJk.js → index-B6AFQ_fB.js} +1 -1
- package/lib/{index-lNjLQ3Ln.mjs → index-BISC0EuN.mjs} +9 -9
- package/lib/{index-NVVfqKqy.js → index-BIVNmWjC.js} +1 -1
- package/lib/{index-nvF_Vnsk.mjs → index-BJuAlURA.mjs} +3 -3
- package/lib/{index-Hj_44yP6.js → index-BJvQdk3o.js} +92 -92
- package/lib/{index-sqvrX5as.js → index-BTncL8og.js} +1 -1
- package/lib/{index-Br2oG_eT.mjs → index-BXkKxPSN.mjs} +2 -2
- package/lib/{index-BeR2pFP_.mjs → index-Bbhbkgfa.mjs} +2 -2
- package/lib/{index-DGUuTzq5.mjs → index-BeJsTgpu.mjs} +10 -10
- package/lib/{index-CH4v9fdl.mjs → index-Bh9u5bZu.mjs} +15 -15
- package/lib/{index-MAW-S7qJ.js → index-Bi4OJr6O.js} +1 -1
- package/lib/index-BsHKXTKU.js +1 -0
- package/lib/{index-CwrUNk7R.js → index-BuGRcK_Q.js} +1 -1
- package/lib/{index-CuqXZa2Q.mjs → index-CJEjOaWr.mjs} +1 -1
- package/lib/{index-BVEhvlmw.mjs → index-CRv6XxH6.mjs} +16 -16
- package/lib/{index-Dsp18Ki0.js → index-CTHiXye2.js} +1 -1
- package/lib/{index-iMGGdz1P.js → index-CWM3H2LC.js} +1 -1
- package/lib/{index-B9I8wNfR.js → index-CXIAreWV.js} +1 -1
- package/lib/{index-BVvayeum.mjs → index-CdExxm-8.mjs} +2 -2
- package/lib/{index-5iQ5GTSu.mjs → index-Cdpg2Kj3.mjs} +2 -2
- package/lib/{index-EFO4LCUD.mjs → index-CjexIr7B.mjs} +12 -12
- package/lib/{index-BPyIEVyq.js → index-Cyjyg63s.js} +1 -1
- package/lib/{index-DIeGmRzd.js → index-D5tJ7kz1.js} +1 -1
- package/lib/{index-DhvaqGhk.mjs → index-D7uCV0-2.mjs} +55 -55
- package/lib/{index-DSQmXjdq.mjs → index-D9fbH3oE.mjs} +35 -35
- package/lib/{index-B0-xPGuQ.mjs → index-D9h0sJ3x.mjs} +76 -76
- package/lib/{index-CaA38viB.js → index-DEi8dfu-.js} +1 -1
- package/lib/{index-BRV3iD_7.mjs → index-DKptU_Hc.mjs} +4 -4
- package/lib/{index-aB_fp0rM.mjs → index-Dc5wV51P.mjs} +20462 -20465
- package/lib/{index-CPe7WKSz.mjs → index-DcurocLc.mjs} +2 -2
- package/lib/{index-DZohPEoL.mjs → index-DdeuHj0J.mjs} +7 -7
- package/lib/{index-DcH-LW3u.js → index-DgbQ-dwi.js} +1 -1
- package/lib/{index-CU3bs1UO.js → index-DlnKgVH2.js} +1 -1
- package/lib/{index-CX4xrmvB.js → index-Ds_oSleh.js} +1 -1
- package/lib/{index-Dj9uX8Yq.mjs → index-HLOU4jOA.mjs} +2 -2
- package/lib/{index-QVDg02xQ.js → index-NNKFqYq6.js} +1 -1
- package/lib/{index-DXxIHcif.js → index-a5wU3oUB.js} +1 -1
- package/lib/{index-5Nsx5Sww.mjs → index-qoWS15WJ.mjs} +4 -4
- package/lib/{index-DaqgMXh5.mjs → index-uAstvLd8.mjs} +2 -2
- package/lib/{index-w19NhRI8.js → index-vjvft509.js} +1 -1
- package/lib/{index.es-8dGbttwj.js → index.es-ex5QzFoQ.js} +2 -2
- package/lib/{index.es-4k95rbkL.mjs → index.es-tj48a6VI.mjs} +5 -5
- package/lib/index.js +1 -1
- package/lib/index.mjs +2 -2
- package/lib/{keccak-BVl93H2h.mjs → keccak-CVFfUSfU.mjs} +1 -1
- package/lib/{keccak-DxPHQOs9.js → keccak-CzODwJ6V.js} +1 -1
- package/lib/{pbkdf2-C4tGHSl-.js → pbkdf2-DLmVRSHA.js} +1 -1
- package/lib/{pbkdf2-CrsCYTQU.mjs → pbkdf2-GUTNazYD.mjs} +1 -1
- package/lib/{signer-Du2DF25K.mjs → signer-Cqs1I7RB.mjs} +1 -1
- package/lib/{signer-BcAkKtkv.js → signer-rbcgQjZj.js} +1 -1
- package/lib/{solana-DS0mdgC1.mjs → solana-7ZFkKRtX.mjs} +4 -4
- package/lib/solana-BYPpXpJs.js +1 -0
- package/lib/solana-CcjhlsWI.mjs +16 -0
- package/lib/{solana-B2noqxW_.js → solana-DoqT3pca.js} +1 -1
- package/lib/{solanaEmbed.esm-Cr2BGkxp.js → solanaEmbed.esm-Bkti_f5v.js} +1 -1
- package/lib/{solanaEmbed.esm-B9HRNUtr.mjs → solanaEmbed.esm-LdO_IpPZ.mjs} +3 -3
- package/lib/{sui-CnGk4aWJ.mjs → sui-BffnXOND.mjs} +10 -10
- package/lib/{sui-CsizbSts.mjs → sui-Ch7mNd_P.mjs} +4 -4
- package/lib/{sui-Q9BM2cCK.js → sui-Df7REI6I.js} +2 -2
- package/lib/{sui-C7SxJ54B.js → sui-DfRirJoo.js} +1 -1
- package/lib/{unsignedTransaction-Cd7qXgBL.mjs → unsignedTransaction-CsCwFMvo.mjs} +4 -4
- package/lib/{unsignedTransaction-DDxT_548.js → unsignedTransaction-CvjJdjtG.js} +1 -1
- package/package.json +1 -1
- package/dist/assets/index-C_hywdem.js +0 -2
- package/lib/index-YmHc4VtK.js +0 -1
- package/lib/solana-CFMBUeJY.js +0 -1
- package/lib/solana-lSSqSdUq.mjs +0 -16
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var _t = Object.defineProperty;
|
|
2
2
|
var Pt = (e, t, r) => t in e ? _t(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var f = (e, t, r) => Pt(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import {
|
|
4
|
+
import { b1 as c, bn as A, br as z, bq as U, h as l, c4 as le, bs as Z, bp as S, bo as V, c5 as Ze, c6 as Ge, c7 as Wt, c8 as It, c9 as Ut, ca as Nt, cb as O, cc as E, ag as y, cd as T, ce as Ft, cf as ye, b_ as dt, cg as xt, ch as lt, ci as zt, cj as Ot, ck as Q, cl as Lt, cm as G, cn as H, co as qt, cp as Dt, cq as Kt, cr as Vt, cs as Se, ct as Zt, cu as v, cv as Gt, e as oe, S as k, bZ as Ce, bC as Ht, p as j, c3 as Be, cw as Yt, cx as Qt, bd as se, b5 as L, ad as Xt, cy as ft, bI as mt, g as gt } from "./index-Dc5wV51P.mjs";
|
|
5
5
|
const M = new c("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
|
|
6
6
|
new c("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
|
|
7
|
-
const Ae = new c("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),
|
|
7
|
+
const Ae = new c("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"), q = new c("So11111111111111111111111111111111111111112");
|
|
8
8
|
new c("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");
|
|
9
9
|
class ee extends Error {
|
|
10
10
|
constructor(t) {
|
|
@@ -31,7 +31,7 @@ class ce extends ee {
|
|
|
31
31
|
super(...arguments), this.name = "TokenInvalidAccountSizeError";
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
class
|
|
34
|
+
class jt extends ee {
|
|
35
35
|
constructor() {
|
|
36
36
|
super(...arguments), this.name = "TokenInvalidMintError";
|
|
37
37
|
}
|
|
@@ -41,10 +41,10 @@ class pt extends ee {
|
|
|
41
41
|
super(...arguments), this.name = "TokenOwnerOffCurveError";
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
var
|
|
44
|
+
var $;
|
|
45
45
|
(function(e) {
|
|
46
46
|
e[e.InitializeMint = 0] = "InitializeMint", e[e.InitializeAccount = 1] = "InitializeAccount", e[e.InitializeMultisig = 2] = "InitializeMultisig", e[e.Transfer = 3] = "Transfer", e[e.Approve = 4] = "Approve", e[e.Revoke = 5] = "Revoke", e[e.SetAuthority = 6] = "SetAuthority", e[e.MintTo = 7] = "MintTo", e[e.Burn = 8] = "Burn", e[e.CloseAccount = 9] = "CloseAccount", e[e.FreezeAccount = 10] = "FreezeAccount", e[e.ThawAccount = 11] = "ThawAccount", e[e.TransferChecked = 12] = "TransferChecked", e[e.ApproveChecked = 13] = "ApproveChecked", e[e.MintToChecked = 14] = "MintToChecked", e[e.BurnChecked = 15] = "BurnChecked", e[e.InitializeAccount2 = 16] = "InitializeAccount2", e[e.SyncNative = 17] = "SyncNative", e[e.InitializeAccount3 = 18] = "InitializeAccount3", e[e.InitializeMultisig2 = 19] = "InitializeMultisig2", e[e.InitializeMint2 = 20] = "InitializeMint2", e[e.GetAccountDataSize = 21] = "GetAccountDataSize", e[e.InitializeImmutableOwner = 22] = "InitializeImmutableOwner", e[e.AmountToUiAmount = 23] = "AmountToUiAmount", e[e.UiAmountToAmount = 24] = "UiAmountToAmount", e[e.InitializeMintCloseAuthority = 25] = "InitializeMintCloseAuthority", e[e.TransferFeeExtension = 26] = "TransferFeeExtension", e[e.ConfidentialTransferExtension = 27] = "ConfidentialTransferExtension", e[e.DefaultAccountStateExtension = 28] = "DefaultAccountStateExtension", e[e.Reallocate = 29] = "Reallocate", e[e.MemoTransferExtension = 30] = "MemoTransferExtension", e[e.CreateNativeMint = 31] = "CreateNativeMint", e[e.InitializeNonTransferableMint = 32] = "InitializeNonTransferableMint", e[e.InterestBearingMintExtension = 33] = "InterestBearingMintExtension", e[e.CpiGuardExtension = 34] = "CpiGuardExtension", e[e.InitializePermanentDelegate = 35] = "InitializePermanentDelegate", e[e.TransferHookExtension = 36] = "TransferHookExtension", e[e.MetadataPointerExtension = 39] = "MetadataPointerExtension";
|
|
47
|
-
})(
|
|
47
|
+
})($ || ($ = {}));
|
|
48
48
|
function Ee(e, t, r) {
|
|
49
49
|
if (r.length) {
|
|
50
50
|
e.push({ pubkey: t, isSigner: !1, isWritable: !1 });
|
|
@@ -59,13 +59,13 @@ function Ee(e, t, r) {
|
|
|
59
59
|
return e;
|
|
60
60
|
}
|
|
61
61
|
const He = A([z("instruction"), U("amount")]);
|
|
62
|
-
function
|
|
62
|
+
function $t(e, t, r, n, i = [], s = M) {
|
|
63
63
|
const o = Ee([
|
|
64
64
|
{ pubkey: e, isSigner: !1, isWritable: !0 },
|
|
65
65
|
{ pubkey: t, isSigner: !1, isWritable: !1 }
|
|
66
66
|
], r, i), a = l.Buffer.alloc(He.span);
|
|
67
67
|
return He.encode({
|
|
68
|
-
instruction:
|
|
68
|
+
instruction: $.Approve,
|
|
69
69
|
amount: BigInt(n)
|
|
70
70
|
}, a), new le({ keys: o, programId: s, data: a });
|
|
71
71
|
}
|
|
@@ -75,7 +75,7 @@ function Qe(e, t, r, n = [], i = M) {
|
|
|
75
75
|
{ pubkey: e, isSigner: !1, isWritable: !0 },
|
|
76
76
|
{ pubkey: t, isSigner: !1, isWritable: !0 }
|
|
77
77
|
], r, n), o = l.Buffer.alloc(Ye.span);
|
|
78
|
-
return Ye.encode({ instruction:
|
|
78
|
+
return Ye.encode({ instruction: $.CloseAccount }, o), new le({ keys: s, programId: i, data: o });
|
|
79
79
|
}
|
|
80
80
|
var ge;
|
|
81
81
|
(function(e) {
|
|
@@ -84,7 +84,7 @@ var ge;
|
|
|
84
84
|
const _e = 1, en = A([
|
|
85
85
|
z("m"),
|
|
86
86
|
z("n"),
|
|
87
|
-
|
|
87
|
+
Z("isInitialized"),
|
|
88
88
|
S("signer1"),
|
|
89
89
|
S("signer2"),
|
|
90
90
|
S("signer3"),
|
|
@@ -161,7 +161,7 @@ const yt = A([
|
|
|
161
161
|
S("mintAuthority"),
|
|
162
162
|
U("supply"),
|
|
163
163
|
z("decimals"),
|
|
164
|
-
|
|
164
|
+
Z("isInitialized"),
|
|
165
165
|
V("freezeAuthorityOption"),
|
|
166
166
|
S("freezeAuthority")
|
|
167
167
|
]), ve = yt.span;
|
|
@@ -184,7 +184,7 @@ function an(e, t, r = M) {
|
|
|
184
184
|
if (t.data.length === Pe)
|
|
185
185
|
throw new ce();
|
|
186
186
|
if (t.data[P] != ge.Mint)
|
|
187
|
-
throw new
|
|
187
|
+
throw new jt();
|
|
188
188
|
i = t.data.slice(P + _e);
|
|
189
189
|
}
|
|
190
190
|
return {
|
|
@@ -209,34 +209,34 @@ function We(e, t, r = !1, n = M, i = Ae) {
|
|
|
209
209
|
const [s] = c.findProgramAddressSync([t.toBuffer(), n.toBuffer(), e.toBuffer()], i);
|
|
210
210
|
return s;
|
|
211
211
|
}
|
|
212
|
-
const on = A([
|
|
212
|
+
const on = A([Z("lockCpi")]), cn = on.span, un = A([z("state")]), dn = un.span, ln = A([]), fn = ln.span, mn = A([
|
|
213
213
|
S("rateAuthority"),
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
]), gn = mn.span, hn = A([
|
|
214
|
+
Ze("initializationTimestamp"),
|
|
215
|
+
Ge("preUpdateAverageRate"),
|
|
216
|
+
Ze("lastUpdateTimestamp"),
|
|
217
|
+
Ge("currentRate")
|
|
218
|
+
]), gn = mn.span, hn = A([Z("requireIncomingTransferMemos")]), pn = hn.span, wn = A([
|
|
219
219
|
S("authority"),
|
|
220
220
|
S("metadataAddress")
|
|
221
221
|
]), yn = wn.span, Sn = A([S("closeAuthority")]), An = Sn.span, St = A([]), Mn = St.span, kn = St.span, bn = A([S("delegate")]), Tn = bn.span, Cn = 1e4;
|
|
222
222
|
BigInt(Cn);
|
|
223
|
-
function
|
|
223
|
+
function je(e) {
|
|
224
224
|
return A([U("epoch"), U("maximumFee"), Wt("transferFeeBasisPoints")], e);
|
|
225
225
|
}
|
|
226
226
|
const vn = A([
|
|
227
227
|
S("transferFeeConfigAuthority"),
|
|
228
228
|
S("withdrawWithheldAuthority"),
|
|
229
229
|
U("withheldAmount"),
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
]), Bn = vn.span, Rn = A([U("withheldAmount")]), En = Rn.span, _n = A([S("authority"), S("programId")]), Pn = _n.span, Wn = A([
|
|
230
|
+
je("olderTransferFee"),
|
|
231
|
+
je("newerTransferFee")
|
|
232
|
+
]), Bn = vn.span, Rn = A([U("withheldAmount")]), En = Rn.span, _n = A([S("authority"), S("programId")]), Pn = _n.span, Wn = A([Z("transferring")]), In = Wn.span, $e = A([
|
|
233
233
|
z("discriminator"),
|
|
234
234
|
It(32, "addressConfig"),
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
Z("isSigner"),
|
|
236
|
+
Z("isWritable")
|
|
237
237
|
]), Un = A([
|
|
238
238
|
V("count"),
|
|
239
|
-
Ut(
|
|
239
|
+
Ut($e, Nt($e.span), "extraAccounts")
|
|
240
240
|
]);
|
|
241
241
|
A([
|
|
242
242
|
U("instructionDiscriminator"),
|
|
@@ -307,7 +307,7 @@ function nt(e, t, r, n = M) {
|
|
|
307
307
|
{ pubkey: r, isSigner: !1, isWritable: !1 },
|
|
308
308
|
{ pubkey: O, isSigner: !1, isWritable: !1 }
|
|
309
309
|
], s = l.Buffer.alloc(tt.span);
|
|
310
|
-
return tt.encode({ instruction:
|
|
310
|
+
return tt.encode({ instruction: $.InitializeAccount }, s), new le({ keys: i, programId: n, data: s });
|
|
311
311
|
}
|
|
312
312
|
function At(e, t, r, n, i = M, s = Ae) {
|
|
313
313
|
return On(e, t, r, n, l.Buffer.alloc(0), i, s);
|
|
@@ -334,7 +334,7 @@ function Ln(e, t, r, n, i = [], s = M) {
|
|
|
334
334
|
{ pubkey: t, isSigner: !1, isWritable: !0 }
|
|
335
335
|
], r, i), a = l.Buffer.alloc(rt.span);
|
|
336
336
|
return rt.encode({
|
|
337
|
-
instruction:
|
|
337
|
+
instruction: $.Transfer,
|
|
338
338
|
amount: BigInt(n)
|
|
339
339
|
}, a), new le({ keys: o, programId: s, data: a });
|
|
340
340
|
}
|
|
@@ -342,7 +342,7 @@ function Ie(e, t) {
|
|
|
342
342
|
const r = l.Buffer.alloc(2);
|
|
343
343
|
return r.writeUInt16BE(y(t)), T([l.Buffer.from("foreign_contract"), r], e);
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function qn(e) {
|
|
346
346
|
return T([l.Buffer.from("redeemer")], e);
|
|
347
347
|
}
|
|
348
348
|
function Ue(e, t) {
|
|
@@ -459,9 +459,9 @@ class Oe {
|
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
function it(e, t, r, n) {
|
|
462
|
-
return
|
|
462
|
+
return $t(new c(t), ne(e), new c(r), n);
|
|
463
463
|
}
|
|
464
|
-
class
|
|
464
|
+
class Dn {
|
|
465
465
|
constructor(t) {
|
|
466
466
|
f(this, "idl");
|
|
467
467
|
this.idl = t;
|
|
@@ -504,9 +504,9 @@ class Vn {
|
|
|
504
504
|
encode(t, r) {
|
|
505
505
|
switch (t) {
|
|
506
506
|
case "initialize":
|
|
507
|
-
return Gn(r);
|
|
508
|
-
case "attestToken":
|
|
509
507
|
return Zn(r);
|
|
508
|
+
case "attestToken":
|
|
509
|
+
return Gn(r);
|
|
510
510
|
case "completeNative":
|
|
511
511
|
return Hn(r);
|
|
512
512
|
case "completeWrapped":
|
|
@@ -518,9 +518,9 @@ class Vn {
|
|
|
518
518
|
case "registerChain":
|
|
519
519
|
return Jn(r);
|
|
520
520
|
case "createWrapped":
|
|
521
|
-
return $n(r);
|
|
522
|
-
case "upgradeContract":
|
|
523
521
|
return jn(r);
|
|
522
|
+
case "upgradeContract":
|
|
523
|
+
return $n(r);
|
|
524
524
|
case "transferWrappedWithPayload":
|
|
525
525
|
return er(r);
|
|
526
526
|
case "transferNativeWithPayload":
|
|
@@ -541,11 +541,11 @@ function N(e, t) {
|
|
|
541
541
|
const r = t === void 0 ? 0 : t.length, n = l.Buffer.alloc(1 + r);
|
|
542
542
|
return n.writeUInt8(e, 0), r > 0 && n.write(t.toString("hex"), 1, "hex"), n;
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function Zn({ wormhole: e }) {
|
|
545
545
|
const t = l.Buffer.alloc(32);
|
|
546
546
|
return t.write(new c(e).toBuffer().toString("hex"), 0, "hex"), N(_.Initialize, t);
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function Gn({ nonce: e }) {
|
|
549
549
|
const t = l.Buffer.alloc(4);
|
|
550
550
|
return t.writeUInt32LE(e, 0), N(_.AttestToken, t);
|
|
551
551
|
}
|
|
@@ -570,10 +570,10 @@ function Xn({ nonce: e, amount: t, fee: r, targetAddress: n, targetChain: i }) {
|
|
|
570
570
|
function Jn({}) {
|
|
571
571
|
return N(_.RegisterChain);
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function jn({}) {
|
|
574
574
|
return N(_.CreateWrapped);
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function $n({}) {
|
|
577
577
|
return N(_.UpgradeContract);
|
|
578
578
|
}
|
|
579
579
|
function Ct({ nonce: e, amount: t, targetAddress: r, targetChain: n, payload: i }) {
|
|
@@ -636,7 +636,7 @@ class ir {
|
|
|
636
636
|
f(this, "state");
|
|
637
637
|
f(this, "events");
|
|
638
638
|
f(this, "types");
|
|
639
|
-
this.instruction = new Vn(t), this.accounts = new
|
|
639
|
+
this.instruction = new Vn(t), this.accounts = new Dn(t), this.state = new nr(t), this.events = new Kn(t), this.types = new rr(t);
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
const vt = {
|
|
@@ -1767,7 +1767,7 @@ function cr(e, t, r, n, i) {
|
|
|
1767
1767
|
return {
|
|
1768
1768
|
payer: new c(r),
|
|
1769
1769
|
config: B(e),
|
|
1770
|
-
vaa:
|
|
1770
|
+
vaa: G(t, l.Buffer.from(n.hash)),
|
|
1771
1771
|
claim: H(e, n.emitterAddress.toUint8Array(), y(n.emitterChain), n.sequence),
|
|
1772
1772
|
endpoint: te(e, y(n.emitterChain), n.emitterAddress.toUint8Array()),
|
|
1773
1773
|
to: new c(n.payload.to.address.toUint8Array()),
|
|
@@ -1796,7 +1796,7 @@ function dr(e, t, r, n, i) {
|
|
|
1796
1796
|
return {
|
|
1797
1797
|
payer: new c(r),
|
|
1798
1798
|
config: B(e),
|
|
1799
|
-
vaa:
|
|
1799
|
+
vaa: G(t, l.Buffer.from(n.hash)),
|
|
1800
1800
|
claim: H(e, n.emitterAddress.toUint8Array(), y(n.emitterChain), n.sequence),
|
|
1801
1801
|
endpoint: te(e, y(n.emitterChain), n.emitterAddress.toUint8Array()),
|
|
1802
1802
|
to: new c(n.payload.to.address.toUint8Array()),
|
|
@@ -1826,7 +1826,7 @@ function fr(e, t, r, n) {
|
|
|
1826
1826
|
payer: new c(r),
|
|
1827
1827
|
config: B(e),
|
|
1828
1828
|
endpoint: te(e, y(n.emitterChain), n.emitterAddress.toUint8Array()),
|
|
1829
|
-
vaa:
|
|
1829
|
+
vaa: G(t, l.Buffer.from(n.hash)),
|
|
1830
1830
|
claim: H(e, n.emitterAddress.toUint8Array(), y(n.emitterChain), n.sequence),
|
|
1831
1831
|
mint: i,
|
|
1832
1832
|
wrappedMeta: Y(e, i),
|
|
@@ -1872,7 +1872,7 @@ function gr(e, t, r, n) {
|
|
|
1872
1872
|
payer: new c(r),
|
|
1873
1873
|
config: B(e),
|
|
1874
1874
|
endpoint: te(e, y(n.payload.actionArgs.foreignChain), n.payload.actionArgs.foreignAddress.toUint8Array()),
|
|
1875
|
-
vaa:
|
|
1875
|
+
vaa: G(t, l.Buffer.from(n.hash)),
|
|
1876
1876
|
claim: H(e, n.emitterAddress.toUint8Array(), y(n.emitterChain), n.sequence),
|
|
1877
1877
|
rent: O,
|
|
1878
1878
|
systemProgram: E.programId,
|
|
@@ -1892,12 +1892,12 @@ function Ir(e, t, r, n, i) {
|
|
|
1892
1892
|
function hr(e, t, r, n, i) {
|
|
1893
1893
|
return {
|
|
1894
1894
|
payer: new c(r),
|
|
1895
|
-
vaa:
|
|
1895
|
+
vaa: G(t, l.Buffer.from(n.hash)),
|
|
1896
1896
|
claim: H(e, n.emitterAddress.toUint8Array(), y(n.emitterChain), n.sequence),
|
|
1897
|
-
upgradeAuthority:
|
|
1897
|
+
upgradeAuthority: qt(e),
|
|
1898
1898
|
spill: new c(i === void 0 ? r : i),
|
|
1899
1899
|
implementation: new c(n.payload.actionArgs.newContract),
|
|
1900
|
-
programData:
|
|
1900
|
+
programData: Dt(e),
|
|
1901
1901
|
tokenBridgeProgram: new c(e),
|
|
1902
1902
|
rent: O,
|
|
1903
1903
|
clock: Kt,
|
|
@@ -2036,7 +2036,7 @@ function Rt(e, t, r, n, i, s, o, a, d) {
|
|
|
2036
2036
|
};
|
|
2037
2037
|
}
|
|
2038
2038
|
function Ur(e, t, r) {
|
|
2039
|
-
const { wormholeEmitter: n, wormholeBridge: i, wormholeFeeCollector: s, wormholeSequence: o } =
|
|
2039
|
+
const { wormholeEmitter: n, wormholeBridge: i, wormholeFeeCollector: s, wormholeSequence: o } = Zt(t, r);
|
|
2040
2040
|
return {
|
|
2041
2041
|
tokenBridgeConfig: B(t),
|
|
2042
2042
|
tokenBridgeAuthoritySigner: ne(t),
|
|
@@ -2101,7 +2101,7 @@ function Nr(e, t, r, n, i) {
|
|
|
2101
2101
|
return {
|
|
2102
2102
|
payer: new c(r),
|
|
2103
2103
|
tokenBridgeConfig: B(e),
|
|
2104
|
-
vaa:
|
|
2104
|
+
vaa: G(t, l.Buffer.from(n.hash)),
|
|
2105
2105
|
tokenBridgeClaim: H(e, n.emitterAddress.toUint8Array(), y(n.emitterChain), n.sequence),
|
|
2106
2106
|
tokenBridgeForeignEndpoint: te(e, y(n.emitterChain), n.emitterAddress.toUint8Array()),
|
|
2107
2107
|
toTokenAccount: new c(i),
|
|
@@ -2121,7 +2121,7 @@ function Fr(e, t, r, n, i) {
|
|
|
2121
2121
|
return {
|
|
2122
2122
|
payer: new c(r),
|
|
2123
2123
|
tokenBridgeConfig: B(e),
|
|
2124
|
-
vaa:
|
|
2124
|
+
vaa: G(t, l.Buffer.from(n.hash)),
|
|
2125
2125
|
tokenBridgeClaim: H(e, n.emitterAddress.toUint8Array(), y(n.emitterChain), n.sequence),
|
|
2126
2126
|
tokenBridgeForeignEndpoint: te(e, y(n.emitterChain), n.emitterAddress.toUint8Array()),
|
|
2127
2127
|
toTokenAccount: new c(i),
|
|
@@ -4118,16 +4118,16 @@ const kr = {
|
|
|
4118
4118
|
}
|
|
4119
4119
|
]
|
|
4120
4120
|
};
|
|
4121
|
-
function
|
|
4121
|
+
function qe(e, t) {
|
|
4122
4122
|
return new lt(kr, new c(e), { connection: t });
|
|
4123
4123
|
}
|
|
4124
4124
|
function Et(e, t) {
|
|
4125
4125
|
return T([l.Buffer.from("seq"), new c(t).toBuffer()], e);
|
|
4126
4126
|
}
|
|
4127
4127
|
async function br(e, t, r, n, i, s, o, a, d, u, m, h) {
|
|
4128
|
-
const { methods: { transferNativeTokensWithRelay: g }, account: { signerSequence: w } } =
|
|
4129
|
-
var
|
|
4130
|
-
if ((
|
|
4128
|
+
const { methods: { transferNativeTokensWithRelay: g }, account: { signerSequence: w } } = qe(t, e), p = Et(t, r), C = await w.fetch(p).then(({ value: x }) => x).catch((x) => {
|
|
4129
|
+
var D;
|
|
4130
|
+
if ((D = x.message) != null && D.includes("Account does not exist"))
|
|
4131
4131
|
return new v(0);
|
|
4132
4132
|
throw x;
|
|
4133
4133
|
}), R = bt(t, r, C), F = We(new c(s), new c(r)), I = kt(t, s), ie = Ar(t, n, i, r, R, F, s);
|
|
@@ -4142,11 +4142,11 @@ async function br(e, t, r, n, i, s, o, a, d, u, m, h) {
|
|
|
4142
4142
|
}).instruction();
|
|
4143
4143
|
}
|
|
4144
4144
|
async function Tr(e, t, r, n, i, s, o, a, d, u, m) {
|
|
4145
|
-
const { methods: { transferWrappedTokensWithRelay: h }, account: { signerSequence: g } } =
|
|
4145
|
+
const { methods: { transferWrappedTokensWithRelay: h }, account: { signerSequence: g } } = qe(t, e), w = Et(t, r), p = await g.fetch(w).then(({ value: D }) => D).catch((D) => {
|
|
4146
4146
|
var Ve;
|
|
4147
|
-
if ((Ve =
|
|
4147
|
+
if ((Ve = D.message) != null && Ve.includes("Account does not exist"))
|
|
4148
4148
|
return new v(0);
|
|
4149
|
-
throw
|
|
4149
|
+
throw D;
|
|
4150
4150
|
}), C = bt(t, r, p), R = We(new c(s), new c(r)), { chain: F, tokenAddress: I } = await me(e, n, s), ie = kt(t, s), x = Mr(t, n, i, r, C, R, F, I);
|
|
4151
4151
|
return h(new v(o.toString()), new v(a.toString()), y(u), [...d], m).accounts({
|
|
4152
4152
|
config: Mt(t),
|
|
@@ -4158,7 +4158,7 @@ async function Tr(e, t, r, n, i, s, o, a, d, u, m) {
|
|
|
4158
4158
|
...x
|
|
4159
4159
|
}).instruction();
|
|
4160
4160
|
}
|
|
4161
|
-
class
|
|
4161
|
+
class De {
|
|
4162
4162
|
constructor(t, r, n, i) {
|
|
4163
4163
|
f(this, "network");
|
|
4164
4164
|
f(this, "chain");
|
|
@@ -4171,13 +4171,13 @@ class qe {
|
|
|
4171
4171
|
const s = i.tokenBridge;
|
|
4172
4172
|
if (!s)
|
|
4173
4173
|
throw new Error(`TokenBridge contract Address for chain ${r} not found`);
|
|
4174
|
-
this.tokenBridge = W(s, n), this.coreBridge = new
|
|
4174
|
+
this.tokenBridge = W(s, n), this.coreBridge = new Gt(t, r, n, i);
|
|
4175
4175
|
}
|
|
4176
4176
|
static async fromRpc(t, r) {
|
|
4177
4177
|
const [n, i] = await oe.chainFromRpc(t), s = r[i];
|
|
4178
4178
|
if (s.network !== n)
|
|
4179
4179
|
throw new Error(`Network mismatch for chain ${i}: ${s.network} != ${n}`);
|
|
4180
|
-
return new
|
|
4180
|
+
return new De(n, i, t, s.contracts);
|
|
4181
4181
|
}
|
|
4182
4182
|
async isWrappedAsset(t) {
|
|
4183
4183
|
return me(this.connection, this.tokenBridge.programId, new k(t).toUint8Array()).catch((r) => null).then((r) => r != null);
|
|
@@ -4213,7 +4213,7 @@ class qe {
|
|
|
4213
4213
|
return !1;
|
|
4214
4214
|
}
|
|
4215
4215
|
async getWrappedAsset(t) {
|
|
4216
|
-
if (
|
|
4216
|
+
if (j(t.address))
|
|
4217
4217
|
throw new Error("Native cannot be a wrapped asset");
|
|
4218
4218
|
const r = re(this.tokenBridge.programId, y(t.chain), t.address.toUniversalAddress().toUint8Array());
|
|
4219
4219
|
try {
|
|
@@ -4226,7 +4226,7 @@ class qe {
|
|
|
4226
4226
|
return Yt(this.connection, this.tokenBridge.programId, t.emitterAddress.toUint8Array(), y(t.emitterChain), t.sequence, this.connection.commitment).catch(() => !1);
|
|
4227
4227
|
}
|
|
4228
4228
|
async getWrappedNative() {
|
|
4229
|
-
return Be(this.chain,
|
|
4229
|
+
return Be(this.chain, q.toBase58());
|
|
4230
4230
|
}
|
|
4231
4231
|
async *createAttestation(t, r) {
|
|
4232
4232
|
if (!r)
|
|
@@ -4254,7 +4254,7 @@ class qe {
|
|
|
4254
4254
|
fromPubkey: o,
|
|
4255
4255
|
lamports: n,
|
|
4256
4256
|
toPubkey: g.publicKey
|
|
4257
|
-
}), R = nt(g.publicKey,
|
|
4257
|
+
}), R = nt(g.publicKey, q, o), F = it(this.tokenBridge.programId, g.publicKey, o, n), I = i ? ut(this.connection, this.tokenBridge.programId, this.coreBridge.address, s, h.publicKey, g.publicKey, q, u, n, a, d, i) : ct(this.connection, this.tokenBridge.programId, this.coreBridge.address, s, h.publicKey, g.publicKey, q, u, n, m, a, d), ie = Qe(
|
|
4258
4258
|
g.publicKey,
|
|
4259
4259
|
//account to close
|
|
4260
4260
|
o,
|
|
@@ -4264,7 +4264,7 @@ class qe {
|
|
|
4264
4264
|
return x.feePayer = o, x.add(p, C, R, F, I, ie), this.createUnsignedTx({ transaction: x, signers: [h, g] }, "TokenBridge.TransferNative");
|
|
4265
4265
|
}
|
|
4266
4266
|
async *transfer(t, r, n, i, s) {
|
|
4267
|
-
if (
|
|
4267
|
+
if (j(n)) {
|
|
4268
4268
|
yield await this.transferSol(t, r, i, s);
|
|
4269
4269
|
return;
|
|
4270
4270
|
}
|
|
@@ -4274,7 +4274,7 @@ class qe {
|
|
|
4274
4274
|
C = s ? ut(this.connection, this.tokenBridge.programId, this.coreBridge.address, a, p.publicKey, d, o, h, i, u, m, s) : ct(this.connection, this.tokenBridge.programId, this.coreBridge.address, a, p.publicKey, d, o, h, i, g, u, m);
|
|
4275
4275
|
else {
|
|
4276
4276
|
const I = await this.getOriginalAsset(n);
|
|
4277
|
-
if (
|
|
4277
|
+
if (j(I.address))
|
|
4278
4278
|
throw new Error("Native cannot be an original asset");
|
|
4279
4279
|
C = s ? Sr(this.connection, this.tokenBridge.programId, this.coreBridge.address, a, p.publicKey, d, a, y(I.chain), I.address.toUint8Array(), h, i, u, m, s) : wr(this.connection, this.tokenBridge.programId, this.coreBridge.address, a, p.publicKey, d, a, y(I.chain), I.address.toUint8Array(), h, i, g, u, m);
|
|
4280
4280
|
}
|
|
@@ -4282,14 +4282,14 @@ class qe {
|
|
|
4282
4282
|
F.feePayer = a, yield this.createUnsignedTx({ transaction: F, signers: [p] }, "TokenBridge.TransferTokens");
|
|
4283
4283
|
}
|
|
4284
4284
|
async *redeemAndUnwrap(t, r) {
|
|
4285
|
-
const n = new k(t).unwrap(), i = new k(r.payload.to.address).unwrap(), s = await sn(this.connection,
|
|
4285
|
+
const n = new k(t).unwrap(), i = new k(r.payload.to.address).unwrap(), s = await sn(this.connection, q).then((p) => r.payload.token.amount * BigInt(Math.pow(10, p.decimals - 8))), o = await Xe(this.connection), a = se.generate(), d = ot(this.connection, this.tokenBridge.programId, this.coreBridge.address, n, r), u = E.createAccount({
|
|
4286
4286
|
fromPubkey: n,
|
|
4287
4287
|
newAccountPubkey: a.publicKey,
|
|
4288
4288
|
lamports: o,
|
|
4289
4289
|
//spl token accounts need rent exemption
|
|
4290
4290
|
space: P,
|
|
4291
4291
|
programId: M
|
|
4292
|
-
}), m = nt(a.publicKey,
|
|
4292
|
+
}), m = nt(a.publicKey, q, n), h = Ln(i, a.publicKey, n, s.valueOf()), g = Qe(
|
|
4293
4293
|
a.publicKey,
|
|
4294
4294
|
//account to close
|
|
4295
4295
|
n,
|
|
@@ -4365,7 +4365,7 @@ class Ke {
|
|
|
4365
4365
|
const s = i.tokenBridgeRelayer;
|
|
4366
4366
|
if (!s)
|
|
4367
4367
|
throw new Error(`TokenBridge contract Address for chain ${r} not found`);
|
|
4368
|
-
this.tokenBridgeRelayer =
|
|
4368
|
+
this.tokenBridgeRelayer = qe(s, n), this.tokenBridgeProgramId = new c(i.tokenBridge), this.coreBridgeProgramId = new c(i.coreBridge);
|
|
4369
4369
|
}
|
|
4370
4370
|
static async fromRpc(t, r) {
|
|
4371
4371
|
const [n, i] = await oe.chainFromRpc(t), s = r[i];
|
|
@@ -4375,7 +4375,7 @@ class Ke {
|
|
|
4375
4375
|
}
|
|
4376
4376
|
async *transfer(t, r, n, i, s) {
|
|
4377
4377
|
const a = new k(t).unwrap(), d = r.address.toUniversalAddress().toUint8Array(), u = this.mintAddress(n), m = new L();
|
|
4378
|
-
if (
|
|
4378
|
+
if (j(n)) {
|
|
4379
4379
|
const p = We(u, a);
|
|
4380
4380
|
try {
|
|
4381
4381
|
await tn(this.connection, p);
|
|
@@ -4387,7 +4387,7 @@ class Ke {
|
|
|
4387
4387
|
throw C;
|
|
4388
4388
|
}
|
|
4389
4389
|
}
|
|
4390
|
-
const h = s || 0n, g =
|
|
4390
|
+
const h = s || 0n, g = j(n), w = g ? await br(this.connection, this.tokenBridgeRelayer.programId, a, this.tokenBridgeProgramId, this.coreBridgeProgramId, u, i, h, d, r.chain, 0, g) : await Tr(this.connection, this.tokenBridgeRelayer.programId, a, this.tokenBridgeProgramId, this.coreBridgeProgramId, u, i, h, d, r.chain, 0);
|
|
4391
4391
|
m.add(w), m.feePayer = a, yield this.createUnsignedTx({ transaction: m }, "AutomaticTokenBridge.Transfer");
|
|
4392
4392
|
}
|
|
4393
4393
|
async *redeem(t, r) {
|
|
@@ -4405,7 +4405,7 @@ class Ke {
|
|
|
4405
4405
|
async maxSwapAmount(t) {
|
|
4406
4406
|
const r = this.mintAddress(t), [{ swapRate: n, maxNativeSwapAmount: i }, { swapRate: s }] = await Promise.all([
|
|
4407
4407
|
this.getRegisteredToken(r),
|
|
4408
|
-
this.getRegisteredToken(
|
|
4408
|
+
this.getRegisteredToken(q)
|
|
4409
4409
|
]), o = Number(await oe.getDecimals(this.chain, this.connection, t)), a = this.calculateNativeSwapRate(s, n), d = o > X ? i.mul(a).mul(ae.pow(new v(o - X))).div(J) : i.mul(a).div(ae.pow(new v(X - o)).mul(J));
|
|
4410
4410
|
return BigInt(d.toString());
|
|
4411
4411
|
}
|
|
@@ -4414,7 +4414,7 @@ class Ke {
|
|
|
4414
4414
|
return 0n;
|
|
4415
4415
|
const n = this.mintAddress(t), i = Number(await oe.getDecimals(this.chain, this.connection, t)), [{ swapRate: s }, { swapRate: o }] = await Promise.all([
|
|
4416
4416
|
this.getRegisteredToken(n),
|
|
4417
|
-
this.getRegisteredToken(
|
|
4417
|
+
this.getRegisteredToken(q)
|
|
4418
4418
|
]), a = this.calculateNativeSwapRate(o, s), d = i > X ? J.mul(new v(r.toString())).div(a.mul(ae.pow(new v(i - X)))) : J.mul(new v(r.toString())).mul(ae.pow(new v(X - i))).div(a);
|
|
4419
4419
|
return BigInt(d.toString());
|
|
4420
4420
|
}
|
|
@@ -4430,7 +4430,7 @@ class Ke {
|
|
|
4430
4430
|
}
|
|
4431
4431
|
}
|
|
4432
4432
|
mintAddress(t) {
|
|
4433
|
-
return
|
|
4433
|
+
return j(t) ? new c(q) : new k(t).unwrap();
|
|
4434
4434
|
}
|
|
4435
4435
|
async getRegisteredTokens() {
|
|
4436
4436
|
return Cr[this.network].map((t) => Be(this.chain, t));
|
|
@@ -4445,13 +4445,13 @@ class Ke {
|
|
|
4445
4445
|
return await this.tokenBridgeRelayer.account.registeredToken.fetch(Ue(this.tokenBridgeRelayer.programId, t));
|
|
4446
4446
|
}
|
|
4447
4447
|
async getRedeemerConfig() {
|
|
4448
|
-
return await this.tokenBridgeRelayer.account.redeemerConfig.fetch(
|
|
4448
|
+
return await this.tokenBridgeRelayer.account.redeemerConfig.fetch(qn(this.tokenBridgeRelayer.programId));
|
|
4449
4449
|
}
|
|
4450
4450
|
createUnsignedTx(t, r, n = !1) {
|
|
4451
4451
|
return new ft(t, this.network, this.chain, r, n);
|
|
4452
4452
|
}
|
|
4453
4453
|
}
|
|
4454
|
-
mt(gt, "TokenBridge",
|
|
4454
|
+
mt(gt, "TokenBridge", De);
|
|
4455
4455
|
mt(gt, "AutomaticTokenBridge", Ke);
|
|
4456
4456
|
export {
|
|
4457
4457
|
pe as CreateMetadataAccountArgs,
|
|
@@ -4461,7 +4461,7 @@ export {
|
|
|
4461
4461
|
st as Key,
|
|
4462
4462
|
Le as Metadata,
|
|
4463
4463
|
Ke as SolanaAutomaticTokenBridge,
|
|
4464
|
-
|
|
4464
|
+
De as SolanaTokenBridge,
|
|
4465
4465
|
de as SplTokenMetadataProgram,
|
|
4466
4466
|
vt as TOKEN_BRIDGE_IDL,
|
|
4467
4467
|
kr as TOKEN_BRIDGE_RELAYER_IDL,
|
|
@@ -4477,7 +4477,7 @@ export {
|
|
|
4477
4477
|
W as createReadOnlyTokenBridgeProgramInterface,
|
|
4478
4478
|
Wr as createRegisterChainInstruction,
|
|
4479
4479
|
sr as createTokenBridgeProgramInterface,
|
|
4480
|
-
|
|
4480
|
+
qe as createTokenBridgeRelayerProgramInterface,
|
|
4481
4481
|
ct as createTransferNativeInstruction,
|
|
4482
4482
|
br as createTransferNativeTokensWithRelayInstruction,
|
|
4483
4483
|
ut as createTransferNativeWithPayloadInstruction,
|
|
@@ -4492,7 +4492,7 @@ export {
|
|
|
4492
4492
|
Ie as deriveForeignContractAddress,
|
|
4493
4493
|
ke as deriveMintAuthorityKey,
|
|
4494
4494
|
ze as deriveRedeemerAccountKey,
|
|
4495
|
-
|
|
4495
|
+
qn as deriveRedeemerConfigAddress,
|
|
4496
4496
|
Ue as deriveRegisteredTokenAddress,
|
|
4497
4497
|
xe as deriveSenderAccountKey,
|
|
4498
4498
|
Mt as deriveSenderConfigAddress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var D=Object.defineProperty;var q=(o,e,n)=>e in o?D(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n;var p=(o,e,n)=>q(o,typeof e!="symbol"?e+"":e,n);const t=require("./index-Hj_44yP6.js"),H=require("./algorand-tXcNTbqw.js");class j{constructor(e,n,r,s,i=!1){p(this,"transaction");p(this,"network");p(this,"chain");p(this,"description");p(this,"parallelizable");this.transaction=e,this.network=n,this.chain=r,this.description=s,this.parallelizable=i}}const K=1002e3,O=15,U=127,L=8,R=U*L,V=U*O,N=L*V,m={_limit:127,encodingLength:o=>{let e=0;for(;o>=128;e++)o>>=7;return e+1},encode:(o,e,n)=>{if(typeof o=="bigint"&&(o=t.safeBigIntToNumber(o)),o<0)throw new RangeError("value must be unsigned");const r=m.encodingLength(o);if(e=e||new ArrayBuffer(r),n=n||0,e.byteLength<n+r)throw new RangeError("the buffer is too small to encode the number at the offset");const s=new Uint8Array(e,n);let i=0;for(;m._limit<o;)s[i++]=o&m._limit|128,o>>=7;return s[i]=Number(o),s},decode:(o,e=0)=>{let n=0,r=0,s;do{if(s=o[e+r],s===void 0)throw new RangeError("offset out of range");n+=(s&m._limit)<<r*7,r++}while(128<=s);return n}},u={forMessageId:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey,r=e.emitter.toUniversalAddress().toUint8Array(),s=t.bignum.toBytes(BigInt(t.toChainId(e.chain)),2),i=t.bytes.concat(s,r);return u.fromData({appId:o,appAddress:n,idx:e.sequence/BigInt(N),address:i})},forWrappedAsset:(o,e)=>{if(t.isNative(e.address))throw new Error("native asset cannot be a wrapped asset");const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:BigInt(t.toChainId(e.chain)),address:e.address.toUniversalAddress().toUint8Array()})},forNativeAsset:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:e,address:t.bytes.encode("native")})},forGuardianSet:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:BigInt(e),address:t.bytes.encode("guardian")})},forEmitter:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:0n,address:e})},_encode:o=>typeof o=="bigint"?[t.hex.encode(m.encode(o))]:[t.hex.encode(m.encode(o.length)),t.hex.encode(o)],fromData:o=>{const e=["0620010181",...u._encode(o.idx),"4880",...u._encode(o.address),"483110810612443119221244311881",...u._encode(o.appId),"1244312080",...u._encode(o.appAddress),"124431018100124431093203124431153203124422"],n=t.hex.decode(e.join(""));return new t.LogicSigAccount(n)},decodeLocalState:async(o,e,n)=>{let r;try{const a=await o.accountApplicationInformation(n,t.safeBigIntToNumber(e)).do();r=t.AccountApplicationResponse.from_obj_for_encoding(a).appLocalState}catch{return new Uint8Array}const s=t.b64.encode("meta");let i=new Map;for(const a of r.keyValue){if(a.key===s)continue;const g=t.b64.decode(a.key)[0],l=t.b64.decode(a.value.bytes);i.set(g,l)}const d=[];for(let a=0;a<O;a++)i.has(a)&&d.push(i.get(a));return t.bytes.concat(...d)},checkBitsSet:async(o,e,n,r)=>{let s=!1,i;const d=await o.accountInformation(n).do(),g=t.Account.from_obj_for_encoding(d).appsLocalState;if(g&&g.forEach(h=>{BigInt(h.id)===e&&(i=h.keyValue)}),(i==null?void 0:i.length)===0)return s;const l=BigInt(N),f=BigInt(8),y=r/l*l,b=t.safeBigIntToNumber(r-y),T=Math.floor(b/R),x=Math.floor((b-T*R)/8),B=t.b64.encode(t.bignum.toBytes(T,1));return i==null||i.forEach(h=>{if(h.key===B){const _=t.dist.Buffer.from(h.value.bytes,"base64"),w=1<<t.safeBigIntToNumber(r%f);s=(_[x]&w)!=0;return}}),s},storageAccountExists:async(o,e,n)=>{try{const r=await o.accountApplicationInformation(e,t.safeBigIntToNumber(n)).do();return Object.keys(r).length>0}catch{}return!1}},c=class c{constructor(e,n,r,s){p(this,"network");p(this,"chain");p(this,"connection");p(this,"contracts");p(this,"chainId");p(this,"coreAppId");p(this,"coreAppAddress");p(this,"tokenBridgeAppId");p(this,"tokenBridgeAppAddress");if(this.network=e,this.chain=n,this.connection=r,this.contracts=s,this.chainId=t.toChainId(n),!s.coreBridge)throw new Error(`Core contract address for chain ${n} not found`);const i=BigInt(s.coreBridge);if(this.coreAppId=i,this.coreAppAddress=t.getApplicationAddress(i),!s.tokenBridge)throw new Error(`TokenBridge contract address for chain ${n} not found`);const d=BigInt(s.tokenBridge);this.tokenBridgeAppId=d,this.tokenBridgeAppAddress=t.getApplicationAddress(d)}getGuardianSet(e){throw new Error("Method not implemented.")}async*verifyMessage(e,n,r){const s=new t.AlgorandAddress(e).toString(),i=await c.submitVAAHeader(this.connection,this.coreAppId,r??this.coreAppId,n,s);for(const d of i.txs)yield this.createUnsignedTx(d,"Core.verifyMessage")}static async fromRpc(e,n){const[r,s]=await H.AlgorandPlatform.chainFromRpc(e),i=n[s];if(i.network!==r)throw new Error(`Network mismatch: ${i.network} !== ${r}`);return new c(r,s,e,i.contracts)}async*publishMessage(e,n){const r=new t.AlgorandAddress(e),s=r.toString(),i=await this.connection.getTransactionParams().do(),d=u.forEmitter(this.coreAppId,r.toUint8Array()),{accounts:a,txs:g}=await c.maybeCreateStorageTx(this.connection,s,this.coreAppId,d,i);for(const f of g)yield this.createUnsignedTx(f,"Core.publishMessage",!0);const l=t.makeApplicationCallTxnFromObject({from:s,appIndex:t.safeBigIntToNumber(this.coreAppId),appArgs:[c.publishMessage,n,t.bignum.toBytes(0n,8)],accounts:a,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:i});yield this.createUnsignedTx({tx:l},"Core.publishMessage",!0)}async getMessageFee(){var s;const e=await this.connection.getApplicationByID(t.safeBigIntToNumber(this.coreAppId)).do(),r=(s=t.Application.from_obj_for_encoding(e).params.globalState)==null?void 0:s.find(i=>i.key===c.feeKey);return r?BigInt(r.value.uint):0n}async getGuardianSetIndex(){throw new Error("Not implemented")}async parseTransaction(e){const n=await this.connection.pendingTransactionInformation(e).do(),r=t.PendingTransactionResponse.from_obj_for_encoding(n);return this.parseTx(r).map(s=>({chain:s.emitterChain,emitter:s.emitterAddress,sequence:s.sequence}))}async parseMessages(e){const n=await this.connection.pendingTransactionInformation(e).do(),r=t.PendingTransactionResponse.from_obj_for_encoding(n);return this.parseTx(r)}parseTx(e){const n=[];if(e.innerTxns&&e.innerTxns.length>0&&n.push(...e.innerTxns.flatMap(g=>this.parseTx(g))),BigInt(e.txn.txn.apid??0)!==this.coreAppId||!e.logs||e.logs.length===0)return n;const r=e.txn.txn.apaa??[];if(r.length!==3||!t.bytes.equals(new Uint8Array(r[0]),c.publishMessage))return n;const s=t.bignum.decode(e.logs[0]),i=new t.AlgorandAddress(e.txn.txn.snd).toUniversalAddress(),d=new Uint8Array(r[1]),a=t.bignum.decode(r[2]);return n.push(t.createVAA("Uint8Array",{emitterChain:this.chain,emitterAddress:i,sequence:s,guardianSet:0,timestamp:0,consistencyLevel:0,nonce:Number(a),payload:d,signatures:[]})),n}static async maybeCreateStorageTx(e,n,r,s,i){const d=t.getApplicationAddress(r),a=s.address(),g=[];if(await u.storageAccountExists(e,a,r))return{accounts:[a],txs:g};i=i??await e.getTransactionParams().do();const l=t.makePaymentTxnWithSuggestedParamsFromObject({from:n,to:a,amount:K,suggestedParams:i});l.fee=l.fee*2,g.push({tx:l});const f=t.makeApplicationOptInTxnFromObject({from:a,appIndex:t.safeBigIntToNumber(r),rekeyTo:d,suggestedParams:i});return f.fee=0,g.push({tx:f,signer:{address:s.address(),signTxn:y=>Promise.resolve(t.signLogicSigTransaction(y,s).blob)}}),{accounts:[a],txs:g}}static async submitVAAHeader(e,n,r,s,i,d){d=d??await e.getTransactionParams().do();let a=[];const g=u.forMessageId(r,{chain:s.emitterChain,sequence:s.sequence,emitter:s.emitterAddress}),{accounts:l,txs:f}=await c.maybeCreateStorageTx(e,i,r,g,d);a.push(...f);const y=u.forGuardianSet(n,s.guardianSet),{accounts:[b],txs:T}=await c.maybeCreateStorageTx(e,i,n,y,d);a.push(...T);let x=[...l,b];const B=await u.decodeLocalState(e,n,b),h=t.keccak_256(s.hash),_=s.signatures.length,w=Math.ceil(_/c.MAX_SIGS_PER_TXN),k=20,C=new t.LogicSigAccount(c.ALGO_VERIFY);for(let M=0;M<w;M++){const v=M*c.MAX_SIGS_PER_TXN,S=s.signatures.slice(v,v+c.MAX_SIGS_PER_TXN),F=S.length*k,G=new Uint8Array(F);for(let A=0;A<S.length;A++){const P=S[A],Y=B.slice(P.guardianIndex*k+1,(P.guardianIndex+1)*k+1);G.set(Y,A*20)}const X=t.makeApplicationCallTxnFromObject({appArgs:[c.verifySigs,t.bytes.concat(...S.map(A=>t.bytes.concat(new Uint8Array([A.guardianIndex]),A.signature.encode()))),G,h],accounts:x,appIndex:t.safeBigIntToNumber(n),from:c.ALGO_VERIFY_HASH,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:d});X.fee=0,a.push({tx:X,signer:{address:C.address(),signTxn:A=>Promise.resolve(t.signLogicSigTransaction(A,C).blob)}})}const E=t.makeApplicationCallTxnFromObject({appArgs:[c.verifyVaa,t.serialize(s)],accounts:x,appIndex:t.safeBigIntToNumber(n),from:i,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:d});return E.fee=E.fee*(2+w),a.push({tx:E}),{accounts:x,txs:a}}createUnsignedTx(e,n,r=!0){return new j(e,this.network,this.chain,n,r)}};p(c,"MAX_SIGS_PER_TXN",6),p(c,"ALGO_VERIFY_HASH","EZATROXX2HISIRZDRGXW4LRQ46Z6IUJYYIHU3PJGP7P5IQDPKVX42N767A"),p(c,"ALGO_VERIFY",new Uint8Array([6,32,4,1,0,32,20,38,1,0,49,32,50,3,18,68,49,1,35,18,68,49,16,129,6,18,68,54,26,1,54,26,3,54,26,2,136,0,3,68,34,67,53,2,53,1,53,0,40,53,240,40,53,241,52,0,21,53,5,35,53,3,35,53,4,52,3,52,5,12,65,0,68,52,1,52,0,52,3,129,65,8,34,88,23,52,0,52,3,34,8,36,88,52,0,52,3,129,33,8,36,88,7,0,53,241,53,240,52,2,52,4,37,88,52,240,52,241,80,2,87,12,20,18,68,52,3,129,66,8,53,3,52,4,37,8,53,4,66,255,180,34,137])),p(c,"feeKey",t.b64.encode("MessageFee")),p(c,"verifyVaa",t.bytes.encode("verifyVAA")),p(c,"verifySigs",t.bytes.encode("verifySigs")),p(c,"publishMessage",t.bytes.encode("publishMessage"));let I=c;t.registerProtocol("Algorand","WormholeCore",I);const z=Object.freeze(Object.defineProperty({__proto__:null,AlgorandWormholeCore:I,BITS_PER_BYTE:L,BITS_PER_KEY:R,MAX_BITS:N,MAX_BYTES:V,MAX_BYTES_PER_KEY:U,MAX_KEYS:O,SEED_AMT:K,StorageLogicSig:u,varint:m},Symbol.toStringTag,{value:"Module"}));exports.AlgorandUnsignedTransaction=j;exports.AlgorandWormholeCore=I;exports.StorageLogicSig=u;exports.index=z;
|
|
1
|
+
"use strict";var D=Object.defineProperty;var q=(o,e,n)=>e in o?D(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n;var p=(o,e,n)=>q(o,typeof e!="symbol"?e+"":e,n);const t=require("./index-BJvQdk3o.js"),H=require("./algorand-BvtlkYvW.js");class j{constructor(e,n,r,s,i=!1){p(this,"transaction");p(this,"network");p(this,"chain");p(this,"description");p(this,"parallelizable");this.transaction=e,this.network=n,this.chain=r,this.description=s,this.parallelizable=i}}const K=1002e3,O=15,U=127,L=8,R=U*L,V=U*O,N=L*V,m={_limit:127,encodingLength:o=>{let e=0;for(;o>=128;e++)o>>=7;return e+1},encode:(o,e,n)=>{if(typeof o=="bigint"&&(o=t.safeBigIntToNumber(o)),o<0)throw new RangeError("value must be unsigned");const r=m.encodingLength(o);if(e=e||new ArrayBuffer(r),n=n||0,e.byteLength<n+r)throw new RangeError("the buffer is too small to encode the number at the offset");const s=new Uint8Array(e,n);let i=0;for(;m._limit<o;)s[i++]=o&m._limit|128,o>>=7;return s[i]=Number(o),s},decode:(o,e=0)=>{let n=0,r=0,s;do{if(s=o[e+r],s===void 0)throw new RangeError("offset out of range");n+=(s&m._limit)<<r*7,r++}while(128<=s);return n}},u={forMessageId:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey,r=e.emitter.toUniversalAddress().toUint8Array(),s=t.bignum.toBytes(BigInt(t.toChainId(e.chain)),2),i=t.bytes.concat(s,r);return u.fromData({appId:o,appAddress:n,idx:e.sequence/BigInt(N),address:i})},forWrappedAsset:(o,e)=>{if(t.isNative(e.address))throw new Error("native asset cannot be a wrapped asset");const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:BigInt(t.toChainId(e.chain)),address:e.address.toUniversalAddress().toUint8Array()})},forNativeAsset:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:e,address:t.bytes.encode("native")})},forGuardianSet:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:BigInt(e),address:t.bytes.encode("guardian")})},forEmitter:(o,e)=>{const n=t.decodeAddress(t.getApplicationAddress(o)).publicKey;return u.fromData({appId:o,appAddress:n,idx:0n,address:e})},_encode:o=>typeof o=="bigint"?[t.hex.encode(m.encode(o))]:[t.hex.encode(m.encode(o.length)),t.hex.encode(o)],fromData:o=>{const e=["0620010181",...u._encode(o.idx),"4880",...u._encode(o.address),"483110810612443119221244311881",...u._encode(o.appId),"1244312080",...u._encode(o.appAddress),"124431018100124431093203124431153203124422"],n=t.hex.decode(e.join(""));return new t.LogicSigAccount(n)},decodeLocalState:async(o,e,n)=>{let r;try{const a=await o.accountApplicationInformation(n,t.safeBigIntToNumber(e)).do();r=t.AccountApplicationResponse.from_obj_for_encoding(a).appLocalState}catch{return new Uint8Array}const s=t.b64.encode("meta");let i=new Map;for(const a of r.keyValue){if(a.key===s)continue;const g=t.b64.decode(a.key)[0],l=t.b64.decode(a.value.bytes);i.set(g,l)}const d=[];for(let a=0;a<O;a++)i.has(a)&&d.push(i.get(a));return t.bytes.concat(...d)},checkBitsSet:async(o,e,n,r)=>{let s=!1,i;const d=await o.accountInformation(n).do(),g=t.Account.from_obj_for_encoding(d).appsLocalState;if(g&&g.forEach(h=>{BigInt(h.id)===e&&(i=h.keyValue)}),(i==null?void 0:i.length)===0)return s;const l=BigInt(N),f=BigInt(8),y=r/l*l,b=t.safeBigIntToNumber(r-y),T=Math.floor(b/R),x=Math.floor((b-T*R)/8),B=t.b64.encode(t.bignum.toBytes(T,1));return i==null||i.forEach(h=>{if(h.key===B){const _=t.dist.Buffer.from(h.value.bytes,"base64"),w=1<<t.safeBigIntToNumber(r%f);s=(_[x]&w)!=0;return}}),s},storageAccountExists:async(o,e,n)=>{try{const r=await o.accountApplicationInformation(e,t.safeBigIntToNumber(n)).do();return Object.keys(r).length>0}catch{}return!1}},c=class c{constructor(e,n,r,s){p(this,"network");p(this,"chain");p(this,"connection");p(this,"contracts");p(this,"chainId");p(this,"coreAppId");p(this,"coreAppAddress");p(this,"tokenBridgeAppId");p(this,"tokenBridgeAppAddress");if(this.network=e,this.chain=n,this.connection=r,this.contracts=s,this.chainId=t.toChainId(n),!s.coreBridge)throw new Error(`Core contract address for chain ${n} not found`);const i=BigInt(s.coreBridge);if(this.coreAppId=i,this.coreAppAddress=t.getApplicationAddress(i),!s.tokenBridge)throw new Error(`TokenBridge contract address for chain ${n} not found`);const d=BigInt(s.tokenBridge);this.tokenBridgeAppId=d,this.tokenBridgeAppAddress=t.getApplicationAddress(d)}getGuardianSet(e){throw new Error("Method not implemented.")}async*verifyMessage(e,n,r){const s=new t.AlgorandAddress(e).toString(),i=await c.submitVAAHeader(this.connection,this.coreAppId,r??this.coreAppId,n,s);for(const d of i.txs)yield this.createUnsignedTx(d,"Core.verifyMessage")}static async fromRpc(e,n){const[r,s]=await H.AlgorandPlatform.chainFromRpc(e),i=n[s];if(i.network!==r)throw new Error(`Network mismatch: ${i.network} !== ${r}`);return new c(r,s,e,i.contracts)}async*publishMessage(e,n){const r=new t.AlgorandAddress(e),s=r.toString(),i=await this.connection.getTransactionParams().do(),d=u.forEmitter(this.coreAppId,r.toUint8Array()),{accounts:a,txs:g}=await c.maybeCreateStorageTx(this.connection,s,this.coreAppId,d,i);for(const f of g)yield this.createUnsignedTx(f,"Core.publishMessage",!0);const l=t.makeApplicationCallTxnFromObject({from:s,appIndex:t.safeBigIntToNumber(this.coreAppId),appArgs:[c.publishMessage,n,t.bignum.toBytes(0n,8)],accounts:a,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:i});yield this.createUnsignedTx({tx:l},"Core.publishMessage",!0)}async getMessageFee(){var s;const e=await this.connection.getApplicationByID(t.safeBigIntToNumber(this.coreAppId)).do(),r=(s=t.Application.from_obj_for_encoding(e).params.globalState)==null?void 0:s.find(i=>i.key===c.feeKey);return r?BigInt(r.value.uint):0n}async getGuardianSetIndex(){throw new Error("Not implemented")}async parseTransaction(e){const n=await this.connection.pendingTransactionInformation(e).do(),r=t.PendingTransactionResponse.from_obj_for_encoding(n);return this.parseTx(r).map(s=>({chain:s.emitterChain,emitter:s.emitterAddress,sequence:s.sequence}))}async parseMessages(e){const n=await this.connection.pendingTransactionInformation(e).do(),r=t.PendingTransactionResponse.from_obj_for_encoding(n);return this.parseTx(r)}parseTx(e){const n=[];if(e.innerTxns&&e.innerTxns.length>0&&n.push(...e.innerTxns.flatMap(g=>this.parseTx(g))),BigInt(e.txn.txn.apid??0)!==this.coreAppId||!e.logs||e.logs.length===0)return n;const r=e.txn.txn.apaa??[];if(r.length!==3||!t.bytes.equals(new Uint8Array(r[0]),c.publishMessage))return n;const s=t.bignum.decode(e.logs[0]),i=new t.AlgorandAddress(e.txn.txn.snd).toUniversalAddress(),d=new Uint8Array(r[1]),a=t.bignum.decode(r[2]);return n.push(t.createVAA("Uint8Array",{emitterChain:this.chain,emitterAddress:i,sequence:s,guardianSet:0,timestamp:0,consistencyLevel:0,nonce:Number(a),payload:d,signatures:[]})),n}static async maybeCreateStorageTx(e,n,r,s,i){const d=t.getApplicationAddress(r),a=s.address(),g=[];if(await u.storageAccountExists(e,a,r))return{accounts:[a],txs:g};i=i??await e.getTransactionParams().do();const l=t.makePaymentTxnWithSuggestedParamsFromObject({from:n,to:a,amount:K,suggestedParams:i});l.fee=l.fee*2,g.push({tx:l});const f=t.makeApplicationOptInTxnFromObject({from:a,appIndex:t.safeBigIntToNumber(r),rekeyTo:d,suggestedParams:i});return f.fee=0,g.push({tx:f,signer:{address:s.address(),signTxn:y=>Promise.resolve(t.signLogicSigTransaction(y,s).blob)}}),{accounts:[a],txs:g}}static async submitVAAHeader(e,n,r,s,i,d){d=d??await e.getTransactionParams().do();let a=[];const g=u.forMessageId(r,{chain:s.emitterChain,sequence:s.sequence,emitter:s.emitterAddress}),{accounts:l,txs:f}=await c.maybeCreateStorageTx(e,i,r,g,d);a.push(...f);const y=u.forGuardianSet(n,s.guardianSet),{accounts:[b],txs:T}=await c.maybeCreateStorageTx(e,i,n,y,d);a.push(...T);let x=[...l,b];const B=await u.decodeLocalState(e,n,b),h=t.keccak_256(s.hash),_=s.signatures.length,w=Math.ceil(_/c.MAX_SIGS_PER_TXN),k=20,C=new t.LogicSigAccount(c.ALGO_VERIFY);for(let M=0;M<w;M++){const v=M*c.MAX_SIGS_PER_TXN,S=s.signatures.slice(v,v+c.MAX_SIGS_PER_TXN),F=S.length*k,G=new Uint8Array(F);for(let A=0;A<S.length;A++){const P=S[A],Y=B.slice(P.guardianIndex*k+1,(P.guardianIndex+1)*k+1);G.set(Y,A*20)}const X=t.makeApplicationCallTxnFromObject({appArgs:[c.verifySigs,t.bytes.concat(...S.map(A=>t.bytes.concat(new Uint8Array([A.guardianIndex]),A.signature.encode()))),G,h],accounts:x,appIndex:t.safeBigIntToNumber(n),from:c.ALGO_VERIFY_HASH,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:d});X.fee=0,a.push({tx:X,signer:{address:C.address(),signTxn:A=>Promise.resolve(t.signLogicSigTransaction(A,C).blob)}})}const E=t.makeApplicationCallTxnFromObject({appArgs:[c.verifyVaa,t.serialize(s)],accounts:x,appIndex:t.safeBigIntToNumber(n),from:i,onComplete:t.OnApplicationComplete.NoOpOC,suggestedParams:d});return E.fee=E.fee*(2+w),a.push({tx:E}),{accounts:x,txs:a}}createUnsignedTx(e,n,r=!0){return new j(e,this.network,this.chain,n,r)}};p(c,"MAX_SIGS_PER_TXN",6),p(c,"ALGO_VERIFY_HASH","EZATROXX2HISIRZDRGXW4LRQ46Z6IUJYYIHU3PJGP7P5IQDPKVX42N767A"),p(c,"ALGO_VERIFY",new Uint8Array([6,32,4,1,0,32,20,38,1,0,49,32,50,3,18,68,49,1,35,18,68,49,16,129,6,18,68,54,26,1,54,26,3,54,26,2,136,0,3,68,34,67,53,2,53,1,53,0,40,53,240,40,53,241,52,0,21,53,5,35,53,3,35,53,4,52,3,52,5,12,65,0,68,52,1,52,0,52,3,129,65,8,34,88,23,52,0,52,3,34,8,36,88,52,0,52,3,129,33,8,36,88,7,0,53,241,53,240,52,2,52,4,37,88,52,240,52,241,80,2,87,12,20,18,68,52,3,129,66,8,53,3,52,4,37,8,53,4,66,255,180,34,137])),p(c,"feeKey",t.b64.encode("MessageFee")),p(c,"verifyVaa",t.bytes.encode("verifyVAA")),p(c,"verifySigs",t.bytes.encode("verifySigs")),p(c,"publishMessage",t.bytes.encode("publishMessage"));let I=c;t.registerProtocol("Algorand","WormholeCore",I);const z=Object.freeze(Object.defineProperty({__proto__:null,AlgorandWormholeCore:I,BITS_PER_BYTE:L,BITS_PER_KEY:R,MAX_BITS:N,MAX_BYTES:V,MAX_BYTES_PER_KEY:U,MAX_KEYS:O,SEED_AMT:K,StorageLogicSig:u,varint:m},Symbol.toStringTag,{value:"Module"}));exports.AlgorandUnsignedTransaction=j;exports.AlgorandWormholeCore=I;exports.StorageLogicSig=u;exports.index=z;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a8 as td, h as H, a2 as th,
|
|
1
|
+
import { a8 as td, h as H, a2 as th, an as rd, ak as rh, b1 as id, b5 as nd } from "./index-Dc5wV51P.mjs";
|
|
2
2
|
import { d as sd } from "./dijkstra-BZM-8g-B.mjs";
|
|
3
|
-
import { e as cr, a as ih } from "./events-
|
|
4
|
-
import { c as U, s as zn, x as nh, r as Kn, H as od, a as sh, q as Nn } from "./index-
|
|
5
|
-
import { r as ad, a as Hr, g as Wr, i as Ot, b as jn, I as Xr, f as Nt, t as gt, c as ms, x as Ws, C as cd, d as hd, E as ht, y as _t, k as mo, A as ld, h as ud, e as ea, j as dd, s as fd, q as oh, l as pd, m as yo, n as vo, o as ah, p as Zt, u as si } from "./index-
|
|
3
|
+
import { e as cr, a as ih } from "./events-DuoZYNKO.mjs";
|
|
4
|
+
import { c as U, s as zn, x as nh, r as Kn, H as od, a as sh, q as Nn } from "./index-CJEjOaWr.mjs";
|
|
5
|
+
import { r as ad, a as Hr, g as Wr, i as Ot, b as jn, I as Xr, f as Nt, t as gt, c as ms, x as Ws, C as cd, d as hd, E as ht, y as _t, k as mo, A as ld, h as ud, e as ea, j as dd, s as fd, q as oh, l as pd, m as yo, n as vo, o as ah, p as Zt, u as si } from "./index-BJuAlURA.mjs";
|
|
6
6
|
let gd = class extends ad {
|
|
7
7
|
constructor(e) {
|
|
8
8
|
super(e), this.events = new cr.EventEmitter(), this.hasRegisteredEventListeners = !1, this.connection = this.setConnection(e), this.connection.connected && this.registerEventListeners();
|