@arkade-os/boltz-swap 0.3.43 → 0.3.44
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/{arkade-swaps-LvsGHtre.d.ts → arkade-swaps-2q3VSgb4.d.ts} +27 -1
- package/dist/{arkade-swaps-C3sUFr5f.d.cts → arkade-swaps-DwgfLCMY.d.cts} +27 -1
- package/dist/{chunk-CWY37W4B.js → chunk-PHF6C2NE.js} +1 -1
- package/dist/{chunk-UXYHW7KV.js → chunk-QVXFEX5F.js} +184 -158
- package/dist/expo/background.cjs +184 -158
- package/dist/expo/background.js +2 -2
- package/dist/expo/index.cjs +184 -158
- package/dist/expo/index.d.cts +1 -1
- package/dist/expo/index.d.ts +1 -1
- package/dist/expo/index.js +2 -2
- package/dist/index.cjs +185 -159
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -95,7 +95,7 @@ __export(index_exports, {
|
|
|
95
95
|
module.exports = __toCommonJS(index_exports);
|
|
96
96
|
|
|
97
97
|
// package.json
|
|
98
|
-
var version = "0.3.
|
|
98
|
+
var version = "0.3.44";
|
|
99
99
|
|
|
100
100
|
// src/errors.ts
|
|
101
101
|
var SwapError = class extends Error {
|
|
@@ -3186,6 +3186,40 @@ var claimVHTLCwithOffchainTx = async (identity, vhtlcScript, serverXOnlyPublicKe
|
|
|
3186
3186
|
await arkProvider.finalizeTx(arkTxid, finalCheckpoints);
|
|
3187
3187
|
return arkTxid;
|
|
3188
3188
|
};
|
|
3189
|
+
var refundWithoutReceiverVHTLCwithOffchainTx = async (identity, vhtlcScript, serverXOnlyPublicKey, input, output, arkInfo, arkProvider) => {
|
|
3190
|
+
const rawCheckpointTapscript = import_base8.hex.decode(arkInfo.checkpointTapscript);
|
|
3191
|
+
const serverUnrollScript = import_sdk7.CSVMultisigTapscript.decode(rawCheckpointTapscript);
|
|
3192
|
+
const { arkTx, checkpoints } = (0, import_sdk7.buildOffchainTx)([input], [output], serverUnrollScript);
|
|
3193
|
+
const signedArkTx = await identity.sign(arkTx);
|
|
3194
|
+
const { arkTxid, finalArkTx, signedCheckpointTxs } = await arkProvider.submitTx(
|
|
3195
|
+
import_base8.base64.encode(signedArkTx.toPSBT()),
|
|
3196
|
+
checkpoints.map((c) => import_base8.base64.encode(c.toPSBT()))
|
|
3197
|
+
);
|
|
3198
|
+
const finalTx = import_sdk7.Transaction.fromPSBT(import_base8.base64.decode(finalArkTx));
|
|
3199
|
+
const serverPubkeyHex = import_base8.hex.encode(serverXOnlyPublicKey);
|
|
3200
|
+
const refundLeafHash = (0, import_payment3.tapLeafHash)(
|
|
3201
|
+
scriptFromTapLeafScript(vhtlcScript.refundWithoutReceiver())
|
|
3202
|
+
);
|
|
3203
|
+
for (let i = 0; i < finalTx.inputsLength; i++) {
|
|
3204
|
+
if (!verifySignatures(finalTx, i, [serverPubkeyHex], refundLeafHash)) {
|
|
3205
|
+
throw new Error("Invalid final Ark transaction");
|
|
3206
|
+
}
|
|
3207
|
+
}
|
|
3208
|
+
const finalCheckpoints = await Promise.all(
|
|
3209
|
+
signedCheckpointTxs.map(async (c, idx) => {
|
|
3210
|
+
const tx = import_sdk7.Transaction.fromPSBT(import_base8.base64.decode(c));
|
|
3211
|
+
const checkpointLeaf = checkpoints[idx].getInput(0).tapLeafScript[0];
|
|
3212
|
+
const cpLeafHash = (0, import_payment3.tapLeafHash)(scriptFromTapLeafScript(checkpointLeaf));
|
|
3213
|
+
if (!verifySignatures(tx, 0, [serverPubkeyHex], cpLeafHash)) {
|
|
3214
|
+
throw new Error("Invalid server signature in checkpoint transaction");
|
|
3215
|
+
}
|
|
3216
|
+
const signedCheckpoint = await identity.sign(tx, [0]);
|
|
3217
|
+
return import_base8.base64.encode(signedCheckpoint.toPSBT());
|
|
3218
|
+
})
|
|
3219
|
+
);
|
|
3220
|
+
await arkProvider.finalizeTx(arkTxid, finalCheckpoints);
|
|
3221
|
+
return arkTxid;
|
|
3222
|
+
};
|
|
3189
3223
|
var refundVHTLCwithOffchainTx = async (swapId, identity, arkProvider, boltzXOnlyPublicKey, ourXOnlyPublicKey, serverXOnlyPublicKey, input, output, arkInfo, refundFunc) => {
|
|
3190
3224
|
const rawCheckpointTapscript = import_base8.hex.decode(arkInfo.checkpointTapscript);
|
|
3191
3225
|
const serverUnrollScript = import_sdk7.CSVMultisigTapscript.decode(rawCheckpointTapscript);
|
|
@@ -3940,85 +3974,22 @@ var ArkadeSwaps = class _ArkadeSwaps {
|
|
|
3940
3974
|
}
|
|
3941
3975
|
const outputScript = import_sdk8.ArkAddress.decode(address).pkScript;
|
|
3942
3976
|
const refundWithoutReceiverLeaf = vhtlcScript.refundWithoutReceiver();
|
|
3943
|
-
const
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
await this.joinBatch(
|
|
3960
|
-
this.wallet.identity,
|
|
3961
|
-
input2,
|
|
3962
|
-
output,
|
|
3963
|
-
arkInfo,
|
|
3964
|
-
isRecoverableVtxo
|
|
3965
|
-
);
|
|
3966
|
-
sweptCount++;
|
|
3967
|
-
continue;
|
|
3968
|
-
}
|
|
3969
|
-
if (isRecoverableVtxo) {
|
|
3970
|
-
logger.error(
|
|
3971
|
-
`Swap ${pendingSwap.id}: recoverable VTXO ${vtxo.txid}:${vtxo.vout} cannot be refunded yet \u2014 refundWithoutReceiver locktime has not passed (refundLocktime=${vhtlcTimeouts.refund}, currentTimestamp=${Math.floor(Date.now() / 1e3)}). Refund will be retried after locktime.`
|
|
3972
|
-
);
|
|
3973
|
-
skippedCount++;
|
|
3974
|
-
continue;
|
|
3975
|
-
}
|
|
3976
|
-
const input = {
|
|
3977
|
-
...vtxo,
|
|
3978
|
-
tapLeafScript: vhtlcScript.refund(),
|
|
3979
|
-
tapTree: vhtlcScript.encode()
|
|
3980
|
-
};
|
|
3981
|
-
try {
|
|
3982
|
-
if (boltzCallCount > 0) {
|
|
3983
|
-
await new Promise((r) => setTimeout(r, 2e3));
|
|
3984
|
-
}
|
|
3985
|
-
boltzCallCount++;
|
|
3986
|
-
await refundVHTLCwithOffchainTx(
|
|
3987
|
-
pendingSwap.id,
|
|
3988
|
-
this.wallet.identity,
|
|
3989
|
-
this.arkProvider,
|
|
3990
|
-
boltzXOnlyPublicKey,
|
|
3991
|
-
ourXOnlyPublicKey,
|
|
3992
|
-
serverXOnlyPublicKey,
|
|
3993
|
-
input,
|
|
3994
|
-
output,
|
|
3995
|
-
arkInfo,
|
|
3996
|
-
this.swapProvider.refundSubmarineSwap.bind(this.swapProvider)
|
|
3997
|
-
);
|
|
3998
|
-
sweptCount++;
|
|
3999
|
-
} catch (error) {
|
|
4000
|
-
if (!(error instanceof BoltzRefundError)) {
|
|
4001
|
-
throw error;
|
|
4002
|
-
}
|
|
4003
|
-
if (!isSubmarineRefundLocktimeReached(vhtlcTimeouts.refund)) {
|
|
4004
|
-
logger.error(
|
|
4005
|
-
`Swap ${pendingSwap.id}: Boltz rejected VTXO outpoint and refundWithoutReceiver locktime has not passed yet (currentTimestamp=${Math.floor(Date.now() / 1e3)}, locktime=${vhtlcTimeouts.refund}). Refund will be retried after locktime.`
|
|
4006
|
-
);
|
|
4007
|
-
skippedCount++;
|
|
4008
|
-
continue;
|
|
4009
|
-
}
|
|
4010
|
-
logger.warn(
|
|
4011
|
-
`Swap ${pendingSwap.id}: Boltz rejected VTXO outpoint, falling back to refundWithoutReceiver via joinBatch`
|
|
4012
|
-
);
|
|
4013
|
-
const fallbackInput = {
|
|
4014
|
-
...vtxo,
|
|
4015
|
-
tapLeafScript: refundWithoutReceiverLeaf,
|
|
4016
|
-
tapTree: vhtlcScript.encode()
|
|
4017
|
-
};
|
|
4018
|
-
await this.joinBatch(this.wallet.identity, fallbackInput, output, arkInfo, false);
|
|
4019
|
-
sweptCount++;
|
|
4020
|
-
}
|
|
4021
|
-
}
|
|
3977
|
+
const refundContext = {
|
|
3978
|
+
arkInfo,
|
|
3979
|
+
vhtlcScript,
|
|
3980
|
+
serverXOnlyPublicKey,
|
|
3981
|
+
refundWithoutReceiverLeaf,
|
|
3982
|
+
outputScript
|
|
3983
|
+
};
|
|
3984
|
+
const { swept: sweptCount, skipped: skippedCount } = await this.refundVtxos({
|
|
3985
|
+
swapId: pendingSwap.id,
|
|
3986
|
+
vtxos: refundableVtxos,
|
|
3987
|
+
refundLocktime: vhtlcTimeouts.refund,
|
|
3988
|
+
refundContext,
|
|
3989
|
+
boltzXOnlyPublicKey,
|
|
3990
|
+
ourXOnlyPublicKey,
|
|
3991
|
+
refundViaBoltz: this.swapProvider.refundSubmarineSwap.bind(this.swapProvider)
|
|
3992
|
+
});
|
|
4022
3993
|
if (!isSubmarineSuccessStatus(pendingSwap.status)) {
|
|
4023
3994
|
const fullyRefunded = skippedCount === 0;
|
|
4024
3995
|
await updateSubmarineSwapStatus(
|
|
@@ -4576,7 +4547,10 @@ var ArkadeSwaps = class _ArkadeSwaps {
|
|
|
4576
4547
|
* swap's ARK lockup address.
|
|
4577
4548
|
*
|
|
4578
4549
|
* Path selection per VTXO:
|
|
4579
|
-
* - CLTV
|
|
4550
|
+
* - CLTV elapsed, live VTXO → `refundWithoutReceiver` offchain (sender +
|
|
4551
|
+
* server, no Boltz, no batch round).
|
|
4552
|
+
* - CLTV elapsed, swept VTXO → `refundWithoutReceiver` via `joinBatch`
|
|
4553
|
+
* (a swept VTXO is no longer a live leaf).
|
|
4580
4554
|
* - Pre-CLTV recoverable → skipped (Boltz can't co-sign swept-batch refund).
|
|
4581
4555
|
* - Pre-CLTV non-recoverable → cooperative 3-of-3 refund via Boltz.
|
|
4582
4556
|
*
|
|
@@ -4633,84 +4607,22 @@ var ArkadeSwaps = class _ArkadeSwaps {
|
|
|
4633
4607
|
const outputScript = import_sdk8.ArkAddress.decode(address).pkScript;
|
|
4634
4608
|
const refundWithoutReceiverLeaf = vhtlcScript.refundWithoutReceiver();
|
|
4635
4609
|
const refundLocktime = pendingSwap.response.lockupDetails.timeouts.refund;
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
this.wallet.identity,
|
|
4653
|
-
input2,
|
|
4654
|
-
output,
|
|
4655
|
-
arkInfo,
|
|
4656
|
-
isRecoverableVtxo
|
|
4657
|
-
);
|
|
4658
|
-
sweptCount++;
|
|
4659
|
-
continue;
|
|
4660
|
-
}
|
|
4661
|
-
if (isRecoverableVtxo) {
|
|
4662
|
-
logger.error(
|
|
4663
|
-
`Swap ${pendingSwap.id}: recoverable VTXO ${vtxo.txid}:${vtxo.vout} cannot be refunded yet \u2014 refundWithoutReceiver locktime has not passed (refundLocktime=${refundLocktime}, currentTimestamp=${Math.floor(Date.now() / 1e3)}). Refund will be retried after locktime.`
|
|
4664
|
-
);
|
|
4665
|
-
skippedCount++;
|
|
4666
|
-
continue;
|
|
4667
|
-
}
|
|
4668
|
-
const input = {
|
|
4669
|
-
...vtxo,
|
|
4670
|
-
tapLeafScript: vhtlcScript.refund(),
|
|
4671
|
-
tapTree: vhtlcScript.encode()
|
|
4672
|
-
};
|
|
4673
|
-
try {
|
|
4674
|
-
if (boltzCallCount > 0) {
|
|
4675
|
-
await new Promise((r) => setTimeout(r, 2e3));
|
|
4676
|
-
}
|
|
4677
|
-
boltzCallCount++;
|
|
4678
|
-
await refundVHTLCwithOffchainTx(
|
|
4679
|
-
pendingSwap.id,
|
|
4680
|
-
this.wallet.identity,
|
|
4681
|
-
this.arkProvider,
|
|
4682
|
-
boltzXOnlyPublicKey,
|
|
4683
|
-
ourXOnlyPublicKey,
|
|
4684
|
-
serverXOnlyPublicKey,
|
|
4685
|
-
input,
|
|
4686
|
-
output,
|
|
4687
|
-
arkInfo,
|
|
4688
|
-
this.swapProvider.refundChainSwap.bind(this.swapProvider)
|
|
4689
|
-
);
|
|
4690
|
-
sweptCount++;
|
|
4691
|
-
} catch (error) {
|
|
4692
|
-
if (!(error instanceof BoltzRefundError)) {
|
|
4693
|
-
throw error;
|
|
4694
|
-
}
|
|
4695
|
-
if (!isSubmarineRefundLocktimeReached(refundLocktime)) {
|
|
4696
|
-
logger.error(
|
|
4697
|
-
`Swap ${pendingSwap.id}: Boltz rejected VTXO outpoint and refundWithoutReceiver locktime has not passed yet (currentTimestamp=${Math.floor(Date.now() / 1e3)}, locktime=${refundLocktime}). Refund will be retried after locktime.`
|
|
4698
|
-
);
|
|
4699
|
-
skippedCount++;
|
|
4700
|
-
continue;
|
|
4701
|
-
}
|
|
4702
|
-
logger.warn(
|
|
4703
|
-
`Swap ${pendingSwap.id}: Boltz rejected VTXO outpoint, falling back to refundWithoutReceiver via joinBatch`
|
|
4704
|
-
);
|
|
4705
|
-
const fallbackInput = {
|
|
4706
|
-
...vtxo,
|
|
4707
|
-
tapLeafScript: refundWithoutReceiverLeaf,
|
|
4708
|
-
tapTree: vhtlcScript.encode()
|
|
4709
|
-
};
|
|
4710
|
-
await this.joinBatch(this.wallet.identity, fallbackInput, output, arkInfo, false);
|
|
4711
|
-
sweptCount++;
|
|
4712
|
-
}
|
|
4713
|
-
}
|
|
4610
|
+
const refundContext = {
|
|
4611
|
+
arkInfo,
|
|
4612
|
+
vhtlcScript,
|
|
4613
|
+
serverXOnlyPublicKey,
|
|
4614
|
+
refundWithoutReceiverLeaf,
|
|
4615
|
+
outputScript
|
|
4616
|
+
};
|
|
4617
|
+
const { swept: sweptCount, skipped: skippedCount } = await this.refundVtxos({
|
|
4618
|
+
swapId: pendingSwap.id,
|
|
4619
|
+
vtxos: unspentVtxos,
|
|
4620
|
+
refundLocktime,
|
|
4621
|
+
refundContext,
|
|
4622
|
+
boltzXOnlyPublicKey,
|
|
4623
|
+
ourXOnlyPublicKey,
|
|
4624
|
+
refundViaBoltz: this.swapProvider.refundChainSwap.bind(this.swapProvider)
|
|
4625
|
+
});
|
|
4714
4626
|
const finalStatus = await this.getSwapStatus(pendingSwap.id);
|
|
4715
4627
|
await this.savePendingChainSwap({
|
|
4716
4628
|
...pendingSwap,
|
|
@@ -5243,6 +5155,120 @@ var ArkadeSwaps = class _ArkadeSwaps {
|
|
|
5243
5155
|
async joinBatch(identity, input, output, arkInfo, isRecoverable2 = true) {
|
|
5244
5156
|
return joinBatch(this.arkProvider, identity, input, output, arkInfo, isRecoverable2);
|
|
5245
5157
|
}
|
|
5158
|
+
/**
|
|
5159
|
+
* Settle a `refundWithoutReceiver` (sender + server, no Boltz) refund for a
|
|
5160
|
+
* single VTXO whose CLTV refund locktime has elapsed.
|
|
5161
|
+
*
|
|
5162
|
+
* A live VTXO settles the leaf with an offchain Ark tx — no batch round. A
|
|
5163
|
+
* swept (recoverable) VTXO is no longer a live leaf, so it can only be
|
|
5164
|
+
* reclaimed by re-registering it into a batch.
|
|
5165
|
+
*/
|
|
5166
|
+
async settleRefundWithoutReceiver(ctx, vtxo) {
|
|
5167
|
+
const input = {
|
|
5168
|
+
...vtxo,
|
|
5169
|
+
tapLeafScript: ctx.refundWithoutReceiverLeaf,
|
|
5170
|
+
tapTree: ctx.vhtlcScript.encode()
|
|
5171
|
+
};
|
|
5172
|
+
const output = { amount: BigInt(vtxo.value), script: ctx.outputScript };
|
|
5173
|
+
if ((0, import_sdk8.isRecoverable)(vtxo)) {
|
|
5174
|
+
await this.joinBatch(this.wallet.identity, input, output, ctx.arkInfo, true);
|
|
5175
|
+
} else {
|
|
5176
|
+
await refundWithoutReceiverVHTLCwithOffchainTx(
|
|
5177
|
+
this.wallet.identity,
|
|
5178
|
+
ctx.vhtlcScript,
|
|
5179
|
+
ctx.serverXOnlyPublicKey,
|
|
5180
|
+
input,
|
|
5181
|
+
output,
|
|
5182
|
+
ctx.arkInfo,
|
|
5183
|
+
this.arkProvider
|
|
5184
|
+
);
|
|
5185
|
+
}
|
|
5186
|
+
}
|
|
5187
|
+
/**
|
|
5188
|
+
* Refund every VTXO at a swap's VHTLC address back to the wallet, shared by
|
|
5189
|
+
* {@link ArkadeSwaps.refundVHTLC} (submarine) and {@link ArkadeSwaps.refundArk}
|
|
5190
|
+
* (chain). Path selection per VTXO:
|
|
5191
|
+
* - CLTV elapsed → `refundWithoutReceiver` (offchain for a live VTXO, via a
|
|
5192
|
+
* batch round for a swept one — see {@link settleRefundWithoutReceiver}).
|
|
5193
|
+
* - Pre-CLTV recoverable → skipped (Boltz can't co-sign a swept-batch refund).
|
|
5194
|
+
* - Pre-CLTV non-recoverable → cooperative 3-of-3 refund via Boltz, falling
|
|
5195
|
+
* back to `refundWithoutReceiver` offchain if Boltz rejects after the
|
|
5196
|
+
* locktime has since elapsed.
|
|
5197
|
+
*
|
|
5198
|
+
* @returns Counts of VTXOs swept vs. deferred.
|
|
5199
|
+
*/
|
|
5200
|
+
async refundVtxos(params) {
|
|
5201
|
+
const {
|
|
5202
|
+
swapId,
|
|
5203
|
+
vtxos,
|
|
5204
|
+
refundLocktime,
|
|
5205
|
+
refundContext,
|
|
5206
|
+
boltzXOnlyPublicKey,
|
|
5207
|
+
ourXOnlyPublicKey,
|
|
5208
|
+
refundViaBoltz
|
|
5209
|
+
} = params;
|
|
5210
|
+
const { vhtlcScript, serverXOnlyPublicKey, arkInfo, outputScript } = refundContext;
|
|
5211
|
+
let boltzCallCount = 0;
|
|
5212
|
+
let sweptCount = 0;
|
|
5213
|
+
let skippedCount = 0;
|
|
5214
|
+
for (const vtxo of vtxos) {
|
|
5215
|
+
const isRecoverableVtxo = (0, import_sdk8.isRecoverable)(vtxo);
|
|
5216
|
+
const output = { amount: BigInt(vtxo.value), script: outputScript };
|
|
5217
|
+
if (isSubmarineRefundLocktimeReached(refundLocktime)) {
|
|
5218
|
+
await this.settleRefundWithoutReceiver(refundContext, vtxo);
|
|
5219
|
+
sweptCount++;
|
|
5220
|
+
continue;
|
|
5221
|
+
}
|
|
5222
|
+
if (isRecoverableVtxo) {
|
|
5223
|
+
logger.error(
|
|
5224
|
+
`Swap ${swapId}: recoverable VTXO ${vtxo.txid}:${vtxo.vout} cannot be refunded yet \u2014 refundWithoutReceiver locktime has not passed (refundLocktime=${refundLocktime}, currentTimestamp=${Math.floor(Date.now() / 1e3)}). Refund will be retried after locktime.`
|
|
5225
|
+
);
|
|
5226
|
+
skippedCount++;
|
|
5227
|
+
continue;
|
|
5228
|
+
}
|
|
5229
|
+
const input = {
|
|
5230
|
+
...vtxo,
|
|
5231
|
+
tapLeafScript: vhtlcScript.refund(),
|
|
5232
|
+
tapTree: vhtlcScript.encode()
|
|
5233
|
+
};
|
|
5234
|
+
try {
|
|
5235
|
+
if (boltzCallCount > 0) {
|
|
5236
|
+
await new Promise((r) => setTimeout(r, 2e3));
|
|
5237
|
+
}
|
|
5238
|
+
boltzCallCount++;
|
|
5239
|
+
await refundVHTLCwithOffchainTx(
|
|
5240
|
+
swapId,
|
|
5241
|
+
this.wallet.identity,
|
|
5242
|
+
this.arkProvider,
|
|
5243
|
+
boltzXOnlyPublicKey,
|
|
5244
|
+
ourXOnlyPublicKey,
|
|
5245
|
+
serverXOnlyPublicKey,
|
|
5246
|
+
input,
|
|
5247
|
+
output,
|
|
5248
|
+
arkInfo,
|
|
5249
|
+
refundViaBoltz
|
|
5250
|
+
);
|
|
5251
|
+
sweptCount++;
|
|
5252
|
+
} catch (error) {
|
|
5253
|
+
if (!(error instanceof BoltzRefundError)) {
|
|
5254
|
+
throw error;
|
|
5255
|
+
}
|
|
5256
|
+
if (!isSubmarineRefundLocktimeReached(refundLocktime)) {
|
|
5257
|
+
logger.error(
|
|
5258
|
+
`Swap ${swapId}: Boltz rejected VTXO outpoint and refundWithoutReceiver locktime has not passed yet (currentTimestamp=${Math.floor(Date.now() / 1e3)}, locktime=${refundLocktime}). Refund will be retried after locktime.`
|
|
5259
|
+
);
|
|
5260
|
+
skippedCount++;
|
|
5261
|
+
continue;
|
|
5262
|
+
}
|
|
5263
|
+
logger.warn(
|
|
5264
|
+
`Swap ${swapId}: Boltz rejected VTXO outpoint, falling back to refundWithoutReceiver offchain`
|
|
5265
|
+
);
|
|
5266
|
+
await this.settleRefundWithoutReceiver(refundContext, vtxo);
|
|
5267
|
+
sweptCount++;
|
|
5268
|
+
}
|
|
5269
|
+
}
|
|
5270
|
+
return { swept: sweptCount, skipped: skippedCount };
|
|
5271
|
+
}
|
|
5246
5272
|
/**
|
|
5247
5273
|
* Creates a VHTLC script for the swap.
|
|
5248
5274
|
* Works for submarine, reverse, and chain swaps.
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Q as QuoteSwapOptions, I as IArkadeSwaps, V as VhtlcTimeouts } from './arkade-swaps-
|
|
2
|
-
export { A as ArkadeSwaps } from './arkade-swaps-
|
|
1
|
+
import { Q as QuoteSwapOptions, I as IArkadeSwaps, V as VhtlcTimeouts } from './arkade-swaps-DwgfLCMY.cjs';
|
|
2
|
+
export { A as ArkadeSwaps } from './arkade-swaps-DwgfLCMY.cjs';
|
|
3
3
|
import { B as BoltzSwap, D as DecodedInvoice, a as BoltzChainSwap, b as BoltzReverseSwap, c as BoltzSubmarineSwap, A as ArkadeSwapsConfig, N as Network, C as CreateLightningInvoiceRequest, S as SendLightningPaymentRequest, F as FeesResponse, d as Chain, e as CreateLightningInvoiceResponse, O as OptimisticSendLightningPaymentResponse, f as SubmarineRefundOutcome, g as SubmarineRecoveryInfo, h as SubmarineRecoveryResult, i as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, j as ArkToBtcResponse, k as BtcToArkResponse, l as ChainArkRefundOutcome, m as SwapRepository, n as SwapManagerClient, o as SendLightningPaymentResponse, p as GetSwapsFilter } from './types-8NrCdOpS.cjs';
|
|
4
4
|
export { q as ArkadeSwapsCreateConfig, r as BoltzSwapProvider, s as BoltzSwapStatus, I as IncomingPaymentSubscription, P as PendingChainSwap, t as PendingReverseSwap, u as PendingSubmarineSwap, v as PendingSwap, w as SubmarineProgressionStatus, x as SubmarineRecoveryStatus, y as SwapManager, z as SwapManagerCallbacks, E as SwapManagerConfig, H as SwapManagerEvents, V as Vtxo, J as hasSubmarineStatusReached, K as isChainClaimableStatus, M as isChainFailedStatus, Q as isChainFinalStatus, R as isChainPendingStatus, T as isChainRefundableStatus, U as isChainSignableStatus, W as isChainSuccessStatus, X as isChainSwapClaimable, Y as isChainSwapRefundable, Z as isPendingChainSwap, _ as isPendingReverseSwap, $ as isPendingSubmarineSwap, a0 as isReverseClaimableStatus, a1 as isReverseFailedStatus, a2 as isReverseFinalStatus, a3 as isReversePendingStatus, a4 as isReverseSuccessStatus, a5 as isReverseSwapClaimable, a6 as isSubmarineFailedStatus, a7 as isSubmarineFinalStatus, a8 as isSubmarinePendingStatus, a9 as isSubmarineRefundableStatus, aa as isSubmarineSuccessStatus, ab as isSubmarineSwapRefundable } from './types-8NrCdOpS.cjs';
|
|
5
5
|
import { Transaction } from '@scure/btc-signer';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Q as QuoteSwapOptions, I as IArkadeSwaps, V as VhtlcTimeouts } from './arkade-swaps-
|
|
2
|
-
export { A as ArkadeSwaps } from './arkade-swaps-
|
|
1
|
+
import { Q as QuoteSwapOptions, I as IArkadeSwaps, V as VhtlcTimeouts } from './arkade-swaps-2q3VSgb4.js';
|
|
2
|
+
export { A as ArkadeSwaps } from './arkade-swaps-2q3VSgb4.js';
|
|
3
3
|
import { B as BoltzSwap, D as DecodedInvoice, a as BoltzChainSwap, b as BoltzReverseSwap, c as BoltzSubmarineSwap, A as ArkadeSwapsConfig, N as Network, C as CreateLightningInvoiceRequest, S as SendLightningPaymentRequest, F as FeesResponse, d as Chain, e as CreateLightningInvoiceResponse, O as OptimisticSendLightningPaymentResponse, f as SubmarineRefundOutcome, g as SubmarineRecoveryInfo, h as SubmarineRecoveryResult, i as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, j as ArkToBtcResponse, k as BtcToArkResponse, l as ChainArkRefundOutcome, m as SwapRepository, n as SwapManagerClient, o as SendLightningPaymentResponse, p as GetSwapsFilter } from './types-8NrCdOpS.js';
|
|
4
4
|
export { q as ArkadeSwapsCreateConfig, r as BoltzSwapProvider, s as BoltzSwapStatus, I as IncomingPaymentSubscription, P as PendingChainSwap, t as PendingReverseSwap, u as PendingSubmarineSwap, v as PendingSwap, w as SubmarineProgressionStatus, x as SubmarineRecoveryStatus, y as SwapManager, z as SwapManagerCallbacks, E as SwapManagerConfig, H as SwapManagerEvents, V as Vtxo, J as hasSubmarineStatusReached, K as isChainClaimableStatus, M as isChainFailedStatus, Q as isChainFinalStatus, R as isChainPendingStatus, T as isChainRefundableStatus, U as isChainSignableStatus, W as isChainSuccessStatus, X as isChainSwapClaimable, Y as isChainSwapRefundable, Z as isPendingChainSwap, _ as isPendingReverseSwap, $ as isPendingSubmarineSwap, a0 as isReverseClaimableStatus, a1 as isReverseFailedStatus, a2 as isReverseFinalStatus, a3 as isReversePendingStatus, a4 as isReverseSuccessStatus, a5 as isReverseSwapClaimable, a6 as isSubmarineFailedStatus, a7 as isSubmarineFinalStatus, a8 as isSubmarinePendingStatus, a9 as isSubmarineRefundableStatus, aa as isSubmarineSuccessStatus, ab as isSubmarineSwapRefundable } from './types-8NrCdOpS.js';
|
|
5
5
|
import { Transaction } from '@scure/btc-signer';
|
package/dist/index.js
CHANGED
|
@@ -53,14 +53,14 @@ import {
|
|
|
53
53
|
updateReverseSwapStatus,
|
|
54
54
|
updateSubmarineSwapStatus,
|
|
55
55
|
verifySignatures
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-QVXFEX5F.js";
|
|
57
57
|
import {
|
|
58
58
|
applyCreatedAtOrder,
|
|
59
59
|
applySwapsFilter
|
|
60
60
|
} from "./chunk-SJQJQO7P.js";
|
|
61
61
|
|
|
62
62
|
// package.json
|
|
63
|
-
var version = "0.3.
|
|
63
|
+
var version = "0.3.44";
|
|
64
64
|
|
|
65
65
|
// src/serviceWorker/arkade-swaps-message-handler.ts
|
|
66
66
|
import { RestArkProvider, RestIndexerProvider } from "@arkade-os/sdk";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkade-os/boltz-swap",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.44",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A production-ready TypeScript package that brings Boltz submarine-swaps to Arkade.",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@scure/btc-signer": "2.0.1",
|
|
77
77
|
"bip68": "1.0.4",
|
|
78
78
|
"light-bolt11-decoder": "3.2.0",
|
|
79
|
-
"@arkade-os/sdk": "0.4.
|
|
79
|
+
"@arkade-os/sdk": "0.4.39"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"expo-task-manager": ">=3.0.0",
|