@arkade-os/sdk 0.4.61 → 0.4.63
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 +20 -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-BWDxp3Dr.d.cts → asyncStorageTaskQueue-CIUEhv2t.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-Cq9FpKv6.d.ts → asyncStorageTaskQueue-LT-xvvDN.d.ts} +2 -2
- package/dist/{chunk-FNCQJLR2.cjs → chunk-AB67CMHS.cjs} +3 -3
- package/dist/{chunk-FNCQJLR2.cjs.map → chunk-AB67CMHS.cjs.map} +1 -1
- package/dist/{chunk-3NUDA3MB.cjs → chunk-COOBS7ET.cjs} +646 -476
- package/dist/chunk-COOBS7ET.cjs.map +1 -0
- package/dist/{chunk-YVQNHELA.js → chunk-CZFAMS57.js} +3 -3
- package/dist/{chunk-YVQNHELA.js.map → chunk-CZFAMS57.js.map} +1 -1
- package/dist/{chunk-GDI2A65Z.js → chunk-FKKERGKA.js} +4 -4
- package/dist/{chunk-GDI2A65Z.js.map → chunk-FKKERGKA.js.map} +1 -1
- package/dist/{chunk-XMRB74HA.cjs → chunk-K56BNZV3.cjs} +10 -10
- package/dist/{chunk-XMRB74HA.cjs.map → chunk-K56BNZV3.cjs.map} +1 -1
- package/dist/{chunk-XLHN5L2O.js → chunk-KWW74O2F.js} +4 -4
- package/dist/{chunk-XLHN5L2O.js.map → chunk-KWW74O2F.js.map} +1 -1
- package/dist/{chunk-2JHN5RCY.cjs → chunk-LG5GY73A.cjs} +17 -17
- package/dist/{chunk-2JHN5RCY.cjs.map → chunk-LG5GY73A.cjs.map} +1 -1
- package/dist/{chunk-PVY6DMN5.js → chunk-MA32NXUV.js} +3 -3
- package/dist/{chunk-PVY6DMN5.js.map → chunk-MA32NXUV.js.map} +1 -1
- package/dist/{chunk-6O5OLYTZ.js → chunk-OAESYVZQ.js} +3 -3
- package/dist/{chunk-6O5OLYTZ.js.map → chunk-OAESYVZQ.js.map} +1 -1
- package/dist/{chunk-SF5NKAUA.cjs → chunk-OL7V43WS.cjs} +48 -48
- package/dist/{chunk-SF5NKAUA.cjs.map → chunk-OL7V43WS.cjs.map} +1 -1
- package/dist/{chunk-XFYFREPH.cjs → chunk-P6XYE27K.cjs} +17 -17
- package/dist/{chunk-XFYFREPH.cjs.map → chunk-P6XYE27K.cjs.map} +1 -1
- package/dist/{chunk-AUEXB42T.js → chunk-X7MMBB7S.js} +252 -84
- package/dist/chunk-X7MMBB7S.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-C4Rl6h9l.d.cts → delegate-BBQW61ym.d.cts} +1 -1
- package/dist/{delegate-BySzD37I.d.ts → delegate-Dv_9OVHv.d.ts} +1 -1
- package/dist/{index-C29VNcxC.d.ts → index-Bxe9kBFs.d.ts} +2 -2
- package/dist/{index-BcRCHnzN.d.cts → index-CFOMyVMt.d.cts} +88 -12
- package/dist/{index-BcRCHnzN.d.ts → index-CFOMyVMt.d.ts} +88 -12
- package/dist/{index-Butfkm-K.d.cts → index-aZycGEsQ.d.cts} +2 -2
- package/dist/index.cjs +274 -266
- package/dist/index.d.cts +116 -20
- package/dist/index.d.ts +116 -20
- 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 +27 -18
- package/dist/repositories/sqlite/index.cjs.map +1 -1
- package/dist/repositories/sqlite/index.d.cts +20 -3
- package/dist/repositories/sqlite/index.d.ts +20 -3
- package/dist/repositories/sqlite/index.js +13 -6
- package/dist/repositories/sqlite/index.js.map +1 -1
- package/dist/{taskRunner-BTq3rMpI.d.cts → taskRunner-BJ6_AnLq.d.cts} +2 -2
- package/dist/{taskRunner-DxMJYJ7Y.d.ts → taskRunner-BQb0W1XG.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 +16 -16
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +5 -5
- package/dist/wallet/expo/index.d.ts +5 -5
- package/dist/wallet/expo/index.js +7 -7
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/{wallet-BVIfg2ic.d.ts → wallet-C2NvHjWB.d.cts} +14 -5
- package/dist/{wallet-DrSsUden.d.cts → wallet-DJUnN939.d.ts} +14 -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-3NUDA3MB.cjs.map +0 -1
- package/dist/chunk-AUEXB42T.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, inputName, contractHandlers, isMainnetDescriptor, descriptorIsOurs, deriveDescriptorLeafPubKey, deriveDescriptorLeafCompressedPubKey, parseHDDescriptor, DefaultVtxo, speculativeReceiveMetadata, DelegateVtxo, WALLET_RECEIVE_SOURCE, BoardingContractHandler, identityDescriptor } 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, sequenceToTimelock, decodeTapscript, scriptFromTapLeafScript, CLTVMultisigTapscript, VtxoTaprootTree, timelockToSequence, baseFetch, Intent, rateGate, DEFAULT_NETWORK_NAME, normalizeVtxo, getSequence, toBatchExpiry, maybeArkError, isArkError, ArkErrorName, toOffchainInputFeeParams, canRecoverOnchain, getNetwork, MultisigTapscript, isEventSourceError, isEventSourceUnavailableError, isRetryableProviderError, getAllNormalizedVtxos, DEFAULT_PAGE_SIZE, RestArkProvider, toVirtualStatus, ArkError, resolveTimeHeight, canSpendOffchain, parseLegacyExpiry, isExpired, 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-CZFAMS57.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, inputName, contractHandlers, isMainnetDescriptor, descriptorIsOurs, deriveDescriptorLeafPubKey, deriveDescriptorLeafCompressedPubKey, parseHDDescriptor, DefaultVtxo, speculativeReceiveMetadata, DelegateVtxo, WALLET_RECEIVE_SOURCE, BoardingContractHandler, identityDescriptor } from './chunk-OAESYVZQ.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, sequenceToTimelock, decodeTapscript, scriptFromTapLeafScript, CLTVMultisigTapscript, VtxoTaprootTree, timelockToSequence, baseFetch, Intent, rateGate, DEFAULT_NETWORK_NAME, 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, DEFAULT_ARKADE_SERVER_URL, ProviderUnavailableError, networks as networks$1, isPastExpiry, fetchVtxoCreatedAtByTxid } from './chunk-MA32NXUV.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';
|
|
@@ -332,6 +332,18 @@ var SingleKey = class _SingleKey {
|
|
|
332
332
|
if (signatureType === "ecdsa") return signAsync(message, this.key, { prehash: false });
|
|
333
333
|
return schnorr$1.signAsync(message, this.key);
|
|
334
334
|
}
|
|
335
|
+
/**
|
|
336
|
+
* BIP-340 sign `messageHash` with aux_rand = 0, so the signature — and
|
|
337
|
+
* anything derived from it — is reproducible from the key alone.
|
|
338
|
+
*
|
|
339
|
+
* What lets a static wallet derive a swap preimage instead of storing one
|
|
340
|
+
* (see `wallet/contractSecrets.ts`). Deliberately NOT `signMessage`, whose
|
|
341
|
+
* schnorr branch draws a random aux_rand: a preimage derived from that is
|
|
342
|
+
* unrecoverable, and the loss would only surface at claim time.
|
|
343
|
+
*/
|
|
344
|
+
async signSchnorrDeterministic(messageHash) {
|
|
345
|
+
return schnorr$1.signAsync(messageHash, this.key, new Uint8Array(32));
|
|
346
|
+
}
|
|
335
347
|
async toReadonly() {
|
|
336
348
|
return new ReadonlySingleKey(await this.compressedPublicKey());
|
|
337
349
|
}
|
|
@@ -461,6 +473,19 @@ var SeedIdentity = class _SeedIdentity {
|
|
|
461
473
|
async signMessage(message, signatureType = "schnorr") {
|
|
462
474
|
return this.signMessageWithKey(this.derivedKey, message, signatureType);
|
|
463
475
|
}
|
|
476
|
+
/**
|
|
477
|
+
* BIP-340 sign `messageHash` with this identity's own key, aux_rand = 0.
|
|
478
|
+
*
|
|
479
|
+
* The descriptor-less sibling of
|
|
480
|
+
* {@link signSchnorrDeterministicWithDescriptor}, for an `auto`-mode wallet
|
|
481
|
+
* whose bare `tr(pubkey)` resolves to the identity itself rather than to a
|
|
482
|
+
* {@link DescriptorIdentity}. Deliberately NOT routed through
|
|
483
|
+
* `signMessage`, whose schnorr branch draws a random aux_rand and would
|
|
484
|
+
* make the "deterministic" signature unreproducible.
|
|
485
|
+
*/
|
|
486
|
+
async signSchnorrDeterministic(messageHash) {
|
|
487
|
+
return schnorr$1.signAsync(messageHash, this.derivedKey, new Uint8Array(32));
|
|
488
|
+
}
|
|
464
489
|
signerSession() {
|
|
465
490
|
return TreeSignerSession.random();
|
|
466
491
|
}
|
|
@@ -1239,6 +1264,7 @@ var sha256 = /* @__PURE__ */ createHasher(
|
|
|
1239
1264
|
/* @__PURE__ */ oidNist(1)
|
|
1240
1265
|
);
|
|
1241
1266
|
var ARKADE_SWAP_PREIMAGE_TAG = "Arkade-RFQ-Preimage-v1";
|
|
1267
|
+
var ARKADE_SALTED_PREIMAGE_TAG = "Arkade-Contract-Preimage-Salted-v1";
|
|
1242
1268
|
function buildPreimageMessage(xonly, index) {
|
|
1243
1269
|
if (xonly.length !== 32) {
|
|
1244
1270
|
throw new Error(`x-only pubkey must be 32 bytes, got ${xonly.length}`);
|
|
@@ -1253,6 +1279,20 @@ function buildPreimageMessage(xonly, index) {
|
|
|
1253
1279
|
new DataView(message.buffer).setUint32(tag.length + 32, index, true);
|
|
1254
1280
|
return message;
|
|
1255
1281
|
}
|
|
1282
|
+
function buildSaltedPreimageMessage(xonly, salt) {
|
|
1283
|
+
if (xonly.length !== 32) {
|
|
1284
|
+
throw new Error(`x-only pubkey must be 32 bytes, got ${xonly.length}`);
|
|
1285
|
+
}
|
|
1286
|
+
if (salt.length !== 32) {
|
|
1287
|
+
throw new Error(`preimage salt must be 32 bytes, got ${salt.length}`);
|
|
1288
|
+
}
|
|
1289
|
+
const tag = new TextEncoder().encode(ARKADE_SALTED_PREIMAGE_TAG);
|
|
1290
|
+
const message = new Uint8Array(tag.length + 32 + 32);
|
|
1291
|
+
message.set(tag, 0);
|
|
1292
|
+
message.set(xonly, tag.length);
|
|
1293
|
+
message.set(salt, tag.length + 32);
|
|
1294
|
+
return message;
|
|
1295
|
+
}
|
|
1256
1296
|
var PREIMAGE_INDEX = 0;
|
|
1257
1297
|
function isPerArtifactDescriptor(descriptor) {
|
|
1258
1298
|
return parseHDDescriptor(descriptor) !== null;
|
|
@@ -1271,14 +1311,36 @@ async function provisionClaimSecret(wallet, opts = {}) {
|
|
|
1271
1311
|
throw new Error(`preimage must be 32 bytes, got ${opts.preimage.length}`);
|
|
1272
1312
|
}
|
|
1273
1313
|
const { descriptor, pubkey } = await provisionRefundKey(wallet);
|
|
1274
|
-
const
|
|
1275
|
-
|
|
1314
|
+
const claim = async () => {
|
|
1315
|
+
if (opts.preimage) return { preimage: opts.preimage, mustPersistPreimage: true };
|
|
1316
|
+
if (isPerArtifactDescriptor(descriptor)) {
|
|
1317
|
+
return {
|
|
1318
|
+
preimage: await derivePreimage(wallet, descriptor),
|
|
1319
|
+
mustPersistPreimage: false
|
|
1320
|
+
};
|
|
1321
|
+
}
|
|
1322
|
+
const preimageSalt2 = randomBytes(32);
|
|
1323
|
+
try {
|
|
1324
|
+
return {
|
|
1325
|
+
preimage: await derivePreimage(wallet, descriptor, preimageSalt2),
|
|
1326
|
+
preimageSalt: preimageSalt2,
|
|
1327
|
+
mustPersistPreimage: false
|
|
1328
|
+
};
|
|
1329
|
+
} catch (cause) {
|
|
1330
|
+
if (cause instanceof ForeignDescriptorError || cause instanceof WalletCannotSignError) {
|
|
1331
|
+
throw cause;
|
|
1332
|
+
}
|
|
1333
|
+
return { preimage: randomBytes(32), mustPersistPreimage: true };
|
|
1334
|
+
}
|
|
1335
|
+
};
|
|
1336
|
+
const { preimage, preimageSalt, mustPersistPreimage } = await claim();
|
|
1276
1337
|
return {
|
|
1277
1338
|
descriptor,
|
|
1278
1339
|
pubkey,
|
|
1279
1340
|
preimage,
|
|
1280
1341
|
paymentHash: sha256(preimage),
|
|
1281
|
-
|
|
1342
|
+
...preimageSalt ? { preimageSalt } : {},
|
|
1343
|
+
mustPersistPreimage
|
|
1282
1344
|
};
|
|
1283
1345
|
}
|
|
1284
1346
|
async function contractSigner(wallet, descriptor) {
|
|
@@ -1302,33 +1364,33 @@ var WalletCannotSignError = class extends Error {
|
|
|
1302
1364
|
descriptor;
|
|
1303
1365
|
name = "WalletCannotSignError";
|
|
1304
1366
|
};
|
|
1305
|
-
async function contractPreimage(wallet, descriptor,
|
|
1306
|
-
if (stored) {
|
|
1307
|
-
if (stored.length !== 32) {
|
|
1308
|
-
throw new Error(`stored preimage must be 32 bytes, got ${stored.length}`);
|
|
1367
|
+
async function contractPreimage(wallet, descriptor, opts = {}) {
|
|
1368
|
+
if (opts.stored) {
|
|
1369
|
+
if (opts.stored.length !== 32) {
|
|
1370
|
+
throw new Error(`stored preimage must be 32 bytes, got ${opts.stored.length}`);
|
|
1309
1371
|
}
|
|
1310
|
-
return stored;
|
|
1311
|
-
}
|
|
1312
|
-
if (!isPerArtifactDescriptor(descriptor)) {
|
|
1313
|
-
throw new Error(
|
|
1314
|
-
`descriptor ${descriptor} names no single artifact, so its preimage cannot be derived; none was stored`
|
|
1315
|
-
);
|
|
1372
|
+
return opts.stored;
|
|
1316
1373
|
}
|
|
1317
|
-
return derivePreimage(wallet, descriptor);
|
|
1374
|
+
if (isPerArtifactDescriptor(descriptor)) return derivePreimage(wallet, descriptor);
|
|
1375
|
+
if (opts.salt) return derivePreimage(wallet, descriptor, opts.salt);
|
|
1376
|
+
throw new Error(
|
|
1377
|
+
`descriptor ${descriptor} names no single artifact, so its preimage cannot be derived; no salt and no stored preimage were given`
|
|
1378
|
+
);
|
|
1318
1379
|
}
|
|
1319
1380
|
function isDeterministicSigner(value) {
|
|
1320
1381
|
if (typeof value !== "object" || value === null) return false;
|
|
1321
1382
|
const v = value;
|
|
1322
1383
|
return typeof v.signSchnorrDeterministic === "function" && typeof v.xOnlyPublicKey === "function";
|
|
1323
1384
|
}
|
|
1324
|
-
async function derivePreimage(wallet, descriptor) {
|
|
1385
|
+
async function derivePreimage(wallet, descriptor, salt) {
|
|
1325
1386
|
const signer = await contractSigner(wallet, descriptor);
|
|
1326
1387
|
if (!isDeterministicSigner(signer)) {
|
|
1327
1388
|
throw new Error(
|
|
1328
1389
|
`wallet cannot sign deterministically for ${descriptor}; its preimage is not derivable`
|
|
1329
1390
|
);
|
|
1330
1391
|
}
|
|
1331
|
-
const
|
|
1392
|
+
const xonly = await signer.xOnlyPublicKey();
|
|
1393
|
+
const message = salt ? buildSaltedPreimageMessage(xonly, salt) : buildPreimageMessage(xonly, PREIMAGE_INDEX);
|
|
1332
1394
|
try {
|
|
1333
1395
|
return sha256(await signer.signSchnorrDeterministic(sha256(message)));
|
|
1334
1396
|
} catch (cause) {
|
|
@@ -2501,6 +2563,7 @@ async function buildActivities(txs, resolvers) {
|
|
|
2501
2563
|
groupId: a.groupId,
|
|
2502
2564
|
label: a.label ?? b.label,
|
|
2503
2565
|
kind: a.kind ?? b.kind,
|
|
2566
|
+
outcome: a.outcome ?? b.outcome,
|
|
2504
2567
|
metadata: { ...b.metadata, ...a.metadata },
|
|
2505
2568
|
amount: a.amount ?? b.amount
|
|
2506
2569
|
});
|
|
@@ -2538,6 +2601,7 @@ async function buildActivities(txs, resolvers) {
|
|
|
2538
2601
|
b.intent = {
|
|
2539
2602
|
label: b.intent?.label ?? m.label,
|
|
2540
2603
|
kind: b.intent?.kind ?? m.kind,
|
|
2604
|
+
outcome: b.intent?.outcome ?? m.outcome,
|
|
2541
2605
|
metadata: { ...m.metadata, ...b.intent?.metadata }
|
|
2542
2606
|
};
|
|
2543
2607
|
b.members.push({ tx, amount: signedAmount(tx, m.amount ?? tx.amount) });
|
|
@@ -3554,6 +3618,21 @@ function assertRecipientArkAddress(encoded, address, context) {
|
|
|
3554
3618
|
);
|
|
3555
3619
|
}
|
|
3556
3620
|
}
|
|
3621
|
+
function assertTapTreeDerivesAddress(encoded, tapTree, address) {
|
|
3622
|
+
let derived;
|
|
3623
|
+
try {
|
|
3624
|
+
derived = VtxoScript.decode(tapTree).pkScript;
|
|
3625
|
+
} catch (e) {
|
|
3626
|
+
throw new Error(
|
|
3627
|
+
`Invalid tapTree for ${encoded}: ${e instanceof Error ? e.message : String(e)}`
|
|
3628
|
+
);
|
|
3629
|
+
}
|
|
3630
|
+
if (hex.encode(derived) !== hex.encode(address.pkScript)) {
|
|
3631
|
+
throw new Error(
|
|
3632
|
+
`Invalid tapTree for ${encoded}: derives ${hex.encode(derived)}, address is ${hex.encode(address.pkScript)}. Expected VtxoScript.encode() form: leaf depths are ignored and the tree is rebuilt in arkd's canonical shape.`
|
|
3633
|
+
);
|
|
3634
|
+
}
|
|
3635
|
+
}
|
|
3557
3636
|
function validateRecipients(recipients, dustAmount, context) {
|
|
3558
3637
|
const validatedRecipients = [];
|
|
3559
3638
|
for (const recipient of recipients) {
|
|
@@ -3568,11 +3647,15 @@ function validateRecipients(recipients, dustAmount, context) {
|
|
|
3568
3647
|
if (amount <= 0) {
|
|
3569
3648
|
throw new Error("Amount must be positive");
|
|
3570
3649
|
}
|
|
3650
|
+
if (recipient.tapTree) {
|
|
3651
|
+
assertTapTreeDerivesAddress(recipient.address, recipient.tapTree, address);
|
|
3652
|
+
}
|
|
3571
3653
|
validatedRecipients.push({
|
|
3572
3654
|
address: recipient.address,
|
|
3573
3655
|
assets: recipient.assets ?? [],
|
|
3574
3656
|
amount,
|
|
3575
|
-
script: amount < dustAmount ? address.subdustPkScript : address.pkScript
|
|
3657
|
+
script: amount < dustAmount ? address.subdustPkScript : address.pkScript,
|
|
3658
|
+
tapTree: recipient.tapTree
|
|
3576
3659
|
});
|
|
3577
3660
|
}
|
|
3578
3661
|
return validatedRecipients;
|
|
@@ -3593,6 +3676,9 @@ function gateExclusion(gated) {
|
|
|
3593
3676
|
return (vtxo) => {
|
|
3594
3677
|
const type = vtxo.script === void 0 ? void 0 : gated.get(vtxo.script);
|
|
3595
3678
|
if (type === void 0) return void 0;
|
|
3679
|
+
if (!contractHandlers.has(type)) {
|
|
3680
|
+
return `at ${vtxo.script} (contract type '${type}') has no handler registered in this build`;
|
|
3681
|
+
}
|
|
3596
3682
|
return `at ${vtxo.script} (contract type '${type}') is not generically spendable`;
|
|
3597
3683
|
};
|
|
3598
3684
|
}
|
|
@@ -11764,6 +11850,8 @@ function computeOffchainBalance(vtxos, caps) {
|
|
|
11764
11850
|
let settled = 0;
|
|
11765
11851
|
let preconfirmed = 0;
|
|
11766
11852
|
let available = 0;
|
|
11853
|
+
let gated = 0;
|
|
11854
|
+
let intentLocked = 0;
|
|
11767
11855
|
let recoverable = 0;
|
|
11768
11856
|
let pendingRecovery = 0;
|
|
11769
11857
|
const owned = /* @__PURE__ */ new Map();
|
|
@@ -11790,7 +11878,11 @@ function computeOffchainBalance(vtxos, caps) {
|
|
|
11790
11878
|
} else {
|
|
11791
11879
|
settled += vtxo.value;
|
|
11792
11880
|
}
|
|
11793
|
-
if (isGenericallySpendable(vtxo)
|
|
11881
|
+
if (!isGenericallySpendable(vtxo)) {
|
|
11882
|
+
gated += vtxo.value;
|
|
11883
|
+
} else if (!isUnlocked(vtxo)) {
|
|
11884
|
+
intentLocked += vtxo.value;
|
|
11885
|
+
} else {
|
|
11794
11886
|
available += vtxo.value;
|
|
11795
11887
|
addAssets(spendable, vtxo);
|
|
11796
11888
|
}
|
|
@@ -11800,6 +11892,8 @@ function computeOffchainBalance(vtxos, caps) {
|
|
|
11800
11892
|
settled,
|
|
11801
11893
|
preconfirmed,
|
|
11802
11894
|
available,
|
|
11895
|
+
gated,
|
|
11896
|
+
intentLocked,
|
|
11803
11897
|
recoverable,
|
|
11804
11898
|
pendingRecovery,
|
|
11805
11899
|
total: settled + preconfirmed + recoverable + pendingRecovery,
|
|
@@ -11956,6 +12050,17 @@ function intentProofJobs(coins) {
|
|
|
11956
12050
|
}));
|
|
11957
12051
|
return [{ index: 0, lookupScript: coinJobs[0].lookupScript }, ...coinJobs];
|
|
11958
12052
|
}
|
|
12053
|
+
function asSendParams(args) {
|
|
12054
|
+
const [first] = args;
|
|
12055
|
+
if (args.length === 1 && first && "recipients" in first) {
|
|
12056
|
+
const params = first;
|
|
12057
|
+
if (params.recipients.length === 0) {
|
|
12058
|
+
throw new Error("At least one receiver is required");
|
|
12059
|
+
}
|
|
12060
|
+
return params;
|
|
12061
|
+
}
|
|
12062
|
+
return { recipients: args };
|
|
12063
|
+
}
|
|
11959
12064
|
function extractArkProviderUrl(provider) {
|
|
11960
12065
|
const serverUrl = provider.serverUrl;
|
|
11961
12066
|
return typeof serverUrl === "string" && serverUrl.length > 0 ? serverUrl : void 0;
|
|
@@ -12552,6 +12657,8 @@ var ReadonlyWallet = class _ReadonlyWallet {
|
|
|
12552
12657
|
settled: offchain.settled,
|
|
12553
12658
|
preconfirmed: offchain.preconfirmed,
|
|
12554
12659
|
available: offchain.available,
|
|
12660
|
+
gated: offchain.gated,
|
|
12661
|
+
intentLocked: offchain.intentLocked,
|
|
12555
12662
|
recoverable: offchain.recoverable,
|
|
12556
12663
|
pendingRecovery: offchain.pendingRecovery,
|
|
12557
12664
|
total: totalBoarding + offchain.total,
|
|
@@ -15291,10 +15398,13 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
|
|
|
15291
15398
|
return total;
|
|
15292
15399
|
}
|
|
15293
15400
|
/**
|
|
15294
|
-
* Send BTC and/or assets to one or more recipients
|
|
15401
|
+
* Send BTC and/or assets to one or more recipients, passed either as
|
|
15402
|
+
* variadic `Recipient`s or as a single `SendParams` object — the latter
|
|
15403
|
+
* also carries the virtual outputs to spend.
|
|
15295
15404
|
*
|
|
15296
|
-
* @param args - Recipients
|
|
15405
|
+
* @param args - Recipients, or a `SendParams` object
|
|
15297
15406
|
* @returns Promise resolving to the Arkade transaction ID
|
|
15407
|
+
* @see SendParams
|
|
15298
15408
|
*
|
|
15299
15409
|
* @example
|
|
15300
15410
|
* ```typescript
|
|
@@ -15303,15 +15413,28 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
|
|
|
15303
15413
|
* amount: 1000, // (optional, default to dust) btc amount to send to the output
|
|
15304
15414
|
* assets: [{ assetId: 'abc123...', amount: 50n }] // (optional) list of assets to send
|
|
15305
15415
|
* });
|
|
15416
|
+
*
|
|
15417
|
+
* // choosing the inputs as well as the outputs
|
|
15418
|
+
* const txid = await wallet.send({
|
|
15419
|
+
* recipients: [{ address: 'ark1q...', amount: 1000 }],
|
|
15420
|
+
* selectedVtxos: mine, // spent as given, nothing added
|
|
15421
|
+
* });
|
|
15306
15422
|
* ```
|
|
15307
15423
|
*/
|
|
15308
15424
|
async send(...args) {
|
|
15309
|
-
|
|
15425
|
+
const params = asSendParams(args);
|
|
15426
|
+
return this._withTxLock(() => this._sendImpl(params));
|
|
15310
15427
|
}
|
|
15311
|
-
async _sendImpl(
|
|
15428
|
+
async _sendImpl({ recipients: args, selectedVtxos }) {
|
|
15312
15429
|
if (args.length === 0) {
|
|
15313
15430
|
throw new Error("At least one receiver is required");
|
|
15314
15431
|
}
|
|
15432
|
+
if (selectedVtxos && selectedVtxos.length === 0) {
|
|
15433
|
+
throw new Error("send({ selectedVtxos }): no inputs");
|
|
15434
|
+
}
|
|
15435
|
+
if (selectedVtxos) {
|
|
15436
|
+
void this.logUngatedInputs("send({ selectedVtxos })", selectedVtxos);
|
|
15437
|
+
}
|
|
15315
15438
|
const offchainTapscript = this.offchainTapscript;
|
|
15316
15439
|
const serverPubKey = this.arkServerPublicKey;
|
|
15317
15440
|
const serverUnrollScript = this.serverUnrollScript;
|
|
@@ -15322,84 +15445,123 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
|
|
|
15322
15445
|
Number(this.dustAmount),
|
|
15323
15446
|
this.recipientAddressContext(serverPubKey)
|
|
15324
15447
|
);
|
|
15325
|
-
|
|
15326
|
-
|
|
15327
|
-
|
|
15448
|
+
let virtualCoins = [];
|
|
15449
|
+
if (!selectedVtxos) {
|
|
15450
|
+
virtualCoins = await this.getSpendableVtxos({
|
|
15451
|
+
withRecoverable: false
|
|
15452
|
+
});
|
|
15453
|
+
}
|
|
15328
15454
|
const assetChanges = /* @__PURE__ */ new Map();
|
|
15329
|
-
let selectedCoins = [];
|
|
15455
|
+
let selectedCoins = selectedVtxos ? [...selectedVtxos] : [];
|
|
15330
15456
|
let btcAmountToSelect = 0;
|
|
15331
15457
|
for (const recipient of recipients) {
|
|
15332
15458
|
btcAmountToSelect += Math.max(recipient.amount, Number(this.dustAmount));
|
|
15333
15459
|
}
|
|
15334
|
-
|
|
15335
|
-
|
|
15336
|
-
|
|
15460
|
+
if (selectedVtxos) {
|
|
15461
|
+
for (const coin of selectedCoins) {
|
|
15462
|
+
for (const asset of coin.assets ?? []) {
|
|
15463
|
+
const existing = assetChanges.get(asset.assetId) ?? 0n;
|
|
15464
|
+
assetChanges.set(asset.assetId, existing + asset.amount);
|
|
15465
|
+
}
|
|
15337
15466
|
}
|
|
15338
|
-
for (const
|
|
15339
|
-
|
|
15340
|
-
|
|
15341
|
-
|
|
15342
|
-
|
|
15343
|
-
|
|
15344
|
-
|
|
15467
|
+
for (const recipient of recipients) {
|
|
15468
|
+
for (const asset of recipient.assets) {
|
|
15469
|
+
const remaining = (assetChanges.get(asset.assetId) ?? 0n) - asset.amount;
|
|
15470
|
+
if (remaining < 0n) {
|
|
15471
|
+
throw new Error(
|
|
15472
|
+
`send({ selectedVtxos }): inputs are short ${-remaining} of asset ${asset.assetId}`
|
|
15473
|
+
);
|
|
15474
|
+
}
|
|
15475
|
+
if (remaining === 0n) {
|
|
15476
|
+
assetChanges.delete(asset.assetId);
|
|
15477
|
+
} else {
|
|
15478
|
+
assetChanges.set(asset.assetId, remaining);
|
|
15345
15479
|
}
|
|
15480
|
+
}
|
|
15481
|
+
}
|
|
15482
|
+
} else {
|
|
15483
|
+
for (const recipient of recipients) {
|
|
15484
|
+
if (!recipient.assets) {
|
|
15346
15485
|
continue;
|
|
15347
15486
|
}
|
|
15348
|
-
|
|
15349
|
-
amountToSelect
|
|
15350
|
-
assetChanges.
|
|
15487
|
+
for (const receiverAsset of recipient.assets) {
|
|
15488
|
+
let amountToSelect = receiverAsset.amount;
|
|
15489
|
+
const existingChange = assetChanges.get(receiverAsset.assetId) ?? 0n;
|
|
15490
|
+
if (existingChange >= amountToSelect) {
|
|
15491
|
+
assetChanges.set(receiverAsset.assetId, existingChange - amountToSelect);
|
|
15492
|
+
if (assetChanges.get(receiverAsset.assetId) === 0n) {
|
|
15493
|
+
assetChanges.delete(receiverAsset.assetId);
|
|
15494
|
+
}
|
|
15495
|
+
continue;
|
|
15496
|
+
}
|
|
15497
|
+
if (existingChange > 0n) {
|
|
15498
|
+
amountToSelect -= existingChange;
|
|
15499
|
+
assetChanges.delete(receiverAsset.assetId);
|
|
15500
|
+
}
|
|
15501
|
+
const availableCoins = virtualCoins.filter(
|
|
15502
|
+
(c) => !selectedCoins.find((sc) => sc.txid === c.txid && sc.vout === c.vout)
|
|
15503
|
+
);
|
|
15504
|
+
const { selected, totalAssetAmount } = selectCoinsWithAsset(
|
|
15505
|
+
availableCoins,
|
|
15506
|
+
receiverAsset.assetId,
|
|
15507
|
+
amountToSelect
|
|
15508
|
+
);
|
|
15509
|
+
for (const coin of selected) {
|
|
15510
|
+
selectedCoins.push(coin);
|
|
15511
|
+
btcAmountToSelect -= coin.value;
|
|
15512
|
+
if (coin.assets) {
|
|
15513
|
+
for (const a of coin.assets) {
|
|
15514
|
+
if (a.assetId === receiverAsset.assetId) {
|
|
15515
|
+
continue;
|
|
15516
|
+
}
|
|
15517
|
+
const existing = assetChanges.get(a.assetId) ?? 0n;
|
|
15518
|
+
assetChanges.set(a.assetId, existing + a.amount);
|
|
15519
|
+
}
|
|
15520
|
+
}
|
|
15521
|
+
}
|
|
15522
|
+
const assetChangeAmount = totalAssetAmount - amountToSelect;
|
|
15523
|
+
if (assetChangeAmount > 0n) {
|
|
15524
|
+
const existing = assetChanges.get(receiverAsset.assetId) ?? 0n;
|
|
15525
|
+
assetChanges.set(receiverAsset.assetId, existing + assetChangeAmount);
|
|
15526
|
+
}
|
|
15351
15527
|
}
|
|
15528
|
+
}
|
|
15529
|
+
if (btcAmountToSelect > 0) {
|
|
15352
15530
|
const availableCoins = virtualCoins.filter(
|
|
15353
15531
|
(c) => !selectedCoins.find((sc) => sc.txid === c.txid && sc.vout === c.vout)
|
|
15354
15532
|
);
|
|
15355
|
-
const {
|
|
15356
|
-
|
|
15357
|
-
receiverAsset.assetId,
|
|
15358
|
-
amountToSelect
|
|
15359
|
-
);
|
|
15360
|
-
for (const coin of selected) {
|
|
15361
|
-
selectedCoins.push(coin);
|
|
15362
|
-
btcAmountToSelect -= coin.value;
|
|
15533
|
+
const { inputs: btcCoins } = selectVirtualCoins(availableCoins, btcAmountToSelect);
|
|
15534
|
+
for (const coin of btcCoins) {
|
|
15363
15535
|
if (coin.assets) {
|
|
15364
|
-
for (const
|
|
15365
|
-
|
|
15366
|
-
|
|
15367
|
-
}
|
|
15368
|
-
const existing = assetChanges.get(a.assetId) ?? 0n;
|
|
15369
|
-
assetChanges.set(a.assetId, existing + a.amount);
|
|
15536
|
+
for (const asset of coin.assets) {
|
|
15537
|
+
const existing = assetChanges.get(asset.assetId) ?? 0n;
|
|
15538
|
+
assetChanges.set(asset.assetId, existing + asset.amount);
|
|
15370
15539
|
}
|
|
15371
15540
|
}
|
|
15372
15541
|
}
|
|
15373
|
-
|
|
15374
|
-
if (assetChangeAmount > 0n) {
|
|
15375
|
-
const existing = assetChanges.get(receiverAsset.assetId) ?? 0n;
|
|
15376
|
-
assetChanges.set(receiverAsset.assetId, existing + assetChangeAmount);
|
|
15377
|
-
}
|
|
15542
|
+
selectedCoins = [...selectedCoins, ...btcCoins];
|
|
15378
15543
|
}
|
|
15379
15544
|
}
|
|
15380
|
-
if (btcAmountToSelect > 0) {
|
|
15381
|
-
const availableCoins = virtualCoins.filter(
|
|
15382
|
-
(c) => !selectedCoins.find((sc) => sc.txid === c.txid && sc.vout === c.vout)
|
|
15383
|
-
);
|
|
15384
|
-
const { inputs: btcCoins } = selectVirtualCoins(availableCoins, btcAmountToSelect);
|
|
15385
|
-
for (const coin of btcCoins) {
|
|
15386
|
-
if (coin.assets) {
|
|
15387
|
-
for (const asset of coin.assets) {
|
|
15388
|
-
const existing = assetChanges.get(asset.assetId) ?? 0n;
|
|
15389
|
-
assetChanges.set(asset.assetId, existing + asset.amount);
|
|
15390
|
-
}
|
|
15391
|
-
}
|
|
15392
|
-
}
|
|
15393
|
-
selectedCoins = [...selectedCoins, ...btcCoins];
|
|
15394
|
-
}
|
|
15395
15545
|
let totalBtcSelected = selectedCoins.reduce((sum, c) => sum + c.value, 0);
|
|
15396
15546
|
const outputs = recipients.map((recipient) => ({
|
|
15397
15547
|
script: recipient.script,
|
|
15398
|
-
amount: BigInt(recipient.amount)
|
|
15548
|
+
amount: BigInt(recipient.amount),
|
|
15549
|
+
// Already checked against the recipient address in `validateRecipients`.
|
|
15550
|
+
...recipient.tapTree ? { tapTree: TapTreeCoder.decode(recipient.tapTree) } : {}
|
|
15399
15551
|
}));
|
|
15400
15552
|
const totalBtcOutput = outputs.reduce((sum, o) => sum + Number(o.amount), 0);
|
|
15401
15553
|
let changeAmount = totalBtcSelected - totalBtcOutput;
|
|
15554
|
+
if (changeAmount < 0) {
|
|
15555
|
+
throw new Error(
|
|
15556
|
+
`send({ selectedVtxos }): inputs total ${totalBtcSelected} sats, outputs need ${totalBtcOutput}`
|
|
15557
|
+
);
|
|
15558
|
+
}
|
|
15402
15559
|
if (assetChanges.size > 0 && changeAmount < Number(this.dustAmount)) {
|
|
15560
|
+
if (selectedVtxos) {
|
|
15561
|
+
throw new Error(
|
|
15562
|
+
`send({ selectedVtxos }): ${changeAmount} sats of change cannot carry ${assetChanges.size} asset change(s), needs ${this.dustAmount}`
|
|
15563
|
+
);
|
|
15564
|
+
}
|
|
15403
15565
|
const availableCoins = virtualCoins.filter(
|
|
15404
15566
|
(c) => !selectedCoins.find((sc) => sc.txid === c.txid && sc.vout === c.vout)
|
|
15405
15567
|
);
|
|
@@ -17162,8 +17324,8 @@ var WalletMessageHandler = class {
|
|
|
17162
17324
|
});
|
|
17163
17325
|
}
|
|
17164
17326
|
case "SEND": {
|
|
17165
|
-
const { recipients } = message.payload;
|
|
17166
|
-
const txid = await this.wallet.send(...recipients);
|
|
17327
|
+
const { recipients, selectedVtxos } = message.payload;
|
|
17328
|
+
const txid = await (selectedVtxos ? this.wallet.send({ recipients, selectedVtxos }) : this.wallet.send(...recipients));
|
|
17167
17329
|
return this.tagged({
|
|
17168
17330
|
id,
|
|
17169
17331
|
type: "SEND_SUCCESS",
|
|
@@ -17411,6 +17573,8 @@ var WalletMessageHandler = class {
|
|
|
17411
17573
|
settled: offchain.settled,
|
|
17412
17574
|
preconfirmed: offchain.preconfirmed,
|
|
17413
17575
|
available: offchain.available,
|
|
17576
|
+
gated: offchain.gated,
|
|
17577
|
+
intentLocked: offchain.intentLocked,
|
|
17414
17578
|
recoverable: offchain.recoverable,
|
|
17415
17579
|
pendingRecovery: offchain.pendingRecovery,
|
|
17416
17580
|
total: totalBoarding + offchain.total,
|
|
@@ -19034,12 +19198,16 @@ var ServiceWorkerWallet = class _ServiceWorkerWallet extends ServiceWorkerReadon
|
|
|
19034
19198
|
throw error;
|
|
19035
19199
|
}
|
|
19036
19200
|
}
|
|
19037
|
-
async send(...
|
|
19201
|
+
async send(...args) {
|
|
19202
|
+
const [first] = args;
|
|
19203
|
+
const { recipients, selectedVtxos } = args.length === 1 && first && "recipients" in first ? first : { recipients: args, selectedVtxos: void 0 };
|
|
19038
19204
|
const message = {
|
|
19039
19205
|
tag: this.messageTag,
|
|
19040
19206
|
type: "SEND",
|
|
19041
19207
|
id: getRandomId(),
|
|
19042
|
-
|
|
19208
|
+
// Omitted rather than sent as `undefined`, so an older worker sees
|
|
19209
|
+
// exactly the payload it saw before.
|
|
19210
|
+
payload: selectedVtxos ? { recipients, selectedVtxos } : { recipients }
|
|
19043
19211
|
};
|
|
19044
19212
|
try {
|
|
19045
19213
|
const response = await this.sendMessage(message);
|
|
@@ -22591,6 +22759,6 @@ function createDefaultPaymentRouter(wallet) {
|
|
|
22591
22759
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
22592
22760
|
*/
|
|
22593
22761
|
|
|
22594
|
-
export { ARKADE_MAGIC, ARKADE_SWAP_PREIMAGE_TAG, ActivityRegistry, AmbiguousRouteError, ArkNote, ArkadeCash, ArkadeCashCreateError, AssetManager, BIP21, BIP21Error, BIP322, Batch, ChainedTxType, ContractManager, ContractRepositoryImpl, ContractWatcher, DB_VERSION, DEFAULT_MESSAGE_TIMEOUTS, DEFAULT_MIN_BATCH_EXPIRY_SECONDS, DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, 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, 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, WalletCannotSignError, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, adoptContractDescriptor, arkRail, arkTarget, arkade_exports, assertFinalCommitmentMatchesValidated, assertIntentIdUnique, assertSendableAmount, assertSubmittedArkTxid, assertValidBatchExpiry, assertValidServerUnrollScript, assetMintResolver, boardingResolver, btcTarget, buildForfeitTx, buildOffchainTx, buildPreimageMessage, claimWithPreimageIdentity, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, collabExitResolver, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, contractPreimage, contractSigner, createAssetPacket, createDefaultActivityRegistry, createDefaultPaymentRouter, createExitChainResolver, decodeArkContract, defaultBatchExpiryPolicy, defaultCheckpointExitDelayPolicy, deserializeAssets, deserializeExitPackage, deserializeUtxo, deserializeVtxo, encodeArkContract, extendVirtualCoinForContract, gateExclusion, gatedContracts, getMigrationStatus, getRandomId, hasBoardingTxExpired, hasCandidates, intentMatchesFilter, intentPageBounds, invoiceTarget, 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, onchainRail, openDatabase, outpointExclusion, outpointReasons, provisionClaimSecret, provisionRefundKey, requiresMigration, resolveBatchExpiryPolicy, resolveCheckpointExitDelayPolicy, resolveDescriptorSigner, resolveSendAmount, rollbackMigration, saveVtxosForContract, scriptFromArkAddress, selectCoinsWithAsset, selectVirtualCoins, serializeAssets, serializeExitPackage, serializeUtxo, serializeVtxo, setupServiceWorker, signAndSubmitOffchainTx, signerSetFromInfo, signingDescriptorIndex, strictSigningDescriptorIndex, toXOnlySignerHex, tryResolveSendAmount, validateBatchRecipients, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds, warnAndFilterVtxosForScript };
|
|
22595
|
-
//# sourceMappingURL=chunk-
|
|
22596
|
-
//# sourceMappingURL=chunk-
|
|
22762
|
+
export { ARKADE_MAGIC, ARKADE_SALTED_PREIMAGE_TAG, ARKADE_SWAP_PREIMAGE_TAG, ActivityRegistry, AmbiguousRouteError, ArkNote, ArkadeCash, ArkadeCashCreateError, AssetManager, BIP21, BIP21Error, BIP322, Batch, ChainedTxType, ContractManager, ContractRepositoryImpl, ContractWatcher, DB_VERSION, DEFAULT_MESSAGE_TIMEOUTS, DEFAULT_MIN_BATCH_EXPIRY_SECONDS, DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, 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, 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, WalletCannotSignError, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, adoptContractDescriptor, arkRail, arkTarget, arkade_exports, assertFinalCommitmentMatchesValidated, assertIntentIdUnique, assertSendableAmount, assertSubmittedArkTxid, assertValidBatchExpiry, assertValidServerUnrollScript, assetMintResolver, boardingResolver, btcTarget, buildForfeitTx, buildOffchainTx, buildPreimageMessage, buildSaltedPreimageMessage, claimWithPreimageIdentity, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, collabExitResolver, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, contractPreimage, contractSigner, createAssetPacket, createDefaultActivityRegistry, createDefaultPaymentRouter, createExitChainResolver, decodeArkContract, defaultBatchExpiryPolicy, defaultCheckpointExitDelayPolicy, deserializeAssets, deserializeExitPackage, deserializeUtxo, deserializeVtxo, encodeArkContract, extendVirtualCoinForContract, gateExclusion, gatedContracts, getMigrationStatus, getRandomId, hasBoardingTxExpired, hasCandidates, intentMatchesFilter, intentPageBounds, invoiceTarget, 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, onchainRail, openDatabase, outpointExclusion, outpointReasons, provisionClaimSecret, provisionRefundKey, requiresMigration, resolveBatchExpiryPolicy, resolveCheckpointExitDelayPolicy, resolveDescriptorSigner, resolveSendAmount, rollbackMigration, saveVtxosForContract, scriptFromArkAddress, selectCoinsWithAsset, selectVirtualCoins, serializeAssets, serializeExitPackage, serializeUtxo, serializeVtxo, setupServiceWorker, signAndSubmitOffchainTx, signerSetFromInfo, signingDescriptorIndex, strictSigningDescriptorIndex, toXOnlySignerHex, tryResolveSendAmount, validateBatchRecipients, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds, warnAndFilterVtxosForScript };
|
|
22763
|
+
//# sourceMappingURL=chunk-X7MMBB7S.js.map
|
|
22764
|
+
//# sourceMappingURL=chunk-X7MMBB7S.js.map
|