@bestinslot/wallet-kit 0.13.0 → 0.13.2
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/{balances-_-oF5kR6.js → balances-CvlQK3uA.js} +1875 -1866
- package/dist/browser.js +5 -5
- package/dist/core.js +5 -5
- package/dist/{mint-Dm67SjcM.js → mint-C_wN10-d.js} +208 -195
- package/dist/node.js +4 -4
- package/dist/react.js +1 -1
- package/dist/{register-browser-providers-BTO9Kyf2.js → register-browser-providers-J2bm6PEo.js} +1 -1
- package/dist/types/core/helpers.d.ts +18 -1
- package/dist/types/core/mint.d.ts +23 -5
- package/dist/vue.js +1 -1
- package/package.json +1 -1
|
@@ -65672,44 +65672,49 @@ function fixCardinalUtxos(t, e) {
|
|
|
65672
65672
|
}
|
|
65673
65673
|
function fixOrdinalUtxos(t, e) {
|
|
65674
65674
|
if (currentExtraTxHexes.length === 0) return t;
|
|
65675
|
-
const r =
|
|
65676
|
-
for (const
|
|
65677
|
-
const
|
|
65678
|
-
checkIfUtxoUsedInExtras(
|
|
65679
|
-
}
|
|
65680
|
-
|
|
65681
|
-
|
|
65682
|
-
|
|
65683
|
-
|
|
65684
|
-
|
|
65685
|
-
|
|
65686
|
-
|
|
65675
|
+
const r = [];
|
|
65676
|
+
for (const A of t) {
|
|
65677
|
+
const s = A.utxo, n = s.split(":")[0], o = Number.parseInt(s.split(":")[1]);
|
|
65678
|
+
checkIfUtxoUsedInExtras(n, o) || r.push(A);
|
|
65679
|
+
}
|
|
65680
|
+
return r.push(...getExtraOrdinalUtxos(e)), r;
|
|
65681
|
+
}
|
|
65682
|
+
function getExtraOrdinalUtxos(t) {
|
|
65683
|
+
if (currentExtraTxHexes.length === 0) return [];
|
|
65684
|
+
const e = getBitcoinNetwork(), r = [];
|
|
65685
|
+
for (const A of currentExtraTxHexes) {
|
|
65686
|
+
const s = srcExports.Transaction.fromHex(A), n = s.getId();
|
|
65687
|
+
for (let o = 0; o < s.outs.length; o++) {
|
|
65688
|
+
const a = s.outs[o];
|
|
65689
|
+
if (!checkIfUtxoIsExtraOrdinal(n, o) || checkIfUtxoUsedInExtras(n, o)) continue;
|
|
65690
|
+
const u = currentExtraInscriptions ? currentExtraInscriptions[0] : null, g = currentExtraInscriptions ? currentExtraInscriptions[1] : null;
|
|
65691
|
+
if (!(!u || !g))
|
|
65687
65692
|
try {
|
|
65688
|
-
if (srcExports.address.fromOutputScript(
|
|
65689
|
-
const
|
|
65690
|
-
address:
|
|
65693
|
+
if (srcExports.address.fromOutputScript(a.script, e) === t) {
|
|
65694
|
+
const d = {
|
|
65695
|
+
address: t,
|
|
65691
65696
|
amounts: null,
|
|
65692
65697
|
block_height: null,
|
|
65693
|
-
inscription_ids: [
|
|
65698
|
+
inscription_ids: [u],
|
|
65694
65699
|
rune_ids: null,
|
|
65695
|
-
satpoints: [
|
|
65696
|
-
script:
|
|
65697
|
-
script_type: utxoOutputTypeFromOutputScript(
|
|
65700
|
+
satpoints: [g],
|
|
65701
|
+
script: s.outs[o].script.toString("hex"),
|
|
65702
|
+
script_type: utxoOutputTypeFromOutputScript(a.script, e),
|
|
65698
65703
|
txfee: null,
|
|
65699
|
-
txid:
|
|
65700
|
-
utxo: `${
|
|
65701
|
-
value:
|
|
65702
|
-
vout:
|
|
65704
|
+
txid: n,
|
|
65705
|
+
utxo: `${n}:${o}`,
|
|
65706
|
+
value: a.value,
|
|
65707
|
+
vout: o,
|
|
65703
65708
|
vsize: null
|
|
65704
65709
|
};
|
|
65705
|
-
|
|
65710
|
+
r.push(d);
|
|
65706
65711
|
}
|
|
65707
|
-
} catch (
|
|
65708
|
-
console.error(`Error processing output script for txid ${
|
|
65712
|
+
} catch (c) {
|
|
65713
|
+
console.error(`Error processing output script for txid ${n}, vout ${o}`), console.error(c);
|
|
65709
65714
|
}
|
|
65710
65715
|
}
|
|
65711
65716
|
}
|
|
65712
|
-
return
|
|
65717
|
+
return r;
|
|
65713
65718
|
}
|
|
65714
65719
|
function witnessStackToScriptWitness(t) {
|
|
65715
65720
|
let e = new Uint8Array(0);
|
|
@@ -65728,9 +65733,13 @@ function witnessStackToScriptWitness(t) {
|
|
|
65728
65733
|
}
|
|
65729
65734
|
return n(t), e;
|
|
65730
65735
|
}
|
|
65731
|
-
async function getCardinalUtxos(t) {
|
|
65732
|
-
const
|
|
65733
|
-
return fixCardinalUtxos(r
|
|
65736
|
+
async function getCardinalUtxos(t, e) {
|
|
65737
|
+
const r = e ? structuredClone(e) : await fetchCardinalUtxos(t);
|
|
65738
|
+
return fixCardinalUtxos(r, t);
|
|
65739
|
+
}
|
|
65740
|
+
async function fetchCardinalUtxos(t) {
|
|
65741
|
+
const e = getBackendUrl(`cardinal_utxos/${t}`);
|
|
65742
|
+
return (await fetchWithErrors(e, { method: "GET" })).data;
|
|
65734
65743
|
}
|
|
65735
65744
|
async function getCardinalBalance(t) {
|
|
65736
65745
|
const e = getBackendUrl(`cardinal_utxos/${t}`), r = await fetchWithErrors(e, { method: "GET" }), A = fixCardinalUtxos(r.data, t);
|
|
@@ -66435,14 +66444,14 @@ async function buildPsbtFromTx(t, e, r, A) {
|
|
|
66435
66444
|
n.updateInput(a.idx, { finalScriptWitness: a.signature });
|
|
66436
66445
|
return n;
|
|
66437
66446
|
}
|
|
66438
|
-
async function buildCommitTx(t, e, r, A, s, n, o, a, u) {
|
|
66447
|
+
async function buildCommitTx(t, e, r, A, s, n, o, a, u, g) {
|
|
66439
66448
|
(a == null || a < 0) && (a = 0);
|
|
66440
|
-
const
|
|
66449
|
+
const c = t;
|
|
66441
66450
|
if (!t.addr) throw new Error("Payer wallet address is not set.");
|
|
66442
|
-
const
|
|
66443
|
-
pubkey: Buffer$1.from(
|
|
66444
|
-
network:
|
|
66445
|
-
}),
|
|
66451
|
+
const d = await getCardinalUtxos(t.addr, g), h = get_seckey(r), I = get_pubkey(h, !0), B = buildRevealScript(I, A), l = Tap.encodeScript(B), [C, p] = Tap.getPubKey(I, { target: l }), Q = getBitcoinNetwork(), v = srcExports.payments.p2tr({
|
|
66452
|
+
pubkey: Buffer$1.from(C, "hex"),
|
|
66453
|
+
network: Q
|
|
66454
|
+
}), R = [
|
|
66446
66455
|
{
|
|
66447
66456
|
value: 0,
|
|
66448
66457
|
scriptPubKey: e.outputScript
|
|
@@ -66450,12 +66459,12 @@ async function buildCommitTx(t, e, r, A, s, n, o, a, u) {
|
|
|
66450
66459
|
];
|
|
66451
66460
|
if (a > 0) {
|
|
66452
66461
|
if (!o) throw new Error("Payment wallet is not available.");
|
|
66453
|
-
|
|
66462
|
+
R.push({
|
|
66454
66463
|
value: 0,
|
|
66455
66464
|
scriptPubKey: o.outputScript
|
|
66456
66465
|
});
|
|
66457
66466
|
}
|
|
66458
|
-
const
|
|
66467
|
+
const M = Tx.create({
|
|
66459
66468
|
vin: [
|
|
66460
66469
|
{
|
|
66461
66470
|
// Use the txid of the funding transaction used to send the sats.
|
|
@@ -66467,40 +66476,40 @@ async function buildCommitTx(t, e, r, A, s, n, o, a, u) {
|
|
|
66467
66476
|
// Feel free to change this if you sent a different amount.
|
|
66468
66477
|
value: 0,
|
|
66469
66478
|
// This is what our address looks like in script form.
|
|
66470
|
-
scriptPubKey: ["OP_1",
|
|
66479
|
+
scriptPubKey: ["OP_1", C]
|
|
66471
66480
|
}
|
|
66472
66481
|
}
|
|
66473
66482
|
],
|
|
66474
|
-
vout:
|
|
66483
|
+
vout: R
|
|
66475
66484
|
});
|
|
66476
|
-
|
|
66485
|
+
M.vin[0].witness = [
|
|
66477
66486
|
Buff$3.hex(
|
|
66478
66487
|
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
|
66479
66488
|
),
|
|
66480
|
-
|
|
66481
|
-
|
|
66489
|
+
B,
|
|
66490
|
+
p
|
|
66482
66491
|
];
|
|
66483
|
-
const
|
|
66484
|
-
|
|
66492
|
+
const F = Tx.util.getTxSize(M).vsize * s, P = new WalletInfo(!1, null, v.address, null, C), $ = buildTransaction(
|
|
66493
|
+
d,
|
|
66485
66494
|
u,
|
|
66486
66495
|
t,
|
|
66487
66496
|
[],
|
|
66488
|
-
|
|
66489
|
-
g,
|
|
66490
|
-
s,
|
|
66491
|
-
n + M + a
|
|
66492
|
-
), $ = P.tx, H = P.tx_fee, J = await buildPsbtFromTx(
|
|
66493
|
-
$,
|
|
66497
|
+
P,
|
|
66494
66498
|
c,
|
|
66499
|
+
s,
|
|
66500
|
+
n + F + a
|
|
66501
|
+
), H = $.tx, J = $.tx_fee, K = await buildPsbtFromTx(
|
|
66502
|
+
H,
|
|
66503
|
+
d,
|
|
66495
66504
|
t,
|
|
66496
66505
|
u
|
|
66497
66506
|
);
|
|
66498
66507
|
return {
|
|
66499
|
-
unsigned_commit_tx:
|
|
66500
|
-
unsigned_psbt_hex:
|
|
66501
|
-
output_value:
|
|
66502
|
-
commit_fee:
|
|
66503
|
-
reveal_fee:
|
|
66508
|
+
unsigned_commit_tx: H,
|
|
66509
|
+
unsigned_psbt_hex: K.toHex(),
|
|
66510
|
+
output_value: H.outs[0].value,
|
|
66511
|
+
commit_fee: J,
|
|
66512
|
+
reveal_fee: F
|
|
66504
66513
|
};
|
|
66505
66514
|
}
|
|
66506
66515
|
async function buildReclaimCommitTx(t, e, r, A, s, n, o, a) {
|
|
@@ -66622,50 +66631,50 @@ async function mintWithReclaimsAll(t, e, r, A, s, n) {
|
|
|
66622
66631
|
n
|
|
66623
66632
|
);
|
|
66624
66633
|
}
|
|
66625
|
-
async function mintWithReclaimsCheckFees(t, e, r, A) {
|
|
66626
|
-
const
|
|
66627
|
-
if (!
|
|
66628
|
-
const
|
|
66634
|
+
async function mintWithReclaimsCheckFees(t, e, r, A, s) {
|
|
66635
|
+
const n = getPaymentWallet(), o = getOrdinalsWallet();
|
|
66636
|
+
if (!n || !o) throw new Error("Wallets not found");
|
|
66637
|
+
const a = new WalletInfo(
|
|
66629
66638
|
!1,
|
|
66630
66639
|
null,
|
|
66631
|
-
|
|
66640
|
+
n.address,
|
|
66632
66641
|
null,
|
|
66633
|
-
|
|
66634
|
-
),
|
|
66642
|
+
n.pubkey
|
|
66643
|
+
), u = new WalletInfo(
|
|
66635
66644
|
!1,
|
|
66636
66645
|
null,
|
|
66637
|
-
|
|
66646
|
+
o.address,
|
|
66638
66647
|
null,
|
|
66639
|
-
|
|
66648
|
+
o.pubkey
|
|
66640
66649
|
);
|
|
66641
|
-
(A == null || A <= 0) && (A = getDustValue(
|
|
66642
|
-
const
|
|
66643
|
-
|
|
66650
|
+
(A == null || A <= 0) && (A = getDustValue(u));
|
|
66651
|
+
const g = await getCardinalUtxos(a.addr, s), c = createSecretToken(), d = await buildReclaimCommitTx(
|
|
66652
|
+
g,
|
|
66644
66653
|
e,
|
|
66645
|
-
o,
|
|
66646
66654
|
a,
|
|
66647
|
-
|
|
66655
|
+
u,
|
|
66656
|
+
c,
|
|
66648
66657
|
t,
|
|
66649
66658
|
r,
|
|
66650
66659
|
A
|
|
66651
|
-
),
|
|
66652
|
-
|
|
66653
|
-
|
|
66654
|
-
|
|
66655
|
-
|
|
66660
|
+
), h = d.unsignedCommitTx.getId(), I = await buildRevealTx(
|
|
66661
|
+
u,
|
|
66662
|
+
h,
|
|
66663
|
+
d.commitOutputValue,
|
|
66664
|
+
c,
|
|
66656
66665
|
t,
|
|
66657
66666
|
r,
|
|
66658
66667
|
A,
|
|
66659
66668
|
null,
|
|
66660
66669
|
null,
|
|
66661
|
-
|
|
66670
|
+
d.commitVout
|
|
66662
66671
|
);
|
|
66663
66672
|
return {
|
|
66664
|
-
unsigned_commit_tx_hex:
|
|
66665
|
-
signed_reveal_tx_hex:
|
|
66666
|
-
inscription_id: `${
|
|
66667
|
-
total_fee:
|
|
66668
|
-
commit_vout:
|
|
66673
|
+
unsigned_commit_tx_hex: d.unsignedCommitTx.toHex(),
|
|
66674
|
+
signed_reveal_tx_hex: I.signedTxHex,
|
|
66675
|
+
inscription_id: `${I.txId}i0`,
|
|
66676
|
+
total_fee: d.commitFee + d.revealFee,
|
|
66677
|
+
commit_vout: d.commitVout
|
|
66669
66678
|
};
|
|
66670
66679
|
}
|
|
66671
66680
|
async function resolveReclaimInputs(t, e) {
|
|
@@ -66911,17 +66920,18 @@ async function sendInscriptionAll(t, e, r, A, s, n) {
|
|
|
66911
66920
|
});
|
|
66912
66921
|
}
|
|
66913
66922
|
async function getInscriptionDetails(t, e, r) {
|
|
66914
|
-
|
|
66915
|
-
|
|
66916
|
-
|
|
66917
|
-
|
|
66918
|
-
|
|
66923
|
+
return findInscriptionDetails(t, getExtraOrdinalUtxos(e)) ?? findInscriptionDetails(t, await getOrdinalUtxos(e));
|
|
66924
|
+
}
|
|
66925
|
+
function findInscriptionDetails(t, e) {
|
|
66926
|
+
for (const r of e)
|
|
66927
|
+
for (let A = 0; A < r.inscription_ids.length; A++)
|
|
66928
|
+
if (r.inscription_ids[A] === t)
|
|
66919
66929
|
return {
|
|
66920
|
-
satpoint:
|
|
66921
|
-
value:
|
|
66922
|
-
script_type:
|
|
66923
|
-
block_height:
|
|
66924
|
-
utxo:
|
|
66930
|
+
satpoint: r.satpoints[A],
|
|
66931
|
+
value: r.value,
|
|
66932
|
+
script_type: r.script_type,
|
|
66933
|
+
block_height: r.block_height,
|
|
66934
|
+
utxo: r.utxo
|
|
66925
66935
|
};
|
|
66926
66936
|
return null;
|
|
66927
66937
|
}
|
|
@@ -67280,46 +67290,47 @@ async function mintAllPaymentWallet(t, e, r, A, s, n, o) {
|
|
|
67280
67290
|
secret: B
|
|
67281
67291
|
};
|
|
67282
67292
|
}
|
|
67283
|
-
async function mintAllCheckFees(t, e, r, A, s) {
|
|
67284
|
-
const
|
|
67285
|
-
if (!
|
|
67286
|
-
const
|
|
67293
|
+
async function mintAllCheckFees(t, e, r, A, s, n) {
|
|
67294
|
+
const o = getPaymentWallet(), a = getOrdinalsWallet();
|
|
67295
|
+
if (!o || !a) throw new Error("Wallets not found");
|
|
67296
|
+
const u = o.address, g = o.pubkey, c = a.address, d = a.pubkey, h = new WalletInfo(!1, null, u, null, g), I = new WalletInfo(
|
|
67287
67297
|
!1,
|
|
67288
67298
|
null,
|
|
67289
|
-
|
|
67299
|
+
c,
|
|
67290
67300
|
null,
|
|
67291
|
-
|
|
67301
|
+
d
|
|
67292
67302
|
);
|
|
67293
|
-
let
|
|
67294
|
-
(r == null || r <= 0) && (r = getDustValue(
|
|
67295
|
-
const
|
|
67296
|
-
d,
|
|
67303
|
+
let B = null;
|
|
67304
|
+
(r == null || r <= 0) && (r = getDustValue(I));
|
|
67305
|
+
const l = createSecretToken(), C = await buildCommitTx(
|
|
67297
67306
|
h,
|
|
67298
|
-
|
|
67307
|
+
I,
|
|
67308
|
+
l,
|
|
67299
67309
|
t,
|
|
67300
67310
|
e,
|
|
67301
67311
|
r,
|
|
67302
|
-
I,
|
|
67303
|
-
s,
|
|
67304
|
-
[]
|
|
67305
|
-
), C = l.unsigned_commit_tx.getId(), p = await buildRevealTx(
|
|
67306
|
-
h,
|
|
67307
|
-
C,
|
|
67308
|
-
l.output_value,
|
|
67309
67312
|
B,
|
|
67313
|
+
s,
|
|
67314
|
+
[],
|
|
67315
|
+
n
|
|
67316
|
+
), p = C.unsigned_commit_tx.getId(), Q = await buildRevealTx(
|
|
67317
|
+
I,
|
|
67318
|
+
p,
|
|
67319
|
+
C.output_value,
|
|
67320
|
+
l,
|
|
67310
67321
|
t,
|
|
67311
67322
|
e,
|
|
67312
67323
|
r,
|
|
67313
|
-
|
|
67324
|
+
B,
|
|
67314
67325
|
s
|
|
67315
67326
|
);
|
|
67316
67327
|
return {
|
|
67317
|
-
commit_fee:
|
|
67318
|
-
reveal_fee:
|
|
67319
|
-
total_fee:
|
|
67320
|
-
unsigned_commit_tx_hex:
|
|
67321
|
-
signed_reveal_tx_hex:
|
|
67322
|
-
inscription_id: `${
|
|
67328
|
+
commit_fee: C.commit_fee,
|
|
67329
|
+
reveal_fee: C.reveal_fee,
|
|
67330
|
+
total_fee: C.commit_fee + C.reveal_fee,
|
|
67331
|
+
unsigned_commit_tx_hex: C.unsigned_commit_tx.toHex(),
|
|
67332
|
+
signed_reveal_tx_hex: Q.signedTxHex,
|
|
67333
|
+
inscription_id: `${Q.txId}i0`,
|
|
67323
67334
|
postage: r
|
|
67324
67335
|
};
|
|
67325
67336
|
}
|
|
@@ -67556,47 +67567,47 @@ async function sendInscriptionToOpReturnWithExtraInputsAndExtraOutputAll(t, e, r
|
|
|
67556
67567
|
signedTxHex: J.signedTxHex
|
|
67557
67568
|
};
|
|
67558
67569
|
}
|
|
67559
|
-
async function sendInscriptionToOpReturnWithExtraInputsAndExtraOutputFeeRate(t, e, r, A, s, n) {
|
|
67560
|
-
const
|
|
67561
|
-
if (!
|
|
67562
|
-
const
|
|
67570
|
+
async function sendInscriptionToOpReturnWithExtraInputsAndExtraOutputFeeRate(t, e, r, A, s, n, o) {
|
|
67571
|
+
const a = getPaymentWallet(), u = getOrdinalsWallet();
|
|
67572
|
+
if (!a || !u) throw new Error("Wallets not found");
|
|
67573
|
+
const g = a.address, c = a.pubkey, d = u.address, h = u.pubkey, I = new WalletInfo(!1, null, g, null, c), B = new WalletInfo(
|
|
67563
67574
|
!1,
|
|
67564
67575
|
null,
|
|
67565
|
-
|
|
67576
|
+
d,
|
|
67566
67577
|
null,
|
|
67567
|
-
|
|
67578
|
+
h
|
|
67568
67579
|
);
|
|
67569
|
-
if (!
|
|
67570
|
-
const
|
|
67571
|
-
if (
|
|
67580
|
+
if (!B.addr) throw new Error("Inscription wallet address is not set.");
|
|
67581
|
+
const l = await getInscriptionDetails(t, B.addr);
|
|
67582
|
+
if (l == null)
|
|
67572
67583
|
throw new Error("Inscription cannot be found in wallet");
|
|
67573
|
-
if (
|
|
67584
|
+
if (l.satpoint.split(":")[2] !== "0")
|
|
67574
67585
|
throw new Error("Inscription is not at the first sat of utxo");
|
|
67575
|
-
if (!
|
|
67576
|
-
const
|
|
67577
|
-
utxo: `${
|
|
67578
|
-
value:
|
|
67579
|
-
script_type:
|
|
67580
|
-
wallet:
|
|
67586
|
+
if (!I.addr) throw new Error("Payer wallet address is not set.");
|
|
67587
|
+
const C = await getCardinalUtxos(I.addr, o), Q = [{
|
|
67588
|
+
utxo: `${l.satpoint.split(":")[0]}:${l.satpoint.split(":")[1]}`,
|
|
67589
|
+
value: l.value,
|
|
67590
|
+
script_type: l.script_type,
|
|
67591
|
+
wallet: B
|
|
67581
67592
|
}];
|
|
67582
|
-
for (const
|
|
67583
|
-
|
|
67584
|
-
const
|
|
67585
|
-
for (const
|
|
67586
|
-
|
|
67587
|
-
const
|
|
67588
|
-
|
|
67589
|
-
p,
|
|
67590
|
-
h,
|
|
67593
|
+
for (const P of e)
|
|
67594
|
+
Q.push(P);
|
|
67595
|
+
const v = [r], R = [A];
|
|
67596
|
+
for (const P of s)
|
|
67597
|
+
v.push(P.wallet), R.push(P.value);
|
|
67598
|
+
const M = buildTransactionMultiOutput(
|
|
67599
|
+
C,
|
|
67591
67600
|
Q,
|
|
67601
|
+
I,
|
|
67592
67602
|
v,
|
|
67593
|
-
|
|
67603
|
+
R,
|
|
67604
|
+
I,
|
|
67594
67605
|
n
|
|
67595
|
-
),
|
|
67606
|
+
), F = M.tx;
|
|
67596
67607
|
return {
|
|
67597
|
-
txid:
|
|
67598
|
-
unsigned_tx_hex:
|
|
67599
|
-
tx_fee:
|
|
67608
|
+
txid: F.getId(),
|
|
67609
|
+
unsigned_tx_hex: F.toHex(),
|
|
67610
|
+
tx_fee: M.tx_fee
|
|
67600
67611
|
};
|
|
67601
67612
|
}
|
|
67602
67613
|
async function mintWithExtraInputInCommitAll(t, e, r, A, s, n, o, a) {
|
|
@@ -67654,46 +67665,47 @@ async function mintWithExtraInputInCommitAll(t, e, r, A, s, n, o, a) {
|
|
|
67654
67665
|
secret: p
|
|
67655
67666
|
};
|
|
67656
67667
|
}
|
|
67657
|
-
async function mintWithExtraInputInCommitFeeRate(t, e, r, A, s, n) {
|
|
67658
|
-
const
|
|
67659
|
-
if (!
|
|
67660
|
-
const
|
|
67668
|
+
async function mintWithExtraInputInCommitFeeRate(t, e, r, A, s, n, o) {
|
|
67669
|
+
const a = getPaymentWallet(), u = getOrdinalsWallet();
|
|
67670
|
+
if (!a || !u) throw new Error("Wallets not found");
|
|
67671
|
+
const g = a.address, c = a.pubkey, d = u.address, h = u.pubkey, I = new WalletInfo(!1, null, g, null, c), B = new WalletInfo(
|
|
67661
67672
|
!1,
|
|
67662
67673
|
null,
|
|
67663
|
-
|
|
67674
|
+
d,
|
|
67664
67675
|
null,
|
|
67665
|
-
|
|
67676
|
+
h
|
|
67666
67677
|
);
|
|
67667
|
-
let
|
|
67668
|
-
(A == null || A <= 0) && (A = getDustValue(
|
|
67669
|
-
const
|
|
67670
|
-
h,
|
|
67678
|
+
let l = null;
|
|
67679
|
+
(A == null || A <= 0) && (A = getDustValue(B));
|
|
67680
|
+
const C = createSecretToken(), p = await buildCommitTx(
|
|
67671
67681
|
I,
|
|
67672
|
-
|
|
67682
|
+
B,
|
|
67683
|
+
C,
|
|
67673
67684
|
t,
|
|
67674
67685
|
r,
|
|
67675
67686
|
A,
|
|
67676
|
-
B,
|
|
67677
|
-
n,
|
|
67678
|
-
e
|
|
67679
|
-
), p = C.unsigned_commit_tx.getId(), Q = await buildRevealTx(
|
|
67680
|
-
I,
|
|
67681
|
-
p,
|
|
67682
|
-
C.output_value,
|
|
67683
67687
|
l,
|
|
67688
|
+
n,
|
|
67689
|
+
e,
|
|
67690
|
+
o
|
|
67691
|
+
), Q = p.unsigned_commit_tx.getId(), v = await buildRevealTx(
|
|
67692
|
+
B,
|
|
67693
|
+
Q,
|
|
67694
|
+
p.output_value,
|
|
67695
|
+
C,
|
|
67684
67696
|
t,
|
|
67685
67697
|
r,
|
|
67686
67698
|
A,
|
|
67687
|
-
|
|
67699
|
+
l,
|
|
67688
67700
|
n
|
|
67689
67701
|
);
|
|
67690
67702
|
return {
|
|
67691
|
-
commit_fee:
|
|
67692
|
-
reveal_fee:
|
|
67693
|
-
total_fee:
|
|
67694
|
-
unsigned_commit_tx_hex:
|
|
67695
|
-
signed_reveal_tx_hex:
|
|
67696
|
-
inscription_id: `${
|
|
67703
|
+
commit_fee: p.commit_fee,
|
|
67704
|
+
reveal_fee: p.reveal_fee,
|
|
67705
|
+
total_fee: p.commit_fee + p.reveal_fee,
|
|
67706
|
+
unsigned_commit_tx_hex: p.unsigned_commit_tx.toHex(),
|
|
67707
|
+
signed_reveal_tx_hex: v.signedTxHex,
|
|
67708
|
+
inscription_id: `${v.txId}i0`,
|
|
67697
67709
|
postage: A
|
|
67698
67710
|
};
|
|
67699
67711
|
}
|
|
@@ -67729,30 +67741,31 @@ export {
|
|
|
67729
67741
|
getAllBalanceDetails as a,
|
|
67730
67742
|
Buff$3 as a0,
|
|
67731
67743
|
InscriptionDetails as a1,
|
|
67732
|
-
|
|
67733
|
-
|
|
67734
|
-
|
|
67735
|
-
|
|
67736
|
-
|
|
67737
|
-
|
|
67738
|
-
|
|
67739
|
-
|
|
67740
|
-
|
|
67741
|
-
|
|
67742
|
-
|
|
67743
|
-
|
|
67744
|
-
|
|
67745
|
-
|
|
67746
|
-
|
|
67747
|
-
|
|
67748
|
-
|
|
67749
|
-
|
|
67750
|
-
|
|
67751
|
-
|
|
67752
|
-
|
|
67753
|
-
|
|
67754
|
-
|
|
67755
|
-
|
|
67744
|
+
fetchCardinalUtxos as a2,
|
|
67745
|
+
resolveReclaimInputs as a3,
|
|
67746
|
+
mintWithReclaimsCheckFees as a4,
|
|
67747
|
+
mintAllCheckFees as a5,
|
|
67748
|
+
saveExtraUtxos as a6,
|
|
67749
|
+
Script as a7,
|
|
67750
|
+
sendInscriptionToOpReturnWithExtraInputsAndExtraOutputFeeRate as a8,
|
|
67751
|
+
clearExtraUtxos as a9,
|
|
67752
|
+
utxoOutputTypeFromOutputScript as aa,
|
|
67753
|
+
mintWithExtraInputInCommitFeeRate as ab,
|
|
67754
|
+
mintWithReclaimsAll as ac,
|
|
67755
|
+
mintAll as ad,
|
|
67756
|
+
sendInscriptionToOpReturnWithExtraInputsAndExtraOutputAll as ae,
|
|
67757
|
+
mintWithExtraInputInCommitAll as af,
|
|
67758
|
+
callSmartContract as ag,
|
|
67759
|
+
callSmartContractFromPaymentWallet as ah,
|
|
67760
|
+
evmEncodeFunctionCall as ai,
|
|
67761
|
+
depositToBrc20Prog as aj,
|
|
67762
|
+
withdrawFromBrc20Prog as ak,
|
|
67763
|
+
inscribeMultiple as al,
|
|
67764
|
+
inscribeWithParent as am,
|
|
67765
|
+
getInscribeMultipleFee as an,
|
|
67766
|
+
getSwapBackendUrl as ao,
|
|
67767
|
+
fetchWithErrors as ap,
|
|
67768
|
+
ethCallOnPublicRpc as aq,
|
|
67756
67769
|
getCardinalBalance as b,
|
|
67757
67770
|
clearWalletInfo as c,
|
|
67758
67771
|
getNetwork as d,
|
package/dist/node.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { x as fI, y as KA, B as f, z as eI, A as tI, C as RA, D as d, E as SI, F as ZA, G as e, H as UA, I as nI, J as pI, K as rI, L as FI, M as sI, N as KI, O as BA, d as zA, i as eA, P as RI, c as UI, Q as qI, W as VI, a as lI, b as dI, e as xI, f as YI, h as JI, s as PI, j as vI, k as OI, l as uI, m as jI } from "./mint-
|
|
2
|
-
import { o as LQ, v as TQ, n as ZQ, r as zQ, p as mQ, q as XQ, t as WQ, w as _Q, u as $Q } from "./mint-
|
|
3
|
-
import { s as bI } from "./balances-
|
|
4
|
-
import { c as IC, b as gC, m as QC, a as CC } from "./balances-
|
|
1
|
+
import { x as fI, y as KA, B as f, z as eI, A as tI, C as RA, D as d, E as SI, F as ZA, G as e, H as UA, I as nI, J as pI, K as rI, L as FI, M as sI, N as KI, O as BA, d as zA, i as eA, P as RI, c as UI, Q as qI, W as VI, a as lI, b as dI, e as xI, f as YI, h as JI, s as PI, j as vI, k as OI, l as uI, m as jI } from "./mint-C_wN10-d.js";
|
|
2
|
+
import { o as LQ, v as TQ, n as ZQ, r as zQ, p as mQ, q as XQ, t as WQ, w as _Q, u as $Q } from "./mint-C_wN10-d.js";
|
|
3
|
+
import { s as bI } from "./balances-CvlQK3uA.js";
|
|
4
|
+
import { c as IC, b as gC, m as QC, a as CC } from "./balances-CvlQK3uA.js";
|
|
5
5
|
var LI = fI();
|
|
6
6
|
const qA = {
|
|
7
7
|
messagePrefix: `Bitcoin Signed Message:
|
package/dist/react.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useSyncExternalStore as u, useCallback as r, useState as w } from "react";
|
|
2
|
-
import { R as c, d as t, i as l, h as n } from "./mint-
|
|
2
|
+
import { R as c, d as t, i as l, h as n } from "./mint-C_wN10-d.js";
|
|
3
3
|
function m() {
|
|
4
4
|
const e = u(c, t, t), s = r((o) => l(o), []);
|
|
5
5
|
return [e, s];
|
package/dist/{register-browser-providers-BTO9Kyf2.js → register-browser-providers-J2bm6PEo.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as l, C as x, E as b, d, S as B, G as p, f as S, T, Q as P } from "./mint-
|
|
1
|
+
import { D as l, C as x, E as b, d, S as B, G as p, f as S, T, Q as P } from "./mint-C_wN10-d.js";
|
|
2
2
|
async function X() {
|
|
3
3
|
if (!window.LeatherProvider) throw new Error("Leather extension not found.");
|
|
4
4
|
const e = await window.LeatherProvider.request("getAddresses");
|
|
@@ -50,6 +50,15 @@ export declare function clearExtraUtxos(): void;
|
|
|
50
50
|
* @returns A string representing the type of the UTXO output, such as 'pubkeyhash', 'scripthash', 'witness_v0_keyhash', 'witness_v0_scripthash', 'witness_v1_taproot', 'pubkey', 'anchor', 'witness_unknown', 'nulldata', 'multisig', or 'nonstandard'.
|
|
51
51
|
*/
|
|
52
52
|
export declare function utxoOutputTypeFromOutputScript(output: any, network: any): 'pubkeyhash' | 'scripthash' | 'witness_v0_keyhash' | 'witness_v0_scripthash' | 'witness_v1_taproot' | 'pubkey' | 'anchor' | 'witness_unknown' | 'nulldata' | 'multisig' | 'nonstandard';
|
|
53
|
+
/**
|
|
54
|
+
* Returns the ordinal UTXOs that the saved extra transactions create for `addr`: the
|
|
55
|
+
* output carrying the saved extra inscription, unless another extra transaction spends it.
|
|
56
|
+
* These are the entries `getOrdinalUtxos` appends to the backend's list.
|
|
57
|
+
*
|
|
58
|
+
* @param addr The address the inscription output must pay to.
|
|
59
|
+
* @returns The extra ordinal UTXOs for `addr`, empty when no extras are saved.
|
|
60
|
+
*/
|
|
61
|
+
export declare function getExtraOrdinalUtxos(addr: string): APIOrdinalUtxoInfo[];
|
|
53
62
|
/**
|
|
54
63
|
* Converts a witness stack to a script witness format that can be used in Bitcoin transactions.
|
|
55
64
|
* @param witness An array representing the witness stack, where each element is a buffer or a string that can be converted to a buffer.
|
|
@@ -76,9 +85,17 @@ export interface APIUtxoInfo {
|
|
|
76
85
|
* Fetches the UTXOs associated with a given address from the backend API and applies fixes to include any extra UTXOs that are currently in the process of being used in transactions but not yet confirmed on the blockchain.
|
|
77
86
|
*
|
|
78
87
|
* @param addr The address for which to fetch the UTXOs.
|
|
88
|
+
* @param fetchedUtxos A response from `fetchCardinalUtxos(addr)` to use in place of a new fetch. Each call works on its own copy, since coin selection sorts and splices the list it is given.
|
|
79
89
|
* @returns A promise that resolves to an array of UTXO information objects.
|
|
80
90
|
*/
|
|
81
|
-
export declare function getCardinalUtxos(addr: string): Promise<APIUtxoInfo[]>;
|
|
91
|
+
export declare function getCardinalUtxos(addr: string, fetchedUtxos?: APIUtxoInfo[]): Promise<APIUtxoInfo[]>;
|
|
92
|
+
/**
|
|
93
|
+
* Fetches the backend's cardinal UTXO list for an address as served, without the saved extra UTXOs applied. A dry run that prices several transactions fetches this once and passes it to each `getCardinalUtxos` call.
|
|
94
|
+
*
|
|
95
|
+
* @param addr The address for which to fetch the UTXOs.
|
|
96
|
+
* @returns A promise that resolves to the backend's array of UTXO information objects.
|
|
97
|
+
*/
|
|
98
|
+
export declare function fetchCardinalUtxos(addr: string): Promise<APIUtxoInfo[]>;
|
|
82
99
|
/**
|
|
83
100
|
* This function gets the balance of a given address by fetching its UTXOs from the backend and summing
|
|
84
101
|
* their values. It also applies fixes to include any extra UTXOs that are currently in the process of
|