@arkade-os/sdk 0.4.39 → 0.4.41
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 +24 -0
- package/dist/adapters/expo.cjs +5 -5
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +3 -3
- package/dist/adapters/indexedDB.cjs +5 -5
- package/dist/adapters/indexedDB.js +4 -4
- package/dist/{ark-BzUNnkoc.d.cts → ark-CSqMJczW.d.cts} +111 -4
- package/dist/{ark-BzUNnkoc.d.ts → ark-CSqMJczW.d.ts} +111 -4
- package/dist/{asyncStorageTaskQueue-C0kQoY1x.d.cts → asyncStorageTaskQueue-79XdGsdW.d.cts} +1 -1
- package/dist/{asyncStorageTaskQueue-CIYeI6GM.d.ts → asyncStorageTaskQueue-SZPrhw23.d.ts} +1 -1
- package/dist/{chunk-GUTKJMSF.cjs → chunk-32YKLQPS.cjs} +29 -29
- package/dist/{chunk-GUTKJMSF.cjs.map → chunk-32YKLQPS.cjs.map} +1 -1
- package/dist/{chunk-P5FKMIGY.cjs → chunk-3MPXMLP4.cjs} +538 -282
- package/dist/chunk-3MPXMLP4.cjs.map +1 -0
- package/dist/{chunk-D744IES4.js → chunk-5XAYUPK4.js} +15 -6
- package/dist/chunk-5XAYUPK4.js.map +1 -0
- package/dist/{chunk-LJLEFPWD.cjs → chunk-ALISWEQ5.cjs} +20 -11
- package/dist/chunk-ALISWEQ5.cjs.map +1 -0
- package/dist/{chunk-OUVTG72A.js → chunk-BE5MUB7T.js} +5 -3
- package/dist/chunk-BE5MUB7T.js.map +1 -0
- package/dist/{chunk-SYEGCMNV.js → chunk-D5MQYYYF.js} +355 -104
- package/dist/chunk-D5MQYYYF.js.map +1 -0
- package/dist/{chunk-VGXTJ7HR.js → chunk-DDG4RE5F.js} +4 -4
- package/dist/{chunk-VGXTJ7HR.js.map → chunk-DDG4RE5F.js.map} +1 -1
- package/dist/{chunk-CMPJR3HS.cjs → chunk-HXDZ2QTW.cjs} +5 -3
- package/dist/chunk-HXDZ2QTW.cjs.map +1 -0
- package/dist/{chunk-A5RLZCPO.cjs → chunk-KNASU3QI.cjs} +7 -7
- package/dist/{chunk-A5RLZCPO.cjs.map → chunk-KNASU3QI.cjs.map} +1 -1
- package/dist/{chunk-UIFBMKI7.js → chunk-MYI333YH.js} +3 -3
- package/dist/{chunk-UIFBMKI7.js.map → chunk-MYI333YH.js.map} +1 -1
- package/dist/{chunk-N56IDZON.cjs → chunk-WBF3FNS3.cjs} +14 -14
- package/dist/{chunk-N56IDZON.cjs.map → chunk-WBF3FNS3.cjs.map} +1 -1
- package/dist/{chunk-CUSABEUQ.js → chunk-YNEDJTX2.js} +3 -3
- package/dist/{chunk-CUSABEUQ.js.map → chunk-YNEDJTX2.js.map} +1 -1
- package/dist/contracts/handlers/index.cjs +7 -7
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/contracts/handlers/index.js +2 -2
- package/dist/{delegate-BjPbX-MR.d.ts → delegate-BTn9BK8E.d.ts} +1 -1
- package/dist/{delegate-DHAgMIS9.d.cts → delegate-Bqwe-kbj.d.cts} +1 -1
- package/dist/{index-YkMAtSfw.d.cts → index-aYiHTMkX.d.cts} +2 -2
- package/dist/{index-BOQKDCmS.d.ts → index-kITujXlS.d.ts} +2 -2
- package/dist/index.cjs +163 -139
- package/dist/index.d.cts +53 -11
- package/dist/index.d.ts +53 -11
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +13 -13
- package/dist/repositories/realm/index.d.cts +1 -1
- package/dist/repositories/realm/index.d.ts +1 -1
- package/dist/repositories/realm/index.js +4 -4
- package/dist/repositories/sqlite/index.cjs +13 -13
- package/dist/repositories/sqlite/index.d.cts +1 -1
- package/dist/repositories/sqlite/index.d.ts +1 -1
- package/dist/repositories/sqlite/index.js +4 -4
- package/dist/{taskRunner-Dfmt7ZPN.d.ts → taskRunner-BuBAZQwB.d.ts} +1 -1
- package/dist/{taskRunner-CVEgBO6d.d.cts → taskRunner-DRHElPMG.d.cts} +1 -1
- package/dist/wallet/expo/background.cjs +14 -14
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +6 -6
- package/dist/wallet/expo/index.cjs +44 -14
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +14 -4
- package/dist/wallet/expo/index.d.ts +14 -4
- package/dist/wallet/expo/index.js +36 -6
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/{wallet-C4Pide44.d.ts → wallet-BZgRfnAE.d.cts} +15 -2
- package/dist/{wallet-_PTv-lMe.d.cts → wallet-CTEQpKG9.d.ts} +15 -2
- package/dist/worker/expo/index.cjs +9 -9
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-CMPJR3HS.cjs.map +0 -1
- package/dist/chunk-D744IES4.js.map +0 -1
- package/dist/chunk-LJLEFPWD.cjs.map +0 -1
- package/dist/chunk-OUVTG72A.js.map +0 -1
- package/dist/chunk-P5FKMIGY.cjs.map +0 -1
- package/dist/chunk-SYEGCMNV.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHXDZ2QTW_cjs = require('./chunk-HXDZ2QTW.cjs');
|
|
4
4
|
var base = require('@scure/base');
|
|
5
5
|
var descriptorsScure = require('@bitcoinerlab/descriptors-scure');
|
|
6
6
|
var btcSigner = require('@scure/btc-signer');
|
|
@@ -73,14 +73,14 @@ var ContractHandlerRegistry = class {
|
|
|
73
73
|
var contractHandlers = new ContractHandlerRegistry();
|
|
74
74
|
exports.DefaultVtxo = void 0;
|
|
75
75
|
((DefaultVtxo2) => {
|
|
76
|
-
class Script2 extends
|
|
76
|
+
class Script2 extends chunkHXDZ2QTW_cjs.VtxoScript {
|
|
77
77
|
/** Create the default virtual output script with one forfeit path and one exit path. */
|
|
78
78
|
constructor(options) {
|
|
79
79
|
const { pubKey, serverPubKey, csvTimelock } = options;
|
|
80
|
-
const forfeitScript =
|
|
80
|
+
const forfeitScript = chunkHXDZ2QTW_cjs.MultisigTapscript.encode({
|
|
81
81
|
pubkeys: [pubKey, serverPubKey]
|
|
82
82
|
}).script;
|
|
83
|
-
const exitScript =
|
|
83
|
+
const exitScript = chunkHXDZ2QTW_cjs.CSVMultisigTapscript.encode({
|
|
84
84
|
timelock: csvTimelock,
|
|
85
85
|
pubkeys: [pubKey]
|
|
86
86
|
}).script;
|
|
@@ -248,7 +248,7 @@ function isCltvSatisfied(context, locktime) {
|
|
|
248
248
|
function isCsvSpendable(context, sequence) {
|
|
249
249
|
if (sequence === void 0) return true;
|
|
250
250
|
if (!context.vtxo) return false;
|
|
251
|
-
const timelock =
|
|
251
|
+
const timelock = chunkHXDZ2QTW_cjs.sequenceToTimelock(sequence);
|
|
252
252
|
if (timelock.type === "blocks") {
|
|
253
253
|
if (context.blockHeight === void 0 || context.vtxo.status.block_height === void 0) {
|
|
254
254
|
return false;
|
|
@@ -300,11 +300,11 @@ var DefaultContractHandler = {
|
|
|
300
300
|
return {
|
|
301
301
|
pubKey: base.hex.encode(params.pubKey),
|
|
302
302
|
serverPubKey: base.hex.encode(params.serverPubKey),
|
|
303
|
-
csvTimelock:
|
|
303
|
+
csvTimelock: chunkHXDZ2QTW_cjs.timelockToSequence(params.csvTimelock).toString()
|
|
304
304
|
};
|
|
305
305
|
},
|
|
306
306
|
deserializeParams(params) {
|
|
307
|
-
const csvTimelock = params.csvTimelock !== void 0 && params.csvTimelock !== "" ?
|
|
307
|
+
const csvTimelock = params.csvTimelock !== void 0 && params.csvTimelock !== "" ? chunkHXDZ2QTW_cjs.sequenceToTimelock(Number(params.csvTimelock)) : exports.DefaultVtxo.Script.DEFAULT_TIMELOCK;
|
|
308
308
|
return {
|
|
309
309
|
pubKey: extractPubKeyBytes(params.pubKey),
|
|
310
310
|
serverPubKey: extractPubKeyBytes(params.serverPubKey),
|
|
@@ -381,7 +381,7 @@ var DefaultContractHandler = {
|
|
|
381
381
|
params: {
|
|
382
382
|
pubKey: base.hex.encode(pubKey),
|
|
383
383
|
serverPubKey: base.hex.encode(c.serverPubKey),
|
|
384
|
-
csvTimelock:
|
|
384
|
+
csvTimelock: chunkHXDZ2QTW_cjs.timelockToSequence(c.csvTimelock).toString()
|
|
385
385
|
},
|
|
386
386
|
script: c.scriptHex,
|
|
387
387
|
address: c.script.address(deps.network.hrp, c.serverPubKey).encode(),
|
|
@@ -398,12 +398,12 @@ var DefaultContractHandler = {
|
|
|
398
398
|
};
|
|
399
399
|
exports.DelegateVtxo = void 0;
|
|
400
400
|
((DelegateVtxo2) => {
|
|
401
|
-
class Script2 extends
|
|
401
|
+
class Script2 extends chunkHXDZ2QTW_cjs.VtxoScript {
|
|
402
402
|
/** Create a delegated virtual output script with forfeit, exit, and delegate paths. */
|
|
403
403
|
constructor(options) {
|
|
404
404
|
const defaultVtxo = new exports.DefaultVtxo.Script(options);
|
|
405
405
|
const { delegatePubKey, pubKey, serverPubKey } = options;
|
|
406
|
-
const delegateScript =
|
|
406
|
+
const delegateScript = chunkHXDZ2QTW_cjs.MultisigTapscript.encode({
|
|
407
407
|
pubkeys: [pubKey, delegatePubKey, serverPubKey]
|
|
408
408
|
}).script;
|
|
409
409
|
super([...defaultVtxo.scripts, delegateScript]);
|
|
@@ -441,11 +441,11 @@ var DelegateContractHandler = {
|
|
|
441
441
|
pubKey: base.hex.encode(params.pubKey),
|
|
442
442
|
serverPubKey: base.hex.encode(params.serverPubKey),
|
|
443
443
|
delegatePubKey: base.hex.encode(params.delegatePubKey),
|
|
444
|
-
csvTimelock:
|
|
444
|
+
csvTimelock: chunkHXDZ2QTW_cjs.timelockToSequence(params.csvTimelock).toString()
|
|
445
445
|
};
|
|
446
446
|
},
|
|
447
447
|
deserializeParams(params) {
|
|
448
|
-
const csvTimelock =
|
|
448
|
+
const csvTimelock = chunkHXDZ2QTW_cjs.sequenceToTimelock(Number(params.csvTimelock));
|
|
449
449
|
return {
|
|
450
450
|
pubKey: base.hex.decode(params.pubKey),
|
|
451
451
|
serverPubKey: base.hex.decode(params.serverPubKey),
|
|
@@ -529,7 +529,7 @@ var DelegateContractHandler = {
|
|
|
529
529
|
pubKey: base.hex.encode(pubKey),
|
|
530
530
|
serverPubKey: base.hex.encode(c.serverPubKey),
|
|
531
531
|
delegatePubKey: base.hex.encode(deps.delegatePubKey),
|
|
532
|
-
csvTimelock:
|
|
532
|
+
csvTimelock: chunkHXDZ2QTW_cjs.timelockToSequence(c.csvTimelock).toString()
|
|
533
533
|
},
|
|
534
534
|
script: c.scriptHex,
|
|
535
535
|
address: c.script.address(deps.network.hrp, c.serverPubKey).encode(),
|
|
@@ -546,7 +546,7 @@ var DelegateContractHandler = {
|
|
|
546
546
|
};
|
|
547
547
|
exports.VHTLC = void 0;
|
|
548
548
|
((VHTLC2) => {
|
|
549
|
-
class Script2 extends
|
|
549
|
+
class Script2 extends chunkHXDZ2QTW_cjs.VtxoScript {
|
|
550
550
|
/** Create a VHTLC script from the supplied participant keys, hash, and timelocks. */
|
|
551
551
|
constructor(options) {
|
|
552
552
|
validateOptions(options);
|
|
@@ -561,27 +561,27 @@ exports.VHTLC = void 0;
|
|
|
561
561
|
unilateralRefundWithoutReceiverDelay
|
|
562
562
|
} = options;
|
|
563
563
|
const conditionScript = preimageConditionScript(preimageHash);
|
|
564
|
-
const claimScript =
|
|
564
|
+
const claimScript = chunkHXDZ2QTW_cjs.ConditionMultisigTapscript.encode({
|
|
565
565
|
conditionScript,
|
|
566
566
|
pubkeys: [receiver, server]
|
|
567
567
|
}).script;
|
|
568
|
-
const refundScript =
|
|
568
|
+
const refundScript = chunkHXDZ2QTW_cjs.MultisigTapscript.encode({
|
|
569
569
|
pubkeys: [sender, receiver, server]
|
|
570
570
|
}).script;
|
|
571
|
-
const refundWithoutReceiverScript =
|
|
571
|
+
const refundWithoutReceiverScript = chunkHXDZ2QTW_cjs.CLTVMultisigTapscript.encode({
|
|
572
572
|
absoluteTimelock: refundLocktime,
|
|
573
573
|
pubkeys: [sender, server]
|
|
574
574
|
}).script;
|
|
575
|
-
const unilateralClaimScript =
|
|
575
|
+
const unilateralClaimScript = chunkHXDZ2QTW_cjs.ConditionCSVMultisigTapscript.encode({
|
|
576
576
|
conditionScript,
|
|
577
577
|
timelock: unilateralClaimDelay,
|
|
578
578
|
pubkeys: [receiver]
|
|
579
579
|
}).script;
|
|
580
|
-
const unilateralRefundScript =
|
|
580
|
+
const unilateralRefundScript = chunkHXDZ2QTW_cjs.CSVMultisigTapscript.encode({
|
|
581
581
|
timelock: unilateralRefundDelay,
|
|
582
582
|
pubkeys: [sender, receiver]
|
|
583
583
|
}).script;
|
|
584
|
-
const unilateralRefundWithoutReceiverScript =
|
|
584
|
+
const unilateralRefundWithoutReceiverScript = chunkHXDZ2QTW_cjs.CSVMultisigTapscript.encode({
|
|
585
585
|
timelock: unilateralRefundWithoutReceiverDelay,
|
|
586
586
|
pubkeys: [sender]
|
|
587
587
|
}).script;
|
|
@@ -708,9 +708,9 @@ var VHTLCContractHandler = {
|
|
|
708
708
|
server: base.hex.encode(params.server),
|
|
709
709
|
hash: base.hex.encode(params.preimageHash),
|
|
710
710
|
refundLocktime: params.refundLocktime.toString(),
|
|
711
|
-
claimDelay:
|
|
712
|
-
refundDelay:
|
|
713
|
-
refundNoReceiverDelay:
|
|
711
|
+
claimDelay: chunkHXDZ2QTW_cjs.timelockToSequence(params.unilateralClaimDelay).toString(),
|
|
712
|
+
refundDelay: chunkHXDZ2QTW_cjs.timelockToSequence(params.unilateralRefundDelay).toString(),
|
|
713
|
+
refundNoReceiverDelay: chunkHXDZ2QTW_cjs.timelockToSequence(
|
|
714
714
|
params.unilateralRefundWithoutReceiverDelay
|
|
715
715
|
).toString()
|
|
716
716
|
};
|
|
@@ -722,9 +722,9 @@ var VHTLCContractHandler = {
|
|
|
722
722
|
server: base.hex.decode(params.server),
|
|
723
723
|
preimageHash: base.hex.decode(params.hash),
|
|
724
724
|
refundLocktime: BigInt(params.refundLocktime),
|
|
725
|
-
unilateralClaimDelay:
|
|
726
|
-
unilateralRefundDelay:
|
|
727
|
-
unilateralRefundWithoutReceiverDelay:
|
|
725
|
+
unilateralClaimDelay: chunkHXDZ2QTW_cjs.sequenceToTimelock(Number(params.claimDelay)),
|
|
726
|
+
unilateralRefundDelay: chunkHXDZ2QTW_cjs.sequenceToTimelock(Number(params.refundDelay)),
|
|
727
|
+
unilateralRefundWithoutReceiverDelay: chunkHXDZ2QTW_cjs.sequenceToTimelock(
|
|
728
728
|
Number(params.refundNoReceiverDelay)
|
|
729
729
|
)
|
|
730
730
|
};
|
|
@@ -917,7 +917,7 @@ var BoardingContractHandler = {
|
|
|
917
917
|
const coins = await deps.onchainProvider.getCoins(onchainAddress);
|
|
918
918
|
if (coins.length === 0) return [];
|
|
919
919
|
const scriptHex = base.hex.encode(script.pkScript);
|
|
920
|
-
const boardingSeq =
|
|
920
|
+
const boardingSeq = chunkHXDZ2QTW_cjs.timelockToSequence(deps.boardingTimelock);
|
|
921
921
|
return [
|
|
922
922
|
{
|
|
923
923
|
type: "boarding",
|
|
@@ -966,5 +966,5 @@ exports.descriptorIsOurs = descriptorIsOurs;
|
|
|
966
966
|
exports.isCltvSatisfied = isCltvSatisfied;
|
|
967
967
|
exports.isCsvSpendable = isCsvSpendable;
|
|
968
968
|
exports.isMainnetDescriptor = isMainnetDescriptor;
|
|
969
|
-
//# sourceMappingURL=chunk-
|
|
970
|
-
//# sourceMappingURL=chunk-
|
|
969
|
+
//# sourceMappingURL=chunk-32YKLQPS.cjs.map
|
|
970
|
+
//# sourceMappingURL=chunk-32YKLQPS.cjs.map
|