@meshsdk/core 1.5.8 → 1.5.10
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/common/contracts/fetcher.d.ts +1 -0
- package/dist/common/types/UTxO.d.ts +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +1918 -1375
- package/dist/providers/blockfrost.provider.d.ts +3 -0
- package/dist/providers/koios.provider.d.ts +4 -1
- package/dist/providers/maestro.provider.d.ts +8 -3
- package/dist/providers/tango.provider.d.ts +1 -0
- package/dist/transaction/index.d.ts +1 -0
- package/dist/transaction/meshTxBuilder/index.d.ts +1 -0
- package/dist/transaction/meshTxBuilder/meshTxBuilder.service.d.ts +44 -0
- package/dist/transaction/meshTxBuilder/meshTxBuilder.spec.d.ts +1 -0
- package/dist/transaction/meshTxBuilder/meshTxBuilderCore.d.ts +239 -0
- package/dist/transaction/meshTxBuilder/type.d.ts +95 -0
- package/package.json +3 -3
package/dist/core.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { customAlphabet as
|
|
2
|
-
import * as
|
|
1
|
+
import { customAlphabet as Ce } from "nanoid";
|
|
2
|
+
import * as a from "@emurgo/cardano-serialization-lib-nodejs";
|
|
3
3
|
import L from "axios";
|
|
4
|
-
import { mnemonicToEntropy as
|
|
5
|
-
import { COSEKey as
|
|
6
|
-
const
|
|
4
|
+
import { mnemonicToEntropy as we, generateMnemonic as ze } from "bip39";
|
|
5
|
+
import { COSEKey as Be, COSESign1 as We, Label as X, Int as Ct, BigNum as Kt, KeyType as Je, AlgorithmId as Ee, CBORValue as Nt, HeaderMap as Xt, Headers as je, ProtectedHeaderMap as Xe, COSESign1Builder as Ze } from "@emurgo/cardano-message-signing-nodejs";
|
|
6
|
+
const ts = ["testnet", "preview", "preprod", "mainnet"], es = (r) => ts.includes(r), At = {
|
|
7
7
|
mem: 7e6,
|
|
8
8
|
steps: 3e9
|
|
9
|
-
},
|
|
9
|
+
}, P = {
|
|
10
10
|
epoch: 0,
|
|
11
11
|
coinsPerUTxOSize: "4310",
|
|
12
12
|
priceMem: 0.0577,
|
|
@@ -27,23 +27,23 @@ const Ze = ["testnet", "preview", "preprod", "mainnet"], ts = (s) => Ze.includes
|
|
|
27
27
|
maxTxExSteps: "10000000000",
|
|
28
28
|
maxBlockExMem: "80000000",
|
|
29
29
|
maxBlockExSteps: "40000000000"
|
|
30
|
-
}, Ut = 2147483648,
|
|
31
|
-
V1:
|
|
32
|
-
V2:
|
|
33
|
-
},
|
|
34
|
-
CERT:
|
|
35
|
-
MINT:
|
|
36
|
-
REWARD:
|
|
37
|
-
SPEND:
|
|
38
|
-
},
|
|
30
|
+
}, Ut = 2147483648, Et = {
|
|
31
|
+
V1: a.Language.new_plutus_v1(),
|
|
32
|
+
V2: a.Language.new_plutus_v2()
|
|
33
|
+
}, F = 56, ss = {
|
|
34
|
+
CERT: a.RedeemerTag.new_cert(),
|
|
35
|
+
MINT: a.RedeemerTag.new_mint(),
|
|
36
|
+
REWARD: a.RedeemerTag.new_reward(),
|
|
37
|
+
SPEND: a.RedeemerTag.new_spend()
|
|
38
|
+
}, St = {
|
|
39
39
|
testnet: ["74", "1598400", "1595967616", "432000"],
|
|
40
40
|
preview: ["183", "15811222", "1682467200", "86400"],
|
|
41
41
|
preprod: ["65", "26438400", "1682121600", "432000"],
|
|
42
42
|
mainnet: ["208", "4492800", "1596059091", "432000"]
|
|
43
|
-
},
|
|
44
|
-
ALONZO:
|
|
43
|
+
}, Zt = {
|
|
44
|
+
ALONZO: a.TxBuilderConstants.plutus_alonzo_cost_models(),
|
|
45
45
|
BABBAGE: (() => {
|
|
46
|
-
const
|
|
46
|
+
const r = a.Costmdls.new(), e = a.CostModel.new();
|
|
47
47
|
Object.values({
|
|
48
48
|
"addInteger-cpu-arguments-intercept": 205665,
|
|
49
49
|
"addInteger-cpu-arguments-slope": 812,
|
|
@@ -211,8 +211,8 @@ const Ze = ["testnet", "preview", "preprod", "mainnet"], ts = (s) => Ze.includes
|
|
|
211
211
|
"verifyEd25519Signature-cpu-arguments-intercept": 57996947,
|
|
212
212
|
"verifyEd25519Signature-cpu-arguments-slope": 18975,
|
|
213
213
|
"verifyEd25519Signature-memory-arguments": 10
|
|
214
|
-
}).forEach((
|
|
215
|
-
const t =
|
|
214
|
+
}).forEach((s, n) => e.set(n, a.Int.new_i32(s)));
|
|
215
|
+
const t = a.CostModel.new();
|
|
216
216
|
return Object.values({
|
|
217
217
|
"addInteger-cpu-arguments-intercept": 205665,
|
|
218
218
|
"addInteger-cpu-arguments-slope": 812,
|
|
@@ -389,9 +389,9 @@ const Ze = ["testnet", "preview", "preprod", "mainnet"], ts = (s) => Ze.includes
|
|
|
389
389
|
"verifySchnorrSecp256k1Signature-cpu-arguments-intercept": 38887044,
|
|
390
390
|
"verifySchnorrSecp256k1Signature-cpu-arguments-slope": 32947,
|
|
391
391
|
"verifySchnorrSecp256k1Signature-memory-arguments": 10
|
|
392
|
-
}).forEach((
|
|
392
|
+
}).forEach((s, n) => t.set(n, a.Int.new_i32(s))), r.insert(a.Language.new_plutus_v1(), e), r.insert(a.Language.new_plutus_v2(), t), r;
|
|
393
393
|
})()
|
|
394
|
-
},
|
|
394
|
+
}, rs = {
|
|
395
395
|
ALONZO: {
|
|
396
396
|
V1: "a141005901d59f1a000302590001011a00060bc719026d00011a000249f01903e800011a000249f018201a0025cea81971f70419744d186419744d186419744d186419744d186419744d186419744d18641864186419744d18641a000249f018201a000249f018201a000249f018201a000249f01903e800011a000249f018201a000249f01903e800081a000242201a00067e2318760001011a000249f01903e800081a000249f01a0001b79818f7011a000249f0192710011a0002155e19052e011903e81a000249f01903e8011a000249f018201a000249f018201a000249f0182001011a000249f0011a000249f0041a000194af18f8011a000194af18f8011a0002377c190556011a0002bdea1901f1011a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000242201a00067e23187600010119f04c192bd200011a000249f018201a000242201a00067e2318760001011a000242201a00067e2318760001011a0025cea81971f704001a000141bb041a000249f019138800011a000249f018201a000302590001011a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a00330da70101ff"
|
|
397
397
|
},
|
|
@@ -399,10 +399,10 @@ const Ze = ["testnet", "preview", "preprod", "mainnet"], ts = (s) => Ze.includes
|
|
|
399
399
|
V1: "a141005901b69f1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201a009063b91903fd0aff",
|
|
400
400
|
V2: "a20198af1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a0011b22c1a0005fdde00021a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201b00000004a817c8001b00000004a817c8001a009063b91903fd0a1b00000004a817c800001b00000004a817c80041005901b69f1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201a009063b91903fd0aff"
|
|
401
401
|
}
|
|
402
|
-
},
|
|
403
|
-
[
|
|
404
|
-
[
|
|
405
|
-
},
|
|
402
|
+
}, Vt = {
|
|
403
|
+
[a.NetworkInfo.testnet().network_id()]: "8d18d786e92776c824607fd8e193ec535c79dc61ea2405ddf3b09fe3",
|
|
404
|
+
[a.NetworkInfo.mainnet().network_id()]: "f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a"
|
|
405
|
+
}, ns = {
|
|
406
406
|
mainnet: "wss://ogmios-api.mainnet.dandelion.link",
|
|
407
407
|
preprod: "wss://ogmios-api.iohk-preprod.dandelion.link",
|
|
408
408
|
preview: "__TBD_SOON_TM__",
|
|
@@ -436,7 +436,7 @@ const Ze = ["testnet", "preview", "preprod", "mainnet"], ts = (s) => Ze.includes
|
|
|
436
436
|
SHEN: "8db269c3ec630e06ae29f74bc39edd1f87c819f1056206e879a1cd615368656e4d6963726f555344",
|
|
437
437
|
WMT: "1d7f33bd23d85e1a25d87d86fac4f199c3197a2f7afeb662a0f34e1e776f726c646d6f62696c65746f6b656e",
|
|
438
438
|
COPI: "b6a7467ea1deb012808ef4e87b5ff371e85f7142d7b356a40d9b42a0436f726e75636f70696173205b76696120436861696e506f72742e696f5d"
|
|
439
|
-
},
|
|
439
|
+
}, te = [
|
|
440
440
|
"begin",
|
|
441
441
|
"eternl",
|
|
442
442
|
"flint",
|
|
@@ -447,222 +447,222 @@ const Ze = ["testnet", "preview", "preprod", "mainnet"], ts = (s) => Ze.includes
|
|
|
447
447
|
"typhoncip30",
|
|
448
448
|
"vespr",
|
|
449
449
|
"yoroi"
|
|
450
|
-
],
|
|
451
|
-
const
|
|
450
|
+
], is = (r, e, t = "5000000") => {
|
|
451
|
+
const s = a.BigNum.from_str(r.get("lovelace") ?? "0").checked_add(a.BigNum.from_str(t)), n = e.filter((c) => c.output.amount.filter((u) => u.unit !== "lovelace").some((u) => r.has(u.unit))), i = ds(n);
|
|
452
452
|
return [
|
|
453
|
-
...
|
|
454
|
-
...
|
|
453
|
+
...i.less_than(s) ? hs(s.clamped_sub(i).to_str(), e.filter((c) => !n.some((u) => u.input.txHash === c.input.txHash && u.input.outputIndex === c.input.outputIndex))) : [],
|
|
454
|
+
...n
|
|
455
455
|
];
|
|
456
|
-
},
|
|
457
|
-
const o = e.filter((
|
|
458
|
-
return
|
|
456
|
+
}, or = (r, e, t = !1, { maxTxSize: s, minFeeA: n, minFeeB: i } = P) => {
|
|
457
|
+
const o = e.filter((l) => Se(l) === !1).sort(qt), c = a.BigNum.from_str(Le(s, n, i)), u = t ? a.BigNum.from_str(r).checked_add(c).to_str() : r;
|
|
458
|
+
return mt(o, /* @__PURE__ */ new Map([
|
|
459
459
|
["lovelace", u]
|
|
460
460
|
]));
|
|
461
|
-
},
|
|
462
|
-
const
|
|
463
|
-
return
|
|
464
|
-
},
|
|
465
|
-
const
|
|
466
|
-
return
|
|
467
|
-
},
|
|
468
|
-
var
|
|
469
|
-
const t =
|
|
470
|
-
return
|
|
471
|
-
},
|
|
472
|
-
const { maxTxSize: e, minFeeA: t, minFeeB:
|
|
473
|
-
return
|
|
474
|
-
},
|
|
475
|
-
var
|
|
476
|
-
const
|
|
477
|
-
return e.checked_add(
|
|
478
|
-
},
|
|
479
|
-
const t = e.sort(
|
|
480
|
-
return
|
|
481
|
-
["lovelace",
|
|
461
|
+
}, os = (r, e, t = !1, s = P) => {
|
|
462
|
+
const n = e.filter(Se).sort(qt), i = us(s), o = r.get("lovelace") ?? "0", c = t ? a.BigNum.from_str(o).checked_add(i).to_str() : o;
|
|
463
|
+
return r.set("lovelace", c), mt(n, r);
|
|
464
|
+
}, cs = (r, e) => Array.from(e, (t) => ({ unit: t[0], quantity: a.BigNum.from_str(t[1]) })).every((t) => r.filter((s) => s.output.amount.find((n) => n.unit === t.unit) !== void 0).reduce((s, n) => {
|
|
465
|
+
const i = n.output.amount.reduce((o, c) => o.checked_add(a.BigNum.from_str(t.unit === c.unit ? c.quantity : "0")), a.BigNum.from_str("0"));
|
|
466
|
+
return s.checked_add(i);
|
|
467
|
+
}, a.BigNum.from_str("0")).less_than(t.quantity) === !1), qt = (r, e) => {
|
|
468
|
+
var n, i;
|
|
469
|
+
const t = a.BigNum.from_str(((n = r.output.amount.find((o) => o.unit === "lovelace")) == null ? void 0 : n.quantity) ?? "0");
|
|
470
|
+
return a.BigNum.from_str(((i = e.output.amount.find((o) => o.unit === "lovelace")) == null ? void 0 : i.quantity) ?? "0").compare(t);
|
|
471
|
+
}, us = (r) => {
|
|
472
|
+
const { maxTxSize: e, minFeeA: t, minFeeB: s } = r;
|
|
473
|
+
return a.BigNum.from_str(Le(e, t, s));
|
|
474
|
+
}, Se = (r) => r.output.amount.length > 1, ds = (r) => r.reduce((e, t) => {
|
|
475
|
+
var n;
|
|
476
|
+
const s = ((n = t.output.amount.find((i) => i.unit === "lovelace")) == null ? void 0 : n.quantity) ?? "0";
|
|
477
|
+
return e.checked_add(a.BigNum.from_str(s));
|
|
478
|
+
}, a.BigNum.from_str("0")), hs = (r, e) => {
|
|
479
|
+
const t = e.sort(qt);
|
|
480
|
+
return mt(t, /* @__PURE__ */ new Map([
|
|
481
|
+
["lovelace", r]
|
|
482
482
|
]));
|
|
483
|
-
},
|
|
484
|
-
const t =
|
|
483
|
+
}, mt = (r, e, t = []) => r.length === 0 || cs(t, e) ? t : ls(r[0], e) ? mt(r.slice(1), e, [...t, r[0]]) : mt(r.slice(1), e, t), ls = (r, e) => Array.from(e.keys()).some((t) => r.output.amount.find((s) => s.unit === t) !== void 0), As = (r, e) => {
|
|
484
|
+
const t = ms(e), s = Is(r, e);
|
|
485
485
|
return {
|
|
486
|
-
coseKey:
|
|
487
|
-
coseSign1:
|
|
486
|
+
coseKey: v(t.to_bytes()),
|
|
487
|
+
coseSign1: v(s.to_bytes())
|
|
488
488
|
};
|
|
489
|
-
},
|
|
489
|
+
}, cr = (r, e, { key: t, signature: s }) => {
|
|
490
490
|
var o, c;
|
|
491
|
-
const
|
|
492
|
-
if ((
|
|
493
|
-
const u =
|
|
494
|
-
if (S(
|
|
491
|
+
const n = Be.from_bytes(I(t)), i = We.from_bytes(I(s));
|
|
492
|
+
if ((r == null ? void 0 : r.length) > 0) {
|
|
493
|
+
const u = v(i.payload() ?? new Uint8Array());
|
|
494
|
+
if (S(r) !== u)
|
|
495
495
|
return !1;
|
|
496
496
|
}
|
|
497
497
|
if ((e == null ? void 0 : e.length) > 0) {
|
|
498
|
-
const
|
|
499
|
-
if (
|
|
498
|
+
const d = (o = i.headers().protected().deserialized_headers().header(X.new_text("address"))) == null ? void 0 : o.as_bytes();
|
|
499
|
+
if (d === void 0)
|
|
500
500
|
throw new Error("Couldn't find a signer address in signature");
|
|
501
|
-
const
|
|
502
|
-
if (
|
|
501
|
+
const A = (c = n.header(X.new_int(Ct.new_negative(Kt.from_str("2"))))) == null ? void 0 : c.as_bytes();
|
|
502
|
+
if (A === void 0)
|
|
503
503
|
throw new Error("Couldn't find a signer key in signature");
|
|
504
|
-
const
|
|
505
|
-
if (
|
|
504
|
+
const l = rt(v(d)), g = qs(v(A));
|
|
505
|
+
if (gs(e, l, g) === !1)
|
|
506
506
|
throw new Error("Couldn't check signature because of address mismatch");
|
|
507
|
-
const f =
|
|
508
|
-
return
|
|
507
|
+
const f = Vs(v(i.signature())), y = i.signed_data().to_bytes();
|
|
508
|
+
return g.verify(y, f);
|
|
509
509
|
}
|
|
510
510
|
return !1;
|
|
511
|
-
},
|
|
512
|
-
if (
|
|
511
|
+
}, gs = (r, e, t) => {
|
|
512
|
+
if (r !== e.to_bech32())
|
|
513
513
|
return !1;
|
|
514
514
|
try {
|
|
515
|
-
return
|
|
515
|
+
return lt(r) === t.hash().to_hex();
|
|
516
516
|
} catch {
|
|
517
517
|
return !1;
|
|
518
518
|
}
|
|
519
|
-
},
|
|
520
|
-
const e =
|
|
521
|
-
return e.set_algorithm_id(
|
|
522
|
-
}, Is = (
|
|
523
|
-
const t =
|
|
524
|
-
t.set_algorithm_id(
|
|
525
|
-
const
|
|
526
|
-
|
|
527
|
-
const o =
|
|
528
|
-
return
|
|
519
|
+
}, ms = (r) => {
|
|
520
|
+
const e = Be.new(X.from_key_type(Je.OKP));
|
|
521
|
+
return e.set_algorithm_id(X.from_algorithm_id(Ee.EdDSA)), e.set_header(X.new_int(Ct.new_negative(Kt.from_str("1"))), Nt.new_int(Ct.new_i32(6))), e.set_header(X.new_int(Ct.new_negative(Kt.from_str("2"))), Nt.new_bytes(r.key.to_public().as_bytes())), e;
|
|
522
|
+
}, Is = (r, e) => {
|
|
523
|
+
const t = Xt.new(), s = Xt.new();
|
|
524
|
+
t.set_algorithm_id(X.from_algorithm_id(Ee.EdDSA)), t.set_header(X.new_text("address"), Nt.new_bytes(e.address.to_bytes()));
|
|
525
|
+
const n = je.new(Xe.new(t), s), i = Ze.new(n, I(r.payload), !1);
|
|
526
|
+
r.externalAAD !== void 0 && i.set_external_aad(I(r.externalAAD));
|
|
527
|
+
const o = i.make_data_to_sign(), c = e.key.sign(o.to_bytes());
|
|
528
|
+
return i.build(c.to_bytes());
|
|
529
529
|
};
|
|
530
|
-
var
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
var
|
|
536
|
-
function
|
|
537
|
-
|
|
530
|
+
var ee = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Qe = {}, Q = { exports: {} };
|
|
531
|
+
G.notEqual = fs;
|
|
532
|
+
G.notOk = _s;
|
|
533
|
+
G.equal = ps;
|
|
534
|
+
G.ok = G;
|
|
535
|
+
var be = G;
|
|
536
|
+
function ps(r, e, t) {
|
|
537
|
+
G(r == e, t);
|
|
538
538
|
}
|
|
539
|
-
function
|
|
540
|
-
|
|
539
|
+
function fs(r, e, t) {
|
|
540
|
+
G(r != e, t);
|
|
541
541
|
}
|
|
542
|
-
function
|
|
543
|
-
|
|
542
|
+
function _s(r, e) {
|
|
543
|
+
G(!r, e);
|
|
544
544
|
}
|
|
545
|
-
function
|
|
546
|
-
if (!
|
|
545
|
+
function G(r, e) {
|
|
546
|
+
if (!r)
|
|
547
547
|
throw new Error(e || "AssertionError");
|
|
548
548
|
}
|
|
549
549
|
var O = { exports: {} };
|
|
550
|
-
function
|
|
551
|
-
throw new Error('Could not dynamically require "' +
|
|
550
|
+
function ys(r) {
|
|
551
|
+
throw new Error('Could not dynamically require "' + r + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
552
552
|
}
|
|
553
|
-
var
|
|
554
|
-
|
|
555
|
-
function
|
|
556
|
-
if (!
|
|
553
|
+
var xs = Rt;
|
|
554
|
+
Rt.supported = typeof WebAssembly < "u";
|
|
555
|
+
function Rt(r) {
|
|
556
|
+
if (!Rt.supported)
|
|
557
557
|
return null;
|
|
558
|
-
var e = s && s.imports, t = Cs("AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMK00AElgMAIABCADcDACAAQQhqQgA3AwAgAEEQakIANwMAIABBGGpCADcDACAAQSBqQgA3AwAgAEEoakIANwMAIABBMGpCADcDACAAQThqQgA3AwAgAEHAAGpCADcDACAAQcgAakIANwMAIABB0ABqQgA3AwAgAEHYAGpCADcDACAAQeAAakIANwMAIABB6ABqQgA3AwAgAEHwAGpCADcDACAAQfgAakIANwMAIABBgAFqQoiS853/zPmE6gBBACkDAIU3AwAgAEGIAWpCu86qptjQ67O7f0EIKQMAhTcDACAAQZABakKr8NP0r+68tzxBECkDAIU3AwAgAEGYAWpC8e30+KWn/aelf0EYKQMAhTcDACAAQaABakLRhZrv+s+Uh9EAQSApAwCFNwMAIABBqAFqQp/Y+dnCkdqCm39BKCkDAIU3AwAgAEGwAWpC6/qG2r+19sEfQTApAwCFNwMAIABBuAFqQvnC+JuRo7Pw2wBBOCkDAIU3AwAgAEHAAWpCADcDACAAQcgBakIANwMAIABB0AFqQgA3AwALbQEDfyAAQcABaiEDIABByAFqIQQgBCkDAKchBQJAA0AgASACRg0BIAVBgAFGBEAgAyADKQMAIAWtfDcDAEEAIQUgABADCyAAIAVqIAEtAAA6AAAgBUEBaiEFIAFBAWohAQwACwsgBCAFrTcDAAtkAQN/IABBwAFqIQEgAEHIAWohAiABIAEpAwAgAikDAHw3AwAgAEHQAWpCfzcDACACKQMApyEDAkADQCADQYABRg0BIAAgA2pBADoAACADQQFqIQMMAAsLIAIgA603AwAgABADC+U7AiB+CX8gAEGAAWohISAAQYgBaiEiIABBkAFqISMgAEGYAWohJCAAQaABaiElIABBqAFqISYgAEGwAWohJyAAQbgBaiEoICEpAwAhASAiKQMAIQIgIykDACEDICQpAwAhBCAlKQMAIQUgJikDACEGICcpAwAhByAoKQMAIQhCiJLznf/M+YTqACEJQr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8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFICEgISkDACABIAmFhTcDACAiICIpAwAgAiAKhYU3AwAgIyAjKQMAIAMgC4WFNwMAICQgJCkDACAEIAyFhTcDACAlICUpAwAgBSANhYU3AwAgJiAmKQMAIAYgDoWFNwMAICcgJykDACAHIA+FhTcDACAoICgpAwAgCCAQhYU3AwAL"), r = null, a = {
|
|
558
|
+
var e = r && r.imports, t = Cs("AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMK00AElgMAIABCADcDACAAQQhqQgA3AwAgAEEQakIANwMAIABBGGpCADcDACAAQSBqQgA3AwAgAEEoakIANwMAIABBMGpCADcDACAAQThqQgA3AwAgAEHAAGpCADcDACAAQcgAakIANwMAIABB0ABqQgA3AwAgAEHYAGpCADcDACAAQeAAakIANwMAIABB6ABqQgA3AwAgAEHwAGpCADcDACAAQfgAakIANwMAIABBgAFqQoiS853/zPmE6gBBACkDAIU3AwAgAEGIAWpCu86qptjQ67O7f0EIKQMAhTcDACAAQZABakKr8NP0r+68tzxBECkDAIU3AwAgAEGYAWpC8e30+KWn/aelf0EYKQMAhTcDACAAQaABakLRhZrv+s+Uh9EAQSApAwCFNwMAIABBqAFqQp/Y+dnCkdqCm39BKCkDAIU3AwAgAEGwAWpC6/qG2r+19sEfQTApAwCFNwMAIABBuAFqQvnC+JuRo7Pw2wBBOCkDAIU3AwAgAEHAAWpCADcDACAAQcgBakIANwMAIABB0AFqQgA3AwALbQEDfyAAQcABaiEDIABByAFqIQQgBCkDAKchBQJAA0AgASACRg0BIAVBgAFGBEAgAyADKQMAIAWtfDcDAEEAIQUgABADCyAAIAVqIAEtAAA6AAAgBUEBaiEFIAFBAWohAQwACwsgBCAFrTcDAAtkAQN/IABBwAFqIQEgAEHIAWohAiABIAEpAwAgAikDAHw3AwAgAEHQAWpCfzcDACACKQMApyEDAkADQCADQYABRg0BIAAgA2pBADoAACADQQFqIQMMAAsLIAIgA603AwAgABADC+U7AiB+CX8gAEGAAWohISAAQYgBaiEiIABBkAFqISMgAEGYAWohJCAAQaABaiElIABBqAFqISYgAEGwAWohJyAAQbgBaiEoICEpAwAhASAiKQMAIQIgIykDACEDICQpAwAhBCAlKQMAIQUgJikDACEGICcpAwAhByAoKQMAIQhCiJLznf/M+YTqACEJQrvOqqbY0Ouzu38hCkKr8NP0r+68tzwhC0Lx7fT4paf9p6V/IQxC0YWa7/rPlIfRACENQp/Y+dnCkdqCm38hDkLr+obav7X2wR8hD0L5wvibkaOz8NsAIRAgACkDACERIABBCGopAwAhEiAAQRBqKQMAIRMgAEEYaikDACEUIABBIGopAwAhFSAAQShqKQMAIRYgAEEwaikDACEXIABBOGopAwAhGCAAQcAAaikDACEZIABByABqKQMAIRogAEHQAGopAwAhGyAAQdgAaikDACEcIABB4ABqKQMAIR0gAEHoAGopAwAhHiAAQfAAaikDACEfIABB+ABqKQMAISAgDSAAQcABaikDAIUhDSAPIABB0AFqKQMAhSEPIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhAS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iALhUI/iiEGIAIgByARfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgE3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBx8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAYfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgFnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBR8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFICEgISkDACABIAmFhTcDACAiICIpAwAgAiAKhYU3AwAgIyAjKQMAIAMgC4WFNwMAICQgJCkDACAEIAyFhTcDACAlICUpAwAgBSANhYU3AwAgJiAmKQMAIAYgDoWFNwMAICcgJykDACAHIA+FhTcDACAoICgpAwAgCCAQhYU3AwAL"), s = null, n = {
|
|
559
559
|
buffer: t,
|
|
560
560
|
memory: null,
|
|
561
561
|
exports: null,
|
|
562
|
-
realloc:
|
|
562
|
+
realloc: i,
|
|
563
563
|
onload: o
|
|
564
564
|
};
|
|
565
565
|
return o(function() {
|
|
566
|
-
}),
|
|
567
|
-
function
|
|
568
|
-
|
|
566
|
+
}), n;
|
|
567
|
+
function i(u) {
|
|
568
|
+
n.exports.memory.grow(Math.ceil(Math.abs(u - n.memory.length) / 65536)), n.memory = new Uint8Array(n.exports.memory.buffer);
|
|
569
569
|
}
|
|
570
570
|
function o(u) {
|
|
571
|
-
if (
|
|
571
|
+
if (n.exports)
|
|
572
572
|
return u();
|
|
573
|
-
if (
|
|
574
|
-
|
|
573
|
+
if (s) {
|
|
574
|
+
s.then(u.bind(null, null)).catch(u);
|
|
575
575
|
return;
|
|
576
576
|
}
|
|
577
577
|
try {
|
|
578
|
-
if (
|
|
578
|
+
if (r && r.async)
|
|
579
579
|
throw new Error("async");
|
|
580
580
|
c({ instance: new WebAssembly.Instance(new WebAssembly.Module(t), e) });
|
|
581
581
|
} catch {
|
|
582
|
-
|
|
582
|
+
s = WebAssembly.instantiate(t, e).then(c);
|
|
583
583
|
}
|
|
584
584
|
o(u);
|
|
585
585
|
}
|
|
586
586
|
function c(u) {
|
|
587
|
-
|
|
587
|
+
n.exports = u.instance.exports, n.memory = n.exports.memory && n.exports.memory.buffer && new Uint8Array(n.exports.memory.buffer);
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
|
-
function Cs(
|
|
591
|
-
return typeof atob == "function" ? new Uint8Array(atob(
|
|
590
|
+
function Cs(r) {
|
|
591
|
+
return typeof atob == "function" ? new Uint8Array(atob(r).split("").map(ws)) : new (ys("buffer")).Buffer(r, "base64");
|
|
592
592
|
}
|
|
593
|
-
function ws(
|
|
594
|
-
return
|
|
593
|
+
function ws(r) {
|
|
594
|
+
return r.charCodeAt(0);
|
|
595
595
|
}
|
|
596
|
-
var
|
|
597
|
-
O.exports =
|
|
598
|
-
var
|
|
596
|
+
var N = be, _ = xs(), R = 64, wt = [];
|
|
597
|
+
O.exports = D;
|
|
598
|
+
var se = O.exports.BYTES_MIN = 16, re = O.exports.BYTES_MAX = 64;
|
|
599
599
|
O.exports.BYTES = 32;
|
|
600
|
-
var
|
|
600
|
+
var ne = O.exports.KEYBYTES_MIN = 16, ae = O.exports.KEYBYTES_MAX = 64;
|
|
601
601
|
O.exports.KEYBYTES = 32;
|
|
602
|
-
var
|
|
603
|
-
function
|
|
604
|
-
if (!(this instanceof
|
|
605
|
-
return new
|
|
602
|
+
var ie = O.exports.SALTBYTES = 16, oe = O.exports.PERSONALBYTES = 16;
|
|
603
|
+
function D(r, e, t, s, n) {
|
|
604
|
+
if (!(this instanceof D))
|
|
605
|
+
return new D(r, e, t, s, n);
|
|
606
606
|
if (!(_ && _.exports))
|
|
607
607
|
throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");
|
|
608
|
-
|
|
608
|
+
r || (r = 32), n !== !0 && (N(r >= se, "digestLength must be at least " + se + ", was given " + r), N(r <= re, "digestLength must be at most " + re + ", was given " + r), e != null && N(e.length >= ne, "key must be at least " + ne + ", was given " + e.length), e != null && N(e.length <= ae, "key must be at least " + ae + ", was given " + e.length), t != null && N(t.length === ie, "salt must be exactly " + ie + ", was given " + t.length), s != null && N(s.length === oe, "personal must be exactly " + oe + ", was given " + s.length)), wt.length || (wt.push(R), R += 216), this.digestLength = r, this.finalized = !1, this.pointer = wt.pop(), _.memory.fill(0, 0, 64), _.memory[0] = this.digestLength, _.memory[1] = e ? e.length : 0, _.memory[2] = 1, _.memory[3] = 1, t && _.memory.set(t, 32), s && _.memory.set(s, 48), this.pointer + 216 > _.memory.length && _.realloc(this.pointer + 216), _.exports.blake2b_init(this.pointer, this.digestLength), e && (this.update(e), _.memory.fill(0, R, R + e.length), _.memory[this.pointer + 200] = 128);
|
|
609
609
|
}
|
|
610
|
-
|
|
611
|
-
return
|
|
610
|
+
D.prototype.update = function(r) {
|
|
611
|
+
return N(this.finalized === !1, "Hash instance finalized"), N(r, "input must be TypedArray or Buffer"), R + r.length > _.memory.length && _.realloc(R + r.length), _.memory.set(r, R), _.exports.blake2b_update(this.pointer, R, R + r.length), this;
|
|
612
612
|
};
|
|
613
|
-
|
|
614
|
-
if (
|
|
613
|
+
D.prototype.digest = function(r) {
|
|
614
|
+
if (N(this.finalized === !1, "Hash instance finalized"), this.finalized = !0, wt.push(this.pointer), _.exports.blake2b_final(this.pointer), !r || r === "binary")
|
|
615
615
|
return _.memory.slice(this.pointer + 128, this.pointer + 128 + this.digestLength);
|
|
616
|
-
if (
|
|
617
|
-
return
|
|
618
|
-
|
|
616
|
+
if (r === "hex")
|
|
617
|
+
return Es(_.memory, this.pointer + 128, this.digestLength);
|
|
618
|
+
N(r.length >= this.digestLength, "input must be TypedArray or Buffer");
|
|
619
619
|
for (var e = 0; e < this.digestLength; e++)
|
|
620
|
-
|
|
621
|
-
return
|
|
620
|
+
r[e] = _.memory[this.pointer + 128 + e];
|
|
621
|
+
return r;
|
|
622
622
|
};
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
if (
|
|
628
|
-
return
|
|
629
|
-
var e = new Promise(function(t,
|
|
630
|
-
_.onload(function(
|
|
631
|
-
|
|
623
|
+
D.prototype.final = D.prototype.digest;
|
|
624
|
+
D.WASM = _ && _.buffer;
|
|
625
|
+
D.SUPPORTED = typeof WebAssembly < "u";
|
|
626
|
+
D.ready = function(r) {
|
|
627
|
+
if (r || (r = Bs), !_)
|
|
628
|
+
return r(new Error("WebAssembly not supported"));
|
|
629
|
+
var e = new Promise(function(t, s) {
|
|
630
|
+
_.onload(function(n) {
|
|
631
|
+
n ? s() : t(), r(n);
|
|
632
632
|
});
|
|
633
633
|
});
|
|
634
634
|
return e;
|
|
635
635
|
};
|
|
636
|
-
|
|
636
|
+
D.prototype.ready = D.ready;
|
|
637
637
|
function Bs() {
|
|
638
638
|
}
|
|
639
|
-
function
|
|
640
|
-
for (var
|
|
641
|
-
|
|
642
|
-
return
|
|
639
|
+
function Es(r, e, t) {
|
|
640
|
+
for (var s = "", n = 0; n < t; n++)
|
|
641
|
+
s += Ss(r[e + n]);
|
|
642
|
+
return s;
|
|
643
643
|
}
|
|
644
|
-
function
|
|
645
|
-
return
|
|
644
|
+
function Ss(r) {
|
|
645
|
+
return r < 16 ? "0" + r.toString(16) : r.toString(16);
|
|
646
646
|
}
|
|
647
|
-
var
|
|
648
|
-
function
|
|
649
|
-
var
|
|
650
|
-
|
|
647
|
+
var j = be, It = O.exports;
|
|
648
|
+
function ft(r, e, t) {
|
|
649
|
+
var s = r[e] + r[t], n = r[e + 1] + r[t + 1];
|
|
650
|
+
s >= 4294967296 && n++, r[e] = s, r[e + 1] = n;
|
|
651
651
|
}
|
|
652
|
-
function
|
|
653
|
-
var
|
|
654
|
-
t < 0 && (
|
|
655
|
-
var
|
|
656
|
-
|
|
652
|
+
function ce(r, e, t, s) {
|
|
653
|
+
var n = r[e] + t;
|
|
654
|
+
t < 0 && (n += 4294967296);
|
|
655
|
+
var i = r[e + 1] + s;
|
|
656
|
+
n >= 4294967296 && i++, r[e] = n, r[e + 1] = i;
|
|
657
657
|
}
|
|
658
|
-
function
|
|
659
|
-
return
|
|
658
|
+
function ve(r, e) {
|
|
659
|
+
return r[e] ^ r[e + 1] << 8 ^ r[e + 2] << 16 ^ r[e + 3] << 24;
|
|
660
660
|
}
|
|
661
|
-
function
|
|
662
|
-
var o =
|
|
663
|
-
|
|
664
|
-
var
|
|
665
|
-
|
|
661
|
+
function W(r, e, t, s, n, i) {
|
|
662
|
+
var o = ht[n], c = ht[n + 1], u = ht[i], d = ht[i + 1];
|
|
663
|
+
ft(m, r, e), ce(m, r, o, c);
|
|
664
|
+
var A = m[s] ^ m[r], l = m[s + 1] ^ m[r + 1];
|
|
665
|
+
m[s] = l, m[s + 1] = A, ft(m, t, s), A = m[e] ^ m[t], l = m[e + 1] ^ m[t + 1], m[e] = A >>> 24 ^ l << 8, m[e + 1] = l >>> 24 ^ A << 8, ft(m, r, e), ce(m, r, u, d), A = m[s] ^ m[r], l = m[s + 1] ^ m[r + 1], m[s] = A >>> 16 ^ l << 16, m[s + 1] = l >>> 16 ^ A << 16, ft(m, t, s), A = m[e] ^ m[t], l = m[e + 1] ^ m[t + 1], m[e] = l >>> 31 ^ A << 1, m[e + 1] = A >>> 31 ^ l << 1;
|
|
666
666
|
}
|
|
667
667
|
var De = new Uint32Array([
|
|
668
668
|
4089235720,
|
|
@@ -681,7 +681,7 @@ var De = new Uint32Array([
|
|
|
681
681
|
528734635,
|
|
682
682
|
327033209,
|
|
683
683
|
1541459225
|
|
684
|
-
]),
|
|
684
|
+
]), Qs = [
|
|
685
685
|
0,
|
|
686
686
|
1,
|
|
687
687
|
2,
|
|
@@ -874,21 +874,21 @@ var De = new Uint32Array([
|
|
|
874
874
|
7,
|
|
875
875
|
5,
|
|
876
876
|
3
|
|
877
|
-
],
|
|
878
|
-
return
|
|
879
|
-
})),
|
|
880
|
-
function
|
|
877
|
+
], B = new Uint8Array(Qs.map(function(r) {
|
|
878
|
+
return r * 2;
|
|
879
|
+
})), m = new Uint32Array(32), ht = new Uint32Array(32);
|
|
880
|
+
function ke(r, e) {
|
|
881
881
|
var t = 0;
|
|
882
882
|
for (t = 0; t < 16; t++)
|
|
883
|
-
|
|
884
|
-
for (
|
|
885
|
-
|
|
883
|
+
m[t] = r.h[t], m[t + 16] = De[t];
|
|
884
|
+
for (m[24] = m[24] ^ r.t, m[25] = m[25] ^ r.t / 4294967296, e && (m[28] = ~m[28], m[29] = ~m[29]), t = 0; t < 32; t++)
|
|
885
|
+
ht[t] = ve(r.b, 4 * t);
|
|
886
886
|
for (t = 0; t < 12; t++)
|
|
887
|
-
|
|
887
|
+
W(0, 8, 16, 24, B[t * 16 + 0], B[t * 16 + 1]), W(2, 10, 18, 26, B[t * 16 + 2], B[t * 16 + 3]), W(4, 12, 20, 28, B[t * 16 + 4], B[t * 16 + 5]), W(6, 14, 22, 30, B[t * 16 + 6], B[t * 16 + 7]), W(0, 10, 20, 30, B[t * 16 + 8], B[t * 16 + 9]), W(2, 12, 22, 24, B[t * 16 + 10], B[t * 16 + 11]), W(4, 14, 16, 26, B[t * 16 + 12], B[t * 16 + 13]), W(6, 8, 18, 28, B[t * 16 + 14], B[t * 16 + 15]);
|
|
888
888
|
for (t = 0; t < 16; t++)
|
|
889
|
-
|
|
889
|
+
r.h[t] = r.h[t] ^ m[t] ^ m[t + 16];
|
|
890
890
|
}
|
|
891
|
-
var
|
|
891
|
+
var J = new Uint8Array([
|
|
892
892
|
0,
|
|
893
893
|
0,
|
|
894
894
|
0,
|
|
@@ -954,203 +954,203 @@ var W = new Uint8Array([
|
|
|
954
954
|
0,
|
|
955
955
|
0
|
|
956
956
|
]);
|
|
957
|
-
function
|
|
958
|
-
|
|
959
|
-
for (var
|
|
960
|
-
this.h[
|
|
961
|
-
e && (
|
|
957
|
+
function it(r, e, t, s) {
|
|
958
|
+
J.fill(0), this.b = new Uint8Array(128), this.h = new Uint32Array(16), this.t = 0, this.c = 0, this.outlen = r, J[0] = r, e && (J[1] = e.length), J[2] = 1, J[3] = 1, t && J.set(t, 32), s && J.set(s, 48);
|
|
959
|
+
for (var n = 0; n < 16; n++)
|
|
960
|
+
this.h[n] = De[n] ^ ve(J, n * 4);
|
|
961
|
+
e && (Te(this, e), this.c = 128);
|
|
962
962
|
}
|
|
963
|
-
|
|
964
|
-
return
|
|
963
|
+
it.prototype.update = function(r) {
|
|
964
|
+
return j(r != null, "input must be Uint8Array or Buffer"), Te(this, r), this;
|
|
965
965
|
};
|
|
966
|
-
|
|
967
|
-
var e = !
|
|
968
|
-
return
|
|
966
|
+
it.prototype.digest = function(r) {
|
|
967
|
+
var e = !r || r === "binary" || r === "hex" ? new Uint8Array(this.outlen) : r;
|
|
968
|
+
return j(e.length >= this.outlen, "out must have at least outlen bytes of space"), bs(this, e), r === "hex" ? vs(e) : e;
|
|
969
969
|
};
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
970
|
+
it.prototype.final = it.prototype.digest;
|
|
971
|
+
it.ready = function(r) {
|
|
972
|
+
It.ready(function() {
|
|
973
|
+
r();
|
|
974
974
|
});
|
|
975
975
|
};
|
|
976
|
-
function
|
|
976
|
+
function Te(r, e) {
|
|
977
977
|
for (var t = 0; t < e.length; t++)
|
|
978
|
-
|
|
978
|
+
r.c === 128 && (r.t += r.c, ke(r, !1), r.c = 0), r.b[r.c++] = e[t];
|
|
979
979
|
}
|
|
980
|
-
function
|
|
981
|
-
for (
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
for (var t = 0; t <
|
|
985
|
-
e[t] =
|
|
980
|
+
function bs(r, e) {
|
|
981
|
+
for (r.t += r.c; r.c < 128; )
|
|
982
|
+
r.b[r.c++] = 0;
|
|
983
|
+
ke(r, !0);
|
|
984
|
+
for (var t = 0; t < r.outlen; t++)
|
|
985
|
+
e[t] = r.h[t >> 2] >> 8 * (t & 3);
|
|
986
986
|
return e;
|
|
987
987
|
}
|
|
988
|
-
function
|
|
989
|
-
for (var e = "", t = 0; t <
|
|
990
|
-
e += Ds(
|
|
988
|
+
function vs(r) {
|
|
989
|
+
for (var e = "", t = 0; t < r.length; t++)
|
|
990
|
+
e += Ds(r[t]);
|
|
991
991
|
return e;
|
|
992
992
|
}
|
|
993
|
-
function Ds(
|
|
994
|
-
return
|
|
993
|
+
function Ds(r) {
|
|
994
|
+
return r < 16 ? "0" + r.toString(16) : r.toString(16);
|
|
995
995
|
}
|
|
996
|
-
var Ue =
|
|
997
|
-
Q.exports = function(e, t,
|
|
998
|
-
return
|
|
996
|
+
var Ue = it;
|
|
997
|
+
Q.exports = function(e, t, s, n, i) {
|
|
998
|
+
return i !== !0 && (j(e >= ue, "outlen must be at least " + ue + ", was given " + e), j(e <= de, "outlen must be at most " + de + ", was given " + e), t != null && j(t.length >= he, "key must be at least " + he + ", was given " + t.length), t != null && j(t.length <= le, "key must be at most " + le + ", was given " + t.length), s != null && j(s.length === Ae, "salt must be exactly " + Ae + ", was given " + s.length), n != null && j(n.length === ge, "personal must be exactly " + ge + ", was given " + n.length)), new Ue(e, t, s, n);
|
|
999
999
|
};
|
|
1000
|
-
Q.exports.ready = function(
|
|
1001
|
-
|
|
1002
|
-
|
|
1000
|
+
Q.exports.ready = function(r) {
|
|
1001
|
+
It.ready(function() {
|
|
1002
|
+
r();
|
|
1003
1003
|
});
|
|
1004
1004
|
};
|
|
1005
|
-
Q.exports.WASM_SUPPORTED =
|
|
1005
|
+
Q.exports.WASM_SUPPORTED = It.SUPPORTED;
|
|
1006
1006
|
Q.exports.WASM_LOADED = !1;
|
|
1007
|
-
var
|
|
1007
|
+
var ue = Q.exports.BYTES_MIN = 16, de = Q.exports.BYTES_MAX = 64;
|
|
1008
1008
|
Q.exports.BYTES = 32;
|
|
1009
|
-
var
|
|
1009
|
+
var he = Q.exports.KEYBYTES_MIN = 16, le = Q.exports.KEYBYTES_MAX = 64;
|
|
1010
1010
|
Q.exports.KEYBYTES = 32;
|
|
1011
|
-
var Ae = Q.exports.SALTBYTES = 16,
|
|
1012
|
-
|
|
1013
|
-
|
|
1011
|
+
var Ae = Q.exports.SALTBYTES = 16, ge = Q.exports.PERSONALBYTES = 16;
|
|
1012
|
+
It.ready(function(r) {
|
|
1013
|
+
r || (Q.exports.WASM_LOADED = !0, Ue = It);
|
|
1014
1014
|
});
|
|
1015
|
-
var
|
|
1016
|
-
Object.defineProperty(
|
|
1017
|
-
|
|
1018
|
-
const
|
|
1019
|
-
for (let
|
|
1020
|
-
const e =
|
|
1021
|
-
|
|
1015
|
+
var ot = {};
|
|
1016
|
+
Object.defineProperty(ot, "__esModule", { value: !0 });
|
|
1017
|
+
ot.bech32m = ot.bech32 = void 0;
|
|
1018
|
+
const Qt = "qpzry9x8gf2tvdw0s3jn54khce6mua7l", Pe = {};
|
|
1019
|
+
for (let r = 0; r < Qt.length; r++) {
|
|
1020
|
+
const e = Qt.charAt(r);
|
|
1021
|
+
Pe[e] = r;
|
|
1022
1022
|
}
|
|
1023
|
-
function at(
|
|
1024
|
-
const e =
|
|
1025
|
-
return (
|
|
1023
|
+
function at(r) {
|
|
1024
|
+
const e = r >> 25;
|
|
1025
|
+
return (r & 33554431) << 5 ^ -(e >> 0 & 1) & 996825010 ^ -(e >> 1 & 1) & 642813549 ^ -(e >> 2 & 1) & 513874426 ^ -(e >> 3 & 1) & 1027748829 ^ -(e >> 4 & 1) & 705979059;
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1027
|
+
function me(r) {
|
|
1028
1028
|
let e = 1;
|
|
1029
|
-
for (let t = 0; t <
|
|
1030
|
-
const
|
|
1031
|
-
if (
|
|
1032
|
-
return "Invalid prefix (" +
|
|
1033
|
-
e = at(e) ^
|
|
1029
|
+
for (let t = 0; t < r.length; ++t) {
|
|
1030
|
+
const s = r.charCodeAt(t);
|
|
1031
|
+
if (s < 33 || s > 126)
|
|
1032
|
+
return "Invalid prefix (" + r + ")";
|
|
1033
|
+
e = at(e) ^ s >> 5;
|
|
1034
1034
|
}
|
|
1035
1035
|
e = at(e);
|
|
1036
|
-
for (let t = 0; t <
|
|
1037
|
-
const
|
|
1038
|
-
e = at(e) ^
|
|
1036
|
+
for (let t = 0; t < r.length; ++t) {
|
|
1037
|
+
const s = r.charCodeAt(t);
|
|
1038
|
+
e = at(e) ^ s & 31;
|
|
1039
1039
|
}
|
|
1040
1040
|
return e;
|
|
1041
1041
|
}
|
|
1042
|
-
function
|
|
1043
|
-
let
|
|
1042
|
+
function Yt(r, e, t, s) {
|
|
1043
|
+
let n = 0, i = 0;
|
|
1044
1044
|
const o = (1 << t) - 1, c = [];
|
|
1045
|
-
for (let u = 0; u <
|
|
1046
|
-
for (
|
|
1047
|
-
|
|
1048
|
-
if (
|
|
1049
|
-
|
|
1045
|
+
for (let u = 0; u < r.length; ++u)
|
|
1046
|
+
for (n = n << e | r[u], i += e; i >= t; )
|
|
1047
|
+
i -= t, c.push(n >> i & o);
|
|
1048
|
+
if (s)
|
|
1049
|
+
i > 0 && c.push(n << t - i & o);
|
|
1050
1050
|
else {
|
|
1051
|
-
if (
|
|
1051
|
+
if (i >= e)
|
|
1052
1052
|
return "Excess padding";
|
|
1053
|
-
if (
|
|
1053
|
+
if (n << t - i & o)
|
|
1054
1054
|
return "Non-zero padding";
|
|
1055
1055
|
}
|
|
1056
1056
|
return c;
|
|
1057
1057
|
}
|
|
1058
|
-
function
|
|
1059
|
-
return
|
|
1058
|
+
function ks(r) {
|
|
1059
|
+
return Yt(r, 8, 5, !0);
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1062
|
-
const e =
|
|
1061
|
+
function Ts(r) {
|
|
1062
|
+
const e = Yt(r, 5, 8, !1);
|
|
1063
1063
|
if (Array.isArray(e))
|
|
1064
1064
|
return e;
|
|
1065
1065
|
}
|
|
1066
|
-
function Us(
|
|
1067
|
-
const e =
|
|
1066
|
+
function Us(r) {
|
|
1067
|
+
const e = Yt(r, 5, 8, !1);
|
|
1068
1068
|
if (Array.isArray(e))
|
|
1069
1069
|
return e;
|
|
1070
1070
|
throw new Error(e);
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1072
|
+
function Ke(r) {
|
|
1073
1073
|
let e;
|
|
1074
|
-
|
|
1074
|
+
r === "bech32" ? e = 1 : e = 734539939;
|
|
1075
1075
|
function t(o, c, u) {
|
|
1076
1076
|
if (u = u || 90, o.length + 7 + c.length > u)
|
|
1077
1077
|
throw new TypeError("Exceeds length limit");
|
|
1078
1078
|
o = o.toLowerCase();
|
|
1079
|
-
let
|
|
1080
|
-
if (typeof
|
|
1081
|
-
throw new Error(
|
|
1082
|
-
let
|
|
1083
|
-
for (let
|
|
1084
|
-
const
|
|
1085
|
-
if (
|
|
1079
|
+
let d = me(o);
|
|
1080
|
+
if (typeof d == "string")
|
|
1081
|
+
throw new Error(d);
|
|
1082
|
+
let A = o + "1";
|
|
1083
|
+
for (let l = 0; l < c.length; ++l) {
|
|
1084
|
+
const g = c[l];
|
|
1085
|
+
if (g >> 5 !== 0)
|
|
1086
1086
|
throw new Error("Non 5-bit word");
|
|
1087
|
-
|
|
1087
|
+
d = at(d) ^ g, A += Qt.charAt(g);
|
|
1088
1088
|
}
|
|
1089
|
-
for (let
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
for (let
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1089
|
+
for (let l = 0; l < 6; ++l)
|
|
1090
|
+
d = at(d);
|
|
1091
|
+
d ^= e;
|
|
1092
|
+
for (let l = 0; l < 6; ++l) {
|
|
1093
|
+
const g = d >> (5 - l) * 5 & 31;
|
|
1094
|
+
A += Qt.charAt(g);
|
|
1095
1095
|
}
|
|
1096
|
-
return
|
|
1096
|
+
return A;
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1098
|
+
function s(o, c) {
|
|
1099
1099
|
if (c = c || 90, o.length < 8)
|
|
1100
1100
|
return o + " too short";
|
|
1101
1101
|
if (o.length > c)
|
|
1102
1102
|
return "Exceeds length limit";
|
|
1103
|
-
const u = o.toLowerCase(),
|
|
1104
|
-
if (o !== u && o !==
|
|
1103
|
+
const u = o.toLowerCase(), d = o.toUpperCase();
|
|
1104
|
+
if (o !== u && o !== d)
|
|
1105
1105
|
return "Mixed-case string " + o;
|
|
1106
1106
|
o = u;
|
|
1107
|
-
const
|
|
1108
|
-
if (
|
|
1107
|
+
const A = o.lastIndexOf("1");
|
|
1108
|
+
if (A === -1)
|
|
1109
1109
|
return "No separator character for " + o;
|
|
1110
|
-
if (
|
|
1110
|
+
if (A === 0)
|
|
1111
1111
|
return "Missing prefix for " + o;
|
|
1112
|
-
const
|
|
1113
|
-
if (
|
|
1112
|
+
const l = o.slice(0, A), g = o.slice(A + 1);
|
|
1113
|
+
if (g.length < 6)
|
|
1114
1114
|
return "Data too short";
|
|
1115
|
-
let f =
|
|
1115
|
+
let f = me(l);
|
|
1116
1116
|
if (typeof f == "string")
|
|
1117
1117
|
return f;
|
|
1118
1118
|
const y = [];
|
|
1119
|
-
for (let
|
|
1120
|
-
const
|
|
1119
|
+
for (let V = 0; V < g.length; ++V) {
|
|
1120
|
+
const z = g.charAt(V), p = Pe[z];
|
|
1121
1121
|
if (p === void 0)
|
|
1122
|
-
return "Unknown character " +
|
|
1123
|
-
f = at(f) ^ p, !(
|
|
1122
|
+
return "Unknown character " + z;
|
|
1123
|
+
f = at(f) ^ p, !(V + 6 >= g.length) && y.push(p);
|
|
1124
1124
|
}
|
|
1125
|
-
return f !== e ? "Invalid checksum for " + o : { prefix:
|
|
1125
|
+
return f !== e ? "Invalid checksum for " + o : { prefix: l, words: y };
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1128
|
-
const u =
|
|
1127
|
+
function n(o, c) {
|
|
1128
|
+
const u = s(o, c);
|
|
1129
1129
|
if (typeof u == "object")
|
|
1130
1130
|
return u;
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1133
|
-
const u =
|
|
1132
|
+
function i(o, c) {
|
|
1133
|
+
const u = s(o, c);
|
|
1134
1134
|
if (typeof u == "object")
|
|
1135
1135
|
return u;
|
|
1136
1136
|
throw new Error(u);
|
|
1137
1137
|
}
|
|
1138
1138
|
return {
|
|
1139
|
-
decodeUnsafe:
|
|
1140
|
-
decode:
|
|
1139
|
+
decodeUnsafe: n,
|
|
1140
|
+
decode: i,
|
|
1141
1141
|
encode: t,
|
|
1142
|
-
toWords:
|
|
1143
|
-
fromWordsUnsafe:
|
|
1142
|
+
toWords: ks,
|
|
1143
|
+
fromWordsUnsafe: Ts,
|
|
1144
1144
|
fromWords: Us
|
|
1145
1145
|
};
|
|
1146
1146
|
}
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
var
|
|
1150
|
-
return
|
|
1147
|
+
ot.bech32 = Ke("bech32");
|
|
1148
|
+
ot.bech32m = Ke("bech32m");
|
|
1149
|
+
var Ps = ee && ee.__importDefault || function(r) {
|
|
1150
|
+
return r && r.__esModule ? r : { default: r };
|
|
1151
1151
|
};
|
|
1152
|
-
Object.defineProperty(
|
|
1153
|
-
const
|
|
1152
|
+
Object.defineProperty(Qe, "__esModule", { value: !0 });
|
|
1153
|
+
const Ks = Ps(Q.exports), _t = ot, Pt = "asset";
|
|
1154
1154
|
class gt {
|
|
1155
1155
|
constructor(e) {
|
|
1156
1156
|
this.hashBuf = e;
|
|
@@ -1159,478 +1159,484 @@ class gt {
|
|
|
1159
1159
|
return new gt(e);
|
|
1160
1160
|
}
|
|
1161
1161
|
static fromParts(e, t) {
|
|
1162
|
-
const
|
|
1163
|
-
return gt.fromHash(
|
|
1162
|
+
const s = (0, Ks.default)(20).update(new Uint8Array([...e, ...t])).digest("binary");
|
|
1163
|
+
return gt.fromHash(s);
|
|
1164
1164
|
}
|
|
1165
1165
|
static fromBech32(e) {
|
|
1166
|
-
const { prefix: t, words:
|
|
1167
|
-
if (t !==
|
|
1166
|
+
const { prefix: t, words: s } = _t.bech32.decode(e);
|
|
1167
|
+
if (t !== Pt)
|
|
1168
1168
|
throw new Error("Invalid asset fingerprint");
|
|
1169
|
-
const
|
|
1170
|
-
return gt.fromHash(
|
|
1169
|
+
const n = Buffer.from(_t.bech32.fromWords(s));
|
|
1170
|
+
return gt.fromHash(n);
|
|
1171
1171
|
}
|
|
1172
1172
|
fingerprint() {
|
|
1173
|
-
const e =
|
|
1174
|
-
return
|
|
1173
|
+
const e = _t.bech32.toWords(this.hashBuf);
|
|
1174
|
+
return _t.bech32.encode(Pt, e);
|
|
1175
1175
|
}
|
|
1176
1176
|
hash() {
|
|
1177
1177
|
return Buffer.from(this.hashBuf).toString("hex");
|
|
1178
1178
|
}
|
|
1179
1179
|
prefix() {
|
|
1180
|
-
return
|
|
1180
|
+
return Pt;
|
|
1181
1181
|
}
|
|
1182
1182
|
checksum() {
|
|
1183
1183
|
return this.fingerprint().slice(-6);
|
|
1184
1184
|
}
|
|
1185
1185
|
}
|
|
1186
|
-
var
|
|
1187
|
-
const
|
|
1188
|
-
const t =
|
|
1189
|
-
return
|
|
1190
|
-
},
|
|
1186
|
+
var Ns = Qe.default = gt;
|
|
1187
|
+
const Hs = Ns, Ms = (r, e) => {
|
|
1188
|
+
const t = Fs(r), s = t.derive(Ut + 1852).derive(Ut + 1815).derive(Ut + e), n = s.derive(0).derive(0).to_raw_key(), i = s.derive(2).derive(0).to_raw_key();
|
|
1189
|
+
return s.free(), t.free(), { paymentKey: n, stakeKey: i };
|
|
1190
|
+
}, rt = (r) => a.Address.from_bytes(I(r)), Fs = (r) => a.Bip32PrivateKey.from_bytes(I(r)), Os = (r) => a.DataHash.from_bytes(I(r)), M = (r) => a.Ed25519KeyHash.from_bytes(I(r)), Vs = (r) => a.Ed25519Signature.from_bytes(I(r)), vt = (r) => a.NativeScript.from_bytes(I(r)), qs = (r) => a.PublicKey.from_bytes(I(r)), Ne = (r) => a.PlutusData.from_bytes(I(r)), ct = (r, e) => a.PlutusScript.from_bytes_with_version(I(r), Et[e]), Rs = (r) => a.ScriptRef.from_bytes(I(r)), Ys = (r) => a.ScriptHash.from_bytes(I(r)), Y = (r) => a.Transaction.from_bytes(I(r)), He = (r) => a.TransactionHash.from_bytes(I(r)), Ie = (r) => a.TransactionUnspentOutput.from_bytes(I(r)), Ls = (r) => a.TransactionWitnessSet.from_bytes(I(r)), Gs = (r) => a.Value.from_bytes(I(r)), K = (r) => a.Address.from_bech32(r), Lt = (r) => a.BaseAddress.from_address(K(r)), Me = (r) => a.EnterpriseAddress.from_address(K(r)), Fe = (r) => a.RewardAddress.from_address(K(r)), v = (r) => Buffer.from(r).toString("hex"), I = (r) => r.length % 2 === 0 && /^[0-9A-F]*$/i.test(r) ? Buffer.from(r, "hex") : Buffer.from(r, "utf-8"), Dt = (r) => {
|
|
1191
1191
|
const e = (t) => {
|
|
1192
|
-
const
|
|
1193
|
-
for (let
|
|
1194
|
-
|
|
1195
|
-
return
|
|
1192
|
+
const s = new Array();
|
|
1193
|
+
for (let n = 0; n < t.len(); n += 1)
|
|
1194
|
+
s.push(Dt(t.get(n)));
|
|
1195
|
+
return s;
|
|
1196
1196
|
};
|
|
1197
|
-
switch (
|
|
1198
|
-
case
|
|
1199
|
-
const t =
|
|
1197
|
+
switch (r.kind()) {
|
|
1198
|
+
case a.NativeScriptKind.ScriptAll: {
|
|
1199
|
+
const t = r.as_script_all();
|
|
1200
1200
|
return {
|
|
1201
1201
|
type: "all",
|
|
1202
1202
|
scripts: e(t.native_scripts())
|
|
1203
1203
|
};
|
|
1204
1204
|
}
|
|
1205
|
-
case
|
|
1206
|
-
const t =
|
|
1205
|
+
case a.NativeScriptKind.ScriptAny: {
|
|
1206
|
+
const t = r.as_script_any();
|
|
1207
1207
|
return {
|
|
1208
1208
|
type: "any",
|
|
1209
1209
|
scripts: e(t.native_scripts())
|
|
1210
1210
|
};
|
|
1211
1211
|
}
|
|
1212
|
-
case
|
|
1213
|
-
const t =
|
|
1212
|
+
case a.NativeScriptKind.ScriptNOfK: {
|
|
1213
|
+
const t = r.as_script_n_of_k();
|
|
1214
1214
|
return {
|
|
1215
1215
|
type: "atLeast",
|
|
1216
1216
|
required: t.n(),
|
|
1217
1217
|
scripts: e(t.native_scripts())
|
|
1218
1218
|
};
|
|
1219
1219
|
}
|
|
1220
|
-
case
|
|
1221
|
-
const t =
|
|
1220
|
+
case a.NativeScriptKind.TimelockStart: {
|
|
1221
|
+
const t = r.as_timelock_start();
|
|
1222
1222
|
return {
|
|
1223
1223
|
type: "after",
|
|
1224
1224
|
slot: t.slot_bignum().to_str()
|
|
1225
1225
|
};
|
|
1226
1226
|
}
|
|
1227
|
-
case
|
|
1228
|
-
const t =
|
|
1227
|
+
case a.NativeScriptKind.TimelockExpiry: {
|
|
1228
|
+
const t = r.as_timelock_expiry();
|
|
1229
1229
|
return {
|
|
1230
1230
|
type: "before",
|
|
1231
1231
|
slot: t.slot_bignum().to_str()
|
|
1232
1232
|
};
|
|
1233
1233
|
}
|
|
1234
|
-
case
|
|
1235
|
-
const t =
|
|
1234
|
+
case a.NativeScriptKind.ScriptPubkey: {
|
|
1235
|
+
const t = r.as_script_pubkey();
|
|
1236
1236
|
return {
|
|
1237
1237
|
type: "sig",
|
|
1238
1238
|
keyHash: t.addr_keyhash().to_hex()
|
|
1239
1239
|
};
|
|
1240
1240
|
}
|
|
1241
1241
|
default:
|
|
1242
|
-
throw new Error(`Script Kind: ${
|
|
1242
|
+
throw new Error(`Script Kind: ${r.kind()}, is not supported`);
|
|
1243
1243
|
}
|
|
1244
|
-
},
|
|
1244
|
+
}, kt = (r) => {
|
|
1245
1245
|
const e = (t) => {
|
|
1246
|
-
const
|
|
1247
|
-
return t.forEach((
|
|
1248
|
-
|
|
1249
|
-
}),
|
|
1246
|
+
const s = a.NativeScripts.new();
|
|
1247
|
+
return t.forEach((n) => {
|
|
1248
|
+
s.add(kt(n));
|
|
1249
|
+
}), s;
|
|
1250
1250
|
};
|
|
1251
|
-
switch (
|
|
1251
|
+
switch (r.type) {
|
|
1252
1252
|
case "all":
|
|
1253
|
-
return
|
|
1253
|
+
return a.NativeScript.new_script_all(a.ScriptAll.new(e(r.scripts)));
|
|
1254
1254
|
case "any":
|
|
1255
|
-
return
|
|
1255
|
+
return a.NativeScript.new_script_any(a.ScriptAny.new(e(r.scripts)));
|
|
1256
1256
|
case "atLeast":
|
|
1257
|
-
return
|
|
1257
|
+
return a.NativeScript.new_script_n_of_k(a.ScriptNOfK.new(r.required, e(r.scripts)));
|
|
1258
1258
|
case "after":
|
|
1259
|
-
return
|
|
1259
|
+
return a.NativeScript.new_timelock_start(a.TimelockStart.new_timelockstart(a.BigNum.from_str(r.slot)));
|
|
1260
1260
|
case "before":
|
|
1261
|
-
return
|
|
1261
|
+
return a.NativeScript.new_timelock_expiry(a.TimelockExpiry.new_timelockexpiry(a.BigNum.from_str(r.slot)));
|
|
1262
1262
|
case "sig":
|
|
1263
|
-
return
|
|
1263
|
+
return a.NativeScript.new_script_pubkey(a.ScriptPubkey.new(M(r.keyHash)));
|
|
1264
1264
|
}
|
|
1265
|
-
},
|
|
1266
|
-
var
|
|
1265
|
+
}, Bt = (r) => {
|
|
1266
|
+
var s, n, i;
|
|
1267
1267
|
const e = (o) => {
|
|
1268
1268
|
const c = [];
|
|
1269
1269
|
for (let u = 0; u < o.len(); u += 1)
|
|
1270
|
-
c.push(
|
|
1270
|
+
c.push(Bt(o.get(u)));
|
|
1271
1271
|
return c;
|
|
1272
1272
|
}, t = (o) => {
|
|
1273
1273
|
const c = /* @__PURE__ */ new Map();
|
|
1274
1274
|
for (let u = 0; u < o.len(); u += 1) {
|
|
1275
|
-
const
|
|
1276
|
-
c.set(
|
|
1275
|
+
const d = o.keys().get(u), A = o.get(d) ?? a.PlutusData.from_hex(S("NO_ITEM_FOUND_INSIDE_GOLD_ROOM"));
|
|
1276
|
+
c.set(Bt(d), Bt(A));
|
|
1277
1277
|
}
|
|
1278
1278
|
return c;
|
|
1279
1279
|
};
|
|
1280
|
-
switch (
|
|
1281
|
-
case
|
|
1282
|
-
return
|
|
1283
|
-
case
|
|
1284
|
-
return parseInt(((
|
|
1285
|
-
case
|
|
1286
|
-
return e(
|
|
1287
|
-
case
|
|
1288
|
-
return t(
|
|
1289
|
-
case
|
|
1280
|
+
switch (r.kind()) {
|
|
1281
|
+
case a.PlutusDataKind.Bytes:
|
|
1282
|
+
return v(r.as_bytes() ?? new Uint8Array());
|
|
1283
|
+
case a.PlutusDataKind.Integer:
|
|
1284
|
+
return parseInt(((s = r.as_integer()) == null ? void 0 : s.to_str()) ?? "0", 10);
|
|
1285
|
+
case a.PlutusDataKind.List:
|
|
1286
|
+
return e(r.as_list() ?? a.PlutusList.new());
|
|
1287
|
+
case a.PlutusDataKind.Map:
|
|
1288
|
+
return t(r.as_map() ?? a.PlutusMap.new());
|
|
1289
|
+
case a.PlutusDataKind.ConstrPlutusData:
|
|
1290
1290
|
return {
|
|
1291
|
-
alternative: parseInt(((
|
|
1292
|
-
fields: e(((
|
|
1291
|
+
alternative: parseInt(((n = r.as_constr_plutus_data()) == null ? void 0 : n.alternative().to_str()) ?? "0", 10),
|
|
1292
|
+
fields: e(((i = r.as_constr_plutus_data()) == null ? void 0 : i.data()) ?? a.PlutusList.new())
|
|
1293
1293
|
};
|
|
1294
1294
|
default:
|
|
1295
|
-
throw new Error(`PlutusData Kind: ${
|
|
1295
|
+
throw new Error(`PlutusData Kind: ${r.kind()}, is not supported`);
|
|
1296
1296
|
}
|
|
1297
|
-
},
|
|
1297
|
+
}, b = (r) => {
|
|
1298
1298
|
const e = (t) => {
|
|
1299
|
-
const
|
|
1300
|
-
return t.forEach((
|
|
1301
|
-
|
|
1302
|
-
}),
|
|
1299
|
+
const s = a.PlutusList.new();
|
|
1300
|
+
return t.forEach((n) => {
|
|
1301
|
+
s.add(b(n));
|
|
1302
|
+
}), s;
|
|
1303
1303
|
};
|
|
1304
|
-
switch (typeof
|
|
1304
|
+
switch (typeof r) {
|
|
1305
1305
|
case "string":
|
|
1306
|
-
return
|
|
1306
|
+
return a.PlutusData.new_bytes(I(r));
|
|
1307
1307
|
case "number":
|
|
1308
|
-
return
|
|
1308
|
+
return a.PlutusData.new_integer(a.BigInt.from_str(r.toString()));
|
|
1309
1309
|
case "object":
|
|
1310
|
-
if (
|
|
1311
|
-
const t = e(
|
|
1312
|
-
return
|
|
1313
|
-
} else if (
|
|
1314
|
-
const t =
|
|
1315
|
-
return
|
|
1316
|
-
t.insert(
|
|
1317
|
-
}),
|
|
1310
|
+
if (r instanceof Array) {
|
|
1311
|
+
const t = e(r);
|
|
1312
|
+
return a.PlutusData.new_list(t);
|
|
1313
|
+
} else if (r instanceof Map) {
|
|
1314
|
+
const t = a.PlutusMap.new();
|
|
1315
|
+
return r.forEach((s, n) => {
|
|
1316
|
+
t.insert(b(n), b(s));
|
|
1317
|
+
}), a.PlutusData.new_map(t);
|
|
1318
1318
|
} else
|
|
1319
|
-
return
|
|
1319
|
+
return a.PlutusData.new_constr_plutus_data(a.ConstrPlutusData.new(a.BigNum.from_str(r.alternative.toString()), e(r.fields)));
|
|
1320
1320
|
}
|
|
1321
|
-
},
|
|
1322
|
-
const e =
|
|
1323
|
-
throw
|
|
1324
|
-
e.add(
|
|
1321
|
+
}, $s = (r) => {
|
|
1322
|
+
const e = a.Relays.new();
|
|
1323
|
+
throw r.relays.forEach((t) => {
|
|
1324
|
+
e.add(zs(t));
|
|
1325
1325
|
}), new Error("toPoolParams not implemented.");
|
|
1326
|
-
},
|
|
1327
|
-
const e = (t) =>
|
|
1328
|
-
return
|
|
1329
|
-
},
|
|
1330
|
-
switch (
|
|
1326
|
+
}, Oe = (r) => {
|
|
1327
|
+
const e = (t) => ss[t];
|
|
1328
|
+
return a.Redeemer.new(e(r.tag), a.BigNum.from_str(r.index.toString()), b(r.data), a.ExUnits.new(a.BigNum.from_str(r.budget.mem.toString()), a.BigNum.from_str(r.budget.steps.toString())));
|
|
1329
|
+
}, zs = (r) => {
|
|
1330
|
+
switch (r.type) {
|
|
1331
1331
|
case "SingleHostAddr": {
|
|
1332
|
-
const e =
|
|
1333
|
-
return
|
|
1332
|
+
const e = r.IPV4 ? a.Ipv4.new(new Uint8Array(r.IPV4.split(".").map((s) => parseInt(s)))) : void 0, t = r.IPV6 ? a.Ipv6.new(I(r.IPV6.replaceAll(":", ""))) : void 0;
|
|
1333
|
+
return a.Relay.new_single_host_addr(a.SingleHostAddr.new(r.port, e, t));
|
|
1334
1334
|
}
|
|
1335
1335
|
case "SingleHostName":
|
|
1336
|
-
return
|
|
1336
|
+
return a.Relay.new_single_host_name(a.SingleHostName.new(r.port, a.DNSRecordAorAAAA.new(r.domainName)));
|
|
1337
1337
|
case "MultiHostName":
|
|
1338
|
-
return
|
|
1338
|
+
return a.Relay.new_multi_host_name(a.MultiHostName.new(a.DNSRecordSRV.new(r.domainName)));
|
|
1339
1339
|
}
|
|
1340
|
-
},
|
|
1341
|
-
if (
|
|
1342
|
-
const t =
|
|
1340
|
+
}, Ve = (r) => {
|
|
1341
|
+
if (r.is_plutus_script()) {
|
|
1342
|
+
const t = r.plutus_script();
|
|
1343
1343
|
return {
|
|
1344
1344
|
code: t.to_hex(),
|
|
1345
|
-
version: Object.keys(
|
|
1345
|
+
version: Object.keys(Et).find((s) => Et[s].to_hex() === t.language_version().to_hex())
|
|
1346
1346
|
};
|
|
1347
1347
|
}
|
|
1348
|
-
const e =
|
|
1348
|
+
const e = r.native_script();
|
|
1349
1349
|
return Dt(e);
|
|
1350
|
-
},
|
|
1351
|
-
if ("code" in
|
|
1352
|
-
const e =
|
|
1353
|
-
return
|
|
1354
|
-
}
|
|
1355
|
-
return
|
|
1356
|
-
},
|
|
1357
|
-
var
|
|
1358
|
-
const e =
|
|
1350
|
+
}, ut = (r) => {
|
|
1351
|
+
if ("code" in r) {
|
|
1352
|
+
const e = ct(r.code, r.version);
|
|
1353
|
+
return a.ScriptRef.new_plutus_script(e);
|
|
1354
|
+
}
|
|
1355
|
+
return a.ScriptRef.new_native_script(kt(r));
|
|
1356
|
+
}, bt = (r) => {
|
|
1357
|
+
var n, i, o;
|
|
1358
|
+
const e = r.output().has_data_hash() ? (n = r.output().data_hash()) == null ? void 0 : n.to_hex() : void 0, t = r.output().has_plutus_data() ? (i = r.output().plutus_data()) == null ? void 0 : i.to_hex() : void 0, s = r.output().has_script_ref() ? (o = r.output().script_ref()) == null ? void 0 : o.to_hex() : void 0;
|
|
1359
1359
|
return {
|
|
1360
1360
|
input: {
|
|
1361
|
-
outputIndex:
|
|
1362
|
-
txHash:
|
|
1361
|
+
outputIndex: r.input().index(),
|
|
1362
|
+
txHash: r.input().transaction_id().to_hex()
|
|
1363
1363
|
},
|
|
1364
1364
|
output: {
|
|
1365
|
-
address:
|
|
1366
|
-
amount:
|
|
1365
|
+
address: r.output().address().to_bech32(),
|
|
1366
|
+
amount: qe(r.output().amount()),
|
|
1367
1367
|
dataHash: e,
|
|
1368
1368
|
plutusData: t,
|
|
1369
|
-
scriptRef:
|
|
1369
|
+
scriptRef: s
|
|
1370
1370
|
}
|
|
1371
1371
|
};
|
|
1372
|
-
},
|
|
1373
|
-
const e =
|
|
1374
|
-
return
|
|
1375
|
-
},
|
|
1376
|
-
const e =
|
|
1377
|
-
return
|
|
1378
|
-
}, S = (
|
|
1372
|
+
}, H = (r) => {
|
|
1373
|
+
const e = a.TransactionInput.new(He(r.input.txHash), r.input.outputIndex), t = a.TransactionOutput.new(K(r.output.address), Z(r.output.amount));
|
|
1374
|
+
return r.output.dataHash !== void 0 && t.set_data_hash(Os(r.output.dataHash)), r.output.plutusData !== void 0 && t.set_plutus_data(Ne(r.output.plutusData)), r.output.scriptRef !== void 0 && t.set_script_ref(Rs(r.output.scriptRef)), a.TransactionUnspentOutput.new(e, t);
|
|
1375
|
+
}, pe = (r) => {
|
|
1376
|
+
const e = r.split(".")[1] ?? "0", t = `${parseInt(e, 10)}`, s = "1" + "0".repeat(e.length);
|
|
1377
|
+
return a.UnitInterval.new(a.BigNum.from_str(t), a.BigNum.from_str(s));
|
|
1378
|
+
}, S = (r) => r.length % 2 === 0 && /^[0-9A-F]*$/i.test(r) ? r : v(Buffer.from(r, "utf-8")), Gt = (r) => Buffer.from(r, "hex").toString("utf-8"), qe = (r) => {
|
|
1379
1379
|
const e = [
|
|
1380
|
-
{ unit: "lovelace", quantity:
|
|
1381
|
-
], t =
|
|
1380
|
+
{ unit: "lovelace", quantity: r.coin().to_str() }
|
|
1381
|
+
], t = r.multiasset();
|
|
1382
1382
|
if (t !== void 0) {
|
|
1383
|
-
const
|
|
1384
|
-
for (let
|
|
1385
|
-
const
|
|
1383
|
+
const s = t.keys();
|
|
1384
|
+
for (let n = 0; n < s.len(); n += 1) {
|
|
1385
|
+
const i = s.get(n), o = t.get(i);
|
|
1386
1386
|
if (o !== void 0) {
|
|
1387
1387
|
const c = o.keys();
|
|
1388
1388
|
for (let u = 0; u < c.len(); u += 1) {
|
|
1389
|
-
const
|
|
1390
|
-
e.push({ unit:
|
|
1389
|
+
const d = c.get(u), A = o.get(d) ?? a.BigNum.from_str("0"), l = i.to_hex() + v(d.name());
|
|
1390
|
+
e.push({ unit: l, quantity: A.to_str() });
|
|
1391
1391
|
}
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
1394
|
}
|
|
1395
1395
|
return e;
|
|
1396
|
-
},
|
|
1397
|
-
const e =
|
|
1398
|
-
t.forEach((
|
|
1399
|
-
const o =
|
|
1400
|
-
|
|
1401
|
-
o.insert(
|
|
1402
|
-
}),
|
|
1396
|
+
}, Z = (r) => {
|
|
1397
|
+
const e = r.find((i) => i.unit === "lovelace"), t = Array.from(new Set(r.filter((i) => i.unit !== "lovelace").map((i) => i.unit.slice(0, F)))), s = a.MultiAsset.new();
|
|
1398
|
+
t.forEach((i) => {
|
|
1399
|
+
const o = a.Assets.new();
|
|
1400
|
+
r.filter((c) => c.unit.slice(0, F) === i).forEach((c) => {
|
|
1401
|
+
o.insert(a.AssetName.new(I(c.unit.slice(F))), a.BigNum.from_str(c.quantity));
|
|
1402
|
+
}), s.insert(Ys(i), o);
|
|
1403
1403
|
});
|
|
1404
|
-
const
|
|
1405
|
-
return (
|
|
1406
|
-
},
|
|
1407
|
-
if (typeof
|
|
1408
|
-
return
|
|
1409
|
-
const e =
|
|
1404
|
+
const n = a.Value.new(a.BigNum.from_str(e ? e.quantity : "0"));
|
|
1405
|
+
return (r.length > 1 || !e) && n.set_multiasset(s), n;
|
|
1406
|
+
}, fe = (r, e, t) => a.BaseAddress.new(r, a.StakeCredential.from_keyhash(e), a.StakeCredential.from_keyhash(t)), Re = (r, e = "") => a.Bip32PrivateKey.from_bip39_entropy(I(r), I(S(e))), Ht = (r) => a.DataCost.new_coins_per_byte(a.BigNum.from_str(r)), Ws = (r) => {
|
|
1407
|
+
if (typeof r != "object" || !("input" in r))
|
|
1408
|
+
return a.DatumSource.new(b(r));
|
|
1409
|
+
const e = H(r);
|
|
1410
1410
|
if (e.output().has_plutus_data())
|
|
1411
|
-
return
|
|
1411
|
+
return a.DatumSource.new_ref_input(e.input());
|
|
1412
1412
|
throw new Error(`No inline datum found in UTxO: ${e.input().transaction_id().to_hex()}`);
|
|
1413
|
-
},
|
|
1414
|
-
if (typeof
|
|
1415
|
-
return
|
|
1413
|
+
}, _e = (r, e) => a.EnterpriseAddress.new(r, a.StakeCredential.from_keyhash(e)), ye = (r, e) => {
|
|
1414
|
+
if (typeof r == "string")
|
|
1415
|
+
return a.MintWitness.new_native_script(vt(r));
|
|
1416
1416
|
if (e === void 0)
|
|
1417
1417
|
throw new Error("Minting with plutus requires a redeemer to be defined");
|
|
1418
1418
|
if (e.tag !== "MINT")
|
|
1419
1419
|
throw new Error("Minting redeemer's tag must be defined as 'MINT'");
|
|
1420
|
-
return
|
|
1420
|
+
return a.MintWitness.new_plutus_script(Ye(r), Oe({
|
|
1421
1421
|
tag: "MINT",
|
|
1422
1422
|
index: 0,
|
|
1423
|
-
budget:
|
|
1423
|
+
budget: At,
|
|
1424
1424
|
data: {
|
|
1425
1425
|
alternative: 0,
|
|
1426
1426
|
fields: []
|
|
1427
1427
|
},
|
|
1428
1428
|
...e
|
|
1429
1429
|
}));
|
|
1430
|
-
},
|
|
1431
|
-
if ("code" in
|
|
1432
|
-
return
|
|
1433
|
-
const e =
|
|
1430
|
+
}, Mt = (r, e) => a.RewardAddress.new(r, a.StakeCredential.from_keyhash(e)), Ye = (r) => {
|
|
1431
|
+
if ("code" in r)
|
|
1432
|
+
return a.PlutusScriptSource.new(ct(r.code, r.version));
|
|
1433
|
+
const e = H(r);
|
|
1434
1434
|
if (e.output().has_script_ref()) {
|
|
1435
1435
|
const t = e.output().script_ref();
|
|
1436
1436
|
if (t.is_plutus_script()) {
|
|
1437
|
-
const
|
|
1438
|
-
return
|
|
1437
|
+
const s = Ve(t), n = ct(s.code, s.version).hash();
|
|
1438
|
+
return a.PlutusScriptSource.new_ref_input_with_lang_ver(n, e.input(), Et[s.version]);
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
1441
|
throw new Error(`No plutus script reference found in UTxO: ${e.input().transaction_id().to_hex()}`);
|
|
1442
|
-
},
|
|
1443
|
-
const e =
|
|
1444
|
-
return
|
|
1445
|
-
},
|
|
1446
|
-
const e =
|
|
1447
|
-
return
|
|
1448
|
-
},
|
|
1449
|
-
const e =
|
|
1450
|
-
return
|
|
1442
|
+
}, yt = (r) => {
|
|
1443
|
+
const e = a.ScriptPubkey.new(r);
|
|
1444
|
+
return a.NativeScript.new_script_pubkey(e);
|
|
1445
|
+
}, Ft = (r = P) => {
|
|
1446
|
+
const e = a.TransactionBuilderConfigBuilder.new().coins_per_utxo_byte(a.BigNum.from_str(r.coinsPerUTxOSize)).ex_unit_prices(a.ExUnitPrices.new(pe(r.priceMem.toString()), pe(r.priceStep.toString()))).fee_algo(a.LinearFee.new(a.BigNum.from_str(r.minFeeA.toString()), a.BigNum.from_str(r.minFeeB.toString()))).key_deposit(a.BigNum.from_str(r.keyDeposit)).max_tx_size(r.maxTxSize).max_value_size(parseInt(r.maxValSize, 10)).pool_deposit(a.BigNum.from_str(r.poolDeposit)).build();
|
|
1447
|
+
return a.TransactionBuilder.new(e);
|
|
1448
|
+
}, xe = (r) => {
|
|
1449
|
+
const e = a.TxInputsBuilder.new();
|
|
1450
|
+
return r.map((t) => t instanceof a.TransactionUnspentOutput ? t : H(t)).forEach((t) => {
|
|
1451
1451
|
e.add_input(t.output().address(), t.input(), t.output().amount());
|
|
1452
1452
|
}), e;
|
|
1453
|
-
},
|
|
1454
|
-
if (typeof
|
|
1455
|
-
return
|
|
1456
|
-
let e =
|
|
1457
|
-
if (
|
|
1458
|
-
const { value: t, inline:
|
|
1459
|
-
e = e.with_data_hash(
|
|
1460
|
-
}
|
|
1461
|
-
if (
|
|
1462
|
-
const t =
|
|
1453
|
+
}, xt = (r) => {
|
|
1454
|
+
if (typeof r == "string")
|
|
1455
|
+
return a.TransactionOutputBuilder.new().with_address(K(r));
|
|
1456
|
+
let e = a.TransactionOutputBuilder.new().with_address(K(r.address));
|
|
1457
|
+
if (r.datum) {
|
|
1458
|
+
const { value: t, inline: s } = r.datum, n = b(t);
|
|
1459
|
+
e = e.with_data_hash(a.hash_plutus_data(n)), s && (e = e.with_plutus_data(n));
|
|
1460
|
+
}
|
|
1461
|
+
if (r.script) {
|
|
1462
|
+
const t = ut(r.script);
|
|
1463
1463
|
e = e.with_script_ref(t);
|
|
1464
1464
|
}
|
|
1465
1465
|
return e;
|
|
1466
|
-
},
|
|
1467
|
-
const e =
|
|
1466
|
+
}, tt = (r) => {
|
|
1467
|
+
const e = r.slice(0, F), t = r.includes(".") ? S(r.split(".")[1]) : r.slice(F);
|
|
1468
1468
|
return { policyId: e, assetName: t };
|
|
1469
|
-
},
|
|
1470
|
-
data:
|
|
1471
|
-
headers:
|
|
1472
|
-
status:
|
|
1473
|
-
}) :
|
|
1474
|
-
const e =
|
|
1475
|
-
return
|
|
1476
|
-
},
|
|
1477
|
-
if (
|
|
1478
|
-
const [t,
|
|
1479
|
-
return parseInt(
|
|
1480
|
-
}
|
|
1481
|
-
throw new Error(`Couldn't resolve EpochNo for network: ${
|
|
1482
|
-
}, Js = (
|
|
1469
|
+
}, h = (r) => L.isAxiosError(r) ? r.response ? JSON.stringify({
|
|
1470
|
+
data: r.response.data,
|
|
1471
|
+
headers: r.response.headers,
|
|
1472
|
+
status: r.response.status
|
|
1473
|
+
}) : r.request ? JSON.stringify(r.request) : r.message : JSON.stringify(r), ur = (r) => {
|
|
1474
|
+
const e = b(r);
|
|
1475
|
+
return a.hash_plutus_data(e).to_hex();
|
|
1476
|
+
}, dr = (r, e = Date.now()) => {
|
|
1477
|
+
if (St[r]) {
|
|
1478
|
+
const [t, s, n, i] = St[r];
|
|
1479
|
+
return parseInt(a.BigNum.from_str(e.toString()).div_floor(a.BigNum.from_str("1000")).checked_sub(a.BigNum.from_str(n)).div_floor(a.BigNum.from_str(i)).checked_add(a.BigNum.from_str(t)).to_str(), 10);
|
|
1480
|
+
}
|
|
1481
|
+
throw new Error(`Couldn't resolve EpochNo for network: ${r}`);
|
|
1482
|
+
}, Js = (r, e) => Hs.fromParts(I(r), I(e)).fingerprint(), hr = (r, e) => rs[r][e], lr = (r) => kt(r).hash().to_hex(), nt = (r) => {
|
|
1483
1483
|
var e, t;
|
|
1484
1484
|
try {
|
|
1485
|
-
const
|
|
1486
|
-
(e =
|
|
1487
|
-
(t =
|
|
1488
|
-
].find((
|
|
1489
|
-
if (
|
|
1490
|
-
return
|
|
1491
|
-
throw new Error(`Couldn't resolve payment key hash from address: ${
|
|
1492
|
-
} catch (
|
|
1493
|
-
throw new Error(`An error occurred during resolvePaymentKeyHash: ${
|
|
1494
|
-
}
|
|
1495
|
-
},
|
|
1496
|
-
const t =
|
|
1497
|
-
return
|
|
1498
|
-
},
|
|
1485
|
+
const s = [
|
|
1486
|
+
(e = Lt(r)) == null ? void 0 : e.payment_cred().to_keyhash(),
|
|
1487
|
+
(t = Me(r)) == null ? void 0 : t.payment_cred().to_keyhash()
|
|
1488
|
+
].find((n) => n !== void 0);
|
|
1489
|
+
if (s !== void 0)
|
|
1490
|
+
return s.to_hex();
|
|
1491
|
+
throw new Error(`Couldn't resolve payment key hash from address: ${r}`);
|
|
1492
|
+
} catch (s) {
|
|
1493
|
+
throw new Error(`An error occurred during resolvePaymentKeyHash: ${s}.`);
|
|
1494
|
+
}
|
|
1495
|
+
}, Ar = (r, e = 0) => {
|
|
1496
|
+
const t = ct(r.code, r.version);
|
|
1497
|
+
return a.EnterpriseAddress.new(e, a.StakeCredential.from_scripthash(t.hash())).to_address().to_bech32();
|
|
1498
|
+
}, gr = (r) => {
|
|
1499
1499
|
try {
|
|
1500
|
-
const e =
|
|
1500
|
+
const e = Me(r), t = e == null ? void 0 : e.payment_cred().to_scripthash();
|
|
1501
1501
|
if (t !== void 0)
|
|
1502
1502
|
return t.to_hex();
|
|
1503
|
-
throw new Error(`Couldn't resolve script hash from address: ${
|
|
1503
|
+
throw new Error(`Couldn't resolve script hash from address: ${r}`);
|
|
1504
1504
|
} catch (e) {
|
|
1505
1505
|
throw new Error(`An error occurred during resolveScriptHash: ${e}.`);
|
|
1506
1506
|
}
|
|
1507
|
-
},
|
|
1508
|
-
const e =
|
|
1509
|
-
return t.free(),
|
|
1510
|
-
},
|
|
1511
|
-
if (
|
|
1512
|
-
const [t,
|
|
1513
|
-
return
|
|
1507
|
+
}, mr = (r) => a.Ed25519KeyHash.from_hex(r).to_bech32("pool1"), Ir = (r) => {
|
|
1508
|
+
const e = we(r.join(" ")), t = Re(e), s = t.to_bech32();
|
|
1509
|
+
return t.free(), s;
|
|
1510
|
+
}, pr = (r) => ut(r).to_hex(), fr = (r, e = Date.now()) => {
|
|
1511
|
+
if (St[r]) {
|
|
1512
|
+
const [t, s, n] = St[r];
|
|
1513
|
+
return a.BigNum.from_str(e.toString()).div_floor(a.BigNum.from_str("1000")).checked_sub(a.BigNum.from_str(n)).checked_add(a.BigNum.from_str(s)).to_str();
|
|
1514
1514
|
}
|
|
1515
|
-
throw new Error(`Couldn't resolve SlotNo for network: ${
|
|
1516
|
-
},
|
|
1515
|
+
throw new Error(`Couldn't resolve SlotNo for network: ${r}`);
|
|
1516
|
+
}, Tt = (r) => {
|
|
1517
1517
|
try {
|
|
1518
|
-
const e =
|
|
1519
|
-
if (
|
|
1520
|
-
return
|
|
1521
|
-
throw new Error(`Couldn't resolve reward address from address: ${
|
|
1518
|
+
const e = K(r), t = Lt(r), s = t == null ? void 0 : t.stake_cred().to_keyhash();
|
|
1519
|
+
if (s !== void 0)
|
|
1520
|
+
return Mt(e.network_id(), s).to_address().to_bech32();
|
|
1521
|
+
throw new Error(`Couldn't resolve reward address from address: ${r}`);
|
|
1522
1522
|
} catch (e) {
|
|
1523
1523
|
throw new Error(`An error occurred during resolveRewardAddress: ${e}.`);
|
|
1524
1524
|
}
|
|
1525
|
-
},
|
|
1525
|
+
}, lt = (r) => {
|
|
1526
1526
|
var e, t;
|
|
1527
1527
|
try {
|
|
1528
|
-
const
|
|
1529
|
-
(e =
|
|
1530
|
-
(t =
|
|
1531
|
-
].find((
|
|
1532
|
-
if (
|
|
1533
|
-
return
|
|
1534
|
-
throw new Error(`Couldn't resolve stake key hash from address: ${
|
|
1535
|
-
} catch (
|
|
1536
|
-
throw new Error(`An error occurred during resolveStakeKeyHash: ${
|
|
1537
|
-
}
|
|
1538
|
-
}, Le = (
|
|
1539
|
-
const e =
|
|
1540
|
-
return
|
|
1541
|
-
},
|
|
1528
|
+
const s = [
|
|
1529
|
+
(e = Lt(r)) == null ? void 0 : e.stake_cred().to_keyhash(),
|
|
1530
|
+
(t = Fe(r)) == null ? void 0 : t.payment_cred().to_keyhash()
|
|
1531
|
+
].find((n) => n !== void 0);
|
|
1532
|
+
if (s !== void 0)
|
|
1533
|
+
return s.to_hex();
|
|
1534
|
+
throw new Error(`Couldn't resolve stake key hash from address: ${r}`);
|
|
1535
|
+
} catch (s) {
|
|
1536
|
+
throw new Error(`An error occurred during resolveStakeKeyHash: ${s}.`);
|
|
1537
|
+
}
|
|
1538
|
+
}, Le = (r, e = P.minFeeA, t = P.minFeeB) => (BigInt(e) * BigInt(r) + BigInt(t)).toString(), js = (r) => {
|
|
1539
|
+
const e = Y(r).body();
|
|
1540
|
+
return a.hash_transaction(e).to_hex();
|
|
1541
|
+
}, _r = (r = "", e = 32) => {
|
|
1542
1542
|
if (e <= 0 || e > 2048)
|
|
1543
1543
|
throw new Error("Length must be bewteen 1 and 2048");
|
|
1544
|
-
const
|
|
1545
|
-
return S(`${
|
|
1546
|
-
}, Ge = (
|
|
1547
|
-
const t =
|
|
1544
|
+
const s = Ce("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")(e);
|
|
1545
|
+
return S(`${r}${s}`);
|
|
1546
|
+
}, Ge = (r, e) => {
|
|
1547
|
+
const t = r.vkeys();
|
|
1548
1548
|
if (t !== void 0) {
|
|
1549
|
-
const
|
|
1550
|
-
for (let
|
|
1551
|
-
|
|
1552
|
-
for (let
|
|
1553
|
-
|
|
1554
|
-
const
|
|
1555
|
-
return
|
|
1556
|
-
|
|
1557
|
-
}),
|
|
1549
|
+
const s = /* @__PURE__ */ new Set();
|
|
1550
|
+
for (let i = 0; i < t.len(); i += 1)
|
|
1551
|
+
s.add(t.get(i).to_hex());
|
|
1552
|
+
for (let i = 0; i < e.len(); i += 1)
|
|
1553
|
+
s.add(e.get(i).to_hex());
|
|
1554
|
+
const n = a.Vkeywitnesses.new();
|
|
1555
|
+
return s.forEach((i) => {
|
|
1556
|
+
n.add(a.Vkeywitness.from_hex(i));
|
|
1557
|
+
}), n;
|
|
1558
1558
|
}
|
|
1559
1559
|
return e;
|
|
1560
|
-
},
|
|
1560
|
+
}, yr = (r) => Bt(Ne(r)), xr = (r) => Y(r).to_js_value();
|
|
1561
1561
|
class Cr {
|
|
1562
1562
|
_axiosInstance;
|
|
1563
1563
|
constructor(...e) {
|
|
1564
1564
|
if (typeof e[0] == "string" && e[0].startsWith("http"))
|
|
1565
1565
|
this._axiosInstance = L.create({ baseURL: e[0] });
|
|
1566
1566
|
else {
|
|
1567
|
-
const t = e[0],
|
|
1567
|
+
const t = e[0], s = t.slice(0, 7);
|
|
1568
1568
|
this._axiosInstance = L.create({
|
|
1569
|
-
baseURL: `https://cardano-${
|
|
1569
|
+
baseURL: `https://cardano-${s}.blockfrost.io/api/v${e[1] ?? 0}`,
|
|
1570
1570
|
headers: { project_id: t }
|
|
1571
1571
|
});
|
|
1572
1572
|
}
|
|
1573
1573
|
}
|
|
1574
1574
|
async fetchAccountInfo(e) {
|
|
1575
|
-
const t = e.startsWith("addr") ?
|
|
1575
|
+
const t = e.startsWith("addr") ? Tt(e) : e;
|
|
1576
1576
|
try {
|
|
1577
|
-
const { data:
|
|
1578
|
-
if (
|
|
1577
|
+
const { data: s, status: n } = await this._axiosInstance.get(`accounts/${t}`);
|
|
1578
|
+
if (n === 200)
|
|
1579
1579
|
return {
|
|
1580
|
-
poolId:
|
|
1581
|
-
active:
|
|
1582
|
-
balance:
|
|
1583
|
-
rewards:
|
|
1584
|
-
withdrawals:
|
|
1580
|
+
poolId: s.pool_id,
|
|
1581
|
+
active: s.active || s.active_epoch !== null,
|
|
1582
|
+
balance: s.controlled_amount,
|
|
1583
|
+
rewards: s.withdrawable_amount,
|
|
1584
|
+
withdrawals: s.withdrawals_sum
|
|
1585
1585
|
};
|
|
1586
|
-
throw
|
|
1587
|
-
} catch (
|
|
1588
|
-
throw
|
|
1586
|
+
throw h(s);
|
|
1587
|
+
} catch (s) {
|
|
1588
|
+
throw h(s);
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
resolveScriptRef = async (e) => {
|
|
1592
|
+
if (e) {
|
|
1593
|
+
const { data: t, status: s } = await this._axiosInstance.get(`scripts/${e}`);
|
|
1594
|
+
if (s === 200) {
|
|
1595
|
+
const n = t.type.startsWith("plutus") ? {
|
|
1596
|
+
code: await this.fetchPlutusScriptCBOR(e),
|
|
1597
|
+
version: t.type.replace("plutus", "")
|
|
1598
|
+
} : await this.fetchNativeScriptJSON(e);
|
|
1599
|
+
return ut(n).to_hex();
|
|
1600
|
+
}
|
|
1601
|
+
throw h(t);
|
|
1589
1602
|
}
|
|
1590
|
-
}
|
|
1603
|
+
};
|
|
1604
|
+
toUTxO = async (e, t) => ({
|
|
1605
|
+
input: {
|
|
1606
|
+
outputIndex: e.output_index,
|
|
1607
|
+
txHash: t
|
|
1608
|
+
},
|
|
1609
|
+
output: {
|
|
1610
|
+
address: e.address,
|
|
1611
|
+
amount: e.amount,
|
|
1612
|
+
dataHash: e.data_hash ?? void 0,
|
|
1613
|
+
plutusData: e.inline_datum ?? void 0,
|
|
1614
|
+
scriptRef: await this.resolveScriptRef(e.reference_script_hash),
|
|
1615
|
+
scriptHash: e.reference_script_hash
|
|
1616
|
+
}
|
|
1617
|
+
});
|
|
1591
1618
|
async fetchAddressUTxOs(e, t) {
|
|
1592
|
-
const
|
|
1593
|
-
const { data:
|
|
1594
|
-
if (
|
|
1595
|
-
return
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
const g = A.type.startsWith("plutus") ? {
|
|
1602
|
-
code: await this.fetchPlutusScriptCBOR(u),
|
|
1603
|
-
version: A.type.replace("plutus", "")
|
|
1604
|
-
} : await this.fetchNativeScriptJSON(u);
|
|
1605
|
-
return ct(g).to_hex();
|
|
1606
|
-
}
|
|
1607
|
-
throw d(A);
|
|
1608
|
-
}
|
|
1609
|
-
}, c = async (u) => ({
|
|
1610
|
-
input: {
|
|
1611
|
-
outputIndex: u.output_index,
|
|
1612
|
-
txHash: u.tx_hash
|
|
1613
|
-
},
|
|
1614
|
-
output: {
|
|
1615
|
-
address: e,
|
|
1616
|
-
amount: u.amount,
|
|
1617
|
-
dataHash: u.data_hash ?? void 0,
|
|
1618
|
-
plutusData: u.inline_datum ?? void 0,
|
|
1619
|
-
scriptRef: await o(u.reference_script_hash)
|
|
1620
|
-
}
|
|
1621
|
-
});
|
|
1619
|
+
const s = t !== void 0 ? `/${t}` : "", n = `addresses/${e}/utxos` + s, i = async (o = 1, c = []) => {
|
|
1620
|
+
const { data: u, status: d } = await this._axiosInstance.get(`${n}?page=${o}`);
|
|
1621
|
+
if (d === 200)
|
|
1622
|
+
return u.length > 0 ? i(o + 1, [
|
|
1623
|
+
...c,
|
|
1624
|
+
...await Promise.all(u.map((A) => this.toUTxO(A, A.tx_hash)))
|
|
1625
|
+
]) : c;
|
|
1626
|
+
throw h(u);
|
|
1627
|
+
};
|
|
1622
1628
|
try {
|
|
1623
|
-
return await
|
|
1629
|
+
return await i();
|
|
1624
1630
|
} catch {
|
|
1625
1631
|
return [];
|
|
1626
1632
|
}
|
|
1627
1633
|
}
|
|
1628
1634
|
async fetchAssetAddresses(e) {
|
|
1629
|
-
const t = async (
|
|
1630
|
-
const { policyId:
|
|
1635
|
+
const t = async (s = 1, n = []) => {
|
|
1636
|
+
const { policyId: i, assetName: o } = tt(e), { data: c, status: u } = await this._axiosInstance.get(`assets/${i}${o}/addresses?page=${s}`);
|
|
1631
1637
|
if (u === 200)
|
|
1632
|
-
return c.length > 0 ? t(
|
|
1633
|
-
throw
|
|
1638
|
+
return c.length > 0 ? t(s + 1, [...n, ...c]) : n;
|
|
1639
|
+
throw h(c);
|
|
1634
1640
|
};
|
|
1635
1641
|
try {
|
|
1636
1642
|
return await t();
|
|
@@ -1640,20 +1646,20 @@ class Cr {
|
|
|
1640
1646
|
}
|
|
1641
1647
|
async fetchAssetMetadata(e) {
|
|
1642
1648
|
try {
|
|
1643
|
-
const { policyId: t, assetName:
|
|
1644
|
-
if (
|
|
1649
|
+
const { policyId: t, assetName: s } = tt(e), { data: n, status: i } = await this._axiosInstance.get(`assets/${t}${s}`);
|
|
1650
|
+
if (i === 200)
|
|
1645
1651
|
return {
|
|
1646
|
-
...
|
|
1652
|
+
...n.onchain_metadata
|
|
1647
1653
|
};
|
|
1648
|
-
throw
|
|
1654
|
+
throw h(n);
|
|
1649
1655
|
} catch (t) {
|
|
1650
|
-
throw
|
|
1656
|
+
throw h(t);
|
|
1651
1657
|
}
|
|
1652
1658
|
}
|
|
1653
1659
|
async fetchBlockInfo(e) {
|
|
1654
1660
|
try {
|
|
1655
|
-
const { data: t, status:
|
|
1656
|
-
if (
|
|
1661
|
+
const { data: t, status: s } = await this._axiosInstance.get(`blocks/${e}`);
|
|
1662
|
+
if (s === 200)
|
|
1657
1663
|
return {
|
|
1658
1664
|
confirmations: t.confirmations,
|
|
1659
1665
|
epoch: t.epoch,
|
|
@@ -1671,41 +1677,41 @@ class Cr {
|
|
|
1671
1677
|
txCount: t.tx_count,
|
|
1672
1678
|
VRFKey: t.block_vrf
|
|
1673
1679
|
};
|
|
1674
|
-
throw
|
|
1680
|
+
throw h(t);
|
|
1675
1681
|
} catch (t) {
|
|
1676
|
-
throw
|
|
1682
|
+
throw h(t);
|
|
1677
1683
|
}
|
|
1678
1684
|
}
|
|
1679
1685
|
async fetchCollectionAssets(e, t = 1) {
|
|
1680
1686
|
try {
|
|
1681
|
-
const { data:
|
|
1682
|
-
if (
|
|
1687
|
+
const { data: s, status: n } = await this._axiosInstance.get(`assets/policy/${e}?page=${t}`);
|
|
1688
|
+
if (n === 200)
|
|
1683
1689
|
return {
|
|
1684
|
-
assets:
|
|
1685
|
-
unit:
|
|
1686
|
-
quantity:
|
|
1690
|
+
assets: s.map((i) => ({
|
|
1691
|
+
unit: i.asset,
|
|
1692
|
+
quantity: i.quantity
|
|
1687
1693
|
})),
|
|
1688
|
-
next:
|
|
1694
|
+
next: s.length === 100 ? t + 1 : null
|
|
1689
1695
|
};
|
|
1690
|
-
throw
|
|
1696
|
+
throw h(s);
|
|
1691
1697
|
} catch {
|
|
1692
1698
|
return { assets: [], next: null };
|
|
1693
1699
|
}
|
|
1694
1700
|
}
|
|
1695
1701
|
async fetchHandleAddress(e) {
|
|
1696
1702
|
try {
|
|
1697
|
-
const t = S(e.replace("$", "")), { data:
|
|
1698
|
-
if (
|
|
1699
|
-
return
|
|
1700
|
-
throw
|
|
1703
|
+
const t = S(e.replace("$", "")), { data: s, status: n } = await this._axiosInstance.get(`assets/${Vt[1]}${t}/addresses`);
|
|
1704
|
+
if (n === 200)
|
|
1705
|
+
return s[0].address;
|
|
1706
|
+
throw h(s);
|
|
1701
1707
|
} catch (t) {
|
|
1702
|
-
throw
|
|
1708
|
+
throw h(t);
|
|
1703
1709
|
}
|
|
1704
1710
|
}
|
|
1705
1711
|
async fetchProtocolParameters(e = Number.NaN) {
|
|
1706
1712
|
try {
|
|
1707
|
-
const { data: t, status:
|
|
1708
|
-
if (
|
|
1713
|
+
const { data: t, status: s } = await this._axiosInstance.get(`epochs/${isNaN(e) ? "latest" : e}/parameters`);
|
|
1714
|
+
if (s === 200)
|
|
1709
1715
|
return {
|
|
1710
1716
|
coinsPerUTxOSize: t.coins_per_utxo_word,
|
|
1711
1717
|
collateralPercent: t.collateral_percent,
|
|
@@ -1728,15 +1734,15 @@ class Cr {
|
|
|
1728
1734
|
priceMem: t.price_mem,
|
|
1729
1735
|
priceStep: t.price_step
|
|
1730
1736
|
};
|
|
1731
|
-
throw
|
|
1737
|
+
throw h(t);
|
|
1732
1738
|
} catch (t) {
|
|
1733
|
-
throw
|
|
1739
|
+
throw h(t);
|
|
1734
1740
|
}
|
|
1735
1741
|
}
|
|
1736
1742
|
async fetchTxInfo(e) {
|
|
1737
1743
|
try {
|
|
1738
|
-
const { data: t, status:
|
|
1739
|
-
if (
|
|
1744
|
+
const { data: t, status: s } = await this._axiosInstance.get(`txs/${e}`);
|
|
1745
|
+
if (s === 200)
|
|
1740
1746
|
return {
|
|
1741
1747
|
block: t.block,
|
|
1742
1748
|
deposit: t.deposit,
|
|
@@ -1748,162 +1754,160 @@ class Cr {
|
|
|
1748
1754
|
slot: t.slot.toString(),
|
|
1749
1755
|
size: t.size
|
|
1750
1756
|
};
|
|
1751
|
-
throw
|
|
1757
|
+
throw h(t);
|
|
1758
|
+
} catch (t) {
|
|
1759
|
+
throw h(t);
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
async fetchUTxOs(e) {
|
|
1763
|
+
try {
|
|
1764
|
+
const { data: t, status: s } = await this._axiosInstance.get(`txs/${e}/utxos`);
|
|
1765
|
+
if (s === 200) {
|
|
1766
|
+
const n = t.outputs, i = [];
|
|
1767
|
+
return n.forEach((c) => {
|
|
1768
|
+
i.push(this.toUTxO(c, e));
|
|
1769
|
+
}), await Promise.all(i);
|
|
1770
|
+
}
|
|
1771
|
+
throw h(t);
|
|
1752
1772
|
} catch (t) {
|
|
1753
|
-
throw
|
|
1773
|
+
throw h(t);
|
|
1754
1774
|
}
|
|
1755
1775
|
}
|
|
1756
|
-
onTxConfirmed(e, t,
|
|
1757
|
-
let
|
|
1758
|
-
const
|
|
1759
|
-
|
|
1776
|
+
onTxConfirmed(e, t, s = 100) {
|
|
1777
|
+
let n = 0;
|
|
1778
|
+
const i = setInterval(() => {
|
|
1779
|
+
n >= s && clearInterval(i), this.fetchTxInfo(e).then((o) => {
|
|
1760
1780
|
this.fetchBlockInfo(o.block).then((c) => {
|
|
1761
|
-
(c == null ? void 0 : c.confirmations) > 0 && (clearInterval(
|
|
1781
|
+
(c == null ? void 0 : c.confirmations) > 0 && (clearInterval(i), t());
|
|
1762
1782
|
}).catch(() => {
|
|
1763
|
-
|
|
1783
|
+
n += 1;
|
|
1764
1784
|
});
|
|
1765
1785
|
}).catch(() => {
|
|
1766
|
-
|
|
1786
|
+
n += 1;
|
|
1767
1787
|
});
|
|
1768
1788
|
}, 5e3);
|
|
1769
1789
|
}
|
|
1770
1790
|
async submitTx(e) {
|
|
1771
1791
|
try {
|
|
1772
|
-
const t = { "Content-Type": "application/cbor" }, { data:
|
|
1773
|
-
if (
|
|
1774
|
-
return
|
|
1775
|
-
throw
|
|
1792
|
+
const t = { "Content-Type": "application/cbor" }, { data: s, status: n } = await this._axiosInstance.post("tx/submit", I(e), { headers: t });
|
|
1793
|
+
if (n === 200)
|
|
1794
|
+
return s;
|
|
1795
|
+
throw h(s);
|
|
1776
1796
|
} catch (t) {
|
|
1777
|
-
throw
|
|
1797
|
+
throw h(t);
|
|
1778
1798
|
}
|
|
1779
1799
|
}
|
|
1780
1800
|
async fetchPlutusScriptCBOR(e) {
|
|
1781
|
-
const { data: t, status:
|
|
1782
|
-
if (
|
|
1801
|
+
const { data: t, status: s } = await this._axiosInstance.get(`scripts/${e}/cbor`);
|
|
1802
|
+
if (s === 200)
|
|
1783
1803
|
return t.cbor;
|
|
1784
|
-
throw
|
|
1804
|
+
throw h(t);
|
|
1785
1805
|
}
|
|
1786
1806
|
async fetchNativeScriptJSON(e) {
|
|
1787
|
-
const { data: t, status:
|
|
1788
|
-
if (
|
|
1807
|
+
const { data: t, status: s } = await this._axiosInstance.get(`scripts/${e}/json`);
|
|
1808
|
+
if (s === 200)
|
|
1789
1809
|
return t.json;
|
|
1790
|
-
throw
|
|
1810
|
+
throw h(t);
|
|
1791
1811
|
}
|
|
1792
1812
|
}
|
|
1793
1813
|
class wr {
|
|
1794
1814
|
_axiosInstance;
|
|
1795
|
-
constructor(e, t,
|
|
1796
|
-
const
|
|
1815
|
+
constructor(e, t, s) {
|
|
1816
|
+
const n = s.host ?? "ipfs.infura.io", i = s.port ?? 5001, o = s.version ?? 0;
|
|
1797
1817
|
this._axiosInstance = L.create({
|
|
1798
|
-
baseURL: `https://${
|
|
1818
|
+
baseURL: `https://${n}:${i}/api/v${o}`,
|
|
1799
1819
|
auth: { username: e, password: t }
|
|
1800
1820
|
});
|
|
1801
1821
|
}
|
|
1802
1822
|
async uploadContent(e, t = !1) {
|
|
1803
1823
|
try {
|
|
1804
|
-
const
|
|
1805
|
-
if (
|
|
1806
|
-
return
|
|
1807
|
-
throw
|
|
1808
|
-
} catch (
|
|
1809
|
-
throw
|
|
1824
|
+
const s = { "Content-Type": "multipart/form-data" }, { data: n, status: i } = await this._axiosInstance.post(`add?recursive=${t}`, e, { headers: s });
|
|
1825
|
+
if (i === 200)
|
|
1826
|
+
return n;
|
|
1827
|
+
throw h(n);
|
|
1828
|
+
} catch (s) {
|
|
1829
|
+
throw h(s);
|
|
1810
1830
|
}
|
|
1811
1831
|
}
|
|
1812
1832
|
}
|
|
1813
1833
|
class Br {
|
|
1814
1834
|
_axiosInstance;
|
|
1815
1835
|
constructor(...e) {
|
|
1816
|
-
typeof e[0] == "string" && e[0].startsWith("http") ? this._axiosInstance = L.create({
|
|
1817
|
-
baseURL:
|
|
1836
|
+
typeof e[0] == "string" && e[0].startsWith("http") ? this._axiosInstance = L.create({
|
|
1837
|
+
baseURL: e[0],
|
|
1838
|
+
headers: {
|
|
1839
|
+
Authorization: `Bearer ${e[1]}`
|
|
1840
|
+
}
|
|
1841
|
+
}) : this._axiosInstance = L.create({
|
|
1842
|
+
baseURL: `https://${e[0]}.koios.rest/api/v${e[2] ?? 0}`,
|
|
1843
|
+
headers: {
|
|
1844
|
+
Authorization: `Bearer ${e[1]}`
|
|
1845
|
+
}
|
|
1818
1846
|
});
|
|
1819
1847
|
}
|
|
1820
1848
|
async fetchAccountInfo(e) {
|
|
1821
1849
|
try {
|
|
1822
|
-
const t = e.startsWith("addr") ?
|
|
1823
|
-
|
|
1850
|
+
const t = e.startsWith("addr") ? Tt(e) : e, { data: s, status: n } = await this._axiosInstance.post("account_info", {
|
|
1851
|
+
_stake_addresses: [t]
|
|
1852
|
+
});
|
|
1853
|
+
if (n === 200)
|
|
1824
1854
|
return {
|
|
1825
|
-
poolId:
|
|
1826
|
-
active:
|
|
1827
|
-
balance:
|
|
1828
|
-
rewards:
|
|
1829
|
-
withdrawals:
|
|
1855
|
+
poolId: s[0].delegated_pool,
|
|
1856
|
+
active: s[0].status === "registered",
|
|
1857
|
+
balance: s[0].total_balance.toString(),
|
|
1858
|
+
rewards: s[0].rewards_available,
|
|
1859
|
+
withdrawals: s[0].withdrawals
|
|
1830
1860
|
};
|
|
1831
|
-
throw
|
|
1861
|
+
throw h(s);
|
|
1832
1862
|
} catch (t) {
|
|
1833
|
-
throw
|
|
1863
|
+
throw h(t);
|
|
1834
1864
|
}
|
|
1835
1865
|
}
|
|
1836
1866
|
async fetchAddressUTxOs(e, t) {
|
|
1837
|
-
const r = (a) => {
|
|
1838
|
-
if (a) {
|
|
1839
|
-
const n = a.type.startsWith("plutus") ? {
|
|
1840
|
-
code: a.bytes,
|
|
1841
|
-
version: a.type.replace("plutus", "")
|
|
1842
|
-
} : Dt(bt(a.bytes));
|
|
1843
|
-
return ct(n).to_hex();
|
|
1844
|
-
}
|
|
1845
|
-
};
|
|
1846
1867
|
try {
|
|
1847
|
-
const { data:
|
|
1868
|
+
const { data: s, status: n } = await this._axiosInstance.post("address_info", {
|
|
1869
|
+
_addresses: [e]
|
|
1870
|
+
});
|
|
1848
1871
|
if (n === 200) {
|
|
1849
|
-
const
|
|
1850
|
-
|
|
1851
|
-
return {
|
|
1852
|
-
input: {
|
|
1853
|
-
outputIndex: c.tx_index,
|
|
1854
|
-
txHash: c.tx_hash
|
|
1855
|
-
},
|
|
1856
|
-
output: {
|
|
1857
|
-
address: e,
|
|
1858
|
-
amount: [
|
|
1859
|
-
{ unit: "lovelace", quantity: c.value },
|
|
1860
|
-
...c.asset_list.map((A) => ({
|
|
1861
|
-
unit: `${A.policy_id}${A.asset_name}`,
|
|
1862
|
-
quantity: `${A.quantity}`
|
|
1863
|
-
}))
|
|
1864
|
-
],
|
|
1865
|
-
dataHash: c.datum_hash ?? void 0,
|
|
1866
|
-
plutusData: ((u = c.inline_datum) == null ? void 0 : u.bytes) ?? void 0,
|
|
1867
|
-
scriptRef: r(c.reference_script)
|
|
1868
|
-
}
|
|
1869
|
-
};
|
|
1870
|
-
});
|
|
1871
|
-
return t !== void 0 ? o.filter((c) => c.output.amount.find((u) => u.unit === t) !== void 0) : o;
|
|
1872
|
+
const i = s.flatMap((o) => o.utxo_set).map((o) => this.toUTxO(o, e));
|
|
1873
|
+
return t !== void 0 ? i.filter((o) => o.output.amount.find((c) => c.unit === t) !== void 0) : i;
|
|
1872
1874
|
}
|
|
1873
|
-
throw
|
|
1875
|
+
throw h(s);
|
|
1874
1876
|
} catch {
|
|
1875
1877
|
return [];
|
|
1876
1878
|
}
|
|
1877
1879
|
}
|
|
1878
1880
|
async fetchAssetAddresses(e) {
|
|
1879
1881
|
try {
|
|
1880
|
-
const { policyId: t, assetName:
|
|
1881
|
-
if (
|
|
1882
|
-
return
|
|
1882
|
+
const { policyId: t, assetName: s } = tt(e), { data: n, status: i } = await this._axiosInstance.get(`asset_address_list?_asset_policy=${t}&_asset_name=${s}`);
|
|
1883
|
+
if (i === 200)
|
|
1884
|
+
return n.map((o) => ({
|
|
1883
1885
|
address: o.payment_address,
|
|
1884
1886
|
quantity: o.quantity
|
|
1885
1887
|
}));
|
|
1886
|
-
throw
|
|
1888
|
+
throw h(n);
|
|
1887
1889
|
} catch (t) {
|
|
1888
|
-
throw
|
|
1890
|
+
throw h(t);
|
|
1889
1891
|
}
|
|
1890
1892
|
}
|
|
1891
1893
|
async fetchAssetMetadata(e) {
|
|
1892
1894
|
try {
|
|
1893
|
-
const { policyId: t, assetName:
|
|
1894
|
-
if (
|
|
1895
|
+
const { policyId: t, assetName: s } = tt(e), { data: n, status: i } = await this._axiosInstance.get(`asset_info?_asset_policy=${t}&_asset_name=${s}`);
|
|
1896
|
+
if (i === 200)
|
|
1895
1897
|
return {
|
|
1896
|
-
...
|
|
1898
|
+
...n[0].minting_tx_metadata[721][t][Gt(s)]
|
|
1897
1899
|
};
|
|
1898
|
-
throw
|
|
1900
|
+
throw h(n);
|
|
1899
1901
|
} catch (t) {
|
|
1900
|
-
throw
|
|
1902
|
+
throw h(t);
|
|
1901
1903
|
}
|
|
1902
1904
|
}
|
|
1903
1905
|
async fetchBlockInfo(e) {
|
|
1904
1906
|
try {
|
|
1905
|
-
const { data: t, status:
|
|
1906
|
-
|
|
1907
|
+
const { data: t, status: s } = await this._axiosInstance.post("block_info", {
|
|
1908
|
+
_block_hashes: [e]
|
|
1909
|
+
});
|
|
1910
|
+
if (s === 200)
|
|
1907
1911
|
return {
|
|
1908
1912
|
confirmations: t[0].num_confirmations,
|
|
1909
1913
|
epoch: t[0].epoch_no,
|
|
@@ -1921,41 +1925,41 @@ class Br {
|
|
|
1921
1925
|
txCount: t[0].tx_count,
|
|
1922
1926
|
VRFKey: t[0].vrf_key
|
|
1923
1927
|
};
|
|
1924
|
-
throw
|
|
1928
|
+
throw h(t);
|
|
1925
1929
|
} catch (t) {
|
|
1926
|
-
throw
|
|
1930
|
+
throw h(t);
|
|
1927
1931
|
}
|
|
1928
1932
|
}
|
|
1929
1933
|
async fetchCollectionAssets(e, t = 0) {
|
|
1930
1934
|
try {
|
|
1931
|
-
const { data:
|
|
1932
|
-
if (
|
|
1935
|
+
const { data: s, status: n } = await this._axiosInstance.get(`asset_policy_info?_asset_policy=${e}&limit=100&offset=${t}`);
|
|
1936
|
+
if (n === 200)
|
|
1933
1937
|
return {
|
|
1934
|
-
assets:
|
|
1935
|
-
unit: `${e}${
|
|
1936
|
-
quantity:
|
|
1938
|
+
assets: s.map((i) => ({
|
|
1939
|
+
unit: `${e}${i.asset_name}`,
|
|
1940
|
+
quantity: i.total_supply
|
|
1937
1941
|
})),
|
|
1938
|
-
next:
|
|
1942
|
+
next: s.length === 100 ? t + 100 : null
|
|
1939
1943
|
};
|
|
1940
|
-
throw
|
|
1941
|
-
} catch (
|
|
1942
|
-
throw
|
|
1944
|
+
throw h(s);
|
|
1945
|
+
} catch (s) {
|
|
1946
|
+
throw h(s);
|
|
1943
1947
|
}
|
|
1944
1948
|
}
|
|
1945
1949
|
async fetchHandleAddress(e) {
|
|
1946
1950
|
try {
|
|
1947
|
-
const t = S(e.replace("$", "")), { data:
|
|
1948
|
-
if (
|
|
1949
|
-
return
|
|
1950
|
-
throw
|
|
1951
|
+
const t = S(e.replace("$", "")), { data: s, status: n } = await this._axiosInstance.get(`asset_address_list?_asset_policy=${Vt[1]}&_asset_name=${t}`);
|
|
1952
|
+
if (n === 200)
|
|
1953
|
+
return s[0].payment_address;
|
|
1954
|
+
throw h(s);
|
|
1951
1955
|
} catch (t) {
|
|
1952
|
-
throw
|
|
1956
|
+
throw h(t);
|
|
1953
1957
|
}
|
|
1954
1958
|
}
|
|
1955
1959
|
async fetchProtocolParameters(e) {
|
|
1956
1960
|
try {
|
|
1957
|
-
const { data: t, status:
|
|
1958
|
-
if (
|
|
1961
|
+
const { data: t, status: s } = await this._axiosInstance.get(`epoch_params?_epoch_no=${e}`);
|
|
1962
|
+
if (s === 200)
|
|
1959
1963
|
return {
|
|
1960
1964
|
coinsPerUTxOSize: t[0].coins_per_utxo_size,
|
|
1961
1965
|
collateralPercent: t[0].collateral_percent,
|
|
@@ -1978,104 +1982,151 @@ class Br {
|
|
|
1978
1982
|
priceMem: t[0].price_mem,
|
|
1979
1983
|
priceStep: t[0].price_step
|
|
1980
1984
|
};
|
|
1981
|
-
throw
|
|
1985
|
+
throw h(t);
|
|
1982
1986
|
} catch (t) {
|
|
1983
|
-
throw
|
|
1987
|
+
throw h(t);
|
|
1984
1988
|
}
|
|
1985
1989
|
}
|
|
1986
1990
|
async fetchTxInfo(e) {
|
|
1987
|
-
var t,
|
|
1991
|
+
var t, s;
|
|
1988
1992
|
try {
|
|
1989
|
-
const { data:
|
|
1990
|
-
|
|
1993
|
+
const { data: n, status: i } = await this._axiosInstance.post("tx_info", {
|
|
1994
|
+
_tx_hashes: [e]
|
|
1995
|
+
});
|
|
1996
|
+
if (i === 200)
|
|
1991
1997
|
return {
|
|
1992
|
-
block:
|
|
1993
|
-
deposit:
|
|
1994
|
-
fees:
|
|
1995
|
-
hash:
|
|
1996
|
-
index:
|
|
1997
|
-
invalidAfter: ((t =
|
|
1998
|
-
invalidBefore: ((
|
|
1999
|
-
slot:
|
|
2000
|
-
size:
|
|
1998
|
+
block: n[0].block_hash,
|
|
1999
|
+
deposit: n[0].deposit,
|
|
2000
|
+
fees: n[0].fee,
|
|
2001
|
+
hash: n[0].tx_hash,
|
|
2002
|
+
index: n[0].tx_block_index,
|
|
2003
|
+
invalidAfter: ((t = n[0].invalid_after) == null ? void 0 : t.toString()) ?? "",
|
|
2004
|
+
invalidBefore: ((s = n[0].invalid_before) == null ? void 0 : s.toString()) ?? "",
|
|
2005
|
+
slot: n[0].absolute_slot.toString(),
|
|
2006
|
+
size: n[0].tx_size
|
|
2001
2007
|
};
|
|
2002
|
-
throw
|
|
2003
|
-
} catch (
|
|
2004
|
-
throw
|
|
2008
|
+
throw h(n);
|
|
2009
|
+
} catch (n) {
|
|
2010
|
+
throw h(n);
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
async fetchUTxOs(e) {
|
|
2014
|
+
try {
|
|
2015
|
+
console.log("hi");
|
|
2016
|
+
const { data: t, status: s } = await this._axiosInstance.post("tx_info", {
|
|
2017
|
+
_tx_hashes: [e]
|
|
2018
|
+
});
|
|
2019
|
+
if (s === 200)
|
|
2020
|
+
return console.log(t[0]), t[0].outputs.map((i) => this.toUTxO(i, i.payment_addr.bech32));
|
|
2021
|
+
throw h(t);
|
|
2022
|
+
} catch (t) {
|
|
2023
|
+
throw h(t);
|
|
2005
2024
|
}
|
|
2006
2025
|
}
|
|
2007
|
-
onTxConfirmed(e, t,
|
|
2008
|
-
let
|
|
2009
|
-
const
|
|
2010
|
-
|
|
2026
|
+
onTxConfirmed(e, t, s = 100) {
|
|
2027
|
+
let n = 0;
|
|
2028
|
+
const i = setInterval(() => {
|
|
2029
|
+
n >= s && clearInterval(i), this.fetchTxInfo(e).then((o) => {
|
|
2011
2030
|
this.fetchBlockInfo(o.block).then((c) => {
|
|
2012
|
-
(c == null ? void 0 : c.confirmations) > 0 && (clearInterval(
|
|
2031
|
+
(c == null ? void 0 : c.confirmations) > 0 && (clearInterval(i), t());
|
|
2013
2032
|
}).catch(() => {
|
|
2014
|
-
|
|
2033
|
+
n += 1;
|
|
2015
2034
|
});
|
|
2016
2035
|
}).catch(() => {
|
|
2017
|
-
|
|
2036
|
+
n += 1;
|
|
2018
2037
|
});
|
|
2019
2038
|
}, 5e3);
|
|
2020
2039
|
}
|
|
2021
2040
|
async submitTx(e) {
|
|
2022
2041
|
try {
|
|
2023
|
-
const t = { "Content-Type": "application/cbor" }, { data:
|
|
2024
|
-
if (
|
|
2025
|
-
return
|
|
2026
|
-
throw
|
|
2042
|
+
const t = { "Content-Type": "application/cbor" }, { data: s, status: n } = await this._axiosInstance.post("submittx", I(e), { headers: t });
|
|
2043
|
+
if (n === 202)
|
|
2044
|
+
return s;
|
|
2045
|
+
throw h(s);
|
|
2027
2046
|
} catch (t) {
|
|
2028
|
-
throw
|
|
2047
|
+
throw h(t);
|
|
2029
2048
|
}
|
|
2030
2049
|
}
|
|
2050
|
+
toUTxO(e, t) {
|
|
2051
|
+
var s, n;
|
|
2052
|
+
return {
|
|
2053
|
+
input: {
|
|
2054
|
+
outputIndex: e.tx_index,
|
|
2055
|
+
txHash: e.tx_hash
|
|
2056
|
+
},
|
|
2057
|
+
output: {
|
|
2058
|
+
address: t,
|
|
2059
|
+
amount: [
|
|
2060
|
+
{ unit: "lovelace", quantity: e.value },
|
|
2061
|
+
...e.asset_list.map((i) => ({
|
|
2062
|
+
unit: `${i.policy_id}${i.asset_name}`,
|
|
2063
|
+
quantity: `${i.quantity}`
|
|
2064
|
+
}))
|
|
2065
|
+
],
|
|
2066
|
+
dataHash: e.datum_hash ?? void 0,
|
|
2067
|
+
plutusData: ((s = e.inline_datum) == null ? void 0 : s.bytes) ?? void 0,
|
|
2068
|
+
scriptRef: this.resolveScriptRef(e.reference_script),
|
|
2069
|
+
scriptHash: ((n = e.reference_script) == null ? void 0 : n.hash) ?? void 0
|
|
2070
|
+
}
|
|
2071
|
+
};
|
|
2072
|
+
}
|
|
2073
|
+
resolveScriptRef = (e) => {
|
|
2074
|
+
if (e) {
|
|
2075
|
+
const t = e.type.startsWith("plutus") ? {
|
|
2076
|
+
code: e.bytes,
|
|
2077
|
+
version: e.type.replace("plutus", "")
|
|
2078
|
+
} : Dt(vt(e.bytes));
|
|
2079
|
+
return ut(t).to_hex();
|
|
2080
|
+
}
|
|
2081
|
+
};
|
|
2031
2082
|
}
|
|
2032
|
-
class
|
|
2083
|
+
class Er {
|
|
2033
2084
|
_baseUrl;
|
|
2034
2085
|
constructor(...e) {
|
|
2035
|
-
this._baseUrl =
|
|
2086
|
+
this._baseUrl = es(e[0]) ? ns[e[0]] : e[0];
|
|
2036
2087
|
}
|
|
2037
2088
|
async evaluateTx(e) {
|
|
2038
2089
|
const t = await this.open();
|
|
2039
2090
|
return this.send(t, "EvaluateTx", {
|
|
2040
2091
|
evaluate: e
|
|
2041
|
-
}), new Promise((
|
|
2042
|
-
t.addEventListener("message", (
|
|
2092
|
+
}), new Promise((s, n) => {
|
|
2093
|
+
t.addEventListener("message", (i) => {
|
|
2043
2094
|
try {
|
|
2044
|
-
const { result: o } = JSON.parse(
|
|
2045
|
-
o.EvaluationResult ?
|
|
2095
|
+
const { result: o } = JSON.parse(i.data);
|
|
2096
|
+
o.EvaluationResult ? s(Object.keys(o.EvaluationResult).map((c) => ({
|
|
2046
2097
|
index: parseInt(c.split(":")[1], 10),
|
|
2047
2098
|
tag: c.split(":")[0].toUpperCase(),
|
|
2048
2099
|
budget: {
|
|
2049
2100
|
mem: o.EvaluationResult[c].memory,
|
|
2050
2101
|
steps: o.EvaluationResult[c].steps
|
|
2051
2102
|
}
|
|
2052
|
-
}))) :
|
|
2103
|
+
}))) : n(o.EvaluationFailure), t.close();
|
|
2053
2104
|
} catch (o) {
|
|
2054
|
-
|
|
2105
|
+
n(o);
|
|
2055
2106
|
}
|
|
2056
2107
|
}, { once: !0 });
|
|
2057
2108
|
});
|
|
2058
2109
|
}
|
|
2059
2110
|
async onNextTx(e) {
|
|
2060
2111
|
const t = await this.open();
|
|
2061
|
-
return this.send(t, "AwaitAcquire", {}), t.addEventListener("message", (
|
|
2062
|
-
const { result:
|
|
2063
|
-
if (
|
|
2112
|
+
return this.send(t, "AwaitAcquire", {}), t.addEventListener("message", (s) => {
|
|
2113
|
+
const { result: n } = JSON.parse(s.data);
|
|
2114
|
+
if (n === null)
|
|
2064
2115
|
return this.send(t, "AwaitAcquire", {});
|
|
2065
|
-
|
|
2116
|
+
n.AwaitAcquired === void 0 && e(n), this.send(t, "NextTx", {});
|
|
2066
2117
|
}), () => t.close();
|
|
2067
2118
|
}
|
|
2068
2119
|
async submitTx(e) {
|
|
2069
2120
|
const t = await this.open();
|
|
2070
2121
|
return this.send(t, "SubmitTx", {
|
|
2071
2122
|
submit: e
|
|
2072
|
-
}), new Promise((
|
|
2073
|
-
t.addEventListener("message", (
|
|
2123
|
+
}), new Promise((s, n) => {
|
|
2124
|
+
t.addEventListener("message", (i) => {
|
|
2074
2125
|
try {
|
|
2075
|
-
const { result: o } = JSON.parse(
|
|
2076
|
-
o.SubmitSuccess ?
|
|
2126
|
+
const { result: o } = JSON.parse(i.data);
|
|
2127
|
+
o.SubmitSuccess ? s(o.SubmitSuccess.txId) : n(o.SubmitFail), t.close();
|
|
2077
2128
|
} catch (o) {
|
|
2078
|
-
|
|
2129
|
+
n(o);
|
|
2079
2130
|
}
|
|
2080
2131
|
}, { once: !0 });
|
|
2081
2132
|
});
|
|
@@ -2086,119 +2137,124 @@ class xr {
|
|
|
2086
2137
|
e.addEventListener("open", () => t(!0), { once: !0 });
|
|
2087
2138
|
}), e;
|
|
2088
2139
|
}
|
|
2089
|
-
send(e, t,
|
|
2140
|
+
send(e, t, s) {
|
|
2090
2141
|
e.send(JSON.stringify({
|
|
2091
2142
|
version: "1.0",
|
|
2092
2143
|
type: "jsonwsp/request",
|
|
2093
2144
|
servicename: "ogmios",
|
|
2094
2145
|
methodname: t,
|
|
2095
|
-
args:
|
|
2146
|
+
args: s
|
|
2096
2147
|
}));
|
|
2097
2148
|
}
|
|
2098
2149
|
}
|
|
2099
|
-
class
|
|
2150
|
+
class Sr {
|
|
2100
2151
|
_axiosInstance;
|
|
2101
|
-
constructor(e, t,
|
|
2152
|
+
constructor(e, t, s, n = 1) {
|
|
2102
2153
|
this._axiosInstance = L.create({
|
|
2103
|
-
baseURL: `https://cardano-${e}.tangocrypto.com/${t}/v${
|
|
2104
|
-
headers: { "x-api-key":
|
|
2154
|
+
baseURL: `https://cardano-${e}.tangocrypto.com/${t}/v${n}`,
|
|
2155
|
+
headers: { "x-api-key": s }
|
|
2105
2156
|
});
|
|
2106
2157
|
}
|
|
2107
2158
|
async evaluateTx(e) {
|
|
2108
2159
|
try {
|
|
2109
|
-
const { data: t, status:
|
|
2110
|
-
if (
|
|
2111
|
-
return t.redeemers.map((
|
|
2112
|
-
index:
|
|
2113
|
-
tag:
|
|
2160
|
+
const { data: t, status: s } = await this._axiosInstance.post("transactions/evaluate", { tx: e, utxos: [] });
|
|
2161
|
+
if (s === 200)
|
|
2162
|
+
return t.redeemers.map((n) => ({
|
|
2163
|
+
index: n.index,
|
|
2164
|
+
tag: n.purpose.toUpperCase(),
|
|
2114
2165
|
budget: {
|
|
2115
|
-
mem:
|
|
2116
|
-
steps:
|
|
2166
|
+
mem: n.unit_mem,
|
|
2167
|
+
steps: n.unit_steps
|
|
2117
2168
|
}
|
|
2118
2169
|
}));
|
|
2119
|
-
throw
|
|
2170
|
+
throw h(t);
|
|
2120
2171
|
} catch (t) {
|
|
2121
|
-
throw
|
|
2172
|
+
throw h(t);
|
|
2122
2173
|
}
|
|
2123
2174
|
}
|
|
2124
2175
|
async fetchAccountInfo(e) {
|
|
2125
2176
|
try {
|
|
2126
|
-
const t = e.startsWith("addr") ?
|
|
2127
|
-
if (
|
|
2177
|
+
const t = e.startsWith("addr") ? Tt(e) : e, { data: s, status: n } = await this._axiosInstance.get(`wallets/${t}`);
|
|
2178
|
+
if (n === 200)
|
|
2128
2179
|
return {
|
|
2129
|
-
poolId:
|
|
2130
|
-
active:
|
|
2131
|
-
balance:
|
|
2132
|
-
rewards:
|
|
2133
|
-
withdrawals:
|
|
2180
|
+
poolId: s.pool_id,
|
|
2181
|
+
active: s.active,
|
|
2182
|
+
balance: s.controlled_total_stake,
|
|
2183
|
+
rewards: s.rewards_sum,
|
|
2184
|
+
withdrawals: s.withdrawals_sum
|
|
2134
2185
|
};
|
|
2135
|
-
throw
|
|
2186
|
+
throw h(s);
|
|
2136
2187
|
} catch (t) {
|
|
2137
|
-
throw
|
|
2188
|
+
throw h(t);
|
|
2138
2189
|
}
|
|
2139
2190
|
}
|
|
2140
2191
|
async fetchAddressUTxOs(e, t) {
|
|
2141
|
-
const
|
|
2192
|
+
const s = t !== void 0 ? `/assets/${t}` : "", n = `addresses/${e}${s}/utxos?size=50`, i = async (d = "", A = []) => {
|
|
2142
2193
|
var f;
|
|
2143
|
-
const { data:
|
|
2144
|
-
if (
|
|
2145
|
-
return
|
|
2146
|
-
throw
|
|
2147
|
-
}, o = (
|
|
2148
|
-
const
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2194
|
+
const { data: l, status: g } = await this._axiosInstance.get(`${n}&cursor=${d}`);
|
|
2195
|
+
if (g === 200)
|
|
2196
|
+
return l.cursor !== null && ((f = l.cursor) == null ? void 0 : f.length) > 0 ? i(l.cursor, [...A, ...l.data.map(u)]) : l.data.map(u);
|
|
2197
|
+
throw h(l);
|
|
2198
|
+
}, o = (d, A) => {
|
|
2199
|
+
const l = [
|
|
2200
|
+
{
|
|
2201
|
+
unit: "lovelace",
|
|
2202
|
+
quantity: d.toString()
|
|
2203
|
+
}
|
|
2204
|
+
];
|
|
2205
|
+
return A.forEach((g) => {
|
|
2206
|
+
const f = S(g.asset_name);
|
|
2207
|
+
l.push({
|
|
2208
|
+
unit: `${g.policy_id}${f}`,
|
|
2209
|
+
quantity: g.quantity.toString()
|
|
2157
2210
|
});
|
|
2158
|
-
}),
|
|
2159
|
-
}, c = (
|
|
2160
|
-
if (
|
|
2161
|
-
const
|
|
2162
|
-
code:
|
|
2163
|
-
version:
|
|
2164
|
-
} : Dt(
|
|
2165
|
-
return
|
|
2211
|
+
}), l;
|
|
2212
|
+
}, c = (d) => {
|
|
2213
|
+
if (d) {
|
|
2214
|
+
const A = d.type.startsWith("plutus") ? {
|
|
2215
|
+
code: d.code,
|
|
2216
|
+
version: d.type.replace("plutus", "")
|
|
2217
|
+
} : Dt(vt(d.json));
|
|
2218
|
+
return ut(A).to_hex();
|
|
2166
2219
|
}
|
|
2167
|
-
}, u = (
|
|
2168
|
-
var
|
|
2220
|
+
}, u = (d) => {
|
|
2221
|
+
var A;
|
|
2169
2222
|
return {
|
|
2170
2223
|
input: {
|
|
2171
|
-
outputIndex:
|
|
2172
|
-
txHash:
|
|
2224
|
+
outputIndex: d.index,
|
|
2225
|
+
txHash: d.hash
|
|
2173
2226
|
},
|
|
2174
2227
|
output: {
|
|
2175
2228
|
address: e,
|
|
2176
|
-
amount: o(
|
|
2229
|
+
amount: o(d.value, d.assets),
|
|
2177
2230
|
dataHash: void 0,
|
|
2178
|
-
plutusData: ((
|
|
2179
|
-
scriptRef: c(
|
|
2231
|
+
plutusData: ((A = d.inline_datum) == null ? void 0 : A.value_raw) ?? void 0,
|
|
2232
|
+
scriptRef: c(d.reference_script)
|
|
2180
2233
|
}
|
|
2181
2234
|
};
|
|
2182
2235
|
};
|
|
2183
2236
|
try {
|
|
2184
|
-
return await
|
|
2237
|
+
return await i();
|
|
2185
2238
|
} catch {
|
|
2186
2239
|
return [];
|
|
2187
2240
|
}
|
|
2188
2241
|
}
|
|
2189
2242
|
async fetchAssetAddresses(e) {
|
|
2190
|
-
const t = (
|
|
2191
|
-
address:
|
|
2192
|
-
quantity:
|
|
2193
|
-
}),
|
|
2194
|
-
var
|
|
2195
|
-
const { policyId: o, assetName: c } =
|
|
2196
|
-
if (
|
|
2197
|
-
return u.cursor !== null && ((
|
|
2198
|
-
|
|
2243
|
+
const t = (n) => ({
|
|
2244
|
+
address: n.address,
|
|
2245
|
+
quantity: n.quantity.toString()
|
|
2246
|
+
}), s = async (n = "", i = []) => {
|
|
2247
|
+
var A;
|
|
2248
|
+
const { policyId: o, assetName: c } = tt(e), { data: u, status: d } = await this._axiosInstance.get(`assets/${o}${c}/addresses?size=100&cursor=${n}`);
|
|
2249
|
+
if (d === 200)
|
|
2250
|
+
return u.cursor !== null && ((A = u.cursor) == null ? void 0 : A.length) > 0 ? s(u.cursor, [
|
|
2251
|
+
...i,
|
|
2252
|
+
...u.data.map(t)
|
|
2253
|
+
]) : u.data.map(t);
|
|
2254
|
+
throw h(u);
|
|
2199
2255
|
};
|
|
2200
2256
|
try {
|
|
2201
|
-
return await
|
|
2257
|
+
return await s();
|
|
2202
2258
|
} catch {
|
|
2203
2259
|
return [];
|
|
2204
2260
|
}
|
|
@@ -2206,20 +2262,20 @@ class Er {
|
|
|
2206
2262
|
async fetchAssetMetadata(e) {
|
|
2207
2263
|
var t;
|
|
2208
2264
|
try {
|
|
2209
|
-
const { policyId:
|
|
2265
|
+
const { policyId: s, assetName: n } = tt(e), { data: i, status: o } = await this._axiosInstance.get(`assets/${s}${n}`);
|
|
2210
2266
|
if (o === 200)
|
|
2211
2267
|
return {
|
|
2212
|
-
...(t =
|
|
2268
|
+
...(t = i.metadata.find((c) => c.label === 721)) == null ? void 0 : t.json[s][Gt(n)]
|
|
2213
2269
|
};
|
|
2214
|
-
throw
|
|
2215
|
-
} catch (
|
|
2216
|
-
throw
|
|
2270
|
+
throw h(i);
|
|
2271
|
+
} catch (s) {
|
|
2272
|
+
throw h(s);
|
|
2217
2273
|
}
|
|
2218
2274
|
}
|
|
2219
2275
|
async fetchBlockInfo(e) {
|
|
2220
2276
|
try {
|
|
2221
|
-
const { data: t, status:
|
|
2222
|
-
if (
|
|
2277
|
+
const { data: t, status: s } = await this._axiosInstance.get(`blocks/${e}`);
|
|
2278
|
+
if (s === 200)
|
|
2223
2279
|
return {
|
|
2224
2280
|
confirmations: t.confirmations,
|
|
2225
2281
|
epoch: t.epoch_no,
|
|
@@ -2237,41 +2293,41 @@ class Er {
|
|
|
2237
2293
|
txCount: t.tx_count,
|
|
2238
2294
|
VRFKey: t.vrf_key
|
|
2239
2295
|
};
|
|
2240
|
-
throw
|
|
2296
|
+
throw h(t);
|
|
2241
2297
|
} catch (t) {
|
|
2242
|
-
throw
|
|
2298
|
+
throw h(t);
|
|
2243
2299
|
}
|
|
2244
2300
|
}
|
|
2245
2301
|
async fetchCollectionAssets(e, t = "") {
|
|
2246
2302
|
try {
|
|
2247
|
-
const { data:
|
|
2248
|
-
if (
|
|
2303
|
+
const { data: s, status: n } = await this._axiosInstance.get(`policies/${e}/assets?size=100&cursor=${t}`);
|
|
2304
|
+
if (n === 200)
|
|
2249
2305
|
return {
|
|
2250
|
-
assets:
|
|
2251
|
-
unit: `${
|
|
2252
|
-
quantity:
|
|
2306
|
+
assets: s.data.map((i) => ({
|
|
2307
|
+
unit: `${i.policy_id}${i.asset_name}`,
|
|
2308
|
+
quantity: i.quantity
|
|
2253
2309
|
})),
|
|
2254
|
-
next:
|
|
2310
|
+
next: s.cursor
|
|
2255
2311
|
};
|
|
2256
|
-
throw
|
|
2312
|
+
throw h(s);
|
|
2257
2313
|
} catch {
|
|
2258
2314
|
return { assets: [], next: null };
|
|
2259
2315
|
}
|
|
2260
2316
|
}
|
|
2261
2317
|
async fetchHandleAddress(e) {
|
|
2262
2318
|
try {
|
|
2263
|
-
const t = S(e.replace("$", "")), { data:
|
|
2264
|
-
if (
|
|
2265
|
-
return
|
|
2266
|
-
throw
|
|
2319
|
+
const t = S(e.replace("$", "")), { data: s, status: n } = await this._axiosInstance.get(`assets/${Vt[1]}${t}/addresses`);
|
|
2320
|
+
if (n === 200)
|
|
2321
|
+
return s.data[0].address;
|
|
2322
|
+
throw h(s);
|
|
2267
2323
|
} catch (t) {
|
|
2268
|
-
throw
|
|
2324
|
+
throw h(t);
|
|
2269
2325
|
}
|
|
2270
2326
|
}
|
|
2271
2327
|
async fetchProtocolParameters(e) {
|
|
2272
2328
|
try {
|
|
2273
|
-
const { data: t, status:
|
|
2274
|
-
if (
|
|
2329
|
+
const { data: t, status: s } = await this._axiosInstance.get(`epochs/${e}/parameters`);
|
|
2330
|
+
if (s === 200)
|
|
2275
2331
|
return {
|
|
2276
2332
|
coinsPerUTxOSize: t.coins_per_utxo_size.toString(),
|
|
2277
2333
|
collateralPercent: t.collateral_percent,
|
|
@@ -2294,15 +2350,15 @@ class Er {
|
|
|
2294
2350
|
priceMem: t.price_mem,
|
|
2295
2351
|
priceStep: t.price_step
|
|
2296
2352
|
};
|
|
2297
|
-
throw
|
|
2353
|
+
throw h(t);
|
|
2298
2354
|
} catch (t) {
|
|
2299
|
-
throw
|
|
2355
|
+
throw h(t);
|
|
2300
2356
|
}
|
|
2301
2357
|
}
|
|
2302
2358
|
async fetchTxInfo(e) {
|
|
2303
2359
|
try {
|
|
2304
|
-
const { data: t, status:
|
|
2305
|
-
if (
|
|
2360
|
+
const { data: t, status: s } = await this._axiosInstance.get(`transactions/${e}`);
|
|
2361
|
+
if (s === 200)
|
|
2306
2362
|
return {
|
|
2307
2363
|
block: t.block.hash,
|
|
2308
2364
|
deposit: t.deposit,
|
|
@@ -2314,338 +2370,386 @@ class Er {
|
|
|
2314
2370
|
slot: t.block.slot_no.toString(),
|
|
2315
2371
|
size: t.size
|
|
2316
2372
|
};
|
|
2317
|
-
throw
|
|
2373
|
+
throw h(t);
|
|
2318
2374
|
} catch (t) {
|
|
2319
|
-
throw
|
|
2375
|
+
throw h(t);
|
|
2320
2376
|
}
|
|
2321
2377
|
}
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2378
|
+
async fetchUTxOs(e) {
|
|
2379
|
+
try {
|
|
2380
|
+
return [];
|
|
2381
|
+
} catch (t) {
|
|
2382
|
+
throw h(t);
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2385
|
+
onTxConfirmed(e, t, s = 100) {
|
|
2386
|
+
let n = 0;
|
|
2387
|
+
const i = setInterval(() => {
|
|
2388
|
+
n >= s && clearInterval(i), this.fetchTxInfo(e).then((o) => {
|
|
2326
2389
|
this.fetchBlockInfo(o.block).then((c) => {
|
|
2327
|
-
(c == null ? void 0 : c.confirmations) > 0 && (clearInterval(
|
|
2390
|
+
(c == null ? void 0 : c.confirmations) > 0 && (clearInterval(i), t());
|
|
2328
2391
|
}).catch(() => {
|
|
2329
|
-
|
|
2392
|
+
n += 1;
|
|
2330
2393
|
});
|
|
2331
2394
|
}).catch(() => {
|
|
2332
|
-
|
|
2395
|
+
n += 1;
|
|
2333
2396
|
});
|
|
2334
2397
|
}, 5e3);
|
|
2335
2398
|
}
|
|
2336
2399
|
async submitTx(e) {
|
|
2337
2400
|
try {
|
|
2338
|
-
const t = { "Content-Type": "application/json" }, { data:
|
|
2339
|
-
if (
|
|
2340
|
-
return
|
|
2341
|
-
throw
|
|
2401
|
+
const t = { "Content-Type": "application/json" }, { data: s, status: n } = await this._axiosInstance.post("transactions/submit", { tx: e }, { headers: t });
|
|
2402
|
+
if (n === 200)
|
|
2403
|
+
return s.tx_id;
|
|
2404
|
+
throw h(s);
|
|
2342
2405
|
} catch (t) {
|
|
2343
|
-
throw
|
|
2406
|
+
throw h(t);
|
|
2344
2407
|
}
|
|
2345
2408
|
}
|
|
2346
2409
|
}
|
|
2347
|
-
class
|
|
2410
|
+
class Qr {
|
|
2348
2411
|
_axiosInstance;
|
|
2412
|
+
_amountsAsStrings = {
|
|
2413
|
+
headers: {
|
|
2414
|
+
"amounts-as-strings": "true"
|
|
2415
|
+
}
|
|
2416
|
+
};
|
|
2349
2417
|
submitUrl;
|
|
2350
|
-
constructor({ network: e, apiKey: t, turboSubmit:
|
|
2418
|
+
constructor({ network: e, apiKey: t, turboSubmit: s = !1 }) {
|
|
2351
2419
|
this._axiosInstance = L.create({
|
|
2352
2420
|
baseURL: `https://${e}.gomaestro-api.org/v1`,
|
|
2353
2421
|
headers: { "api-key": t }
|
|
2354
|
-
}), this.submitUrl =
|
|
2422
|
+
}), this.submitUrl = s ? "txmanager/turbosubmit" : "txmanager";
|
|
2423
|
+
}
|
|
2424
|
+
async evaluateTx(e) {
|
|
2425
|
+
try {
|
|
2426
|
+
const { data: t, status: s } = await this._axiosInstance.post("transactions/evaluate", { cbor: e });
|
|
2427
|
+
if (s === 200) {
|
|
2428
|
+
const n = {
|
|
2429
|
+
spend: "SPEND",
|
|
2430
|
+
mint: "MINT",
|
|
2431
|
+
cert: "CERT",
|
|
2432
|
+
wdrl: "REWARD"
|
|
2433
|
+
};
|
|
2434
|
+
return t.map((o) => {
|
|
2435
|
+
const c = o.ex_units, u = o.redeemer_index, d = n[o.redeemer_tag];
|
|
2436
|
+
return { budget: c, index: u, tag: d };
|
|
2437
|
+
});
|
|
2438
|
+
}
|
|
2439
|
+
throw h(t);
|
|
2440
|
+
} catch (t) {
|
|
2441
|
+
throw h(t);
|
|
2442
|
+
}
|
|
2355
2443
|
}
|
|
2356
2444
|
async fetchAccountInfo(e) {
|
|
2357
|
-
const t = e.startsWith("addr") ?
|
|
2445
|
+
const t = e.startsWith("addr") ? Tt(e) : e;
|
|
2358
2446
|
try {
|
|
2359
|
-
const { data:
|
|
2360
|
-
if (
|
|
2361
|
-
const
|
|
2447
|
+
const { data: s, status: n } = await this._axiosInstance.get(`accounts/${t}`, this._amountsAsStrings);
|
|
2448
|
+
if (n === 200) {
|
|
2449
|
+
const i = s.data;
|
|
2362
2450
|
return {
|
|
2363
|
-
poolId:
|
|
2364
|
-
active:
|
|
2365
|
-
balance:
|
|
2366
|
-
rewards:
|
|
2367
|
-
withdrawals:
|
|
2451
|
+
poolId: i.delegated_pool,
|
|
2452
|
+
active: i.registered,
|
|
2453
|
+
balance: i.total_balance,
|
|
2454
|
+
rewards: i.rewards_available,
|
|
2455
|
+
withdrawals: i.total_withdrawn
|
|
2368
2456
|
};
|
|
2369
2457
|
}
|
|
2370
|
-
throw
|
|
2371
|
-
} catch (
|
|
2372
|
-
throw
|
|
2458
|
+
throw h(s);
|
|
2459
|
+
} catch (s) {
|
|
2460
|
+
throw h(s);
|
|
2373
2461
|
}
|
|
2374
2462
|
}
|
|
2375
2463
|
async fetchAddressUTxOs(e, t) {
|
|
2376
|
-
const
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
};
|
|
2382
|
-
return ct(A).to_hex();
|
|
2383
|
-
} else
|
|
2384
|
-
return;
|
|
2385
|
-
}, o = async (u = null, A = []) => {
|
|
2386
|
-
const l = u === null ? "" : `&cursor=${u}`, { data: g, status: I } = await this._axiosInstance.get(`${r}/utxos?count=100${a}${l}`);
|
|
2387
|
-
if (I === 200) {
|
|
2388
|
-
const y = g.data.map(c), b = [...A, ...y], k = g.next_cursor;
|
|
2389
|
-
return k == null ? b : o(k, b);
|
|
2464
|
+
const s = (() => e.startsWith("addr_vkh") || e.startsWith("addr_shared_vkh") ? `addresses/cred/${e}` : `addresses/${e}`)(), n = t ? `&asset=${t}` : "", i = async (o = null, c = []) => {
|
|
2465
|
+
const u = o === null ? "" : `&cursor=${o}`, { data: d, status: A } = await this._axiosInstance.get(`${s}/utxos?count=100${n}${u}`, this._amountsAsStrings);
|
|
2466
|
+
if (A === 200) {
|
|
2467
|
+
const g = d.data.map(this.toUTxO), f = [...c, ...g], y = d.next_cursor;
|
|
2468
|
+
return y == null ? f : i(y, f);
|
|
2390
2469
|
}
|
|
2391
|
-
throw d
|
|
2392
|
-
}, c = (u) => {
|
|
2393
|
-
var A, l;
|
|
2394
|
-
return {
|
|
2395
|
-
input: {
|
|
2396
|
-
outputIndex: u.index,
|
|
2397
|
-
txHash: u.tx_hash
|
|
2398
|
-
},
|
|
2399
|
-
output: {
|
|
2400
|
-
address: e,
|
|
2401
|
-
amount: u.assets.map((g) => ({
|
|
2402
|
-
unit: g.unit,
|
|
2403
|
-
quantity: g.amount.toString()
|
|
2404
|
-
})),
|
|
2405
|
-
dataHash: (A = u.datum) == null ? void 0 : A.hash,
|
|
2406
|
-
plutusData: (l = u.datum) == null ? void 0 : l.bytes,
|
|
2407
|
-
scriptRef: n(u)
|
|
2408
|
-
}
|
|
2409
|
-
};
|
|
2470
|
+
throw h(d);
|
|
2410
2471
|
};
|
|
2411
2472
|
try {
|
|
2412
|
-
return await
|
|
2473
|
+
return await i();
|
|
2413
2474
|
} catch {
|
|
2414
2475
|
return [];
|
|
2415
2476
|
}
|
|
2416
2477
|
}
|
|
2417
2478
|
async fetchAssetAddresses(e) {
|
|
2418
|
-
const { policyId: t, assetName:
|
|
2419
|
-
const c =
|
|
2420
|
-
if (
|
|
2421
|
-
const
|
|
2422
|
-
|
|
2479
|
+
const { policyId: t, assetName: s } = tt(e), n = async (i = null, o = []) => {
|
|
2480
|
+
const c = i === null ? "" : `&cursor=${i}`, { data: u, status: d } = await this._axiosInstance.get(`assets/${t}${s}/addresses?count=100${c}`, this._amountsAsStrings);
|
|
2481
|
+
if (d === 200) {
|
|
2482
|
+
const l = u.data.map((y) => ({ address: y.address, quantity: y.amount })), g = u.next_cursor, f = [
|
|
2483
|
+
...o,
|
|
2484
|
+
...l
|
|
2485
|
+
];
|
|
2486
|
+
return g == null ? f : n(g, f);
|
|
2423
2487
|
}
|
|
2424
|
-
throw
|
|
2488
|
+
throw h(u);
|
|
2425
2489
|
};
|
|
2426
2490
|
try {
|
|
2427
|
-
return await
|
|
2491
|
+
return await n();
|
|
2428
2492
|
} catch {
|
|
2429
2493
|
return [];
|
|
2430
2494
|
}
|
|
2431
2495
|
}
|
|
2432
2496
|
async fetchAssetMetadata(e) {
|
|
2433
2497
|
try {
|
|
2434
|
-
const { policyId: t, assetName:
|
|
2435
|
-
if (
|
|
2436
|
-
const o =
|
|
2498
|
+
const { policyId: t, assetName: s } = tt(e), { data: n, status: i } = await this._axiosInstance.get(`assets/${t}${s}`);
|
|
2499
|
+
if (i === 200) {
|
|
2500
|
+
const o = n.data;
|
|
2437
2501
|
return {
|
|
2438
2502
|
...o.asset_standards.cip25_metadata,
|
|
2439
2503
|
...o.asset_standards.cip68_metadata
|
|
2440
2504
|
};
|
|
2441
2505
|
}
|
|
2442
|
-
throw
|
|
2506
|
+
throw h(n);
|
|
2443
2507
|
} catch (t) {
|
|
2444
|
-
throw
|
|
2508
|
+
throw h(t);
|
|
2445
2509
|
}
|
|
2446
2510
|
}
|
|
2447
2511
|
async fetchBlockInfo(e) {
|
|
2448
2512
|
var t;
|
|
2449
2513
|
try {
|
|
2450
|
-
const { data:
|
|
2451
|
-
if (
|
|
2452
|
-
const
|
|
2514
|
+
const { data: s, status: n } = await this._axiosInstance.get(`blocks/${e}`, this._amountsAsStrings);
|
|
2515
|
+
if (n === 200) {
|
|
2516
|
+
const i = s.data;
|
|
2453
2517
|
return {
|
|
2454
|
-
confirmations:
|
|
2455
|
-
epoch:
|
|
2456
|
-
epochSlot:
|
|
2457
|
-
fees:
|
|
2458
|
-
hash:
|
|
2459
|
-
nextBlock:
|
|
2460
|
-
operationalCertificate: (t =
|
|
2461
|
-
output:
|
|
2462
|
-
previousBlock:
|
|
2463
|
-
size:
|
|
2464
|
-
slot:
|
|
2465
|
-
slotLeader:
|
|
2466
|
-
time: Date.parse(
|
|
2467
|
-
txCount:
|
|
2468
|
-
VRFKey:
|
|
2518
|
+
confirmations: i.confirmations,
|
|
2519
|
+
epoch: i.epoch,
|
|
2520
|
+
epochSlot: i.epoch_slot.toString(),
|
|
2521
|
+
fees: i.total_fees,
|
|
2522
|
+
hash: i.hash,
|
|
2523
|
+
nextBlock: i.next_block ?? "",
|
|
2524
|
+
operationalCertificate: (t = i.operational_certificate) == null ? void 0 : t.hot_vkey,
|
|
2525
|
+
output: i.total_output_lovelace ?? "0",
|
|
2526
|
+
previousBlock: i.previous_block,
|
|
2527
|
+
size: i.size,
|
|
2528
|
+
slot: i.absolute_slot.toString(),
|
|
2529
|
+
slotLeader: i.block_producer ?? "",
|
|
2530
|
+
time: Date.parse(i.timestamp) / 1e3,
|
|
2531
|
+
txCount: i.tx_hashes.length,
|
|
2532
|
+
VRFKey: a.VRFVKey.from_hex(i.vrf_key).to_bech32("vrf_vk")
|
|
2469
2533
|
};
|
|
2470
2534
|
}
|
|
2471
|
-
throw
|
|
2472
|
-
} catch (
|
|
2473
|
-
throw
|
|
2535
|
+
throw h(s);
|
|
2536
|
+
} catch (s) {
|
|
2537
|
+
throw h(s);
|
|
2474
2538
|
}
|
|
2475
2539
|
}
|
|
2476
2540
|
async fetchCollectionAssets(e, t) {
|
|
2477
2541
|
try {
|
|
2478
|
-
const { data:
|
|
2479
|
-
if (
|
|
2542
|
+
const { data: s, status: n } = await this._axiosInstance.get(`policy/${e}/assets?count=100${t ? `&cursor=${t}` : ""}`);
|
|
2543
|
+
if (n === 200)
|
|
2480
2544
|
return {
|
|
2481
|
-
assets:
|
|
2545
|
+
assets: s.data.map((o) => ({
|
|
2482
2546
|
unit: e + o.asset_name,
|
|
2483
|
-
quantity: o.total_supply
|
|
2547
|
+
quantity: o.total_supply
|
|
2484
2548
|
})),
|
|
2485
|
-
next:
|
|
2549
|
+
next: s.next_cursor
|
|
2486
2550
|
};
|
|
2487
|
-
throw
|
|
2551
|
+
throw h(s);
|
|
2488
2552
|
} catch {
|
|
2489
2553
|
return { assets: [], next: null };
|
|
2490
2554
|
}
|
|
2491
2555
|
}
|
|
2492
2556
|
async fetchHandleAddress(e) {
|
|
2493
2557
|
try {
|
|
2494
|
-
const t = e.charAt(0) === "$" ? e.substring(1) : e, { data:
|
|
2495
|
-
if (
|
|
2496
|
-
return
|
|
2497
|
-
throw
|
|
2558
|
+
const t = e.charAt(0) === "$" ? e.substring(1) : e, { data: s, status: n } = await this._axiosInstance.get(`ecosystem/adahandle/${t}`);
|
|
2559
|
+
if (n === 200)
|
|
2560
|
+
return s.data;
|
|
2561
|
+
throw h(s);
|
|
2498
2562
|
} catch (t) {
|
|
2499
|
-
throw
|
|
2563
|
+
throw h(t);
|
|
2500
2564
|
}
|
|
2501
2565
|
}
|
|
2502
2566
|
async fetchProtocolParameters(e = Number.NaN) {
|
|
2503
2567
|
if (!isNaN(e))
|
|
2504
2568
|
throw new Error("Maestro only supports fetching Protocol parameters of the latest completed epoch.");
|
|
2505
|
-
const t = (
|
|
2506
|
-
const
|
|
2507
|
-
return parseInt(
|
|
2569
|
+
const t = (s) => {
|
|
2570
|
+
const n = s.indexOf("/");
|
|
2571
|
+
return parseInt(s.slice(0, n)) / parseInt(s.slice(n + 1));
|
|
2508
2572
|
};
|
|
2509
2573
|
try {
|
|
2510
|
-
const { data:
|
|
2511
|
-
if (
|
|
2512
|
-
const
|
|
2574
|
+
const { data: s, status: n } = await this._axiosInstance.get("protocol-params");
|
|
2575
|
+
if (n === 200) {
|
|
2576
|
+
const i = s.data;
|
|
2513
2577
|
try {
|
|
2514
2578
|
const { data: o, status: c } = await this._axiosInstance.get("epochs/current");
|
|
2515
2579
|
if (c === 200) {
|
|
2516
2580
|
const u = o.data;
|
|
2517
2581
|
return {
|
|
2518
|
-
coinsPerUTxOSize:
|
|
2519
|
-
collateralPercent: parseInt(
|
|
2582
|
+
coinsPerUTxOSize: i.coins_per_utxo_byte.toString(),
|
|
2583
|
+
collateralPercent: parseInt(i.collateral_percentage),
|
|
2520
2584
|
decentralisation: 0,
|
|
2521
2585
|
epoch: parseInt(u.epoch_no),
|
|
2522
|
-
keyDeposit:
|
|
2523
|
-
maxBlockExMem:
|
|
2524
|
-
maxBlockExSteps:
|
|
2525
|
-
maxBlockHeaderSize: parseInt(
|
|
2526
|
-
maxBlockSize: parseInt(
|
|
2527
|
-
maxCollateralInputs: parseInt(
|
|
2528
|
-
maxTxExMem:
|
|
2529
|
-
maxTxExSteps:
|
|
2530
|
-
maxTxSize: parseInt(
|
|
2531
|
-
maxValSize:
|
|
2532
|
-
minFeeA:
|
|
2533
|
-
minFeeB:
|
|
2534
|
-
minPoolCost:
|
|
2535
|
-
poolDeposit:
|
|
2536
|
-
priceMem: t(
|
|
2537
|
-
priceStep: t(
|
|
2586
|
+
keyDeposit: i.stake_key_deposit.toString(),
|
|
2587
|
+
maxBlockExMem: i.max_execution_units_per_block.memory.toString(),
|
|
2588
|
+
maxBlockExSteps: i.max_execution_units_per_block.steps.toString(),
|
|
2589
|
+
maxBlockHeaderSize: parseInt(i.max_block_header_size),
|
|
2590
|
+
maxBlockSize: parseInt(i.max_block_body_size),
|
|
2591
|
+
maxCollateralInputs: parseInt(i.max_collateral_inputs),
|
|
2592
|
+
maxTxExMem: i.max_execution_units_per_transaction.memory.toString(),
|
|
2593
|
+
maxTxExSteps: i.max_execution_units_per_transaction.steps.toString(),
|
|
2594
|
+
maxTxSize: parseInt(i.max_tx_size),
|
|
2595
|
+
maxValSize: i.max_value_size.toString(),
|
|
2596
|
+
minFeeA: i.min_fee_coefficient,
|
|
2597
|
+
minFeeB: i.min_fee_constant,
|
|
2598
|
+
minPoolCost: i.min_pool_cost.toString(),
|
|
2599
|
+
poolDeposit: i.pool_deposit.toString(),
|
|
2600
|
+
priceMem: t(i.prices.memory),
|
|
2601
|
+
priceStep: t(i.prices.steps)
|
|
2538
2602
|
};
|
|
2539
2603
|
}
|
|
2540
|
-
throw
|
|
2604
|
+
throw h(o);
|
|
2541
2605
|
} catch (o) {
|
|
2542
|
-
throw
|
|
2606
|
+
throw h(o);
|
|
2543
2607
|
}
|
|
2544
2608
|
}
|
|
2545
|
-
throw
|
|
2546
|
-
} catch (
|
|
2547
|
-
throw
|
|
2609
|
+
throw h(s);
|
|
2610
|
+
} catch (s) {
|
|
2611
|
+
throw h(s);
|
|
2548
2612
|
}
|
|
2549
2613
|
}
|
|
2550
2614
|
async fetchTxInfo(e) {
|
|
2551
2615
|
try {
|
|
2552
|
-
const { data: t, status:
|
|
2553
|
-
if (
|
|
2554
|
-
const
|
|
2616
|
+
const { data: t, status: s } = await this._axiosInstance.get(`transactions/${e}`);
|
|
2617
|
+
if (s === 200) {
|
|
2618
|
+
const n = t.data;
|
|
2555
2619
|
return {
|
|
2556
|
-
block:
|
|
2557
|
-
deposit:
|
|
2558
|
-
fees:
|
|
2559
|
-
hash:
|
|
2560
|
-
index:
|
|
2561
|
-
invalidAfter:
|
|
2562
|
-
invalidBefore:
|
|
2563
|
-
slot:
|
|
2564
|
-
size:
|
|
2620
|
+
block: n.block_hash,
|
|
2621
|
+
deposit: n.deposit.toString(),
|
|
2622
|
+
fees: n.fee.toString(),
|
|
2623
|
+
hash: n.tx_hash,
|
|
2624
|
+
index: n.block_tx_index,
|
|
2625
|
+
invalidAfter: n.invalid_hereafter ?? "",
|
|
2626
|
+
invalidBefore: n.invalid_before ?? "",
|
|
2627
|
+
slot: n.block_absolute_slot.toString(),
|
|
2628
|
+
size: n.size - 1
|
|
2565
2629
|
};
|
|
2566
2630
|
}
|
|
2567
|
-
throw
|
|
2631
|
+
throw h(t);
|
|
2568
2632
|
} catch (t) {
|
|
2569
|
-
throw
|
|
2633
|
+
throw h(t);
|
|
2570
2634
|
}
|
|
2571
2635
|
}
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2636
|
+
async fetchUTxOs(e) {
|
|
2637
|
+
try {
|
|
2638
|
+
const { data: t, status: s } = await this._axiosInstance.get(`transactions/${e}`, this._amountsAsStrings);
|
|
2639
|
+
if (s === 200)
|
|
2640
|
+
return t.data.outputs.map(this.toUTxO);
|
|
2641
|
+
throw h(t);
|
|
2642
|
+
} catch (t) {
|
|
2643
|
+
throw h(t);
|
|
2644
|
+
}
|
|
2645
|
+
}
|
|
2646
|
+
onTxConfirmed(e, t, s = 100) {
|
|
2647
|
+
let n = 0;
|
|
2648
|
+
const i = setInterval(() => {
|
|
2649
|
+
n >= s && clearInterval(i), this.fetchTxInfo(e).then((o) => {
|
|
2576
2650
|
this.fetchBlockInfo(o.block).then((c) => {
|
|
2577
|
-
(c == null ? void 0 : c.confirmations) > 0 && (clearInterval(
|
|
2651
|
+
(c == null ? void 0 : c.confirmations) > 0 && (clearInterval(i), t());
|
|
2578
2652
|
}).catch(() => {
|
|
2579
|
-
|
|
2653
|
+
n += 1;
|
|
2580
2654
|
});
|
|
2581
2655
|
}).catch(() => {
|
|
2582
|
-
|
|
2656
|
+
n += 1;
|
|
2583
2657
|
});
|
|
2584
2658
|
}, 5e3);
|
|
2585
2659
|
}
|
|
2586
2660
|
async submitTx(e) {
|
|
2587
2661
|
try {
|
|
2588
|
-
const t = { "Content-Type": "application/cbor" }, { data:
|
|
2589
|
-
if (
|
|
2590
|
-
return
|
|
2591
|
-
throw
|
|
2662
|
+
const t = { "Content-Type": "application/cbor" }, { data: s, status: n } = await this._axiosInstance.post(this.submitUrl, I(e), { headers: t });
|
|
2663
|
+
if (n === 202)
|
|
2664
|
+
return s;
|
|
2665
|
+
throw h(s);
|
|
2592
2666
|
} catch (t) {
|
|
2593
|
-
throw
|
|
2667
|
+
throw h(t);
|
|
2594
2668
|
}
|
|
2595
2669
|
}
|
|
2670
|
+
toUTxO = (e) => {
|
|
2671
|
+
var t, s, n;
|
|
2672
|
+
return {
|
|
2673
|
+
input: {
|
|
2674
|
+
outputIndex: e.index,
|
|
2675
|
+
txHash: e.tx_hash
|
|
2676
|
+
},
|
|
2677
|
+
output: {
|
|
2678
|
+
address: e.address,
|
|
2679
|
+
amount: e.assets.map((i) => ({
|
|
2680
|
+
unit: i.unit,
|
|
2681
|
+
quantity: i.amount
|
|
2682
|
+
})),
|
|
2683
|
+
dataHash: (t = e.datum) == null ? void 0 : t.hash,
|
|
2684
|
+
plutusData: (s = e.datum) == null ? void 0 : s.bytes,
|
|
2685
|
+
scriptRef: this.resolveScript(e),
|
|
2686
|
+
scriptHash: (n = e.reference_script) == null ? void 0 : n.hash
|
|
2687
|
+
}
|
|
2688
|
+
};
|
|
2689
|
+
};
|
|
2690
|
+
resolveScript = (e) => {
|
|
2691
|
+
if (e.reference_script) {
|
|
2692
|
+
const t = e.reference_script.type === "native" ? e.reference_script.json : {
|
|
2693
|
+
code: e.reference_script.bytes,
|
|
2694
|
+
version: e.reference_script.type.replace("plutusv", "V")
|
|
2695
|
+
};
|
|
2696
|
+
return ut(t).to_hex();
|
|
2697
|
+
} else
|
|
2698
|
+
return;
|
|
2699
|
+
};
|
|
2596
2700
|
}
|
|
2597
|
-
class
|
|
2701
|
+
class br {
|
|
2598
2702
|
static withOneSignature(e) {
|
|
2599
|
-
const t =
|
|
2600
|
-
return
|
|
2703
|
+
const t = M(nt(e));
|
|
2704
|
+
return yt(t).to_hex();
|
|
2601
2705
|
}
|
|
2602
2706
|
static withAtLeastNSignatures(e, t) {
|
|
2603
|
-
const
|
|
2604
|
-
e.forEach((
|
|
2605
|
-
const o =
|
|
2606
|
-
|
|
2707
|
+
const s = a.NativeScripts.new();
|
|
2708
|
+
e.forEach((i) => {
|
|
2709
|
+
const o = M(nt(i));
|
|
2710
|
+
s.add(yt(o));
|
|
2607
2711
|
});
|
|
2608
|
-
const
|
|
2609
|
-
return
|
|
2712
|
+
const n = a.ScriptNOfK.new(t, s);
|
|
2713
|
+
return a.NativeScript.new_script_any(n).to_hex();
|
|
2610
2714
|
}
|
|
2611
2715
|
static withAnySignature(e) {
|
|
2612
|
-
const t =
|
|
2613
|
-
e.forEach((
|
|
2614
|
-
const
|
|
2615
|
-
t.add(
|
|
2716
|
+
const t = a.NativeScripts.new();
|
|
2717
|
+
e.forEach((n) => {
|
|
2718
|
+
const i = M(nt(n));
|
|
2719
|
+
t.add(yt(i));
|
|
2616
2720
|
});
|
|
2617
|
-
const
|
|
2618
|
-
return
|
|
2721
|
+
const s = a.ScriptAny.new(t);
|
|
2722
|
+
return a.NativeScript.new_script_any(s).to_hex();
|
|
2619
2723
|
}
|
|
2620
2724
|
static withAllSignatures(e) {
|
|
2621
|
-
const t =
|
|
2622
|
-
e.forEach((
|
|
2623
|
-
const
|
|
2624
|
-
t.add(
|
|
2725
|
+
const t = a.NativeScripts.new();
|
|
2726
|
+
e.forEach((n) => {
|
|
2727
|
+
const i = M(nt(n));
|
|
2728
|
+
t.add(yt(i));
|
|
2625
2729
|
});
|
|
2626
|
-
const
|
|
2627
|
-
return
|
|
2730
|
+
const s = a.ScriptAll.new(t);
|
|
2731
|
+
return a.NativeScript.new_script_any(s).to_hex();
|
|
2628
2732
|
}
|
|
2629
2733
|
static fromNativeScript(e) {
|
|
2630
|
-
return
|
|
2734
|
+
return kt(e).to_hex();
|
|
2631
2735
|
}
|
|
2632
2736
|
}
|
|
2633
|
-
function
|
|
2634
|
-
var
|
|
2737
|
+
function et(r, e, t, s) {
|
|
2738
|
+
var n = arguments.length, i = n < 3 ? e : s === null ? s = Object.getOwnPropertyDescriptor(e, t) : s, o;
|
|
2635
2739
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
2636
|
-
|
|
2740
|
+
i = Reflect.decorate(r, e, t, s);
|
|
2637
2741
|
else
|
|
2638
|
-
for (var c =
|
|
2639
|
-
(o =
|
|
2640
|
-
return
|
|
2742
|
+
for (var c = r.length - 1; c >= 0; c--)
|
|
2743
|
+
(o = r[c]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, t, i) : o(e, t)) || i);
|
|
2744
|
+
return n > 3 && i && Object.defineProperty(e, t, i), i;
|
|
2641
2745
|
}
|
|
2642
|
-
const Xs = (
|
|
2746
|
+
const Xs = (r) => class extends r {
|
|
2643
2747
|
__visits = [];
|
|
2644
|
-
},
|
|
2645
|
-
const
|
|
2646
|
-
t.value = function(...
|
|
2647
|
-
const
|
|
2648
|
-
return this.__visits && this.__visits.push(e),
|
|
2748
|
+
}, st = () => function(r, e, t) {
|
|
2749
|
+
const s = t.value;
|
|
2750
|
+
t.value = function(...n) {
|
|
2751
|
+
const i = s.call(this, ...n);
|
|
2752
|
+
return this.__visits && this.__visits.push(e), i;
|
|
2649
2753
|
};
|
|
2650
2754
|
};
|
|
2651
2755
|
let $ = class {
|
|
@@ -2663,29 +2767,29 @@ let $ = class {
|
|
|
2663
2767
|
_txInputsBuilder;
|
|
2664
2768
|
_txWithdrawals;
|
|
2665
2769
|
constructor(e = {}) {
|
|
2666
|
-
this._era = e.era, this._initiator = e.initiator, this._mintBuilder =
|
|
2770
|
+
this._era = e.era, this._initiator = e.initiator, this._mintBuilder = a.MintBuilder.new(), this._protocolParameters = e.parameters ?? P, this._txBuilder = Ft(e.parameters), this._txCertificates = a.Certificates.new(), this._txInputsBuilder = a.TxInputsBuilder.new(), this._txWithdrawals = a.Withdrawals.new();
|
|
2667
2771
|
}
|
|
2668
2772
|
static maskMetadata(e, t = "BABBAGE") {
|
|
2669
|
-
var
|
|
2670
|
-
const
|
|
2671
|
-
if (
|
|
2672
|
-
const o =
|
|
2673
|
-
for (let u = 0; u <
|
|
2674
|
-
const
|
|
2675
|
-
o.insert(
|
|
2773
|
+
var i;
|
|
2774
|
+
const s = Y(e), n = (i = s.auxiliary_data()) == null ? void 0 : i.metadata();
|
|
2775
|
+
if (n !== void 0) {
|
|
2776
|
+
const o = a.GeneralTransactionMetadata.new();
|
|
2777
|
+
for (let u = 0; u < n.len(); u += 1) {
|
|
2778
|
+
const d = n.keys().get(u), A = n.get(d);
|
|
2779
|
+
o.insert(d, a.TransactionMetadatum.from_hex("0".repeat(((A == null ? void 0 : A.to_hex()) ?? "").length)));
|
|
2676
2780
|
}
|
|
2677
|
-
const c =
|
|
2678
|
-
return c !== void 0 && (c.set_metadata(o), c.set_prefer_alonzo_format(t === "ALONZO")),
|
|
2781
|
+
const c = s.auxiliary_data();
|
|
2782
|
+
return c !== void 0 && (c.set_metadata(o), c.set_prefer_alonzo_format(t === "ALONZO")), a.Transaction.new(s.body(), s.witness_set(), c).to_hex();
|
|
2679
2783
|
}
|
|
2680
2784
|
return e;
|
|
2681
2785
|
}
|
|
2682
2786
|
static readMetadata(e) {
|
|
2683
|
-
var
|
|
2684
|
-
return ((
|
|
2787
|
+
var s, n;
|
|
2788
|
+
return ((n = (s = Y(e).auxiliary_data()) == null ? void 0 : s.metadata()) == null ? void 0 : n.to_hex()) ?? "";
|
|
2685
2789
|
}
|
|
2686
|
-
static writeMetadata(e, t,
|
|
2687
|
-
const
|
|
2688
|
-
return
|
|
2790
|
+
static writeMetadata(e, t, s = "BABBAGE") {
|
|
2791
|
+
const n = Y(e), i = n.auxiliary_data() ?? a.AuxiliaryData.new();
|
|
2792
|
+
return i.set_metadata(a.GeneralTransactionMetadata.from_hex(t)), i.set_prefer_alonzo_format(s === "ALONZO"), a.Transaction.new(n.body(), n.witness_set(), i).to_hex();
|
|
2689
2793
|
}
|
|
2690
2794
|
get size() {
|
|
2691
2795
|
return this._txBuilder.full_size();
|
|
@@ -2697,40 +2801,40 @@ let $ = class {
|
|
|
2697
2801
|
throw new Error(`[Transaction] An error occurred during build: ${e}.`);
|
|
2698
2802
|
}
|
|
2699
2803
|
}
|
|
2700
|
-
burnAsset(e, t,
|
|
2701
|
-
const
|
|
2702
|
-
return this._mintBuilder.add_asset(
|
|
2804
|
+
burnAsset(e, t, s) {
|
|
2805
|
+
const n = this._totalBurns.has(t.unit) ? a.BigNum.from_str(this._totalBurns.get(t.unit) ?? "0").checked_add(a.BigNum.from_str(t.quantity)).to_str() : t.quantity;
|
|
2806
|
+
return this._mintBuilder.add_asset(ye(e, s), a.AssetName.new(I(t.unit.slice(F))), a.Int.new_negative(a.BigNum.from_str(t.quantity))), this._totalBurns.set(t.unit, n), this;
|
|
2703
2807
|
}
|
|
2704
2808
|
delegateStake(e, t) {
|
|
2705
|
-
const
|
|
2706
|
-
return this._txCertificates.add(
|
|
2809
|
+
const s = a.Certificate.new_stake_delegation(a.StakeDelegation.new(a.StakeCredential.from_keyhash(M(lt(e))), a.Ed25519KeyHash.from_bech32(t)));
|
|
2810
|
+
return this._txCertificates.add(s), this;
|
|
2707
2811
|
}
|
|
2708
2812
|
deregisterStake(e) {
|
|
2709
|
-
const t =
|
|
2813
|
+
const t = a.Certificate.new_stake_deregistration(a.StakeDeregistration.new(a.StakeCredential.from_keyhash(M(lt(e)))));
|
|
2710
2814
|
return this._txCertificates.add(t), this;
|
|
2711
2815
|
}
|
|
2712
|
-
mintAsset(e, t,
|
|
2713
|
-
var
|
|
2714
|
-
const
|
|
2715
|
-
const f = typeof
|
|
2816
|
+
mintAsset(e, t, s) {
|
|
2817
|
+
var d, A;
|
|
2818
|
+
const n = (l, g) => {
|
|
2819
|
+
const f = typeof l == "string" ? vt(l).hash().to_hex() : i(l).hash().to_hex(), y = S(g.assetName);
|
|
2716
2820
|
return {
|
|
2717
2821
|
unit: `${f}${y}`,
|
|
2718
|
-
quantity:
|
|
2822
|
+
quantity: g.assetQuantity
|
|
2719
2823
|
};
|
|
2720
|
-
},
|
|
2721
|
-
if ("code" in
|
|
2722
|
-
return
|
|
2723
|
-
const
|
|
2724
|
-
if (
|
|
2725
|
-
const f =
|
|
2824
|
+
}, i = (l) => {
|
|
2825
|
+
if ("code" in l)
|
|
2826
|
+
return ct(l.code, l.version);
|
|
2827
|
+
const g = H(l);
|
|
2828
|
+
if (g.output().has_script_ref()) {
|
|
2829
|
+
const f = g.output().script_ref();
|
|
2726
2830
|
if (f.is_plutus_script()) {
|
|
2727
|
-
const y =
|
|
2728
|
-
return
|
|
2831
|
+
const y = Ve(f);
|
|
2832
|
+
return ct(y.code, y.version);
|
|
2729
2833
|
}
|
|
2730
2834
|
}
|
|
2731
|
-
throw new Error(`No plutus script reference found in UTxO: ${
|
|
2732
|
-
}, o =
|
|
2733
|
-
return this._mintBuilder.add_asset(
|
|
2835
|
+
throw new Error(`No plutus script reference found in UTxO: ${g.input().transaction_id().to_hex()}`);
|
|
2836
|
+
}, o = n(e, t), u = a.BigNum.from_str(((d = this._totalMints.get(o.unit)) == null ? void 0 : d.assetQuantity) ?? "0").checked_add(a.BigNum.from_str(o.quantity));
|
|
2837
|
+
return this._mintBuilder.add_asset(ye(e, s), a.AssetName.new(I(S(t.assetName))), a.Int.new(a.BigNum.from_str(o.quantity))), this._recipients.has(t.recipient) ? (A = this._recipients.get(t.recipient)) == null || A.push(o) : this._recipients.set(t.recipient, [o]), this._totalMints.set(o.unit, {
|
|
2734
2838
|
...t,
|
|
2735
2839
|
assetQuantity: u.to_str()
|
|
2736
2840
|
}), this;
|
|
@@ -2738,96 +2842,96 @@ let $ = class {
|
|
|
2738
2842
|
redeemValue(e) {
|
|
2739
2843
|
const t = {
|
|
2740
2844
|
tag: "SPEND",
|
|
2741
|
-
budget:
|
|
2845
|
+
budget: At,
|
|
2742
2846
|
index: this._txInputsBuilder.inputs().len(),
|
|
2743
2847
|
data: {
|
|
2744
2848
|
alternative: 0,
|
|
2745
2849
|
fields: []
|
|
2746
2850
|
},
|
|
2747
2851
|
...e.redeemer
|
|
2748
|
-
},
|
|
2749
|
-
return this._txInputsBuilder.add_plutus_script_input(
|
|
2852
|
+
}, s = H(e.value), n = a.PlutusWitness.new_with_ref(Ye(e.script), Ws(e.datum), Oe(t));
|
|
2853
|
+
return this._txInputsBuilder.add_plutus_script_input(n, s.input(), s.output().amount()), this;
|
|
2750
2854
|
}
|
|
2751
2855
|
registerStake(e) {
|
|
2752
|
-
const t =
|
|
2856
|
+
const t = a.Certificate.new_stake_registration(a.StakeRegistration.new(a.StakeCredential.from_keyhash(M(lt(e)))));
|
|
2753
2857
|
return this._txCertificates.add(t), this;
|
|
2754
2858
|
}
|
|
2755
2859
|
registerPool(e) {
|
|
2756
|
-
const t =
|
|
2860
|
+
const t = a.Certificate.new_pool_registration(a.PoolRegistration.new($s(e)));
|
|
2757
2861
|
return this._txCertificates.add(t), this;
|
|
2758
2862
|
}
|
|
2759
2863
|
retirePool(e, t) {
|
|
2760
|
-
const
|
|
2761
|
-
return this._txCertificates.add(
|
|
2864
|
+
const s = a.Certificate.new_pool_retirement(a.PoolRetirement.new(a.Ed25519KeyHash.from_bech32(e), t));
|
|
2865
|
+
return this._txCertificates.add(s), this;
|
|
2762
2866
|
}
|
|
2763
2867
|
sendAssets(e, t) {
|
|
2764
|
-
const
|
|
2765
|
-
if (
|
|
2868
|
+
const s = Z(t), n = s.multiasset();
|
|
2869
|
+
if (s.is_zero() || n === void 0)
|
|
2766
2870
|
return this;
|
|
2767
|
-
const
|
|
2871
|
+
const i = xt(e).next(), o = s.coin().is_zero() ? i.with_asset_and_min_required_coin_by_utxo_cost(n, Ht(this._protocolParameters.coinsPerUTxOSize)).build() : i.with_coin_and_asset(s.coin(), n).build();
|
|
2768
2872
|
return t.forEach((c) => {
|
|
2769
2873
|
this.setTxOutput(c);
|
|
2770
2874
|
}), this._txBuilder.add_output(o), this;
|
|
2771
2875
|
}
|
|
2772
2876
|
sendLovelace(e, t) {
|
|
2773
|
-
const
|
|
2877
|
+
const n = xt(e).next().with_coin(a.BigNum.from_str(t)).build();
|
|
2774
2878
|
return this.setTxOutput({
|
|
2775
2879
|
unit: "lovelace",
|
|
2776
2880
|
quantity: t
|
|
2777
|
-
}), this._txBuilder.add_output(
|
|
2881
|
+
}), this._txBuilder.add_output(n), this;
|
|
2778
2882
|
}
|
|
2779
|
-
sendToken(e, t,
|
|
2883
|
+
sendToken(e, t, s) {
|
|
2780
2884
|
return this.sendAssets(e, [{
|
|
2781
|
-
quantity:
|
|
2885
|
+
quantity: s,
|
|
2782
2886
|
unit: as[t]
|
|
2783
2887
|
}]), this;
|
|
2784
2888
|
}
|
|
2785
2889
|
sendValue(e, t) {
|
|
2786
|
-
const
|
|
2890
|
+
const s = Z(t.output.amount), i = xt(e).next().with_value(s).build();
|
|
2787
2891
|
return t.output.amount.forEach((o) => {
|
|
2788
2892
|
this.setTxOutput(o);
|
|
2789
|
-
}), this._txBuilder.add_output(
|
|
2893
|
+
}), this._txBuilder.add_output(i), this;
|
|
2790
2894
|
}
|
|
2791
2895
|
setChangeAddress(e) {
|
|
2792
|
-
return this._changeAddress =
|
|
2896
|
+
return this._changeAddress = K(e), this;
|
|
2793
2897
|
}
|
|
2794
2898
|
setCollateral(e) {
|
|
2795
|
-
const t =
|
|
2899
|
+
const t = xe(e);
|
|
2796
2900
|
return this._txBuilder.set_collateral(t), this;
|
|
2797
2901
|
}
|
|
2798
2902
|
setMetadata(e, t) {
|
|
2799
|
-
return this._txBuilder.add_json_metadatum_with_schema(
|
|
2903
|
+
return this._txBuilder.add_json_metadatum_with_schema(a.BigNum.from_str(e.toString()), JSON.stringify(t), a.MetadataJsonSchema.NoConversions), this;
|
|
2800
2904
|
}
|
|
2801
2905
|
setRequiredSigners(e) {
|
|
2802
|
-
return Array.from(new Set(e.map((
|
|
2803
|
-
this._txBuilder.add_required_signer(
|
|
2906
|
+
return Array.from(new Set(e.map((s) => s.startsWith("addr") ? nt(s) : lt(s)).map((s) => M(s)))).forEach((s) => {
|
|
2907
|
+
this._txBuilder.add_required_signer(s);
|
|
2804
2908
|
}), this;
|
|
2805
2909
|
}
|
|
2806
2910
|
setTimeToStart(e) {
|
|
2807
|
-
return this._txBuilder.set_validity_start_interval_bignum(
|
|
2911
|
+
return this._txBuilder.set_validity_start_interval_bignum(a.BigNum.from_str(e)), this;
|
|
2808
2912
|
}
|
|
2809
2913
|
setTimeToExpire(e) {
|
|
2810
|
-
return this._txBuilder.set_ttl_bignum(
|
|
2914
|
+
return this._txBuilder.set_ttl_bignum(a.BigNum.from_str(e)), this;
|
|
2811
2915
|
}
|
|
2812
2916
|
setTxInputs(e) {
|
|
2813
|
-
return e.map((t) =>
|
|
2917
|
+
return e.map((t) => H(t)).forEach((t) => {
|
|
2814
2918
|
this._txInputsBuilder.add_input(t.output().address(), t.input(), t.output().amount());
|
|
2815
2919
|
}), this;
|
|
2816
2920
|
}
|
|
2817
2921
|
setTxRefInputs(e) {
|
|
2818
|
-
return e.map((t) =>
|
|
2922
|
+
return e.map((t) => H(t)).forEach((t) => {
|
|
2819
2923
|
this._txBuilder.add_reference_input(t.input());
|
|
2820
2924
|
}), this;
|
|
2821
2925
|
}
|
|
2822
2926
|
withdrawRewards(e, t) {
|
|
2823
|
-
const
|
|
2824
|
-
return
|
|
2927
|
+
const s = Fe(e);
|
|
2928
|
+
return s !== void 0 && this._txWithdrawals.insert(s, a.BigNum.from_str(t)), this;
|
|
2825
2929
|
}
|
|
2826
2930
|
async addBurnInputsIfNeeded() {
|
|
2827
2931
|
if (this._initiator && this._totalBurns.size > 0 && this.notVisited("setTxInputs")) {
|
|
2828
2932
|
const e = await this._initiator.getUsedUTxOs();
|
|
2829
|
-
|
|
2830
|
-
this._txInputsBuilder.add_input(
|
|
2933
|
+
os(this._totalBurns, e.map((s) => bt(s))).map((s) => H(s)).forEach((s) => {
|
|
2934
|
+
this._txInputsBuilder.add_input(s.output().address(), s.input(), s.output().amount());
|
|
2831
2935
|
});
|
|
2832
2936
|
}
|
|
2833
2937
|
}
|
|
@@ -2841,68 +2945,68 @@ let $ = class {
|
|
|
2841
2945
|
async addCollateralIfNeeded() {
|
|
2842
2946
|
if (this._initiator && this.notVisited("setCollateral")) {
|
|
2843
2947
|
const e = await this._initiator.getUsedCollateral();
|
|
2844
|
-
this._txBuilder.set_collateral(
|
|
2948
|
+
this._txBuilder.set_collateral(xe(e));
|
|
2845
2949
|
}
|
|
2846
2950
|
}
|
|
2847
2951
|
async addRequiredSignersIfNeeded() {
|
|
2848
2952
|
if (this._initiator && this.notVisited("setRequiredSigners")) {
|
|
2849
|
-
const e = await this._initiator.getUsedAddress(), t =
|
|
2850
|
-
this._txBuilder.add_required_signer(
|
|
2953
|
+
const e = await this._initiator.getUsedAddress(), t = nt(e.to_bech32());
|
|
2954
|
+
this._txBuilder.add_required_signer(M(t));
|
|
2851
2955
|
}
|
|
2852
2956
|
}
|
|
2853
2957
|
async addTxInputsAsNeeded() {
|
|
2854
2958
|
if (this.notVisited("setTxInputs")) {
|
|
2855
2959
|
const e = await this.filterAvailableUTxOs();
|
|
2856
|
-
|
|
2857
|
-
this._txInputsBuilder.add_input(
|
|
2960
|
+
is(this._txOutputs, e.map((s) => bt(s))).map((s) => H(s)).forEach((s) => {
|
|
2961
|
+
this._txInputsBuilder.add_input(s.output().address(), s.input(), s.output().amount());
|
|
2858
2962
|
});
|
|
2859
2963
|
}
|
|
2860
2964
|
if (this._txBuilder.set_inputs(this._txInputsBuilder), (this._mintBuilder.has_native_scripts() || this._mintBuilder.has_plutus_scripts()) && this._txBuilder.set_mint_builder(this._mintBuilder), this._txCertificates.len() > 0 && this._txBuilder.set_certs(this._txCertificates), this._txWithdrawals.len() > 0 && this._txBuilder.set_withdrawals(this._txWithdrawals), this._txBuilder.get_mint_builder() || this.notVisited("redeemValue") === !1) {
|
|
2861
|
-
const e = this._era !== void 0 ?
|
|
2965
|
+
const e = this._era !== void 0 ? Zt[this._era] : Zt.BABBAGE;
|
|
2862
2966
|
this._txBuilder.calc_script_data_hash(e);
|
|
2863
2967
|
}
|
|
2864
2968
|
}
|
|
2865
2969
|
async forgeAssetsIfNeeded() {
|
|
2866
|
-
const e = (t,
|
|
2867
|
-
const
|
|
2970
|
+
const e = (t, s) => {
|
|
2971
|
+
const n = t.data.assetName, i = t.data.metadata, o = t.unit.slice(0, F);
|
|
2868
2972
|
if (t.data.label === "777")
|
|
2869
|
-
return
|
|
2870
|
-
if (
|
|
2871
|
-
const { [o]: c, ...u } =
|
|
2872
|
-
[
|
|
2973
|
+
return i;
|
|
2974
|
+
if (s && s[o]) {
|
|
2975
|
+
const { [o]: c, ...u } = s, d = {
|
|
2976
|
+
[n]: i,
|
|
2873
2977
|
...c
|
|
2874
2978
|
};
|
|
2875
2979
|
return {
|
|
2876
2980
|
[o]: {
|
|
2877
|
-
...
|
|
2981
|
+
...d
|
|
2878
2982
|
},
|
|
2879
2983
|
...u
|
|
2880
2984
|
};
|
|
2881
2985
|
}
|
|
2882
|
-
return
|
|
2986
|
+
return s !== void 0 ? {
|
|
2883
2987
|
[o]: {
|
|
2884
|
-
[
|
|
2988
|
+
[n]: i
|
|
2885
2989
|
},
|
|
2886
|
-
...
|
|
2990
|
+
...s
|
|
2887
2991
|
} : {
|
|
2888
|
-
[o]: { [
|
|
2992
|
+
[o]: { [n]: i }
|
|
2889
2993
|
};
|
|
2890
2994
|
};
|
|
2891
2995
|
await this.addBurnInputsIfNeeded(), Array.from(this._totalMints, (t) => ({
|
|
2892
2996
|
unit: t[0],
|
|
2893
2997
|
data: t[1]
|
|
2894
|
-
})).reduce((t,
|
|
2895
|
-
this._txBuilder.add_json_metadatum(
|
|
2998
|
+
})).reduce((t, s) => t.set(s.data.label, e(s, t.get(s.data.label))), /* @__PURE__ */ new Map()).forEach((t, s) => {
|
|
2999
|
+
this._txBuilder.add_json_metadatum(a.BigNum.from_str(s), JSON.stringify(t));
|
|
2896
3000
|
}), this.addMintOutputs();
|
|
2897
3001
|
}
|
|
2898
3002
|
async filterAvailableUTxOs(e = []) {
|
|
2899
|
-
return this._initiator === void 0 ? [] : (await this._initiator.getUsedUTxOs()).filter((
|
|
3003
|
+
return this._initiator === void 0 ? [] : (await this._initiator.getUsedUTxOs()).filter((s) => e.find((n) => n.input.txHash === s.input().transaction_id().to_hex()) === void 0);
|
|
2900
3004
|
}
|
|
2901
3005
|
addMintOutputs() {
|
|
2902
3006
|
this._recipients.forEach((e, t) => {
|
|
2903
|
-
const
|
|
2904
|
-
if (
|
|
2905
|
-
const o =
|
|
3007
|
+
const n = Z(e).multiasset();
|
|
3008
|
+
if (n !== void 0) {
|
|
3009
|
+
const o = xt(t).next().with_asset_and_min_required_coin_by_utxo_cost(n, Ht(this._protocolParameters.coinsPerUTxOSize)).build();
|
|
2906
3010
|
this._txBuilder.add_output(o);
|
|
2907
3011
|
}
|
|
2908
3012
|
});
|
|
@@ -2911,286 +3015,724 @@ let $ = class {
|
|
|
2911
3015
|
return this.__visits.includes(e) === !1;
|
|
2912
3016
|
}
|
|
2913
3017
|
setTxOutput(e) {
|
|
2914
|
-
const
|
|
2915
|
-
this._txOutputs.set(e.unit,
|
|
3018
|
+
const s = a.BigNum.from_str(this._txOutputs.get(e.unit) ?? "0").checked_add(a.BigNum.from_str(e.quantity)).to_str();
|
|
3019
|
+
this._txOutputs.set(e.unit, s);
|
|
2916
3020
|
}
|
|
2917
3021
|
};
|
|
2918
|
-
|
|
2919
|
-
|
|
3022
|
+
et([
|
|
3023
|
+
st()
|
|
2920
3024
|
], $.prototype, "mintAsset", null);
|
|
2921
|
-
|
|
2922
|
-
|
|
3025
|
+
et([
|
|
3026
|
+
st()
|
|
2923
3027
|
], $.prototype, "redeemValue", null);
|
|
2924
|
-
|
|
2925
|
-
|
|
3028
|
+
et([
|
|
3029
|
+
st()
|
|
2926
3030
|
], $.prototype, "sendAssets", null);
|
|
2927
|
-
|
|
2928
|
-
|
|
3031
|
+
et([
|
|
3032
|
+
st()
|
|
2929
3033
|
], $.prototype, "sendValue", null);
|
|
2930
|
-
|
|
2931
|
-
|
|
3034
|
+
et([
|
|
3035
|
+
st()
|
|
2932
3036
|
], $.prototype, "setCollateral", null);
|
|
2933
|
-
|
|
2934
|
-
|
|
3037
|
+
et([
|
|
3038
|
+
st()
|
|
2935
3039
|
], $.prototype, "setRequiredSigners", null);
|
|
2936
|
-
|
|
2937
|
-
|
|
3040
|
+
et([
|
|
3041
|
+
st()
|
|
2938
3042
|
], $.prototype, "setTxInputs", null);
|
|
2939
|
-
$ =
|
|
3043
|
+
$ = et([
|
|
2940
3044
|
Xs
|
|
2941
3045
|
], $);
|
|
2942
|
-
class
|
|
3046
|
+
class Zs {
|
|
3047
|
+
txHex = "";
|
|
3048
|
+
txBuilder = Ft();
|
|
3049
|
+
_protocolParams = P;
|
|
3050
|
+
txOutput;
|
|
3051
|
+
addingScriptInput = !1;
|
|
3052
|
+
addingPlutusMint = !1;
|
|
3053
|
+
isHydra = !1;
|
|
3054
|
+
meshTxBuilderBody = {
|
|
3055
|
+
inputs: [],
|
|
3056
|
+
outputs: [],
|
|
3057
|
+
collaterals: [],
|
|
3058
|
+
requiredSignatures: [],
|
|
3059
|
+
referenceInputs: [],
|
|
3060
|
+
mints: [],
|
|
3061
|
+
changeAddress: "",
|
|
3062
|
+
metadata: [],
|
|
3063
|
+
validityRange: {},
|
|
3064
|
+
signingKey: []
|
|
3065
|
+
};
|
|
3066
|
+
mintItem;
|
|
3067
|
+
txInQueueItem;
|
|
3068
|
+
collateralQueueItem;
|
|
3069
|
+
refScriptTxInQueueItem;
|
|
3070
|
+
completeSync = (e) => (e && (this.meshTxBuilderBody = e), this.serializeTxBody(this.meshTxBuilderBody));
|
|
3071
|
+
completeSigning = () => {
|
|
3072
|
+
const { signingKey: e } = this.meshTxBuilderBody;
|
|
3073
|
+
return e.length > 0 && this.addAllSigningKeys(e), this.txHex;
|
|
3074
|
+
};
|
|
3075
|
+
serializeTxBody = (e) => {
|
|
3076
|
+
const { inputs: t, outputs: s, collaterals: n, referenceInputs: i, mints: o, changeAddress: c, validityRange: u, requiredSignatures: d, metadata: A } = e;
|
|
3077
|
+
return this.isHydra ? this.protocolParams({
|
|
3078
|
+
minFeeA: 0,
|
|
3079
|
+
minFeeB: 0,
|
|
3080
|
+
priceMem: 0,
|
|
3081
|
+
priceStep: 0,
|
|
3082
|
+
collateralPercent: 0,
|
|
3083
|
+
coinsPerUTxOSize: "0"
|
|
3084
|
+
}) : this.protocolParams({}), this.meshTxBuilderBody.mints.sort((l, g) => l.policyId.localeCompare(g.policyId)), this.meshTxBuilderBody.inputs.sort((l, g) => l.txIn.txHash === g.txIn.txHash ? l.txIn.txIndex - g.txIn.txIndex : l.txIn.txHash.localeCompare(g.txIn.txHash)), this.addAllInputs(t), this.addAllOutputs(s), this.addAllCollaterals(n), this.addAllReferenceInputs(i), this.addAllMints(o), this.addValidityRange(u), this.addAllRequiredSignatures(d), this.addAllMetadata(A), this.addCostModels(), c && this.addChange(c), this.buildTx(), this;
|
|
3085
|
+
};
|
|
3086
|
+
txIn = (e, t, s, n) => (this.txInQueueItem && this.queueInput(), this.addingScriptInput ? this.txInQueueItem = {
|
|
3087
|
+
type: "Script",
|
|
3088
|
+
txIn: {
|
|
3089
|
+
txHash: e,
|
|
3090
|
+
txIndex: t,
|
|
3091
|
+
amount: s,
|
|
3092
|
+
address: n
|
|
3093
|
+
},
|
|
3094
|
+
scriptTxIn: {}
|
|
3095
|
+
} : this.txInQueueItem = {
|
|
3096
|
+
type: "PubKey",
|
|
3097
|
+
txIn: {
|
|
3098
|
+
txHash: e,
|
|
3099
|
+
txIndex: t,
|
|
3100
|
+
amount: s,
|
|
3101
|
+
address: n
|
|
3102
|
+
}
|
|
3103
|
+
}, this.addingScriptInput = !1, this);
|
|
3104
|
+
txInScript = (e) => {
|
|
3105
|
+
if (!this.txInQueueItem)
|
|
3106
|
+
throw Error("Undefined input");
|
|
3107
|
+
if (this.txInQueueItem.type === "PubKey")
|
|
3108
|
+
throw Error("Datum value attempted to be called a non script input");
|
|
3109
|
+
this.txInQueueItem.scriptTxIn.scriptSource = {
|
|
3110
|
+
type: "Provided",
|
|
3111
|
+
scriptCbor: e
|
|
3112
|
+
};
|
|
3113
|
+
};
|
|
3114
|
+
txInDatumValue = (e) => {
|
|
3115
|
+
if (!this.txInQueueItem)
|
|
3116
|
+
throw Error("Undefined input");
|
|
3117
|
+
if (this.txInQueueItem.type === "PubKey")
|
|
3118
|
+
throw Error("Datum value attempted to be called a non script input");
|
|
3119
|
+
return this.txInQueueItem.scriptTxIn.datumSource = {
|
|
3120
|
+
type: "Provided",
|
|
3121
|
+
data: e
|
|
3122
|
+
}, this;
|
|
3123
|
+
};
|
|
3124
|
+
txInInlineDatumPresent = () => {
|
|
3125
|
+
if (!this.txInQueueItem)
|
|
3126
|
+
throw Error("Undefined input");
|
|
3127
|
+
if (this.txInQueueItem.type === "PubKey")
|
|
3128
|
+
throw Error("Inline datum present attempted to be called a non script input");
|
|
3129
|
+
const { txHash: e, txIndex: t } = this.txInQueueItem.txIn;
|
|
3130
|
+
return e && t.toString() && (this.txInQueueItem.scriptTxIn.datumSource = {
|
|
3131
|
+
type: "Inline",
|
|
3132
|
+
txHash: e,
|
|
3133
|
+
txIndex: t
|
|
3134
|
+
}), this;
|
|
3135
|
+
};
|
|
3136
|
+
txInRedeemerValue = (e, t = At) => {
|
|
3137
|
+
if (!this.txInQueueItem)
|
|
3138
|
+
throw Error("Undefined input");
|
|
3139
|
+
if (this.txInQueueItem.type === "PubKey")
|
|
3140
|
+
throw Error("Spending tx in reference redeemer attempted to be called a non script input");
|
|
3141
|
+
return this.txInQueueItem.scriptTxIn.redeemer = {
|
|
3142
|
+
data: e,
|
|
3143
|
+
exUnits: t
|
|
3144
|
+
}, this;
|
|
3145
|
+
};
|
|
3146
|
+
txOut = (e, t) => (this.txOutput && (this.meshTxBuilderBody.outputs.push(this.txOutput), this.txOutput = void 0), this.txOutput = {
|
|
3147
|
+
address: e,
|
|
3148
|
+
amount: t
|
|
3149
|
+
}, this);
|
|
3150
|
+
txOutDatumHashValue = (e) => (this.txOutput && (this.txOutput.datum = {
|
|
3151
|
+
type: "Hash",
|
|
3152
|
+
data: e
|
|
3153
|
+
}), this);
|
|
3154
|
+
txOutInlineDatumValue = (e) => (this.txOutput && (this.txOutput.datum = {
|
|
3155
|
+
type: "Inline",
|
|
3156
|
+
data: e
|
|
3157
|
+
}), this);
|
|
3158
|
+
txOutReferenceScript = (e) => (this.txOutput && (this.txOutput.referenceScript = e), this);
|
|
3159
|
+
spendingPlutusScriptV2 = () => (this.addingScriptInput = !0, this);
|
|
3160
|
+
spendingTxInReference = (e, t, s) => {
|
|
3161
|
+
if (!this.txInQueueItem)
|
|
3162
|
+
throw Error("Undefined input");
|
|
3163
|
+
if (this.txInQueueItem.type === "PubKey")
|
|
3164
|
+
throw Error("Spending tx in reference attempted to be called a non script input");
|
|
3165
|
+
return this.txInQueueItem.scriptTxIn.scriptSource = {
|
|
3166
|
+
type: "Inline",
|
|
3167
|
+
txInInfo: {
|
|
3168
|
+
txHash: e,
|
|
3169
|
+
txIndex: t,
|
|
3170
|
+
spendingScriptHash: s
|
|
3171
|
+
}
|
|
3172
|
+
}, this;
|
|
3173
|
+
};
|
|
3174
|
+
spendingReferenceTxInInlineDatumPresent = () => (this.txInInlineDatumPresent(), this);
|
|
3175
|
+
spendingReferenceTxInRedeemerValue = (e, t = At) => (this.txInRedeemerValue(e, t), this);
|
|
3176
|
+
readOnlyTxInReference = (e, t) => (this.meshTxBuilderBody.referenceInputs.push({ txHash: e, txIndex: t }), this);
|
|
3177
|
+
mintPlutusScriptV2 = () => (this.addingPlutusMint = !0, this);
|
|
3178
|
+
mint = (e, t, s) => (this.mintItem && this.queueMint(), this.mintItem = {
|
|
3179
|
+
type: this.addingPlutusMint ? "Plutus" : "Native",
|
|
3180
|
+
policyId: t,
|
|
3181
|
+
assetName: s,
|
|
3182
|
+
amount: e
|
|
3183
|
+
}, this.addingPlutusMint = !1, this);
|
|
3184
|
+
mintingScript = (e) => {
|
|
3185
|
+
if (!this.mintItem)
|
|
3186
|
+
throw Error("Undefined mint");
|
|
3187
|
+
if (!this.mintItem.type)
|
|
3188
|
+
throw Error("Mint information missing");
|
|
3189
|
+
return this.mintItem.scriptSource = { type: "Provided", cbor: e }, this;
|
|
3190
|
+
};
|
|
3191
|
+
mintTxInReference = (e, t) => {
|
|
3192
|
+
if (!this.mintItem)
|
|
3193
|
+
throw Error("Undefined mint");
|
|
3194
|
+
if (!this.mintItem.type)
|
|
3195
|
+
throw Error("Mint information missing");
|
|
3196
|
+
if (this.mintItem.type == "Native")
|
|
3197
|
+
throw Error("Mint tx in reference can only be used on plutus script tokens");
|
|
3198
|
+
if (!this.mintItem.policyId)
|
|
3199
|
+
throw Error("PolicyId information missing from mint asset");
|
|
3200
|
+
return this.mintItem.scriptSource = {
|
|
3201
|
+
type: "Reference Script",
|
|
3202
|
+
txHash: e,
|
|
3203
|
+
txIndex: t
|
|
3204
|
+
}, this;
|
|
3205
|
+
};
|
|
3206
|
+
mintReferenceTxInRedeemerValue = (e, t = At) => {
|
|
3207
|
+
if (!this.mintItem)
|
|
3208
|
+
throw Error("Undefined mint");
|
|
3209
|
+
if (this.mintItem.type == "Native")
|
|
3210
|
+
throw Error("Mint tx in reference can only be used on plutus script tokens");
|
|
3211
|
+
if (this.mintItem.type == "Plutus") {
|
|
3212
|
+
if (!this.mintItem.policyId)
|
|
3213
|
+
throw Error("PolicyId information missing from mint asset");
|
|
3214
|
+
this.mintItem.redeemer = {
|
|
3215
|
+
data: e,
|
|
3216
|
+
exUnits: t
|
|
3217
|
+
};
|
|
3218
|
+
}
|
|
3219
|
+
return this;
|
|
3220
|
+
};
|
|
3221
|
+
mintRedeemerValue = (e, t) => (this.mintReferenceTxInRedeemerValue(e, t), this);
|
|
3222
|
+
requiredSignerHash = (e) => (this.meshTxBuilderBody.requiredSignatures.push(e), this);
|
|
3223
|
+
txInCollateral = (e, t, s, n) => (this.collateralQueueItem && this.meshTxBuilderBody.collaterals.push(this.collateralQueueItem), this.collateralQueueItem = {
|
|
3224
|
+
type: "PubKey",
|
|
3225
|
+
txIn: {
|
|
3226
|
+
txHash: e,
|
|
3227
|
+
txIndex: t,
|
|
3228
|
+
amount: s,
|
|
3229
|
+
address: n
|
|
3230
|
+
}
|
|
3231
|
+
}, this);
|
|
3232
|
+
changeAddress = (e) => (this.meshTxBuilderBody.changeAddress = e, this);
|
|
3233
|
+
invalidBefore = (e) => (this.meshTxBuilderBody.validityRange.invalidBefore = e, this);
|
|
3234
|
+
invalidHereafter = (e) => (this.meshTxBuilderBody.validityRange.invalidHereafter = e, this);
|
|
3235
|
+
metadataValue = (e, t) => (this.meshTxBuilderBody.metadata.push({ tag: e, metadata: t }), this);
|
|
3236
|
+
protocolParams = (e) => {
|
|
3237
|
+
const t = { ...P, ...e };
|
|
3238
|
+
return this._protocolParams = t, this.txBuilder = Ft(t), this;
|
|
3239
|
+
};
|
|
3240
|
+
signingKey = (e) => (this.meshTxBuilderBody.signingKey.push(e), this);
|
|
3241
|
+
addAllSigningKeys = (e) => {
|
|
3242
|
+
if (e.length > 0) {
|
|
3243
|
+
const t = a.Vkeywitnesses.new(), s = a.Transaction.from_hex(this.txHex), n = s.body();
|
|
3244
|
+
e.forEach((c) => {
|
|
3245
|
+
const u = c.slice(0, 4) === "5820" ? c.slice(4) : c, d = a.PrivateKey.from_hex(u), A = a.make_vkey_witness(a.hash_transaction(n), d);
|
|
3246
|
+
t.add(A);
|
|
3247
|
+
});
|
|
3248
|
+
const i = s.witness_set();
|
|
3249
|
+
i.set_vkeys(t);
|
|
3250
|
+
const o = a.Transaction.new(n, i, s.auxiliary_data());
|
|
3251
|
+
this.txHex = o.to_hex();
|
|
3252
|
+
}
|
|
3253
|
+
};
|
|
3254
|
+
buildTx = () => {
|
|
3255
|
+
const e = this.txBuilder.build_tx();
|
|
3256
|
+
this.txHex = e.to_hex();
|
|
3257
|
+
};
|
|
3258
|
+
queueInput = () => {
|
|
3259
|
+
if (!this.txInQueueItem)
|
|
3260
|
+
throw Error("Undefined input");
|
|
3261
|
+
if (this.txInQueueItem.type === "Script")
|
|
3262
|
+
if (this.txInQueueItem.scriptTxIn) {
|
|
3263
|
+
if (!this.txInQueueItem.scriptTxIn.datumSource)
|
|
3264
|
+
throw Error("Script input does not contain datum information");
|
|
3265
|
+
if (!this.txInQueueItem.scriptTxIn.redeemer)
|
|
3266
|
+
throw Error("Script input does not contain redeemer information");
|
|
3267
|
+
if (!this.txInQueueItem.scriptTxIn.scriptSource)
|
|
3268
|
+
throw Error("Script input does not contain script information");
|
|
3269
|
+
} else
|
|
3270
|
+
throw Error("Script input does not contain script, datum, or redeemer information");
|
|
3271
|
+
this.meshTxBuilderBody.inputs.push(this.txInQueueItem), this.txInQueueItem = void 0;
|
|
3272
|
+
};
|
|
3273
|
+
queueMint = () => {
|
|
3274
|
+
if (!this.mintItem)
|
|
3275
|
+
throw Error("Undefined mint");
|
|
3276
|
+
if (!this.mintItem.scriptSource)
|
|
3277
|
+
throw Error("Missing mint script information");
|
|
3278
|
+
this.meshTxBuilderBody.mints.push(this.mintItem), this.mintItem = void 0;
|
|
3279
|
+
};
|
|
3280
|
+
makePlutusScriptSource = (e) => {
|
|
3281
|
+
const t = a.ScriptHash.from_hex(e.spendingScriptHash), s = a.TransactionInput.new(a.TransactionHash.from_hex(e.txHash), e.txIndex);
|
|
3282
|
+
return a.PlutusScriptSource.new_ref_input_with_lang_ver(t, s, a.Language.new_plutus_v2());
|
|
3283
|
+
};
|
|
3284
|
+
addAllInputs = (e) => {
|
|
3285
|
+
for (let t = 0; t < e.length; t++) {
|
|
3286
|
+
const s = e[t];
|
|
3287
|
+
switch (s.type) {
|
|
3288
|
+
case "PubKey":
|
|
3289
|
+
this.addTxIn(s);
|
|
3290
|
+
break;
|
|
3291
|
+
case "Script":
|
|
3292
|
+
this.addScriptTxIn(s);
|
|
3293
|
+
break;
|
|
3294
|
+
}
|
|
3295
|
+
}
|
|
3296
|
+
};
|
|
3297
|
+
addTxIn = (e) => {
|
|
3298
|
+
this.txBuilder.add_input(a.Address.from_bech32(e.txIn.address), a.TransactionInput.new(a.TransactionHash.from_hex(e.txIn.txHash), e.txIn.txIndex), Z(e.txIn.amount));
|
|
3299
|
+
};
|
|
3300
|
+
addScriptTxIn = ({ scriptTxIn: e, txIn: t }) => {
|
|
3301
|
+
let s;
|
|
3302
|
+
const { datumSource: n, scriptSource: i, redeemer: o } = e;
|
|
3303
|
+
if (n.type === "Provided")
|
|
3304
|
+
s = a.DatumSource.new(b(n.data));
|
|
3305
|
+
else {
|
|
3306
|
+
const d = a.TransactionInput.new(a.TransactionHash.from_hex(n.txHash), n.txIndex);
|
|
3307
|
+
s = a.DatumSource.new_ref_input(d);
|
|
3308
|
+
}
|
|
3309
|
+
let c;
|
|
3310
|
+
i.type == "Inline" ? c = this.makePlutusScriptSource(i.txInInfo) : c = a.PlutusScriptSource.new(a.PlutusScript.from_hex_with_version(i.scriptCbor, a.Language.new_plutus_v2()));
|
|
3311
|
+
const u = a.Redeemer.new(a.RedeemerTag.new_spend(), a.BigNum.from_str("0"), b(o.data), a.ExUnits.new(a.BigNum.from_str(String(o.exUnits.mem)), a.BigNum.from_str(String(o.exUnits.steps))));
|
|
3312
|
+
this.txBuilder.add_plutus_script_input(a.PlutusWitness.new_with_ref(c, s, u), a.TransactionInput.new(a.TransactionHash.from_hex(t.txHash), t.txIndex), Z(t.amount));
|
|
3313
|
+
};
|
|
3314
|
+
addAllOutputs = (e) => {
|
|
3315
|
+
for (let t = 0; t < e.length; t++) {
|
|
3316
|
+
const s = e[t];
|
|
3317
|
+
this.addOutput(s);
|
|
3318
|
+
}
|
|
3319
|
+
};
|
|
3320
|
+
addOutput = ({ amount: e, address: t, datum: s, referenceScript: n }) => {
|
|
3321
|
+
const i = Z(e), o = i.multiasset();
|
|
3322
|
+
if (i.is_zero() && o === void 0)
|
|
3323
|
+
throw Error("Invalid output amount");
|
|
3324
|
+
let c = a.TransactionOutputBuilder.new().with_address(K(t));
|
|
3325
|
+
s && s.type === "Hash" && (c = c.with_data_hash(a.hash_plutus_data(b(s.data)))), s && s.type === "Inline" && (c = c.with_plutus_data(b(s.data))), n && (c = c.with_script_ref(a.ScriptRef.new_plutus_script(a.PlutusScript.from_hex(n))));
|
|
3326
|
+
const u = c.next();
|
|
3327
|
+
if (o) {
|
|
3328
|
+
const d = i.coin().is_zero() ? u.with_asset_and_min_required_coin_by_utxo_cost(o, Ht(this._protocolParams.coinsPerUTxOSize)).build() : u.with_coin_and_asset(i.coin(), o).build();
|
|
3329
|
+
this.txBuilder.add_output(d);
|
|
3330
|
+
} else {
|
|
3331
|
+
const d = u.with_coin(i.coin()).build();
|
|
3332
|
+
this.txBuilder.add_output(d);
|
|
3333
|
+
}
|
|
3334
|
+
};
|
|
3335
|
+
addAllCollaterals = (e) => {
|
|
3336
|
+
const t = a.TxInputsBuilder.new();
|
|
3337
|
+
for (let s = 0; s < e.length; s++) {
|
|
3338
|
+
const n = e[s];
|
|
3339
|
+
this.addCollateral(t, n);
|
|
3340
|
+
}
|
|
3341
|
+
this.txBuilder.set_collateral(t);
|
|
3342
|
+
};
|
|
3343
|
+
addCollateral = (e, t) => {
|
|
3344
|
+
e.add_input(a.Address.from_bech32(t.txIn.address), a.TransactionInput.new(a.TransactionHash.from_hex(t.txIn.txHash), t.txIn.txIndex), Z(t.txIn.amount));
|
|
3345
|
+
};
|
|
3346
|
+
addCollateralReturn = (e, t = 0) => {
|
|
3347
|
+
};
|
|
3348
|
+
addAllReferenceInputs = (e) => {
|
|
3349
|
+
e.forEach((t) => {
|
|
3350
|
+
this.addReferenceInput(t);
|
|
3351
|
+
});
|
|
3352
|
+
};
|
|
3353
|
+
addReferenceInput = ({ txHash: e, txIndex: t }) => {
|
|
3354
|
+
const s = a.TransactionInput.new(a.TransactionHash.from_hex(e), t);
|
|
3355
|
+
this.txBuilder.add_reference_input(s);
|
|
3356
|
+
};
|
|
3357
|
+
addAllMints = (e) => {
|
|
3358
|
+
const t = a.MintBuilder.new();
|
|
3359
|
+
let s = 0;
|
|
3360
|
+
for (let n = 0; n < e.length; n++) {
|
|
3361
|
+
const i = e[n];
|
|
3362
|
+
if (!i.scriptSource)
|
|
3363
|
+
throw Error("Mint script is expected to be provided");
|
|
3364
|
+
if (i.type === "Plutus") {
|
|
3365
|
+
if (!i.redeemer)
|
|
3366
|
+
throw Error("Missing mint redeemer information");
|
|
3367
|
+
this.addPlutusMint(t, i, s), s++;
|
|
3368
|
+
} else
|
|
3369
|
+
i.type === "Native" && this.addNativeMint(t, i);
|
|
3370
|
+
}
|
|
3371
|
+
this.txBuilder.set_mint_builder(t);
|
|
3372
|
+
};
|
|
3373
|
+
addPlutusMint = (e, { redeemer: t, policyId: s, scriptSource: n, assetName: i, amount: o }, c) => {
|
|
3374
|
+
const u = a.Redeemer.new(a.RedeemerTag.new_mint(), a.BigNum.from_str(String(c)), b(t.data), a.ExUnits.new(a.BigNum.from_str(String(t.exUnits.mem)), a.BigNum.from_str(String(t.exUnits.steps)))), d = n.type === "Reference Script" ? a.PlutusScriptSource.new_ref_input_with_lang_ver(a.ScriptHash.from_hex(s), a.TransactionInput.new(a.TransactionHash.from_hex(n.txHash), n.txIndex), a.Language.new_plutus_v2()) : a.PlutusScriptSource.new(a.PlutusScript.from_hex_with_version(n.cbor, a.Language.new_plutus_v2()));
|
|
3375
|
+
e.add_asset(a.MintWitness.new_plutus_script(d, u), a.AssetName.new(Buffer.from(i, "hex")), a.Int.new_i32(o));
|
|
3376
|
+
};
|
|
3377
|
+
addNativeMint = (e, { scriptSource: t, assetName: s, amount: n }) => {
|
|
3378
|
+
if (t.type === "Reference Script")
|
|
3379
|
+
throw Error("Native mint cannot have reference script");
|
|
3380
|
+
e.add_asset(a.MintWitness.new_native_script(a.NativeScript.from_hex(t.cbor)), a.AssetName.new(Buffer.from(s, "hex")), a.Int.new_i32(n));
|
|
3381
|
+
};
|
|
3382
|
+
queueAllLastItem = () => {
|
|
3383
|
+
this.txOutput && (this.meshTxBuilderBody.outputs.push(this.txOutput), this.txOutput = void 0), this.txInQueueItem && this.queueInput(), this.collateralQueueItem && this.meshTxBuilderBody.collaterals.push(this.collateralQueueItem), this.mintItem && this.queueMint();
|
|
3384
|
+
};
|
|
3385
|
+
addCostModels = () => {
|
|
3386
|
+
this.txBuilder.calc_script_data_hash(a.TxBuilderConstants.plutus_vasil_cost_models());
|
|
3387
|
+
};
|
|
3388
|
+
addChange = (e) => {
|
|
3389
|
+
this.txBuilder.add_change_if_needed(a.Address.from_bech32(e));
|
|
3390
|
+
};
|
|
3391
|
+
addValidityRange = ({ invalidBefore: e, invalidHereafter: t }) => {
|
|
3392
|
+
e && this.txBuilder.set_validity_start_interval_bignum(a.BigNum.from_str(e.toString())), t && this.txBuilder.set_ttl_bignum(a.BigNum.from_str(t.toString()));
|
|
3393
|
+
};
|
|
3394
|
+
addAllRequiredSignatures = (e) => {
|
|
3395
|
+
e.forEach((t) => {
|
|
3396
|
+
this.txBuilder.add_required_signer(a.Ed25519KeyHash.from_hex(t));
|
|
3397
|
+
});
|
|
3398
|
+
};
|
|
3399
|
+
addAllMetadata = (e) => {
|
|
3400
|
+
e.forEach(({ tag: t, metadata: s }) => {
|
|
3401
|
+
this.txBuilder.add_json_metadatum(a.BigNum.from_str(t), JSON.stringify(s));
|
|
3402
|
+
});
|
|
3403
|
+
};
|
|
3404
|
+
updateRedeemer = (e, t) => {
|
|
3405
|
+
t.forEach((s) => {
|
|
3406
|
+
switch (s.tag) {
|
|
3407
|
+
case "SPEND": {
|
|
3408
|
+
const n = e.inputs[s.index];
|
|
3409
|
+
n.type == "Script" && n.scriptTxIn.redeemer && (n.scriptTxIn.redeemer.exUnits.mem = s.budget.mem, n.scriptTxIn.redeemer.exUnits.steps = s.budget.steps);
|
|
3410
|
+
break;
|
|
3411
|
+
}
|
|
3412
|
+
case "MINT": {
|
|
3413
|
+
const n = e.mints[s.index];
|
|
3414
|
+
n.type == "Plutus" && n.redeemer && (n.redeemer.exUnits.mem = s.budget.mem, n.redeemer.exUnits.steps = s.budget.steps);
|
|
3415
|
+
break;
|
|
3416
|
+
}
|
|
3417
|
+
}
|
|
3418
|
+
});
|
|
3419
|
+
};
|
|
3420
|
+
}
|
|
3421
|
+
class Dr extends Zs {
|
|
3422
|
+
_fetcher;
|
|
3423
|
+
_submitter;
|
|
3424
|
+
_evaluator;
|
|
3425
|
+
queriedTxHashes = /* @__PURE__ */ new Set();
|
|
3426
|
+
queriedUTxOs = {};
|
|
3427
|
+
constructor({ fetcher: e, submitter: t, evaluator: s, isHydra: n = !1 }) {
|
|
3428
|
+
super(), e && (this._fetcher = e), t && (this._submitter = t), s && (this._evaluator = s), n && (this.isHydra = !0);
|
|
3429
|
+
}
|
|
3430
|
+
complete = async (e) => {
|
|
3431
|
+
e ? this.meshTxBuilderBody = e : this.queueAllLastItem(), await this.queryAllTxInfo();
|
|
3432
|
+
const { inputs: t, collaterals: s } = this.meshTxBuilderBody;
|
|
3433
|
+
if ([...t, ...s].forEach((n) => {
|
|
3434
|
+
this.completeTxInformation(n);
|
|
3435
|
+
}), this.completeSync(e), this._evaluator) {
|
|
3436
|
+
const n = await this._evaluator.evaluateTx(this.txHex);
|
|
3437
|
+
this.updateRedeemer(this.meshTxBuilderBody, n), this.completeSync(e);
|
|
3438
|
+
}
|
|
3439
|
+
return this;
|
|
3440
|
+
};
|
|
3441
|
+
submitTx = async (e) => {
|
|
3442
|
+
var s;
|
|
3443
|
+
return await ((s = this._submitter) == null ? void 0 : s.submitTx(e));
|
|
3444
|
+
};
|
|
3445
|
+
getUTxOInfo = async (e) => {
|
|
3446
|
+
var s;
|
|
3447
|
+
let t = [];
|
|
3448
|
+
this.queriedTxHashes.has(e) || (this.queriedTxHashes.add(e), t = await ((s = this._fetcher) == null ? void 0 : s.fetchUTxOs(e)) || [], this.queriedUTxOs[e] = t);
|
|
3449
|
+
};
|
|
3450
|
+
queryAllTxInfo = () => {
|
|
3451
|
+
var n, i;
|
|
3452
|
+
const e = [], { inputs: t, collaterals: s } = this.meshTxBuilderBody;
|
|
3453
|
+
if (t.length + s.length > 0 && !this._fetcher)
|
|
3454
|
+
throw Error("Transaction information is incomplete while no fetcher instance is provided");
|
|
3455
|
+
for (let o = 0; o < t.length; o++) {
|
|
3456
|
+
const c = t[o];
|
|
3457
|
+
if ((!c.txIn.amount || !c.txIn.address) && e.push(this.getUTxOInfo(c.txIn.txHash)), c.type === "Script" && ((n = c.scriptTxIn.scriptSource) == null ? void 0 : n.type) == "Inline" && c.scriptTxIn.scriptSource.txInInfo && !((i = c.scriptTxIn.scriptSource) != null && i.txInInfo.spendingScriptHash)) {
|
|
3458
|
+
const u = c.scriptTxIn.scriptSource.txInInfo.txHash;
|
|
3459
|
+
e.push(this.getUTxOInfo(u));
|
|
3460
|
+
}
|
|
3461
|
+
}
|
|
3462
|
+
for (let o = 0; o < s.length; o++) {
|
|
3463
|
+
const c = s[o];
|
|
3464
|
+
(!c.txIn.amount || !c.txIn.address) && e.push(this.getUTxOInfo(c.txIn.txHash));
|
|
3465
|
+
}
|
|
3466
|
+
return Promise.all(e);
|
|
3467
|
+
};
|
|
3468
|
+
completeTxInformation = (e) => {
|
|
3469
|
+
var o;
|
|
3470
|
+
const s = this.queriedUTxOs[e.txIn.txHash].find((c) => c.input.outputIndex === e.txIn.txIndex), n = s == null ? void 0 : s.output.address, i = s == null ? void 0 : s.output.amount;
|
|
3471
|
+
if (!n || n === "" || !i || i.length === 0)
|
|
3472
|
+
throw Error(`Couldn't find information for ${e.txIn.txHash}#${e.txIn.txIndex}`);
|
|
3473
|
+
if (e.txIn.address = n, e.txIn.amount = i, e.type === "Script" && ((o = e.scriptTxIn.scriptSource) == null ? void 0 : o.type) == "Inline") {
|
|
3474
|
+
const c = e.scriptTxIn.scriptSource.txInInfo;
|
|
3475
|
+
if (!c.spendingScriptHash) {
|
|
3476
|
+
const d = this.queriedUTxOs[c.txHash].find((A) => A.input.outputIndex === c.txIndex);
|
|
3477
|
+
if (!d)
|
|
3478
|
+
throw Error(`Couldn't find script reference utxo for ${c.txHash}#${c.txIndex}`);
|
|
3479
|
+
c.spendingScriptHash = d == null ? void 0 : d.output.scriptHash;
|
|
3480
|
+
}
|
|
3481
|
+
}
|
|
3482
|
+
};
|
|
3483
|
+
}
|
|
3484
|
+
class C {
|
|
2943
3485
|
_networkId;
|
|
2944
3486
|
_encryptedSecret;
|
|
2945
3487
|
constructor(e, t) {
|
|
2946
3488
|
this._networkId = e, this._encryptedSecret = t;
|
|
2947
3489
|
}
|
|
2948
3490
|
getAccount(e, t) {
|
|
2949
|
-
return this.accountContext(e, t, (
|
|
2950
|
-
const
|
|
3491
|
+
return this.accountContext(e, t, (s, n) => {
|
|
3492
|
+
const i = fe(this._networkId, s.to_public().hash(), n.to_public().hash()).to_address().to_bech32(), o = _e(this._networkId, s.to_public().hash()).to_address().to_bech32(), c = Mt(this._networkId, n.to_public().hash()).to_address().to_bech32();
|
|
2951
3493
|
return {
|
|
2952
|
-
baseAddress:
|
|
3494
|
+
baseAddress: i,
|
|
2953
3495
|
enterpriseAddress: o,
|
|
2954
3496
|
rewardAddress: c
|
|
2955
3497
|
};
|
|
2956
3498
|
});
|
|
2957
3499
|
}
|
|
2958
|
-
signData(e, t,
|
|
3500
|
+
signData(e, t, s, n) {
|
|
2959
3501
|
try {
|
|
2960
|
-
return this.accountContext(e, t, (
|
|
2961
|
-
const c = { payload:
|
|
2962
|
-
address:
|
|
2963
|
-
key:
|
|
2964
|
-
}, { coseSign1:
|
|
2965
|
-
return { signature:
|
|
3502
|
+
return this.accountContext(e, t, (i, o) => {
|
|
3503
|
+
const c = { payload: n }, u = {
|
|
3504
|
+
address: C.resolveAddress(this._networkId, s, i, o),
|
|
3505
|
+
key: s.startsWith("stake") ? o : i
|
|
3506
|
+
}, { coseSign1: d, coseKey: A } = As(c, u);
|
|
3507
|
+
return { signature: d, key: A };
|
|
2966
3508
|
});
|
|
2967
|
-
} catch (
|
|
2968
|
-
throw new Error(`An error occurred during signData: ${
|
|
3509
|
+
} catch (i) {
|
|
3510
|
+
throw new Error(`An error occurred during signData: ${i}.`);
|
|
2969
3511
|
}
|
|
2970
3512
|
}
|
|
2971
|
-
signTx(e, t,
|
|
3513
|
+
signTx(e, t, s, n, i) {
|
|
2972
3514
|
try {
|
|
2973
|
-
const o =
|
|
3515
|
+
const o = He(js(n));
|
|
2974
3516
|
return this.accountContext(e, t, (c, u) => {
|
|
2975
|
-
const
|
|
2976
|
-
return
|
|
2977
|
-
if (
|
|
2978
|
-
|
|
2979
|
-
else if (
|
|
2980
|
-
|
|
2981
|
-
else if (
|
|
2982
|
-
throw new Error(`Missing key witness for: ${
|
|
2983
|
-
}),
|
|
3517
|
+
const d = a.Vkeywitnesses.new();
|
|
3518
|
+
return C.resolveSigners(n, s, c.to_public().hash().to_hex()).forEach((l) => {
|
|
3519
|
+
if (l === c.to_public().hash().to_hex())
|
|
3520
|
+
d.add(a.make_vkey_witness(o, c));
|
|
3521
|
+
else if (l === u.to_public().hash().to_hex())
|
|
3522
|
+
d.add(a.make_vkey_witness(o, u));
|
|
3523
|
+
else if (i === !1)
|
|
3524
|
+
throw new Error(`Missing key witness for: ${l}`);
|
|
3525
|
+
}), d;
|
|
2984
3526
|
});
|
|
2985
3527
|
} catch (o) {
|
|
2986
3528
|
throw new Error(`An error occurred during signTx: ${o}.`);
|
|
2987
3529
|
}
|
|
2988
3530
|
}
|
|
2989
3531
|
static encryptMnemonic(e, t) {
|
|
2990
|
-
const
|
|
2991
|
-
return
|
|
3532
|
+
const s = we(e.join(" ")), n = Re(s), i = v(n.as_bytes());
|
|
3533
|
+
return n.free(), C.encrypt(i, t);
|
|
2992
3534
|
}
|
|
2993
3535
|
static encryptPrivateKey(e, t) {
|
|
2994
|
-
const
|
|
2995
|
-
return
|
|
3536
|
+
const s = a.Bip32PrivateKey.from_bech32(e), n = v(s.as_bytes());
|
|
3537
|
+
return s.free(), C.encrypt(n, t);
|
|
2996
3538
|
}
|
|
2997
|
-
static encryptSigningKeys(e, t,
|
|
2998
|
-
const
|
|
2999
|
-
return [
|
|
3539
|
+
static encryptSigningKeys(e, t, s) {
|
|
3540
|
+
const n = C.encrypt(e.slice(4), s), i = C.encrypt(t.slice(4), s);
|
|
3541
|
+
return [n, i];
|
|
3000
3542
|
}
|
|
3001
3543
|
static generateMnemonic(e = 256) {
|
|
3002
|
-
return
|
|
3544
|
+
return ze(e).split(" ");
|
|
3003
3545
|
}
|
|
3004
|
-
accountContext(e, t,
|
|
3005
|
-
const { paymentKey:
|
|
3006
|
-
return
|
|
3546
|
+
accountContext(e, t, s) {
|
|
3547
|
+
const { paymentKey: n, stakeKey: i } = C.resolveKeys(e, t, this._encryptedSecret), o = s(n, i);
|
|
3548
|
+
return n.free(), i.free(), o;
|
|
3007
3549
|
}
|
|
3008
3550
|
static decrypt(e, t) {
|
|
3009
3551
|
try {
|
|
3010
|
-
return
|
|
3552
|
+
return a.decrypt_with_password(S(t), e);
|
|
3011
3553
|
} catch {
|
|
3012
3554
|
throw new Error("The password is incorrect.");
|
|
3013
3555
|
}
|
|
3014
3556
|
}
|
|
3015
3557
|
static encrypt(e, t) {
|
|
3016
|
-
const
|
|
3017
|
-
return
|
|
3018
|
-
}
|
|
3019
|
-
static resolveAddress(e, t,
|
|
3020
|
-
const
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3558
|
+
const s = Ce("0123456789abcdef"), n = s(64), i = s(24);
|
|
3559
|
+
return a.encrypt_with_password(S(t), n, i, e);
|
|
3560
|
+
}
|
|
3561
|
+
static resolveAddress(e, t, s, n) {
|
|
3562
|
+
const i = [
|
|
3563
|
+
fe(e, s.to_public().hash(), n.to_public().hash()),
|
|
3564
|
+
_e(e, s.to_public().hash()),
|
|
3565
|
+
Mt(e, n.to_public().hash())
|
|
3024
3566
|
].find((o) => o.to_address().to_bech32() === t);
|
|
3025
|
-
if (
|
|
3026
|
-
return
|
|
3567
|
+
if (i !== void 0)
|
|
3568
|
+
return i.to_address();
|
|
3027
3569
|
throw new Error(`Address: ${t} doesn't belong to this account.`);
|
|
3028
3570
|
}
|
|
3029
|
-
static resolveKeys(e, t,
|
|
3030
|
-
if (typeof
|
|
3031
|
-
const o =
|
|
3032
|
-
return
|
|
3571
|
+
static resolveKeys(e, t, s) {
|
|
3572
|
+
if (typeof s == "string") {
|
|
3573
|
+
const o = C.decrypt(s, t);
|
|
3574
|
+
return Ms(o, e);
|
|
3033
3575
|
}
|
|
3034
|
-
const
|
|
3576
|
+
const n = C.decrypt(s[0], t), i = C.decrypt(s[1], t);
|
|
3035
3577
|
return {
|
|
3036
|
-
paymentKey:
|
|
3037
|
-
stakeKey:
|
|
3578
|
+
paymentKey: a.PrivateKey.from_hex(n),
|
|
3579
|
+
stakeKey: a.PrivateKey.from_hex(i)
|
|
3038
3580
|
};
|
|
3039
3581
|
}
|
|
3040
|
-
static resolveSigners(e, t,
|
|
3041
|
-
const
|
|
3042
|
-
const u = (p, E = [],
|
|
3043
|
-
var
|
|
3044
|
-
if (p === void 0 ||
|
|
3582
|
+
static resolveSigners(e, t, s) {
|
|
3583
|
+
const n = (c) => {
|
|
3584
|
+
const u = (p, E = [], w = 0) => {
|
|
3585
|
+
var pt, dt, $t, zt, Wt;
|
|
3586
|
+
if (p === void 0 || w >= p.len())
|
|
3045
3587
|
return E;
|
|
3046
|
-
const
|
|
3047
|
-
switch (
|
|
3048
|
-
case
|
|
3049
|
-
const
|
|
3050
|
-
|
|
3588
|
+
const k = p.get(w), T = new Array();
|
|
3589
|
+
switch (k.kind()) {
|
|
3590
|
+
case a.CertificateKind.StakeDeregistration: {
|
|
3591
|
+
const x = (pt = k.as_stake_deregistration()) == null ? void 0 : pt.stake_credential(), q = (x == null ? void 0 : x.kind()) === a.StakeCredKind.Key ? x.to_keyhash() : void 0;
|
|
3592
|
+
q && T.push(q.to_hex());
|
|
3051
3593
|
break;
|
|
3052
3594
|
}
|
|
3053
|
-
case
|
|
3054
|
-
const
|
|
3055
|
-
|
|
3595
|
+
case a.CertificateKind.StakeDelegation: {
|
|
3596
|
+
const x = (dt = k.as_stake_delegation()) == null ? void 0 : dt.stake_credential(), q = (x == null ? void 0 : x.kind()) === a.StakeCredKind.Key ? x.to_keyhash() : void 0;
|
|
3597
|
+
q && T.push(q.to_hex());
|
|
3056
3598
|
break;
|
|
3057
3599
|
}
|
|
3058
|
-
case
|
|
3059
|
-
const
|
|
3060
|
-
|
|
3600
|
+
case a.CertificateKind.PoolRegistration: {
|
|
3601
|
+
const x = ($t = k.as_pool_registration()) == null ? void 0 : $t.pool_params().pool_owners();
|
|
3602
|
+
T.push(...A(x));
|
|
3061
3603
|
break;
|
|
3062
3604
|
}
|
|
3063
|
-
case
|
|
3064
|
-
const
|
|
3065
|
-
|
|
3605
|
+
case a.CertificateKind.PoolRetirement: {
|
|
3606
|
+
const x = (zt = k.as_pool_retirement()) == null ? void 0 : zt.pool_keyhash();
|
|
3607
|
+
x && T.push(x.to_hex());
|
|
3066
3608
|
break;
|
|
3067
3609
|
}
|
|
3068
|
-
case
|
|
3069
|
-
const
|
|
3070
|
-
if (
|
|
3071
|
-
for (let
|
|
3072
|
-
const
|
|
3073
|
-
|
|
3610
|
+
case a.CertificateKind.MoveInstantaneousRewardsCert: {
|
|
3611
|
+
const x = (Wt = k.as_move_instantaneous_rewards_cert()) == null ? void 0 : Wt.move_instantaneous_reward().as_to_stake_creds();
|
|
3612
|
+
if (x)
|
|
3613
|
+
for (let q = 0; q < x.len(); q += 1) {
|
|
3614
|
+
const Jt = x.keys().get(q), jt = Jt.kind() === a.StakeCredKind.Key ? Jt.to_keyhash() : void 0;
|
|
3615
|
+
jt && T.push(jt.to_hex());
|
|
3074
3616
|
}
|
|
3075
3617
|
break;
|
|
3076
3618
|
}
|
|
3077
3619
|
}
|
|
3078
|
-
return u(p, [...E, ...
|
|
3079
|
-
},
|
|
3080
|
-
if (p === void 0 ||
|
|
3620
|
+
return u(p, [...E, ...T], w + 1);
|
|
3621
|
+
}, d = (p, E = [], w = 0) => {
|
|
3622
|
+
if (p === void 0 || w >= p.len())
|
|
3081
3623
|
return E;
|
|
3082
|
-
const
|
|
3083
|
-
return
|
|
3084
|
-
},
|
|
3085
|
-
if (p === void 0 ||
|
|
3624
|
+
const k = p.get(w).index(), T = p.get(w).transaction_id(), pt = t.find((dt) => dt.input.outputIndex === k && dt.input.txHash === T.to_hex()) !== void 0 ? s : "OUR_PRINCESS_IS_IN_ANOTHER_CASTLE";
|
|
3625
|
+
return d(p, [...E, pt], w + 1);
|
|
3626
|
+
}, A = (p, E = [], w = 0) => p === void 0 || w >= p.len() ? E : A(p, [...E, p.get(w).to_hex()], w + 1), l = (p, E = [], w = 0) => {
|
|
3627
|
+
if (p === void 0 || w >= p.len())
|
|
3086
3628
|
return E;
|
|
3087
|
-
const
|
|
3088
|
-
return
|
|
3089
|
-
},
|
|
3629
|
+
const k = p.keys().get(w).payment_cred(), T = k.kind() === a.StakeCredKind.Key ? k.to_keyhash() : void 0;
|
|
3630
|
+
return l(p, T ? [...E, T.to_hex()] : E, w + 1);
|
|
3631
|
+
}, g = c.certs(), f = c.collateral(), y = c.inputs(), V = c.required_signers(), z = c.withdrawals();
|
|
3090
3632
|
return [
|
|
3091
|
-
...u(
|
|
3092
|
-
...
|
|
3093
|
-
...
|
|
3094
|
-
...
|
|
3095
|
-
...
|
|
3633
|
+
...u(g),
|
|
3634
|
+
...d(f),
|
|
3635
|
+
...d(y),
|
|
3636
|
+
...A(V),
|
|
3637
|
+
...l(z)
|
|
3096
3638
|
];
|
|
3097
|
-
},
|
|
3098
|
-
const u = (
|
|
3099
|
-
var
|
|
3100
|
-
if (
|
|
3101
|
-
for (let
|
|
3102
|
-
const p =
|
|
3639
|
+
}, i = (c) => {
|
|
3640
|
+
const u = (A, l = []) => {
|
|
3641
|
+
var g, f, y, V;
|
|
3642
|
+
if (A)
|
|
3643
|
+
for (let z = 0; z < A.len(); z += 1) {
|
|
3644
|
+
const p = A.get(z);
|
|
3103
3645
|
switch (p.kind()) {
|
|
3104
|
-
case
|
|
3105
|
-
const E = (
|
|
3106
|
-
return E ? [...
|
|
3646
|
+
case a.NativeScriptKind.ScriptPubkey: {
|
|
3647
|
+
const E = (g = p.as_script_pubkey()) == null ? void 0 : g.addr_keyhash().to_hex();
|
|
3648
|
+
return E ? [...l, E] : l;
|
|
3107
3649
|
}
|
|
3108
|
-
case
|
|
3109
|
-
return u((f = p.as_script_all()) == null ? void 0 : f.native_scripts(),
|
|
3110
|
-
case
|
|
3111
|
-
return u((y = p.as_script_any()) == null ? void 0 : y.native_scripts(),
|
|
3112
|
-
case
|
|
3113
|
-
return u((
|
|
3650
|
+
case a.NativeScriptKind.ScriptAll:
|
|
3651
|
+
return u((f = p.as_script_all()) == null ? void 0 : f.native_scripts(), l);
|
|
3652
|
+
case a.NativeScriptKind.ScriptAny:
|
|
3653
|
+
return u((y = p.as_script_any()) == null ? void 0 : y.native_scripts(), l);
|
|
3654
|
+
case a.NativeScriptKind.ScriptNOfK:
|
|
3655
|
+
return u((V = p.as_script_n_of_k()) == null ? void 0 : V.native_scripts(), l);
|
|
3114
3656
|
}
|
|
3115
3657
|
}
|
|
3116
|
-
return
|
|
3117
|
-
},
|
|
3658
|
+
return l;
|
|
3659
|
+
}, d = c.native_scripts();
|
|
3118
3660
|
return [
|
|
3119
|
-
...u(
|
|
3661
|
+
...u(d)
|
|
3120
3662
|
];
|
|
3121
|
-
}, o =
|
|
3663
|
+
}, o = Y(e);
|
|
3122
3664
|
return /* @__PURE__ */ new Set([
|
|
3123
|
-
...
|
|
3124
|
-
...
|
|
3665
|
+
...n(o.body()),
|
|
3666
|
+
...i(o.witness_set())
|
|
3125
3667
|
]);
|
|
3126
3668
|
}
|
|
3127
3669
|
}
|
|
3128
|
-
const
|
|
3129
|
-
class
|
|
3670
|
+
const U = "MARI0TIME";
|
|
3671
|
+
class kr {
|
|
3130
3672
|
_fetcher;
|
|
3131
3673
|
_submitter;
|
|
3132
3674
|
_wallet;
|
|
3133
3675
|
constructor(e) {
|
|
3134
3676
|
switch (this._fetcher = e.fetcher, this._submitter = e.submitter, e.key.type) {
|
|
3135
3677
|
case "mnemonic":
|
|
3136
|
-
this._wallet = new
|
|
3678
|
+
this._wallet = new C(e.networkId, C.encryptMnemonic(e.key.words, U));
|
|
3137
3679
|
break;
|
|
3138
3680
|
case "root":
|
|
3139
|
-
this._wallet = new
|
|
3681
|
+
this._wallet = new C(e.networkId, C.encryptPrivateKey(e.key.bech32, U));
|
|
3140
3682
|
break;
|
|
3141
3683
|
case "cli":
|
|
3142
|
-
this._wallet = new
|
|
3684
|
+
this._wallet = new C(e.networkId, C.encryptSigningKeys(e.key.payment, e.key.stake ?? "f0".repeat(34), U));
|
|
3143
3685
|
}
|
|
3144
3686
|
}
|
|
3145
3687
|
getBaseAddress(e = 0) {
|
|
3146
|
-
return this._wallet.getAccount(e,
|
|
3688
|
+
return this._wallet.getAccount(e, U).baseAddress;
|
|
3147
3689
|
}
|
|
3148
3690
|
getPaymentAddress(e = 0) {
|
|
3149
|
-
return this._wallet.getAccount(e,
|
|
3691
|
+
return this._wallet.getAccount(e, U).enterpriseAddress;
|
|
3150
3692
|
}
|
|
3151
3693
|
getRewardAddress(e = 0) {
|
|
3152
|
-
return this._wallet.getAccount(e,
|
|
3694
|
+
return this._wallet.getAccount(e, U).rewardAddress;
|
|
3153
3695
|
}
|
|
3154
3696
|
getUsedAddress(e = 0) {
|
|
3155
|
-
const t = this._wallet.getAccount(e,
|
|
3156
|
-
return
|
|
3697
|
+
const t = this._wallet.getAccount(e, U);
|
|
3698
|
+
return K(t.enterpriseAddress);
|
|
3157
3699
|
}
|
|
3158
|
-
getUsedCollateral(e =
|
|
3700
|
+
getUsedCollateral(e = P.maxCollateralInputs) {
|
|
3159
3701
|
throw new Error("getUsedCollateral not implemented.");
|
|
3160
3702
|
}
|
|
3161
3703
|
async getUsedUTxOs(e = 0) {
|
|
3162
|
-
const t = this._wallet.getAccount(e,
|
|
3163
|
-
return (await this._fetcher.fetchAddressUTxOs(t.enterpriseAddress)).map((
|
|
3704
|
+
const t = this._wallet.getAccount(e, U);
|
|
3705
|
+
return (await this._fetcher.fetchAddressUTxOs(t.enterpriseAddress)).map((n) => H(n));
|
|
3164
3706
|
}
|
|
3165
|
-
signData(e, t,
|
|
3707
|
+
signData(e, t, s = 0) {
|
|
3166
3708
|
try {
|
|
3167
|
-
return this._wallet.signData(
|
|
3168
|
-
} catch (
|
|
3169
|
-
throw new Error(`[AppWallet] An error occurred during signData: ${
|
|
3709
|
+
return this._wallet.signData(s, U, e, t);
|
|
3710
|
+
} catch (n) {
|
|
3711
|
+
throw new Error(`[AppWallet] An error occurred during signData: ${n}.`);
|
|
3170
3712
|
}
|
|
3171
3713
|
}
|
|
3172
|
-
async signTx(e, t = !1,
|
|
3714
|
+
async signTx(e, t = !1, s = 0) {
|
|
3173
3715
|
try {
|
|
3174
|
-
const
|
|
3175
|
-
return u.set_vkeys(
|
|
3176
|
-
} catch (
|
|
3177
|
-
throw new Error(`[AppWallet] An error occurred during signTx: ${
|
|
3716
|
+
const n = this._wallet.getAccount(s, U), i = await this._fetcher.fetchAddressUTxOs(n.enterpriseAddress), o = this._wallet.signTx(s, U, i, e, t), c = Y(e), u = c.witness_set(), d = Ge(u, o);
|
|
3717
|
+
return u.set_vkeys(d), a.Transaction.new(c.body(), u, c.auxiliary_data()).to_hex();
|
|
3718
|
+
} catch (n) {
|
|
3719
|
+
throw new Error(`[AppWallet] An error occurred during signTx: ${n}.`);
|
|
3178
3720
|
}
|
|
3179
3721
|
}
|
|
3180
3722
|
submitTx(e) {
|
|
3181
3723
|
return this._submitter.submitTx(e);
|
|
3182
3724
|
}
|
|
3183
3725
|
static brew(e = 256) {
|
|
3184
|
-
return
|
|
3726
|
+
return C.generateMnemonic(e);
|
|
3185
3727
|
}
|
|
3186
3728
|
}
|
|
3187
|
-
class
|
|
3729
|
+
class Ot {
|
|
3188
3730
|
_walletInstance;
|
|
3189
3731
|
constructor(e) {
|
|
3190
3732
|
this._walletInstance = e;
|
|
3191
3733
|
}
|
|
3192
3734
|
static getInstalledWallets() {
|
|
3193
|
-
return window.cardano === void 0 ? [] :
|
|
3735
|
+
return window.cardano === void 0 ? [] : te.filter((e) => window.cardano[e] !== void 0).map((e) => ({
|
|
3194
3736
|
name: window.cardano[e].name,
|
|
3195
3737
|
icon: window.cardano[e].icon,
|
|
3196
3738
|
version: window.cardano[e].apiVersion
|
|
@@ -3198,9 +3740,9 @@ class Tt {
|
|
|
3198
3740
|
}
|
|
3199
3741
|
static async enable(e) {
|
|
3200
3742
|
try {
|
|
3201
|
-
const t = await
|
|
3743
|
+
const t = await Ot.resolveInstance(e);
|
|
3202
3744
|
if (t !== void 0)
|
|
3203
|
-
return new
|
|
3745
|
+
return new Ot(t);
|
|
3204
3746
|
throw new Error(`Couldn't create an instance of wallet: ${e}`);
|
|
3205
3747
|
} catch (t) {
|
|
3206
3748
|
throw new Error(`[BrowserWallet] An error occurred during enable: ${t}.`);
|
|
@@ -3208,40 +3750,40 @@ class Tt {
|
|
|
3208
3750
|
}
|
|
3209
3751
|
async getBalance() {
|
|
3210
3752
|
const e = await this._walletInstance.getBalance();
|
|
3211
|
-
return
|
|
3753
|
+
return qe(Gs(e));
|
|
3212
3754
|
}
|
|
3213
3755
|
async getChangeAddress() {
|
|
3214
3756
|
const e = await this._walletInstance.getChangeAddress();
|
|
3215
|
-
return
|
|
3757
|
+
return rt(e).to_bech32();
|
|
3216
3758
|
}
|
|
3217
|
-
async getCollateral(e =
|
|
3218
|
-
return (await this.getUsedCollateral(e)).map((
|
|
3759
|
+
async getCollateral(e = P.maxCollateralInputs) {
|
|
3760
|
+
return (await this.getUsedCollateral(e)).map((s) => bt(s));
|
|
3219
3761
|
}
|
|
3220
3762
|
getNetworkId() {
|
|
3221
3763
|
return this._walletInstance.getNetworkId();
|
|
3222
3764
|
}
|
|
3223
3765
|
async getRewardAddresses() {
|
|
3224
|
-
return (await this._walletInstance.getRewardAddresses()).map((t) =>
|
|
3766
|
+
return (await this._walletInstance.getRewardAddresses()).map((t) => rt(t).to_bech32());
|
|
3225
3767
|
}
|
|
3226
3768
|
async getUnusedAddresses() {
|
|
3227
|
-
return (await this._walletInstance.getUnusedAddresses()).map((t) =>
|
|
3769
|
+
return (await this._walletInstance.getUnusedAddresses()).map((t) => rt(t).to_bech32());
|
|
3228
3770
|
}
|
|
3229
3771
|
async getUsedAddresses() {
|
|
3230
|
-
return (await this._walletInstance.getUsedAddresses()).map((t) =>
|
|
3772
|
+
return (await this._walletInstance.getUsedAddresses()).map((t) => rt(t).to_bech32());
|
|
3231
3773
|
}
|
|
3232
3774
|
async getUtxos() {
|
|
3233
|
-
return (await this.getUsedUTxOs()).map((t) =>
|
|
3775
|
+
return (await this.getUsedUTxOs()).map((t) => bt(t));
|
|
3234
3776
|
}
|
|
3235
3777
|
signData(e, t) {
|
|
3236
|
-
const
|
|
3237
|
-
return this._walletInstance.signData(
|
|
3778
|
+
const s = K(e).to_hex();
|
|
3779
|
+
return this._walletInstance.signData(s, S(t));
|
|
3238
3780
|
}
|
|
3239
3781
|
async signTx(e, t = !1) {
|
|
3240
3782
|
try {
|
|
3241
|
-
const
|
|
3242
|
-
return
|
|
3243
|
-
} catch (
|
|
3244
|
-
throw new Error(`[BrowserWallet] An error occurred during signTx: ${JSON.stringify(
|
|
3783
|
+
const s = Y(e), n = s.witness_set(), i = await this._walletInstance.signTx(e, t), o = Ls(i).vkeys() ?? a.Vkeywitnesses.new(), c = Ge(n, o);
|
|
3784
|
+
return n.set_vkeys(c), v(a.Transaction.new(s.body(), n, s.auxiliary_data()).to_bytes());
|
|
3785
|
+
} catch (s) {
|
|
3786
|
+
throw new Error(`[BrowserWallet] An error occurred during signTx: ${JSON.stringify(s)}.`);
|
|
3245
3787
|
}
|
|
3246
3788
|
}
|
|
3247
3789
|
submitTx(e) {
|
|
@@ -3249,49 +3791,49 @@ class Tt {
|
|
|
3249
3791
|
}
|
|
3250
3792
|
async getUsedAddress() {
|
|
3251
3793
|
const e = await this._walletInstance.getUsedAddresses();
|
|
3252
|
-
return
|
|
3794
|
+
return rt(e[0]);
|
|
3253
3795
|
}
|
|
3254
|
-
async getUsedCollateral(e =
|
|
3255
|
-
return (await this._walletInstance.experimental.getCollateral() ?? []).map((
|
|
3796
|
+
async getUsedCollateral(e = P.maxCollateralInputs) {
|
|
3797
|
+
return (await this._walletInstance.experimental.getCollateral() ?? []).map((s) => Ie(s)).slice(0, e);
|
|
3256
3798
|
}
|
|
3257
3799
|
async getUsedUTxOs() {
|
|
3258
|
-
return (await this._walletInstance.getUtxos() ?? []).map((t) =>
|
|
3800
|
+
return (await this._walletInstance.getUtxos() ?? []).map((t) => Ie(t));
|
|
3259
3801
|
}
|
|
3260
3802
|
async getAssets() {
|
|
3261
3803
|
return (await this.getBalance()).filter((t) => t.unit !== "lovelace").map((t) => {
|
|
3262
|
-
const
|
|
3804
|
+
const s = t.unit.slice(0, F), n = t.unit.slice(F), i = Js(s, n);
|
|
3263
3805
|
return {
|
|
3264
3806
|
unit: t.unit,
|
|
3265
|
-
policyId:
|
|
3266
|
-
assetName:
|
|
3267
|
-
fingerprint:
|
|
3807
|
+
policyId: s,
|
|
3808
|
+
assetName: Gt(n),
|
|
3809
|
+
fingerprint: i,
|
|
3268
3810
|
quantity: t.quantity
|
|
3269
3811
|
};
|
|
3270
3812
|
});
|
|
3271
3813
|
}
|
|
3272
3814
|
async getLovelace() {
|
|
3273
|
-
const t = (await this.getBalance()).find((
|
|
3815
|
+
const t = (await this.getBalance()).find((s) => s.unit === "lovelace");
|
|
3274
3816
|
return t !== void 0 ? t.quantity : "0";
|
|
3275
3817
|
}
|
|
3276
3818
|
async getPolicyIdAssets(e) {
|
|
3277
|
-
return (await this.getAssets()).filter((
|
|
3819
|
+
return (await this.getAssets()).filter((s) => s.policyId === e);
|
|
3278
3820
|
}
|
|
3279
3821
|
async getPolicyIds() {
|
|
3280
3822
|
const e = await this.getBalance();
|
|
3281
|
-
return Array.from(new Set(e.map((t) => t.unit.slice(0,
|
|
3823
|
+
return Array.from(new Set(e.map((t) => t.unit.slice(0, F)))).filter((t) => t !== "lovelace");
|
|
3282
3824
|
}
|
|
3283
3825
|
static resolveInstance(e) {
|
|
3284
3826
|
if (window.cardano === void 0)
|
|
3285
3827
|
return;
|
|
3286
|
-
const t =
|
|
3828
|
+
const t = te.map((s) => window.cardano[s]).filter((s) => s !== void 0).find((s) => s.name.toLowerCase() === e.toLowerCase());
|
|
3287
3829
|
return t == null ? void 0 : t.enable();
|
|
3288
3830
|
}
|
|
3289
3831
|
}
|
|
3290
|
-
const
|
|
3291
|
-
class
|
|
3832
|
+
const $e = "http://localhost:4000/", tr = "http://localhost:5000/", er = `${$e}access`, sr = `${$e}transaction/signtx`;
|
|
3833
|
+
class Tr {
|
|
3292
3834
|
static getAxiosInstance() {
|
|
3293
3835
|
return L.create({
|
|
3294
|
-
baseURL:
|
|
3836
|
+
baseURL: tr,
|
|
3295
3837
|
withCredentials: !0
|
|
3296
3838
|
});
|
|
3297
3839
|
}
|
|
@@ -3301,18 +3843,18 @@ class vr {
|
|
|
3301
3843
|
static async openMinaFrontend(e) {
|
|
3302
3844
|
const t = this.getAppId();
|
|
3303
3845
|
e.includes("?") ? e = `${e}&appId=${t}` : e = `${e}?appId=${t}`;
|
|
3304
|
-
const
|
|
3305
|
-
return
|
|
3846
|
+
const s = "left=100,top=100,width=540,height=540", n = window.open(e, "meshWindow", s);
|
|
3847
|
+
return n || console.error("the window did not open", n), await (async () => new Promise((i) => {
|
|
3306
3848
|
window.addEventListener("message", async (o) => {
|
|
3307
|
-
o.data.target == "minaWallet" &&
|
|
3849
|
+
o.data.target == "minaWallet" && i(o.data);
|
|
3308
3850
|
});
|
|
3309
3851
|
}))();
|
|
3310
3852
|
}
|
|
3311
3853
|
static async get(e, t = {}) {
|
|
3312
|
-
const
|
|
3854
|
+
const s = this.getAppId();
|
|
3313
3855
|
t = {
|
|
3314
3856
|
...t,
|
|
3315
|
-
appId:
|
|
3857
|
+
appId: s
|
|
3316
3858
|
};
|
|
3317
3859
|
try {
|
|
3318
3860
|
return (await this.getAxiosInstance().get(e, {
|
|
@@ -3324,7 +3866,7 @@ class vr {
|
|
|
3324
3866
|
}
|
|
3325
3867
|
}
|
|
3326
3868
|
static async enable() {
|
|
3327
|
-
return await this.get("wallet/getuserwalletsmeta") === void 0 ? await this.openMinaFrontend(
|
|
3869
|
+
return await this.get("wallet/getuserwalletsmeta") === void 0 ? await this.openMinaFrontend(er) : !0;
|
|
3328
3870
|
}
|
|
3329
3871
|
static async getChangeAddress(e = void 0, t = void 0) {
|
|
3330
3872
|
return await this.get("wallet/getchangeaddress", {
|
|
@@ -3339,13 +3881,13 @@ class vr {
|
|
|
3339
3881
|
});
|
|
3340
3882
|
}
|
|
3341
3883
|
static async signTx(e, t = !1) {
|
|
3342
|
-
const
|
|
3343
|
-
if (console.log("userWalletsMeta",
|
|
3344
|
-
const
|
|
3345
|
-
if (
|
|
3346
|
-
const
|
|
3347
|
-
o.set_vkeys(
|
|
3348
|
-
const c =
|
|
3884
|
+
const s = await this.get("wallet/getuserwalletsmeta");
|
|
3885
|
+
if (console.log("userWalletsMeta", s), s) {
|
|
3886
|
+
const n = await this.openMinaFrontend(`${sr}?unsignedTx=${e}&partialSign=${t}`);
|
|
3887
|
+
if (n instanceof a.Vkeywitnesses) {
|
|
3888
|
+
const i = Y(e), o = i.witness_set();
|
|
3889
|
+
o.set_vkeys(n);
|
|
3890
|
+
const c = a.Transaction.new(i.body(), o, i.auxiliary_data()).to_hex();
|
|
3349
3891
|
return console.log("signedTx", c), c;
|
|
3350
3892
|
}
|
|
3351
3893
|
} else
|
|
@@ -3353,42 +3895,43 @@ class vr {
|
|
|
3353
3895
|
}
|
|
3354
3896
|
}
|
|
3355
3897
|
export {
|
|
3356
|
-
|
|
3898
|
+
kr as AppWallet,
|
|
3357
3899
|
Cr as BlockfrostProvider,
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3900
|
+
Ot as BrowserWallet,
|
|
3901
|
+
C as EmbeddedWallet,
|
|
3902
|
+
br as ForgeScript,
|
|
3361
3903
|
wr as InfuraProvider,
|
|
3362
3904
|
Br as KoiosProvider,
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
Er as
|
|
3905
|
+
Qr as MaestroProvider,
|
|
3906
|
+
Dr as MeshTxBuilder,
|
|
3907
|
+
Tr as MinaWallet,
|
|
3908
|
+
Er as OgmiosProvider,
|
|
3909
|
+
Sr as TangoProvider,
|
|
3367
3910
|
$ as Transaction,
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3911
|
+
cr as checkSignature,
|
|
3912
|
+
_r as generateNonce,
|
|
3913
|
+
es as isNetwork,
|
|
3914
|
+
is as keepRelevant,
|
|
3915
|
+
or as largestFirst,
|
|
3916
|
+
os as largestFirstMultiAsset,
|
|
3917
|
+
tt as parseAssetUnit,
|
|
3918
|
+
h as parseHttpError,
|
|
3919
|
+
yr as readPlutusData,
|
|
3920
|
+
xr as readTransaction,
|
|
3921
|
+
ur as resolveDataHash,
|
|
3922
|
+
dr as resolveEpochNo,
|
|
3380
3923
|
Js as resolveFingerprint,
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3924
|
+
hr as resolveLanguageView,
|
|
3925
|
+
lr as resolveNativeScriptHash,
|
|
3926
|
+
nt as resolvePaymentKeyHash,
|
|
3927
|
+
Ar as resolvePlutusScriptAddress,
|
|
3928
|
+
gr as resolvePlutusScriptHash,
|
|
3929
|
+
mr as resolvePoolId,
|
|
3387
3930
|
Ir as resolvePrivateKey,
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3931
|
+
Tt as resolveRewardAddress,
|
|
3932
|
+
pr as resolveScriptRef,
|
|
3933
|
+
fr as resolveSlotNo,
|
|
3934
|
+
lt as resolveStakeKeyHash,
|
|
3392
3935
|
Le as resolveTxFees,
|
|
3393
3936
|
js as resolveTxHash
|
|
3394
3937
|
};
|