@arkade-os/sdk 0.5.0-rc.3 → 0.5.0-rc.5
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 +12 -67
- package/dist/adapters/expo.cjs +5 -6
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +3 -4
- package/dist/{asyncStorageTaskQueue-DqGRG66E.d.cts → asyncStorageTaskQueue-AZkDlEZ0.d.cts} +1 -1
- package/dist/{asyncStorageTaskQueue-DAs_n1xr.d.ts → asyncStorageTaskQueue-BVcOhuOc.d.ts} +1 -1
- package/dist/{chunk-7W6FHWYN.js → chunk-3ZIEFYL3.js} +14 -38
- package/dist/chunk-3ZIEFYL3.js.map +1 -0
- package/dist/{chunk-UCSTNXB4.cjs → chunk-AEDYZK7T.cjs} +61 -85
- package/dist/chunk-AEDYZK7T.cjs.map +1 -0
- package/dist/{chunk-43XGA362.cjs → chunk-BUYG7QK3.cjs} +17 -17
- package/dist/{chunk-43XGA362.cjs.map → chunk-BUYG7QK3.cjs.map} +1 -1
- package/dist/{chunk-G4UPMCKW.js → chunk-FLPP5KNW.js} +4 -4
- package/dist/{chunk-G4UPMCKW.js.map → chunk-FLPP5KNW.js.map} +1 -1
- package/dist/{chunk-ERUAQGYF.js → chunk-FZ2BTDWY.js} +3 -4
- package/dist/chunk-FZ2BTDWY.js.map +1 -0
- package/dist/{chunk-FSF2PGTR.cjs → chunk-GQWHCQLD.cjs} +850 -1153
- package/dist/chunk-GQWHCQLD.cjs.map +1 -0
- package/dist/{chunk-L4HZK4KK.cjs → chunk-NEVMOIQL.cjs} +18 -19
- package/dist/chunk-NEVMOIQL.cjs.map +1 -0
- package/dist/{chunk-HSG2GQTM.js → chunk-NPG5FAOW.js} +24 -66
- package/dist/chunk-NPG5FAOW.js.map +1 -0
- package/dist/{chunk-BCT7DT2J.cjs → chunk-OMJIILNG.cjs} +10 -10
- package/dist/{chunk-BCT7DT2J.cjs.map → chunk-OMJIILNG.cjs.map} +1 -1
- package/dist/{chunk-VQCDDGRW.js → chunk-ORRKOSQK.js} +433 -728
- package/dist/chunk-ORRKOSQK.js.map +1 -0
- package/dist/{chunk-UJTYUYY4.cjs → chunk-QWWOD7M2.cjs} +25 -71
- package/dist/chunk-QWWOD7M2.cjs.map +1 -0
- package/dist/{chunk-ROD5H7RX.js → chunk-YFILTMLF.js} +4 -4
- package/dist/{chunk-ROD5H7RX.js.map → chunk-YFILTMLF.js.map} +1 -1
- package/dist/contracts/handlers/index.cjs +9 -10
- 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 -3
- package/dist/{delegate-CZzIduW4.d.cts → delegate-B5cd_m9h.d.cts} +1 -1
- package/dist/{delegate-B9Bmrns7.d.ts → delegate-BeAa3vil.d.ts} +1 -1
- package/dist/{hdWalletCapable-Cr5nGpK5.d.ts → hdWalletCapable-CqJnNn-i.d.ts} +6 -24
- package/dist/{hdWalletCapable-BIl3yLVM.d.cts → hdWalletCapable-DjjIw6-Q.d.cts} +6 -24
- package/dist/{index-Ci5MmNnK.d.cts → index-BNybgFmf.d.cts} +2 -2
- package/dist/{index-DQ1Hb2w_.d.ts → index-Cg8_sNpz.d.ts} +2 -2
- package/dist/{index-DnNIOqHS.d.cts → index-KCU4cxhL.d.cts} +118 -221
- package/dist/{index-DnNIOqHS.d.ts → index-KCU4cxhL.d.ts} +118 -221
- package/dist/index.cjs +295 -340
- package/dist/index.d.cts +93 -223
- package/dist/index.d.ts +93 -223
- package/dist/index.js +4 -5
- package/dist/repositories/realm/index.cjs +57 -24
- package/dist/repositories/realm/index.cjs.map +1 -1
- package/dist/repositories/realm/index.d.cts +12 -4
- package/dist/repositories/realm/index.d.ts +12 -4
- package/dist/repositories/realm/index.js +43 -10
- package/dist/repositories/realm/index.js.map +1 -1
- package/dist/repositories/sqlite/index.cjs +103 -33
- package/dist/repositories/sqlite/index.cjs.map +1 -1
- package/dist/repositories/sqlite/index.d.cts +12 -2
- package/dist/repositories/sqlite/index.d.ts +12 -2
- package/dist/repositories/sqlite/index.js +90 -20
- package/dist/repositories/sqlite/index.js.map +1 -1
- package/dist/{taskRunner-F7wNJcF3.d.ts → taskRunner-BywoLcvo.d.ts} +1 -1
- package/dist/{taskRunner-BDb5Ee2J.d.cts → taskRunner-CRetv4-8.d.cts} +1 -1
- package/dist/wallet/expo/background.cjs +14 -15
- package/dist/wallet/expo/background.cjs.map +1 -1
- 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 -7
- package/dist/wallet/expo/background.js.map +1 -1
- package/dist/wallet/expo/index.cjs +15 -23
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +4 -7
- package/dist/wallet/expo/index.d.ts +4 -7
- package/dist/wallet/expo/index.js +7 -15
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/worker/expo/index.cjs +9 -10
- package/dist/worker/expo/index.cjs.map +1 -1
- 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 -6
- package/dist/worker/expo/index.js.map +1 -1
- package/package.json +4 -42
- package/dist/adapters/asyncStorage.cjs +0 -48
- package/dist/adapters/asyncStorage.cjs.map +0 -1
- package/dist/adapters/asyncStorage.d.cts +0 -16
- package/dist/adapters/asyncStorage.d.ts +0 -16
- package/dist/adapters/asyncStorage.js +0 -46
- package/dist/adapters/asyncStorage.js.map +0 -1
- package/dist/adapters/fileSystem.cjs +0 -116
- package/dist/adapters/fileSystem.cjs.map +0 -1
- package/dist/adapters/fileSystem.d.cts +0 -17
- package/dist/adapters/fileSystem.d.ts +0 -17
- package/dist/adapters/fileSystem.js +0 -93
- package/dist/adapters/fileSystem.js.map +0 -1
- package/dist/adapters/indexedDB.cjs +0 -103
- package/dist/adapters/indexedDB.cjs.map +0 -1
- package/dist/adapters/indexedDB.d.cts +0 -18
- package/dist/adapters/indexedDB.d.ts +0 -18
- package/dist/adapters/indexedDB.js +0 -101
- package/dist/adapters/indexedDB.js.map +0 -1
- package/dist/adapters/localStorage.cjs +0 -50
- package/dist/adapters/localStorage.cjs.map +0 -1
- package/dist/adapters/localStorage.d.cts +0 -14
- package/dist/adapters/localStorage.d.ts +0 -14
- package/dist/adapters/localStorage.js +0 -48
- package/dist/adapters/localStorage.js.map +0 -1
- package/dist/chunk-5BLDMQED.cjs +0 -18
- package/dist/chunk-5BLDMQED.cjs.map +0 -1
- package/dist/chunk-7W6FHWYN.js.map +0 -1
- package/dist/chunk-ERUAQGYF.js.map +0 -1
- package/dist/chunk-FSF2PGTR.cjs.map +0 -1
- package/dist/chunk-HSG2GQTM.js.map +0 -1
- package/dist/chunk-L4HZK4KK.cjs.map +0 -1
- package/dist/chunk-NSBPE2FW.js +0 -15
- package/dist/chunk-NSBPE2FW.js.map +0 -1
- package/dist/chunk-UCSTNXB4.cjs.map +0 -1
- package/dist/chunk-UJTYUYY4.cjs.map +0 -1
- package/dist/chunk-VQCDDGRW.js.map +0 -1
- package/dist/index-C0IanN1m.d.cts +0 -11
- package/dist/index-C0IanN1m.d.ts +0 -11
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var chunk5BLDMQED_cjs = require('./chunk-5BLDMQED.cjs');
|
|
3
|
+
var chunkQWWOD7M2_cjs = require('./chunk-QWWOD7M2.cjs');
|
|
5
4
|
var base = require('@scure/base');
|
|
6
5
|
var descriptorsScure = require('@bitcoinerlab/descriptors-scure');
|
|
7
6
|
var btcSigner = require('@scure/btc-signer');
|
|
@@ -76,14 +75,14 @@ var ContractHandlerRegistry = class {
|
|
|
76
75
|
var contractHandlers = new ContractHandlerRegistry();
|
|
77
76
|
exports.DefaultVtxo = void 0;
|
|
78
77
|
((DefaultVtxo2) => {
|
|
79
|
-
class Script3 extends
|
|
78
|
+
class Script3 extends chunkQWWOD7M2_cjs.VtxoScript {
|
|
80
79
|
/** Create the default virtual output script with one forfeit path and one exit path. */
|
|
81
80
|
constructor(options) {
|
|
82
81
|
const { pubKey, serverPubKey, csvTimelock } = options;
|
|
83
|
-
const forfeitScript =
|
|
82
|
+
const forfeitScript = chunkQWWOD7M2_cjs.MultisigTapscript.encode({
|
|
84
83
|
pubkeys: [pubKey, serverPubKey]
|
|
85
84
|
}).script;
|
|
86
|
-
const exitScript =
|
|
85
|
+
const exitScript = chunkQWWOD7M2_cjs.CSVMultisigTapscript.encode({
|
|
87
86
|
timelock: csvTimelock,
|
|
88
87
|
pubkeys: [pubKey]
|
|
89
88
|
}).script;
|
|
@@ -268,27 +267,14 @@ function resolveRole(contract, context) {
|
|
|
268
267
|
}
|
|
269
268
|
return void 0;
|
|
270
269
|
};
|
|
271
|
-
if (context.walletDescriptor)
|
|
272
|
-
|
|
273
|
-
const matchedRole = matchRole(walletDescriptorKey);
|
|
274
|
-
if (matchedRole) {
|
|
275
|
-
return matchedRole;
|
|
276
|
-
}
|
|
277
|
-
if (!walletDescriptorKey && context.walletPubKey) {
|
|
278
|
-
return matchRole(extractRawPubKey(context.walletPubKey));
|
|
279
|
-
}
|
|
280
|
-
return void 0;
|
|
281
|
-
}
|
|
282
|
-
if (context.walletPubKey) {
|
|
283
|
-
return matchRole(extractRawPubKey(context.walletPubKey));
|
|
284
|
-
}
|
|
285
|
-
return void 0;
|
|
270
|
+
if (!context.walletDescriptor) return void 0;
|
|
271
|
+
return matchRole(extractRawPubKey(context.walletDescriptor));
|
|
286
272
|
}
|
|
287
273
|
function extractPubKeyBytes(value) {
|
|
288
274
|
return base.hex.decode(extractPubKey(normalizeToDescriptor(value)));
|
|
289
275
|
}
|
|
290
276
|
function deserializeCsvTimelock(value) {
|
|
291
|
-
return value !== void 0 && value !== "" ?
|
|
277
|
+
return value !== void 0 && value !== "" ? chunkQWWOD7M2_cjs.sequenceToTimelock(Number(value)) : exports.DefaultVtxo.Script.DEFAULT_TIMELOCK;
|
|
292
278
|
}
|
|
293
279
|
var CLTV_HEIGHT_THRESHOLD = 500000000n;
|
|
294
280
|
function isCltvSatisfied(context, locktime) {
|
|
@@ -330,7 +316,7 @@ function assertVhtlcSpendableNow(contract, context) {
|
|
|
330
316
|
function isCsvSpendable(context, sequence) {
|
|
331
317
|
if (sequence === void 0) return true;
|
|
332
318
|
if (!context.vtxo) return false;
|
|
333
|
-
const timelock =
|
|
319
|
+
const timelock = chunkQWWOD7M2_cjs.sequenceToTimelock(sequence);
|
|
334
320
|
if (timelock.type === "blocks") {
|
|
335
321
|
if (context.blockHeight === void 0 || context.vtxo.status.block_height === void 0) {
|
|
336
322
|
return false;
|
|
@@ -388,21 +374,21 @@ function forfeitExitSpendablePaths(script, contract, context) {
|
|
|
388
374
|
async function detectUsedScripts(indexerProvider, scriptHexes) {
|
|
389
375
|
const used = /* @__PURE__ */ new Set();
|
|
390
376
|
const unique = [...new Set(scriptHexes)];
|
|
391
|
-
for (let offset = 0; offset < unique.length; offset +=
|
|
392
|
-
const scripts = unique.slice(offset, offset +
|
|
377
|
+
for (let offset = 0; offset < unique.length; offset += chunkQWWOD7M2_cjs.SCRIPT_QUERY_CHUNK_SIZE) {
|
|
378
|
+
const scripts = unique.slice(offset, offset + chunkQWWOD7M2_cjs.SCRIPT_QUERY_CHUNK_SIZE);
|
|
393
379
|
const remaining = new Set(scripts);
|
|
394
380
|
let pageIndex = 0;
|
|
395
381
|
let hasMore = true;
|
|
396
382
|
while (hasMore && remaining.size > 0) {
|
|
397
|
-
const { vtxos, page } = await
|
|
383
|
+
const { vtxos, page } = await chunkQWWOD7M2_cjs.getNormalizedVtxos(indexerProvider, {
|
|
398
384
|
scripts,
|
|
399
385
|
pageIndex,
|
|
400
|
-
pageSize:
|
|
386
|
+
pageSize: chunkQWWOD7M2_cjs.DEFAULT_PAGE_SIZE
|
|
401
387
|
});
|
|
402
388
|
for (const vtxo of vtxos) {
|
|
403
389
|
if (remaining.delete(vtxo.script)) used.add(vtxo.script);
|
|
404
390
|
}
|
|
405
|
-
hasMore = page ? vtxos.length ===
|
|
391
|
+
hasMore = page ? vtxos.length === chunkQWWOD7M2_cjs.DEFAULT_PAGE_SIZE : false;
|
|
406
392
|
pageIndex++;
|
|
407
393
|
}
|
|
408
394
|
}
|
|
@@ -463,7 +449,7 @@ var DefaultContractHandler = {
|
|
|
463
449
|
return {
|
|
464
450
|
pubKey: base.hex.encode(params.pubKey),
|
|
465
451
|
serverPubKey: base.hex.encode(params.serverPubKey),
|
|
466
|
-
csvTimelock:
|
|
452
|
+
csvTimelock: chunkQWWOD7M2_cjs.timelockToSequence(params.csvTimelock).toString()
|
|
467
453
|
};
|
|
468
454
|
},
|
|
469
455
|
deserializeParams(params) {
|
|
@@ -498,7 +484,7 @@ function defaultCandidatesAt(_index, descriptor, deps) {
|
|
|
498
484
|
params: {
|
|
499
485
|
pubKey: base.hex.encode(c.pubKey),
|
|
500
486
|
serverPubKey: base.hex.encode(c.serverPubKey),
|
|
501
|
-
csvTimelock:
|
|
487
|
+
csvTimelock: chunkQWWOD7M2_cjs.timelockToSequence(c.csvTimelock).toString()
|
|
502
488
|
},
|
|
503
489
|
script: c.scriptHex,
|
|
504
490
|
address: c.script.address(deps.network.hrp, c.serverPubKey).encode()
|
|
@@ -514,12 +500,12 @@ function discoverDefaultRange(entries, deps) {
|
|
|
514
500
|
}
|
|
515
501
|
exports.DelegateVtxo = void 0;
|
|
516
502
|
((DelegateVtxo2) => {
|
|
517
|
-
class Script3 extends
|
|
503
|
+
class Script3 extends chunkQWWOD7M2_cjs.VtxoScript {
|
|
518
504
|
/** Create a delegated virtual output script with forfeit, exit, and delegate paths. */
|
|
519
505
|
constructor(options) {
|
|
520
506
|
const defaultVtxo = new exports.DefaultVtxo.Script(options);
|
|
521
507
|
const { delegatePubKey, pubKey, serverPubKey } = options;
|
|
522
|
-
const delegateScript =
|
|
508
|
+
const delegateScript = chunkQWWOD7M2_cjs.MultisigTapscript.encode({
|
|
523
509
|
pubkeys: [pubKey, delegatePubKey, serverPubKey]
|
|
524
510
|
}).script;
|
|
525
511
|
super([...defaultVtxo.scripts, delegateScript]);
|
|
@@ -558,7 +544,7 @@ var DelegateContractHandler = {
|
|
|
558
544
|
pubKey: base.hex.encode(params.pubKey),
|
|
559
545
|
serverPubKey: base.hex.encode(params.serverPubKey),
|
|
560
546
|
delegatePubKey: base.hex.encode(params.delegatePubKey),
|
|
561
|
-
csvTimelock:
|
|
547
|
+
csvTimelock: chunkQWWOD7M2_cjs.timelockToSequence(params.csvTimelock).toString()
|
|
562
548
|
};
|
|
563
549
|
},
|
|
564
550
|
deserializeParams(params) {
|
|
@@ -602,7 +588,7 @@ function delegateCandidatesAt(_index, descriptor, deps) {
|
|
|
602
588
|
pubKey: base.hex.encode(c.pubKey),
|
|
603
589
|
serverPubKey: base.hex.encode(c.serverPubKey),
|
|
604
590
|
delegatePubKey: base.hex.encode(delegatePubKey),
|
|
605
|
-
csvTimelock:
|
|
591
|
+
csvTimelock: chunkQWWOD7M2_cjs.timelockToSequence(c.csvTimelock).toString()
|
|
606
592
|
},
|
|
607
593
|
script: c.scriptHex,
|
|
608
594
|
address: c.script.address(deps.network.hrp, c.serverPubKey).encode()
|
|
@@ -1256,7 +1242,7 @@ function getOpcodeValue(name) {
|
|
|
1256
1242
|
|
|
1257
1243
|
// src/arkade/bignum.ts
|
|
1258
1244
|
var bignum_exports = {};
|
|
1259
|
-
|
|
1245
|
+
chunkQWWOD7M2_cjs.__export(bignum_exports, {
|
|
1260
1246
|
BIGNUM_MAX_BYTES: () => BIGNUM_MAX_BYTES,
|
|
1261
1247
|
decode: () => decode,
|
|
1262
1248
|
encode: () => encode
|
|
@@ -1445,7 +1431,7 @@ function computeArkadeScriptPublicKey(pubKey, script) {
|
|
|
1445
1431
|
// src/script/vhtlc.ts
|
|
1446
1432
|
exports.VHTLC = void 0;
|
|
1447
1433
|
((VHTLC2) => {
|
|
1448
|
-
class BaseScript extends
|
|
1434
|
+
class BaseScript extends chunkQWWOD7M2_cjs.VtxoScript {
|
|
1449
1435
|
options;
|
|
1450
1436
|
claimScript;
|
|
1451
1437
|
refundScript;
|
|
@@ -1472,27 +1458,27 @@ exports.VHTLC = void 0;
|
|
|
1472
1458
|
unilateralRefundWithoutReceiverDelay
|
|
1473
1459
|
} = options;
|
|
1474
1460
|
const conditionScript = preimageCondition(preimageHash);
|
|
1475
|
-
const claimScript =
|
|
1461
|
+
const claimScript = chunkQWWOD7M2_cjs.ConditionMultisigTapscript.encode({
|
|
1476
1462
|
conditionScript,
|
|
1477
1463
|
pubkeys: [receiver, server]
|
|
1478
1464
|
}).script;
|
|
1479
|
-
const refundScript =
|
|
1465
|
+
const refundScript = chunkQWWOD7M2_cjs.MultisigTapscript.encode({
|
|
1480
1466
|
pubkeys: [sender, receiver, server]
|
|
1481
1467
|
}).script;
|
|
1482
|
-
const refundWithoutReceiverScript =
|
|
1468
|
+
const refundWithoutReceiverScript = chunkQWWOD7M2_cjs.CLTVMultisigTapscript.encode({
|
|
1483
1469
|
absoluteTimelock: refundLocktime,
|
|
1484
1470
|
pubkeys: [sender, server]
|
|
1485
1471
|
}).script;
|
|
1486
|
-
const unilateralClaimScript =
|
|
1472
|
+
const unilateralClaimScript = chunkQWWOD7M2_cjs.ConditionCSVMultisigTapscript.encode({
|
|
1487
1473
|
conditionScript,
|
|
1488
1474
|
timelock: unilateralClaimDelay,
|
|
1489
1475
|
pubkeys: [receiver]
|
|
1490
1476
|
}).script;
|
|
1491
|
-
const unilateralRefundScript =
|
|
1477
|
+
const unilateralRefundScript = chunkQWWOD7M2_cjs.CSVMultisigTapscript.encode({
|
|
1492
1478
|
timelock: unilateralRefundDelay,
|
|
1493
1479
|
pubkeys: [sender, receiver]
|
|
1494
1480
|
}).script;
|
|
1495
|
-
const unilateralRefundWithoutReceiverScript =
|
|
1481
|
+
const unilateralRefundWithoutReceiverScript = chunkQWWOD7M2_cjs.CSVMultisigTapscript.encode({
|
|
1496
1482
|
timelock: unilateralRefundWithoutReceiverDelay,
|
|
1497
1483
|
pubkeys: [sender]
|
|
1498
1484
|
}).script;
|
|
@@ -1512,7 +1498,7 @@ exports.VHTLC = void 0;
|
|
|
1512
1498
|
const covenants = options.nonInteractiveParameters;
|
|
1513
1499
|
if (covenants) {
|
|
1514
1500
|
arkadeScriptNic = enforcePayToMaybeAsset(covenants.receiverPkScript, options.asset);
|
|
1515
|
-
nonInteractiveClaimScript =
|
|
1501
|
+
nonInteractiveClaimScript = chunkQWWOD7M2_cjs.ConditionMultisigTapscript.encode({
|
|
1516
1502
|
conditionScript,
|
|
1517
1503
|
pubkeys: [
|
|
1518
1504
|
server,
|
|
@@ -1525,12 +1511,12 @@ exports.VHTLC = void 0;
|
|
|
1525
1511
|
covenants.emulatorPubkey,
|
|
1526
1512
|
arkadeScriptNir
|
|
1527
1513
|
);
|
|
1528
|
-
nonInteractiveRefundScript =
|
|
1514
|
+
nonInteractiveRefundScript = chunkQWWOD7M2_cjs.MultisigTapscript.encode({
|
|
1529
1515
|
pubkeys: [server, receiver, nirCosigner]
|
|
1530
1516
|
}).script;
|
|
1531
1517
|
scripts.push(nonInteractiveRefundScript);
|
|
1532
1518
|
if (covenants.legacy !== "preTimelockedRefund") {
|
|
1533
|
-
nonInteractiveRefundWithoutReceiverScript =
|
|
1519
|
+
nonInteractiveRefundWithoutReceiverScript = chunkQWWOD7M2_cjs.CLTVMultisigTapscript.encode({
|
|
1534
1520
|
absoluteTimelock: refundLocktime,
|
|
1535
1521
|
pubkeys: [server, nirCosigner]
|
|
1536
1522
|
}).script;
|
|
@@ -1844,9 +1830,9 @@ var VHTLCContractHandler = {
|
|
|
1844
1830
|
server: base.hex.encode(params.server),
|
|
1845
1831
|
hash: base.hex.encode(params.preimageHash),
|
|
1846
1832
|
refundLocktime: params.refundLocktime.toString(),
|
|
1847
|
-
claimDelay:
|
|
1848
|
-
refundDelay:
|
|
1849
|
-
refundNoReceiverDelay:
|
|
1833
|
+
claimDelay: chunkQWWOD7M2_cjs.timelockToSequence(params.unilateralClaimDelay).toString(),
|
|
1834
|
+
refundDelay: chunkQWWOD7M2_cjs.timelockToSequence(params.unilateralRefundDelay).toString(),
|
|
1835
|
+
refundNoReceiverDelay: chunkQWWOD7M2_cjs.timelockToSequence(
|
|
1850
1836
|
params.unilateralRefundWithoutReceiverDelay
|
|
1851
1837
|
).toString()
|
|
1852
1838
|
};
|
|
@@ -1858,9 +1844,9 @@ var VHTLCContractHandler = {
|
|
|
1858
1844
|
server: base.hex.decode(params.server),
|
|
1859
1845
|
preimageHash: base.hex.decode(params.hash),
|
|
1860
1846
|
refundLocktime: BigInt(params.refundLocktime),
|
|
1861
|
-
unilateralClaimDelay:
|
|
1862
|
-
unilateralRefundDelay:
|
|
1863
|
-
unilateralRefundWithoutReceiverDelay:
|
|
1847
|
+
unilateralClaimDelay: chunkQWWOD7M2_cjs.sequenceToTimelock(Number(params.claimDelay)),
|
|
1848
|
+
unilateralRefundDelay: chunkQWWOD7M2_cjs.sequenceToTimelock(Number(params.refundDelay)),
|
|
1849
|
+
unilateralRefundWithoutReceiverDelay: chunkQWWOD7M2_cjs.sequenceToTimelock(
|
|
1864
1850
|
Number(params.refundNoReceiverDelay)
|
|
1865
1851
|
)
|
|
1866
1852
|
};
|
|
@@ -1869,7 +1855,7 @@ var VHTLCContractHandler = {
|
|
|
1869
1855
|
* Select spending path based on context.
|
|
1870
1856
|
*
|
|
1871
1857
|
* Role is determined from `context.role` or by matching
|
|
1872
|
-
* `context.walletDescriptor`
|
|
1858
|
+
* `context.walletDescriptor`
|
|
1873
1859
|
* against sender/receiver in contract params.
|
|
1874
1860
|
*/
|
|
1875
1861
|
selectPath(script, contract, context) {
|
|
@@ -1916,7 +1902,7 @@ var VHTLCContractHandler = {
|
|
|
1916
1902
|
* Get all possible spending paths (no timelock checks).
|
|
1917
1903
|
*
|
|
1918
1904
|
* Role is determined from `context.role` or by matching
|
|
1919
|
-
* `context.walletDescriptor`
|
|
1905
|
+
* `context.walletDescriptor`
|
|
1920
1906
|
* against sender/receiver in contract params.
|
|
1921
1907
|
*/
|
|
1922
1908
|
getAllSpendingPaths(script, contract, context) {
|
|
@@ -2106,9 +2092,9 @@ var VHTLCV2ContractHandler = {
|
|
|
2106
2092
|
server: base.hex.encode(params.server),
|
|
2107
2093
|
hash: base.hex.encode(params.preimageHash),
|
|
2108
2094
|
refundLocktime: params.refundLocktime.toString(),
|
|
2109
|
-
claimDelay:
|
|
2110
|
-
refundDelay:
|
|
2111
|
-
refundNoReceiverDelay:
|
|
2095
|
+
claimDelay: chunkQWWOD7M2_cjs.timelockToSequence(params.unilateralClaimDelay).toString(),
|
|
2096
|
+
refundDelay: chunkQWWOD7M2_cjs.timelockToSequence(params.unilateralRefundDelay).toString(),
|
|
2097
|
+
refundNoReceiverDelay: chunkQWWOD7M2_cjs.timelockToSequence(
|
|
2112
2098
|
params.unilateralRefundWithoutReceiverDelay
|
|
2113
2099
|
).toString(),
|
|
2114
2100
|
// The on-disk keys keep their per-leaf names even though the typed
|
|
@@ -2208,9 +2194,9 @@ var VHTLCV2ContractHandler = {
|
|
|
2208
2194
|
preimageHash: base.hex.decode(params.hash),
|
|
2209
2195
|
refundLocktime: BigInt(params.refundLocktime),
|
|
2210
2196
|
...asset && { asset },
|
|
2211
|
-
unilateralClaimDelay:
|
|
2212
|
-
unilateralRefundDelay:
|
|
2213
|
-
unilateralRefundWithoutReceiverDelay:
|
|
2197
|
+
unilateralClaimDelay: chunkQWWOD7M2_cjs.sequenceToTimelock(Number(params.claimDelay)),
|
|
2198
|
+
unilateralRefundDelay: chunkQWWOD7M2_cjs.sequenceToTimelock(Number(params.refundDelay)),
|
|
2199
|
+
unilateralRefundWithoutReceiverDelay: chunkQWWOD7M2_cjs.sequenceToTimelock(
|
|
2214
2200
|
Number(params.refundNoReceiverDelay)
|
|
2215
2201
|
),
|
|
2216
2202
|
...claim && refund && {
|
|
@@ -2231,7 +2217,7 @@ var VHTLCV2ContractHandler = {
|
|
|
2231
2217
|
* Select spending path based on context.
|
|
2232
2218
|
*
|
|
2233
2219
|
* Role is determined from `context.role` or by matching
|
|
2234
|
-
* `context.walletDescriptor`
|
|
2220
|
+
* `context.walletDescriptor`
|
|
2235
2221
|
* against sender/receiver in contract params.
|
|
2236
2222
|
*/
|
|
2237
2223
|
selectPath(script, contract, context) {
|
|
@@ -2278,7 +2264,7 @@ var VHTLCV2ContractHandler = {
|
|
|
2278
2264
|
* Get all possible spending paths (no timelock checks).
|
|
2279
2265
|
*
|
|
2280
2266
|
* Role is determined from `context.role` or by matching
|
|
2281
|
-
* `context.walletDescriptor`
|
|
2267
|
+
* `context.walletDescriptor`
|
|
2282
2268
|
* against sender/receiver in contract params.
|
|
2283
2269
|
*/
|
|
2284
2270
|
getAllSpendingPaths(script, contract, context) {
|
|
@@ -2482,7 +2468,7 @@ var BoardingContractHandler = {
|
|
|
2482
2468
|
const coins = await deps.onchainProvider.getCoins(onchainAddress);
|
|
2483
2469
|
if (coins.length === 0) return [];
|
|
2484
2470
|
const scriptHex = base.hex.encode(script.pkScript);
|
|
2485
|
-
const boardingSeq =
|
|
2471
|
+
const boardingSeq = chunkQWWOD7M2_cjs.timelockToSequence(deps.boardingTimelock);
|
|
2486
2472
|
return [
|
|
2487
2473
|
{
|
|
2488
2474
|
type: "boarding",
|
|
@@ -2643,27 +2629,27 @@ function encodeTapscriptSegment(seg, pubkeys, args) {
|
|
|
2643
2629
|
if (seg.csv) {
|
|
2644
2630
|
const timelock = { type: seg.csv.type, value: resolveTimelockValue(seg.csv.value, args) };
|
|
2645
2631
|
if (seg.asm) {
|
|
2646
|
-
return
|
|
2632
|
+
return chunkQWWOD7M2_cjs.ConditionCSVMultisigTapscript.encode({
|
|
2647
2633
|
conditionScript: resolveAsm(seg.asm, args),
|
|
2648
2634
|
timelock,
|
|
2649
2635
|
pubkeys
|
|
2650
2636
|
});
|
|
2651
2637
|
}
|
|
2652
|
-
return
|
|
2638
|
+
return chunkQWWOD7M2_cjs.CSVMultisigTapscript.encode({ timelock, pubkeys });
|
|
2653
2639
|
}
|
|
2654
2640
|
if (seg.cltv !== void 0) {
|
|
2655
|
-
return
|
|
2641
|
+
return chunkQWWOD7M2_cjs.CLTVMultisigTapscript.encode({
|
|
2656
2642
|
absoluteTimelock: resolveTimelockValue(seg.cltv, args),
|
|
2657
2643
|
pubkeys
|
|
2658
2644
|
});
|
|
2659
2645
|
}
|
|
2660
2646
|
if (seg.asm) {
|
|
2661
|
-
return
|
|
2647
|
+
return chunkQWWOD7M2_cjs.ConditionMultisigTapscript.encode({
|
|
2662
2648
|
conditionScript: resolveAsm(seg.asm, args),
|
|
2663
2649
|
pubkeys
|
|
2664
2650
|
});
|
|
2665
2651
|
}
|
|
2666
|
-
return
|
|
2652
|
+
return chunkQWWOD7M2_cjs.MultisigTapscript.encode({ pubkeys });
|
|
2667
2653
|
}
|
|
2668
2654
|
function compileFunctions(program, args, keys) {
|
|
2669
2655
|
if (program.version !== SUPPORTED_PROGRAM_VERSION) {
|
|
@@ -2693,7 +2679,7 @@ function compileFunctions(program, args, keys) {
|
|
|
2693
2679
|
return { name: names[i], def, leafScript, arkadeScript, signerKeys: pubkeys };
|
|
2694
2680
|
});
|
|
2695
2681
|
}
|
|
2696
|
-
var ArkadeProgramScript = class extends
|
|
2682
|
+
var ArkadeProgramScript = class extends chunkQWWOD7M2_cjs.VtxoScript {
|
|
2697
2683
|
constructor(program, args, keys) {
|
|
2698
2684
|
const partial = compileFunctions(program, args, keys);
|
|
2699
2685
|
super(partial.map((p) => p.leafScript));
|
|
@@ -2852,22 +2838,12 @@ function deserializeArkadeContractParams(params) {
|
|
|
2852
2838
|
|
|
2853
2839
|
// src/contracts/handlers/arkade.ts
|
|
2854
2840
|
function walletKeyFrom(context) {
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
return void 0;
|
|
2861
|
-
}
|
|
2862
|
-
};
|
|
2863
|
-
if (context.walletDescriptor) {
|
|
2864
|
-
const key = extract(context.walletDescriptor);
|
|
2865
|
-
if (key) return key;
|
|
2866
|
-
}
|
|
2867
|
-
if (context.walletPubKey) {
|
|
2868
|
-
return extract(context.walletPubKey);
|
|
2841
|
+
if (!context.walletDescriptor) return void 0;
|
|
2842
|
+
try {
|
|
2843
|
+
return extractPubKey(context.walletDescriptor).toLowerCase();
|
|
2844
|
+
} catch {
|
|
2845
|
+
return void 0;
|
|
2869
2846
|
}
|
|
2870
|
-
return void 0;
|
|
2871
2847
|
}
|
|
2872
2848
|
function staticWitness(fn, script) {
|
|
2873
2849
|
const refs = fn.def.tapscript.witness ?? [];
|
|
@@ -2906,7 +2882,7 @@ function pathsFor(script, context, opts) {
|
|
|
2906
2882
|
continue;
|
|
2907
2883
|
}
|
|
2908
2884
|
if (requiresServer) continue;
|
|
2909
|
-
const sequence = csv ? Number(
|
|
2885
|
+
const sequence = csv ? Number(chunkQWWOD7M2_cjs.timelockToSequence(csv)) : void 0;
|
|
2910
2886
|
if (opts.checkTimelocks && csv && !isCsvSpendable(context, sequence)) continue;
|
|
2911
2887
|
if (opts.checkTimelocks && cltv !== void 0 && !isCltvSatisfied(context, cltv)) {
|
|
2912
2888
|
continue;
|
|
@@ -3035,5 +3011,5 @@ exports.toASM = toASM;
|
|
|
3035
3011
|
exports.toXOnly = toXOnly;
|
|
3036
3012
|
exports.validateProgram = validateProgram;
|
|
3037
3013
|
exports.witnessRefToBytes = witnessRefToBytes;
|
|
3038
|
-
//# sourceMappingURL=chunk-
|
|
3039
|
-
//# sourceMappingURL=chunk-
|
|
3014
|
+
//# sourceMappingURL=chunk-AEDYZK7T.cjs.map
|
|
3015
|
+
//# sourceMappingURL=chunk-AEDYZK7T.cjs.map
|