@wormhole-foundation/wormhole-connect 1.1.8 → 1.1.9-beta.0-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/{algorand-Bg-MfjsH.js → algorand-vDDEz6KP.js} +2 -2
- package/dist/assets/{ccip-atE20ZEL.js → ccip-B1JPJPOY.js} +1 -1
- package/dist/assets/{cosmwasm-xANzAboS.js → cosmwasm-DP4CIVSM.js} +2 -2
- package/dist/assets/{evm-B20gvxWA.js → evm-BB3755Wr.js} +1 -1
- package/dist/assets/{evm-DiRlPnyB.js → evm-FvO3h1wl.js} +4 -4
- package/dist/assets/{index-C6qclzFA.js → index-B1mp7Z63.js} +1 -1
- package/dist/assets/{index-eLk_b8u9.js → index-BU0ECMia.js} +1 -1
- package/dist/assets/{index-DyD6kblh.js → index-BbJVBTsE.js} +1 -1
- package/dist/assets/{index-BYxgRLLh.js → index-BhEp9mlK.js} +1 -1
- package/dist/assets/{index-D3WFv54i.js → index-Bvun80fl.js} +1 -1
- package/dist/assets/{index-jD6ZZ5Tu.js → index-Bz-32kSJ.js} +1 -1
- package/dist/assets/{index-CLcPjTbq.js → index-CVb8oZT5.js} +2 -2
- package/dist/assets/index-DP2zLB5d.js +5 -0
- package/dist/assets/index-Dp6gvGvL.js +2 -0
- package/dist/assets/{index-CxijOPcm.js → index-re-SltAL.js} +1 -1
- package/dist/assets/{index-DOuohql9.js → index-tGkAuFX0.js} +1 -1
- package/dist/assets/{index.es-BxGbRBbk.js → index.es-D8YphuI4.js} +2 -2
- package/dist/assets/{solana-DOaiyZir.js → solana-Bc-ePjuF.js} +1 -1
- package/dist/assets/{sui-mXOoFb4M.js → sui-DVNpNCUB.js} +4 -4
- package/dist/assets/{unsignedTransaction-0WUum9tP.js → unsignedTransaction-CPy_oMd2.js} +1 -1
- package/dist/assets/unsignedTransaction-arVvzoJx.js +1 -0
- package/dist/main.js +58 -58
- package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
- package/dist/src/config/testnet/tokens.d.ts.map +1 -1
- package/dist/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
- package/dist/src/icons/Chains/WORLD.d.ts.map +1 -1
- package/dist/src/icons/TokenIcons.d.ts.map +1 -1
- package/dist/src/icons/Tokens/WORLD.d.ts +4 -0
- package/dist/src/icons/Tokens/WORLD.d.ts.map +1 -0
- package/dist/src/utils/sdkv2.d.ts.map +1 -1
- package/lib/{algorand-DUcbNcTT.mjs → algorand-CprzAHj4.mjs} +3 -3
- package/lib/{algorand-BvtlkYvW.js → algorand-D2kn_YCP.js} +1 -1
- package/lib/{aptos-B4rlOyU6.mjs → aptos-Cbdd7TGX.mjs} +3 -3
- package/lib/{aptos-BhgRAjHC.js → aptos-CooxpMkq.js} +2 -2
- package/lib/{aptos-nQowjIcb.mjs → aptos-CxfujMIg.mjs} +1 -1
- package/lib/{aptos-DhzeFi4o.js → aptos-D4EZf1pL.js} +1 -1
- package/lib/{ccip-jzRXPLFO.mjs → ccip-B7sQsroM.mjs} +1 -1
- package/lib/{ccip-BGUsNrsA.js → ccip-l4G3agzc.js} +1 -1
- package/lib/{cosmwasm-CGeqw6cI.js → cosmwasm-CzoZmAov.js} +2 -2
- package/lib/{cosmwasm-DrywDSkp.mjs → cosmwasm-r9Dcfq2_.mjs} +6 -6
- package/lib/{events-DuoZYNKO.mjs → events-BD3jHr55.mjs} +1 -1
- package/lib/{events-COjha8bx.js → events-DPG_k7aT.js} +1 -1
- package/lib/{evm-BBDClE2g.js → evm-CWPWco3x.js} +4 -4
- package/lib/{evm-BuIItcEA.mjs → evm-CqZH4qDI.mjs} +12 -12
- package/lib/{evm-CYnUn08H.js → evm-DA0UVqiZ.js} +1 -1
- package/lib/{evm-CEj34i-Y.mjs → evm-MLYkwdYo.mjs} +7 -7
- package/lib/{index-CdExxm-8.mjs → index-1P7DtP2r.mjs} +2 -2
- package/lib/{index-CJEjOaWr.mjs → index-5sE8OCOP.mjs} +1 -1
- package/lib/{index-NNKFqYq6.js → index-B2ALlGbm.js} +1 -1
- package/lib/{index-BJvQdk3o.js → index-B72tCThM.js} +7 -7
- package/lib/{index-CWM3H2LC.js → index-B9-xYyXd.js} +1 -1
- package/lib/{index-Bbhbkgfa.mjs → index-B9mhdAdq.mjs} +2 -2
- package/lib/{index-D9h0sJ3x.mjs → index-BA3kjRAK.mjs} +1 -1
- package/lib/{index-BIVNmWjC.js → index-BKK6e2Zn.js} +1 -1
- package/lib/{index-CRv6XxH6.mjs → index-BYIBymjK.mjs} +2 -2
- package/lib/{index-Cyjyg63s.js → index-BbDtFGWT.js} +1 -1
- package/lib/{index-DKptU_Hc.mjs → index-Bp9D0p75.mjs} +4 -4
- package/lib/{index-uAstvLd8.mjs → index-Bt79Gcg4.mjs} +2 -2
- package/lib/{index-Dc5wV51P.mjs → index-BwifXygO.mjs} +218 -125
- package/lib/{index-B6AFQ_fB.js → index-C-_dVgsh.js} +1 -1
- package/lib/{index-Bh9u5bZu.mjs → index-C41sqz-E.mjs} +2 -2
- package/lib/{index-B2JFHCjY.js → index-CGpV5u19.js} +1 -1
- package/lib/{index-BTncL8og.js → index-CRM9RIQm.js} +1 -1
- package/lib/{index-B-LwhonE.js → index-CT6UJ_EL.js} +1 -1
- package/lib/{index-CTHiXye2.js → index-CWJxT6vs.js} +1 -1
- package/lib/{index-Ds_oSleh.js → index-CgdZLNBr.js} +1 -1
- package/lib/{index-CjexIr7B.mjs → index-Ch4JHScc.mjs} +2 -2
- package/lib/{index-BJuAlURA.mjs → index-CjBfG1PD.mjs} +3 -3
- package/lib/index-CuMsUIvK.js +5 -0
- package/lib/{index-Cdpg2Kj3.mjs → index-CzSNeEZ7.mjs} +2 -2
- package/lib/{index-BXkKxPSN.mjs → index-D0i-3BNU.mjs} +2 -2
- package/lib/{index-a5wU3oUB.js → index-D2NQOwWl.js} +1 -1
- package/lib/{index-vjvft509.js → index-D6IvMYTY.js} +1 -1
- package/lib/{index-CXIAreWV.js → index-D6_pFYbp.js} +1 -1
- package/lib/{index-BISC0EuN.mjs → index-D7o-xpfy.mjs} +2 -2
- package/lib/index-DG-zySXj.js +1 -0
- package/lib/index-DPkB79ju.mjs +3816 -0
- package/lib/{index-DcurocLc.mjs → index-DTDgv8BR.mjs} +2 -2
- package/lib/{index-DdeuHj0J.mjs → index-D_HXrfx2.mjs} +1 -1
- package/lib/{index-qoWS15WJ.mjs → index-DfZldCn-.mjs} +4 -4
- package/lib/{index-D9fbH3oE.mjs → index-Dfq8cOSZ.mjs} +11 -11
- package/lib/{index-A72nDBhY.mjs → index-DgCVdoY_.mjs} +1 -1
- package/lib/{index-BuGRcK_Q.js → index-DsaeOVzT.js} +1 -1
- package/lib/{index-8IabBseN.js → index-DtJmfQmV.js} +1 -1
- package/lib/{index-D5tJ7kz1.js → index-HoGFMJt0.js} +1 -1
- package/lib/{index-BeJsTgpu.mjs → index-JEf11FIl.mjs} +4 -4
- package/lib/{index-D7uCV0-2.mjs → index-LhBPWv5M.mjs} +140 -149
- package/lib/{index-DlnKgVH2.js → index-LnwD-DoX.js} +1 -1
- package/lib/{index-HLOU4jOA.mjs → index-QA9dpScn.mjs} +2 -2
- package/lib/{index-Bi4OJr6O.js → index-ZlQhJUEX.js} +1 -1
- package/lib/index-qXJjecnK.js +5 -0
- package/lib/{index-DEi8dfu-.js → index-ruz_whBI.js} +1 -1
- package/lib/{index.es-tj48a6VI.mjs → index.es-DpTW5wIE.mjs} +5 -5
- package/lib/{index.es-ex5QzFoQ.js → index.es-Pku98btF.js} +2 -2
- package/lib/index.js +1 -1
- package/lib/index.mjs +2 -2
- package/lib/{keccak-CVFfUSfU.mjs → keccak-DWESGy_C.mjs} +1 -1
- package/lib/{keccak-CzODwJ6V.js → keccak-Rx7RS8L6.js} +1 -1
- package/lib/{pbkdf2-DLmVRSHA.js → pbkdf2-6hG-XBJs.js} +1 -1
- package/lib/{pbkdf2-GUTNazYD.mjs → pbkdf2-BVpVer9L.mjs} +1 -1
- package/lib/{signer-rbcgQjZj.js → signer-DhWIDOWp.js} +1 -1
- package/lib/{signer-Cqs1I7RB.mjs → signer-Dz4VN8ZI.mjs} +1 -1
- package/lib/solana-B6zAgqCg.mjs +16 -0
- package/lib/{solana-DoqT3pca.js → solana-BWM14UIk.js} +1 -1
- package/lib/solana-CKkJ-kf3.js +1 -0
- package/lib/{solana-7ZFkKRtX.mjs → solana-Dvddqnn3.mjs} +4 -4
- package/lib/{solanaEmbed.esm-Bkti_f5v.js → solanaEmbed.esm-Ghqj1fn8.js} +1 -1
- package/lib/{solanaEmbed.esm-LdO_IpPZ.mjs → solanaEmbed.esm-qmqvaX26.mjs} +3 -3
- package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
- package/lib/src/config/testnet/tokens.d.ts.map +1 -1
- package/lib/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
- package/lib/src/icons/Chains/WORLD.d.ts.map +1 -1
- package/lib/src/icons/TokenIcons.d.ts.map +1 -1
- package/lib/src/icons/Tokens/WORLD.d.ts +4 -0
- package/lib/src/icons/Tokens/WORLD.d.ts.map +1 -0
- package/lib/src/utils/sdkv2.d.ts.map +1 -1
- package/lib/{sui-DfRirJoo.js → sui-BAoaV0fk.js} +1 -1
- package/lib/{sui-Df7REI6I.js → sui-COMAcPz7.js} +2 -2
- package/lib/{sui-Ch7mNd_P.mjs → sui-DKW6LQmE.mjs} +74 -75
- package/lib/{sui-BffnXOND.mjs → sui-DWDf6r1T.mjs} +1 -1
- package/lib/{unsignedTransaction-CvjJdjtG.js → unsignedTransaction-B9dxNqAu.js} +1 -1
- package/lib/unsignedTransaction-BD81leu1.mjs +16 -0
- package/lib/unsignedTransaction-DzSLsK-p.js +1 -0
- package/lib/{unsignedTransaction-CsCwFMvo.mjs → unsignedTransaction-T9pxJxVn.mjs} +4 -4
- package/package.json +17 -17
- package/dist/assets/index-CKe5Sopa.js +0 -2
- package/dist/src/utils/repairVaa.d.ts +0 -4
- package/dist/src/utils/repairVaa.d.ts.map +0 -1
- package/lib/index-BsHKXTKU.js +0 -1
- package/lib/index-DgbQ-dwi.js +0 -5
- package/lib/solana-BYPpXpJs.js +0 -1
- package/lib/solana-CcjhlsWI.mjs +0 -16
- package/lib/src/utils/repairVaa.d.ts +0 -4
- package/lib/src/utils/repairVaa.d.ts.map +0 -1
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
var Zr = Object.defineProperty;
|
|
2
2
|
var Qr = (t, e, r) => e in t ? Zr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
-
var
|
|
4
|
-
import { ak as Yr, F as en, cH as ft, L as tn, cI as hr, cJ as ke, ax as rn, bZ as nt, bC as nn, b_ as nr, ag as ce, Q as ge, p as oe, bz as sn, c3 as ir, c0 as an, cK as on, bD as ht, N as cn, u as De, ad as un, ce as sr, cL as dn, O as ar, bI as gr } from "./index-
|
|
5
|
-
import { g as tt, a as gt, i as
|
|
6
|
-
import "./index-
|
|
7
|
-
|
|
8
|
-
constructor(e, r, n, i, s = !1) {
|
|
9
|
-
C(this, "transaction");
|
|
10
|
-
C(this, "network");
|
|
11
|
-
C(this, "chain");
|
|
12
|
-
C(this, "description");
|
|
13
|
-
C(this, "parallelizable");
|
|
14
|
-
this.transaction = e, this.network = r, this.chain = n, this.description = i, this.parallelizable = s;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
3
|
+
var M = (t, e, r) => Qr(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { ak as Yr, F as en, cH as ft, L as tn, cI as hr, cJ as ke, ax as rn, bZ as nt, bC as nn, b_ as nr, ag as ce, Q as ge, p as oe, bz as sn, c3 as ir, c0 as an, cK as on, bD as ht, N as cn, u as De, ad as un, ce as sr, cL as dn, O as ar, bI as gr } from "./index-BwifXygO.mjs";
|
|
5
|
+
import { g as tt, a as gt, i as Ve, S as Y, b as H, p as ln, c as fn, d as it, u as ze, e as pr, f as hn, h as He, j as gn, k as pn } from "./sui-DKW6LQmE.mjs";
|
|
6
|
+
import "./index-DTDgv8BR.mjs";
|
|
7
|
+
import { S as yr } from "./unsignedTransaction-BD81leu1.mjs";
|
|
17
8
|
class yn extends TypeError {
|
|
18
9
|
constructor(e, r) {
|
|
19
10
|
let n;
|
|
@@ -299,7 +290,7 @@ function Tn(t) {
|
|
|
299
290
|
}
|
|
300
291
|
});
|
|
301
292
|
}
|
|
302
|
-
function
|
|
293
|
+
function C(t) {
|
|
303
294
|
const e = t.map((r) => r.type).join(" | ");
|
|
304
295
|
return new te({
|
|
305
296
|
type: "union",
|
|
@@ -332,7 +323,7 @@ function $(t) {
|
|
|
332
323
|
function Tr() {
|
|
333
324
|
return G("unknown", () => !0);
|
|
334
325
|
}
|
|
335
|
-
const kt =
|
|
326
|
+
const kt = C([
|
|
336
327
|
p({
|
|
337
328
|
AddressOwner: h()
|
|
338
329
|
}),
|
|
@@ -347,7 +338,7 @@ const kt = $([
|
|
|
347
338
|
T("Immutable")
|
|
348
339
|
]);
|
|
349
340
|
G("SuiJsonValue", () => !0);
|
|
350
|
-
const vn =
|
|
341
|
+
const vn = C([
|
|
351
342
|
p({ u32: h() }),
|
|
352
343
|
p({ u64: h() }),
|
|
353
344
|
p({ f64: h() })
|
|
@@ -359,14 +350,14 @@ p({
|
|
|
359
350
|
minSupportedProtocolVersion: h(),
|
|
360
351
|
protocolVersion: h()
|
|
361
352
|
});
|
|
362
|
-
|
|
353
|
+
C([h(), T("package")]);
|
|
363
354
|
const de = p({
|
|
364
355
|
/** Base64 string representing the object digest */
|
|
365
356
|
digest: h(),
|
|
366
357
|
/** Hex code as string representing the object id */
|
|
367
358
|
objectId: h(),
|
|
368
359
|
/** Object version */
|
|
369
|
-
version:
|
|
360
|
+
version: C([ye(), h(), Sn()])
|
|
370
361
|
});
|
|
371
362
|
p({
|
|
372
363
|
owner: kt,
|
|
@@ -399,7 +390,7 @@ const kn = Ae(
|
|
|
399
390
|
}), On = p({
|
|
400
391
|
/** A mapping from module name to disassembled Move bytecode */
|
|
401
392
|
disassembled: jn
|
|
402
|
-
}), An =
|
|
393
|
+
}), An = C([
|
|
403
394
|
Ae(En, p({ dataType: T("moveObject") })),
|
|
404
395
|
Ae(On, p({ dataType: T("package") }))
|
|
405
396
|
]), _n = p({
|
|
@@ -412,7 +403,7 @@ const kn = Ae(
|
|
|
412
403
|
id: h(),
|
|
413
404
|
/** A mapping from module name to Move bytecode enocded in base64*/
|
|
414
405
|
moduleMap: Q(h(), h())
|
|
415
|
-
}), Bn =
|
|
406
|
+
}), Bn = C([
|
|
416
407
|
Ae(_n, p({ dataType: T("moveObject") })),
|
|
417
408
|
Ae(xn, p({ dataType: T("package") }))
|
|
418
409
|
]);
|
|
@@ -427,7 +418,7 @@ const vr = p({
|
|
|
427
418
|
}), Cn = p({
|
|
428
419
|
data: B(S(Q(h(), h()))),
|
|
429
420
|
error: B(S(vr))
|
|
430
|
-
}), $n =
|
|
421
|
+
}), $n = C([
|
|
431
422
|
Cn,
|
|
432
423
|
S(Q(h(), h()))
|
|
433
424
|
]), kr = p({
|
|
@@ -485,7 +476,7 @@ p({
|
|
|
485
476
|
/* Whether to fetch the display metadata, default to be false */
|
|
486
477
|
showDisplay: B(S(D()))
|
|
487
478
|
});
|
|
488
|
-
|
|
479
|
+
C([T("Exists"), T("notExists"), T("Deleted")]);
|
|
489
480
|
I(kn);
|
|
490
481
|
const Un = p({
|
|
491
482
|
data: B(S(kr)),
|
|
@@ -523,7 +514,7 @@ p({
|
|
|
523
514
|
nextCursor: S(B(h())),
|
|
524
515
|
hasNextPage: D()
|
|
525
516
|
});
|
|
526
|
-
|
|
517
|
+
C([
|
|
527
518
|
p({
|
|
528
519
|
details: kr,
|
|
529
520
|
status: T("VersionFound")
|
|
@@ -549,17 +540,17 @@ $([
|
|
|
549
540
|
status: T("VersionTooHigh")
|
|
550
541
|
})
|
|
551
542
|
]);
|
|
552
|
-
const Mn =
|
|
543
|
+
const Mn = C([h(), p({ Object: h() })]);
|
|
553
544
|
I(Mn);
|
|
554
545
|
const Nn = p({
|
|
555
546
|
address: h(),
|
|
556
547
|
name: h()
|
|
557
|
-
}), Dn =
|
|
548
|
+
}), Dn = C([T("Private"), T("Public"), T("Friend")]), It = p({
|
|
558
549
|
abilities: I(h())
|
|
559
|
-
}),
|
|
550
|
+
}), Vn = p({
|
|
560
551
|
constraints: It,
|
|
561
552
|
isPhantom: D()
|
|
562
|
-
}),
|
|
553
|
+
}), zn = p({
|
|
563
554
|
TypeParameter: ye()
|
|
564
555
|
}), st = Sr([
|
|
565
556
|
p({
|
|
@@ -577,7 +568,7 @@ p({
|
|
|
577
568
|
function Ir(t) {
|
|
578
569
|
if (!t)
|
|
579
570
|
return !1;
|
|
580
|
-
if (typeof t == "string" || F(t,
|
|
571
|
+
if (typeof t == "string" || F(t, zn) || jr(t))
|
|
581
572
|
return !0;
|
|
582
573
|
if (typeof t != "object")
|
|
583
574
|
return !1;
|
|
@@ -612,7 +603,7 @@ const Fn = p({
|
|
|
612
603
|
type: Se
|
|
613
604
|
}), Ln = p({
|
|
614
605
|
abilities: It,
|
|
615
|
-
typeParameters: I(
|
|
606
|
+
typeParameters: I(Vn),
|
|
616
607
|
fields: I(Gn)
|
|
617
608
|
}), Wn = p({
|
|
618
609
|
fileFormatVersion: ye(),
|
|
@@ -657,17 +648,17 @@ function Kn(t) {
|
|
|
657
648
|
return "";
|
|
658
649
|
for (var w = 0, b = 0, f = 0, j = y.length; f !== j && y[f] === 0; )
|
|
659
650
|
f++, w++;
|
|
660
|
-
for (var _ = (j - f) * d + 1 >>> 0,
|
|
661
|
-
for (var E = y[f], k = 0,
|
|
662
|
-
E += 256 * U
|
|
651
|
+
for (var _ = (j - f) * d + 1 >>> 0, $ = new Uint8Array(_); f !== j; ) {
|
|
652
|
+
for (var E = y[f], k = 0, U = _ - 1; (E !== 0 || k < b) && U !== -1; U--, k++)
|
|
653
|
+
E += 256 * $[U] >>> 0, $[U] = E % c >>> 0, E = E / c >>> 0;
|
|
663
654
|
if (E !== 0)
|
|
664
655
|
throw new Error("Non-zero carry");
|
|
665
656
|
b = k, f++;
|
|
666
657
|
}
|
|
667
|
-
for (var K = _ - b; K !== _ &&
|
|
658
|
+
for (var K = _ - b; K !== _ && $[K] === 0; )
|
|
668
659
|
K++;
|
|
669
660
|
for (var we = a.repeat(w); K < _; ++K)
|
|
670
|
-
we += t.charAt(
|
|
661
|
+
we += t.charAt($[K]);
|
|
671
662
|
return we;
|
|
672
663
|
}
|
|
673
664
|
function g(y) {
|
|
@@ -678,19 +669,19 @@ function Kn(t) {
|
|
|
678
669
|
for (var w = 0, b = 0, f = 0; y[w] === a; )
|
|
679
670
|
b++, w++;
|
|
680
671
|
for (var j = (y.length - w) * o + 1 >>> 0, _ = new Uint8Array(j); y[w]; ) {
|
|
681
|
-
var
|
|
682
|
-
if (
|
|
672
|
+
var $ = e[y.charCodeAt(w)];
|
|
673
|
+
if ($ === 255)
|
|
683
674
|
return;
|
|
684
|
-
for (var E = 0, k = j - 1; (
|
|
685
|
-
|
|
686
|
-
if (
|
|
675
|
+
for (var E = 0, k = j - 1; ($ !== 0 || E < f) && k !== -1; k--, E++)
|
|
676
|
+
$ += c * _[k] >>> 0, _[k] = $ % 256 >>> 0, $ = $ / 256 >>> 0;
|
|
677
|
+
if ($ !== 0)
|
|
687
678
|
throw new Error("Non-zero carry");
|
|
688
679
|
f = E, w++;
|
|
689
680
|
}
|
|
690
|
-
for (var
|
|
691
|
-
|
|
692
|
-
for (var K = new Uint8Array(b + (j -
|
|
693
|
-
K[we++] = _[
|
|
681
|
+
for (var U = j - f; U !== j && _[U] === 0; )
|
|
682
|
+
U++;
|
|
683
|
+
for (var K = new Uint8Array(b + (j - U)), we = b; U !== j; )
|
|
684
|
+
K[we++] = _[U++];
|
|
694
685
|
return K;
|
|
695
686
|
}
|
|
696
687
|
function m(y) {
|
|
@@ -2561,7 +2552,7 @@ const Z = l.bytes(xt).transform({
|
|
|
2561
2552
|
address: null,
|
|
2562
2553
|
signer: null,
|
|
2563
2554
|
vector: l.lazy(() => ve),
|
|
2564
|
-
struct: l.lazy(() =>
|
|
2555
|
+
struct: l.lazy(() => zt),
|
|
2565
2556
|
u16: null,
|
|
2566
2557
|
u32: null,
|
|
2567
2558
|
u256: null
|
|
@@ -2653,10 +2644,10 @@ const Z = l.bytes(xt).transform({
|
|
|
2653
2644
|
ChangeEpoch: null,
|
|
2654
2645
|
Genesis: null,
|
|
2655
2646
|
ConsensusCommitPrologue: null
|
|
2656
|
-
}),
|
|
2647
|
+
}), Vt = l.enum("TransactionExpiration", {
|
|
2657
2648
|
None: null,
|
|
2658
2649
|
Epoch: Rr()
|
|
2659
|
-
}),
|
|
2650
|
+
}), zt = l.struct("StructTag", {
|
|
2660
2651
|
address: Z,
|
|
2661
2652
|
module: l.string(),
|
|
2662
2653
|
name: l.string(),
|
|
@@ -2670,7 +2661,7 @@ const Z = l.bytes(xt).transform({
|
|
|
2670
2661
|
kind: Dt,
|
|
2671
2662
|
sender: Z,
|
|
2672
2663
|
gasData: Ft,
|
|
2673
|
-
expiration:
|
|
2664
|
+
expiration: Vt
|
|
2674
2665
|
}), Lt = l.enum("TransactionData", {
|
|
2675
2666
|
V1: Gt
|
|
2676
2667
|
}), Ai = l.enum("IntentScope", {
|
|
@@ -2720,7 +2711,7 @@ const Z = l.bytes(xt).transform({
|
|
|
2720
2711
|
txSignatures: l.vector($i)
|
|
2721
2712
|
}), Nr = l.vector(Mr, {
|
|
2722
2713
|
name: "SenderSignedData"
|
|
2723
|
-
}),
|
|
2714
|
+
}), R = {
|
|
2724
2715
|
...l,
|
|
2725
2716
|
U8: l.u8(),
|
|
2726
2717
|
U16: l.u16(),
|
|
@@ -2747,12 +2738,12 @@ const Z = l.bytes(xt).transform({
|
|
|
2747
2738
|
SenderSignedData: Nr,
|
|
2748
2739
|
SenderSignedTransaction: Mr,
|
|
2749
2740
|
SharedObjectRef: Ut,
|
|
2750
|
-
StructTag:
|
|
2741
|
+
StructTag: zt,
|
|
2751
2742
|
SuiObjectRef: _e,
|
|
2752
2743
|
Transaction: Mt,
|
|
2753
2744
|
TransactionData: Lt,
|
|
2754
2745
|
TransactionDataV1: Gt,
|
|
2755
|
-
TransactionExpiration:
|
|
2746
|
+
TransactionExpiration: Vt,
|
|
2756
2747
|
TransactionKind: Dt,
|
|
2757
2748
|
TypeTag: ve,
|
|
2758
2749
|
// preserve backwards compatibility with old bcs export
|
|
@@ -2788,39 +2779,39 @@ A.registerBcsType("enumKind", (t) => Ct(t));
|
|
|
2788
2779
|
Kt,
|
|
2789
2780
|
Nr,
|
|
2790
2781
|
Ut,
|
|
2791
|
-
|
|
2782
|
+
zt,
|
|
2792
2783
|
_e,
|
|
2793
2784
|
Mt,
|
|
2794
2785
|
Lt,
|
|
2795
2786
|
Gt,
|
|
2796
|
-
|
|
2787
|
+
Vt,
|
|
2797
2788
|
Dt,
|
|
2798
2789
|
ve
|
|
2799
2790
|
].forEach((t) => {
|
|
2800
2791
|
A.registerBcsType(t.name, () => t);
|
|
2801
2792
|
});
|
|
2802
|
-
const Ui =
|
|
2793
|
+
const Ui = C([
|
|
2803
2794
|
p({ ImmOrOwned: de }),
|
|
2804
2795
|
p({
|
|
2805
2796
|
Shared: p({
|
|
2806
2797
|
objectId: h(),
|
|
2807
|
-
initialSharedVersion:
|
|
2798
|
+
initialSharedVersion: C([ee(), h()]),
|
|
2808
2799
|
mutable: D()
|
|
2809
2800
|
})
|
|
2810
2801
|
}),
|
|
2811
2802
|
p({ Receiving: de })
|
|
2812
|
-
]), Ye = p({ Pure: I(ee()) }), bt = p({ Object: Ui }), et =
|
|
2803
|
+
]), Ye = p({ Pure: I(ee()) }), bt = p({ Object: Ui }), et = C([Ye, bt]);
|
|
2813
2804
|
function Ri(t, e) {
|
|
2814
2805
|
return {
|
|
2815
2806
|
Pure: Array.from(
|
|
2816
2807
|
t instanceof Uint8Array ? t : _t(t) ? t.toBytes() : (
|
|
2817
2808
|
// NOTE: We explicitly set this to be growable to infinity, because we have maxSize validation at the builder-level:
|
|
2818
|
-
|
|
2809
|
+
R.ser(e, t, { maxSize: 1 / 0 }).toBytes()
|
|
2819
2810
|
)
|
|
2820
2811
|
)
|
|
2821
2812
|
};
|
|
2822
2813
|
}
|
|
2823
|
-
const
|
|
2814
|
+
const z = {
|
|
2824
2815
|
Pure: Ri,
|
|
2825
2816
|
ObjectRef({ objectId: t, digest: e, version: r }) {
|
|
2826
2817
|
return {
|
|
@@ -2866,10 +2857,10 @@ function Mi(t) {
|
|
|
2866
2857
|
var e;
|
|
2867
2858
|
return ((e = Pi(t)) == null ? void 0 : e.mutable) ?? !1;
|
|
2868
2859
|
}
|
|
2869
|
-
function
|
|
2860
|
+
function V(t, e) {
|
|
2870
2861
|
return mr(t, e);
|
|
2871
2862
|
}
|
|
2872
|
-
const Ni = (t) =>
|
|
2863
|
+
const Ni = (t) => C([p({ None: C([T(!0), T(null)]) }), p({ Some: t })]), xe = C([
|
|
2873
2864
|
p({
|
|
2874
2865
|
kind: T("Input"),
|
|
2875
2866
|
index: ee(),
|
|
@@ -2891,16 +2882,16 @@ const Ni = (t) => $([p({ None: $([T(!0), T(null)]) }), p({ Some: t })]), xe = $(
|
|
|
2891
2882
|
index: ee(),
|
|
2892
2883
|
resultIndex: ee()
|
|
2893
2884
|
})
|
|
2894
|
-
], se =
|
|
2885
|
+
], se = C([...Di]), Dr = p({
|
|
2895
2886
|
kind: T("MoveCall"),
|
|
2896
2887
|
target: G("target", h().validator),
|
|
2897
2888
|
typeArguments: I(h()),
|
|
2898
2889
|
arguments: I(se)
|
|
2899
|
-
}),
|
|
2890
|
+
}), Vr = p({
|
|
2900
2891
|
kind: T("TransferObjects"),
|
|
2901
2892
|
objects: I(se),
|
|
2902
2893
|
address: se
|
|
2903
|
-
}),
|
|
2894
|
+
}), zr = p({
|
|
2904
2895
|
kind: T("SplitCoins"),
|
|
2905
2896
|
coin: se,
|
|
2906
2897
|
amounts: I(se)
|
|
@@ -2925,17 +2916,17 @@ const Ni = (t) => $([p({ None: $([T(!0), T(null)]) }), p({ Some: t })]), xe = $(
|
|
|
2925
2916
|
dependencies: I(h()),
|
|
2926
2917
|
packageId: h(),
|
|
2927
2918
|
ticket: se
|
|
2928
|
-
}),
|
|
2919
|
+
}), Vi = [
|
|
2929
2920
|
Dr,
|
|
2930
|
-
zr,
|
|
2931
2921
|
Vr,
|
|
2922
|
+
zr,
|
|
2932
2923
|
Fr,
|
|
2933
2924
|
Lr,
|
|
2934
2925
|
Wr,
|
|
2935
2926
|
Gr
|
|
2936
|
-
],
|
|
2927
|
+
], zi = C([...Vi]), he = {
|
|
2937
2928
|
MoveCall(t) {
|
|
2938
|
-
return
|
|
2929
|
+
return V(
|
|
2939
2930
|
{
|
|
2940
2931
|
kind: "MoveCall",
|
|
2941
2932
|
target: t.target,
|
|
@@ -2946,28 +2937,28 @@ const Ni = (t) => $([p({ None: $([T(!0), T(null)]) }), p({ Some: t })]), xe = $(
|
|
|
2946
2937
|
);
|
|
2947
2938
|
},
|
|
2948
2939
|
TransferObjects(t, e) {
|
|
2949
|
-
return e.kind === "Input" && e.type === "pure" && typeof e.value != "object" && (e.value =
|
|
2940
|
+
return e.kind === "Input" && e.type === "pure" && typeof e.value != "object" && (e.value = z.Pure(R.Address.serialize(e.value))), V({ kind: "TransferObjects", objects: t, address: e }, Vr);
|
|
2950
2941
|
},
|
|
2951
2942
|
SplitCoins(t, e) {
|
|
2952
2943
|
return e.forEach((r) => {
|
|
2953
|
-
r.kind === "Input" && r.type === "pure" && typeof r.value != "object" && (r.value =
|
|
2954
|
-
}),
|
|
2944
|
+
r.kind === "Input" && r.type === "pure" && typeof r.value != "object" && (r.value = z.Pure(R.U64.serialize(r.value)));
|
|
2945
|
+
}), V(
|
|
2955
2946
|
{
|
|
2956
2947
|
kind: "SplitCoins",
|
|
2957
2948
|
coin: t,
|
|
2958
2949
|
amounts: e
|
|
2959
2950
|
},
|
|
2960
|
-
|
|
2951
|
+
zr
|
|
2961
2952
|
);
|
|
2962
2953
|
},
|
|
2963
2954
|
MergeCoins(t, e) {
|
|
2964
|
-
return
|
|
2955
|
+
return V({ kind: "MergeCoins", destination: t, sources: e }, Fr);
|
|
2965
2956
|
},
|
|
2966
2957
|
Publish({
|
|
2967
2958
|
modules: t,
|
|
2968
2959
|
dependencies: e
|
|
2969
2960
|
}) {
|
|
2970
|
-
return
|
|
2961
|
+
return V(
|
|
2971
2962
|
{
|
|
2972
2963
|
kind: "Publish",
|
|
2973
2964
|
modules: t.map(
|
|
@@ -2984,7 +2975,7 @@ const Ni = (t) => $([p({ None: $([T(!0), T(null)]) }), p({ Some: t })]), xe = $(
|
|
|
2984
2975
|
packageId: r,
|
|
2985
2976
|
ticket: n
|
|
2986
2977
|
}) {
|
|
2987
|
-
return
|
|
2978
|
+
return V(
|
|
2988
2979
|
{
|
|
2989
2980
|
kind: "Upgrade",
|
|
2990
2981
|
modules: t.map(
|
|
@@ -3001,7 +2992,7 @@ const Ni = (t) => $([p({ None: $([T(!0), T(null)]) }), p({ Some: t })]), xe = $(
|
|
|
3001
2992
|
type: t,
|
|
3002
2993
|
objects: e
|
|
3003
2994
|
}) {
|
|
3004
|
-
return
|
|
2995
|
+
return V(
|
|
3005
2996
|
{
|
|
3006
2997
|
kind: "MakeMoveVec",
|
|
3007
2998
|
type: t ? { Some: ne.parseFromStr(t) } : { None: null },
|
|
@@ -3015,7 +3006,7 @@ function Fi(t) {
|
|
|
3015
3006
|
function e(r, n) {
|
|
3016
3007
|
return t(r, n);
|
|
3017
3008
|
}
|
|
3018
|
-
return e.u8 = (r) => t(
|
|
3009
|
+
return e.u8 = (r) => t(R.U8.serialize(r)), e.u16 = (r) => t(R.U16.serialize(r)), e.u32 = (r) => t(R.U32.serialize(r)), e.u64 = (r) => t(R.U64.serialize(r)), e.u128 = (r) => t(R.U128.serialize(r)), e.u256 = (r) => t(R.U256.serialize(r)), e.bool = (r) => t(R.Bool.serialize(r)), e.string = (r) => t(R.String.serialize(r)), e.address = (r) => t(R.Address.serialize(r)), e.id = e.address, e;
|
|
3019
3010
|
}
|
|
3020
3011
|
function Gi(t, e) {
|
|
3021
3012
|
const r = Array.from(`${t}::`).map((i) => i.charCodeAt(0)), n = new Uint8Array(r.length + e.length);
|
|
@@ -3023,7 +3014,7 @@ function Gi(t, e) {
|
|
|
3023
3014
|
}
|
|
3024
3015
|
const Li = S(
|
|
3025
3016
|
B(
|
|
3026
|
-
|
|
3017
|
+
C([p({ Epoch: ee() }), p({ None: C([T(!0), T(null)]) })])
|
|
3027
3018
|
)
|
|
3028
3019
|
), dr = G("StringEncodedBigint", (t) => {
|
|
3029
3020
|
if (!["string", "number", "bigint"].includes(typeof t))
|
|
@@ -3044,7 +3035,7 @@ const Li = S(
|
|
|
3044
3035
|
expiration: Li,
|
|
3045
3036
|
gasConfig: Wi,
|
|
3046
3037
|
inputs: I(xe),
|
|
3047
|
-
transactions: I(
|
|
3038
|
+
transactions: I(zi)
|
|
3048
3039
|
});
|
|
3049
3040
|
function lr(t) {
|
|
3050
3041
|
return N(t).replace("0x", "");
|
|
@@ -3054,15 +3045,15 @@ class ie {
|
|
|
3054
3045
|
this.version = 1, this.sender = e == null ? void 0 : e.sender, this.expiration = e == null ? void 0 : e.expiration, this.gasConfig = (e == null ? void 0 : e.gasConfig) ?? {}, this.inputs = (e == null ? void 0 : e.inputs) ?? [], this.transactions = (e == null ? void 0 : e.transactions) ?? [];
|
|
3055
3046
|
}
|
|
3056
3047
|
static fromKindBytes(e) {
|
|
3057
|
-
const r =
|
|
3048
|
+
const r = R.TransactionKind.parse(e), n = "ProgrammableTransaction" in r ? r.ProgrammableTransaction : null;
|
|
3058
3049
|
if (!n)
|
|
3059
3050
|
throw new Error("Unable to deserialize from bytes.");
|
|
3060
|
-
const i =
|
|
3051
|
+
const i = V(
|
|
3061
3052
|
{
|
|
3062
3053
|
version: 1,
|
|
3063
3054
|
gasConfig: {},
|
|
3064
3055
|
inputs: n.inputs.map(
|
|
3065
|
-
(s, c) =>
|
|
3056
|
+
(s, c) => V(
|
|
3066
3057
|
{
|
|
3067
3058
|
kind: "Input",
|
|
3068
3059
|
value: s,
|
|
@@ -3080,17 +3071,17 @@ class ie {
|
|
|
3080
3071
|
}
|
|
3081
3072
|
static fromBytes(e) {
|
|
3082
3073
|
var c;
|
|
3083
|
-
const r =
|
|
3074
|
+
const r = R.TransactionData.parse(e), n = r == null ? void 0 : r.V1, i = "ProgrammableTransaction" in n.kind ? (c = n == null ? void 0 : n.kind) == null ? void 0 : c.ProgrammableTransaction : null;
|
|
3084
3075
|
if (!n || !i)
|
|
3085
3076
|
throw new Error("Unable to deserialize from bytes.");
|
|
3086
|
-
const s =
|
|
3077
|
+
const s = V(
|
|
3087
3078
|
{
|
|
3088
3079
|
version: 1,
|
|
3089
3080
|
sender: n.sender,
|
|
3090
3081
|
expiration: n.expiration,
|
|
3091
3082
|
gasConfig: n.gasData,
|
|
3092
3083
|
inputs: i.inputs.map(
|
|
3093
|
-
(a, o) =>
|
|
3084
|
+
(a, o) => V(
|
|
3094
3085
|
{
|
|
3095
3086
|
kind: "Input",
|
|
3096
3087
|
value: a,
|
|
@@ -3133,7 +3124,7 @@ class ie {
|
|
|
3133
3124
|
}
|
|
3134
3125
|
};
|
|
3135
3126
|
if (n)
|
|
3136
|
-
return
|
|
3127
|
+
return R.TransactionKind.serialize(s, { maxSize: e }).toBytes();
|
|
3137
3128
|
const c = (r == null ? void 0 : r.expiration) ?? this.expiration, a = (r == null ? void 0 : r.sender) ?? this.sender, o = { ...this.gasConfig, ...r == null ? void 0 : r.gasConfig };
|
|
3138
3129
|
if (!a)
|
|
3139
3130
|
throw new Error("Missing transaction sender");
|
|
@@ -3159,7 +3150,7 @@ class ie {
|
|
|
3159
3150
|
}
|
|
3160
3151
|
}
|
|
3161
3152
|
};
|
|
3162
|
-
return
|
|
3153
|
+
return R.TransactionData.serialize(
|
|
3163
3154
|
{ V1: d },
|
|
3164
3155
|
{ maxSize: e }
|
|
3165
3156
|
).toBytes();
|
|
@@ -3169,7 +3160,7 @@ class ie {
|
|
|
3169
3160
|
return ie.getDigestFromBytes(e);
|
|
3170
3161
|
}
|
|
3171
3162
|
snapshot() {
|
|
3172
|
-
return
|
|
3163
|
+
return V(this, Me);
|
|
3173
3164
|
}
|
|
3174
3165
|
}
|
|
3175
3166
|
var Xt = (t, e, r) => {
|
|
@@ -3179,7 +3170,7 @@ var Xt = (t, e, r) => {
|
|
|
3179
3170
|
if (e.has(t))
|
|
3180
3171
|
throw TypeError("Cannot add the same private member more than once");
|
|
3181
3172
|
e instanceof WeakSet ? e.add(t) : e.set(t, r);
|
|
3182
|
-
}, Ne = (t, e, r, n) => (Xt(t, e, "write to private field"), e.set(t, r), r),
|
|
3173
|
+
}, Ne = (t, e, r, n) => (Xt(t, e, "write to private field"), e.set(t, r), r), P = (t, e, r) => (Xt(t, e, "access private method"), r), v, Ee, Le, Oe, We, fe, me, qt, Kr, Zt, Jr, Qt, Hr, Yt, Xr, Ke, St;
|
|
3183
3174
|
const Ki = {
|
|
3184
3175
|
maxPureArgumentSize: 16 * 1024,
|
|
3185
3176
|
maxTxGas: 5e10,
|
|
@@ -3307,9 +3298,9 @@ const Xi = Symbol.for("@mysten/transaction"), lt = {
|
|
|
3307
3298
|
get pure() {
|
|
3308
3299
|
return Object.defineProperty(this, "pure", {
|
|
3309
3300
|
enumerable: !1,
|
|
3310
|
-
value: Fi((t, e) => _t(t) ?
|
|
3301
|
+
value: Fi((t, e) => _t(t) ? P(this, Ee, Le).call(this, "pure", {
|
|
3311
3302
|
Pure: Array.from(t.toBytes())
|
|
3312
|
-
}) :
|
|
3303
|
+
}) : P(this, Ee, Le).call(this, "pure", t instanceof Uint8Array ? z.Pure(t) : e ? z.Pure(t, e) : t))
|
|
3313
3304
|
}), this.pure;
|
|
3314
3305
|
}
|
|
3315
3306
|
/** Returns an argument for the gas coin, to be used in a transaction. */
|
|
@@ -3325,28 +3316,28 @@ const Xi = Symbol.for("@mysten/transaction"), lt = {
|
|
|
3325
3316
|
const e = ur(t), r = O(this, v).inputs.find(
|
|
3326
3317
|
(n) => n.type === "object" && e === ur(n.value)
|
|
3327
3318
|
);
|
|
3328
|
-
return r && F(r.value, bt) && "Shared" in r.value.Object && F(t, bt) && "Shared" in t.Object && (r.value.Object.Shared.mutable = r.value.Object.Shared.mutable || t.Object.Shared.mutable), r ??
|
|
3319
|
+
return r && F(r.value, bt) && "Shared" in r.value.Object && F(t, bt) && "Shared" in t.Object && (r.value.Object.Shared.mutable = r.value.Object.Shared.mutable || t.Object.Shared.mutable), r ?? P(this, Ee, Le).call(this, "object", typeof t == "string" ? N(t) : t);
|
|
3329
3320
|
}
|
|
3330
3321
|
/**
|
|
3331
3322
|
* Add a new object input to the transaction using the fully-resolved object reference.
|
|
3332
3323
|
* If you only have an object ID, use `builder.object(id)` instead.
|
|
3333
3324
|
*/
|
|
3334
3325
|
objectRef(...t) {
|
|
3335
|
-
return this.object(
|
|
3326
|
+
return this.object(z.ObjectRef(...t));
|
|
3336
3327
|
}
|
|
3337
3328
|
/**
|
|
3338
3329
|
* Add a new receiving input to the transaction using the fully-resolved object reference.
|
|
3339
3330
|
* If you only have an object ID, use `builder.object(id)` instead.
|
|
3340
3331
|
*/
|
|
3341
3332
|
receivingRef(...t) {
|
|
3342
|
-
return this.object(
|
|
3333
|
+
return this.object(z.ReceivingRef(...t));
|
|
3343
3334
|
}
|
|
3344
3335
|
/**
|
|
3345
3336
|
* Add a new shared object input to the transaction using the fully-resolved shared object reference.
|
|
3346
3337
|
* If you only have an object ID, use `builder.object(id)` instead.
|
|
3347
3338
|
*/
|
|
3348
3339
|
sharedObjectRef(...t) {
|
|
3349
|
-
return this.object(
|
|
3340
|
+
return this.object(z.SharedObjectRef(...t));
|
|
3350
3341
|
}
|
|
3351
3342
|
/** Add a transaction to the transaction block. */
|
|
3352
3343
|
add(t) {
|
|
@@ -3359,7 +3350,7 @@ const Xi = Symbol.for("@mysten/transaction"), lt = {
|
|
|
3359
3350
|
he.SplitCoins(
|
|
3360
3351
|
typeof t == "string" ? this.object(t) : t,
|
|
3361
3352
|
e.map(
|
|
3362
|
-
(r) => typeof r == "number" || typeof r == "bigint" || typeof r == "string" ? this.pure.u64(r) :
|
|
3353
|
+
(r) => typeof r == "number" || typeof r == "bigint" || typeof r == "string" ? this.pure.u64(r) : P(this, Oe, We).call(this, r)
|
|
3363
3354
|
)
|
|
3364
3355
|
)
|
|
3365
3356
|
);
|
|
@@ -3402,7 +3393,7 @@ const Xi = Symbol.for("@mysten/transaction"), lt = {
|
|
|
3402
3393
|
}) {
|
|
3403
3394
|
return this.add(
|
|
3404
3395
|
he.MoveCall({
|
|
3405
|
-
arguments: t == null ? void 0 : t.map((n) =>
|
|
3396
|
+
arguments: t == null ? void 0 : t.map((n) => P(this, Oe, We).call(this, n)),
|
|
3406
3397
|
typeArguments: e,
|
|
3407
3398
|
target: r
|
|
3408
3399
|
})
|
|
@@ -3412,7 +3403,7 @@ const Xi = Symbol.for("@mysten/transaction"), lt = {
|
|
|
3412
3403
|
return this.add(
|
|
3413
3404
|
he.TransferObjects(
|
|
3414
3405
|
t.map((r) => typeof r == "string" ? this.object(r) : r),
|
|
3415
|
-
typeof e == "string" ? this.pure.address(e) :
|
|
3406
|
+
typeof e == "string" ? this.pure.address(e) : P(this, Oe, We).call(this, e)
|
|
3416
3407
|
)
|
|
3417
3408
|
);
|
|
3418
3409
|
}
|
|
@@ -3449,21 +3440,21 @@ const Xi = Symbol.for("@mysten/transaction"), lt = {
|
|
|
3449
3440
|
}
|
|
3450
3441
|
/** Build the transaction to BCS bytes. */
|
|
3451
3442
|
async build(t = {}) {
|
|
3452
|
-
return await
|
|
3453
|
-
maxSizeBytes:
|
|
3443
|
+
return await P(this, Ke, St).call(this, t), O(this, v).build({
|
|
3444
|
+
maxSizeBytes: P(this, fe, me).call(this, "maxTxSizeBytes", t),
|
|
3454
3445
|
onlyTransactionKind: t.onlyTransactionKind
|
|
3455
3446
|
});
|
|
3456
3447
|
}
|
|
3457
3448
|
/** Derive transaction digest */
|
|
3458
3449
|
async getDigest(t = {}) {
|
|
3459
|
-
return await
|
|
3450
|
+
return await P(this, Ke, St).call(this, t), O(this, v).getDigest();
|
|
3460
3451
|
}
|
|
3461
3452
|
};
|
|
3462
3453
|
let ue = Tt;
|
|
3463
3454
|
v = /* @__PURE__ */ new WeakMap();
|
|
3464
3455
|
Ee = /* @__PURE__ */ new WeakSet();
|
|
3465
3456
|
Le = function(t, e) {
|
|
3466
|
-
const r = O(this, v).inputs.length, n =
|
|
3457
|
+
const r = O(this, v).inputs.length, n = V(
|
|
3467
3458
|
{
|
|
3468
3459
|
kind: "Input",
|
|
3469
3460
|
// bigints can't be serialized to JSON, so just string-convert them here:
|
|
@@ -3495,7 +3486,7 @@ me = function(t, { protocolConfig: e, limits: r }) {
|
|
|
3495
3486
|
};
|
|
3496
3487
|
qt = /* @__PURE__ */ new WeakSet();
|
|
3497
3488
|
Kr = function(t) {
|
|
3498
|
-
const e =
|
|
3489
|
+
const e = P(this, fe, me).call(this, "maxPureArgumentSize", t);
|
|
3499
3490
|
O(this, v).inputs.forEach((r, n) => {
|
|
3500
3491
|
if (F(r.value, Ye) && r.value.Pure.length > e)
|
|
3501
3492
|
throw new Error(
|
|
@@ -3506,7 +3497,7 @@ Kr = function(t) {
|
|
|
3506
3497
|
Zt = /* @__PURE__ */ new WeakSet();
|
|
3507
3498
|
Jr = async function(t) {
|
|
3508
3499
|
if (O(this, v).gasConfig.payment) {
|
|
3509
|
-
const i =
|
|
3500
|
+
const i = P(this, fe, me).call(this, "maxGasObjects", t);
|
|
3510
3501
|
if (O(this, v).gasConfig.payment.length > i)
|
|
3511
3502
|
throw new Error(`Payment objects exceed maximum amount: ${i}`);
|
|
3512
3503
|
}
|
|
@@ -3515,7 +3506,7 @@ Jr = async function(t) {
|
|
|
3515
3506
|
const e = O(this, v).gasConfig.owner ?? O(this, v).sender, n = (await Be(t).getCoins({
|
|
3516
3507
|
owner: e,
|
|
3517
3508
|
coinType: Ge
|
|
3518
|
-
})).data.filter((i) => !O(this, v).inputs.find((c) => F(c.value, et) && "Object" in c.value && "ImmOrOwned" in c.value.Object ? i.coinObjectId === c.value.Object.ImmOrOwned.objectId : !1)).slice(0,
|
|
3509
|
+
})).data.filter((i) => !O(this, v).inputs.find((c) => F(c.value, et) && "Object" in c.value && "ImmOrOwned" in c.value.Object ? i.coinObjectId === c.value.Object.ImmOrOwned.objectId : !1)).slice(0, P(this, fe, me).call(this, "maxGasObjects", t) - 1).map((i) => ({
|
|
3519
3510
|
objectId: i.coinObjectId,
|
|
3520
3511
|
digest: i.digest,
|
|
3521
3512
|
version: i.version
|
|
@@ -3542,11 +3533,11 @@ Xr = async function(t) {
|
|
|
3542
3533
|
) && n.push(s), s.kind === "SplitCoins" && s.amounts.forEach((c) => {
|
|
3543
3534
|
if (c.kind === "Input") {
|
|
3544
3535
|
const a = e[c.index];
|
|
3545
|
-
typeof a.value != "object" && (a.value =
|
|
3536
|
+
typeof a.value != "object" && (a.value = z.Pure(R.U64.serialize(a.value)));
|
|
3546
3537
|
}
|
|
3547
3538
|
}), s.kind === "TransferObjects" && s.address.kind === "Input") {
|
|
3548
3539
|
const c = e[s.address.index];
|
|
3549
|
-
typeof c.value != "object" && (c.value =
|
|
3540
|
+
typeof c.value != "object" && (c.value = z.Pure(R.Address.serialize(c.value)));
|
|
3550
3541
|
}
|
|
3551
3542
|
}), n.length && await Promise.all(
|
|
3552
3543
|
n.map(async (s) => {
|
|
@@ -3566,7 +3557,7 @@ Xr = async function(t) {
|
|
|
3566
3557
|
return;
|
|
3567
3558
|
const f = b.value, j = wt(m, f);
|
|
3568
3559
|
if (j) {
|
|
3569
|
-
b.value =
|
|
3560
|
+
b.value = z.Pure(f, j);
|
|
3570
3561
|
return;
|
|
3571
3562
|
}
|
|
3572
3563
|
if (jt(m) != null || typeof m == "object" && "TypeParameter" in m) {
|
|
@@ -3614,12 +3605,12 @@ Xr = async function(t) {
|
|
|
3614
3605
|
const y = o.get(u), w = (f = y.data) == null ? void 0 : f.owner, b = w && typeof w == "object" && "Shared" in w ? w.Shared.initial_shared_version : void 0;
|
|
3615
3606
|
if (b) {
|
|
3616
3607
|
const j = m != null && mt(m) == null && Er(m) == null, _ = Mi(g.value) || j || m != null && mt(m) != null;
|
|
3617
|
-
g.value =
|
|
3608
|
+
g.value = z.SharedObjectRef({
|
|
3618
3609
|
objectId: u,
|
|
3619
3610
|
initialSharedVersion: b,
|
|
3620
3611
|
mutable: _
|
|
3621
3612
|
});
|
|
3622
|
-
} else m && Hi(m) ? g.value =
|
|
3613
|
+
} else m && Hi(m) ? g.value = z.ReceivingRef(cr(y)) : g.value = z.ObjectRef(cr(y));
|
|
3623
3614
|
});
|
|
3624
3615
|
}
|
|
3625
3616
|
};
|
|
@@ -3627,13 +3618,13 @@ Ke = /* @__PURE__ */ new WeakSet();
|
|
|
3627
3618
|
St = async function(t) {
|
|
3628
3619
|
if (!t.onlyTransactionKind && !O(this, v).sender)
|
|
3629
3620
|
throw new Error("Missing transaction sender");
|
|
3630
|
-
if (!t.protocolConfig && !t.limits && t.client && (t.protocolConfig = await t.client.getProtocolConfig()), await Promise.all([
|
|
3621
|
+
if (!t.protocolConfig && !t.limits && t.client && (t.protocolConfig = await t.client.getProtocolConfig()), await Promise.all([P(this, Qt, Hr).call(this, t), P(this, Yt, Xr).call(this, t)]), !t.onlyTransactionKind && (await P(this, Zt, Jr).call(this, t), !O(this, v).gasConfig.budget)) {
|
|
3631
3622
|
const e = await Be(t).dryRunTransactionBlock({
|
|
3632
3623
|
transactionBlock: O(this, v).build({
|
|
3633
|
-
maxSizeBytes:
|
|
3624
|
+
maxSizeBytes: P(this, fe, me).call(this, "maxTxSizeBytes", t),
|
|
3634
3625
|
overrides: {
|
|
3635
3626
|
gasConfig: {
|
|
3636
|
-
budget: String(
|
|
3627
|
+
budget: String(P(this, fe, me).call(this, "maxTxGas", t)),
|
|
3637
3628
|
payment: []
|
|
3638
3629
|
}
|
|
3639
3630
|
}
|
|
@@ -3649,7 +3640,7 @@ St = async function(t) {
|
|
|
3649
3640
|
i > n ? i : n
|
|
3650
3641
|
);
|
|
3651
3642
|
}
|
|
3652
|
-
|
|
3643
|
+
P(this, qt, Kr).call(this, t);
|
|
3653
3644
|
};
|
|
3654
3645
|
const fr = async (t, e, r) => {
|
|
3655
3646
|
var c, a, o;
|
|
@@ -3702,19 +3693,19 @@ const fr = async (t, e, r) => {
|
|
|
3702
3693
|
const d = gt(o);
|
|
3703
3694
|
if (!d)
|
|
3704
3695
|
return null;
|
|
3705
|
-
if (!
|
|
3696
|
+
if (!Ve(d))
|
|
3706
3697
|
throw new Error("What?");
|
|
3707
3698
|
return "value" in d ? ke(d.value) : null;
|
|
3708
3699
|
};
|
|
3709
3700
|
class er {
|
|
3710
3701
|
constructor(e, r, n, i) {
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3702
|
+
M(this, "network");
|
|
3703
|
+
M(this, "chain");
|
|
3704
|
+
M(this, "provider");
|
|
3705
|
+
M(this, "contracts");
|
|
3706
|
+
M(this, "coreBridgeObjectId");
|
|
3707
|
+
M(this, "tokenBridgeObjectId");
|
|
3708
|
+
M(this, "chainId");
|
|
3718
3709
|
this.network = e, this.chain = r, this.provider = n, this.contracts = i, this.chainId = rn.get(e, r);
|
|
3719
3710
|
const s = this.contracts.tokenBridge;
|
|
3720
3711
|
if (!s)
|
|
@@ -3744,7 +3735,7 @@ class er {
|
|
|
3744
3735
|
const n = await fr(this.provider, this.tokenBridgeObjectId, r), i = gt(n);
|
|
3745
3736
|
if (!i)
|
|
3746
3737
|
throw nt(r);
|
|
3747
|
-
if (!
|
|
3738
|
+
if (!Ve(i))
|
|
3748
3739
|
throw new Error("Expected fields to be a MoveStruct");
|
|
3749
3740
|
if (!("value" in i))
|
|
3750
3741
|
throw new Error("Expected a `value` key in fields of MoveStruct");
|
|
@@ -3759,7 +3750,7 @@ class er {
|
|
|
3759
3750
|
const o = a.fields.token_address;
|
|
3760
3751
|
if (!H(o))
|
|
3761
3752
|
throw new Error("Expected fields to be a MoveStruct");
|
|
3762
|
-
if (!
|
|
3753
|
+
if (!Ve(o.fields))
|
|
3763
3754
|
throw new Error("Expected address data to be a MoveObject");
|
|
3764
3755
|
if (!("value" in o.fields))
|
|
3765
3756
|
throw new Error("Expected a `value` key in fields of MoveStruct");
|
|
@@ -3781,7 +3772,7 @@ class er {
|
|
|
3781
3772
|
const n = await fr(this.provider, this.tokenBridgeObjectId, r), i = gt(n);
|
|
3782
3773
|
if (!i)
|
|
3783
3774
|
throw new Error(`Token of type ${r} has not been registered with the token bridge. Has it been attested?`);
|
|
3784
|
-
if (!
|
|
3775
|
+
if (!Ve(i))
|
|
3785
3776
|
throw new Error("Expected fields to be a MoveStruct");
|
|
3786
3777
|
if (!("value" in i))
|
|
3787
3778
|
throw new Error("Expected a `value` key in fields of MoveStruct");
|
|
@@ -3875,12 +3866,12 @@ class er {
|
|
|
3875
3866
|
let d = "", u = "", g = "", m = "", y = "", w = !1;
|
|
3876
3867
|
for (; !w; ) {
|
|
3877
3868
|
await new Promise((E) => setTimeout(E, 500));
|
|
3878
|
-
const
|
|
3869
|
+
const $ = await this.provider.queryTransactionBlocks({
|
|
3879
3870
|
filter: { FromAddress: s },
|
|
3880
3871
|
options: { showObjectChanges: !0 },
|
|
3881
3872
|
limit: 3
|
|
3882
3873
|
});
|
|
3883
|
-
for (const E of
|
|
3874
|
+
for (const E of $.data)
|
|
3884
3875
|
if ("objectChanges" in E) {
|
|
3885
3876
|
for (const k of E.objectChanges)
|
|
3886
3877
|
fn(k) && k.packageId !== void 0 ? d = k.packageId : it(k) && k.objectType.includes("WrappedAssetSetup") ? (u = k.objectId, y = k.objectType.split(", ")[1].replace(">", "")) : it(k) && k.objectType.includes("UpgradeCap") ? g = k.objectId : it(k) && k.objectType.includes("CoinMetadata") && (m = k.objectId);
|
|
@@ -3895,7 +3886,7 @@ class er {
|
|
|
3895
3886
|
target: `${n}::vaa::parse_and_verify`,
|
|
3896
3887
|
arguments: [
|
|
3897
3888
|
f.object(this.coreBridgeObjectId),
|
|
3898
|
-
f.pure(
|
|
3889
|
+
f.pure(ze(ht(e))),
|
|
3899
3890
|
f.object(pe)
|
|
3900
3891
|
]
|
|
3901
3892
|
}), [_] = f.moveCall({
|
|
@@ -3925,7 +3916,7 @@ class er {
|
|
|
3925
3916
|
const E = f.object(m.coinObjectId);
|
|
3926
3917
|
return y.length && f.mergeCoins(E, y.map((k) => f.object(k.coinObjectId))), f.splitCoins(E, [f.pure(i)]);
|
|
3927
3918
|
}
|
|
3928
|
-
})(), [_] = f.splitCoins(f.gas, [f.pure(c)]), [
|
|
3919
|
+
})(), [_] = f.splitCoins(f.gas, [f.pure(c)]), [$] = f.moveCall({
|
|
3929
3920
|
target: `${b}::state::verified_asset`,
|
|
3930
3921
|
arguments: [f.object(this.tokenBridgeObjectId)],
|
|
3931
3922
|
typeArguments: [u]
|
|
@@ -3945,11 +3936,11 @@ class er {
|
|
|
3945
3936
|
});
|
|
3946
3937
|
return E = !0, qr;
|
|
3947
3938
|
}
|
|
3948
|
-
})(), [
|
|
3939
|
+
})(), [U, K] = f.moveCall({
|
|
3949
3940
|
target: `${b}::transfer_tokens_with_payload::prepare_transfer`,
|
|
3950
3941
|
arguments: [
|
|
3951
3942
|
k,
|
|
3952
|
-
|
|
3943
|
+
$,
|
|
3953
3944
|
j,
|
|
3954
3945
|
f.pure(ce(r.chain)),
|
|
3955
3946
|
f.pure(r.address.toUint8Array()),
|
|
@@ -3965,7 +3956,7 @@ class er {
|
|
|
3965
3956
|
});
|
|
3966
3957
|
const [we] = f.moveCall({
|
|
3967
3958
|
target: `${b}::transfer_tokens_with_payload::transfer_tokens_with_payload`,
|
|
3968
|
-
arguments: [f.object(this.tokenBridgeObjectId),
|
|
3959
|
+
arguments: [f.object(this.tokenBridgeObjectId), U],
|
|
3969
3960
|
typeArguments: [u]
|
|
3970
3961
|
});
|
|
3971
3962
|
f.moveCall({
|
|
@@ -3981,10 +3972,10 @@ class er {
|
|
|
3981
3972
|
const [E, k] = f.moveCall({
|
|
3982
3973
|
target: `${b}::transfer_tokens::prepare_transfer`,
|
|
3983
3974
|
arguments: [
|
|
3984
|
-
|
|
3975
|
+
$,
|
|
3985
3976
|
j,
|
|
3986
3977
|
f.pure(ce(r.chain)),
|
|
3987
|
-
f.pure(
|
|
3978
|
+
f.pure(ze(r.address.toUint8Array())),
|
|
3988
3979
|
f.pure(a),
|
|
3989
3980
|
f.pure(0)
|
|
3990
3981
|
],
|
|
@@ -3995,7 +3986,7 @@ class er {
|
|
|
3995
3986
|
arguments: [k],
|
|
3996
3987
|
typeArguments: [u]
|
|
3997
3988
|
});
|
|
3998
|
-
const [
|
|
3989
|
+
const [U] = f.moveCall({
|
|
3999
3990
|
target: `${b}::transfer_tokens::transfer_tokens`,
|
|
4000
3991
|
arguments: [f.object(this.tokenBridgeObjectId), E],
|
|
4001
3992
|
typeArguments: [u]
|
|
@@ -4005,7 +3996,7 @@ class er {
|
|
|
4005
3996
|
arguments: [
|
|
4006
3997
|
f.object(this.coreBridgeObjectId),
|
|
4007
3998
|
_,
|
|
4008
|
-
|
|
3999
|
+
U,
|
|
4009
4000
|
f.object(pe)
|
|
4010
4001
|
]
|
|
4011
4002
|
}), yield this.createUnsignedTx(f, "Sui.TokenBridge.Transfer");
|
|
@@ -4019,7 +4010,7 @@ class er {
|
|
|
4019
4010
|
target: `${s}::vaa::parse_and_verify`,
|
|
4020
4011
|
arguments: [
|
|
4021
4012
|
a.object(this.coreBridgeObjectId),
|
|
4022
|
-
a.pure(
|
|
4013
|
+
a.pure(ze(ht(r))),
|
|
4023
4014
|
a.object(pe)
|
|
4024
4015
|
]
|
|
4025
4016
|
}), [d] = a.moveCall({
|
|
@@ -4068,14 +4059,14 @@ class er {
|
|
|
4068
4059
|
}
|
|
4069
4060
|
class tr {
|
|
4070
4061
|
constructor(e, r, n, i) {
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4062
|
+
M(this, "network");
|
|
4063
|
+
M(this, "chain");
|
|
4064
|
+
M(this, "connection");
|
|
4065
|
+
M(this, "contracts");
|
|
4066
|
+
M(this, "tokenBridgeRelayerObjectId");
|
|
4067
|
+
M(this, "coreBridgeObjectId");
|
|
4068
|
+
M(this, "tokenBridgeObjectId");
|
|
4069
|
+
M(this, "fields");
|
|
4079
4070
|
this.network = e, this.chain = r, this.connection = n, this.contracts = i;
|
|
4080
4071
|
const { tokenBridge: s, tokenBridgeRelayer: c, coreBridge: a } = i;
|
|
4081
4072
|
if (!s || !c || !a)
|
|
@@ -4093,11 +4084,11 @@ class tr {
|
|
|
4093
4084
|
if (oe(n))
|
|
4094
4085
|
return u.splitCoins(u.gas, [u.pure(i)]);
|
|
4095
4086
|
{
|
|
4096
|
-
const _ = await Y.getCoins(this.connection, e, a), [
|
|
4097
|
-
if (
|
|
4087
|
+
const _ = await Y.getCoins(this.connection, e, a), [$, ...E] = _.filter((U) => U.coinType === a);
|
|
4088
|
+
if ($ === void 0)
|
|
4098
4089
|
throw new Error(`Coins array doesn't contain any coins of type ${a}`);
|
|
4099
|
-
const k = u.object(
|
|
4100
|
-
return E.length && u.mergeCoins(k, E.map((
|
|
4090
|
+
const k = u.object($.coinObjectId);
|
|
4091
|
+
return E.length && u.mergeCoins(k, E.map((U) => u.object(U.coinObjectId))), u.splitCoins(k, [u.pure(i)]);
|
|
4101
4092
|
}
|
|
4102
4093
|
})(), [w] = u.moveCall({
|
|
4103
4094
|
target: `${d}::state::verified_asset`,
|
|
@@ -4138,7 +4129,7 @@ class tr {
|
|
|
4138
4129
|
target: `${n}::vaa::parse_and_verify`,
|
|
4139
4130
|
arguments: [
|
|
4140
4131
|
o.object(this.coreBridgeObjectId),
|
|
4141
|
-
o.pure(
|
|
4132
|
+
o.pure(ze(ht(r))),
|
|
4142
4133
|
o.object(pe)
|
|
4143
4134
|
]
|
|
4144
4135
|
}), [u] = o.moveCall({
|