@arkade-os/sdk 0.4.72 → 0.4.74
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/{asyncStorageTaskQueue-s5lUGWxu.d.cts → asyncStorageTaskQueue-D1AwLuqn.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-DhhNZc4v.d.ts → asyncStorageTaskQueue-aCaOBGTS.d.ts} +2 -2
- package/dist/{chunk-4C5PMGBB.cjs → chunk-AS3W34MG.cjs} +17 -17
- package/dist/{chunk-4C5PMGBB.cjs.map → chunk-AS3W34MG.cjs.map} +1 -1
- package/dist/{chunk-NPM5YZBC.cjs → chunk-DXLVCFVK.cjs} +49 -49
- package/dist/{chunk-NPM5YZBC.cjs.map → chunk-DXLVCFVK.cjs.map} +1 -1
- package/dist/{chunk-S5PUFSXC.js → chunk-J3XVGWMP.js} +21 -22
- package/dist/chunk-J3XVGWMP.js.map +1 -0
- package/dist/{chunk-4BWZ437E.cjs → chunk-J4ZR4VEM.cjs} +31 -32
- package/dist/chunk-J4ZR4VEM.cjs.map +1 -0
- package/dist/{chunk-6FTHFJAN.cjs → chunk-KMPNH7NS.cjs} +8 -4
- package/dist/chunk-KMPNH7NS.cjs.map +1 -0
- package/dist/{chunk-CZPBPMO2.js → chunk-KPLQN4M4.js} +4 -4
- package/dist/{chunk-CZPBPMO2.js.map → chunk-KPLQN4M4.js.map} +1 -1
- package/dist/{chunk-CB6QPAO5.js → chunk-LGB65ZCO.js} +3 -3
- package/dist/{chunk-CB6QPAO5.js.map → chunk-LGB65ZCO.js.map} +1 -1
- package/dist/{chunk-KDMHEWTD.cjs → chunk-QS6AZE4F.cjs} +10 -10
- package/dist/{chunk-KDMHEWTD.cjs.map → chunk-QS6AZE4F.cjs.map} +1 -1
- package/dist/{chunk-U5I3ITV7.cjs → chunk-WIHSU3YS.cjs} +708 -497
- package/dist/chunk-WIHSU3YS.cjs.map +1 -0
- package/dist/{chunk-5GQFYVWP.js → chunk-WJVOFYTQ.js} +8 -4
- package/dist/chunk-WJVOFYTQ.js.map +1 -0
- package/dist/{chunk-IGER5FPC.js → chunk-X5BPARRD.js} +3 -3
- package/dist/{chunk-IGER5FPC.js.map → chunk-X5BPARRD.js.map} +1 -1
- package/dist/{chunk-BHLYB44A.js → chunk-ZTGTQP2W.js} +272 -63
- package/dist/chunk-ZTGTQP2W.js.map +1 -0
- package/dist/contracts/handlers/index.cjs +9 -9
- 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-BJp8f6LT.d.cts → delegate-6N0DKdnG.d.cts} +1 -1
- package/dist/{delegate-Ckz_TWzM.d.ts → delegate-z6veQfLI.d.ts} +1 -1
- package/dist/{hdWalletCapable-DABgAD-T.d.ts → hdWalletCapable-Bncp-eF0.d.ts} +2 -2
- package/dist/{hdWalletCapable-DA9bJ5eB.d.cts → hdWalletCapable-DJT8E8sN.d.cts} +2 -2
- package/dist/{index-DSbDm0Io.d.cts → index-BVqlZJwW.d.cts} +2 -2
- package/dist/{index-Dg0-TvBQ.d.ts → index-Bxz3cKPA.d.cts} +13 -7
- package/dist/{index-Dg0-TvBQ.d.cts → index-Bxz3cKPA.d.ts} +13 -7
- package/dist/{index-B8xrELXY.d.ts → index-CKQQ1oOg.d.ts} +2 -2
- package/dist/index.cjs +308 -300
- package/dist/index.d.cts +50 -24
- package/dist/index.d.ts +50 -24
- 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-BH_FxaNI.d.cts → taskRunner-C26IIg1F.d.cts} +2 -2
- package/dist/{taskRunner-DrVz2QZs.d.ts → taskRunner-KxtIKYLv.d.ts} +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.d.cts +4 -4
- package/dist/wallet/expo/index.d.ts +4 -4
- package/dist/wallet/expo/index.js +5 -5
- 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-4BWZ437E.cjs.map +0 -1
- package/dist/chunk-5GQFYVWP.js.map +0 -1
- package/dist/chunk-6FTHFJAN.cjs.map +0 -1
- package/dist/chunk-BHLYB44A.js.map +0 -1
- package/dist/chunk-S5PUFSXC.js.map +0 -1
- package/dist/chunk-U5I3ITV7.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AssetId, AssetGroup, AssetInput, AssetOutput, Metadata, Packet, BufferReader, BufferWriter, AssetRef, RestIndexerProvider } from './chunk-
|
|
2
|
-
import { witnessRefToBytes, validateProgram, toASM, stringifyArtifact, serializeArkadeContractParams, resolveAsm, parseArtifact, getOpcodeValue, getOpcodeName, fromASM, deserializeArkadeContractParams, computeArkadeScriptPublicKey, bytesToASM, asmToBytes, arkadeWitnessHash, arkadeScriptHash, SUPPORTED_PROGRAM_VERSION, OPCODE_VALUES, OPCODE_NAMES, bignum_exports, ArkadeScript, ArkadeProgramScript, ARKADE_OPS, ARKADE_OPCODE_VALUES, ARKADE_OPCODE_NAMES, ARKADE_OPCODES, ARKADE_OP, toXOnly, inputName, contractHandlers, isMainnetDescriptor, descriptorIsOurs, deriveDescriptorLeafPubKey, deriveDescriptorLeafCompressedPubKey, parseHDDescriptor, identityDescriptor, DefaultVtxo, speculativeReceiveMetadata, DelegateVtxo, WALLET_RECEIVE_SOURCE, BoardingContractHandler } from './chunk-
|
|
3
|
-
import { VtxoScript, Transaction, isRecoverable, CSVMultisigTapscript, DEFAULT_NETWORK, resolveEmulatorPubkey, hasTerminalSpend, getNormalizedVtxos, setArkPsbtField, PrevArkTxField, ConditionWitness, craftToSpendTx, ArkAddress, isVirtualCoin, getArkPsbtFields, CosignerPublicKey, ServerResponseMismatchError, OP_RETURN_EMPTY_PKSCRIPT, canSweepOnchain, sequenceToTimelock, decodeTapscript, scriptFromTapLeafScript, CLTVMultisigTapscript, VtxoTaprootTree, timelockToSequence, assertAllowedSighashTypes, baseFetch, Intent, rateGate, DEFAULT_NETWORK_NAME, formatSighash, normalizeVtxo, getSequence, toBatchExpiry, maybeArkError, isArkError, ArkErrorName, toOffchainInputFeeParams, canRecoverOnchain, getNetwork, MultisigTapscript, isEventSourceError, isEventSourceUnavailableError, getAllNormalizedVtxos, isPastExpiry, isRetryableProviderError, DEFAULT_PAGE_SIZE, RestArkProvider, toVirtualStatus, ArkError, TapTreeCoder, resolveTimeHeight, canSpendOffchain, parseLegacyExpiry, isExpired, PrevoutTxField, fetchVtxoCreatedAtByTxid, DEFAULT_ARKADE_SERVER_URL, ProviderUnavailableError, networks as networks$1 } from './chunk-
|
|
1
|
+
import { AssetId, AssetGroup, AssetInput, AssetOutput, Metadata, Packet, BufferReader, BufferWriter, AssetRef, RestIndexerProvider } from './chunk-X5BPARRD.js';
|
|
2
|
+
import { witnessRefToBytes, validateProgram, toASM, stringifyArtifact, serializeArkadeContractParams, resolveAsm, parseArtifact, getOpcodeValue, getOpcodeName, fromASM, deserializeArkadeContractParams, computeArkadeScriptPublicKey, bytesToASM, asmToBytes, arkadeWitnessHash, arkadeScriptHash, SUPPORTED_PROGRAM_VERSION, OPCODE_VALUES, OPCODE_NAMES, bignum_exports, ArkadeScript, ArkadeProgramScript, ARKADE_OPS, ARKADE_OPCODE_VALUES, ARKADE_OPCODE_NAMES, ARKADE_OPCODES, ARKADE_OP, toXOnly, inputName, contractHandlers, isMainnetDescriptor, descriptorIsOurs, deriveDescriptorLeafPubKey, deriveDescriptorLeafCompressedPubKey, parseHDDescriptor, identityDescriptor, DefaultVtxo, speculativeReceiveMetadata, DelegateVtxo, WALLET_RECEIVE_SOURCE, BoardingContractHandler } from './chunk-LGB65ZCO.js';
|
|
3
|
+
import { VtxoScript, Transaction, isRecoverable, CSVMultisigTapscript, DEFAULT_NETWORK, resolveEmulatorPubkey, hasTerminalSpend, getNormalizedVtxos, setArkPsbtField, PrevArkTxField, ConditionWitness, craftToSpendTx, ArkAddress, isVirtualCoin, getArkPsbtFields, CosignerPublicKey, ServerResponseMismatchError, OP_RETURN_EMPTY_PKSCRIPT, canSweepOnchain, sequenceToTimelock, decodeTapscript, scriptFromTapLeafScript, CLTVMultisigTapscript, VtxoTaprootTree, timelockToSequence, assertAllowedSighashTypes, baseFetch, Intent, rateGate, DEFAULT_NETWORK_NAME, formatSighash, normalizeVtxo, getSequence, toBatchExpiry, maybeArkError, isArkError, ArkErrorName, toOffchainInputFeeParams, canRecoverOnchain, getNetwork, MultisigTapscript, isEventSourceError, isEventSourceUnavailableError, getAllNormalizedVtxos, isPastExpiry, isRetryableProviderError, DEFAULT_PAGE_SIZE, RestArkProvider, toVirtualStatus, ArkError, TapTreeCoder, resolveTimeHeight, canSpendOffchain, parseLegacyExpiry, isExpired, PrevoutTxField, fetchVtxoCreatedAtByTxid, DEFAULT_ARKADE_SERVER_URL, ProviderUnavailableError, networks as networks$1 } from './chunk-WJVOFYTQ.js';
|
|
4
4
|
import { __export } from './chunk-NSBPE2FW.js';
|
|
5
5
|
import { sha256 as sha256$1, equalBytes, hash160, sha256x2, concatBytes, randomPrivateKeyBytes, pubECDSA, pubSchnorr } from '@scure/btc-signer/utils.js';
|
|
6
6
|
import { SigHash, Script, OP, OutScript, Address, RawWitness, p2tr, p2wpkh, TaprootControlBlock, DEFAULT_SEQUENCE, Transaction as Transaction$2 } from '@scure/btc-signer';
|
|
@@ -2698,6 +2698,12 @@ var ErrOnchainOutputNotFound = (address) => new ServerResponseMismatchError(`onc
|
|
|
2698
2698
|
var ErrUnvalidatedOffchainOutput = (address) => new ServerResponseMismatchError(
|
|
2699
2699
|
`offchain output ${address} cannot be validated: virtual output tree signing did not run`
|
|
2700
2700
|
);
|
|
2701
|
+
var ErrIntentOutputNotFound = (index, kind) => new ServerResponseMismatchError(
|
|
2702
|
+
`${kind} output ${index} of the intent proof is not present in what the server built`
|
|
2703
|
+
);
|
|
2704
|
+
var ErrUnvalidatedIntentOutput = (index) => new ServerResponseMismatchError(
|
|
2705
|
+
`offchain output ${index} of the intent proof cannot be validated: virtual output tree signing did not run`
|
|
2706
|
+
);
|
|
2701
2707
|
var ErrInvalidOnchainOutputAmount = (address) => new Error(`invalid onchain output amount: ${address}`);
|
|
2702
2708
|
var ErrInvalidOnchainOutputAssets = (address) => new Error(`onchain output ${address} cannot have assets`);
|
|
2703
2709
|
var ErrInvalidOffchainOutputAmount = (address) => new Error(`invalid offchain output ${address}, missing amount`);
|
|
@@ -2734,6 +2740,74 @@ function validateBatchRecipientsWithoutTree(commitmentTx, recipients, network) {
|
|
|
2734
2740
|
throw ErrUnvalidatedOffchainOutput(recipient.address);
|
|
2735
2741
|
}
|
|
2736
2742
|
}
|
|
2743
|
+
function declaredIntentOutputs(signedProof, onchainOutputIndexes) {
|
|
2744
|
+
const proof = Transaction.fromPSBT(base64.decode(signedProof));
|
|
2745
|
+
const onchain = new Set(onchainOutputIndexes);
|
|
2746
|
+
const declared = [];
|
|
2747
|
+
for (let i = 0; i < proof.outputsLength; i++) {
|
|
2748
|
+
const output = proof.getOutput(i);
|
|
2749
|
+
if (!output?.script || output.script.length === 0 || !output.amount) continue;
|
|
2750
|
+
declared.push({
|
|
2751
|
+
index: i,
|
|
2752
|
+
script: output.script,
|
|
2753
|
+
amount: output.amount,
|
|
2754
|
+
onchain: onchain.has(i)
|
|
2755
|
+
});
|
|
2756
|
+
}
|
|
2757
|
+
return declared;
|
|
2758
|
+
}
|
|
2759
|
+
function validateBatchAgainstIntent(commitmentTx, vtxoTreeLeaves, declared) {
|
|
2760
|
+
const usedOnchain = /* @__PURE__ */ new Set();
|
|
2761
|
+
const usedLeaf = /* @__PURE__ */ new Set();
|
|
2762
|
+
for (const output of declared) {
|
|
2763
|
+
if (output.onchain) {
|
|
2764
|
+
if (!takeOnchainOutput(commitmentTx, output, usedOnchain)) {
|
|
2765
|
+
throw ErrIntentOutputNotFound(output.index, "onchain");
|
|
2766
|
+
}
|
|
2767
|
+
continue;
|
|
2768
|
+
}
|
|
2769
|
+
if (!takeLeafOutput(vtxoTreeLeaves, output, usedLeaf)) {
|
|
2770
|
+
throw ErrIntentOutputNotFound(output.index, "offchain");
|
|
2771
|
+
}
|
|
2772
|
+
}
|
|
2773
|
+
}
|
|
2774
|
+
function validateBatchAgainstIntentWithoutTree(commitmentTx, declared) {
|
|
2775
|
+
const usedOnchain = /* @__PURE__ */ new Set();
|
|
2776
|
+
for (const output of declared) {
|
|
2777
|
+
if (!output.onchain) {
|
|
2778
|
+
throw ErrUnvalidatedIntentOutput(output.index);
|
|
2779
|
+
}
|
|
2780
|
+
if (!takeOnchainOutput(commitmentTx, output, usedOnchain)) {
|
|
2781
|
+
throw ErrIntentOutputNotFound(output.index, "onchain");
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
function takeOnchainOutput(commitmentTx, declared, used) {
|
|
2786
|
+
for (let i = 0; i < commitmentTx.outputsLength; i++) {
|
|
2787
|
+
if (used.has(i)) continue;
|
|
2788
|
+
const output = commitmentTx.getOutput(i);
|
|
2789
|
+
if (!output?.script || output.amount !== declared.amount) continue;
|
|
2790
|
+
if (!equalBytes(output.script, declared.script)) continue;
|
|
2791
|
+
used.add(i);
|
|
2792
|
+
return true;
|
|
2793
|
+
}
|
|
2794
|
+
return false;
|
|
2795
|
+
}
|
|
2796
|
+
function takeLeafOutput(leaves, declared, used) {
|
|
2797
|
+
for (let leafIdx = 0; leafIdx < leaves.length; leafIdx++) {
|
|
2798
|
+
const leaf = leaves[leafIdx];
|
|
2799
|
+
for (let i = 0; i < leaf.outputsLength; i++) {
|
|
2800
|
+
const key = `${leafIdx}:${i}`;
|
|
2801
|
+
if (used.has(key)) continue;
|
|
2802
|
+
const output = leaf.getOutput(i);
|
|
2803
|
+
if (!output?.script || output.amount !== declared.amount) continue;
|
|
2804
|
+
if (!equalBytes(output.script, declared.script)) continue;
|
|
2805
|
+
used.add(key);
|
|
2806
|
+
return true;
|
|
2807
|
+
}
|
|
2808
|
+
}
|
|
2809
|
+
return false;
|
|
2810
|
+
}
|
|
2737
2811
|
function validateOnchainRecipient(commitmentTx, recipient, network, usedOutputs) {
|
|
2738
2812
|
const addr = Address(network).decode(recipient.address);
|
|
2739
2813
|
const expectedPkScript = OutScript.encode(addr);
|
|
@@ -3496,21 +3570,38 @@ function assertSubmittedArkTxid(response, signedArkTx, context) {
|
|
|
3496
3570
|
);
|
|
3497
3571
|
}
|
|
3498
3572
|
}
|
|
3499
|
-
function assertServerSignedLeaf(serverTx, localTx, inputIndex,
|
|
3573
|
+
function assertServerSignedLeaf(serverTx, localTx, inputIndex, serverPubkeys, context) {
|
|
3500
3574
|
const leaf = localTx.getInput(inputIndex).tapLeafScript?.[0];
|
|
3501
3575
|
if (!leaf) {
|
|
3502
3576
|
throw new Error(
|
|
3503
3577
|
`${context}: input ${inputIndex} carries no spend leaf to verify the server signature against`
|
|
3504
3578
|
);
|
|
3505
3579
|
}
|
|
3580
|
+
const script = scriptFromTapLeafScript(leaf);
|
|
3581
|
+
let leafPubkeys;
|
|
3582
|
+
try {
|
|
3583
|
+
leafPubkeys = decodeTapscript(script).params.pubkeys.map(
|
|
3584
|
+
(key) => hex.encode(toXOnly(key, "leaf key"))
|
|
3585
|
+
);
|
|
3586
|
+
} catch (error) {
|
|
3587
|
+
throw new ServerResponseMismatchError(
|
|
3588
|
+
`${context}: input ${inputIndex} spend leaf cannot be decoded (${error instanceof Error ? error.message : String(error)})`
|
|
3589
|
+
);
|
|
3590
|
+
}
|
|
3591
|
+
const signer = leafPubkeys.find((key) => serverPubkeys.has(key));
|
|
3592
|
+
if (!signer) {
|
|
3593
|
+
throw new ServerResponseMismatchError(
|
|
3594
|
+
`${context}: input ${inputIndex} spend leaf names no signer key the server advertises`
|
|
3595
|
+
);
|
|
3596
|
+
}
|
|
3506
3597
|
try {
|
|
3507
3598
|
verifyTapscriptSignatures(
|
|
3508
3599
|
serverTx,
|
|
3509
3600
|
inputIndex,
|
|
3510
|
-
[
|
|
3601
|
+
[signer],
|
|
3511
3602
|
void 0,
|
|
3512
3603
|
void 0,
|
|
3513
|
-
tapLeafHash(
|
|
3604
|
+
tapLeafHash(script)
|
|
3514
3605
|
);
|
|
3515
3606
|
} catch (error) {
|
|
3516
3607
|
throw new ServerResponseMismatchError(
|
|
@@ -3584,24 +3675,22 @@ async function submitOffchainTx(provider, offchainTx, signer, hooks, options) {
|
|
|
3584
3675
|
);
|
|
3585
3676
|
}
|
|
3586
3677
|
const finalArkTx = Transaction.fromPSBT(base64.decode(response.finalArkTx));
|
|
3587
|
-
const
|
|
3678
|
+
const serverPubkeys = new Set(
|
|
3679
|
+
[verify.serverPubkey, ...verify.deprecatedServerPubkeys ?? []].map(
|
|
3680
|
+
(key) => hex.encode(toXOnly(key, "server key"))
|
|
3681
|
+
)
|
|
3682
|
+
);
|
|
3588
3683
|
for (let i = 0; i < offchainTx.arkTx.inputsLength; i++) {
|
|
3589
3684
|
assertServerSignedLeaf(
|
|
3590
3685
|
finalArkTx,
|
|
3591
3686
|
offchainTx.arkTx,
|
|
3592
3687
|
i,
|
|
3593
|
-
|
|
3688
|
+
serverPubkeys,
|
|
3594
3689
|
"submitTx ark tx"
|
|
3595
3690
|
);
|
|
3596
3691
|
}
|
|
3597
3692
|
matched.forEach(
|
|
3598
|
-
({ server, local }, index) => assertServerSignedLeaf(
|
|
3599
|
-
server,
|
|
3600
|
-
local,
|
|
3601
|
-
0,
|
|
3602
|
-
serverPubkeyHex,
|
|
3603
|
-
`submitTx checkpoint ${index}`
|
|
3604
|
-
)
|
|
3693
|
+
({ server, local }, index) => assertServerSignedLeaf(server, local, 0, serverPubkeys, `submitTx checkpoint ${index}`)
|
|
3605
3694
|
);
|
|
3606
3695
|
}
|
|
3607
3696
|
let finalCheckpoints;
|
|
@@ -7638,12 +7727,7 @@ async function delegate(identity, delegateProvider, arkInfo, delegateInfo, vtxos
|
|
|
7638
7727
|
if (!expiryTimestamp || expiryTimestamp === Number.MAX_SAFE_INTEGER) {
|
|
7639
7728
|
delegateAt = new Date(Date.now() + 1 * 60 * 1e3);
|
|
7640
7729
|
} else {
|
|
7641
|
-
|
|
7642
|
-
if (remainingTimeMs <= 0) {
|
|
7643
|
-
delegateAt = new Date(Date.now() + 1 * 60 * 1e3);
|
|
7644
|
-
} else {
|
|
7645
|
-
delegateAt = new Date(expiryTimestamp - remainingTimeMs * 0.1);
|
|
7646
|
-
}
|
|
7730
|
+
delegateAt = defaultDelegateAt(expiryTimestamp, arkInfo.sessionDuration);
|
|
7647
7731
|
}
|
|
7648
7732
|
}
|
|
7649
7733
|
const { fees, dust, forfeitAddress, network } = arkInfo;
|
|
@@ -7803,6 +7887,14 @@ async function makeSignedDelegateIntent(identity, coins, outputs, onchainOutputs
|
|
|
7803
7887
|
message
|
|
7804
7888
|
};
|
|
7805
7889
|
}
|
|
7890
|
+
function defaultDelegateAt(expiryTimestamp, sessionDurationSeconds, now = Date.now()) {
|
|
7891
|
+
const remainingTimeMs = expiryTimestamp - now;
|
|
7892
|
+
if (remainingTimeMs <= 0) return new Date(now + 6e4);
|
|
7893
|
+
const sessionLeadMs = Number(sessionDurationSeconds * 1000n);
|
|
7894
|
+
const leadTimeMs = Math.max(remainingTimeMs * 0.1, sessionLeadMs);
|
|
7895
|
+
const delegateAt = expiryTimestamp - leadTimeMs;
|
|
7896
|
+
return new Date(delegateAt > now ? delegateAt : now + 2e3);
|
|
7897
|
+
}
|
|
7806
7898
|
function findDestinationOutputIndex(outputs, destinationScript) {
|
|
7807
7899
|
return outputs.findIndex((o) => o.script && equalBytes(o.script, destinationScript));
|
|
7808
7900
|
}
|
|
@@ -8918,23 +9010,32 @@ var ContractWatcher = class {
|
|
|
8918
9010
|
}
|
|
8919
9011
|
/** @see IContractManager.watchScript for the delivery and filter contract. */
|
|
8920
9012
|
async addWatchedScript(script, options) {
|
|
8921
|
-
const
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
9013
|
+
const added = [];
|
|
9014
|
+
for (const one of Array.isArray(script) ? script : [script]) {
|
|
9015
|
+
const existing = this.watchedScripts.get(one);
|
|
9016
|
+
if (existing) {
|
|
9017
|
+
if (options?.label !== void 0) existing.label = options.label;
|
|
9018
|
+
continue;
|
|
9019
|
+
}
|
|
9020
|
+
this.watchedScripts.set(one, {
|
|
9021
|
+
label: options?.label,
|
|
9022
|
+
lastKnownVtxos: /* @__PURE__ */ new Map()
|
|
9023
|
+
});
|
|
9024
|
+
added.push(one);
|
|
8925
9025
|
}
|
|
8926
|
-
this.
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
});
|
|
8930
|
-
if (this.isWatching) {
|
|
8931
|
-
await this.pollWatchedScripts([script]);
|
|
9026
|
+
if (added.length === 0 || !this.isWatching) return;
|
|
9027
|
+
await this.withCoalescedSubscription(async () => {
|
|
9028
|
+
await this.pollWatchedScripts(added);
|
|
8932
9029
|
await this.tryUpdateSubscription();
|
|
8933
|
-
}
|
|
9030
|
+
});
|
|
8934
9031
|
}
|
|
8935
9032
|
/** Stop watching a script added by {@link addWatchedScript}. */
|
|
8936
9033
|
async removeWatchedScript(script) {
|
|
8937
|
-
|
|
9034
|
+
let removed = false;
|
|
9035
|
+
for (const one of Array.isArray(script) ? script : [script]) {
|
|
9036
|
+
if (this.watchedScripts.delete(one)) removed = true;
|
|
9037
|
+
}
|
|
9038
|
+
if (!removed) return;
|
|
8938
9039
|
if (this.isWatching) {
|
|
8939
9040
|
await this.tryUpdateSubscription();
|
|
8940
9041
|
}
|
|
@@ -15370,6 +15471,7 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
|
|
|
15370
15471
|
const connectorsLeaves = connectorsGraph?.leaves() || [];
|
|
15371
15472
|
for (const input of inputs) {
|
|
15372
15473
|
if (!isVirtualCoin(input)) {
|
|
15474
|
+
let matched = false;
|
|
15373
15475
|
for (let i = 0; i < settlementPsbt.inputsLength; i++) {
|
|
15374
15476
|
const settlementInput = settlementPsbt.getInput(i);
|
|
15375
15477
|
if (!settlementInput.txid || settlementInput.index === void 0) {
|
|
@@ -15396,8 +15498,14 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
|
|
|
15396
15498
|
throw new Error(await this.unsignableBoardingInputError(input, script));
|
|
15397
15499
|
}
|
|
15398
15500
|
hasBoardingUtxos = true;
|
|
15501
|
+
matched = true;
|
|
15399
15502
|
break;
|
|
15400
15503
|
}
|
|
15504
|
+
if (!matched && !(input instanceof ArkNote)) {
|
|
15505
|
+
throw new Error(
|
|
15506
|
+
`boarding input ${input.txid}:${input.vout} is not an input of the commitment tx`
|
|
15507
|
+
);
|
|
15508
|
+
}
|
|
15401
15509
|
continue;
|
|
15402
15510
|
}
|
|
15403
15511
|
if (canRecoverOnchain(input, { timestamp: /* @__PURE__ */ new Date() }) || isSubdust({ value: input.value }, this.dustAmount)) {
|
|
@@ -16538,18 +16646,33 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
|
|
|
16538
16646
|
this.inputSigningJobsFromWitnessUtxos(checkpoint)
|
|
16539
16647
|
)
|
|
16540
16648
|
};
|
|
16541
|
-
return submitOffchainTx(
|
|
16542
|
-
|
|
16543
|
-
|
|
16544
|
-
|
|
16545
|
-
|
|
16546
|
-
|
|
16547
|
-
|
|
16548
|
-
|
|
16549
|
-
|
|
16649
|
+
return submitOffchainTx(
|
|
16650
|
+
this.arkProvider,
|
|
16651
|
+
offchainTx,
|
|
16652
|
+
signer,
|
|
16653
|
+
{
|
|
16654
|
+
// Mark pending before submitting — if we crash between submit and
|
|
16655
|
+
// finalize, the next init recovers via finalizePendingTxs.
|
|
16656
|
+
beforeSubmit: () => this.setPendingTxFlag(true),
|
|
16657
|
+
afterFinalize: async () => {
|
|
16658
|
+
try {
|
|
16659
|
+
await this.setPendingTxFlag(false);
|
|
16660
|
+
} catch (error) {
|
|
16661
|
+
console.error("Failed to clear pending tx flag:", error);
|
|
16662
|
+
}
|
|
16663
|
+
}
|
|
16664
|
+
},
|
|
16665
|
+
{
|
|
16666
|
+
// Deprecated keys too: a vtxo built before a rotation is still
|
|
16667
|
+
// spent under the signer its leaf names.
|
|
16668
|
+
verifyServerSignatures: {
|
|
16669
|
+
serverPubkey: this._arkServerPublicKey,
|
|
16670
|
+
deprecatedServerPubkeys: [...this._deprecatedSigners.keys()].map(
|
|
16671
|
+
(h) => hex.decode(h)
|
|
16672
|
+
)
|
|
16550
16673
|
}
|
|
16551
16674
|
}
|
|
16552
|
-
|
|
16675
|
+
);
|
|
16553
16676
|
}
|
|
16554
16677
|
// mark virtual outputs as spent, save change outputs if any.
|
|
16555
16678
|
// `offchainTapscript` and `serverPubKey` are the epoch snapshot the
|
|
@@ -17492,6 +17615,23 @@ function offboardDestinationScript(destinationAddress) {
|
|
|
17492
17615
|
}
|
|
17493
17616
|
throw new Error(`Failed to decode destination address: ${destinationAddress}`);
|
|
17494
17617
|
}
|
|
17618
|
+
var CHANGE_FEE_MAX_ROUNDS = 8;
|
|
17619
|
+
function settleChangeAgainstFee(change, feeOn) {
|
|
17620
|
+
let net = change;
|
|
17621
|
+
for (let i = 0; i < CHANGE_FEE_MAX_ROUNDS; i++) {
|
|
17622
|
+
const next = change - feeOn(net > 0n ? net : 0n);
|
|
17623
|
+
if (next === net) return net > 0n ? net : 0n;
|
|
17624
|
+
net = next;
|
|
17625
|
+
}
|
|
17626
|
+
throw new Error(
|
|
17627
|
+
`change fee does not settle after ${CHANGE_FEE_MAX_ROUNDS} rounds (${change} sats of change); settle the full balance instead`
|
|
17628
|
+
);
|
|
17629
|
+
}
|
|
17630
|
+
function reportUngatedInputs(wallet, inputs) {
|
|
17631
|
+
if (!("logUngatedInputs" in wallet)) return;
|
|
17632
|
+
const logger = wallet;
|
|
17633
|
+
void logger.logUngatedInputs("Ramps.offboard({ vtxos })", inputs);
|
|
17634
|
+
}
|
|
17495
17635
|
var Ramps = class {
|
|
17496
17636
|
/**
|
|
17497
17637
|
* Create convenience wrappers for onboarding and offboarding flows.
|
|
@@ -17545,6 +17685,19 @@ var Ramps = class {
|
|
|
17545
17685
|
}
|
|
17546
17686
|
change = totalAmount - amount;
|
|
17547
17687
|
}
|
|
17688
|
+
let boardingAddress;
|
|
17689
|
+
if (change > 0n) {
|
|
17690
|
+
boardingAddress = await this.wallet.getBoardingAddress();
|
|
17691
|
+
const changeScript = hex.encode(offboardDestinationScript(boardingAddress));
|
|
17692
|
+
change = settleChangeAgainstFee(
|
|
17693
|
+
change,
|
|
17694
|
+
(amt) => BigInt(estimator.evalOnchainOutput({ amount: amt, script: changeScript }).satoshis)
|
|
17695
|
+
);
|
|
17696
|
+
const dustAmount = getDustAmount(this.wallet);
|
|
17697
|
+
if (change > 0n && change < dustAmount) {
|
|
17698
|
+
throw new DustChangeError(change, dustAmount);
|
|
17699
|
+
}
|
|
17700
|
+
}
|
|
17548
17701
|
amount = amount ?? totalAmount;
|
|
17549
17702
|
const offchainAddress = await this.wallet.getAddress();
|
|
17550
17703
|
const offchainAddr = ArkAddress.decode(offchainAddress);
|
|
@@ -17566,7 +17719,6 @@ var Ramps = class {
|
|
|
17566
17719
|
}
|
|
17567
17720
|
];
|
|
17568
17721
|
if (change > 0n) {
|
|
17569
|
-
const boardingAddress = await this.wallet.getBoardingAddress();
|
|
17570
17722
|
outputs.push({
|
|
17571
17723
|
address: boardingAddress,
|
|
17572
17724
|
amount: change
|
|
@@ -17587,6 +17739,10 @@ var Ramps = class {
|
|
|
17587
17739
|
* @param feeInfo - The fee info to deduct from the offboard amount.
|
|
17588
17740
|
* @param amount - The amount to offboard. If not provided, the total amount of virtual outputs will be offboarded.
|
|
17589
17741
|
* @param eventCallback - Optional callback that receives settlement events
|
|
17742
|
+
* @param vtxos - Specific virtual outputs to spend, mirroring {@link onboard}'s
|
|
17743
|
+
* `boardingUtxos`. Omitted, every spendable one is spent — merging the whole
|
|
17744
|
+
* off-chain balance into a single change output. Taken as given like
|
|
17745
|
+
* `settle({ inputs })`: an `amount` these cannot cover is an error, not a top-up.
|
|
17590
17746
|
* @returns The Arkade transaction id created by settlement
|
|
17591
17747
|
* @throws Error if no virtual outputs remain after fee deduction or the destination address cannot be decoded
|
|
17592
17748
|
* @see IWallet.getSpendableVtxos
|
|
@@ -17598,8 +17754,10 @@ var Ramps = class {
|
|
|
17598
17754
|
* await ramps.offboard('bc1q...', feeInfo);
|
|
17599
17755
|
* ```
|
|
17600
17756
|
*/
|
|
17601
|
-
async offboard(destinationAddress, feeInfo, amount, eventCallback) {
|
|
17602
|
-
const
|
|
17757
|
+
async offboard(destinationAddress, feeInfo, amount, eventCallback, vtxos) {
|
|
17758
|
+
const named = vtxos !== void 0;
|
|
17759
|
+
if (vtxos) reportUngatedInputs(this.wallet, vtxos);
|
|
17760
|
+
vtxos ??= await this.wallet.getSpendableVtxos({
|
|
17603
17761
|
withRecoverable: true,
|
|
17604
17762
|
withUnrolled: false
|
|
17605
17763
|
});
|
|
@@ -17609,6 +17767,11 @@ var Ramps = class {
|
|
|
17609
17767
|
for (const vtxo of vtxos) {
|
|
17610
17768
|
const inputFee = estimator.evalOffchainInput(toOffchainInputFeeParams(vtxo));
|
|
17611
17769
|
if (inputFee.satoshis >= vtxo.value) {
|
|
17770
|
+
if (named) {
|
|
17771
|
+
throw new Error(
|
|
17772
|
+
`selected vtxo ${vtxo.txid}:${vtxo.vout} costs ${inputFee.satoshis} sats to spend and is worth ${vtxo.value} \u2014 drop it from the selection`
|
|
17773
|
+
);
|
|
17774
|
+
}
|
|
17612
17775
|
continue;
|
|
17613
17776
|
}
|
|
17614
17777
|
filteredVtxos.push(vtxo);
|
|
@@ -17624,6 +17787,15 @@ var Ramps = class {
|
|
|
17624
17787
|
}
|
|
17625
17788
|
change = totalAmount - amount;
|
|
17626
17789
|
}
|
|
17790
|
+
let changeAddress;
|
|
17791
|
+
if (change > 0n) {
|
|
17792
|
+
changeAddress = await this.wallet.getAddress();
|
|
17793
|
+
const changeScript = hex.encode(ArkAddress.decode(changeAddress).pkScript);
|
|
17794
|
+
change = settleChangeAgainstFee(
|
|
17795
|
+
change,
|
|
17796
|
+
(amount2) => BigInt(estimator.evalOffchainOutput({ amount: amount2, script: changeScript }).satoshis)
|
|
17797
|
+
);
|
|
17798
|
+
}
|
|
17627
17799
|
const dustAmount = getDustAmount(this.wallet);
|
|
17628
17800
|
if (change > 0n && change < dustAmount) {
|
|
17629
17801
|
throw new DustChangeError(change, dustAmount);
|
|
@@ -17647,7 +17819,7 @@ var Ramps = class {
|
|
|
17647
17819
|
}
|
|
17648
17820
|
];
|
|
17649
17821
|
if (change > 0n) {
|
|
17650
|
-
const offchainAddress =
|
|
17822
|
+
const offchainAddress = changeAddress;
|
|
17651
17823
|
outputs.push({
|
|
17652
17824
|
address: offchainAddress,
|
|
17653
17825
|
amount: change
|
|
@@ -23238,6 +23410,12 @@ function createArkadeBatchHandler(intentId, inputs, signer, signedProof, message
|
|
|
23238
23410
|
validateVtxoTxGraph(vtxoTree, commitmentTx, sweepTapTreeRoot);
|
|
23239
23411
|
if (recipients && recipients.length > 0) {
|
|
23240
23412
|
validateBatchRecipients(commitmentTx, vtxoTree.leaves(), recipients, network);
|
|
23413
|
+
} else {
|
|
23414
|
+
validateBatchAgainstIntent(
|
|
23415
|
+
commitmentTx,
|
|
23416
|
+
vtxoTree.leaves(),
|
|
23417
|
+
declaredIntentOutputs(signedProof, message.onchain_output_indexes)
|
|
23418
|
+
);
|
|
23241
23419
|
}
|
|
23242
23420
|
const sharedOutput = commitmentTx.getOutput(0);
|
|
23243
23421
|
if (!sharedOutput?.amount) {
|
|
@@ -23272,8 +23450,15 @@ function createArkadeBatchHandler(intentId, inputs, signer, signedProof, message
|
|
|
23272
23450
|
validatedCommitmentTxid,
|
|
23273
23451
|
"arkade batch finalization"
|
|
23274
23452
|
);
|
|
23275
|
-
if (!validatedCommitmentTxid
|
|
23276
|
-
|
|
23453
|
+
if (!validatedCommitmentTxid) {
|
|
23454
|
+
if (recipients && recipients.length > 0) {
|
|
23455
|
+
validateBatchRecipientsWithoutTree(commitmentPsbt, recipients, network);
|
|
23456
|
+
} else {
|
|
23457
|
+
validateBatchAgainstIntentWithoutTree(
|
|
23458
|
+
commitmentPsbt,
|
|
23459
|
+
declaredIntentOutputs(signedProof, message.onchain_output_indexes)
|
|
23460
|
+
);
|
|
23461
|
+
}
|
|
23277
23462
|
}
|
|
23278
23463
|
const signedForfeits = [];
|
|
23279
23464
|
let connectorIndex = 0;
|
|
@@ -24032,6 +24217,16 @@ function assertNoAssets(railId, req) {
|
|
|
24032
24217
|
);
|
|
24033
24218
|
}
|
|
24034
24219
|
}
|
|
24220
|
+
function selectionOf(req) {
|
|
24221
|
+
return req.selectedVtxos;
|
|
24222
|
+
}
|
|
24223
|
+
function assertNoSelection(railId, req) {
|
|
24224
|
+
if (selectionOf(req) !== void 0) {
|
|
24225
|
+
throw new Error(
|
|
24226
|
+
`${railId}: cannot spend a caller-chosen input set (selectedVtxos) \u2014 this rail does not choose the coins it spends`
|
|
24227
|
+
);
|
|
24228
|
+
}
|
|
24229
|
+
}
|
|
24035
24230
|
function resolveAssetAmount(railId, req) {
|
|
24036
24231
|
const assets = assetsOf(req);
|
|
24037
24232
|
if (assets.length !== 1) {
|
|
@@ -24175,13 +24370,17 @@ function arkRail() {
|
|
|
24175
24370
|
const address = arkTarget(req.raw);
|
|
24176
24371
|
assertNoAssets("ark", req);
|
|
24177
24372
|
const amt = resolveSendAmount("ark", req.raw, req.amount);
|
|
24373
|
+
const selectedVtxos = selectionOf(req);
|
|
24178
24374
|
return {
|
|
24179
24375
|
railId: "ark",
|
|
24180
24376
|
amount: amt,
|
|
24181
24377
|
fee: 0,
|
|
24182
24378
|
total: amt,
|
|
24183
24379
|
send: async () => makeHandle("ark", async (emit) => {
|
|
24184
|
-
const txid = await ctx.wallet.send({
|
|
24380
|
+
const txid = selectedVtxos ? await ctx.wallet.send({
|
|
24381
|
+
recipients: [{ address, amount: amt }],
|
|
24382
|
+
selectedVtxos
|
|
24383
|
+
}) : await ctx.wallet.send({ address, amount: amt });
|
|
24185
24384
|
const result = { railId: "ark", txid };
|
|
24186
24385
|
emit({ status: "settled", result });
|
|
24187
24386
|
return result;
|
|
@@ -24204,6 +24403,7 @@ function arkAssetRail() {
|
|
|
24204
24403
|
const asset = resolveAssetAmount("ark-asset", req);
|
|
24205
24404
|
if (req.amount !== void 0) assertSendableAmount("ark-asset", req.amount);
|
|
24206
24405
|
const carrier = tryResolveSendAmount(req.raw, req.amount) ?? ASSET_CARRIER_SATS;
|
|
24406
|
+
const selectedVtxos = selectionOf(req);
|
|
24207
24407
|
return {
|
|
24208
24408
|
railId: "ark-asset",
|
|
24209
24409
|
amount: carrier,
|
|
@@ -24211,11 +24411,8 @@ function arkAssetRail() {
|
|
|
24211
24411
|
total: carrier,
|
|
24212
24412
|
assets: { delivered: asset, spent: asset },
|
|
24213
24413
|
send: async () => makeHandle("ark-asset", async (emit) => {
|
|
24214
|
-
const
|
|
24215
|
-
|
|
24216
|
-
amount: carrier,
|
|
24217
|
-
assets: [asset]
|
|
24218
|
-
});
|
|
24414
|
+
const recipient = { address, amount: carrier, assets: [asset] };
|
|
24415
|
+
const txid = selectedVtxos ? await ctx.wallet.send({ recipients: [recipient], selectedVtxos }) : await ctx.wallet.send(recipient);
|
|
24219
24416
|
const result = { railId: "ark-asset", txid };
|
|
24220
24417
|
emit({ status: "settled", result });
|
|
24221
24418
|
return result;
|
|
@@ -24237,6 +24434,13 @@ function grossUpOffboard(net, feeInfo, script) {
|
|
|
24237
24434
|
}
|
|
24238
24435
|
return { gross, fee: gross - net };
|
|
24239
24436
|
}
|
|
24437
|
+
function offchainInputFees(vtxos, fees) {
|
|
24438
|
+
const estimator = new Estimator(fees?.intentFee ?? {});
|
|
24439
|
+
return vtxos.reduce(
|
|
24440
|
+
(total, vtxo) => total + estimator.evalOffchainInput(toOffchainInputFeeParams(vtxo)).satoshis,
|
|
24441
|
+
0
|
|
24442
|
+
);
|
|
24443
|
+
}
|
|
24240
24444
|
function onchainRail(deps) {
|
|
24241
24445
|
if (typeof deps?.feeInfo !== "function") {
|
|
24242
24446
|
throw new Error("onchain rail: a feeInfo source is required");
|
|
@@ -24253,17 +24457,22 @@ function onchainRail(deps) {
|
|
|
24253
24457
|
const fees = await deps.feeInfo();
|
|
24254
24458
|
const script = hex.encode(offboardDestinationScript(address));
|
|
24255
24459
|
const { gross, fee } = grossUpOffboard(amt, fees, script);
|
|
24460
|
+
const selectedVtxos = selectionOf(req);
|
|
24461
|
+
const inputFee = selectedVtxos ? offchainInputFees(selectedVtxos, fees) : 0;
|
|
24256
24462
|
return {
|
|
24257
24463
|
railId: "onchain",
|
|
24258
24464
|
amount: amt,
|
|
24259
|
-
fee,
|
|
24260
|
-
total: gross,
|
|
24465
|
+
fee: fee + inputFee,
|
|
24466
|
+
total: gross + inputFee,
|
|
24261
24467
|
send: async () => makeHandle("onchain", async (emit) => {
|
|
24262
|
-
const
|
|
24468
|
+
const ramps = new Ramps(ctx.wallet);
|
|
24469
|
+
const txid = selectedVtxos ? await ramps.offboard(
|
|
24263
24470
|
address,
|
|
24264
24471
|
fees,
|
|
24265
|
-
BigInt(gross)
|
|
24266
|
-
|
|
24472
|
+
BigInt(gross),
|
|
24473
|
+
void 0,
|
|
24474
|
+
selectedVtxos
|
|
24475
|
+
) : await ramps.offboard(address, fees, BigInt(gross));
|
|
24267
24476
|
const result = { railId: "onchain", txid };
|
|
24268
24477
|
emit({ status: "settled", result });
|
|
24269
24478
|
return result;
|
|
@@ -24286,6 +24495,6 @@ function createDefaultPaymentRouter(wallet) {
|
|
|
24286
24495
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
24287
24496
|
*/
|
|
24288
24497
|
|
|
24289
|
-
export { ARKADE_MAGIC, ARKADE_SALTED_PREIMAGE_TAG, ARKADE_SWAP_PREIMAGE_TAG, ASSET_CARRIER_SATS, AbortError, ActivityRegistry, AmbiguousRouteError, ArkNote, ArkadeCash, ArkadeCashCreateError, AssetManager, BIP21, BIP21Error, BIP322, BLOCKED_UPGRADE_TIMEOUT_MS, Batch, CachingArkProvider, ChainedTxType, ConnectionDisposedError, ContractManager, ContractRepositoryImpl, ContractWatcher, DB_VERSION, DEFAULT_MESSAGE_TIMEOUTS, DEFAULT_MIN_BATCH_EXPIRY_SECONDS, DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, DatabaseUpgradeBlockedError, DelegateManagerImpl, DelegateNotConfiguredError, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorIdentity, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EmulatorPacket, EsploraProvider, Estimator, Extension, ExtensionNotFoundError, ForeignDescriptorError, HDDescriptorProvider, INTENT_TERMINAL_STATES, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBWalletRepository, MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MUTINYNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, P2A, PaymentRouter, PrevTxUnavailableError, REGTEST_MIN_BATCH_EXPIRY_SECONDS, REGTEST_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestDelegatorProvider, RestEmulatorProvider, SIGNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, UnannotatableInputError, UnilateralExit, UnknownPacket, Unroll, VtxoManager, Wallet2 as Wallet, WalletCannotAllocateAddressError, WalletCannotSignError, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, adoptContractDescriptor, arkAssetRail, arkRail, arkTarget, arkade_exports, assertFinalCommitmentMatchesValidated, assertIntentIdUnique, assertNoAssets, assertSendableAmount, assertSubmittedArkTxid, assertValidBatchExpiry, assertValidServerUnrollScript, assetMintResolver, assetsOf, attachPrevArkTxs, attachPrevoutTxs, awaitTransaction, boardingResolver, btcTarget, buildForfeitTx, buildOffchainTx, buildPreimageMessage, buildSaltedPreimageMessage, claimWithPreimageIdentity, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, collabExitResolver, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, contractPreimage, contractSigner, createAssetPacket, createDefaultActivityRegistry, createDefaultPaymentRouter, createExitChainResolver, createManagedConnection, decodeArkContract, defaultBatchExpiryPolicy, defaultCheckpointExitDelayPolicy, deleteByIndex, deserializeAssets, deserializeExitPackage, deserializeUtxo, deserializeVtxo, encodeArkContract, exitObserverFor, extendVirtualCoinForContract, extractArkProviderUrl, gateExclusion, gatedContracts, getAllByIndexValues, getMigrationStatus, getRandomId, hasBoardingTxExpired, hasCandidates, intentMatchesFilter, intentPageBounds, invoiceTarget, isAddressAllocationCapable, isArkContract, isBatchSignable, isBtcAddress, isContractGenericallySpendable, isContractVtxoEvent, isCooperativelyMigratable, isDeterministicSigner, isDiscoverable, isHDAllocationCapable, isHDDeterministicSignCapable, isHDWalletCapable, isLightningInvoice, isLnurl, isMessageBusInitializingError, isMessageBusNotInitializedError, isPerArtifactDescriptor, isSigningIdentity, isSubdust, isTerminalIntentState, isValidArkAddress, isVtxoExpiringSoon, isVtxoForScript, isWatchedContract, logExcludedVtxos, makeHandle, matchServerCheckpoints, mergeChainedTxType, migrateWalletRepository, notifyExitObserved, onchainRail, openDatabase, outpointExclusion, outpointReasons, promisifyRequest, provisionClaimSecret, provisionRefundKey, registerWalletRestoreHook, requiresMigration, resolveAssetAmount, resolveBatchExpiryPolicy, resolveCheckpointExitDelayPolicy, resolveDescriptorSigner, resolvePrevTxs, resolveSendAmount, rollbackMigration, saveVtxosForContract, scriptFromArkAddress, selectCoinsWithAsset, selectVirtualCoins, serializeAssets, serializeExitPackage, serializeUtxo, serializeVtxo, setupServiceWorker, signAndSubmitOffchainTx, signerSetFromInfo, signingDescriptorIndex, strictSigningDescriptorIndex, toXOnlySignerHex, tryResolveSendAmount, validateBatchRecipients, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds, walletFeeSource, warnAndFilterVtxosForScript, withPrevTxs };
|
|
24290
|
-
//# sourceMappingURL=chunk-
|
|
24291
|
-
//# sourceMappingURL=chunk-
|
|
24498
|
+
export { ARKADE_MAGIC, ARKADE_SALTED_PREIMAGE_TAG, ARKADE_SWAP_PREIMAGE_TAG, ASSET_CARRIER_SATS, AbortError, ActivityRegistry, AmbiguousRouteError, ArkNote, ArkadeCash, ArkadeCashCreateError, AssetManager, BIP21, BIP21Error, BIP322, BLOCKED_UPGRADE_TIMEOUT_MS, Batch, CachingArkProvider, ChainedTxType, ConnectionDisposedError, ContractManager, ContractRepositoryImpl, ContractWatcher, DB_VERSION, DEFAULT_MESSAGE_TIMEOUTS, DEFAULT_MIN_BATCH_EXPIRY_SECONDS, DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, DatabaseUpgradeBlockedError, DelegateManagerImpl, DelegateNotConfiguredError, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorIdentity, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EmulatorPacket, EsploraProvider, Estimator, Extension, ExtensionNotFoundError, ForeignDescriptorError, HDDescriptorProvider, INTENT_TERMINAL_STATES, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBWalletRepository, MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MUTINYNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, P2A, PaymentRouter, PrevTxUnavailableError, REGTEST_MIN_BATCH_EXPIRY_SECONDS, REGTEST_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestDelegatorProvider, RestEmulatorProvider, SIGNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, UnannotatableInputError, UnilateralExit, UnknownPacket, Unroll, VtxoManager, Wallet2 as Wallet, WalletCannotAllocateAddressError, WalletCannotSignError, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, adoptContractDescriptor, arkAssetRail, arkRail, arkTarget, arkade_exports, assertFinalCommitmentMatchesValidated, assertIntentIdUnique, assertNoAssets, assertNoSelection, assertSendableAmount, assertSubmittedArkTxid, assertValidBatchExpiry, assertValidServerUnrollScript, assetMintResolver, assetsOf, attachPrevArkTxs, attachPrevoutTxs, awaitTransaction, boardingResolver, btcTarget, buildForfeitTx, buildOffchainTx, buildPreimageMessage, buildSaltedPreimageMessage, claimWithPreimageIdentity, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, collabExitResolver, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, contractPreimage, contractSigner, createAssetPacket, createDefaultActivityRegistry, createDefaultPaymentRouter, createExitChainResolver, createManagedConnection, decodeArkContract, defaultBatchExpiryPolicy, defaultCheckpointExitDelayPolicy, deleteByIndex, deserializeAssets, deserializeExitPackage, deserializeUtxo, deserializeVtxo, encodeArkContract, exitObserverFor, extendVirtualCoinForContract, extractArkProviderUrl, gateExclusion, gatedContracts, getAllByIndexValues, getMigrationStatus, getRandomId, hasBoardingTxExpired, hasCandidates, intentMatchesFilter, intentPageBounds, invoiceTarget, isAddressAllocationCapable, isArkContract, isBatchSignable, isBtcAddress, isContractGenericallySpendable, isContractVtxoEvent, isCooperativelyMigratable, isDeterministicSigner, isDiscoverable, isHDAllocationCapable, isHDDeterministicSignCapable, isHDWalletCapable, isLightningInvoice, isLnurl, isMessageBusInitializingError, isMessageBusNotInitializedError, isPerArtifactDescriptor, isSigningIdentity, isSubdust, isTerminalIntentState, isValidArkAddress, isVtxoExpiringSoon, isVtxoForScript, isWatchedContract, logExcludedVtxos, makeHandle, matchServerCheckpoints, mergeChainedTxType, migrateWalletRepository, notifyExitObserved, onchainRail, openDatabase, outpointExclusion, outpointReasons, promisifyRequest, provisionClaimSecret, provisionRefundKey, registerWalletRestoreHook, requiresMigration, resolveAssetAmount, resolveBatchExpiryPolicy, resolveCheckpointExitDelayPolicy, resolveDescriptorSigner, resolvePrevTxs, resolveSendAmount, rollbackMigration, saveVtxosForContract, scriptFromArkAddress, selectCoinsWithAsset, selectVirtualCoins, selectionOf, serializeAssets, serializeExitPackage, serializeUtxo, serializeVtxo, setupServiceWorker, signAndSubmitOffchainTx, signerSetFromInfo, signingDescriptorIndex, strictSigningDescriptorIndex, toXOnlySignerHex, tryResolveSendAmount, validateBatchRecipients, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds, walletFeeSource, warnAndFilterVtxosForScript, withPrevTxs };
|
|
24499
|
+
//# sourceMappingURL=chunk-ZTGTQP2W.js.map
|
|
24500
|
+
//# sourceMappingURL=chunk-ZTGTQP2W.js.map
|