@arkade-os/sdk 0.4.68 → 0.4.70
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 +33 -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-DaZlVTbM.d.ts → asyncStorageTaskQueue-BgUJN-3X.d.ts} +1 -1
- package/dist/{asyncStorageTaskQueue-B2CcXIHU.d.cts → asyncStorageTaskQueue-Cstx6hS7.d.cts} +1 -1
- package/dist/{chunk-PJR63FTK.cjs → chunk-3KW4TWP2.cjs} +17 -17
- package/dist/{chunk-PJR63FTK.cjs.map → chunk-3KW4TWP2.cjs.map} +1 -1
- package/dist/{chunk-6YUACVX4.cjs → chunk-3OKEUDHU.cjs} +49 -49
- package/dist/{chunk-6YUACVX4.cjs.map → chunk-3OKEUDHU.cjs.map} +1 -1
- package/dist/{chunk-EJOFL5WH.cjs → chunk-57636V35.cjs} +3 -3
- package/dist/{chunk-EJOFL5WH.cjs.map → chunk-57636V35.cjs.map} +1 -1
- package/dist/{chunk-45FKMOJH.js → chunk-6UM55KPZ.js} +3 -3
- package/dist/{chunk-45FKMOJH.js.map → chunk-6UM55KPZ.js.map} +1 -1
- package/dist/{chunk-4KCVS4ZN.cjs → chunk-B73Q75IL.cjs} +10 -10
- package/dist/{chunk-4KCVS4ZN.cjs.map → chunk-B73Q75IL.cjs.map} +1 -1
- package/dist/{chunk-33Q2RFET.js → chunk-F5E7LI6G.js} +3 -3
- package/dist/{chunk-33Q2RFET.js.map → chunk-F5E7LI6G.js.map} +1 -1
- package/dist/{chunk-GQ4NMQGR.js → chunk-IUFTICRY.js} +4 -4
- package/dist/{chunk-GQ4NMQGR.js.map → chunk-IUFTICRY.js.map} +1 -1
- package/dist/{chunk-JGMSZIE4.cjs → chunk-JJ7AXR4O.cjs} +17 -17
- package/dist/{chunk-JGMSZIE4.cjs.map → chunk-JJ7AXR4O.cjs.map} +1 -1
- package/dist/{chunk-VBHXBI7F.js → chunk-JVHO6XHG.js} +435 -55
- package/dist/chunk-JVHO6XHG.js.map +1 -0
- package/dist/{chunk-4CMXV5SF.js → chunk-TXSF2DKX.js} +3 -3
- package/dist/{chunk-4CMXV5SF.js.map → chunk-TXSF2DKX.js.map} +1 -1
- package/dist/{chunk-G4I6PU5H.js → chunk-UG3EZDLF.js} +4 -4
- package/dist/{chunk-G4I6PU5H.js.map → chunk-UG3EZDLF.js.map} +1 -1
- package/dist/{chunk-WCJVKFAP.cjs → chunk-XTCOSZ34.cjs} +870 -483
- package/dist/chunk-XTCOSZ34.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-AomVWxO_.d.ts → delegate-BPdzTbwN.d.ts} +1 -1
- package/dist/{delegate-Bffc5f54.d.cts → delegate-DrwIar11.d.cts} +1 -1
- package/dist/{hdWalletCapable-DZdIVa23.d.ts → hdWalletCapable-D4WH35z0.d.cts} +49 -5
- package/dist/{hdWalletCapable-B5nRs3RH.d.cts → hdWalletCapable-DyxCiNVE.d.ts} +49 -5
- package/dist/{index-nfyQM33h.d.cts → index-BqhpAqqj.d.cts} +2 -2
- package/dist/{index-jouvy8FD.d.ts → index-TZJvbIaA.d.ts} +2 -2
- package/dist/{index-C7RZCfoY.d.cts → index-dWRqYSdS.d.cts} +53 -1
- package/dist/{index-C7RZCfoY.d.ts → index-dWRqYSdS.d.ts} +53 -1
- package/dist/index.cjs +318 -290
- package/dist/index.d.cts +97 -21
- package/dist/index.d.ts +97 -21
- 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-D2vnpPBT.d.cts → taskRunner-CzYKyJ9c.d.cts} +1 -1
- package/dist/{taskRunner-DuwK9t8O.d.ts → taskRunner-D2fnbqYw.d.ts} +1 -1
- 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 +2 -1
- package/dist/chunk-VBHXBI7F.js.map +0 -1
- package/dist/chunk-WCJVKFAP.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, isRetryableProviderError, getAllNormalizedVtxos, DEFAULT_PAGE_SIZE, RestArkProvider, toVirtualStatus, ArkError, TapTreeCoder, resolveTimeHeight, canSpendOffchain, parseLegacyExpiry, isExpired, PrevoutTxField, DEFAULT_ARKADE_SERVER_URL, ProviderUnavailableError, networks as networks$1, isPastExpiry, fetchVtxoCreatedAtByTxid } from './chunk-
|
|
1
|
+
import { AssetId, AssetGroup, AssetInput, AssetOutput, Metadata, Packet, BufferReader, BufferWriter, AssetRef, RestIndexerProvider } from './chunk-F5E7LI6G.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-6UM55KPZ.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, isRetryableProviderError, getAllNormalizedVtxos, DEFAULT_PAGE_SIZE, RestArkProvider, toVirtualStatus, ArkError, TapTreeCoder, resolveTimeHeight, canSpendOffchain, parseLegacyExpiry, isExpired, PrevoutTxField, DEFAULT_ARKADE_SERVER_URL, ProviderUnavailableError, networks as networks$1, isPastExpiry, fetchVtxoCreatedAtByTxid } from './chunk-TXSF2DKX.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';
|
|
@@ -1649,6 +1649,16 @@ var EsploraProvider = class {
|
|
|
1649
1649
|
baseUrl;
|
|
1650
1650
|
pollingInterval;
|
|
1651
1651
|
forcePolling;
|
|
1652
|
+
/**
|
|
1653
|
+
* Live {@link watchAddresses} subscriptions, keyed by their address set.
|
|
1654
|
+
*
|
|
1655
|
+
* Concurrent watchers over the same addresses share one transport, so a
|
|
1656
|
+
* caller that opens watchers in a loop — or leaks them by abandoning
|
|
1657
|
+
* {@link waitForIncomingFunds} — costs one entry in a `Set` rather than
|
|
1658
|
+
* another WebSocket plus another full-history polling loop. Entries are
|
|
1659
|
+
* dropped once their last subscriber stops.
|
|
1660
|
+
*/
|
|
1661
|
+
addressWatches = /* @__PURE__ */ new Map();
|
|
1652
1662
|
async getCoins(address) {
|
|
1653
1663
|
const response = await baseFetch(`${this.baseUrl}/address/${address}/utxo`);
|
|
1654
1664
|
if (!response.ok) {
|
|
@@ -1693,6 +1703,18 @@ var EsploraProvider = class {
|
|
|
1693
1703
|
}
|
|
1694
1704
|
return response.json();
|
|
1695
1705
|
}
|
|
1706
|
+
/**
|
|
1707
|
+
* Activity counts for an address, without its transactions — orders of
|
|
1708
|
+
* magnitude smaller than `/address/{addr}/txs`, which is what makes it
|
|
1709
|
+
* usable as a change probe for the polling fallback.
|
|
1710
|
+
*/
|
|
1711
|
+
async getAddressStats(address) {
|
|
1712
|
+
const response = await baseFetch(`${this.baseUrl}/address/${address}`);
|
|
1713
|
+
if (!response.ok) {
|
|
1714
|
+
throw new Error(`Failed to get address stats: ${response.statusText}`);
|
|
1715
|
+
}
|
|
1716
|
+
return response.json();
|
|
1717
|
+
}
|
|
1696
1718
|
async getRawTransaction(txid) {
|
|
1697
1719
|
const response = await baseFetch(`${this.baseUrl}/tx/${txid}/hex`);
|
|
1698
1720
|
if (!response.ok) {
|
|
@@ -1724,50 +1746,227 @@ var EsploraProvider = class {
|
|
|
1724
1746
|
blockHeight: data.block_height
|
|
1725
1747
|
};
|
|
1726
1748
|
}
|
|
1749
|
+
/**
|
|
1750
|
+
* Watch a set of addresses over the explorer's WebSocket, degrading to HTTP
|
|
1751
|
+
* polling whenever the socket is unavailable and returning to the socket as
|
|
1752
|
+
* soon as it can be re-established.
|
|
1753
|
+
*
|
|
1754
|
+
* Concurrent calls covering the same address set share one transport. The
|
|
1755
|
+
* returned function releases **this** subscription only; the transport is
|
|
1756
|
+
* torn down when the last subscriber releases it. Calling it more than once
|
|
1757
|
+
* is a no-op.
|
|
1758
|
+
*
|
|
1759
|
+
* @param addresses - Addresses to monitor; order is not significant
|
|
1760
|
+
* @param callback - Invoked with transactions seen after the watch started
|
|
1761
|
+
* @returns A function releasing this subscription
|
|
1762
|
+
* @remarks
|
|
1763
|
+
* The HTTP fallback fetches full address history per address per cycle,
|
|
1764
|
+
* which is dramatically more expensive than the socket — so callers should
|
|
1765
|
+
* release watches they no longer need rather than relying on sharing.
|
|
1766
|
+
* @see {@link waitForIncomingFunds} for the cancellation-aware wallet-level helper
|
|
1767
|
+
*/
|
|
1727
1768
|
async watchAddresses(addresses, callback) {
|
|
1728
|
-
|
|
1769
|
+
const key = [...addresses].sort().join("\0");
|
|
1770
|
+
let watch = this.addressWatches.get(key);
|
|
1771
|
+
if (!watch) {
|
|
1772
|
+
watch = this.createAddressWatch(addresses, () => this.addressWatches.delete(key));
|
|
1773
|
+
this.addressWatches.set(key, watch);
|
|
1774
|
+
}
|
|
1775
|
+
const subscriber = { callback };
|
|
1776
|
+
watch.subscribers.add(subscriber);
|
|
1777
|
+
const shared = watch;
|
|
1778
|
+
await shared.started;
|
|
1779
|
+
let released = false;
|
|
1780
|
+
return () => {
|
|
1781
|
+
if (released) return;
|
|
1782
|
+
released = true;
|
|
1783
|
+
shared.subscribers.delete(subscriber);
|
|
1784
|
+
if (shared.subscribers.size === 0) shared.teardown();
|
|
1785
|
+
};
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1788
|
+
* Bring up one shared address watch: a WebSocket subscription where the
|
|
1789
|
+
* explorer supports it, degrading to HTTP polling when it doesn't.
|
|
1790
|
+
*
|
|
1791
|
+
* @param addresses - Addresses this watch covers
|
|
1792
|
+
* @param onTeardown - Invoked when the watch retires, to drop the registry entry
|
|
1793
|
+
*/
|
|
1794
|
+
createAddressWatch(addresses, onTeardown) {
|
|
1795
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
1729
1796
|
const wsUrl = this.baseUrl.replace(/^http(s)?:/, "ws$1:") + "/v1/ws";
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1797
|
+
let stopped = false;
|
|
1798
|
+
let timer = null;
|
|
1799
|
+
let pollStarted = false;
|
|
1800
|
+
let ws = null;
|
|
1801
|
+
let reconnectTimer = null;
|
|
1802
|
+
let reconnectFailures = 0;
|
|
1803
|
+
let pollSession = 0;
|
|
1804
|
+
const emit = (txs) => {
|
|
1805
|
+
if (stopped || txs.length === 0) return;
|
|
1806
|
+
for (const subscriber of [...subscribers]) {
|
|
1807
|
+
try {
|
|
1808
|
+
subscriber.callback(txs);
|
|
1809
|
+
} catch (error) {
|
|
1810
|
+
console.error("Address watch subscriber threw:", error);
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
};
|
|
1814
|
+
const txKey2 = (tx) => `${tx.txid}_${tx.status.block_time}`;
|
|
1815
|
+
const getAllTxs = async () => {
|
|
1816
|
+
const txArrays = await Promise.all(
|
|
1817
|
+
addresses.map((address) => this.getTransactions(address))
|
|
1818
|
+
);
|
|
1819
|
+
return txArrays.flat();
|
|
1820
|
+
};
|
|
1821
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1822
|
+
let baselined = false;
|
|
1823
|
+
let anchorHeight;
|
|
1824
|
+
const baseline = (async () => {
|
|
1825
|
+
const [history, tip] = await Promise.allSettled([getAllTxs(), this.getChainTip()]);
|
|
1826
|
+
if (history.status === "fulfilled") {
|
|
1827
|
+
for (const tx of history.value) seen.add(txKey2(tx));
|
|
1828
|
+
baselined = true;
|
|
1829
|
+
return;
|
|
1830
|
+
}
|
|
1831
|
+
console.warn(
|
|
1832
|
+
"Could not baseline watched addresses; the first poll pass will establish it instead:",
|
|
1833
|
+
history.reason
|
|
1834
|
+
);
|
|
1835
|
+
if (tip.status === "fulfilled") anchorHeight = tip.value.height;
|
|
1836
|
+
})();
|
|
1837
|
+
const report = (txs) => {
|
|
1838
|
+
const fresh = [];
|
|
1839
|
+
for (const tx of txs) {
|
|
1840
|
+
const key = txKey2(tx);
|
|
1841
|
+
if (seen.has(key)) continue;
|
|
1842
|
+
seen.add(key);
|
|
1843
|
+
fresh.push(tx);
|
|
1844
|
+
}
|
|
1845
|
+
if (fresh.length === 0) return;
|
|
1846
|
+
emit(fresh);
|
|
1847
|
+
};
|
|
1848
|
+
const startPolling = async () => {
|
|
1849
|
+
if (stopped || pollStarted) return;
|
|
1850
|
+
pollStarted = true;
|
|
1851
|
+
console.warn(
|
|
1852
|
+
`Esplora websocket unavailable (${wsUrl}); falling back to HTTP polling every ${this.pollingInterval}ms for ${addresses.length} address(es) while retrying the socket`
|
|
1853
|
+
);
|
|
1854
|
+
let failures = 0;
|
|
1855
|
+
const activityFingerprint = async () => {
|
|
1856
|
+
try {
|
|
1857
|
+
const stats = await Promise.all(
|
|
1858
|
+
addresses.map((address) => this.getAddressStats(address))
|
|
1859
|
+
);
|
|
1860
|
+
const counted = (activity) => typeof activity?.tx_count === "number" && typeof activity.funded_txo_count === "number" && typeof activity.spent_txo_count === "number";
|
|
1861
|
+
const usable = stats.every(
|
|
1862
|
+
(s) => counted(s?.chain_stats) && counted(s?.mempool_stats)
|
|
1863
|
+
);
|
|
1864
|
+
if (!usable) return void 0;
|
|
1865
|
+
if (stats.some((s) => s.mempool_stats.tx_count > 0)) return void 0;
|
|
1866
|
+
return stats.map(
|
|
1867
|
+
({ chain_stats: chain }) => `${chain.tx_count}:${chain.funded_txo_count}:${chain.spent_txo_count}`
|
|
1868
|
+
).join(",");
|
|
1869
|
+
} catch {
|
|
1870
|
+
return void 0;
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
let lastFingerprint;
|
|
1874
|
+
const session = pollSession;
|
|
1875
|
+
const isCurrentLoop = () => !stopped && session === pollSession;
|
|
1876
|
+
const schedule = () => {
|
|
1877
|
+
if (!isCurrentLoop()) return;
|
|
1878
|
+
timer = setTimeout(tick, this.pollingInterval * 2 ** failures);
|
|
1736
1879
|
};
|
|
1737
|
-
const
|
|
1738
|
-
const txKey2 = (tx) => `${tx.txid}_${tx.status.block_time}`;
|
|
1739
|
-
const existingTxs = new Set(initialTxs.map(txKey2));
|
|
1740
|
-
intervalId = setInterval(async () => {
|
|
1880
|
+
const tick = async () => {
|
|
1741
1881
|
try {
|
|
1882
|
+
const fingerprint = await activityFingerprint();
|
|
1883
|
+
if (!isCurrentLoop()) return;
|
|
1884
|
+
if (fingerprint !== void 0 && fingerprint === lastFingerprint) {
|
|
1885
|
+
failures = 0;
|
|
1886
|
+
schedule();
|
|
1887
|
+
return;
|
|
1888
|
+
}
|
|
1742
1889
|
const currentTxs = await getAllTxs();
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1890
|
+
if (!isCurrentLoop()) return;
|
|
1891
|
+
lastFingerprint = fingerprint;
|
|
1892
|
+
if (baselined) {
|
|
1893
|
+
report(currentTxs);
|
|
1894
|
+
} else if (anchorHeight !== void 0) {
|
|
1895
|
+
const arrivedAfterStart = (tx) => !tx.status.confirmed || tx.status.block_height === void 0 || tx.status.block_height > anchorHeight;
|
|
1896
|
+
for (const tx of currentTxs) {
|
|
1897
|
+
if (!arrivedAfterStart(tx)) seen.add(txKey2(tx));
|
|
1898
|
+
}
|
|
1899
|
+
baselined = true;
|
|
1900
|
+
report(currentTxs);
|
|
1901
|
+
} else {
|
|
1902
|
+
console.warn(
|
|
1903
|
+
`Esplora address watch established its baseline late for ${addresses.length} address(es); deposits arriving before now may not have been reported`
|
|
1904
|
+
);
|
|
1905
|
+
for (const tx of currentTxs) seen.add(txKey2(tx));
|
|
1906
|
+
baselined = true;
|
|
1747
1907
|
}
|
|
1908
|
+
failures = 0;
|
|
1748
1909
|
} catch (error) {
|
|
1749
|
-
|
|
1910
|
+
failures = Math.min(failures + 1, MAX_POLL_BACKOFF_EXPONENT);
|
|
1911
|
+
console.error("Error polling watched addresses:", error);
|
|
1750
1912
|
}
|
|
1751
|
-
|
|
1913
|
+
schedule();
|
|
1914
|
+
};
|
|
1915
|
+
await baseline;
|
|
1916
|
+
if (!isCurrentLoop()) return;
|
|
1917
|
+
await tick();
|
|
1752
1918
|
};
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
if (
|
|
1756
|
-
|
|
1919
|
+
const stopPolling = () => {
|
|
1920
|
+
pollSession++;
|
|
1921
|
+
if (timer) {
|
|
1922
|
+
clearTimeout(timer);
|
|
1923
|
+
timer = null;
|
|
1924
|
+
}
|
|
1925
|
+
pollStarted = false;
|
|
1757
1926
|
};
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1927
|
+
const handleSocketFailure = () => {
|
|
1928
|
+
if (stopped) return Promise.resolve();
|
|
1929
|
+
scheduleReconnect();
|
|
1930
|
+
return startPolling();
|
|
1931
|
+
};
|
|
1932
|
+
const scheduleReconnect = () => {
|
|
1933
|
+
if (stopped || reconnectTimer !== null) return;
|
|
1934
|
+
const delay = RECONNECT_BASE_DELAY_MS * 2 ** Math.min(reconnectFailures, MAX_RECONNECT_BACKOFF_EXPONENT);
|
|
1935
|
+
reconnectFailures++;
|
|
1936
|
+
reconnectTimer = setTimeout(() => {
|
|
1937
|
+
reconnectTimer = null;
|
|
1938
|
+
connect();
|
|
1939
|
+
}, delay);
|
|
1940
|
+
};
|
|
1941
|
+
const connect = () => {
|
|
1942
|
+
if (stopped) return Promise.resolve();
|
|
1943
|
+
const previous = ws;
|
|
1944
|
+
ws = null;
|
|
1945
|
+
if (previous) {
|
|
1946
|
+
try {
|
|
1947
|
+
previous.close();
|
|
1948
|
+
} catch {
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
let socket;
|
|
1952
|
+
try {
|
|
1953
|
+
socket = new WebSocket(wsUrl);
|
|
1954
|
+
} catch {
|
|
1955
|
+
return handleSocketFailure();
|
|
1956
|
+
}
|
|
1957
|
+
ws = socket;
|
|
1958
|
+
const isCurrent = () => !stopped && ws === socket;
|
|
1959
|
+
socket.addEventListener("open", () => {
|
|
1960
|
+
if (!isCurrent()) return;
|
|
1961
|
+
reconnectFailures = 0;
|
|
1765
1962
|
const subscribeMsg = {
|
|
1766
1963
|
"track-addresses": addresses
|
|
1767
1964
|
};
|
|
1768
|
-
|
|
1965
|
+
socket.send(JSON.stringify(subscribeMsg));
|
|
1966
|
+
stopPolling();
|
|
1769
1967
|
});
|
|
1770
|
-
|
|
1968
|
+
socket.addEventListener("message", (event) => {
|
|
1969
|
+
if (!isCurrent()) return;
|
|
1771
1970
|
try {
|
|
1772
1971
|
const newTxs = [];
|
|
1773
1972
|
const message = JSON.parse(event.data.toString());
|
|
@@ -1779,22 +1978,48 @@ var EsploraProvider = class {
|
|
|
1779
1978
|
newTxs.push(...aux[address][type].filter(isExplorerTransaction));
|
|
1780
1979
|
}
|
|
1781
1980
|
}
|
|
1782
|
-
|
|
1981
|
+
report(newTxs);
|
|
1783
1982
|
} catch (error) {
|
|
1784
1983
|
console.error("Failed to process WebSocket message:", error);
|
|
1785
1984
|
}
|
|
1786
1985
|
});
|
|
1787
|
-
|
|
1788
|
-
|
|
1986
|
+
socket.addEventListener("error", () => {
|
|
1987
|
+
if (isCurrent()) void handleSocketFailure();
|
|
1789
1988
|
});
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1989
|
+
socket.addEventListener("close", () => {
|
|
1990
|
+
if (isCurrent()) void handleSocketFailure();
|
|
1991
|
+
});
|
|
1992
|
+
return Promise.resolve();
|
|
1993
|
+
};
|
|
1994
|
+
const teardown = () => {
|
|
1995
|
+
if (stopped) return;
|
|
1996
|
+
stopped = true;
|
|
1997
|
+
onTeardown();
|
|
1998
|
+
if (timer) {
|
|
1999
|
+
clearTimeout(timer);
|
|
2000
|
+
timer = null;
|
|
2001
|
+
}
|
|
2002
|
+
if (reconnectTimer !== null) {
|
|
2003
|
+
clearTimeout(reconnectTimer);
|
|
2004
|
+
reconnectTimer = null;
|
|
2005
|
+
}
|
|
2006
|
+
if (ws) {
|
|
2007
|
+
try {
|
|
2008
|
+
ws.close();
|
|
2009
|
+
} catch {
|
|
2010
|
+
}
|
|
2011
|
+
ws = null;
|
|
2012
|
+
}
|
|
2013
|
+
subscribers.clear();
|
|
2014
|
+
};
|
|
2015
|
+
const started = this.forcePolling ? startPolling() : connect().then(() => baseline);
|
|
2016
|
+
return { subscribers, teardown, started };
|
|
1795
2017
|
}
|
|
1796
2018
|
async getChainTip() {
|
|
1797
|
-
|
|
2019
|
+
let tipBlocks = await baseFetch(`${this.baseUrl}/blocks`);
|
|
2020
|
+
if (tipBlocks.status === 404) {
|
|
2021
|
+
tipBlocks = await baseFetch(`${this.baseUrl}/v1/blocks`);
|
|
2022
|
+
}
|
|
1798
2023
|
if (!tipBlocks.ok) {
|
|
1799
2024
|
throw new Error(`Failed to get chain tip: ${tipBlocks.statusText}`);
|
|
1800
2025
|
}
|
|
@@ -1808,6 +2033,8 @@ var EsploraProvider = class {
|
|
|
1808
2033
|
const hash = tip[0].id;
|
|
1809
2034
|
return {
|
|
1810
2035
|
height: tip[0].height,
|
|
2036
|
+
// `mediantime`, never `timestamp`: the latter is the header's own
|
|
2037
|
+
// `nTime`, and this field is specified as MTP.
|
|
1811
2038
|
time: tip[0].mediantime,
|
|
1812
2039
|
hash
|
|
1813
2040
|
};
|
|
@@ -1873,6 +2100,9 @@ var isExplorerTransaction = (tx) => {
|
|
|
1873
2100
|
(vout) => typeof vout.scriptpubkey_address === "string" && typeof vout.value === "number"
|
|
1874
2101
|
) && typeof tx.status === "object" && typeof tx.status.confirmed === "boolean";
|
|
1875
2102
|
};
|
|
2103
|
+
var MAX_POLL_BACKOFF_EXPONENT = 4;
|
|
2104
|
+
var RECONNECT_BASE_DELAY_MS = 1e3;
|
|
2105
|
+
var MAX_RECONNECT_BACKOFF_EXPONENT = 5;
|
|
1876
2106
|
var getVarIntSize = (n) => {
|
|
1877
2107
|
if (n < 253) return 1;
|
|
1878
2108
|
if (n <= 65535) return 3;
|
|
@@ -16278,19 +16508,53 @@ function selectVirtualCoins(coins, targetAmount) {
|
|
|
16278
16508
|
changeAmount
|
|
16279
16509
|
};
|
|
16280
16510
|
}
|
|
16281
|
-
|
|
16511
|
+
var AbortError = class extends Error {
|
|
16512
|
+
constructor(message = "Operation aborted") {
|
|
16513
|
+
super(message);
|
|
16514
|
+
this.name = "AbortError";
|
|
16515
|
+
}
|
|
16516
|
+
};
|
|
16517
|
+
function abortReason(signal) {
|
|
16518
|
+
const { reason } = signal;
|
|
16519
|
+
if (reason instanceof Error) return reason;
|
|
16520
|
+
return new AbortError(typeof reason === "string" ? reason : void 0);
|
|
16521
|
+
}
|
|
16522
|
+
async function waitForIncomingFunds(wallet, options) {
|
|
16523
|
+
const { signal, timeoutMs } = options ?? {};
|
|
16524
|
+
if (signal?.aborted) throw abortReason(signal);
|
|
16282
16525
|
let stopFunc;
|
|
16283
16526
|
let settled = false;
|
|
16284
|
-
|
|
16527
|
+
let timeoutId;
|
|
16528
|
+
let onAbort;
|
|
16529
|
+
return new Promise((resolve, reject) => {
|
|
16530
|
+
const settle = (deliver) => {
|
|
16531
|
+
if (settled) return;
|
|
16532
|
+
settled = true;
|
|
16533
|
+
if (timeoutId !== void 0) clearTimeout(timeoutId);
|
|
16534
|
+
if (onAbort) signal?.removeEventListener("abort", onAbort);
|
|
16535
|
+
stopFunc?.();
|
|
16536
|
+
deliver();
|
|
16537
|
+
};
|
|
16538
|
+
const cancel = (reason) => settle(() => reject(reason));
|
|
16539
|
+
if (signal) {
|
|
16540
|
+
onAbort = () => cancel(abortReason(signal));
|
|
16541
|
+
signal.addEventListener("abort", onAbort);
|
|
16542
|
+
}
|
|
16543
|
+
if (timeoutMs !== void 0) {
|
|
16544
|
+
timeoutId = setTimeout(
|
|
16545
|
+
() => cancel(new AbortError(`waitForIncomingFunds timed out after ${timeoutMs}ms`)),
|
|
16546
|
+
timeoutMs
|
|
16547
|
+
);
|
|
16548
|
+
}
|
|
16285
16549
|
wallet.notifyIncomingFunds((funds) => {
|
|
16286
16550
|
const hasFunds = funds.type === "utxo" ? funds.coins.length > 0 : funds.newVtxos.length > 0;
|
|
16287
16551
|
if (settled || !hasFunds) return;
|
|
16288
|
-
|
|
16289
|
-
resolve(funds);
|
|
16290
|
-
stopFunc?.();
|
|
16552
|
+
settle(() => resolve(funds));
|
|
16291
16553
|
}).then((stop) => {
|
|
16292
16554
|
stopFunc = stop;
|
|
16293
16555
|
if (settled) stop();
|
|
16556
|
+
}).catch((error) => {
|
|
16557
|
+
cancel(error);
|
|
16294
16558
|
});
|
|
16295
16559
|
});
|
|
16296
16560
|
}
|
|
@@ -20120,6 +20384,7 @@ var ListUnspentMethod = "blockchain.scripthash.listunspent";
|
|
|
20120
20384
|
var MISSING_TRANSACTION = "missingtransaction";
|
|
20121
20385
|
var MAX_FETCH_TRANSACTIONS_ATTEMPTS = 5;
|
|
20122
20386
|
var BLOCK_HEADER_SIZE = 80;
|
|
20387
|
+
var MTP_WINDOW = 11;
|
|
20123
20388
|
function parseBlockHeader(headerHex) {
|
|
20124
20389
|
const headerBytes = hex.decode(headerHex);
|
|
20125
20390
|
if (headerBytes.length !== BLOCK_HEADER_SIZE) {
|
|
@@ -20426,6 +20691,8 @@ var ElectrumOnchainProvider = class {
|
|
|
20426
20691
|
ws;
|
|
20427
20692
|
network;
|
|
20428
20693
|
chain;
|
|
20694
|
+
mtpCache;
|
|
20695
|
+
mtpInflight;
|
|
20429
20696
|
async getCoins(address) {
|
|
20430
20697
|
const script = this.encodeAddress(address);
|
|
20431
20698
|
const scriptHash = toScriptHash(script);
|
|
@@ -20681,15 +20948,58 @@ var ElectrumOnchainProvider = class {
|
|
|
20681
20948
|
blockTime
|
|
20682
20949
|
};
|
|
20683
20950
|
}
|
|
20951
|
+
/** `time` is median-time-past, per {@link OnchainProvider.getChainTip};
|
|
20952
|
+
* Electrum serves raw headers and no MTP, so it is computed here. */
|
|
20684
20953
|
async getChainTip() {
|
|
20685
20954
|
const tip = await this.chain.subscribeHeaders();
|
|
20686
20955
|
const { hash, timestamp } = parseBlockHeader(tip.hex);
|
|
20687
20956
|
return {
|
|
20688
20957
|
height: tip.height,
|
|
20689
|
-
time: timestamp,
|
|
20958
|
+
time: await this.medianTimePast(tip.height, timestamp, hash),
|
|
20690
20959
|
hash
|
|
20691
20960
|
};
|
|
20692
20961
|
}
|
|
20962
|
+
/**
|
|
20963
|
+
* Consensus's `GetMedianTimePast`, ending at and including `height`.
|
|
20964
|
+
*
|
|
20965
|
+
* Cached per tip HASH, not height: this runs on every balance read, and
|
|
20966
|
+
* hashing means a reorg at the same height recomputes rather than serving
|
|
20967
|
+
* the orphaned chain's median.
|
|
20968
|
+
*/
|
|
20969
|
+
async medianTimePast(height, tipTime, hash) {
|
|
20970
|
+
if (this.mtpCache?.hash === hash) return this.mtpCache.mtp;
|
|
20971
|
+
if (this.mtpInflight?.hash === hash) return this.mtpInflight.mtp;
|
|
20972
|
+
const mtp = this.readMedianTimePast(height, tipTime, hash).finally(() => {
|
|
20973
|
+
this.mtpInflight = void 0;
|
|
20974
|
+
});
|
|
20975
|
+
this.mtpInflight = { hash, mtp };
|
|
20976
|
+
return mtp;
|
|
20977
|
+
}
|
|
20978
|
+
/** Degrades to the tip's `nTime` rather than throwing — a caller that
|
|
20979
|
+
* cannot read the tip at all is worse off. */
|
|
20980
|
+
async readMedianTimePast(height, tipTime, hash) {
|
|
20981
|
+
const heights = [];
|
|
20982
|
+
for (let h = height - 1; h >= 0 && heights.length < MTP_WINDOW - 1; h--) heights.push(h);
|
|
20983
|
+
if (heights.length === 0) return tipTime;
|
|
20984
|
+
let timestamps;
|
|
20985
|
+
try {
|
|
20986
|
+
const headers = await this.chain.fetchBlockHeaders(heights);
|
|
20987
|
+
timestamps = [
|
|
20988
|
+
tipTime,
|
|
20989
|
+
...headers.map((header) => parseBlockHeader(header.hex).timestamp)
|
|
20990
|
+
];
|
|
20991
|
+
} catch (e) {
|
|
20992
|
+
console.warn(
|
|
20993
|
+
"Failed to fetch the median-time-past window; using the tip's own time",
|
|
20994
|
+
e
|
|
20995
|
+
);
|
|
20996
|
+
return tipTime;
|
|
20997
|
+
}
|
|
20998
|
+
timestamps.sort((a, b) => a - b);
|
|
20999
|
+
const mtp = timestamps[Math.floor(timestamps.length / 2)];
|
|
21000
|
+
this.mtpCache = { hash, mtp };
|
|
21001
|
+
return mtp;
|
|
21002
|
+
}
|
|
20693
21003
|
async watchAddresses(addresses, eventCallback) {
|
|
20694
21004
|
const scripts = addresses.map((addr) => this.encodeAddress(addr));
|
|
20695
21005
|
const scriptHashes = scripts.map(toScriptHash);
|
|
@@ -23313,6 +23623,33 @@ function tryResolveSendAmount(raw, amount) {
|
|
|
23313
23623
|
const amt = amount ?? BIP21.amountSats(raw);
|
|
23314
23624
|
return amt !== void 0 && Number.isInteger(amt) && amt > 0 ? amt : void 0;
|
|
23315
23625
|
}
|
|
23626
|
+
function assetsOf(req) {
|
|
23627
|
+
return req.assets ?? [];
|
|
23628
|
+
}
|
|
23629
|
+
function assertNoAssets(railId, req) {
|
|
23630
|
+
const assets = assetsOf(req);
|
|
23631
|
+
if (assets.length > 0) {
|
|
23632
|
+
throw new Error(
|
|
23633
|
+
`${railId}: cannot deliver ${assets.map((a) => a.assetId).join(", ")} \u2014 this rail moves BTC only`
|
|
23634
|
+
);
|
|
23635
|
+
}
|
|
23636
|
+
}
|
|
23637
|
+
function resolveAssetAmount(railId, req) {
|
|
23638
|
+
const assets = assetsOf(req);
|
|
23639
|
+
if (assets.length !== 1) {
|
|
23640
|
+
throw new Error(`${railId}: expected exactly one asset to pay, got ${assets.length}`);
|
|
23641
|
+
}
|
|
23642
|
+
const [asset] = assets;
|
|
23643
|
+
if (typeof asset.amount !== "bigint" || asset.amount <= 0n) {
|
|
23644
|
+
throw new Error(
|
|
23645
|
+
`${railId}: invalid amount ${String(asset.amount)} of ${asset.assetId} (expected a positive bigint of atomic units)`
|
|
23646
|
+
);
|
|
23647
|
+
}
|
|
23648
|
+
if (typeof asset.assetId !== "string" || asset.assetId.length === 0) {
|
|
23649
|
+
throw new Error(`${railId}: an asset amount must name an asset`);
|
|
23650
|
+
}
|
|
23651
|
+
return asset;
|
|
23652
|
+
}
|
|
23316
23653
|
|
|
23317
23654
|
// src/payment/handle.ts
|
|
23318
23655
|
function makeHandle(id, run) {
|
|
@@ -23435,8 +23772,10 @@ function arkRail() {
|
|
|
23435
23772
|
return {
|
|
23436
23773
|
id: "ark",
|
|
23437
23774
|
match: (req) => arkTarget(req.raw) !== void 0,
|
|
23775
|
+
available: (req) => assetsOf(req).length === 0,
|
|
23438
23776
|
quote: async (req, ctx) => {
|
|
23439
23777
|
const address = arkTarget(req.raw);
|
|
23778
|
+
assertNoAssets("ark", req);
|
|
23440
23779
|
const amt = resolveSendAmount("ark", req.raw, req.amount);
|
|
23441
23780
|
return {
|
|
23442
23781
|
railId: "ark",
|
|
@@ -23453,6 +23792,41 @@ function arkRail() {
|
|
|
23453
23792
|
}
|
|
23454
23793
|
};
|
|
23455
23794
|
}
|
|
23795
|
+
|
|
23796
|
+
// src/payment/rails/arkAsset.ts
|
|
23797
|
+
var ASSET_CARRIER_SATS = 330;
|
|
23798
|
+
function arkAssetRail() {
|
|
23799
|
+
return {
|
|
23800
|
+
id: "ark-asset",
|
|
23801
|
+
match: (req) => arkTarget(req.raw) !== void 0,
|
|
23802
|
+
// A malformed asset is `quote()`'s to name, not this rail's to drop.
|
|
23803
|
+
available: (req) => assetsOf(req).length > 0,
|
|
23804
|
+
quote: async (req, ctx) => {
|
|
23805
|
+
const address = arkTarget(req.raw);
|
|
23806
|
+
const asset = resolveAssetAmount("ark-asset", req);
|
|
23807
|
+
if (req.amount !== void 0) assertSendableAmount("ark-asset", req.amount);
|
|
23808
|
+
const carrier = tryResolveSendAmount(req.raw, req.amount) ?? ASSET_CARRIER_SATS;
|
|
23809
|
+
return {
|
|
23810
|
+
railId: "ark-asset",
|
|
23811
|
+
amount: carrier,
|
|
23812
|
+
fee: 0,
|
|
23813
|
+
total: carrier,
|
|
23814
|
+
assets: { delivered: asset, spent: asset },
|
|
23815
|
+
send: async () => makeHandle("ark-asset", async (emit) => {
|
|
23816
|
+
const txid = await ctx.wallet.send({
|
|
23817
|
+
address,
|
|
23818
|
+
amount: carrier,
|
|
23819
|
+
assets: [asset]
|
|
23820
|
+
});
|
|
23821
|
+
const result = { railId: "ark-asset", txid };
|
|
23822
|
+
emit({ status: "settled", result });
|
|
23823
|
+
return result;
|
|
23824
|
+
})
|
|
23825
|
+
};
|
|
23826
|
+
}
|
|
23827
|
+
};
|
|
23828
|
+
}
|
|
23829
|
+
var walletFeeSource = (wallet) => async () => (await wallet.arkProvider.getInfo()).fees;
|
|
23456
23830
|
var GROSS_UP_MAX_ROUNDS = 8;
|
|
23457
23831
|
function grossUpOffboard(net, feeInfo, script) {
|
|
23458
23832
|
const estimator = new Estimator(feeInfo?.intentFee ?? {});
|
|
@@ -23465,14 +23839,20 @@ function grossUpOffboard(net, feeInfo, script) {
|
|
|
23465
23839
|
}
|
|
23466
23840
|
return { gross, fee: gross - net };
|
|
23467
23841
|
}
|
|
23468
|
-
function onchainRail() {
|
|
23842
|
+
function onchainRail(deps) {
|
|
23843
|
+
if (typeof deps?.feeInfo !== "function") {
|
|
23844
|
+
throw new Error("onchain rail: a feeInfo source is required");
|
|
23845
|
+
}
|
|
23469
23846
|
return {
|
|
23470
23847
|
id: "onchain",
|
|
23471
23848
|
match: (req) => btcTarget(req.raw) !== void 0,
|
|
23849
|
+
// BTC only: an Arkade asset has no L1 representation to offboard to.
|
|
23850
|
+
available: (req) => assetsOf(req).length === 0,
|
|
23472
23851
|
quote: async (req, ctx) => {
|
|
23852
|
+
assertNoAssets("onchain", req);
|
|
23473
23853
|
const address = btcTarget(req.raw);
|
|
23474
23854
|
const amt = resolveSendAmount("onchain", req.raw, req.amount);
|
|
23475
|
-
const
|
|
23855
|
+
const fees = await deps.feeInfo();
|
|
23476
23856
|
const script = hex.encode(offboardDestinationScript(address));
|
|
23477
23857
|
const { gross, fee } = grossUpOffboard(amt, fees, script);
|
|
23478
23858
|
return {
|
|
@@ -23499,8 +23879,8 @@ function onchainRail() {
|
|
|
23499
23879
|
function createDefaultPaymentRouter(wallet) {
|
|
23500
23880
|
return new PaymentRouter({
|
|
23501
23881
|
wallet,
|
|
23502
|
-
prefs: { priority: ["ark", "lightning", "onchain"] }
|
|
23503
|
-
}).use(arkRail()).use(onchainRail());
|
|
23882
|
+
prefs: { priority: ["ark", "ark-asset", "lightning", "onchain"] }
|
|
23883
|
+
}).use(arkRail()).use(arkAssetRail()).use(onchainRail({ feeInfo: walletFeeSource(wallet) }));
|
|
23504
23884
|
}
|
|
23505
23885
|
/*! Bundled license information:
|
|
23506
23886
|
|
|
@@ -23508,6 +23888,6 @@ function createDefaultPaymentRouter(wallet) {
|
|
|
23508
23888
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
23509
23889
|
*/
|
|
23510
23890
|
|
|
23511
|
-
export { ARKADE_MAGIC, ARKADE_SALTED_PREIMAGE_TAG, ARKADE_SWAP_PREIMAGE_TAG, 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, arkRail, arkTarget, arkade_exports, assertFinalCommitmentMatchesValidated, assertIntentIdUnique, assertSendableAmount, assertSubmittedArkTxid, assertValidBatchExpiry, assertValidServerUnrollScript, assetMintResolver, 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, 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, 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, warnAndFilterVtxosForScript, withPrevTxs };
|
|
23512
|
-
//# sourceMappingURL=chunk-
|
|
23513
|
-
//# sourceMappingURL=chunk-
|
|
23891
|
+
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, 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 };
|
|
23892
|
+
//# sourceMappingURL=chunk-JVHO6XHG.js.map
|
|
23893
|
+
//# sourceMappingURL=chunk-JVHO6XHG.js.map
|