@arkade-os/sdk 0.4.71 → 0.4.72
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 +29 -0
- package/dist/adapters/expo.cjs +5 -5
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +3 -3
- package/dist/adapters/indexedDB.cjs +5 -5
- package/dist/adapters/indexedDB.js +4 -4
- package/dist/{asyncStorageTaskQueue-CjKAUiuj.d.ts → asyncStorageTaskQueue-DhhNZc4v.d.ts} +2 -2
- package/dist/{asyncStorageTaskQueue-DgXf4iuU.d.cts → asyncStorageTaskQueue-s5lUGWxu.d.cts} +2 -2
- package/dist/{chunk-I7ZNWBBU.cjs → chunk-4BWZ437E.cjs} +21 -17
- package/dist/chunk-4BWZ437E.cjs.map +1 -0
- package/dist/{chunk-FM263GKH.cjs → chunk-4C5PMGBB.cjs} +51 -25
- package/dist/chunk-4C5PMGBB.cjs.map +1 -0
- package/dist/{chunk-2ZX4Z2IP.js → chunk-5GQFYVWP.js} +30 -5
- package/dist/chunk-5GQFYVWP.js.map +1 -0
- package/dist/{chunk-5J5PDZRR.cjs → chunk-6FTHFJAN.cjs} +30 -4
- package/dist/chunk-6FTHFJAN.cjs.map +1 -0
- package/dist/{chunk-E5JNYFOF.js → chunk-BHLYB44A.js} +210 -53
- package/dist/chunk-BHLYB44A.js.map +1 -0
- package/dist/{chunk-ALZ2CZ3T.js → chunk-CB6QPAO5.js} +3 -3
- package/dist/{chunk-ALZ2CZ3T.js.map → chunk-CB6QPAO5.js.map} +1 -1
- package/dist/{chunk-NOWVA5CM.js → chunk-CZPBPMO2.js} +4 -4
- package/dist/{chunk-NOWVA5CM.js.map → chunk-CZPBPMO2.js.map} +1 -1
- package/dist/{chunk-ZT3EM4CE.js → chunk-IGER5FPC.js} +37 -11
- package/dist/chunk-IGER5FPC.js.map +1 -0
- package/dist/{chunk-7PHMT3T4.cjs → chunk-KDMHEWTD.cjs} +10 -10
- package/dist/{chunk-7PHMT3T4.cjs.map → chunk-KDMHEWTD.cjs.map} +1 -1
- package/dist/{chunk-P6EXRY5L.cjs → chunk-NPM5YZBC.cjs} +49 -49
- package/dist/{chunk-P6EXRY5L.cjs.map → chunk-NPM5YZBC.cjs.map} +1 -1
- package/dist/{chunk-SCSLCU66.js → chunk-S5PUFSXC.js} +8 -4
- package/dist/chunk-S5PUFSXC.js.map +1 -0
- package/dist/{chunk-MK5EPTTB.cjs → chunk-U5I3ITV7.cjs} +643 -485
- package/dist/chunk-U5I3ITV7.cjs.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-D-gEEqrP.d.cts → delegate-BJp8f6LT.d.cts} +1 -1
- package/dist/{delegate-CKJdsC99.d.ts → delegate-Ckz_TWzM.d.ts} +1 -1
- package/dist/{hdWalletCapable-CwLPmWct.d.cts → hdWalletCapable-DA9bJ5eB.d.cts} +2 -2
- package/dist/{hdWalletCapable-BJ4pvkai.d.ts → hdWalletCapable-DABgAD-T.d.ts} +2 -2
- package/dist/{index-Boppyqav.d.ts → index-B8xrELXY.d.ts} +2 -2
- package/dist/{index-BE1uFXrV.d.cts → index-DSbDm0Io.d.cts} +2 -2
- package/dist/{index-CyGnhCSS.d.ts → index-Dg0-TvBQ.d.cts} +51 -3
- package/dist/{index-CyGnhCSS.d.cts → index-Dg0-TvBQ.d.ts} +51 -3
- package/dist/index.cjs +306 -298
- package/dist/index.d.cts +54 -10
- package/dist/index.d.ts +54 -10
- 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-CjmMH_rW.d.cts → taskRunner-BH_FxaNI.d.cts} +2 -2
- package/dist/{taskRunner-l3zyfW_Q.d.ts → taskRunner-DrVz2QZs.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-2ZX4Z2IP.js.map +0 -1
- package/dist/chunk-5J5PDZRR.cjs.map +0 -1
- package/dist/chunk-E5JNYFOF.js.map +0 -1
- package/dist/chunk-FM263GKH.cjs.map +0 -1
- package/dist/chunk-I7ZNWBBU.cjs.map +0 -1
- package/dist/chunk-MK5EPTTB.cjs.map +0 -1
- package/dist/chunk-SCSLCU66.js.map +0 -1
- package/dist/chunk-ZT3EM4CE.js.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, DEFAULT_ARKADE_SERVER_URL, ProviderUnavailableError, networks as networks$1
|
|
1
|
+
import { AssetId, AssetGroup, AssetInput, AssetOutput, Metadata, Packet, BufferReader, BufferWriter, AssetRef, RestIndexerProvider } from './chunk-IGER5FPC.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-CB6QPAO5.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-5GQFYVWP.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';
|
|
@@ -2983,6 +2983,39 @@ function createDefaultActivityRegistry() {
|
|
|
2983
2983
|
return registry;
|
|
2984
2984
|
}
|
|
2985
2985
|
|
|
2986
|
+
// src/wallet/restoreHooks.ts
|
|
2987
|
+
var restoreHooks = /* @__PURE__ */ new WeakMap();
|
|
2988
|
+
function registerWalletRestoreHook(wallet, hook) {
|
|
2989
|
+
const hooks = restoreHooks.get(wallet) ?? [];
|
|
2990
|
+
const entry = { ...hook };
|
|
2991
|
+
const existing = hooks.findIndex(({ id }) => id === hook.id);
|
|
2992
|
+
if (existing === -1) hooks.push(entry);
|
|
2993
|
+
else hooks[existing] = entry;
|
|
2994
|
+
restoreHooks.set(wallet, hooks);
|
|
2995
|
+
return () => {
|
|
2996
|
+
const current = restoreHooks.get(wallet);
|
|
2997
|
+
if (!current) return;
|
|
2998
|
+
const index = current.indexOf(entry);
|
|
2999
|
+
if (index === -1) return;
|
|
3000
|
+
current.splice(index, 1);
|
|
3001
|
+
if (current.length === 0) restoreHooks.delete(wallet);
|
|
3002
|
+
};
|
|
3003
|
+
}
|
|
3004
|
+
async function runWalletRestoreHooks(wallet) {
|
|
3005
|
+
const snapshot = [...restoreHooks.get(wallet) ?? []];
|
|
3006
|
+
const errors = [];
|
|
3007
|
+
for (const hook of snapshot) {
|
|
3008
|
+
try {
|
|
3009
|
+
await hook.restore(wallet);
|
|
3010
|
+
} catch (error) {
|
|
3011
|
+
errors.push(error);
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
3014
|
+
if (errors.length > 0) {
|
|
3015
|
+
throw new AggregateError(errors, "Wallet restore hooks failed");
|
|
3016
|
+
}
|
|
3017
|
+
}
|
|
3018
|
+
|
|
2986
3019
|
// src/wallet/index.ts
|
|
2987
3020
|
var TxType = /* @__PURE__ */ ((TxType2) => {
|
|
2988
3021
|
TxType2["TxSent"] = "SENT";
|
|
@@ -3957,9 +3990,18 @@ function gatedContracts(contracts) {
|
|
|
3957
3990
|
}
|
|
3958
3991
|
return gated;
|
|
3959
3992
|
}
|
|
3993
|
+
function gatedFrom(snapshot) {
|
|
3994
|
+
return gatedContracts(snapshot.map((entry) => entry.contract));
|
|
3995
|
+
}
|
|
3996
|
+
function gatedTypeOf(vtxo, gated) {
|
|
3997
|
+
return vtxo.script === void 0 ? void 0 : gated.get(vtxo.script);
|
|
3998
|
+
}
|
|
3999
|
+
function isGatedVtxo(vtxo, gated) {
|
|
4000
|
+
return gatedTypeOf(vtxo, gated) !== void 0;
|
|
4001
|
+
}
|
|
3960
4002
|
function gateExclusion(gated) {
|
|
3961
4003
|
return (vtxo) => {
|
|
3962
|
-
const type = vtxo
|
|
4004
|
+
const type = gatedTypeOf(vtxo, gated);
|
|
3963
4005
|
if (type === void 0) return void 0;
|
|
3964
4006
|
if (!contractHandlers.has(type)) {
|
|
3965
4007
|
return `at ${vtxo.script} (contract type '${type}') has no handler registered in this build`;
|
|
@@ -6937,6 +6979,24 @@ var Batch;
|
|
|
6937
6979
|
})(Batch || (Batch = {}));
|
|
6938
6980
|
|
|
6939
6981
|
// src/utils/transactionHistory.ts
|
|
6982
|
+
function localCreatedAtByTxid(vtxos) {
|
|
6983
|
+
const createdAt = /* @__PURE__ */ new Map();
|
|
6984
|
+
for (const vtxo of vtxos) {
|
|
6985
|
+
if (vtxo.txid && !createdAt.has(vtxo.txid)) {
|
|
6986
|
+
createdAt.set(vtxo.txid, vtxo.createdAt.getTime());
|
|
6987
|
+
}
|
|
6988
|
+
}
|
|
6989
|
+
return createdAt;
|
|
6990
|
+
}
|
|
6991
|
+
function gatedTouchpoints(gated) {
|
|
6992
|
+
const paidIn = /* @__PURE__ */ new Set();
|
|
6993
|
+
const paidOut = /* @__PURE__ */ new Set();
|
|
6994
|
+
for (const vtxo of gated) {
|
|
6995
|
+
if (vtxo.txid) paidIn.add(vtxo.txid);
|
|
6996
|
+
if (vtxo.isSpent && vtxo.arkTxId) paidOut.add(vtxo.arkTxId);
|
|
6997
|
+
}
|
|
6998
|
+
return { paidIn, paidOut };
|
|
6999
|
+
}
|
|
6940
7000
|
var txKey = {
|
|
6941
7001
|
commitmentTxid: "",
|
|
6942
7002
|
boardingTxid: "",
|
|
@@ -6988,24 +7048,27 @@ function subtractAssets(spent, change) {
|
|
|
6988
7048
|
if (map.size === 0) return void 0;
|
|
6989
7049
|
return Array.from(map, ([assetId, amount]) => ({ assetId, amount }));
|
|
6990
7050
|
}
|
|
6991
|
-
function collectArkTxidsNeedingCreatedAt(vtxos) {
|
|
6992
|
-
const ownTxids = new Set(vtxos.map((v) => v.txid));
|
|
7051
|
+
function collectArkTxidsNeedingCreatedAt(vtxos, localCreatedAt) {
|
|
6993
7052
|
const txids = /* @__PURE__ */ new Set();
|
|
6994
7053
|
for (const vtxo of vtxos) {
|
|
6995
|
-
if (vtxo.isSpent && vtxo.arkTxId && !
|
|
7054
|
+
if (vtxo.isSpent && vtxo.arkTxId && !localCreatedAt.has(vtxo.arkTxId)) {
|
|
6996
7055
|
txids.add(vtxo.arkTxId);
|
|
6997
7056
|
}
|
|
6998
7057
|
}
|
|
6999
7058
|
return [...txids];
|
|
7000
7059
|
}
|
|
7001
|
-
async function buildTransactionHistory(vtxos, allBoardingTxs, commitmentsToIgnore, resolveTxCreatedAt) {
|
|
7002
|
-
const
|
|
7003
|
-
const
|
|
7060
|
+
async function buildTransactionHistory(vtxos, allBoardingTxs, commitmentsToIgnore, resolveTxCreatedAt, gatedScripts = /* @__PURE__ */ new Map()) {
|
|
7061
|
+
const normalized = vtxos.map(normalizeVtxo).sort((a, b) => a.createdAt.getTime() - b.createdAt.getTime());
|
|
7062
|
+
const localCreatedAt = localCreatedAtByTxid(normalized);
|
|
7063
|
+
const gatedVtxos = normalized.filter((vtxo) => isGatedVtxo(vtxo, gatedScripts));
|
|
7064
|
+
const ownVtxos = normalized.filter((vtxo) => !isGatedVtxo(vtxo, gatedScripts));
|
|
7065
|
+
const { paidIn: paidIntoGated, paidOut: paidOutOfGated } = gatedTouchpoints(gatedVtxos);
|
|
7066
|
+
const txidsNeedingCreatedAt = resolveTxCreatedAt ? collectArkTxidsNeedingCreatedAt(ownVtxos, localCreatedAt) : [];
|
|
7004
7067
|
const resolvedCreatedAt = resolveTxCreatedAt && txidsNeedingCreatedAt.length > 0 ? await resolveTxCreatedAt(txidsNeedingCreatedAt) : /* @__PURE__ */ new Map();
|
|
7005
7068
|
const unmatchedSettledBoardingTxs = allBoardingTxs.filter(isSettledBoardingReceive).sort((a, b) => a.createdAt - b.createdAt);
|
|
7006
7069
|
const sent = [];
|
|
7007
7070
|
let received = [];
|
|
7008
|
-
for (const vtxo of
|
|
7071
|
+
for (const vtxo of ownVtxos) {
|
|
7009
7072
|
if (vtxo.status.isLeaf) {
|
|
7010
7073
|
const commitmentTxid = vtxo.commitmentTxIds[0];
|
|
7011
7074
|
const vtxoCreatedAt = vtxo.createdAt.getTime();
|
|
@@ -7015,7 +7078,7 @@ async function buildTransactionHistory(vtxos, allBoardingTxs, commitmentsToIgnor
|
|
|
7015
7078
|
unmatchedSettledBoardingTxs,
|
|
7016
7079
|
(tx) => tx.createdAt <= vtxoCreatedAt && (tx.key.commitmentTxid === commitmentTxid || tx.key.commitmentTxid === vtxo.settledBy)
|
|
7017
7080
|
);
|
|
7018
|
-
} else if (
|
|
7081
|
+
} else if (ownVtxos.filter((v) => v.settledBy === vtxo.commitmentTxIds[0]).length === 0) {
|
|
7019
7082
|
const duplicateBoardingReceive = consumeBoardingReceive(
|
|
7020
7083
|
unmatchedSettledBoardingTxs,
|
|
7021
7084
|
(tx) => tx.amount === vtxo.value && tx.createdAt <= vtxoCreatedAt
|
|
@@ -7036,11 +7099,14 @@ async function buildTransactionHistory(vtxos, allBoardingTxs, commitmentsToIgnor
|
|
|
7036
7099
|
});
|
|
7037
7100
|
}
|
|
7038
7101
|
}
|
|
7039
|
-
} else if (
|
|
7102
|
+
} else if (ownVtxos.filter((v) => v.arkTxId === vtxo.txid).length === 0) {
|
|
7040
7103
|
const assets = collectAssets([vtxo]);
|
|
7041
7104
|
received.push({
|
|
7042
7105
|
key: { ...txKey, arkTxid: vtxo.txid },
|
|
7043
|
-
|
|
7106
|
+
// The escrow paying out: a swap fill or a cancel spends the
|
|
7107
|
+
// gated coin and lands the proceeds here. Nothing else about
|
|
7108
|
+
// the row changes — the tag only names the counterparty.
|
|
7109
|
+
tag: paidOutOfGated.has(vtxo.txid) ? "gated" : "offchain",
|
|
7044
7110
|
type: "RECEIVED" /* TxReceived */,
|
|
7045
7111
|
amount: vtxo.value,
|
|
7046
7112
|
settled: vtxo.status.isLeaf || vtxo.isSpent,
|
|
@@ -7050,8 +7116,8 @@ async function buildTransactionHistory(vtxos, allBoardingTxs, commitmentsToIgnor
|
|
|
7050
7116
|
}
|
|
7051
7117
|
if (vtxo.isSpent) {
|
|
7052
7118
|
if (vtxo.arkTxId && !sent.some((s) => s.key.arkTxid === vtxo.arkTxId)) {
|
|
7053
|
-
const changes =
|
|
7054
|
-
const allSpent =
|
|
7119
|
+
const changes = ownVtxos.filter((_) => _.txid === vtxo.arkTxId);
|
|
7120
|
+
const allSpent = ownVtxos.filter((v) => v.arkTxId === vtxo.arkTxId);
|
|
7055
7121
|
const spentAmount = allSpent.reduce((acc, v) => acc + v.value, 0);
|
|
7056
7122
|
let txAmount = 0;
|
|
7057
7123
|
let txTime = 0;
|
|
@@ -7061,13 +7127,16 @@ async function buildTransactionHistory(vtxos, allBoardingTxs, commitmentsToIgnor
|
|
|
7061
7127
|
txTime = changes[0].createdAt.getTime();
|
|
7062
7128
|
} else {
|
|
7063
7129
|
txAmount = spentAmount;
|
|
7064
|
-
txTime = resolvedCreatedAt.get(vtxo.arkTxId) ?? vtxo.createdAt.getTime() + 1;
|
|
7130
|
+
txTime = localCreatedAt.get(vtxo.arkTxId) ?? resolvedCreatedAt.get(vtxo.arkTxId) ?? vtxo.createdAt.getTime() + 1;
|
|
7065
7131
|
}
|
|
7066
7132
|
const assets = subtractAssets(allSpent, changes);
|
|
7067
7133
|
if (txAmount !== 0 || assets) {
|
|
7068
7134
|
sent.push({
|
|
7069
7135
|
key: { ...txKey, arkTxid: vtxo.arkTxId },
|
|
7070
|
-
|
|
7136
|
+
// Funding the escrow: an output of this tx landed on a
|
|
7137
|
+
// gated contract of the wallet's, so the send is to the
|
|
7138
|
+
// user's own covenant rather than to a stranger.
|
|
7139
|
+
tag: paidIntoGated.has(vtxo.arkTxId) ? "gated" : "offchain",
|
|
7071
7140
|
type: "SENT" /* TxSent */,
|
|
7072
7141
|
amount: txAmount,
|
|
7073
7142
|
settled: true,
|
|
@@ -7077,10 +7146,10 @@ async function buildTransactionHistory(vtxos, allBoardingTxs, commitmentsToIgnor
|
|
|
7077
7146
|
}
|
|
7078
7147
|
}
|
|
7079
7148
|
if (vtxo.settledBy && !commitmentsToIgnore.has(vtxo.settledBy) && !sent.some((s) => s.key.commitmentTxid === vtxo.settledBy)) {
|
|
7080
|
-
const changes =
|
|
7149
|
+
const changes = ownVtxos.filter(
|
|
7081
7150
|
(v) => v.status.isLeaf && v.commitmentTxIds.length > 0 && v.commitmentTxIds.every((_) => vtxo.settledBy === _)
|
|
7082
7151
|
);
|
|
7083
|
-
const forfeitVtxos =
|
|
7152
|
+
const forfeitVtxos = ownVtxos.filter((v) => v.settledBy === vtxo.settledBy);
|
|
7084
7153
|
const forfeitAmount = forfeitVtxos.reduce((acc, v) => acc + v.value, 0);
|
|
7085
7154
|
if (changes.length > 0) {
|
|
7086
7155
|
const settledAmount = changes.reduce((acc, v) => acc + v.value, 0);
|
|
@@ -9144,13 +9213,14 @@ var ContractWatcher = class {
|
|
|
9144
9213
|
try {
|
|
9145
9214
|
const vtxosMap = await this.getContractVtxos({
|
|
9146
9215
|
contractScripts,
|
|
9147
|
-
includeSpent:
|
|
9148
|
-
// only spendable ones!
|
|
9216
|
+
includeSpent: true
|
|
9149
9217
|
});
|
|
9150
9218
|
for (const contractScript of contractScripts) {
|
|
9151
9219
|
const state = this.contracts.get(contractScript);
|
|
9152
9220
|
if (!state) continue;
|
|
9153
|
-
const
|
|
9221
|
+
const known = vtxosMap.get(contractScript) || [];
|
|
9222
|
+
const knownByKey = new Map(known.map((v) => [`${v.txid}:${v.vout}`, v]));
|
|
9223
|
+
const currentVtxos = known.filter((v) => !v.isSpent);
|
|
9154
9224
|
const currentKeys = new Set(currentVtxos.map((v) => `${v.txid}:${v.vout}`));
|
|
9155
9225
|
const newVtxos = [];
|
|
9156
9226
|
for (const vtxo of currentVtxos) {
|
|
@@ -9163,7 +9233,7 @@ var ContractWatcher = class {
|
|
|
9163
9233
|
const spentVtxos = [];
|
|
9164
9234
|
for (const [key, vtxo] of state.lastKnownVtxos) {
|
|
9165
9235
|
if (!currentKeys.has(key)) {
|
|
9166
|
-
spentVtxos.push(vtxo);
|
|
9236
|
+
spentVtxos.push(knownByKey.get(key) ?? vtxo);
|
|
9167
9237
|
state.lastKnownVtxos.delete(key);
|
|
9168
9238
|
}
|
|
9169
9239
|
}
|
|
@@ -9557,6 +9627,7 @@ var ContractManager = class _ContractManager {
|
|
|
9557
9627
|
syncDegradedReason;
|
|
9558
9628
|
/** Epoch-ms of the last successful provider sync, if any. */
|
|
9559
9629
|
lastSyncedAt;
|
|
9630
|
+
syncedAtByScript = /* @__PURE__ */ new Map();
|
|
9560
9631
|
/** Last chain tip read, with the epoch-ms it was read at. @see currentChainTip */
|
|
9561
9632
|
chainTipCache;
|
|
9562
9633
|
/** In-flight chain tip read, so concurrent cache misses share one. */
|
|
@@ -9610,6 +9681,10 @@ var ContractManager = class _ContractManager {
|
|
|
9610
9681
|
lastSyncedAt: this.lastSyncedAt
|
|
9611
9682
|
};
|
|
9612
9683
|
}
|
|
9684
|
+
/** @see ContractManagerConfig.vtxoSyncMaxAgeMs — for factory-built managers. */
|
|
9685
|
+
setVtxoSyncMaxAge(maxAgeMs) {
|
|
9686
|
+
this.config.vtxoSyncMaxAgeMs = maxAgeMs;
|
|
9687
|
+
}
|
|
9613
9688
|
markSyncOnline() {
|
|
9614
9689
|
this.lastSyncedAt = Date.now();
|
|
9615
9690
|
this.syncDegradedReason = this.annotationDegradedReason();
|
|
@@ -9913,6 +9988,41 @@ var ContractManager = class _ContractManager {
|
|
|
9913
9988
|
}
|
|
9914
9989
|
return contract;
|
|
9915
9990
|
}
|
|
9991
|
+
/**
|
|
9992
|
+
* `createContract`'s step order, fetch batched: persist all, hydrate once,
|
|
9993
|
+
* then watch. Hydrating first keeps it equivalent — the watcher seeds from
|
|
9994
|
+
* the repository, so an unhydrated row reads as all-new. A part-way failure
|
|
9995
|
+
* still watches what it wrote; a retry reports those rows as existing.
|
|
9996
|
+
*/
|
|
9997
|
+
async createContracts(paramsList) {
|
|
9998
|
+
if (paramsList.length === 0) return [];
|
|
9999
|
+
return this.watcher.withCoalescedSubscription(async () => {
|
|
10000
|
+
const upserted = [];
|
|
10001
|
+
try {
|
|
10002
|
+
for (const params of paramsList) upserted.push(await this.upsertContract(params));
|
|
10003
|
+
} catch (err) {
|
|
10004
|
+
for (const u of upserted) {
|
|
10005
|
+
if (!u.persisted) continue;
|
|
10006
|
+
await this.watcher.addContract(u.contract).catch(
|
|
10007
|
+
(e) => console.error(`ContractManager: ${u.contract.script} left dark`, e)
|
|
10008
|
+
);
|
|
10009
|
+
}
|
|
10010
|
+
throw err;
|
|
10011
|
+
}
|
|
10012
|
+
const fresh = upserted.filter((u) => u.persisted).map((u) => u.contract);
|
|
10013
|
+
if (fresh.length > 0) {
|
|
10014
|
+
try {
|
|
10015
|
+
await this.fetchContractVxosFromIndexer(fresh);
|
|
10016
|
+
this.markSyncOnline();
|
|
10017
|
+
} catch (err) {
|
|
10018
|
+
if (!isRetryableProviderError(err)) throw err;
|
|
10019
|
+
this.markSyncDegraded(err);
|
|
10020
|
+
}
|
|
10021
|
+
for (const contract of fresh) await this.watcher.addContract(contract);
|
|
10022
|
+
}
|
|
10023
|
+
return upserted.map((u) => u.contract);
|
|
10024
|
+
});
|
|
10025
|
+
}
|
|
9916
10026
|
/**
|
|
9917
10027
|
* Lightweight variant of {@link createContract} for batch discovery
|
|
9918
10028
|
* paths (currently: {@link scanContracts}). Validates, dedupes, persists,
|
|
@@ -10174,12 +10284,16 @@ var ContractManager = class _ContractManager {
|
|
|
10174
10284
|
}
|
|
10175
10285
|
async getContractsWithVtxos(filter, pageSize) {
|
|
10176
10286
|
const contracts = await this.getContracts(filter);
|
|
10177
|
-
|
|
10178
|
-
await this.
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10287
|
+
if (this.syncedWithin(contracts, this.config.vtxoSyncMaxAgeMs ?? 0)) {
|
|
10288
|
+
await this.demoteFundedAwaitingContracts(contracts);
|
|
10289
|
+
} else {
|
|
10290
|
+
try {
|
|
10291
|
+
await this.syncContracts({ contracts, pageSize });
|
|
10292
|
+
this.markSyncOnline();
|
|
10293
|
+
} catch (err) {
|
|
10294
|
+
if (!isRetryableProviderError(err)) throw err;
|
|
10295
|
+
this.markSyncDegraded(err);
|
|
10296
|
+
}
|
|
10183
10297
|
}
|
|
10184
10298
|
const vtxos = await this.getVtxosForContracts(contracts);
|
|
10185
10299
|
return contracts.map((contract) => ({
|
|
@@ -10594,6 +10708,7 @@ var ContractManager = class _ContractManager {
|
|
|
10594
10708
|
}
|
|
10595
10709
|
break;
|
|
10596
10710
|
case "connection_reset":
|
|
10711
|
+
this.syncedAtByScript.clear();
|
|
10597
10712
|
await this.scheduleLookAheadDrain();
|
|
10598
10713
|
await this.reconcileWatched();
|
|
10599
10714
|
this.markSyncOnline();
|
|
@@ -10640,9 +10755,21 @@ var ContractManager = class _ContractManager {
|
|
|
10640
10755
|
const cutoff = cursorCutoff(requestStartedAt);
|
|
10641
10756
|
await advanceSyncCursor(this.config.walletRepository, cutoff);
|
|
10642
10757
|
}
|
|
10758
|
+
if (options.window === void 0) {
|
|
10759
|
+
for (const contract of contracts) {
|
|
10760
|
+
this.syncedAtByScript.set(contract.script, requestStartedAt);
|
|
10761
|
+
}
|
|
10762
|
+
}
|
|
10643
10763
|
await this.demoteFundedAwaitingContracts(contracts);
|
|
10644
10764
|
return result;
|
|
10645
10765
|
}
|
|
10766
|
+
syncedWithin(contracts, maxAgeMs) {
|
|
10767
|
+
if (maxAgeMs <= 0) return false;
|
|
10768
|
+
const floor = Date.now() - maxAgeMs;
|
|
10769
|
+
return contracts.every(
|
|
10770
|
+
(contract) => (this.syncedAtByScript.get(contract.script) ?? 0) >= floor
|
|
10771
|
+
);
|
|
10772
|
+
}
|
|
10646
10773
|
/**
|
|
10647
10774
|
* Demote every `awaiting-funds` contract in `contracts` that has been
|
|
10648
10775
|
* funded — the automatic half of {@link ContractWatchState}.
|
|
@@ -13048,7 +13175,7 @@ var ReadonlyWallet = class _ReadonlyWallet {
|
|
|
13048
13175
|
const vtxos = filterSnapshotVtxos(snapshot, filter, this._pendingSpendOutpoints);
|
|
13049
13176
|
const { gated, pendingRecovery } = this.spendabilityView(snapshot);
|
|
13050
13177
|
const selectable = vtxos.filter(
|
|
13051
|
-
(vtxo) => !
|
|
13178
|
+
(vtxo) => !isGatedVtxo(vtxo, gated) && !pendingRecovery.has(`${vtxo.txid}:${vtxo.vout}`)
|
|
13052
13179
|
);
|
|
13053
13180
|
const unlocked = await spendableVtxosExcludingLocked(selectable, this.intentRepository);
|
|
13054
13181
|
logExcludedVtxos("getSpendableVtxos", vtxos, [
|
|
@@ -13146,7 +13273,7 @@ var ReadonlyWallet = class _ReadonlyWallet {
|
|
|
13146
13273
|
*/
|
|
13147
13274
|
spendabilityView(snapshot) {
|
|
13148
13275
|
return {
|
|
13149
|
-
gated:
|
|
13276
|
+
gated: gatedFrom(snapshot),
|
|
13150
13277
|
pendingRecovery: this.selectPendingRecovery(snapshot)
|
|
13151
13278
|
};
|
|
13152
13279
|
}
|
|
@@ -13161,7 +13288,7 @@ var ReadonlyWallet = class _ReadonlyWallet {
|
|
|
13161
13288
|
return {
|
|
13162
13289
|
now: { timestamp: /* @__PURE__ */ new Date() },
|
|
13163
13290
|
isPendingRecovery: (vtxo) => pendingRecovery.has(`${vtxo.txid}:${vtxo.vout}`),
|
|
13164
|
-
isGenericallySpendable: (vtxo) => !
|
|
13291
|
+
isGenericallySpendable: (vtxo) => !isGatedVtxo(vtxo, gated),
|
|
13165
13292
|
isUnlocked: (vtxo) => unlocked.has(`${vtxo.txid}:${vtxo.vout}`)
|
|
13166
13293
|
};
|
|
13167
13294
|
}
|
|
@@ -13201,16 +13328,18 @@ var ReadonlyWallet = class _ReadonlyWallet {
|
|
|
13201
13328
|
* Return wallet transaction history derived from Arkade state and boarding transactions.
|
|
13202
13329
|
*/
|
|
13203
13330
|
async getTransactionHistory() {
|
|
13204
|
-
const
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13331
|
+
const [snapshot, { boardingTxs, commitmentsToIgnore }] = await Promise.all([
|
|
13332
|
+
this.contractSnapshot(),
|
|
13333
|
+
this.getBoardingTxs()
|
|
13334
|
+
]);
|
|
13335
|
+
const allVtxos = snapshot.flatMap((_) => _.vtxos);
|
|
13208
13336
|
const resolveTxCreatedAt = (txids) => fetchVtxoCreatedAtByTxid(this.indexerProvider, txids);
|
|
13209
13337
|
return buildTransactionHistory(
|
|
13210
13338
|
allVtxos,
|
|
13211
13339
|
boardingTxs,
|
|
13212
13340
|
commitmentsToIgnore,
|
|
13213
|
-
resolveTxCreatedAt
|
|
13341
|
+
resolveTxCreatedAt,
|
|
13342
|
+
gatedFrom(snapshot)
|
|
13214
13343
|
);
|
|
13215
13344
|
}
|
|
13216
13345
|
/**
|
|
@@ -14570,7 +14699,10 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
|
|
|
14570
14699
|
`restore: gapLimit must be a positive integer (got ${String(opts?.gapLimit)})`
|
|
14571
14700
|
);
|
|
14572
14701
|
}
|
|
14573
|
-
this._restoreInFlight =
|
|
14702
|
+
this._restoreInFlight = (async () => {
|
|
14703
|
+
await this._runRestore(gapLimit);
|
|
14704
|
+
await runWalletRestoreHooks(this);
|
|
14705
|
+
})().finally(() => {
|
|
14574
14706
|
this._restoreInFlight = void 0;
|
|
14575
14707
|
});
|
|
14576
14708
|
return this._restoreInFlight;
|
|
@@ -17890,8 +18022,7 @@ var WalletMessageHandler = class {
|
|
|
17890
18022
|
});
|
|
17891
18023
|
}
|
|
17892
18024
|
case "GET_TRANSACTION_HISTORY": {
|
|
17893
|
-
const
|
|
17894
|
-
const transactions = await this.buildTransactionHistoryFromCache(allVtxos) ?? [];
|
|
18025
|
+
const transactions = await this.buildTransactionHistoryFromCache() ?? [];
|
|
17895
18026
|
return this.tagged({
|
|
17896
18027
|
id,
|
|
17897
18028
|
type: "TRANSACTION_HISTORY",
|
|
@@ -18373,7 +18504,7 @@ var WalletMessageHandler = class {
|
|
|
18373
18504
|
unconfirmed += utxo.value;
|
|
18374
18505
|
}
|
|
18375
18506
|
}
|
|
18376
|
-
const gated =
|
|
18507
|
+
const gated = gatedFrom(snapshot);
|
|
18377
18508
|
const unlocked = new Set(
|
|
18378
18509
|
(await spendableVtxosExcludingLocked(allVtxos, this.readonlyWallet?.intentRepository)).map((vtxo) => `${vtxo.txid}:${vtxo.vout}`)
|
|
18379
18510
|
);
|
|
@@ -18381,7 +18512,7 @@ var WalletMessageHandler = class {
|
|
|
18381
18512
|
const offchain = computeOffchainBalance(allVtxos, {
|
|
18382
18513
|
now: { timestamp: /* @__PURE__ */ new Date() },
|
|
18383
18514
|
isPendingRecovery: (vtxo) => pendingOutpoints.has(`${vtxo.txid}:${vtxo.vout}`),
|
|
18384
|
-
isGenericallySpendable: (vtxo) => !
|
|
18515
|
+
isGenericallySpendable: (vtxo) => !isGatedVtxo(vtxo, gated),
|
|
18385
18516
|
isUnlocked: (vtxo) => unlocked.has(`${vtxo.txid}:${vtxo.vout}`)
|
|
18386
18517
|
});
|
|
18387
18518
|
return {
|
|
@@ -18521,7 +18652,6 @@ var WalletMessageHandler = class {
|
|
|
18521
18652
|
if (!this.readonlyWallet || !this.walletRepository) {
|
|
18522
18653
|
return;
|
|
18523
18654
|
}
|
|
18524
|
-
const vtxos = await this.getVtxosFromRepo();
|
|
18525
18655
|
const boardingAddresses = await this.readonlyWallet.getBoardingAddresses();
|
|
18526
18656
|
const fresh = await this.readonlyWallet.getBoardingUtxos();
|
|
18527
18657
|
const freshKeys = new Set(fresh.map((u) => `${u.txid}:${u.vout}`));
|
|
@@ -18533,7 +18663,7 @@ var WalletMessageHandler = class {
|
|
|
18533
18663
|
if (kept.length > 0) await this.walletRepository.saveUtxos(addr, kept);
|
|
18534
18664
|
}
|
|
18535
18665
|
const address = await this.readonlyWallet.getAddress();
|
|
18536
|
-
const txs = await this.buildTransactionHistoryFromCache(
|
|
18666
|
+
const txs = await this.buildTransactionHistoryFromCache();
|
|
18537
18667
|
if (txs) await this.walletRepository.saveTransactions(address, txs);
|
|
18538
18668
|
}
|
|
18539
18669
|
/**
|
|
@@ -18741,13 +18871,29 @@ var WalletMessageHandler = class {
|
|
|
18741
18871
|
/**
|
|
18742
18872
|
* Build transaction history from cached virtual outputs, hitting the indexer only for
|
|
18743
18873
|
* uncached timestamps. Best-effort, like the plain Wallet path.
|
|
18744
|
-
|
|
18745
|
-
|
|
18874
|
+
*
|
|
18875
|
+
* Takes its own {@link repoSnapshot} rather than a caller-supplied VTXO
|
|
18876
|
+
* list: the coins and the gate that judges them have to come off one read
|
|
18877
|
+
* or they answer about different instants, and being the worker's only
|
|
18878
|
+
* history builder means neither caller can supply one without the other.
|
|
18879
|
+
* The snapshot and the boarding read are independent, so they run together
|
|
18880
|
+
* — the same pairing `handleGetBalance` makes.
|
|
18881
|
+
*/
|
|
18882
|
+
async buildTransactionHistoryFromCache() {
|
|
18746
18883
|
if (!this.readonlyWallet) return null;
|
|
18747
|
-
const { boardingTxs, commitmentsToIgnore } = await
|
|
18884
|
+
const [{ snapshot, vtxos }, { boardingTxs, commitmentsToIgnore }] = await Promise.all([
|
|
18885
|
+
this.repoSnapshot(),
|
|
18886
|
+
this.readonlyWallet.getBoardingTxs()
|
|
18887
|
+
]);
|
|
18748
18888
|
const indexerProvider = this.indexerProvider;
|
|
18749
18889
|
const resolveTxCreatedAt = indexerProvider ? (txids) => fetchVtxoCreatedAtByTxid(indexerProvider, txids) : void 0;
|
|
18750
|
-
return buildTransactionHistory(
|
|
18890
|
+
return buildTransactionHistory(
|
|
18891
|
+
vtxos,
|
|
18892
|
+
boardingTxs,
|
|
18893
|
+
commitmentsToIgnore,
|
|
18894
|
+
resolveTxCreatedAt,
|
|
18895
|
+
gatedFrom(snapshot)
|
|
18896
|
+
);
|
|
18751
18897
|
}
|
|
18752
18898
|
async ensureContractEventBroadcasting() {
|
|
18753
18899
|
const wallet = this.readonlyWallet;
|
|
@@ -19843,6 +19989,7 @@ var ServiceWorkerWallet = class _ServiceWorkerWallet extends ServiceWorkerReadon
|
|
|
19843
19989
|
identity;
|
|
19844
19990
|
_assetManager;
|
|
19845
19991
|
hasDelegate;
|
|
19992
|
+
_restoreInFlight;
|
|
19846
19993
|
get assetManager() {
|
|
19847
19994
|
return this._assetManager;
|
|
19848
19995
|
}
|
|
@@ -20105,6 +20252,16 @@ var ServiceWorkerWallet = class _ServiceWorkerWallet extends ServiceWorkerReadon
|
|
|
20105
20252
|
* reconstructed here so callers can inspect `.errors`.
|
|
20106
20253
|
*/
|
|
20107
20254
|
async restore(opts) {
|
|
20255
|
+
if (this._restoreInFlight) return this._restoreInFlight;
|
|
20256
|
+
this._restoreInFlight = (async () => {
|
|
20257
|
+
await this._restoreWorkerWallet(opts);
|
|
20258
|
+
await runWalletRestoreHooks(this);
|
|
20259
|
+
})().finally(() => {
|
|
20260
|
+
this._restoreInFlight = void 0;
|
|
20261
|
+
});
|
|
20262
|
+
return this._restoreInFlight;
|
|
20263
|
+
}
|
|
20264
|
+
async _restoreWorkerWallet(opts) {
|
|
20108
20265
|
const message = {
|
|
20109
20266
|
id: getRandomId(),
|
|
20110
20267
|
tag: this.messageTag,
|
|
@@ -21694,7 +21851,7 @@ var RestEmulatorProvider = class {
|
|
|
21694
21851
|
serverUrl;
|
|
21695
21852
|
async getInfo() {
|
|
21696
21853
|
const url = `${this.serverUrl}/v1/info`;
|
|
21697
|
-
const response = await
|
|
21854
|
+
const response = await baseFetch(url);
|
|
21698
21855
|
if (!response.ok) {
|
|
21699
21856
|
const errorText2 = await response.text();
|
|
21700
21857
|
throw new Error(`Failed to get emulator info: ${errorText2}`);
|
|
@@ -24129,6 +24286,6 @@ function createDefaultPaymentRouter(wallet) {
|
|
|
24129
24286
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
24130
24287
|
*/
|
|
24131
24288
|
|
|
24132
|
-
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, 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 };
|
|
24133
|
-
//# sourceMappingURL=chunk-
|
|
24134
|
-
//# sourceMappingURL=chunk-
|
|
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-BHLYB44A.js.map
|
|
24291
|
+
//# sourceMappingURL=chunk-BHLYB44A.js.map
|