@arkade-os/sdk 0.4.53 → 0.4.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/expo.cjs +5 -5
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +3 -3
- package/dist/adapters/indexedDB.cjs +5 -5
- package/dist/adapters/indexedDB.js +4 -4
- package/dist/{ark-B69ugeJw.d.cts → ark-Do9Lqfsp.d.cts} +36 -2
- package/dist/{ark-B69ugeJw.d.ts → ark-Do9Lqfsp.d.ts} +36 -2
- package/dist/{asyncStorageTaskQueue-B0SUQMXw.d.cts → asyncStorageTaskQueue-C3DYxvAT.d.cts} +1 -1
- package/dist/{asyncStorageTaskQueue-DWqxuIAs.d.ts → asyncStorageTaskQueue-DOnBOEDn.d.ts} +1 -1
- package/dist/{chunk-CZTQLA55.cjs → chunk-C6UYPHTQ.cjs} +9 -9
- package/dist/{chunk-CZTQLA55.cjs.map → chunk-C6UYPHTQ.cjs.map} +1 -1
- package/dist/{chunk-4GB73TRR.cjs → chunk-CSS74VCN.cjs} +17 -17
- package/dist/{chunk-4GB73TRR.cjs.map → chunk-CSS74VCN.cjs.map} +1 -1
- package/dist/{chunk-LHYNNDY6.js → chunk-ENWR2F2P.js} +8 -1327
- package/dist/chunk-ENWR2F2P.js.map +1 -0
- package/dist/{chunk-RNMLFY2V.cjs → chunk-G7DOBFQN.cjs} +19 -1367
- package/dist/chunk-G7DOBFQN.cjs.map +1 -0
- package/dist/chunk-JCJ5WFS3.js +2326 -0
- package/dist/chunk-JCJ5WFS3.js.map +1 -0
- package/dist/{chunk-B4WZOJAI.js → chunk-LAONNMM5.js} +4 -4
- package/dist/{chunk-B4WZOJAI.js.map → chunk-LAONNMM5.js.map} +1 -1
- package/dist/chunk-OWCPXRGP.cjs +2415 -0
- package/dist/chunk-OWCPXRGP.cjs.map +1 -0
- package/dist/{chunk-UZLQUWYP.js → chunk-QMPNPZ2T.js} +23 -4
- package/dist/chunk-QMPNPZ2T.js.map +1 -0
- package/dist/{chunk-3MMUKLCI.js → chunk-QO3IKBYL.js} +827 -130
- package/dist/chunk-QO3IKBYL.js.map +1 -0
- package/dist/{chunk-3XWDMLOI.js → chunk-SG4X7SEC.js} +4 -4
- package/dist/{chunk-3XWDMLOI.js.map → chunk-SG4X7SEC.js.map} +1 -1
- package/dist/{chunk-IEMPH7J6.cjs → chunk-V2TOHHPW.cjs} +60 -40
- package/dist/chunk-V2TOHHPW.cjs.map +1 -0
- package/dist/{chunk-3YC3LQ2E.cjs → chunk-ZPL34T2Q.cjs} +1191 -471
- package/dist/chunk-ZPL34T2Q.cjs.map +1 -0
- package/dist/contracts/handlers/index.cjs +8 -8
- 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-C_Y2YrXC.d.cts → delegate-C0iIBxen.d.cts} +1 -1
- package/dist/{delegate-BU-Cpyjw.d.ts → delegate-DmhFrtdq.d.ts} +1 -1
- package/dist/{index-BWF-C9eh.d.ts → index-BNt4wcSh.d.ts} +2 -2
- package/dist/{index-tzAInyiX.d.cts → index-BnLM1XxA.d.cts} +2 -2
- package/dist/index.cjs +348 -240
- package/dist/index.d.cts +424 -14
- package/dist/index.d.ts +424 -14
- 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-nzJFH8qb.d.ts → taskRunner-Bgs-0I3x.d.ts} +1 -1
- package/dist/{taskRunner-B7svzMhT.d.cts → taskRunner-RwUvgQ5M.d.cts} +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 +5 -5
- package/dist/wallet/expo/index.d.ts +5 -5
- package/dist/wallet/expo/index.js +5 -5
- package/dist/{wallet-B6Xiferv.d.cts → wallet-5Aou-V5n.d.ts} +83 -6
- package/dist/{wallet-CuHAI-eW.d.ts → wallet-Ck7BH8zR.d.cts} +83 -6
- 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-3MMUKLCI.js.map +0 -1
- package/dist/chunk-3YC3LQ2E.cjs.map +0 -1
- package/dist/chunk-E7HB3GKK.cjs +0 -1030
- package/dist/chunk-E7HB3GKK.cjs.map +0 -1
- package/dist/chunk-EFNLTS6Q.js +0 -976
- package/dist/chunk-EFNLTS6Q.js.map +0 -1
- package/dist/chunk-IEMPH7J6.cjs.map +0 -1
- package/dist/chunk-LHYNNDY6.js.map +0 -1
- package/dist/chunk-RNMLFY2V.cjs.map +0 -1
- package/dist/chunk-UZLQUWYP.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { aT as ActivityIntent, aU as ActivityResolver,
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
import {
|
|
6
|
-
export {
|
|
7
|
-
import {
|
|
8
|
-
export {
|
|
1
|
+
import { $ as ReadonlyIdentity, a as Identity, al as DescriptorSigningRequest, am as Transaction, ah as SignerSession, Z as DescriptorProvider, x as IntentRepository, y as ArkIntent, z as IntentFilter, O as Outpoint, B as VirtualTxRepository, D as VirtualTx, F as VtxoBranch, W as WalletRepository, t as ExtendedVirtualCoin, u as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, v as WalletState, s as Contract, C as ContractRepository, w as ContractFilter, an as IntentFeeConfig, ao as OffchainInput, ap as FeeAmount, aq as OnchainInput, ar as FeeOutput, n as ArkProvider, af as SettlementConfig, as as ContractWatcherConfig, at as Asset, R as Recipient, I as IWallet, au as FeeInfo, i as SettlementEvent, h as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, av as CreateContractParams, aw as GetContractsFilter, r as VirtualCoin, ax as GetSpendablePathsOptions, ay as GetAllSpendingPathsOptions, az as IssuanceParams, aA as ReissuanceParams, aB as BurnParams, aC as RenewVtxosOptions, c as WalletBalance, a7 as ContractSyncState, aD as ContractWithVtxos, aE as PathSelection, aF as ContractEvent, aG as AssetDetails, aH as IssuanceResult, aI as DelegateInfo, aJ as MigrationGlobalSkipReason, aK as MigrationLegSkipReason, aL as SignerStatus, _ as IReadonlyWallet, d as ActivityRegistry, a6 as IReadonlyAssetManager, aM as StorageConfig, e as Activity, N as NormalizedExtendedVirtualCoin, f as IContractManager, j as IAssetManager, g as IDelegateManager, aN as IVtxoManager, a1 as OnchainProvider, a0 as Network, a8 as NetworkName, ab as Coin, aO as ExplorerTransaction, q as TapLeafScript, aP as EncodedVtxoScript, ae as CSVMultisigTapscript, p as RelativeTimelock, V as VtxoScript, aQ as Status, aa as ArkAddress, aj as Intent, aR as ChainTx, o as IndexerProvider, L as TxTree, aS as PathContext } from './ark-Do9Lqfsp.cjs';
|
|
2
|
+
export { aT as ActivityIntent, aU as ActivityResolver, a9 as ArkInfo, aV as ArkIntentState, aW as ArkTapscript, aX as AssetMetadata, aY as BaseWalletConfig, U as BatchFailedEvent, P as BatchFinalizationEvent, Q as BatchFinalizedEvent, aZ as BatchInfo, a_ as BatchSignableIdentity, J as BatchStartedEvent, a$ as CLTVMultisigTapscript, b0 as CandidateDeps, b1 as ChainTxType, H as ChainedTxType, b2 as CommitmentTx, b3 as ConditionCSVMultisigTapscript, b4 as ConditionMultisigTapscript, b5 as ContractBalance, b6 as ContractEventCallback, b7 as ContractHandler, ac as ContractManager, ad as ContractManagerConfig, b8 as ContractState, b9 as ContractVtxo, ba as ContractWatcher, bb as DelegateManagerImpl, bc as DelegateOptions, a2 as DelegateProvider, bd as DelegatorManagerImpl, be as DelegatorProvider, bf as DeprecatedSignerMigrationReport, bg as DeprecatedSignerReport, bh as DigestMismatchError, bi as Discoverable, bj as DiscoveredContract, bk as DiscoveryDeps, bl as ESPLORA_URL, bm as EsploraProvider, a4 as ExitCaptureMode, bn as ExitChainResolver, a5 as ExitDataSource, bo as ExtendedContractVtxo, bp as GroupMembership, bq as HandlerError, br as IDelegatorManager, bs as INTENT_TERMINAL_STATES, bt as IndexerTxType, bu as KnownMetadata, bv as MigrateDeprecatedSignerOptions, bw as MigrationLegReport, bx as MigrationVtxoRef, by as MultisigTapscript, bz as Nonces, bA as Output, bB as PageResponse, bC as PaginationOptions, bD as PartialSig, bE as ProviderClass, a3 as ReadonlyWalletConfig, k as RestArkProvider, bF as RestDelegateProvider, bG as RestDelegatorProvider, l as RestIndexerProvider, bH as ScanContractsOptions, bI as ScanResult, bJ as ScheduledSession, bK as SettlementEventType, bL as SignRequest, ai as SignedIntent, bM as SignerClassification, bN as SignerSet, bO as SubscriptionEvent, bP as SubscriptionHeartbeat, m as SubscriptionResponse, bQ as TapLeaves, bR as TapTreeCoder, bS as TapscriptType, ak as TimeHeight, bT as TreeNonces, M as TreeNoncesEvent, bU as TreePartialSigs, Y as TreeSignatureEvent, K as TreeSigningStartedEvent, X as TreeTxEvent, bV as Tx, bW as TxHistoryRecord, bX as TxKey, T as TxNotification, bY as TxTag, bZ as TxTreeNode, b_ as TxType, b$ as VirtualStatus, c0 as Vtxo, c1 as VtxoChain, ag as VtxoManager, c2 as VtxoType, b as WalletConfig, c3 as WalletMode, c4 as assetMintResolver, c5 as boardingResolver, c6 as canRecoverOnchain, c7 as canSpendOffchain, c8 as classifyAgainstSignerSet, c9 as classifyContractSigner, ca as collabExitResolver, cb as createDefaultActivityRegistry, cc as createExitChainResolver, cd as decodeTapscript, ce as getNetwork, cf as getSequence, cg as hasCandidates, ch as hasTerminalSpend, ci as isBatchSignable, cj as isCooperativelyMigratable, ck as isDiscoverable, cl as isExpired, cm as isPastExpiry, cn as isRecoverable, co as isSpendable, cp as isSubdust, cq as isTerminalIntentState, cr as isVirtualCoin, cs as isVtxoExpiringSoon, ct as networks, cu as scriptFromTapLeafScript, cv as signerSetFromInfo, cw as toXOnlySignerHex } from './ark-Do9Lqfsp.cjs';
|
|
3
|
+
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot, P as ProviderConnectionState, B as Batch } from './wallet-Ck7BH8zR.cjs';
|
|
4
|
+
export { A as ArkError, d as ArkErrorName, e as ArkadeCashClaimResult, f as ArkadeCashCreateError, g as ArkadeCashUnclaimedReason, h as ArkadeCashUnclaimedVtxo, i as BoardingUtxoGroup, H as HDWalletCapable, I as IncomingFunds, j as ProviderKind, k as ProviderUnavailableError, S as ServerInfoSource, l as ServerResponseMismatchError, m as isArkError, n as isHDWalletCapable, o as maybeArkError, s as selectVirtualCoins, w as waitForIncomingFunds } from './wallet-Ck7BH8zR.cjs';
|
|
5
|
+
import { P as Program, A as ArkadeParamValue, a as ArkadeProgramScript, b as ProgramKeys, c as ArkadeArgValue, C as CompiledProgramFunction, d as ArkadeFunction, I as InputRef, e as InputDef, f as ArkadeValueType, g as ArkadeArgType, h as ArkadeContractParams, i as ArkadeSegment, j as AsmToken, S as SUPPORTED_PROGRAM_VERSION, k as SignerRef, T as TapscriptSegment, W as WitnessRef, l as deserializeArkadeContractParams, p as parseArtifact, r as resolveAsm, s as serializeArkadeContractParams, m as stringifyArtifact, v as validateProgram, w as witnessRefToBytes } from './index-BnLM1XxA.cjs';
|
|
6
|
+
export { n as ArkadeContractHandler, B as BoardingContractHandler, o as BoardingContractParams, D as DefaultContractHandler, q as DefaultContractParams, t as DelegateContractHandler, u as DelegateContractParams, V as VHTLC, x as VHTLCContractHandler, y as VHTLCContractParams, z as contractHandlers } from './index-BnLM1XxA.cjs';
|
|
7
|
+
import { D as DefaultVtxo } from './delegate-C0iIBxen.cjs';
|
|
8
|
+
export { a as DelegateVtxo } from './delegate-C0iIBxen.cjs';
|
|
9
9
|
import { Bytes, BTC_NETWORK } from '@scure/btc-signer/utils.js';
|
|
10
10
|
import { P2TR } from '@scure/btc-signer/payment.js';
|
|
11
11
|
import { Transaction as Transaction$1, OP, Script, ScriptType } from '@scure/btc-signer';
|
|
@@ -265,6 +265,12 @@ declare class SeedIdentity implements HDCapableIdentity {
|
|
|
265
265
|
* this method only as backing implementation for descriptor providers.
|
|
266
266
|
*/
|
|
267
267
|
signMessageWithDescriptor(descriptor: string, message: Uint8Array, signatureType?: "schnorr" | "ecdsa"): Promise<Uint8Array>;
|
|
268
|
+
/**
|
|
269
|
+
* BIP-340 sign `messageHash` with the key derived from `descriptor`,
|
|
270
|
+
* aux_rand = 0. Backs {@link DescriptorIdentity.signSchnorrDeterministic},
|
|
271
|
+
* which swap preimage derivation reads through.
|
|
272
|
+
*/
|
|
273
|
+
signSchnorrDeterministicWithDescriptor(descriptor: string, messageHash: Uint8Array): Promise<Uint8Array>;
|
|
268
274
|
private derivePrivateKeyForDescriptor;
|
|
269
275
|
private signTxWithKey;
|
|
270
276
|
private signMessageWithKey;
|
|
@@ -357,6 +363,77 @@ declare class ReadonlyDescriptorIdentity implements ReadonlyHDCapableIdentity {
|
|
|
357
363
|
isOurs(descriptor: string): boolean;
|
|
358
364
|
}
|
|
359
365
|
|
|
366
|
+
/**
|
|
367
|
+
* Compressed (33-byte) counterpart of {@link deriveDescriptorLeafPubKey}, for
|
|
368
|
+
* protocols that key on the parity byte (Boltz swap keys).
|
|
369
|
+
*
|
|
370
|
+
* Only HD descriptors are supported: a bare `tr(xonly)` has lost its parity and
|
|
371
|
+
* synthesizing `02||xonly` would silently produce the wrong key half the time.
|
|
372
|
+
*/
|
|
373
|
+
declare function deriveDescriptorLeafCompressedPubKey(descriptor: string): Uint8Array;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Descriptor-scoped signing surface — the two members every
|
|
377
|
+
* {@link DescriptorProvider} and every `HDCapableIdentity` share.
|
|
378
|
+
*/
|
|
379
|
+
type DescriptorSigner = Pick<DescriptorProvider, "signWithDescriptor" | "signMessageWithDescriptor">;
|
|
380
|
+
/**
|
|
381
|
+
* Per-descriptor deterministic Schnorr signing. Separate from the baseline
|
|
382
|
+
* `DeterministicSignCapable` marker because the seed holder — not the
|
|
383
|
+
* descriptor — is the only party that can derive the key at an index.
|
|
384
|
+
*/
|
|
385
|
+
interface HDDeterministicSignCapable {
|
|
386
|
+
/** BIP-340 sign `messageHash` with the descriptor's key and aux_rand = 0. */
|
|
387
|
+
signSchnorrDeterministicWithDescriptor(descriptor: string, messageHash: Uint8Array): Promise<Uint8Array>;
|
|
388
|
+
}
|
|
389
|
+
/** Type guard for {@link HDDeterministicSignCapable}. */
|
|
390
|
+
declare function isHDDeterministicSignCapable(value: unknown): value is HDDeterministicSignCapable;
|
|
391
|
+
/** Constructor arguments for {@link DescriptorIdentity}. */
|
|
392
|
+
interface DescriptorIdentityOptions {
|
|
393
|
+
/** Materialized descriptor (no wildcard) this identity is pinned to. */
|
|
394
|
+
descriptor: string;
|
|
395
|
+
/** Descriptor-aware signer — an `HDDescriptorProvider` or an HD identity. */
|
|
396
|
+
signer: DescriptorSigner;
|
|
397
|
+
/**
|
|
398
|
+
* Seed-holding identity behind `signer`. Backs the members that are not
|
|
399
|
+
* descriptor-scoped in the provider contract: musig2 sessions and
|
|
400
|
+
* deterministic Schnorr.
|
|
401
|
+
*/
|
|
402
|
+
base: Identity;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* {@link Identity} pinned to one materialized HD descriptor: every key and
|
|
406
|
+
* signature it produces belongs to that index rather than to the wallet's
|
|
407
|
+
* baseline key.
|
|
408
|
+
*
|
|
409
|
+
* Lets components that take a plain `Identity` (VHTLC claim/refund, batch
|
|
410
|
+
* joins) operate on a rotated index without knowing about descriptors.
|
|
411
|
+
*
|
|
412
|
+
* Deliberately does NOT satisfy `isBatchSignable`, `isHDCapableIdentity`, or
|
|
413
|
+
* `hasToReadonly` — it is a leaf signer, not another HD root.
|
|
414
|
+
*/
|
|
415
|
+
declare class DescriptorIdentity implements Identity {
|
|
416
|
+
private readonly descriptor;
|
|
417
|
+
private readonly signer;
|
|
418
|
+
private readonly base;
|
|
419
|
+
constructor({ descriptor, signer, base }: DescriptorIdentityOptions);
|
|
420
|
+
xOnlyPublicKey(): Promise<Uint8Array>;
|
|
421
|
+
compressedPublicKey(): Promise<Uint8Array>;
|
|
422
|
+
sign(tx: Transaction, inputIndexes?: number[]): Promise<Transaction>;
|
|
423
|
+
signMessage(message: Uint8Array, signatureType?: "schnorr" | "ecdsa"): Promise<Uint8Array>;
|
|
424
|
+
/**
|
|
425
|
+
* Delegated: `TreeSignerSession.random()` consults no key material, so the
|
|
426
|
+
* session is index-independent.
|
|
427
|
+
*/
|
|
428
|
+
signerSession(): SignerSession;
|
|
429
|
+
/**
|
|
430
|
+
* Throws rather than falling back to the baseline key: a preimage derived
|
|
431
|
+
* from the wrong index is unrecoverable, and callers probe this member
|
|
432
|
+
* through a structural guard that cannot tell the two apart.
|
|
433
|
+
*/
|
|
434
|
+
signSchnorrDeterministic(messageHash: Uint8Array): Promise<Uint8Array>;
|
|
435
|
+
}
|
|
436
|
+
|
|
360
437
|
/**
|
|
361
438
|
* In-memory single key implementation for Bitcoin transaction signing.
|
|
362
439
|
*
|
|
@@ -2479,8 +2556,8 @@ declare class WalletMessageHandler implements MessageHandler<WalletUpdaterReques
|
|
|
2479
2556
|
*/
|
|
2480
2557
|
private getVtxosFromRepo;
|
|
2481
2558
|
/**
|
|
2482
|
-
* Build transaction history from cached virtual outputs
|
|
2483
|
-
*
|
|
2559
|
+
* Build transaction history from cached virtual outputs, hitting the indexer only for
|
|
2560
|
+
* uncached timestamps. Best-effort, like the plain Wallet path.
|
|
2484
2561
|
*/
|
|
2485
2562
|
private buildTransactionHistoryFromCache;
|
|
2486
2563
|
private ensureContractEventBroadcasting;
|
|
@@ -3260,9 +3337,11 @@ declare function hasBoardingTxExpired(coin: ExtendedCoin, boardingTimelock: Rela
|
|
|
3260
3337
|
* @param requiredSigners List of required signer pubkeys (hex encoded)
|
|
3261
3338
|
* @param excludePubkeys List of pubkeys to exclude from verification (hex encoded, e.g., server key not yet signed)
|
|
3262
3339
|
* @param allowedSighashTypes List of allowed sighash types (defaults to [SigHash.DEFAULT])
|
|
3340
|
+
* @param expectedLeafHash Tapscript leaf hash the signatures must commit to. When omitted, a
|
|
3341
|
+
* signature over any leaf carried by the input is accepted.
|
|
3263
3342
|
* @throws Error if verification fails
|
|
3264
3343
|
*/
|
|
3265
|
-
declare function verifyTapscriptSignatures(tx: Transaction, inputIndex: number, requiredSigners: string[], excludePubkeys?: string[], allowedSighashTypes?: number[]): void;
|
|
3344
|
+
declare function verifyTapscriptSignatures(tx: Transaction, inputIndex: number, requiredSigners: string[], excludePubkeys?: string[], allowedSighashTypes?: number[], expectedLeafHash?: Uint8Array): void;
|
|
3266
3345
|
/**
|
|
3267
3346
|
* Merges the tapscript signatures of `signedTx` onto `originalTx`, in place.
|
|
3268
3347
|
*
|
|
@@ -3284,6 +3363,45 @@ declare function combineTapscriptSigs(signedTx: Transaction, originalTx: Transac
|
|
|
3284
3363
|
* @returns True if the address is valid, false otherwise.
|
|
3285
3364
|
*/
|
|
3286
3365
|
declare function isValidArkAddress(address: string): boolean;
|
|
3366
|
+
/**
|
|
3367
|
+
* Pair each server-returned checkpoint PSBT with the locally built checkpoint
|
|
3368
|
+
* of the same txid, rejecting anything else.
|
|
3369
|
+
*
|
|
3370
|
+
* The ark tx signed just above spends each checkpoint at `checkpointTxid:0`, so
|
|
3371
|
+
* the response is only usable if it carries the same txids: a checkpoint with
|
|
3372
|
+
* any other txid leaves that ark tx unspendable. The two sets are therefore
|
|
3373
|
+
* equal by construction, and this pairing is what the signing step below
|
|
3374
|
+
* consumes.
|
|
3375
|
+
*
|
|
3376
|
+
* Matching is by txid rather than by position — nothing in the wire contract
|
|
3377
|
+
* promises arkd echoes checkpoints in submission order — while the result keeps
|
|
3378
|
+
* the server's order, so nothing downstream is reordered.
|
|
3379
|
+
*
|
|
3380
|
+
* Comparing txids is sound while checkpoint inputs are taproot-only: witness
|
|
3381
|
+
* data does not affect the txid, so the server's signature cannot change it. A
|
|
3382
|
+
* future P2SH-wrapped/scriptSig input could acquire a `finalScriptSig`
|
|
3383
|
+
* server-side and legitimately change txid; that protocol shape would need a
|
|
3384
|
+
* different comparison target.
|
|
3385
|
+
*/
|
|
3386
|
+
declare function matchServerCheckpoints(serverCheckpointTxs: string[], expectedCheckpoints: Transaction[], context: string): {
|
|
3387
|
+
server: Transaction;
|
|
3388
|
+
local: Transaction;
|
|
3389
|
+
}[];
|
|
3390
|
+
/**
|
|
3391
|
+
* Assert a `submitTx` response refers to the ark transaction just submitted.
|
|
3392
|
+
*
|
|
3393
|
+
* The returned `arkTxid` is what gets passed to `finalizeTx` and persisted by
|
|
3394
|
+
* callers, so a stale or misrouted response must be rejected before either
|
|
3395
|
+
* happens: it must equal the locally signed transaction's txid, and when the
|
|
3396
|
+
* response carries the counter-signed `finalArkTx`, that transaction's txid
|
|
3397
|
+
* must match too. Server signatures live in the witness and cannot
|
|
3398
|
+
* legitimately change either — with the same taproot-only caveat as
|
|
3399
|
+
* {@link matchServerCheckpoints}.
|
|
3400
|
+
*/
|
|
3401
|
+
declare function assertSubmittedArkTxid(response: {
|
|
3402
|
+
arkTxid: string;
|
|
3403
|
+
finalArkTx?: string;
|
|
3404
|
+
}, signedArkTx: Transaction, context: string): void;
|
|
3287
3405
|
|
|
3288
3406
|
declare function getRandomId(): string;
|
|
3289
3407
|
|
|
@@ -3657,8 +3775,10 @@ type ArkadeBatchInput = ArkadeExtendedCoin | ArkadeExtendedVirtualCoin;
|
|
|
3657
3775
|
declare function createArkadeBatchHandler(intentId: string, inputs: ArkadeBatchInput[], signer: Identity, signedProof: string, message: Intent.RegisterMessage, session: SignerSession, arkProvider: ArkProvider, emulator: EmulatorProvider, network: Network,
|
|
3658
3776
|
/**
|
|
3659
3777
|
* Expected recipients of the settlement, validated against the virtual
|
|
3660
|
-
* output tree before co-signing it
|
|
3661
|
-
*
|
|
3778
|
+
* output tree before co-signing it, and — when tree signing did not run —
|
|
3779
|
+
* against the commitment tx before signing anything at finalization
|
|
3780
|
+
* (mirrors `Wallet.createBatchHandler`). Without this the handler signs
|
|
3781
|
+
* whatever the server proposes, on both paths.
|
|
3662
3782
|
*/
|
|
3663
3783
|
recipients?: Recipient[]): Batch.Handler;
|
|
3664
3784
|
|
|
@@ -3997,10 +4117,26 @@ declare class Executor implements AsyncIterable<ExecutorEvent> {
|
|
|
3997
4117
|
readonly provider: OnchainProvider;
|
|
3998
4118
|
private readonly pollIntervalMs;
|
|
3999
4119
|
private readonly feeWallet?;
|
|
4120
|
+
private readonly signal?;
|
|
4000
4121
|
constructor(pkg: ExitPackage, provider: OnchainProvider, opts?: {
|
|
4001
4122
|
pollIntervalMs?: number;
|
|
4002
4123
|
feeWallet?: ExitFeeWallet;
|
|
4124
|
+
/** Abort to stop execution.
|
|
4125
|
+
*
|
|
4126
|
+
* Iteration then rejects with `signal.reason`. Calling `abort()`
|
|
4127
|
+
* with no argument yields an error whose `name` is `"AbortError"`;
|
|
4128
|
+
* a custom reason is forwarded as-is, matching `fetch` and
|
|
4129
|
+
* `AbortSignal.prototype.throwIfAborted`.
|
|
4130
|
+
*
|
|
4131
|
+
* Already-broadcast transactions are not recalled; the executor is
|
|
4132
|
+
* idempotent, so a later run resumes from the chain. */
|
|
4133
|
+
signal?: AbortSignal;
|
|
4003
4134
|
});
|
|
4135
|
+
/**
|
|
4136
|
+
* Poll delay. Nearly all wall-clock time is spent here, so it must be the
|
|
4137
|
+
* thing that reacts to abort — checking only between polls would leave
|
|
4138
|
+
* cancellation up to a full interval late and the timer still pending.
|
|
4139
|
+
*/
|
|
4004
4140
|
private sleep;
|
|
4005
4141
|
private status;
|
|
4006
4142
|
private waitConfirmed;
|
|
@@ -4931,6 +5067,280 @@ declare namespace index {
|
|
|
4931
5067
|
export { index_ARKADE_OP as ARKADE_OP, index_ARKADE_OPCODES as ARKADE_OPCODES, index_ARKADE_OPCODE_NAMES as ARKADE_OPCODE_NAMES, index_ARKADE_OPCODE_VALUES as ARKADE_OPCODE_VALUES, index_ARKADE_OPS as ARKADE_OPS, index_Arkade as Arkade, index_ArkadeArgType as ArkadeArgType, index_ArkadeArgValue as ArkadeArgValue, type index_ArkadeBatchInput as ArkadeBatchInput, type index_ArkadeConnectOptions as ArkadeConnectOptions, index_ArkadeContract as ArkadeContract, index_ArkadeContractParams as ArkadeContractParams, type index_ArkadeExtendedCoin as ArkadeExtendedCoin, type index_ArkadeExtendedVirtualCoin as ArkadeExtendedVirtualCoin, index_ArkadeFunction as ArkadeFunction, index_ArkadeParamValue as ArkadeParamValue, index_ArkadeProgramScript as ArkadeProgramScript, index_ArkadeScript as ArkadeScript, type index_ArkadeScriptOP as ArkadeScriptOP, type index_ArkadeScriptType as ArkadeScriptType, index_ArkadeSegment as ArkadeSegment, type index_ArkadeSpendResult as ArkadeSpendResult, index_ArkadeTransactionBuilder as ArkadeTransactionBuilder, index_AsmToken as AsmToken, type index_AssetSpec as AssetSpec, bignum as BigNum, type index_CallableFunctions as CallableFunctions, index_CompiledProgramFunction as CompiledProgramFunction, type index_ContractFunctions as ContractFunctions, index_InputDef as InputDef, index_InputRef as InputRef, index_OP as OP, index_OPCODE_NAMES as OPCODE_NAMES, index_OPCODE_VALUES as OPCODE_VALUES, index_Program as Program, index_ProgramKeys as ProgramKeys, index_SUPPORTED_PROGRAM_VERSION as SUPPORTED_PROGRAM_VERSION, index_Script as Script, index_ScriptType as ScriptType, index_SignerRef as SignerRef, index_TapscriptSegment as TapscriptSegment, type index_Utxo as Utxo, index_WitnessRef as WitnessRef, index_arkadeScriptHash as arkadeScriptHash, index_arkadeWitnessHash as arkadeWitnessHash, index_asmToBytes as asmToBytes, index_bytesToASM as bytesToASM, index_computeArkadeScriptPublicKey as computeArkadeScriptPublicKey, index_createArkadeBatchHandler as createArkadeBatchHandler, index_deserializeArkadeContractParams as deserializeArkadeContractParams, index_fromASM as fromASM, index_getOpcodeName as getOpcodeName, index_getOpcodeValue as getOpcodeValue, index_parseArtifact as parseArtifact, index_resolveAsm as resolveAsm, index_serializeArkadeContractParams as serializeArkadeContractParams, index_stringifyArtifact as stringifyArtifact, index_toASM as toASM, index_validateProgram as validateProgram, index_witnessRefToBytes as witnessRefToBytes };
|
|
4932
5068
|
}
|
|
4933
5069
|
|
|
5070
|
+
/** Known BIP21 parameters including Arkade-specific extensions. */
|
|
5071
|
+
interface BIP21Params {
|
|
5072
|
+
address?: string;
|
|
5073
|
+
amount?: number;
|
|
5074
|
+
label?: string;
|
|
5075
|
+
message?: string;
|
|
5076
|
+
/** Optional Arkade address parameter. */
|
|
5077
|
+
ark?: string;
|
|
5078
|
+
/** Optional Silent Payment address parameter. */
|
|
5079
|
+
sp?: string;
|
|
5080
|
+
[key: string]: string | number | undefined;
|
|
5081
|
+
}
|
|
5082
|
+
/** Result returned by `BIP21.parse`. */
|
|
5083
|
+
interface BIP21ParseResult {
|
|
5084
|
+
originalString: string;
|
|
5085
|
+
params: BIP21Params;
|
|
5086
|
+
}
|
|
5087
|
+
declare enum BIP21Error {
|
|
5088
|
+
INVALID_URI = "Invalid BIP21 URI",
|
|
5089
|
+
INVALID_ADDRESS = "Invalid address"
|
|
5090
|
+
}
|
|
5091
|
+
declare class BIP21 {
|
|
5092
|
+
/**
|
|
5093
|
+
* Create a BIP21 URI from the provided parameters.
|
|
5094
|
+
*
|
|
5095
|
+
* @param params - BIP21 parameters to encode
|
|
5096
|
+
* @returns Encoded BIP21 URI
|
|
5097
|
+
*/
|
|
5098
|
+
static create(params: BIP21Params): string;
|
|
5099
|
+
/**
|
|
5100
|
+
* Integer-sats amount encoded in a BIP21 URI (`amount=` is BTC), or
|
|
5101
|
+
* `undefined` when absent or the URI is unparseable. Shared by the payment
|
|
5102
|
+
* rails, which accept either a bare address or a BIP21 URI.
|
|
5103
|
+
*
|
|
5104
|
+
* @param uri - BIP21 URI (or bare address) to read the amount from
|
|
5105
|
+
* @returns The amount in satoshis, or `undefined`
|
|
5106
|
+
*/
|
|
5107
|
+
static amountSats(uri: string): number | undefined;
|
|
5108
|
+
/**
|
|
5109
|
+
* Parse a BIP21 URI and return its decoded parameters.
|
|
5110
|
+
*
|
|
5111
|
+
* @param uri - BIP21 URI to parse
|
|
5112
|
+
* @returns Parsed BIP21 URI data
|
|
5113
|
+
* @throws Error if the URI does not start with the `bitcoin:` scheme
|
|
5114
|
+
*/
|
|
5115
|
+
static parse(uri: string): BIP21ParseResult;
|
|
5116
|
+
}
|
|
5117
|
+
|
|
5118
|
+
type PaymentStatus = "pending" | "sent" | "settled" | "failed";
|
|
5119
|
+
interface RouteResult {
|
|
5120
|
+
railId: string;
|
|
5121
|
+
txid?: string;
|
|
5122
|
+
preimage?: string;
|
|
5123
|
+
swapId?: string;
|
|
5124
|
+
}
|
|
5125
|
+
/** An in-flight payment. Observe it — its outcome may also arrive out-of-band
|
|
5126
|
+
* (swap monitor / webhook) and surface as a tx in the wallet's history. */
|
|
5127
|
+
interface PaymentHandle {
|
|
5128
|
+
readonly id: string;
|
|
5129
|
+
readonly status: PaymentStatus;
|
|
5130
|
+
/** Progress stream; returns an unsubscribe fn. Replays the latest update.
|
|
5131
|
+
* A terminal `"failed"` update carries the rejection in `error` (for swap rails
|
|
5132
|
+
* a `SwapError` whose `isRefundable`/`pendingSwap` drive recovery). */
|
|
5133
|
+
subscribe(fn: (u: {
|
|
5134
|
+
status: PaymentStatus;
|
|
5135
|
+
result?: RouteResult;
|
|
5136
|
+
error?: unknown;
|
|
5137
|
+
}) => void): () => void;
|
|
5138
|
+
/** OPTIONAL await — resolves on a terminal result, rejects on the timeout.
|
|
5139
|
+
* Fire-and-forget rails may never resolve it; that is allowed. */
|
|
5140
|
+
settled(opts?: {
|
|
5141
|
+
timeoutMs?: number;
|
|
5142
|
+
}): Promise<RouteResult>;
|
|
5143
|
+
}
|
|
5144
|
+
/**
|
|
5145
|
+
* A priced route. The three amounts are **receiver-exact** and mean the same
|
|
5146
|
+
* thing on every rail, so `options()` can be ranked on cost and a rail swapped
|
|
5147
|
+
* without changing what the recipient gets:
|
|
5148
|
+
*
|
|
5149
|
+
* - `amount` — sats delivered **to the recipient**.
|
|
5150
|
+
* - `fee` — sats charged **on top**, by the rail and its counterparty.
|
|
5151
|
+
* - `total` — `amount + fee`; the sats that leave the wallet.
|
|
5152
|
+
*
|
|
5153
|
+
* Rails whose underlying primitive *deducts* its fee (the collaborative exit)
|
|
5154
|
+
* gross the amount up to honour this; rails that add it on top pass it through.
|
|
5155
|
+
*
|
|
5156
|
+
* `fee` is a pre-send estimate wherever the true cost is only fixed later: the
|
|
5157
|
+
* swap rails quote from Boltz's advertised pricing and are superseded by the
|
|
5158
|
+
* amount Boltz returns at swap creation, and the collaborative exit does not
|
|
5159
|
+
* include the per-input intent fees, which depend on the VTXO selection made at
|
|
5160
|
+
* settlement. Treat it as a display and ranking figure, not a guarantee.
|
|
5161
|
+
*/
|
|
5162
|
+
interface RouteQuote {
|
|
5163
|
+
railId: string;
|
|
5164
|
+
/** Sats delivered to the recipient. */
|
|
5165
|
+
amount: number;
|
|
5166
|
+
/** Sats charged on top of {@link amount}; an estimate on the swap rails. */
|
|
5167
|
+
fee: number;
|
|
5168
|
+
/** `amount + fee` — what leaves the wallet. */
|
|
5169
|
+
total: number;
|
|
5170
|
+
/** Execute. Returns an observable handle, never a bare result. */
|
|
5171
|
+
send(): Promise<PaymentHandle>;
|
|
5172
|
+
meta?: Record<string, unknown>;
|
|
5173
|
+
}
|
|
5174
|
+
interface RouterPreferences {
|
|
5175
|
+
/** Ordered rail ids; first matching+available wins. Default ships in the factory. */
|
|
5176
|
+
priority?: string[];
|
|
5177
|
+
disabled?: string[];
|
|
5178
|
+
caps?: Record<string, unknown>;
|
|
5179
|
+
/** route() behaviour when >1 option survives ranking. Default "first". */
|
|
5180
|
+
tieBreak?: "first" | "require-choice";
|
|
5181
|
+
}
|
|
5182
|
+
interface RouterContext {
|
|
5183
|
+
wallet: Wallet;
|
|
5184
|
+
/** Loosely typed in core to avoid a dependency on boltz-swap; swap rails cast it. */
|
|
5185
|
+
swaps?: unknown;
|
|
5186
|
+
prefs: RouterPreferences;
|
|
5187
|
+
}
|
|
5188
|
+
/** A payment request: the raw target plus an optional explicit amount. Rails
|
|
5189
|
+
* self-extract their target from `raw` (bare address/invoice or a BIP21 URI);
|
|
5190
|
+
* `amount` supplements or overrides any amount encoded in `raw`. */
|
|
5191
|
+
interface PaymentRequest {
|
|
5192
|
+
/** Raw target: bare address/invoice, or a BIP21 URI. */
|
|
5193
|
+
raw: string;
|
|
5194
|
+
/** Explicit sats; supplements/overrides any amount encoded in `raw`. */
|
|
5195
|
+
amount?: number;
|
|
5196
|
+
}
|
|
5197
|
+
/** A payment rail — registered by id, mirrors the ActivityRegistry resolver shape. */
|
|
5198
|
+
interface PaymentRail {
|
|
5199
|
+
id: string;
|
|
5200
|
+
/** Classification only — amount-blind; takes the request for uniformity. */
|
|
5201
|
+
match(req: PaymentRequest, ctx: RouterContext): boolean;
|
|
5202
|
+
/** Availability gate — where a rail drops itself for an out-of-limits amount. */
|
|
5203
|
+
available?(req: PaymentRequest, ctx: RouterContext): boolean | Promise<boolean>;
|
|
5204
|
+
quote(req: PaymentRequest, ctx: RouterContext): Promise<RouteQuote>;
|
|
5205
|
+
}
|
|
5206
|
+
interface PaymentOption {
|
|
5207
|
+
railId: string;
|
|
5208
|
+
/** Lazy — resolves fee/amount + prepares execution only when called. The
|
|
5209
|
+
* amount is fixed by the request, so this is no-arg. */
|
|
5210
|
+
quote(): Promise<RouteQuote>;
|
|
5211
|
+
}
|
|
5212
|
+
|
|
5213
|
+
/**
|
|
5214
|
+
* Target classification for the payment rails — format only. No bech32
|
|
5215
|
+
* checksum, no bolt11 decode (core carries no bolt11 dependency), no network
|
|
5216
|
+
* match against the wallet. Rails re-validate before spending: `onchain` via
|
|
5217
|
+
* `Ramps.offboard` → `Address.decode`, `lightning` via `getInvoiceSatoshis`.
|
|
5218
|
+
*/
|
|
5219
|
+
/** True if the string decodes as an Arkade address (canonical SDK check). */
|
|
5220
|
+
|
|
5221
|
+
/** True for a BOLT11 invoice (with or without a `lightning:` prefix). HRPs:
|
|
5222
|
+
* mainnet, testnet, signet, regtest, simnet. The amount rides inside the HRP
|
|
5223
|
+
* (`lnbc2500u1…`), so the tail stays loose. */
|
|
5224
|
+
declare const isLightningInvoice: (raw: string) => boolean;
|
|
5225
|
+
/**
|
|
5226
|
+
* True for an LNURL or a Lightning address (`user@host`).
|
|
5227
|
+
*
|
|
5228
|
+
* TODO(lnurl): no rail consumes this yet — LNURL / Lightning-address routing is
|
|
5229
|
+
* planned future work. The predicate is exported ahead of the rail so consumers
|
|
5230
|
+
* can classify these targets today; until the rail lands, `route()` throws
|
|
5231
|
+
* "no rail for" on them. Keep the export (do not flag as unused).
|
|
5232
|
+
*/
|
|
5233
|
+
declare const isLnurl: (raw: string) => boolean;
|
|
5234
|
+
/** True for a bech32 (segwit) or base58 (legacy) Bitcoin address, any network —
|
|
5235
|
+
* legacy covers testnet/regtest `m`/`n`/`2` alongside mainnet `1`/`3`. */
|
|
5236
|
+
declare const isBtcAddress: (raw: string) => boolean;
|
|
5237
|
+
|
|
5238
|
+
/** The ark address in `raw`: bare, or the `ark=` param. */
|
|
5239
|
+
declare const arkTarget: (raw: string) => string | undefined;
|
|
5240
|
+
/** The on-chain BTC address in `raw`: bare, or the URI's address. */
|
|
5241
|
+
declare const btcTarget: (raw: string) => string | undefined;
|
|
5242
|
+
/** The bolt11 invoice in `raw` with any `lightning:` prefix stripped: bare, or
|
|
5243
|
+
* the `lightning=` param. */
|
|
5244
|
+
declare const invoiceTarget: (raw: string) => string | undefined;
|
|
5245
|
+
|
|
5246
|
+
/** Throw unless `amt` is a positive integer number of satoshis. */
|
|
5247
|
+
declare function assertSendableAmount(railId: string, amt: number): void;
|
|
5248
|
+
/**
|
|
5249
|
+
* Resolve a rail's send amount from an explicit value or the BIP21 `amount=`
|
|
5250
|
+
* param, validated as a positive integer number of satoshis. Rejecting here
|
|
5251
|
+
* keeps the router from surfacing a `{ amount: 0 }` quote that only fails later
|
|
5252
|
+
* in wallet/swap code.
|
|
5253
|
+
*/
|
|
5254
|
+
declare function resolveSendAmount(railId: string, raw: string, amount?: number): number;
|
|
5255
|
+
/**
|
|
5256
|
+
* Non-throwing counterpart of {@link resolveSendAmount}, for availability
|
|
5257
|
+
* checks that must not reject the router: returns the positive-integer sats
|
|
5258
|
+
* from the explicit `amount` or the BIP21 `amount=` param, or `undefined` when
|
|
5259
|
+
* none is present or the value is not a positive integer. The missing-vs-invalid
|
|
5260
|
+
* distinction is left to `resolveSendAmount` at quote time.
|
|
5261
|
+
*/
|
|
5262
|
+
declare function tryResolveSendAmount(raw: string, amount?: number): number | undefined;
|
|
5263
|
+
|
|
5264
|
+
type Update = {
|
|
5265
|
+
status: PaymentStatus;
|
|
5266
|
+
result?: RouteResult;
|
|
5267
|
+
error?: unknown;
|
|
5268
|
+
};
|
|
5269
|
+
/** Build an observable handle. `run` starts immediately and gets an `emit` to
|
|
5270
|
+
* stream progress; its resolved value is the terminal result. */
|
|
5271
|
+
declare function makeHandle(id: string, run: (emit: (u: Update) => void) => Promise<RouteResult>): PaymentHandle;
|
|
5272
|
+
|
|
5273
|
+
/** Thrown by `route()` when several options survive and `tieBreak` is
|
|
5274
|
+
* `"require-choice"` — the app must disambiguate via `options()`. */
|
|
5275
|
+
declare class AmbiguousRouteError extends Error {
|
|
5276
|
+
readonly railIds: string[];
|
|
5277
|
+
constructor(railIds: string[]);
|
|
5278
|
+
}
|
|
5279
|
+
/**
|
|
5280
|
+
* Registry-based payment router. Holds id-keyed {@link PaymentRail} entries
|
|
5281
|
+
* (mirroring `ActivityRegistry`): `use()` overwrites by id, `remove()` deletes.
|
|
5282
|
+
* It operates on a {@link PaymentRequest} (raw target + optional amount) —
|
|
5283
|
+
* rails self-extract their target via the shared helpers, and `available()`
|
|
5284
|
+
* gates on the amount. `options()` returns every matching+available rail ranked
|
|
5285
|
+
* by preferences; `route()` is the "take the top" convenience.
|
|
5286
|
+
*/
|
|
5287
|
+
declare class PaymentRouter {
|
|
5288
|
+
private readonly ctx;
|
|
5289
|
+
private readonly rails;
|
|
5290
|
+
constructor(ctx: RouterContext);
|
|
5291
|
+
/** Register a rail (or overwrite one with the same id). */
|
|
5292
|
+
use(rail: PaymentRail): this;
|
|
5293
|
+
/** Remove a rail by id. */
|
|
5294
|
+
remove(id: string): this;
|
|
5295
|
+
/** Rails matching `req`, filtered by `disabled`/`available()`, ranked by
|
|
5296
|
+
* `priority` (unlisted rails keep insertion order, after listed ones). */
|
|
5297
|
+
options(req: PaymentRequest, prefs?: RouterPreferences): Promise<PaymentOption[]>;
|
|
5298
|
+
/** Top-ranked option's quote. Throws when nothing routes, or
|
|
5299
|
+
* {@link AmbiguousRouteError} when `tieBreak` is `"require-choice"` and
|
|
5300
|
+
* more than one option survives. */
|
|
5301
|
+
route(req: PaymentRequest, prefs?: RouterPreferences): Promise<RouteQuote>;
|
|
5302
|
+
}
|
|
5303
|
+
|
|
5304
|
+
/**
|
|
5305
|
+
* Off-chain Arkade send. Matches a bare ark address or the `ark=` param of a
|
|
5306
|
+
* unified BIP21 URI, and settles via `Wallet.send`.
|
|
5307
|
+
*
|
|
5308
|
+
* The only rail that is receiver-exact for free: an off-chain send delivers the
|
|
5309
|
+
* full amount and carries no counterparty or on-chain fee, so `fee` is 0 and
|
|
5310
|
+
* `total` equals `amount` (see {@link RouteQuote}).
|
|
5311
|
+
*/
|
|
5312
|
+
declare function arkRail(): PaymentRail;
|
|
5313
|
+
|
|
5314
|
+
/**
|
|
5315
|
+
* On-chain BTC send via collaborative exit — the Wallet-only on-chain path (no
|
|
5316
|
+
* swap). Matches a bare BTC address or the on-chain part of a unified BIP21 URI
|
|
5317
|
+
* and offboards VTXOs to the address via {@link Ramps.offboard}, which owns
|
|
5318
|
+
* fee-aware coin selection, dust-safe change, and settlement.
|
|
5319
|
+
*
|
|
5320
|
+
* `offboard` deducts its fee from the amount it is handed, so the rail grosses
|
|
5321
|
+
* the amount up first: the recipient receives exactly `quote.amount`, matching
|
|
5322
|
+
* the receiver-exact semantics of every other rail (see {@link RouteQuote}).
|
|
5323
|
+
* `quote.total` is the offboard amount; the per-input intent fees `offboard`
|
|
5324
|
+
* shaves off the selected VTXOs are additional and depend on the selection, so
|
|
5325
|
+
* they are not part of the quote.
|
|
5326
|
+
*
|
|
5327
|
+
* An explicit amount is mandatory. To sweep the full balance, call
|
|
5328
|
+
* `Ramps.offboard(address, feeInfo)` directly — the router has no amountless path.
|
|
5329
|
+
*/
|
|
5330
|
+
declare function onchainRail(): PaymentRail;
|
|
5331
|
+
|
|
5332
|
+
/**
|
|
5333
|
+
* Default payment router with the Wallet-only rails: `ark` (off-chain send) and
|
|
5334
|
+
* `onchain` (collaborative exit). Lightning and chain-swap rails live in
|
|
5335
|
+
* `@arkade-os/boltz-swap`, which ships a `createDefaultPaymentRouter(wallet,
|
|
5336
|
+
* swaps)` overload composing the full set.
|
|
5337
|
+
*
|
|
5338
|
+
* The default priority is `["ark", "lightning", "onchain"]` — the wallet's
|
|
5339
|
+
* Ark > Lightning > on-chain ladder. `"lightning"` is listed so it ranks
|
|
5340
|
+
* correctly once the boltz rail is added; it is simply absent here.
|
|
5341
|
+
*/
|
|
5342
|
+
declare function createDefaultPaymentRouter(wallet: Wallet): PaymentRouter;
|
|
5343
|
+
|
|
4934
5344
|
/**
|
|
4935
5345
|
* Check if an absolute (CLTV) locktime is currently satisfied.
|
|
4936
5346
|
*
|
|
@@ -5086,4 +5496,4 @@ declare class AssetManager extends ReadonlyAssetManager implements IAssetManager
|
|
|
5086
5496
|
burn(params: BurnParams): Promise<string>;
|
|
5087
5497
|
}
|
|
5088
5498
|
|
|
5089
|
-
export { ARKADE_MAGIC, Activity, ActivityRegistry, type AnchorBumper, ArkAddress, ArkIntent, ArkNote, ArkProvider, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, type ArkadeBatchInput, ArkadeCash, ArkadeContractParams, type ArkadeExtendedCoin, type ArkadeExtendedVirtualCoin, Asset, AssetDetails, AssetManager, BIP322, Batch, BurnParams, CSVMultisigTapscript, ChainTx, Coin, ConditionWitness, type ConnectorTreeNode, Contract, ContractEvent, ContractRepository, ContractRepositoryImpl, ContractSyncState, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DefaultVtxo, DelegateInfo, DelegateNotConfiguredError, DelegatorNotConfiguredError, type DescriptorOptions, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, type EmulatorEntry, type EmulatorInfo, EmulatorPacket, type EmulatorProvider, EncodedVtxoScript, Estimator, type ExecutorEvent, type ExitDelay, type ExitFeeWallet, type ExitMode, type ExitOptions, type ExitPackage, type ExitQuote, type ExitStep, type ExitTotals, type ExitVtxoInfo, ExplorerTransaction, ExtendedCoin, ExtendedVirtualCoin, Extension, ExtensionNotFoundError, type ExtensionPacket, FeeAmount, FeeInfo, FeeOutput, FetchError, GetVtxosFilter, HDDescriptorProvider, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBWalletRepository, IndexerProvider, Intent, IntentFeeConfig, IntentFilter, IntentRepository, IssuanceParams, IssuanceResult, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, MigrationGlobalSkipReason, MigrationLegSkipReason, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathContext, PathSelection, PrevArkTxField, PrevoutTxField, ProviderConnectionState, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, RestEmulatorProvider, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignerSession, SignerStatus, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, UnilateralExit, UnknownPacket, Unroll, type VSize, VirtualCoin, VirtualTx, VirtualTxRepository, VtxoBranch, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, index as arkade, assembleBtcdTaprootTree, index$1 as asset, buildForfeitTx, buildOffchainTx, buildVersion, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, createAssetPacket, decodeArkContract, deserializeExitPackage, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isCltvSatisfied, isCsvSpendable, isMessageBusInitializingError, isMessageBusNotInitializedError, isRetryableProviderError, isValidArkAddress, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sdkVersion, selectCoinsWithAsset, sequenceToTimelock, serializeExitPackage, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
|
|
5499
|
+
export { ARKADE_MAGIC, Activity, ActivityRegistry, AmbiguousRouteError, type AnchorBumper, ArkAddress, ArkIntent, ArkNote, ArkProvider, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, type ArkadeBatchInput, ArkadeCash, ArkadeContractParams, type ArkadeExtendedCoin, type ArkadeExtendedVirtualCoin, Asset, AssetDetails, AssetManager, BIP21, BIP21Error, type BIP21Params, type BIP21ParseResult, BIP322, Batch, BurnParams, CSVMultisigTapscript, ChainTx, Coin, ConditionWitness, type ConnectorTreeNode, Contract, ContractEvent, ContractRepository, ContractRepositoryImpl, ContractSyncState, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DefaultVtxo, DelegateInfo, DelegateNotConfiguredError, DelegatorNotConfiguredError, DescriptorIdentity, type DescriptorIdentityOptions, type DescriptorOptions, type DescriptorSigner, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, type EmulatorEntry, type EmulatorInfo, EmulatorPacket, type EmulatorProvider, EncodedVtxoScript, Estimator, type ExecutorEvent, type ExitDelay, type ExitFeeWallet, type ExitMode, type ExitOptions, type ExitPackage, type ExitQuote, type ExitStep, type ExitTotals, type ExitVtxoInfo, ExplorerTransaction, ExtendedCoin, ExtendedVirtualCoin, Extension, ExtensionNotFoundError, type ExtensionPacket, FeeAmount, FeeInfo, FeeOutput, FetchError, GetVtxosFilter, HDDescriptorProvider, type HDDeterministicSignCapable, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBWalletRepository, IndexerProvider, Intent, IntentFeeConfig, IntentFilter, IntentRepository, IssuanceParams, IssuanceResult, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, MigrationGlobalSkipReason, MigrationLegSkipReason, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathContext, PathSelection, type PaymentHandle, type PaymentOption, type PaymentRail, type PaymentRequest, PaymentRouter, type PaymentStatus, PrevArkTxField, PrevoutTxField, ProviderConnectionState, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, RestEmulatorProvider, type RouteQuote, type RouteResult, type RouterContext, type RouterPreferences, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignerSession, SignerStatus, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, UnilateralExit, UnknownPacket, Unroll, type VSize, VirtualCoin, VirtualTx, VirtualTxRepository, VtxoBranch, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, arkRail, arkTarget, index as arkade, assembleBtcdTaprootTree, assertSendableAmount, assertSubmittedArkTxid, index$1 as asset, btcTarget, buildForfeitTx, buildOffchainTx, buildVersion, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, createAssetPacket, createDefaultPaymentRouter, decodeArkContract, deriveDescriptorLeafCompressedPubKey, deserializeExitPackage, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, invoiceTarget, isArkContract, isBtcAddress, isCltvSatisfied, isCsvSpendable, isHDDeterministicSignCapable, isLightningInvoice, isLnurl, isMessageBusInitializingError, isMessageBusNotInitializedError, isRetryableProviderError, isValidArkAddress, makeHandle, matchServerCheckpoints, migrateWalletRepository, onchainRail, openDatabase, requiresMigration, resolveSendAmount, rollbackMigration, sdkVersion, selectCoinsWithAsset, sequenceToTimelock, serializeExitPackage, setArkPsbtField, setupServiceWorker, timelockToSequence, tryResolveSendAmount, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
|