@arkade-os/sdk 0.5.8 → 0.5.9
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/README.md +22 -4
- package/dist/adapters/expo.cjs +7 -7
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +4 -4
- package/dist/{asyncStorageTaskQueue-B5NPtkXo.d.cts → asyncStorageTaskQueue-B6rFkXzW.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-YPwiJyVA.d.ts → asyncStorageTaskQueue-C0irgPwJ.d.ts} +2 -2
- package/dist/{chunk-F5O6JI2H.js → chunk-2657D67V.js} +5 -5
- package/dist/{chunk-F5O6JI2H.js.map → chunk-2657D67V.js.map} +1 -1
- package/dist/{chunk-E7LKKEVR.js → chunk-3KNSMZWD.js} +17 -12
- package/dist/chunk-3KNSMZWD.js.map +1 -0
- package/dist/{chunk-XXNPX4MK.js → chunk-4DUTRRXF.js} +3 -3
- package/dist/{chunk-XXNPX4MK.js.map → chunk-4DUTRRXF.js.map} +1 -1
- package/dist/{chunk-JYQXB7OH.cjs → chunk-4PSM6ZUC.cjs} +55 -57
- package/dist/chunk-4PSM6ZUC.cjs.map +1 -0
- package/dist/{chunk-FDJ734CH.js → chunk-DPFD5KBK.js} +5 -2
- package/dist/chunk-DPFD5KBK.js.map +1 -0
- package/dist/{chunk-SOJDUKY6.cjs → chunk-DY24A73N.cjs} +28 -18
- package/dist/chunk-DY24A73N.cjs.map +1 -0
- package/dist/{chunk-YTOABP6J.js → chunk-FUCKDTH7.js} +21 -12
- package/dist/chunk-FUCKDTH7.js.map +1 -0
- package/dist/{chunk-H7GT3QC4.js → chunk-GUK33TNC.js} +9 -13
- package/dist/chunk-GUK33TNC.js.map +1 -0
- package/dist/{chunk-OLKZUJIN.js → chunk-HT35HPXR.js} +3915 -2997
- package/dist/chunk-HT35HPXR.js.map +1 -0
- package/dist/{chunk-4IDCSOP2.cjs → chunk-ODLSVJRU.cjs} +33 -28
- package/dist/chunk-ODLSVJRU.cjs.map +1 -0
- package/dist/{chunk-L7OOPAUG.cjs → chunk-OMZZQTDM.cjs} +22 -17
- package/dist/chunk-OMZZQTDM.cjs.map +1 -0
- package/dist/{chunk-U34GU5RM.js → chunk-PXEFYEKL.js} +16 -11
- package/dist/chunk-PXEFYEKL.js.map +1 -0
- package/dist/{chunk-5PWL7WOT.cjs → chunk-UPIQZRNJ.cjs} +11 -11
- package/dist/{chunk-5PWL7WOT.cjs.map → chunk-UPIQZRNJ.cjs.map} +1 -1
- package/dist/{chunk-KWR37J6L.cjs → chunk-UPV4W423.cjs} +14 -18
- package/dist/chunk-UPV4W423.cjs.map +1 -0
- package/dist/{chunk-EQ3JVVUR.cjs → chunk-V2EU5QWF.cjs} +4499 -3578
- package/dist/chunk-V2EU5QWF.cjs.map +1 -0
- package/dist/{chunk-FLPWNMX3.cjs → chunk-WIZCF5IX.cjs} +5 -2
- package/dist/chunk-WIZCF5IX.cjs.map +1 -0
- package/dist/{chunk-JQSHFSME.cjs → chunk-WZJJZGBT.cjs} +20 -20
- package/dist/{chunk-JQSHFSME.cjs.map → chunk-WZJJZGBT.cjs.map} +1 -1
- package/dist/{chunk-3F5AJ235.js → chunk-Z6WDOZZI.js} +10 -12
- package/dist/chunk-Z6WDOZZI.js.map +1 -0
- package/dist/compiler.cjs +4 -4
- package/dist/compiler.js +3 -3
- package/dist/contracts/handlers/index.cjs +11 -11
- package/dist/contracts/handlers/index.d.cts +2 -3
- package/dist/contracts/handlers/index.d.ts +2 -3
- package/dist/contracts/handlers/index.js +4 -4
- package/dist/{index-Pk3i_MMU.d.ts → index-Bq349_ly.d.cts} +2322 -99
- package/dist/{index-CKzBYoDa.d.cts → index-D4ahI0W6.d.cts} +1 -2
- package/dist/{index-czozpKPT.d.cts → index-Mn2POBPj.d.ts} +2322 -99
- package/dist/{index-COs69e8T.d.ts → index-Yh5y9G4E.d.ts} +1 -2
- package/dist/index.cjs +359 -347
- package/dist/index.d.cts +1459 -1357
- package/dist/index.d.ts +1459 -1357
- package/dist/index.js +7 -7
- package/dist/repositories/realm/index.cjs +40 -40
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/realm/index.js +8 -8
- package/dist/repositories/sqlite/index.cjs +38 -38
- package/dist/repositories/sqlite/index.d.cts +2 -2
- package/dist/repositories/sqlite/index.d.ts +2 -2
- package/dist/repositories/sqlite/index.js +8 -8
- package/dist/{taskRunner-DBOqvP33.d.ts → taskRunner-BYxEgwM5.d.ts} +2 -2
- package/dist/{taskRunner-DXivOJHc.d.cts → taskRunner-Z3LnHfgs.d.cts} +2 -2
- package/dist/wallet/expo/background.cjs +17 -17
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +9 -9
- package/dist/wallet/expo/index.cjs +18 -18
- package/dist/wallet/expo/index.d.cts +3 -5
- package/dist/wallet/expo/index.d.ts +3 -5
- package/dist/wallet/expo/index.js +8 -8
- package/dist/worker/expo/index.cjs +12 -12
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +8 -8
- package/package.json +1 -1
- package/dist/chunk-3F5AJ235.js.map +0 -1
- package/dist/chunk-4IDCSOP2.cjs.map +0 -1
- package/dist/chunk-E7LKKEVR.js.map +0 -1
- package/dist/chunk-EQ3JVVUR.cjs.map +0 -1
- package/dist/chunk-FDJ734CH.js.map +0 -1
- package/dist/chunk-FLPWNMX3.cjs.map +0 -1
- package/dist/chunk-H7GT3QC4.js.map +0 -1
- package/dist/chunk-JYQXB7OH.cjs.map +0 -1
- package/dist/chunk-KWR37J6L.cjs.map +0 -1
- package/dist/chunk-L7OOPAUG.cjs.map +0 -1
- package/dist/chunk-OLKZUJIN.js.map +0 -1
- package/dist/chunk-SOJDUKY6.cjs.map +0 -1
- package/dist/chunk-U34GU5RM.js.map +0 -1
- package/dist/chunk-YTOABP6J.js.map +0 -1
- package/dist/delegate-gGkUnYpi.d.cts +0 -92
- package/dist/delegate-iyDum4fw.d.ts +0 -92
- package/dist/keyringDescriptorProvider-CbNzWwbS.d.ts +0 -2095
- package/dist/keyringDescriptorProvider-nC8fIjBN.d.cts +0 -2095
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkUPIQZRNJ_cjs = require('./chunk-UPIQZRNJ.cjs');
|
|
4
|
+
var chunkDY24A73N_cjs = require('./chunk-DY24A73N.cjs');
|
|
5
|
+
var chunkWIZCF5IX_cjs = require('./chunk-WIZCF5IX.cjs');
|
|
6
6
|
var base = require('@scure/base');
|
|
7
7
|
var descriptorsScure = require('@bitcoinerlab/descriptors-scure');
|
|
8
8
|
var btcSigner = require('@scure/btc-signer');
|
|
@@ -46,14 +46,14 @@ var ContractHandlerRegistry = class {
|
|
|
46
46
|
var contractHandlers = new ContractHandlerRegistry();
|
|
47
47
|
exports.DefaultVtxo = void 0;
|
|
48
48
|
((DefaultVtxo2) => {
|
|
49
|
-
class Script2 extends
|
|
49
|
+
class Script2 extends chunkWIZCF5IX_cjs.VtxoScript {
|
|
50
50
|
/** Create the default virtual output script with one forfeit path and one exit path. */
|
|
51
51
|
constructor(options) {
|
|
52
52
|
const { pubKey, serverPubKey, csvTimelock } = options;
|
|
53
|
-
const forfeitScript =
|
|
53
|
+
const forfeitScript = chunkWIZCF5IX_cjs.MultisigTapscript.encode({
|
|
54
54
|
pubkeys: [pubKey, serverPubKey]
|
|
55
55
|
}).script;
|
|
56
|
-
const exitScript =
|
|
56
|
+
const exitScript = chunkWIZCF5IX_cjs.CSVMultisigTapscript.encode({
|
|
57
57
|
timelock: csvTimelock,
|
|
58
58
|
pubkeys: [pubKey]
|
|
59
59
|
}).script;
|
|
@@ -245,7 +245,7 @@ function extractPubKeyBytes(value) {
|
|
|
245
245
|
return base.hex.decode(extractPubKey(normalizeToDescriptor(value)));
|
|
246
246
|
}
|
|
247
247
|
function deserializeCsvTimelock(value) {
|
|
248
|
-
return value !== void 0 && value !== "" ?
|
|
248
|
+
return value !== void 0 && value !== "" ? chunkWIZCF5IX_cjs.sequenceToTimelock(Number(value)) : exports.DefaultVtxo.Script.DEFAULT_TIMELOCK;
|
|
249
249
|
}
|
|
250
250
|
var CLTV_HEIGHT_THRESHOLD = 500000000n;
|
|
251
251
|
function isCltvSatisfied(context, locktime) {
|
|
@@ -416,7 +416,7 @@ function deriveVhtlcTapscripts(script) {
|
|
|
416
416
|
function isCsvSpendable(context, sequence) {
|
|
417
417
|
if (sequence === void 0) return true;
|
|
418
418
|
if (!context.vtxo) return false;
|
|
419
|
-
const timelock =
|
|
419
|
+
const timelock = chunkWIZCF5IX_cjs.sequenceToTimelock(sequence);
|
|
420
420
|
if (timelock.type === "blocks") {
|
|
421
421
|
if (context.blockHeight === void 0 || context.vtxo.status.block_height === void 0) {
|
|
422
422
|
return false;
|
|
@@ -474,22 +474,20 @@ function forfeitExitSpendablePaths(script, contract, context) {
|
|
|
474
474
|
async function detectUsedScripts(indexerProvider, scriptHexes) {
|
|
475
475
|
const used = /* @__PURE__ */ new Set();
|
|
476
476
|
const unique = [...new Set(scriptHexes)];
|
|
477
|
-
for (let offset = 0; offset < unique.length; offset +=
|
|
478
|
-
const scripts = unique.slice(offset, offset +
|
|
477
|
+
for (let offset = 0; offset < unique.length; offset += chunkDY24A73N_cjs.SCRIPT_QUERY_CHUNK_SIZE) {
|
|
478
|
+
const scripts = unique.slice(offset, offset + chunkDY24A73N_cjs.SCRIPT_QUERY_CHUNK_SIZE);
|
|
479
479
|
const remaining = new Set(scripts);
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
while (hasMore && remaining.size > 0) {
|
|
483
|
-
const { vtxos, page } = await chunkSOJDUKY6_cjs.getNormalizedVtxos(indexerProvider, {
|
|
480
|
+
for await (const { vtxos } of chunkDY24A73N_cjs.indexerPages(
|
|
481
|
+
(pageIndex) => chunkDY24A73N_cjs.getNormalizedVtxos(indexerProvider, {
|
|
484
482
|
scripts,
|
|
485
483
|
pageIndex,
|
|
486
|
-
pageSize:
|
|
487
|
-
})
|
|
484
|
+
pageSize: chunkDY24A73N_cjs.DEFAULT_PAGE_SIZE
|
|
485
|
+
})
|
|
486
|
+
)) {
|
|
488
487
|
for (const vtxo of vtxos) {
|
|
489
488
|
if (remaining.delete(vtxo.script)) used.add(vtxo.script);
|
|
490
489
|
}
|
|
491
|
-
|
|
492
|
-
pageIndex++;
|
|
490
|
+
if (remaining.size === 0) break;
|
|
493
491
|
}
|
|
494
492
|
}
|
|
495
493
|
return used;
|
|
@@ -549,7 +547,7 @@ var DefaultContractHandler = {
|
|
|
549
547
|
return {
|
|
550
548
|
pubKey: base.hex.encode(params.pubKey),
|
|
551
549
|
serverPubKey: base.hex.encode(params.serverPubKey),
|
|
552
|
-
csvTimelock:
|
|
550
|
+
csvTimelock: chunkWIZCF5IX_cjs.timelockToSequence(params.csvTimelock).toString()
|
|
553
551
|
};
|
|
554
552
|
},
|
|
555
553
|
deserializeParams(params) {
|
|
@@ -596,12 +594,12 @@ function discoverDefaultRange(entries, deps) {
|
|
|
596
594
|
}
|
|
597
595
|
exports.DelegateVtxo = void 0;
|
|
598
596
|
((DelegateVtxo2) => {
|
|
599
|
-
class Script2 extends
|
|
597
|
+
class Script2 extends chunkWIZCF5IX_cjs.VtxoScript {
|
|
600
598
|
/** Create a delegated virtual output script with forfeit, exit, and delegate paths. */
|
|
601
599
|
constructor(options) {
|
|
602
600
|
const defaultVtxo = new exports.DefaultVtxo.Script(options);
|
|
603
601
|
const { delegatePubKey, pubKey, serverPubKey } = options;
|
|
604
|
-
const delegateScript =
|
|
602
|
+
const delegateScript = chunkWIZCF5IX_cjs.MultisigTapscript.encode({
|
|
605
603
|
pubkeys: [pubKey, delegatePubKey, serverPubKey]
|
|
606
604
|
}).script;
|
|
607
605
|
super([...defaultVtxo.scripts, delegateScript]);
|
|
@@ -640,7 +638,7 @@ var DelegateContractHandler = {
|
|
|
640
638
|
pubKey: base.hex.encode(params.pubKey),
|
|
641
639
|
serverPubKey: base.hex.encode(params.serverPubKey),
|
|
642
640
|
delegatePubKey: base.hex.encode(params.delegatePubKey),
|
|
643
|
-
csvTimelock:
|
|
641
|
+
csvTimelock: chunkWIZCF5IX_cjs.timelockToSequence(params.csvTimelock).toString()
|
|
644
642
|
};
|
|
645
643
|
},
|
|
646
644
|
deserializeParams(params) {
|
|
@@ -698,7 +696,7 @@ function discoverDelegateRange(entries, deps) {
|
|
|
698
696
|
}
|
|
699
697
|
exports.VHTLC = void 0;
|
|
700
698
|
((VHTLC2) => {
|
|
701
|
-
class BaseScript extends
|
|
699
|
+
class BaseScript extends chunkWIZCF5IX_cjs.VtxoScript {
|
|
702
700
|
options;
|
|
703
701
|
claimScript;
|
|
704
702
|
refundScript;
|
|
@@ -725,27 +723,27 @@ exports.VHTLC = void 0;
|
|
|
725
723
|
unilateralRefundWithoutReceiverDelay
|
|
726
724
|
} = options;
|
|
727
725
|
const conditionScript = preimageCondition(preimageHash);
|
|
728
|
-
const claimScript =
|
|
726
|
+
const claimScript = chunkWIZCF5IX_cjs.ConditionMultisigTapscript.encode({
|
|
729
727
|
conditionScript,
|
|
730
728
|
pubkeys: [receiver, server]
|
|
731
729
|
}).script;
|
|
732
|
-
const refundScript =
|
|
730
|
+
const refundScript = chunkWIZCF5IX_cjs.MultisigTapscript.encode({
|
|
733
731
|
pubkeys: [sender, receiver, server]
|
|
734
732
|
}).script;
|
|
735
|
-
const refundWithoutReceiverScript =
|
|
733
|
+
const refundWithoutReceiverScript = chunkWIZCF5IX_cjs.CLTVMultisigTapscript.encode({
|
|
736
734
|
absoluteTimelock: refundLocktime,
|
|
737
735
|
pubkeys: [sender, server]
|
|
738
736
|
}).script;
|
|
739
|
-
const unilateralClaimScript =
|
|
737
|
+
const unilateralClaimScript = chunkWIZCF5IX_cjs.ConditionCSVMultisigTapscript.encode({
|
|
740
738
|
conditionScript,
|
|
741
739
|
timelock: unilateralClaimDelay,
|
|
742
740
|
pubkeys: [receiver]
|
|
743
741
|
}).script;
|
|
744
|
-
const unilateralRefundScript =
|
|
742
|
+
const unilateralRefundScript = chunkWIZCF5IX_cjs.CSVMultisigTapscript.encode({
|
|
745
743
|
timelock: unilateralRefundDelay,
|
|
746
744
|
pubkeys: [sender, receiver]
|
|
747
745
|
}).script;
|
|
748
|
-
const unilateralRefundWithoutReceiverScript =
|
|
746
|
+
const unilateralRefundWithoutReceiverScript = chunkWIZCF5IX_cjs.CSVMultisigTapscript.encode({
|
|
749
747
|
timelock: unilateralRefundWithoutReceiverDelay,
|
|
750
748
|
pubkeys: [sender]
|
|
751
749
|
}).script;
|
|
@@ -765,25 +763,25 @@ exports.VHTLC = void 0;
|
|
|
765
763
|
const covenants = options.nonInteractiveParameters;
|
|
766
764
|
if (covenants) {
|
|
767
765
|
arkadeScriptNic = enforcePayToMaybeAsset(covenants.receiverPkScript, options.asset);
|
|
768
|
-
nonInteractiveClaimScript =
|
|
766
|
+
nonInteractiveClaimScript = chunkWIZCF5IX_cjs.ConditionMultisigTapscript.encode({
|
|
769
767
|
conditionScript,
|
|
770
768
|
pubkeys: [
|
|
771
769
|
server,
|
|
772
|
-
|
|
770
|
+
chunkUPIQZRNJ_cjs.computeArkadeScriptPublicKey(covenants.emulatorPubkey, arkadeScriptNic)
|
|
773
771
|
]
|
|
774
772
|
}).script;
|
|
775
773
|
scripts.push(nonInteractiveClaimScript);
|
|
776
774
|
arkadeScriptNir = enforcePayToMaybeAsset(covenants.senderPkScript, options.asset);
|
|
777
|
-
const nirCosigner =
|
|
775
|
+
const nirCosigner = chunkUPIQZRNJ_cjs.computeArkadeScriptPublicKey(
|
|
778
776
|
covenants.emulatorPubkey,
|
|
779
777
|
arkadeScriptNir
|
|
780
778
|
);
|
|
781
|
-
nonInteractiveRefundScript =
|
|
779
|
+
nonInteractiveRefundScript = chunkWIZCF5IX_cjs.MultisigTapscript.encode({
|
|
782
780
|
pubkeys: [server, receiver, nirCosigner]
|
|
783
781
|
}).script;
|
|
784
782
|
scripts.push(nonInteractiveRefundScript);
|
|
785
783
|
if (covenants.legacy !== "preTimelockedRefund") {
|
|
786
|
-
nonInteractiveRefundWithoutReceiverScript =
|
|
784
|
+
nonInteractiveRefundWithoutReceiverScript = chunkWIZCF5IX_cjs.CLTVMultisigTapscript.encode({
|
|
787
785
|
absoluteTimelock: refundLocktime,
|
|
788
786
|
pubkeys: [server, nirCosigner]
|
|
789
787
|
}).script;
|
|
@@ -1001,7 +999,7 @@ function enforcePayTo(destinationPkScript) {
|
|
|
1001
999
|
if (!isP2trPkScript(destinationPkScript)) {
|
|
1002
1000
|
throw new Error("invalid P2TR script");
|
|
1003
1001
|
}
|
|
1004
|
-
return
|
|
1002
|
+
return chunkUPIQZRNJ_cjs.ArkadeScript.encode(satClause(destinationPkScript));
|
|
1005
1003
|
}
|
|
1006
1004
|
function enforcePayToAsset(destinationPkScript, asset) {
|
|
1007
1005
|
if (!isP2trPkScript(destinationPkScript)) {
|
|
@@ -1016,7 +1014,7 @@ function enforcePayToAsset(destinationPkScript, asset) {
|
|
|
1016
1014
|
);
|
|
1017
1015
|
}
|
|
1018
1016
|
const inspectionTxid = Uint8Array.from(asset.txid).reverse();
|
|
1019
|
-
return
|
|
1017
|
+
return chunkUPIQZRNJ_cjs.ArkadeScript.encode([
|
|
1020
1018
|
// The output at the input's index carries at least the input's amount of the asset.
|
|
1021
1019
|
"PUSHCURRENTINPUTINDEX",
|
|
1022
1020
|
inspectionTxid,
|
|
@@ -1059,9 +1057,9 @@ var VHTLCContractHandler = {
|
|
|
1059
1057
|
server: base.hex.encode(params.server),
|
|
1060
1058
|
hash: base.hex.encode(params.preimageHash),
|
|
1061
1059
|
refundLocktime: params.refundLocktime.toString(),
|
|
1062
|
-
claimDelay:
|
|
1063
|
-
refundDelay:
|
|
1064
|
-
refundNoReceiverDelay:
|
|
1060
|
+
claimDelay: chunkWIZCF5IX_cjs.timelockToSequence(params.unilateralClaimDelay).toString(),
|
|
1061
|
+
refundDelay: chunkWIZCF5IX_cjs.timelockToSequence(params.unilateralRefundDelay).toString(),
|
|
1062
|
+
refundNoReceiverDelay: chunkWIZCF5IX_cjs.timelockToSequence(
|
|
1065
1063
|
params.unilateralRefundWithoutReceiverDelay
|
|
1066
1064
|
).toString()
|
|
1067
1065
|
};
|
|
@@ -1073,9 +1071,9 @@ var VHTLCContractHandler = {
|
|
|
1073
1071
|
server: base.hex.decode(params.server),
|
|
1074
1072
|
preimageHash: base.hex.decode(params.hash),
|
|
1075
1073
|
refundLocktime: BigInt(params.refundLocktime),
|
|
1076
|
-
unilateralClaimDelay:
|
|
1077
|
-
unilateralRefundDelay:
|
|
1078
|
-
unilateralRefundWithoutReceiverDelay:
|
|
1074
|
+
unilateralClaimDelay: chunkWIZCF5IX_cjs.sequenceToTimelock(Number(params.claimDelay)),
|
|
1075
|
+
unilateralRefundDelay: chunkWIZCF5IX_cjs.sequenceToTimelock(Number(params.refundDelay)),
|
|
1076
|
+
unilateralRefundWithoutReceiverDelay: chunkWIZCF5IX_cjs.sequenceToTimelock(
|
|
1079
1077
|
Number(params.refundNoReceiverDelay)
|
|
1080
1078
|
)
|
|
1081
1079
|
};
|
|
@@ -1168,9 +1166,9 @@ var VHTLCV2ContractHandler = {
|
|
|
1168
1166
|
server: base.hex.encode(params.server),
|
|
1169
1167
|
hash: base.hex.encode(params.preimageHash),
|
|
1170
1168
|
refundLocktime: params.refundLocktime.toString(),
|
|
1171
|
-
claimDelay:
|
|
1172
|
-
refundDelay:
|
|
1173
|
-
refundNoReceiverDelay:
|
|
1169
|
+
claimDelay: chunkWIZCF5IX_cjs.timelockToSequence(params.unilateralClaimDelay).toString(),
|
|
1170
|
+
refundDelay: chunkWIZCF5IX_cjs.timelockToSequence(params.unilateralRefundDelay).toString(),
|
|
1171
|
+
refundNoReceiverDelay: chunkWIZCF5IX_cjs.timelockToSequence(
|
|
1174
1172
|
params.unilateralRefundWithoutReceiverDelay
|
|
1175
1173
|
).toString(),
|
|
1176
1174
|
// Per-leaf on-disk keys predate the grouped param and older rows carry exactly these;
|
|
@@ -1248,9 +1246,9 @@ var VHTLCV2ContractHandler = {
|
|
|
1248
1246
|
preimageHash: base.hex.decode(params.hash),
|
|
1249
1247
|
refundLocktime: BigInt(params.refundLocktime),
|
|
1250
1248
|
...asset && { asset },
|
|
1251
|
-
unilateralClaimDelay:
|
|
1252
|
-
unilateralRefundDelay:
|
|
1253
|
-
unilateralRefundWithoutReceiverDelay:
|
|
1249
|
+
unilateralClaimDelay: chunkWIZCF5IX_cjs.sequenceToTimelock(Number(params.claimDelay)),
|
|
1250
|
+
unilateralRefundDelay: chunkWIZCF5IX_cjs.sequenceToTimelock(Number(params.refundDelay)),
|
|
1251
|
+
unilateralRefundWithoutReceiverDelay: chunkWIZCF5IX_cjs.sequenceToTimelock(
|
|
1254
1252
|
Number(params.refundNoReceiverDelay)
|
|
1255
1253
|
),
|
|
1256
1254
|
...claim && refund && {
|
|
@@ -1384,7 +1382,7 @@ function pathsFor(script, context, opts) {
|
|
|
1384
1382
|
const paths = [];
|
|
1385
1383
|
for (const fn of script.compiled) {
|
|
1386
1384
|
if (fn.arkadeScript) continue;
|
|
1387
|
-
const witness =
|
|
1385
|
+
const witness = chunkUPIQZRNJ_cjs.staticWitness(fn.def.tapscript.witness, script.args);
|
|
1388
1386
|
if (witness === null) continue;
|
|
1389
1387
|
const signerHexes = fn.signerKeys.map((s) => base.hex.encode(s));
|
|
1390
1388
|
const requiresServer = signerHexes.includes(serverHex);
|
|
@@ -1393,8 +1391,8 @@ function pathsFor(script, context, opts) {
|
|
|
1393
1391
|
continue;
|
|
1394
1392
|
}
|
|
1395
1393
|
const csvDef = fn.def.tapscript.csv;
|
|
1396
|
-
const csv = csvDef ?
|
|
1397
|
-
const cltv = fn.def.tapscript.cltv !== void 0 ?
|
|
1394
|
+
const csv = csvDef ? chunkUPIQZRNJ_cjs.resolveCsvTimelock(csvDef, script.args) : void 0;
|
|
1395
|
+
const cltv = fn.def.tapscript.cltv !== void 0 ? chunkUPIQZRNJ_cjs.resolveTimelockValue(fn.def.tapscript.cltv, script.args) : void 0;
|
|
1398
1396
|
if (context.collaborative) {
|
|
1399
1397
|
if (csv) continue;
|
|
1400
1398
|
if (opts.checkTimelocks && cltv !== void 0 && !isCltvSatisfied(context, cltv)) {
|
|
@@ -1407,7 +1405,7 @@ function pathsFor(script, context, opts) {
|
|
|
1407
1405
|
continue;
|
|
1408
1406
|
}
|
|
1409
1407
|
if (requiresServer) continue;
|
|
1410
|
-
const sequence = csv ? Number(
|
|
1408
|
+
const sequence = csv ? Number(chunkWIZCF5IX_cjs.timelockToSequence(csv)) : void 0;
|
|
1411
1409
|
if (opts.checkTimelocks && csv && !isCsvSpendable(context, sequence)) continue;
|
|
1412
1410
|
if (opts.checkTimelocks && cltv !== void 0 && !isCltvSatisfied(context, cltv)) {
|
|
1413
1411
|
continue;
|
|
@@ -1424,17 +1422,17 @@ var ArkadeContractHandler = {
|
|
|
1424
1422
|
type: "arkade",
|
|
1425
1423
|
createScript(params) {
|
|
1426
1424
|
const typed = this.deserializeParams(params);
|
|
1427
|
-
return new
|
|
1425
|
+
return new chunkUPIQZRNJ_cjs.ArkadeProgramScript(typed.program, typed.args, {
|
|
1428
1426
|
serverKey: typed.serverKey,
|
|
1429
1427
|
userKey: typed.userKey,
|
|
1430
1428
|
emulatorKey: typed.emulatorKey
|
|
1431
1429
|
});
|
|
1432
1430
|
},
|
|
1433
1431
|
serializeParams(params) {
|
|
1434
|
-
return
|
|
1432
|
+
return chunkUPIQZRNJ_cjs.serializeArkadeContractParams(params);
|
|
1435
1433
|
},
|
|
1436
1434
|
deserializeParams(params) {
|
|
1437
|
-
return
|
|
1435
|
+
return chunkUPIQZRNJ_cjs.deserializeArkadeContractParams(params);
|
|
1438
1436
|
},
|
|
1439
1437
|
selectPath(script, _contract, context) {
|
|
1440
1438
|
const paths = pathsFor(script, context, { checkTimelocks: true });
|
|
@@ -1509,5 +1507,5 @@ exports.isMainnetDescriptor = isMainnetDescriptor;
|
|
|
1509
1507
|
exports.normalizeToDescriptor = normalizeToDescriptor;
|
|
1510
1508
|
exports.parseHDDescriptor = parseHDDescriptor;
|
|
1511
1509
|
exports.speculativeReceiveMetadata = speculativeReceiveMetadata;
|
|
1512
|
-
//# sourceMappingURL=chunk-
|
|
1513
|
-
//# sourceMappingURL=chunk-
|
|
1510
|
+
//# sourceMappingURL=chunk-4PSM6ZUC.cjs.map
|
|
1511
|
+
//# sourceMappingURL=chunk-4PSM6ZUC.cjs.map
|