@arkade-os/sdk 0.4.47 → 0.4.48
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/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-CoJgwTi_.d.cts → ark-CjE0KkGp.d.cts} +405 -250
- package/dist/{ark-CoJgwTi_.d.ts → ark-CjE0KkGp.d.ts} +405 -250
- package/dist/{asyncStorageTaskQueue-Dowyo59a.d.cts → asyncStorageTaskQueue-CeLZhZFU.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-Z3aFoXCl.d.ts → asyncStorageTaskQueue-D9SOPMPC.d.ts} +2 -2
- package/dist/{chunk-XN3554FT.js → chunk-4VVTRPH3.js} +4 -4
- package/dist/chunk-4VVTRPH3.js.map +1 -0
- package/dist/{chunk-RQSA7ADZ.cjs → chunk-5XMVTK5S.cjs} +37 -37
- package/dist/chunk-5XMVTK5S.cjs.map +1 -0
- package/dist/{chunk-L5ND2FJJ.cjs → chunk-7TXSPRN5.cjs} +161 -2
- package/dist/chunk-7TXSPRN5.cjs.map +1 -0
- package/dist/{chunk-CDDWXBEM.js → chunk-BHHLRZCS.js} +169 -42
- package/dist/chunk-BHHLRZCS.js.map +1 -0
- package/dist/{chunk-HHV5FPC6.cjs → chunk-EB3ALGTM.cjs} +178 -50
- package/dist/chunk-EB3ALGTM.cjs.map +1 -0
- package/dist/{chunk-JAYOXOLT.cjs → chunk-ENDNQPZA.cjs} +17 -44
- package/dist/chunk-ENDNQPZA.cjs.map +1 -0
- package/dist/{chunk-WTTLIFS7.cjs → chunk-ENZ4YPR2.cjs} +944 -544
- package/dist/chunk-ENZ4YPR2.cjs.map +1 -0
- package/dist/{chunk-3N5I6GT6.js → chunk-G6J6AEMH.js} +5 -4
- package/dist/chunk-G6J6AEMH.js.map +1 -0
- package/dist/{chunk-OCS5S3L3.js → chunk-NYR5H6GR.js} +685 -284
- package/dist/chunk-NYR5H6GR.js.map +1 -0
- package/dist/{chunk-VE67GMGM.cjs → chunk-SYDANBJI.cjs} +9 -8
- package/dist/chunk-SYDANBJI.cjs.map +1 -0
- package/dist/{chunk-AJQ4AOT3.js → chunk-XFMGIFBL.js} +4 -31
- package/dist/chunk-XFMGIFBL.js.map +1 -0
- package/dist/{chunk-C7TXXTMS.js → chunk-ZDDBTFVO.js} +146 -3
- package/dist/chunk-ZDDBTFVO.js.map +1 -0
- package/dist/contracts/handlers/index.cjs +8 -8
- 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-Dl87_zMA.d.cts → delegate-D3dY-2vS.d.cts} +1 -1
- package/dist/{delegate-CuaDqqQi.d.ts → delegate-DhGZk1r2.d.ts} +1 -1
- package/dist/{index-BC_G0VTh.d.cts → index-D6RQROds.d.cts} +2 -2
- package/dist/{index-CKwpZEpw.d.ts → index-DK4_iWYy.d.ts} +2 -2
- package/dist/index.cjs +211 -183
- package/dist/index.d.cts +61 -11
- package/dist/index.d.ts +61 -11
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +19 -19
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/realm/index.js +5 -5
- package/dist/repositories/sqlite/index.cjs +18 -18
- package/dist/repositories/sqlite/index.d.cts +2 -2
- package/dist/repositories/sqlite/index.d.ts +2 -2
- package/dist/repositories/sqlite/index.js +5 -5
- package/dist/{taskRunner-Dz-TI4Rb.d.ts → taskRunner-B-2MHCYG.d.ts} +2 -2
- package/dist/{taskRunner-Dz47k0lp.d.cts → taskRunner-Brnak0Rc.d.cts} +2 -2
- 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 +14 -14
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +5 -5
- package/dist/wallet/expo/index.d.ts +5 -5
- package/dist/wallet/expo/index.js +5 -5
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/{wallet-Oxz_wLxo.d.cts → wallet-B5bwixQa.d.ts} +130 -7
- package/dist/{wallet-x7egmXq6.d.ts → wallet-DiOrtYic.d.cts} +130 -7
- 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 +3 -2
- package/dist/chunk-3N5I6GT6.js.map +0 -1
- package/dist/chunk-AJQ4AOT3.js.map +0 -1
- package/dist/chunk-C7TXXTMS.js.map +0 -1
- package/dist/chunk-CDDWXBEM.js.map +0 -1
- package/dist/chunk-HHV5FPC6.cjs.map +0 -1
- package/dist/chunk-JAYOXOLT.cjs.map +0 -1
- package/dist/chunk-L5ND2FJJ.cjs.map +0 -1
- package/dist/chunk-OCS5S3L3.js.map +0 -1
- package/dist/chunk-RQSA7ADZ.cjs.map +0 -1
- package/dist/chunk-VE67GMGM.cjs.map +0 -1
- package/dist/chunk-WTTLIFS7.cjs.map +0 -1
- package/dist/chunk-XN3554FT.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk7TXSPRN5_cjs = require('./chunk-7TXSPRN5.cjs');
|
|
4
4
|
var chunk5BLDMQED_cjs = require('./chunk-5BLDMQED.cjs');
|
|
5
5
|
var base = require('@scure/base');
|
|
6
6
|
var descriptorsScure = require('@bitcoinerlab/descriptors-scure');
|
|
@@ -76,14 +76,14 @@ var ContractHandlerRegistry = class {
|
|
|
76
76
|
var contractHandlers = new ContractHandlerRegistry();
|
|
77
77
|
exports.DefaultVtxo = void 0;
|
|
78
78
|
((DefaultVtxo2) => {
|
|
79
|
-
class Script3 extends
|
|
79
|
+
class Script3 extends chunk7TXSPRN5_cjs.VtxoScript {
|
|
80
80
|
/** Create the default virtual output script with one forfeit path and one exit path. */
|
|
81
81
|
constructor(options) {
|
|
82
82
|
const { pubKey, serverPubKey, csvTimelock } = options;
|
|
83
|
-
const forfeitScript =
|
|
83
|
+
const forfeitScript = chunk7TXSPRN5_cjs.MultisigTapscript.encode({
|
|
84
84
|
pubkeys: [pubKey, serverPubKey]
|
|
85
85
|
}).script;
|
|
86
|
-
const exitScript =
|
|
86
|
+
const exitScript = chunk7TXSPRN5_cjs.CSVMultisigTapscript.encode({
|
|
87
87
|
timelock: csvTimelock,
|
|
88
88
|
pubkeys: [pubKey]
|
|
89
89
|
}).script;
|
|
@@ -252,7 +252,7 @@ function isCltvSatisfied(context, locktime) {
|
|
|
252
252
|
function isCsvSpendable(context, sequence) {
|
|
253
253
|
if (sequence === void 0) return true;
|
|
254
254
|
if (!context.vtxo) return false;
|
|
255
|
-
const timelock =
|
|
255
|
+
const timelock = chunk7TXSPRN5_cjs.sequenceToTimelock(sequence);
|
|
256
256
|
if (timelock.type === "blocks") {
|
|
257
257
|
if (context.blockHeight === void 0 || context.vtxo.status.block_height === void 0) {
|
|
258
258
|
return false;
|
|
@@ -273,7 +273,7 @@ async function detectUsedScripts(indexerProvider, scriptHexes) {
|
|
|
273
273
|
let pageIndex = 0;
|
|
274
274
|
let hasMore = true;
|
|
275
275
|
while (hasMore && remaining.size > 0) {
|
|
276
|
-
const { vtxos, page } = await
|
|
276
|
+
const { vtxos, page } = await chunk7TXSPRN5_cjs.getNormalizedVtxos(indexerProvider, {
|
|
277
277
|
scripts: scriptHexes,
|
|
278
278
|
pageIndex,
|
|
279
279
|
pageSize: DEFAULT_PAGE_SIZE
|
|
@@ -304,11 +304,11 @@ var DefaultContractHandler = {
|
|
|
304
304
|
return {
|
|
305
305
|
pubKey: base.hex.encode(params.pubKey),
|
|
306
306
|
serverPubKey: base.hex.encode(params.serverPubKey),
|
|
307
|
-
csvTimelock:
|
|
307
|
+
csvTimelock: chunk7TXSPRN5_cjs.timelockToSequence(params.csvTimelock).toString()
|
|
308
308
|
};
|
|
309
309
|
},
|
|
310
310
|
deserializeParams(params) {
|
|
311
|
-
const csvTimelock = params.csvTimelock !== void 0 && params.csvTimelock !== "" ?
|
|
311
|
+
const csvTimelock = params.csvTimelock !== void 0 && params.csvTimelock !== "" ? chunk7TXSPRN5_cjs.sequenceToTimelock(Number(params.csvTimelock)) : exports.DefaultVtxo.Script.DEFAULT_TIMELOCK;
|
|
312
312
|
return {
|
|
313
313
|
pubKey: extractPubKeyBytes(params.pubKey),
|
|
314
314
|
serverPubKey: extractPubKeyBytes(params.serverPubKey),
|
|
@@ -385,7 +385,7 @@ var DefaultContractHandler = {
|
|
|
385
385
|
params: {
|
|
386
386
|
pubKey: base.hex.encode(pubKey),
|
|
387
387
|
serverPubKey: base.hex.encode(c.serverPubKey),
|
|
388
|
-
csvTimelock:
|
|
388
|
+
csvTimelock: chunk7TXSPRN5_cjs.timelockToSequence(c.csvTimelock).toString()
|
|
389
389
|
},
|
|
390
390
|
script: c.scriptHex,
|
|
391
391
|
address: c.script.address(deps.network.hrp, c.serverPubKey).encode(),
|
|
@@ -402,12 +402,12 @@ var DefaultContractHandler = {
|
|
|
402
402
|
};
|
|
403
403
|
exports.DelegateVtxo = void 0;
|
|
404
404
|
((DelegateVtxo2) => {
|
|
405
|
-
class Script3 extends
|
|
405
|
+
class Script3 extends chunk7TXSPRN5_cjs.VtxoScript {
|
|
406
406
|
/** Create a delegated virtual output script with forfeit, exit, and delegate paths. */
|
|
407
407
|
constructor(options) {
|
|
408
408
|
const defaultVtxo = new exports.DefaultVtxo.Script(options);
|
|
409
409
|
const { delegatePubKey, pubKey, serverPubKey } = options;
|
|
410
|
-
const delegateScript =
|
|
410
|
+
const delegateScript = chunk7TXSPRN5_cjs.MultisigTapscript.encode({
|
|
411
411
|
pubkeys: [pubKey, delegatePubKey, serverPubKey]
|
|
412
412
|
}).script;
|
|
413
413
|
super([...defaultVtxo.scripts, delegateScript]);
|
|
@@ -446,11 +446,11 @@ var DelegateContractHandler = {
|
|
|
446
446
|
pubKey: base.hex.encode(params.pubKey),
|
|
447
447
|
serverPubKey: base.hex.encode(params.serverPubKey),
|
|
448
448
|
delegatePubKey: base.hex.encode(params.delegatePubKey),
|
|
449
|
-
csvTimelock:
|
|
449
|
+
csvTimelock: chunk7TXSPRN5_cjs.timelockToSequence(params.csvTimelock).toString()
|
|
450
450
|
};
|
|
451
451
|
},
|
|
452
452
|
deserializeParams(params) {
|
|
453
|
-
const csvTimelock =
|
|
453
|
+
const csvTimelock = chunk7TXSPRN5_cjs.sequenceToTimelock(Number(params.csvTimelock));
|
|
454
454
|
return {
|
|
455
455
|
pubKey: base.hex.decode(params.pubKey),
|
|
456
456
|
serverPubKey: base.hex.decode(params.serverPubKey),
|
|
@@ -534,7 +534,7 @@ var DelegateContractHandler = {
|
|
|
534
534
|
pubKey: base.hex.encode(pubKey),
|
|
535
535
|
serverPubKey: base.hex.encode(c.serverPubKey),
|
|
536
536
|
delegatePubKey: base.hex.encode(deps.delegatePubKey),
|
|
537
|
-
csvTimelock:
|
|
537
|
+
csvTimelock: chunk7TXSPRN5_cjs.timelockToSequence(c.csvTimelock).toString()
|
|
538
538
|
},
|
|
539
539
|
script: c.scriptHex,
|
|
540
540
|
address: c.script.address(deps.network.hrp, c.serverPubKey).encode(),
|
|
@@ -551,7 +551,7 @@ var DelegateContractHandler = {
|
|
|
551
551
|
};
|
|
552
552
|
exports.VHTLC = void 0;
|
|
553
553
|
((VHTLC2) => {
|
|
554
|
-
class Script3 extends
|
|
554
|
+
class Script3 extends chunk7TXSPRN5_cjs.VtxoScript {
|
|
555
555
|
/** Create a VHTLC script from the supplied participant keys, hash, and timelocks. */
|
|
556
556
|
constructor(options) {
|
|
557
557
|
validateOptions(options);
|
|
@@ -566,27 +566,27 @@ exports.VHTLC = void 0;
|
|
|
566
566
|
unilateralRefundWithoutReceiverDelay
|
|
567
567
|
} = options;
|
|
568
568
|
const conditionScript = preimageConditionScript(preimageHash);
|
|
569
|
-
const claimScript =
|
|
569
|
+
const claimScript = chunk7TXSPRN5_cjs.ConditionMultisigTapscript.encode({
|
|
570
570
|
conditionScript,
|
|
571
571
|
pubkeys: [receiver, server]
|
|
572
572
|
}).script;
|
|
573
|
-
const refundScript =
|
|
573
|
+
const refundScript = chunk7TXSPRN5_cjs.MultisigTapscript.encode({
|
|
574
574
|
pubkeys: [sender, receiver, server]
|
|
575
575
|
}).script;
|
|
576
|
-
const refundWithoutReceiverScript =
|
|
576
|
+
const refundWithoutReceiverScript = chunk7TXSPRN5_cjs.CLTVMultisigTapscript.encode({
|
|
577
577
|
absoluteTimelock: refundLocktime,
|
|
578
578
|
pubkeys: [sender, server]
|
|
579
579
|
}).script;
|
|
580
|
-
const unilateralClaimScript =
|
|
580
|
+
const unilateralClaimScript = chunk7TXSPRN5_cjs.ConditionCSVMultisigTapscript.encode({
|
|
581
581
|
conditionScript,
|
|
582
582
|
timelock: unilateralClaimDelay,
|
|
583
583
|
pubkeys: [receiver]
|
|
584
584
|
}).script;
|
|
585
|
-
const unilateralRefundScript =
|
|
585
|
+
const unilateralRefundScript = chunk7TXSPRN5_cjs.CSVMultisigTapscript.encode({
|
|
586
586
|
timelock: unilateralRefundDelay,
|
|
587
587
|
pubkeys: [sender, receiver]
|
|
588
588
|
}).script;
|
|
589
|
-
const unilateralRefundWithoutReceiverScript =
|
|
589
|
+
const unilateralRefundWithoutReceiverScript = chunk7TXSPRN5_cjs.CSVMultisigTapscript.encode({
|
|
590
590
|
timelock: unilateralRefundWithoutReceiverDelay,
|
|
591
591
|
pubkeys: [sender]
|
|
592
592
|
}).script;
|
|
@@ -714,9 +714,9 @@ var VHTLCContractHandler = {
|
|
|
714
714
|
server: base.hex.encode(params.server),
|
|
715
715
|
hash: base.hex.encode(params.preimageHash),
|
|
716
716
|
refundLocktime: params.refundLocktime.toString(),
|
|
717
|
-
claimDelay:
|
|
718
|
-
refundDelay:
|
|
719
|
-
refundNoReceiverDelay:
|
|
717
|
+
claimDelay: chunk7TXSPRN5_cjs.timelockToSequence(params.unilateralClaimDelay).toString(),
|
|
718
|
+
refundDelay: chunk7TXSPRN5_cjs.timelockToSequence(params.unilateralRefundDelay).toString(),
|
|
719
|
+
refundNoReceiverDelay: chunk7TXSPRN5_cjs.timelockToSequence(
|
|
720
720
|
params.unilateralRefundWithoutReceiverDelay
|
|
721
721
|
).toString()
|
|
722
722
|
};
|
|
@@ -728,9 +728,9 @@ var VHTLCContractHandler = {
|
|
|
728
728
|
server: base.hex.decode(params.server),
|
|
729
729
|
preimageHash: base.hex.decode(params.hash),
|
|
730
730
|
refundLocktime: BigInt(params.refundLocktime),
|
|
731
|
-
unilateralClaimDelay:
|
|
732
|
-
unilateralRefundDelay:
|
|
733
|
-
unilateralRefundWithoutReceiverDelay:
|
|
731
|
+
unilateralClaimDelay: chunk7TXSPRN5_cjs.sequenceToTimelock(Number(params.claimDelay)),
|
|
732
|
+
unilateralRefundDelay: chunk7TXSPRN5_cjs.sequenceToTimelock(Number(params.refundDelay)),
|
|
733
|
+
unilateralRefundWithoutReceiverDelay: chunk7TXSPRN5_cjs.sequenceToTimelock(
|
|
734
734
|
Number(params.refundNoReceiverDelay)
|
|
735
735
|
)
|
|
736
736
|
};
|
|
@@ -923,7 +923,7 @@ var BoardingContractHandler = {
|
|
|
923
923
|
const coins = await deps.onchainProvider.getCoins(onchainAddress);
|
|
924
924
|
if (coins.length === 0) return [];
|
|
925
925
|
const scriptHex = base.hex.encode(script.pkScript);
|
|
926
|
-
const boardingSeq =
|
|
926
|
+
const boardingSeq = chunk7TXSPRN5_cjs.timelockToSequence(deps.boardingTimelock);
|
|
927
927
|
return [
|
|
928
928
|
{
|
|
929
929
|
type: "boarding",
|
|
@@ -1909,27 +1909,27 @@ function encodeTapscriptSegment(seg, pubkeys, args) {
|
|
|
1909
1909
|
if (seg.csv) {
|
|
1910
1910
|
const timelock = { type: seg.csv.type, value: resolveTimelockValue(seg.csv.value, args) };
|
|
1911
1911
|
if (seg.asm) {
|
|
1912
|
-
return
|
|
1912
|
+
return chunk7TXSPRN5_cjs.ConditionCSVMultisigTapscript.encode({
|
|
1913
1913
|
conditionScript: resolveAsm(seg.asm, args),
|
|
1914
1914
|
timelock,
|
|
1915
1915
|
pubkeys
|
|
1916
1916
|
});
|
|
1917
1917
|
}
|
|
1918
|
-
return
|
|
1918
|
+
return chunk7TXSPRN5_cjs.CSVMultisigTapscript.encode({ timelock, pubkeys });
|
|
1919
1919
|
}
|
|
1920
1920
|
if (seg.cltv !== void 0) {
|
|
1921
|
-
return
|
|
1921
|
+
return chunk7TXSPRN5_cjs.CLTVMultisigTapscript.encode({
|
|
1922
1922
|
absoluteTimelock: resolveTimelockValue(seg.cltv, args),
|
|
1923
1923
|
pubkeys
|
|
1924
1924
|
});
|
|
1925
1925
|
}
|
|
1926
1926
|
if (seg.asm) {
|
|
1927
|
-
return
|
|
1927
|
+
return chunk7TXSPRN5_cjs.ConditionMultisigTapscript.encode({
|
|
1928
1928
|
conditionScript: resolveAsm(seg.asm, args),
|
|
1929
1929
|
pubkeys
|
|
1930
1930
|
});
|
|
1931
1931
|
}
|
|
1932
|
-
return
|
|
1932
|
+
return chunk7TXSPRN5_cjs.MultisigTapscript.encode({ pubkeys });
|
|
1933
1933
|
}
|
|
1934
1934
|
function compileFunctions(program, args, keys) {
|
|
1935
1935
|
if (program.version !== SUPPORTED_PROGRAM_VERSION) {
|
|
@@ -1959,7 +1959,7 @@ function compileFunctions(program, args, keys) {
|
|
|
1959
1959
|
return { name: names[i], def, leafScript, arkadeScript, signerKeys: pubkeys };
|
|
1960
1960
|
});
|
|
1961
1961
|
}
|
|
1962
|
-
var ArkadeProgramScript = class extends
|
|
1962
|
+
var ArkadeProgramScript = class extends chunk7TXSPRN5_cjs.VtxoScript {
|
|
1963
1963
|
constructor(program, args, keys) {
|
|
1964
1964
|
const partial = compileFunctions(program, args, keys);
|
|
1965
1965
|
super(partial.map((p) => p.leafScript));
|
|
@@ -2172,7 +2172,7 @@ function pathsFor(script, context, opts) {
|
|
|
2172
2172
|
continue;
|
|
2173
2173
|
}
|
|
2174
2174
|
if (requiresServer) continue;
|
|
2175
|
-
const sequence = csv ? Number(
|
|
2175
|
+
const sequence = csv ? Number(chunk7TXSPRN5_cjs.timelockToSequence(csv)) : void 0;
|
|
2176
2176
|
if (opts.checkTimelocks && csv && !isCsvSpendable(context, sequence)) continue;
|
|
2177
2177
|
if (opts.checkTimelocks && cltv !== void 0 && !isCltvSatisfied(context, cltv)) {
|
|
2178
2178
|
continue;
|
|
@@ -2282,5 +2282,5 @@ exports.stringifyArtifact = stringifyArtifact;
|
|
|
2282
2282
|
exports.toASM = toASM;
|
|
2283
2283
|
exports.validateProgram = validateProgram;
|
|
2284
2284
|
exports.witnessRefToBytes = witnessRefToBytes;
|
|
2285
|
-
//# sourceMappingURL=chunk-
|
|
2286
|
-
//# sourceMappingURL=chunk-
|
|
2285
|
+
//# sourceMappingURL=chunk-5XMVTK5S.cjs.map
|
|
2286
|
+
//# sourceMappingURL=chunk-5XMVTK5S.cjs.map
|