@arkade-os/sdk 0.4.59 → 0.4.60
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 +34 -6
- 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-C9DsPSm8.d.cts → ark-D2_yNhfz.d.cts} +1009 -523
- package/dist/{ark-C9DsPSm8.d.ts → ark-D2_yNhfz.d.ts} +1009 -523
- package/dist/{asyncStorageTaskQueue-CYHXFfvn.d.cts → asyncStorageTaskQueue-CqijAAPG.d.cts} +1 -1
- package/dist/{asyncStorageTaskQueue-BwuWQ1Qc.d.ts → asyncStorageTaskQueue-Vsp6uk8e.d.ts} +1 -1
- package/dist/{chunk-PN5RD7ZI.js → chunk-2DINXHGQ.js} +1665 -1149
- package/dist/chunk-2DINXHGQ.js.map +1 -0
- package/dist/{chunk-IPFGYVF3.cjs → chunk-2XLNQHG4.cjs} +10 -10
- package/dist/chunk-2XLNQHG4.cjs.map +1 -0
- package/dist/{chunk-VSHY5TBY.js → chunk-3Q7BBUWO.js} +4 -4
- package/dist/{chunk-VSHY5TBY.js.map → chunk-3Q7BBUWO.js.map} +1 -1
- package/dist/{chunk-DSTYXT2D.cjs → chunk-4A4GRSTB.cjs} +44 -6
- package/dist/chunk-4A4GRSTB.cjs.map +1 -0
- package/dist/{chunk-H342JPPZ.js → chunk-B66RYHTB.js} +5 -5
- package/dist/chunk-B66RYHTB.js.map +1 -0
- package/dist/{chunk-YEHGCHIL.js → chunk-FSKANUV4.js} +12 -5
- package/dist/chunk-FSKANUV4.js.map +1 -0
- package/dist/{chunk-7FA36NOA.cjs → chunk-H7JCHFM6.cjs} +17 -17
- package/dist/{chunk-7FA36NOA.cjs.map → chunk-H7JCHFM6.cjs.map} +1 -1
- package/dist/{chunk-FIMOVH25.js → chunk-JBULXTCC.js} +40 -7
- package/dist/chunk-JBULXTCC.js.map +1 -0
- package/dist/{chunk-DYNB6POO.cjs → chunk-KNS5MTTI.cjs} +3820 -2915
- package/dist/chunk-KNS5MTTI.cjs.map +1 -0
- package/dist/{chunk-2XO43UHI.cjs → chunk-MZNLCMUP.cjs} +1686 -1169
- package/dist/chunk-MZNLCMUP.cjs.map +1 -0
- package/dist/{chunk-V2KENVN6.cjs → chunk-PRFL62ID.cjs} +22 -15
- package/dist/chunk-PRFL62ID.cjs.map +1 -0
- package/dist/{chunk-OVSNY3HC.js → chunk-Y54MUBT7.js} +3476 -2584
- package/dist/chunk-Y54MUBT7.js.map +1 -0
- package/dist/contracts/handlers/index.cjs +12 -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-D0eGaz3J.d.cts → delegate-DNEuM_nK.d.cts} +1 -1
- package/dist/{delegate-B_oKWm1k.d.ts → delegate-DidNTsKm.d.ts} +1 -1
- package/dist/{index-BmK6tEqf.d.ts → index-BP8-zniX.d.cts} +182 -26
- package/dist/{index-BG2AL2Ie.d.cts → index-DzQbNQUG.d.ts} +182 -26
- package/dist/index.cjs +302 -230
- package/dist/index.d.cts +286 -48
- package/dist/index.d.ts +286 -48
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +43 -23
- package/dist/repositories/realm/index.cjs.map +1 -1
- package/dist/repositories/realm/index.d.cts +21 -9
- package/dist/repositories/realm/index.d.ts +21 -9
- package/dist/repositories/realm/index.js +29 -9
- package/dist/repositories/realm/index.js.map +1 -1
- package/dist/repositories/sqlite/index.cjs +48 -23
- package/dist/repositories/sqlite/index.cjs.map +1 -1
- package/dist/repositories/sqlite/index.d.cts +9 -3
- package/dist/repositories/sqlite/index.d.ts +9 -3
- package/dist/repositories/sqlite/index.js +35 -10
- package/dist/repositories/sqlite/index.js.map +1 -1
- package/dist/{taskRunner-Cy4Gh8n7.d.ts → taskRunner-9gnlYEpb.d.ts} +1 -1
- package/dist/{taskRunner-CBvKIttE.d.cts → taskRunner-BEQNFEa4.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 +17 -14
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +5 -4
- package/dist/wallet/expo/index.d.ts +5 -4
- package/dist/wallet/expo/index.js +8 -5
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/{wallet-EyVDhqzP.d.ts → wallet-C_MYHyOj.d.ts} +155 -17
- package/dist/{wallet-DlXemAzP.d.cts → wallet-ipUA1XCp.d.cts} +155 -17
- package/dist/worker/expo/index.cjs +9 -9
- package/dist/worker/expo/index.d.cts +5 -5
- package/dist/worker/expo/index.d.ts +5 -5
- package/dist/worker/expo/index.js +5 -5
- package/package.json +4 -2
- package/dist/chunk-2XO43UHI.cjs.map +0 -1
- package/dist/chunk-DSTYXT2D.cjs.map +0 -1
- package/dist/chunk-DYNB6POO.cjs.map +0 -1
- package/dist/chunk-FIMOVH25.js.map +0 -1
- package/dist/chunk-H342JPPZ.js.map +0 -1
- package/dist/chunk-IPFGYVF3.cjs.map +0 -1
- package/dist/chunk-OVSNY3HC.js.map +0 -1
- package/dist/chunk-PN5RD7ZI.js.map +0 -1
- package/dist/chunk-V2KENVN6.cjs.map +0 -1
- package/dist/chunk-YEHGCHIL.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot, P as ProviderConnectionState, B as BatchExpiryPolicy,
|
|
4
|
-
export { A as ArkError,
|
|
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-
|
|
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-
|
|
7
|
-
import { D as DefaultVtxo } from './delegate-
|
|
8
|
-
export { a as DelegateVtxo } from './delegate-
|
|
1
|
+
import { a1 as ReadonlyIdentity, a as Identity, ao as DescriptorSigningRequest, ap as Transaction, ak as SignerSession, $ 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, aq as IntentFeeConfig, ar as OffchainInput, as as FeeAmount, at as OnchainInput, au as FeeOutput, n as ArkProvider, ai as SettlementConfig, av as ContractWatcherConfig, aw as Asset, R as Recipient, I as IWallet, ax as FeeInfo, i as SettlementEvent, h as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, ay as CreateContractParams, az as GetContractsFilter, r as VirtualCoin, aA as GetSpendablePathsOptions, aB as GetAllSpendingPathsOptions, aC as IssuanceParams, aD as ReissuanceParams, aE as BurnParams, aF as RenewVtxosOptions, c as WalletBalance, a8 as ContractSyncState, ad as ContractWithVtxos, aG as PathSelection, aH as ContractEvent, aI as AssetDetails, aJ as IssuanceResult, aK as DelegateInfo, aL as MigrationGlobalSkipReason, aM as MigrationLegSkipReason, aN as SignerStatus, a0 as IReadonlyWallet, d as ActivityRegistry, a7 as IReadonlyAssetManager, aO as StorageConfig, e as Activity, N as NormalizedExtendedVirtualCoin, f as IContractManager, j as IAssetManager, g as IDelegateManager, aP as IVtxoManager, a2 as OnchainProvider, J as Network, aa as NetworkName, af as Coin, aQ as ExplorerTransaction, q as TapLeafScript, aR as EncodedVtxoScript, K as CSVMultisigTapscript, p as RelativeTimelock, V as VtxoScript, aS as Status, ac as ArkAddress, am as Intent, aT as ChainTx, o as IndexerProvider, P as TxTree, aU as PathContext } from './ark-D2_yNhfz.cjs';
|
|
2
|
+
export { aV as ActivityIntent, aW as ActivityResolver, ab as ArkInfo, aX as ArkIntentState, aY as ArkTapscript, aZ as AssetMetadata, a_ as BITCOIN_EMULATOR_PUBKEY, a$ as BaseWalletConfig, Y as BatchFailedEvent, U as BatchFinalizationEvent, X as BatchFinalizedEvent, b0 as BatchInfo, b1 as BatchSignableIdentity, L as BatchStartedEvent, b2 as CLTVMultisigTapscript, b3 as CandidateDeps, b4 as ChainTxType, H as ChainedTxType, b5 as CommitmentTx, b6 as ConditionCSVMultisigTapscript, b7 as ConditionMultisigTapscript, b8 as ContractBalance, b9 as ContractEventCallback, ba as ContractHandler, ag as ContractManager, ah as ContractManagerConfig, bb as ContractState, bc as ContractVtxo, bd as ContractWatcher, be as DelegateManagerImpl, bf as DelegateOptions, a3 as DelegateProvider, bg as DelegatorManagerImpl, bh as DelegatorProvider, bi as DeprecatedSignerMigrationReport, bj as DeprecatedSignerReport, bk as DigestMismatchError, bl as Discoverable, bm as DiscoveredContract, bn as DiscoveryDeps, bo as ESPLORA_URL, bp as EsploraProvider, bq as EventSourceCapable, br as EventSourceFactory, bs as EventSourceLike, bt as EventSourceUnavailableError, a5 as ExitCaptureMode, bu as ExitChainResolver, a6 as ExitDataSource, bv as ExtendedContractVtxo, bw as GroupMembership, bx as HandlerError, by as IDelegatorManager, bz as INTENT_TERMINAL_STATES, bA as IndexerTxType, bB as KnownMetadata, bC as MUTINYNET_EMULATOR_PUBKEY, bD as MigrateDeprecatedSignerOptions, bE as MigrationLegReport, bF as MigrationVtxoRef, bG as MultisigTapscript, bH as Nonces, bI as Output, bJ as PageResponse, bK as PaginationOptions, bL as PartialSig, bM as ProviderClass, bN as REGTEST_EMULATOR_PUBKEY, a4 as ReadonlyWalletConfig, k as RestArkProvider, bO as RestDelegateProvider, bP as RestDelegatorProvider, l as RestIndexerProvider, bQ as ScanContractsOptions, bR as ScanResult, bS as ScheduledSession, bT as SettlementEventType, bU as SignRequest, al as SignedIntent, bV as SignerClassification, bW as SignerSet, bX as SubscriptionEvent, bY as SubscriptionHeartbeat, m as SubscriptionResponse, bZ as TapLeaves, b_ as TapTreeCoder, b$ as TapscriptType, an as TimeHeight, c0 as TreeNonces, Q as TreeNoncesEvent, c1 as TreePartialSigs, _ as TreeSignatureEvent, M as TreeSigningStartedEvent, Z as TreeTxEvent, c2 as Tx, c3 as TxHistoryRecord, c4 as TxKey, T as TxNotification, c5 as TxTag, c6 as TxTreeNode, c7 as TxType, c8 as VirtualStatus, c9 as Vtxo, ca as VtxoChain, aj as VtxoManager, cb as VtxoType, b as WalletConfig, cc as WalletMode, cd as assetMintResolver, ce as boardingResolver, cf as canRecoverOnchain, cg as canSpendOffchain, ch as classifyAgainstSignerSet, ci as classifyContractSigner, cj as collabExitResolver, ck as configureEventSource, cl as createDefaultActivityRegistry, cm as createExitChainResolver, cn as decodeTapscript, co as defaultEmulatorPubkey, cp as getConfiguredEventSource, cq as getNetwork, cr as getRandomId, cs as getSequence, ct as hasCandidates, cu as hasTerminalSpend, cv as isBatchSignable, cw as isCooperativelyMigratable, cx as isDiscoverable, cy as isEventSourceUnavailableError, cz as isExpired, cA as isPastExpiry, cB as isRecoverable, cC as isSpendable, cD as isSubdust, cE as isTerminalIntentState, cF as isVirtualCoin, cG as isVtxoExpiringSoon, cH as networks, cI as resolveEmulatorPubkey, cJ as resolveEventSource, cK as scriptFromTapLeafScript, cL as signerSetFromInfo, cM as toXOnlySignerHex } from './ark-D2_yNhfz.cjs';
|
|
3
|
+
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot, P as ProviderConnectionState, H as HDWalletCapable, d as HDAllocationCapable, B as BatchExpiryPolicy, e as Batch } from './wallet-ipUA1XCp.cjs';
|
|
4
|
+
export { A as ArkError, f as ArkErrorName, g as ArkadeCashClaimResult, h as ArkadeCashCreateError, i as ArkadeCashUnclaimedReason, j as ArkadeCashUnclaimedVtxo, k as BoardingUtxoGroup, C as CheckpointExitDelayPolicy, D as DEFAULT_MIN_BATCH_EXPIRY_SECONDS, l as DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, I as IncomingFunds, M as MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD, m as MUTINYNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, n as ProviderKind, o as ProviderUnavailableError, p as REGTEST_MIN_BATCH_EXPIRY_SECONDS, q as REGTEST_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, S as SIGNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, r as ServerInfoSource, s as ServerResponseMismatchError, t as assertValidBatchExpiry, u as assertValidServerUnrollScript, v as defaultBatchExpiryPolicy, w as defaultCheckpointExitDelayPolicy, x as isArkError, y as isHDAllocationCapable, z as isHDWalletCapable, E as maybeArkError, F as resolveBatchExpiryPolicy, G as resolveCheckpointExitDelayPolicy, J as selectVirtualCoins, K as signingDescriptorIndex, L as strictSigningDescriptorIndex, N as waitForIncomingFunds } from './wallet-ipUA1XCp.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-BP8-zniX.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 VHTLCV2ContractHandler, E as VHTLCV2ContractParams, F as contractHandlers } from './index-BP8-zniX.cjs';
|
|
7
|
+
import { D as DefaultVtxo } from './delegate-DNEuM_nK.cjs';
|
|
8
|
+
export { a as DelegateVtxo } from './delegate-DNEuM_nK.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';
|
|
@@ -589,6 +589,61 @@ declare class InMemoryWalletRepository implements WalletRepository {
|
|
|
589
589
|
[Symbol.asyncDispose](): Promise<void>;
|
|
590
590
|
}
|
|
591
591
|
|
|
592
|
+
/**
|
|
593
|
+
* Whether generic wallet spending may select this contract's VTXOs.
|
|
594
|
+
*
|
|
595
|
+
* Default closed: a type whose handler declares nothing — a custom type, a
|
|
596
|
+
* plugin type, a row whose handler is not registered in this context — is not
|
|
597
|
+
* spendable. Every shipped handler answers explicitly.
|
|
598
|
+
*
|
|
599
|
+
* @see ContractHandler.isGenericallySpendable
|
|
600
|
+
*/
|
|
601
|
+
declare function isContractGenericallySpendable(contract: Contract): boolean;
|
|
602
|
+
/**
|
|
603
|
+
* The contracts generic spending must skip, as `script → type`. VTXOs are keyed
|
|
604
|
+
* to their contract by `script`, so membership answers the per-VTXO question too.
|
|
605
|
+
*/
|
|
606
|
+
declare function gatedContracts(contracts: readonly Contract[]): Map<string, string>;
|
|
607
|
+
/** The minimum a VTXO must carry to be matched against an exclusion set. */
|
|
608
|
+
type ExcludableVtxo = {
|
|
609
|
+
txid: string;
|
|
610
|
+
vout: number;
|
|
611
|
+
script?: string;
|
|
612
|
+
};
|
|
613
|
+
/**
|
|
614
|
+
* Why generic spending skips a VTXO, or `undefined` when it does not — phrased
|
|
615
|
+
* to follow the outpoint in a log line.
|
|
616
|
+
*
|
|
617
|
+
* Generic spending applies three exclusions (the contract gate, pending
|
|
618
|
+
* recovery, intent locks) that key on different things — script, script,
|
|
619
|
+
* outpoint. Stating each as a reason-or-undefined lets all three report through
|
|
620
|
+
* one path, so no exclusion can drop a coin silently while another logs.
|
|
621
|
+
*/
|
|
622
|
+
type VtxoExclusion = (vtxo: ExcludableVtxo) => string | undefined;
|
|
623
|
+
/** The contract gate as an exclusion, naming the type that closed it. */
|
|
624
|
+
declare function gateExclusion(gated: ReadonlyMap<string, string>): VtxoExclusion;
|
|
625
|
+
/** Outpoints excluded for a shared reason, e.g. an intent-lock set. */
|
|
626
|
+
declare function outpointExclusion(outpoints: ReadonlySet<string>, reason: string): VtxoExclusion;
|
|
627
|
+
/**
|
|
628
|
+
* Report VTXOs an exclusion dropped — the only field-diagnosable signal for why
|
|
629
|
+
* a coin is missing from a spend, or why an explicitly named one will fail.
|
|
630
|
+
* Debug level, one line per VTXO per reason.
|
|
631
|
+
*/
|
|
632
|
+
declare function logExcludedVtxos(source: string, vtxos: readonly ExcludableVtxo[], exclusions: readonly VtxoExclusion[]): void;
|
|
633
|
+
/**
|
|
634
|
+
* Thrown when a spend names VTXOs whose contract can no longer be annotated —
|
|
635
|
+
* its handler is not registered here, its handler rejects the stored params, or
|
|
636
|
+
* it has no contract row at all.
|
|
637
|
+
*
|
|
638
|
+
* Raised before submission on purpose. Spending reads the tapscripts stored on
|
|
639
|
+
* each coin rather than re-deriving them, so such a spend would otherwise build
|
|
640
|
+
* and broadcast normally and only fail in the bookkeeping afterwards, leaving
|
|
641
|
+
* the transaction on the network and the local state behind it.
|
|
642
|
+
*/
|
|
643
|
+
declare class UnannotatableInputError extends Error {
|
|
644
|
+
readonly name = "UnannotatableInputError";
|
|
645
|
+
}
|
|
646
|
+
|
|
592
647
|
/**
|
|
593
648
|
* Encode a contract to the arkcontract string format.
|
|
594
649
|
*
|
|
@@ -688,12 +743,35 @@ declare function contractFromArkContractWithAddress(encoded: string, serverPubKe
|
|
|
688
743
|
*/
|
|
689
744
|
declare function isArkContract(str: string): boolean;
|
|
690
745
|
|
|
746
|
+
/**
|
|
747
|
+
* Thrown when a descriptor-capable contract (default, delegate, or boarding)
|
|
748
|
+
* cannot be routed to any signer: its owner key (`params.pubKey`) is not this
|
|
749
|
+
* wallet's baseline signing key, and the record carries no
|
|
750
|
+
* `metadata.signingDescriptor` to send it to a descriptor-aware signer.
|
|
751
|
+
*
|
|
752
|
+
* Note that this can arise also when a contract belongs to a different identity (storage reuse).
|
|
753
|
+
*/
|
|
754
|
+
declare class MissingSigningDescriptorError extends Error {
|
|
755
|
+
readonly contractScript: string;
|
|
756
|
+
readonly contractType: "default" | "delegate" | "boarding";
|
|
757
|
+
readonly name = "MissingSigningDescriptorError";
|
|
758
|
+
constructor(contractScript: string, contractType: "default" | "delegate" | "boarding");
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Thrown when an input needs descriptor-aware signing but no
|
|
762
|
+
* DescriptorProvider was wired into the wallet.
|
|
763
|
+
*/
|
|
764
|
+
declare class DescriptorSigningProviderMissingError extends Error {
|
|
765
|
+
readonly name = "DescriptorSigningProviderMissingError";
|
|
766
|
+
constructor();
|
|
767
|
+
}
|
|
768
|
+
|
|
691
769
|
/**
|
|
692
770
|
* In-memory implementation of ContractRepository.
|
|
693
771
|
* Data is ephemeral and scoped to the instance.
|
|
694
772
|
*/
|
|
695
773
|
declare class InMemoryContractRepository implements ContractRepository {
|
|
696
|
-
readonly version:
|
|
774
|
+
readonly version: 2;
|
|
697
775
|
private readonly contractData;
|
|
698
776
|
private readonly collections;
|
|
699
777
|
private readonly contractsByScript;
|
|
@@ -711,7 +789,7 @@ declare class InMemoryContractRepository implements ContractRepository {
|
|
|
711
789
|
*/
|
|
712
790
|
declare class IndexedDBContractRepository implements ContractRepository {
|
|
713
791
|
private readonly dbName;
|
|
714
|
-
readonly version:
|
|
792
|
+
readonly version: 2;
|
|
715
793
|
private db;
|
|
716
794
|
constructor(dbName?: string);
|
|
717
795
|
clear(): Promise<void>;
|
|
@@ -798,9 +876,9 @@ declare class WalletRepositoryImpl implements WalletRepository {
|
|
|
798
876
|
* @deprecated This is only to be used in migration from storage V1
|
|
799
877
|
*/
|
|
800
878
|
declare class ContractRepositoryImpl implements ContractRepository {
|
|
801
|
-
readonly version: 1;
|
|
802
879
|
private storage;
|
|
803
880
|
constructor(storage: StorageAdapter);
|
|
881
|
+
get version(): 2;
|
|
804
882
|
getContractData<T>(contractId: string, key: string): Promise<T | null>;
|
|
805
883
|
setContractData<T>(contractId: string, key: string, data: T): Promise<void>;
|
|
806
884
|
deleteContractData(contractId: string, key: string): Promise<void>;
|
|
@@ -863,29 +941,6 @@ declare class Estimator {
|
|
|
863
941
|
evaluate(offchainInputs: OffchainInput[], onchainInputs: OnchainInput[], offchainOutputs: FeeOutput[], onchainOutputs: FeeOutput[]): FeeAmount;
|
|
864
942
|
}
|
|
865
943
|
|
|
866
|
-
/**
|
|
867
|
-
* Thrown when a descriptor-capable contract (default, delegate, or boarding)
|
|
868
|
-
* cannot be routed to any signer: its owner key (`params.pubKey`) is not this
|
|
869
|
-
* wallet's baseline signing key, and the record carries no
|
|
870
|
-
* `metadata.signingDescriptor` to send it to a descriptor-aware signer.
|
|
871
|
-
*
|
|
872
|
-
* Note that this can arise also when a contract belongs to a different identity (storage reuse).
|
|
873
|
-
*/
|
|
874
|
-
declare class MissingSigningDescriptorError extends Error {
|
|
875
|
-
readonly contractScript: string;
|
|
876
|
-
readonly contractType: "default" | "delegate" | "boarding";
|
|
877
|
-
readonly name = "MissingSigningDescriptorError";
|
|
878
|
-
constructor(contractScript: string, contractType: "default" | "delegate" | "boarding");
|
|
879
|
-
}
|
|
880
|
-
/**
|
|
881
|
-
* Thrown when an input needs descriptor-aware signing but no
|
|
882
|
-
* DescriptorProvider was wired into the wallet.
|
|
883
|
-
*/
|
|
884
|
-
declare class DescriptorSigningProviderMissingError extends Error {
|
|
885
|
-
readonly name = "DescriptorSigningProviderMissingError";
|
|
886
|
-
constructor();
|
|
887
|
-
}
|
|
888
|
-
|
|
889
944
|
type RequestEnvelope = {
|
|
890
945
|
tag: string;
|
|
891
946
|
id: string;
|
|
@@ -951,6 +1006,16 @@ type Options = {
|
|
|
951
1006
|
* every (re-)init.
|
|
952
1007
|
*/
|
|
953
1008
|
messageTimeoutOverrides?: Record<string, number>;
|
|
1009
|
+
/**
|
|
1010
|
+
* Optional intent-lifecycle repository, handed to the worker's wallet as
|
|
1011
|
+
* `storage.intentRepository`. Same opt-in as a main-thread wallet: without
|
|
1012
|
+
* it the worker persists no settlement intent, reconciles none on restart,
|
|
1013
|
+
* and counts intent-locked VTXOs as available. Pass the same repository the
|
|
1014
|
+
* main thread uses so both sides read one intent state.
|
|
1015
|
+
*
|
|
1016
|
+
* Ignored when `buildServices` is supplied — that override owns `storage`.
|
|
1017
|
+
*/
|
|
1018
|
+
intentRepository?: IntentRepository;
|
|
954
1019
|
debug?: boolean;
|
|
955
1020
|
buildServices?: (config: Initialize["config"]) => Promise<{
|
|
956
1021
|
arkProvider: ArkProvider;
|
|
@@ -1015,8 +1080,9 @@ declare class MessageBus {
|
|
|
1015
1080
|
private pendingInitCount;
|
|
1016
1081
|
private readonly buildServicesFn;
|
|
1017
1082
|
private readonly boundOnMessage;
|
|
1083
|
+
private readonly intentRepository?;
|
|
1018
1084
|
/** Create the service-worker message bus with repositories and handler configuration. */
|
|
1019
|
-
constructor(walletRepository: WalletRepository, contractRepository: ContractRepository, { messageHandlers, tickIntervalMs, messageTimeoutMs, messageTimeoutOverrides, debug, buildServices, }: Options);
|
|
1085
|
+
constructor(walletRepository: WalletRepository, contractRepository: ContractRepository, { messageHandlers, tickIntervalMs, messageTimeoutMs, messageTimeoutOverrides, intentRepository, debug, buildServices, }: Options);
|
|
1020
1086
|
/** Start the message bus and attach service-worker event listeners. */
|
|
1021
1087
|
start(): Promise<void>;
|
|
1022
1088
|
/** Stop the message bus, cancel ticks, and stop all registered handlers. */
|
|
@@ -1804,7 +1870,7 @@ declare class Ramps {
|
|
|
1804
1870
|
* @param eventCallback - Optional callback that receives settlement events
|
|
1805
1871
|
* @returns The Arkade transaction id created by settlement
|
|
1806
1872
|
* @throws Error if no virtual outputs remain after fee deduction or the destination address cannot be decoded
|
|
1807
|
-
* @see IWallet.
|
|
1873
|
+
* @see IWallet.getSpendableVtxos
|
|
1808
1874
|
* @see IWallet.settle
|
|
1809
1875
|
* @example
|
|
1810
1876
|
* ```typescript
|
|
@@ -1886,10 +1952,13 @@ declare class HDDescriptorProvider implements DescriptorProvider, ReceiveRotator
|
|
|
1886
1952
|
* `getNextSigningDescriptor()` skips indices discovered by a restore
|
|
1887
1953
|
* scan. Never rewinds: a lower or equal `index` is a no-op.
|
|
1888
1954
|
*
|
|
1889
|
-
* An invalid `index` (non-integer / negative
|
|
1890
|
-
*
|
|
1891
|
-
* `parseSettings()` throw, mirroring
|
|
1892
|
-
* already enforces.
|
|
1955
|
+
* An invalid `index` (non-integer / negative / past the BIP32
|
|
1956
|
+
* non-hardened ceiling) is ignored (no-op): persisting it would corrupt
|
|
1957
|
+
* `lastIndexUsed` and make the next `parseSettings()` throw, mirroring
|
|
1958
|
+
* the validation parseSettings already enforces. The upper bound matters
|
|
1959
|
+
* because the damage outlives the call — `materializeDescriptorAt` cannot
|
|
1960
|
+
* derive at or above 2^31, so a watermark parked there would fail every
|
|
1961
|
+
* subsequent allocation for the life of the repo.
|
|
1893
1962
|
*/
|
|
1894
1963
|
advanceLastIndexUsed(index: number): Promise<void>;
|
|
1895
1964
|
/**
|
|
@@ -2041,6 +2110,18 @@ type ResponseGetVtxos = ResponseEnvelope & {
|
|
|
2041
2110
|
vtxos: Awaited<ReturnType<IWallet["getVtxos"]>>;
|
|
2042
2111
|
};
|
|
2043
2112
|
};
|
|
2113
|
+
type RequestGetSpendableVtxos = RequestEnvelope & {
|
|
2114
|
+
type: "GET_SPENDABLE_VTXOS";
|
|
2115
|
+
payload: {
|
|
2116
|
+
filter?: GetVtxosFilter;
|
|
2117
|
+
};
|
|
2118
|
+
};
|
|
2119
|
+
type ResponseGetSpendableVtxos = ResponseEnvelope & {
|
|
2120
|
+
type: "SPENDABLE_VTXOS";
|
|
2121
|
+
payload: {
|
|
2122
|
+
vtxos: Awaited<ReturnType<IWallet["getSpendableVtxos"]>>;
|
|
2123
|
+
};
|
|
2124
|
+
};
|
|
2044
2125
|
type RequestGetBoardingUtxos = RequestEnvelope & {
|
|
2045
2126
|
type: "GET_BOARDING_UTXOS";
|
|
2046
2127
|
};
|
|
@@ -2225,6 +2306,45 @@ type RequestRefreshOutpoints = RequestEnvelope & {
|
|
|
2225
2306
|
type ResponseRefreshOutpoints = ResponseEnvelope & {
|
|
2226
2307
|
type: "REFRESH_OUTPOINTS_SUCCESS";
|
|
2227
2308
|
};
|
|
2309
|
+
type RequestGetCurrentSigningDescriptor = RequestEnvelope & {
|
|
2310
|
+
type: "GET_CURRENT_SIGNING_DESCRIPTOR";
|
|
2311
|
+
};
|
|
2312
|
+
type ResponseGetCurrentSigningDescriptor = ResponseEnvelope & {
|
|
2313
|
+
type: "CURRENT_SIGNING_DESCRIPTOR";
|
|
2314
|
+
payload: {
|
|
2315
|
+
descriptor?: string;
|
|
2316
|
+
};
|
|
2317
|
+
};
|
|
2318
|
+
type RequestGetNextSigningDescriptor = RequestEnvelope & {
|
|
2319
|
+
type: "GET_NEXT_SIGNING_DESCRIPTOR";
|
|
2320
|
+
};
|
|
2321
|
+
type ResponseGetNextSigningDescriptor = ResponseEnvelope & {
|
|
2322
|
+
type: "NEXT_SIGNING_DESCRIPTOR";
|
|
2323
|
+
payload: {
|
|
2324
|
+
descriptor?: string;
|
|
2325
|
+
};
|
|
2326
|
+
};
|
|
2327
|
+
type RequestGetUsedSigningDescriptors = RequestEnvelope & {
|
|
2328
|
+
type: "GET_USED_SIGNING_DESCRIPTORS";
|
|
2329
|
+
payload?: {
|
|
2330
|
+
lookAhead?: number;
|
|
2331
|
+
};
|
|
2332
|
+
};
|
|
2333
|
+
type ResponseGetUsedSigningDescriptors = ResponseEnvelope & {
|
|
2334
|
+
type: "USED_SIGNING_DESCRIPTORS";
|
|
2335
|
+
payload: {
|
|
2336
|
+
descriptors: string[];
|
|
2337
|
+
};
|
|
2338
|
+
};
|
|
2339
|
+
type RequestAdvanceSigningDescriptorWatermark = RequestEnvelope & {
|
|
2340
|
+
type: "ADVANCE_SIGNING_DESCRIPTOR_WATERMARK";
|
|
2341
|
+
payload: {
|
|
2342
|
+
descriptor: string;
|
|
2343
|
+
};
|
|
2344
|
+
};
|
|
2345
|
+
type ResponseAdvanceSigningDescriptorWatermark = ResponseEnvelope & {
|
|
2346
|
+
type: "SIGNING_DESCRIPTOR_WATERMARK_ADVANCED";
|
|
2347
|
+
};
|
|
2228
2348
|
type RequestGetAllSpendingPaths = RequestEnvelope & {
|
|
2229
2349
|
type: "GET_ALL_SPENDING_PATHS";
|
|
2230
2350
|
payload: {
|
|
@@ -2499,8 +2619,8 @@ type RequestRestoreWallet = RequestEnvelope & {
|
|
|
2499
2619
|
type ResponseRestoreWallet = ResponseEnvelope & {
|
|
2500
2620
|
type: "RESTORE_WALLET_SUCCESS";
|
|
2501
2621
|
};
|
|
2502
|
-
type WalletUpdaterRequest = RequestInitWallet | RequestSettle | RequestSendBitcoin | RequestGetAddress | RequestGetBoardingAddress | RequestGetBalance | RequestGetVtxos | RequestGetBoardingUtxos | RequestGetTransactionHistory | RequestGetStatus | RequestGetContractSyncState | RequestClear | RequestReloadWallet | RequestSignTransaction | RequestCreateContract | RequestGetContracts | RequestGetContractsWithVtxos | RequestAnnotateVtxos | RequestUpdateContract | RequestDeleteContract | RequestGetSpendablePaths | RequestGetAllSpendingPaths | RequestIsContractManagerWatching | RequestRefreshVtxos | RequestRefreshOutpoints | RequestSend | RequestGetAssetDetails | RequestIssue | RequestReissue | RequestBurn | RequestDelegate | RequestGetDelegateInfo | RequestRecoverVtxos | RequestGetRecoverableBalance | RequestGetExpiringVtxos | RequestRenewVtxos | RequestGetExpiredBoardingUtxos | RequestSweepExpiredBoardingUtxos | RequestMigrateDeprecatedSignerVtxos | RequestGetDeprecatedSignerStatus | RequestRestoreWallet;
|
|
2503
|
-
type WalletUpdaterResponse = ResponseEnvelope & (ResponseInitWallet | ResponseSettle | ResponseSettleEvent | ResponseSendBitcoin | ResponseGetAddress | ResponseGetBoardingAddress | ResponseGetBalance | ResponseGetVtxos | ResponseGetBoardingUtxos | ResponseGetTransactionHistory | ResponseGetStatus | ResponseGetContractSyncState | ResponseClear | ResponseReloadWallet | ResponseUtxoUpdate | ResponseVtxoUpdate | ResponseSignTransaction | ResponseCreateContract | ResponseGetContracts | ResponseGetContractsWithVtxos | ResponseAnnotateVtxos | ResponseUpdateContract | ResponseDeleteContract | ResponseGetSpendablePaths | ResponseGetAllSpendingPaths | ResponseIsContractManagerWatching | ResponseRefreshVtxos | ResponseRefreshOutpoints | ResponseContractEvent | ResponseSend | ResponseGetAssetDetails | ResponseIssue | ResponseReissue | ResponseBurn | ResponseDelegate | ResponseGetDelegateInfo | ResponseRecoverVtxos | ResponseRecoverVtxosEvent | ResponseGetRecoverableBalance | ResponseGetExpiringVtxos | ResponseRenewVtxos | ResponseRenewVtxosEvent | ResponseGetExpiredBoardingUtxos | ResponseSweepExpiredBoardingUtxos | ResponseMigrateDeprecatedSignerVtxos | ResponseMigrateDeprecatedSignerVtxosEvent | ResponseGetDeprecatedSignerStatus | ResponseRestoreWallet);
|
|
2622
|
+
type WalletUpdaterRequest = RequestInitWallet | RequestSettle | RequestSendBitcoin | RequestGetAddress | RequestGetBoardingAddress | RequestGetBalance | RequestGetVtxos | RequestGetSpendableVtxos | RequestGetBoardingUtxos | RequestGetTransactionHistory | RequestGetStatus | RequestGetContractSyncState | RequestClear | RequestReloadWallet | RequestSignTransaction | RequestCreateContract | RequestGetContracts | RequestGetContractsWithVtxos | RequestAnnotateVtxos | RequestUpdateContract | RequestDeleteContract | RequestGetSpendablePaths | RequestGetAllSpendingPaths | RequestIsContractManagerWatching | RequestRefreshVtxos | RequestRefreshOutpoints | RequestGetCurrentSigningDescriptor | RequestGetNextSigningDescriptor | RequestGetUsedSigningDescriptors | RequestAdvanceSigningDescriptorWatermark | RequestSend | RequestGetAssetDetails | RequestIssue | RequestReissue | RequestBurn | RequestDelegate | RequestGetDelegateInfo | RequestRecoverVtxos | RequestGetRecoverableBalance | RequestGetExpiringVtxos | RequestRenewVtxos | RequestGetExpiredBoardingUtxos | RequestSweepExpiredBoardingUtxos | RequestMigrateDeprecatedSignerVtxos | RequestGetDeprecatedSignerStatus | RequestRestoreWallet;
|
|
2623
|
+
type WalletUpdaterResponse = ResponseEnvelope & (ResponseInitWallet | ResponseSettle | ResponseSettleEvent | ResponseSendBitcoin | ResponseGetAddress | ResponseGetBoardingAddress | ResponseGetBalance | ResponseGetVtxos | ResponseGetSpendableVtxos | ResponseGetBoardingUtxos | ResponseGetTransactionHistory | ResponseGetStatus | ResponseGetContractSyncState | ResponseClear | ResponseReloadWallet | ResponseUtxoUpdate | ResponseVtxoUpdate | ResponseSignTransaction | ResponseCreateContract | ResponseGetContracts | ResponseGetContractsWithVtxos | ResponseAnnotateVtxos | ResponseUpdateContract | ResponseDeleteContract | ResponseGetSpendablePaths | ResponseGetAllSpendingPaths | ResponseIsContractManagerWatching | ResponseRefreshVtxos | ResponseRefreshOutpoints | ResponseGetCurrentSigningDescriptor | ResponseGetNextSigningDescriptor | ResponseGetUsedSigningDescriptors | ResponseAdvanceSigningDescriptorWatermark | ResponseContractEvent | ResponseSend | ResponseGetAssetDetails | ResponseIssue | ResponseReissue | ResponseBurn | ResponseDelegate | ResponseGetDelegateInfo | ResponseRecoverVtxos | ResponseRecoverVtxosEvent | ResponseGetRecoverableBalance | ResponseGetExpiringVtxos | ResponseRenewVtxos | ResponseRenewVtxosEvent | ResponseGetExpiredBoardingUtxos | ResponseSweepExpiredBoardingUtxos | ResponseMigrateDeprecatedSignerVtxos | ResponseMigrateDeprecatedSignerVtxosEvent | ResponseGetDeprecatedSignerStatus | ResponseRestoreWallet);
|
|
2504
2624
|
declare class WalletMessageHandler implements MessageHandler<WalletUpdaterRequest, WalletUpdaterResponse> {
|
|
2505
2625
|
readonly messageTag: string;
|
|
2506
2626
|
private wallet;
|
|
@@ -2528,12 +2648,16 @@ declare class WalletMessageHandler implements MessageHandler<WalletUpdaterReques
|
|
|
2528
2648
|
isLongRunning(message: WalletUpdaterRequest): boolean;
|
|
2529
2649
|
handleMessage(message: WalletUpdaterRequest): Promise<WalletUpdaterResponse>;
|
|
2530
2650
|
private handleInitWallet;
|
|
2531
|
-
private handleGetBalance;
|
|
2532
|
-
private getAllBoardingUtxos;
|
|
2533
2651
|
/**
|
|
2534
|
-
*
|
|
2652
|
+
* The worker's own balance. Same bucketing rules as `Wallet.getBalance` —
|
|
2653
|
+
* both call {@link computeOffchainBalance} — but deliberately a different
|
|
2654
|
+
* freshness: this reads the repository directly, with no indexer sync, so a
|
|
2655
|
+
* polling UI never pays for a network round-trip. That rules out
|
|
2656
|
+
* `pendingRecoveryOutpoints()`, whose snapshot syncs; the same classification
|
|
2657
|
+
* runs over this method's local snapshot instead.
|
|
2535
2658
|
*/
|
|
2536
|
-
private
|
|
2659
|
+
private handleGetBalance;
|
|
2660
|
+
private getAllBoardingUtxos;
|
|
2537
2661
|
private onWalletInitialized;
|
|
2538
2662
|
/**
|
|
2539
2663
|
* Refresh virtual outputs, boarding inputs, and transaction history from cache.
|
|
@@ -2551,6 +2675,9 @@ declare class WalletMessageHandler implements MessageHandler<WalletUpdaterReques
|
|
|
2551
2675
|
private handleSendBitcoin;
|
|
2552
2676
|
private handleSignTransaction;
|
|
2553
2677
|
private handleDelegate;
|
|
2678
|
+
/**
|
|
2679
|
+
* Ungated repository read mirroring `Wallet.getVtxos`, the raw reporting read.
|
|
2680
|
+
*/
|
|
2554
2681
|
private handleGetVtxos;
|
|
2555
2682
|
/** Tear down handler subscriptions, then delegate the full wipe to the wallet. */
|
|
2556
2683
|
private clear;
|
|
@@ -2559,6 +2686,20 @@ declare class WalletMessageHandler implements MessageHandler<WalletUpdaterReques
|
|
|
2559
2686
|
* addresses and the wallet's primary address, with deduplication.
|
|
2560
2687
|
*/
|
|
2561
2688
|
private getVtxosFromRepo;
|
|
2689
|
+
/**
|
|
2690
|
+
* The worker's equivalent of `ReadonlyWallet.contractSnapshot`: contracts
|
|
2691
|
+
* paired with the VTXOs the repository holds for them, plus the flat
|
|
2692
|
+
* deduplicated list. Purely local — unlike the main-thread snapshot it never
|
|
2693
|
+
* syncs against the indexer.
|
|
2694
|
+
*
|
|
2695
|
+
* One read of the contract rows serves both halves. Reading them twice
|
|
2696
|
+
* (once for the VTXO buckets, once for the gate) races the contract
|
|
2697
|
+
* manager's own writes: a contract registered between the two reads yields
|
|
2698
|
+
* VTXOs with no matching row in the gate, and `gatedContracts` lists only
|
|
2699
|
+
* what it knows is closed — so the coins of a just-registered escrowed
|
|
2700
|
+
* contract would count as available until the next poll.
|
|
2701
|
+
*/
|
|
2702
|
+
private repoSnapshot;
|
|
2562
2703
|
/**
|
|
2563
2704
|
* Build transaction history from cached virtual outputs, hitting the indexer only for
|
|
2564
2705
|
* uncached timestamps. Best-effort, like the plain Wallet path.
|
|
@@ -2825,6 +2966,18 @@ declare class ServiceWorkerReadonlyWallet implements IReadonlyWallet {
|
|
|
2825
2966
|
getActivityHistory(): Promise<Activity[]>;
|
|
2826
2967
|
getTransactionHistory(): Promise<ArkTransaction[]>;
|
|
2827
2968
|
getVtxos(filter?: GetVtxosFilter): Promise<NormalizedExtendedVirtualCoin[]>;
|
|
2969
|
+
/**
|
|
2970
|
+
* The gate has to run *inside* the worker (no plugin object or contract row
|
|
2971
|
+
* metadata exists on this side), so this is its own message rather than a
|
|
2972
|
+
* post-filter over `GET_VTXOS`.
|
|
2973
|
+
*
|
|
2974
|
+
* A worker predating this message answers "Unknown message" and the call
|
|
2975
|
+
* throws. That is deliberate: service workers activate asynchronously, so
|
|
2976
|
+
* new page code runs against a stale worker for a window on every deploy,
|
|
2977
|
+
* and falling back to `GET_VTXOS` there would silently spend ungated coins.
|
|
2978
|
+
* Fail closed — loud and recoverable — rather than make the gate advisory.
|
|
2979
|
+
*/
|
|
2980
|
+
getSpendableVtxos(filter?: GetVtxosFilter): Promise<NormalizedExtendedVirtualCoin[]>;
|
|
2828
2981
|
/**
|
|
2829
2982
|
* Trigger a wallet reload inside the service worker.
|
|
2830
2983
|
*
|
|
@@ -2833,7 +2986,7 @@ declare class ServiceWorkerReadonlyWallet implements IReadonlyWallet {
|
|
|
2833
2986
|
reload(): Promise<boolean>;
|
|
2834
2987
|
getContractManager(): Promise<IContractManager>;
|
|
2835
2988
|
}
|
|
2836
|
-
declare class ServiceWorkerWallet extends ServiceWorkerReadonlyWallet implements IWallet {
|
|
2989
|
+
declare class ServiceWorkerWallet extends ServiceWorkerReadonlyWallet implements IWallet, HDWalletCapable, HDAllocationCapable {
|
|
2837
2990
|
readonly serviceWorker: ServiceWorker;
|
|
2838
2991
|
readonly walletRepository: WalletRepository;
|
|
2839
2992
|
readonly contractRepository: ContractRepository;
|
|
@@ -2858,6 +3011,26 @@ declare class ServiceWorkerWallet extends ServiceWorkerReadonlyWallet implements
|
|
|
2858
3011
|
* ```
|
|
2859
3012
|
*/
|
|
2860
3013
|
static setup(options: ServiceWorkerWalletSetupOptions): Promise<ServiceWorkerWallet>;
|
|
3014
|
+
/** @see HDWalletCapable.getCurrentSigningDescriptor */
|
|
3015
|
+
getCurrentSigningDescriptor(): Promise<string | undefined>;
|
|
3016
|
+
/** @see HDAllocationCapable.getNextSigningDescriptor */
|
|
3017
|
+
getNextSigningDescriptor(): Promise<string | undefined>;
|
|
3018
|
+
/** @see HDWalletCapable.getUsedSigningDescriptors */
|
|
3019
|
+
getUsedSigningDescriptors(opts?: {
|
|
3020
|
+
lookAhead?: number;
|
|
3021
|
+
}): Promise<string[]>;
|
|
3022
|
+
/** @see HDAllocationCapable.advanceSigningDescriptorWatermark */
|
|
3023
|
+
advanceSigningDescriptorWatermark(descriptor: string): Promise<void>;
|
|
3024
|
+
/**
|
|
3025
|
+
* @see HDWalletCapable.signerForDescriptor
|
|
3026
|
+
*
|
|
3027
|
+
* Runs page-side: an Identity cannot cross the message bus, and it does
|
|
3028
|
+
* not need to — the page owns the signing identity, and derivation reads
|
|
3029
|
+
* no allocation state. Mirrors {@link Wallet.signerForDescriptor}'s
|
|
3030
|
+
* fallback: the wallet identity itself for a non-HD identity or a foreign
|
|
3031
|
+
* descriptor.
|
|
3032
|
+
*/
|
|
3033
|
+
signerForDescriptor(descriptor: string): Promise<Identity>;
|
|
2861
3034
|
sendBitcoin(params: SendBitcoinParams): Promise<string>;
|
|
2862
3035
|
settle(params?: SettleParams, callback?: (event: SettlementEvent) => void): Promise<string>;
|
|
2863
3036
|
/**
|
|
@@ -3381,6 +3554,20 @@ declare function combineTapscriptSigs(signedTx: Transaction, originalTx: Transac
|
|
|
3381
3554
|
* @returns True if the address is valid, false otherwise.
|
|
3382
3555
|
*/
|
|
3383
3556
|
declare function isValidArkAddress(address: string): boolean;
|
|
3557
|
+
/**
|
|
3558
|
+
* Minimal Ark provider surface required to submit and finalize an offchain
|
|
3559
|
+
* transaction. Both {@link ArkProvider} implementations satisfy it
|
|
3560
|
+
* structurally, so declaring it here keeps this module free of a provider
|
|
3561
|
+
* import (and of the dependency cycle that would create).
|
|
3562
|
+
*/
|
|
3563
|
+
interface OffchainTxSubmitProvider {
|
|
3564
|
+
submitTx(signedArkTx: string, checkpointTxs: string[]): Promise<{
|
|
3565
|
+
arkTxid: string;
|
|
3566
|
+
finalArkTx?: string;
|
|
3567
|
+
signedCheckpointTxs: string[];
|
|
3568
|
+
}>;
|
|
3569
|
+
finalizeTx(arkTxid: string, finalCheckpointTxs: string[]): Promise<void>;
|
|
3570
|
+
}
|
|
3384
3571
|
/**
|
|
3385
3572
|
* Pair each server-returned checkpoint PSBT with the locally built checkpoint
|
|
3386
3573
|
* of the same txid, rejecting anything else.
|
|
@@ -3420,6 +3607,57 @@ declare function assertSubmittedArkTxid(response: {
|
|
|
3420
3607
|
arkTxid: string;
|
|
3421
3608
|
finalArkTx?: string;
|
|
3422
3609
|
}, signedArkTx: Transaction, context: string): void;
|
|
3610
|
+
/**
|
|
3611
|
+
* Opt-in proof that the server co-signed what it handed back.
|
|
3612
|
+
*
|
|
3613
|
+
* Be precise about what this buys, because it is less than it sounds like. It
|
|
3614
|
+
* does NOT protect a preimage or any other condition value: those reach the
|
|
3615
|
+
* server at `submitTx`, before any of this runs. What it buys is a loud,
|
|
3616
|
+
* immediate failure instead of a caller reporting success, watching nothing
|
|
3617
|
+
* confirm, and learning the truth when the counterparty's refund lands.
|
|
3618
|
+
*/
|
|
3619
|
+
interface VerifyServerSignatures {
|
|
3620
|
+
/** The Ark server's key; x-only or compressed, both accepted. */
|
|
3621
|
+
serverPubkey: Uint8Array;
|
|
3622
|
+
}
|
|
3623
|
+
/**
|
|
3624
|
+
* Build, sign, submit, and finalize an offchain transaction whose every input
|
|
3625
|
+
* is controlled by a single key — the "thin signer" path.
|
|
3626
|
+
*
|
|
3627
|
+
* Needs no wallet, repository, or contract state: just an identity that can
|
|
3628
|
+
* sign, an Ark provider, the inputs (already carrying their spend leaf and tap
|
|
3629
|
+
* tree), the outputs, and the server unroll script. Used by the ArkadeCash sweep
|
|
3630
|
+
* to move bearer coins to the receiver's address without spinning up a full
|
|
3631
|
+
* background-managed wallet on shared repositories.
|
|
3632
|
+
*
|
|
3633
|
+
* @returns The Ark transaction id.
|
|
3634
|
+
*/
|
|
3635
|
+
declare function signAndSubmitOffchainTx(params: {
|
|
3636
|
+
identity: {
|
|
3637
|
+
sign(tx: Transaction, inputIndexes?: number[]): Promise<Transaction>;
|
|
3638
|
+
};
|
|
3639
|
+
provider: OffchainTxSubmitProvider;
|
|
3640
|
+
inputs: ArkTxInput[];
|
|
3641
|
+
outputs: TransactionOutput[];
|
|
3642
|
+
serverUnrollScript: CSVMultisigTapscript.Type;
|
|
3643
|
+
/** Forwarded to {@link submitOffchainTx}; omitted, nothing is checked. */
|
|
3644
|
+
verifyServerSignatures?: VerifyServerSignatures;
|
|
3645
|
+
}): Promise<string>;
|
|
3646
|
+
/**
|
|
3647
|
+
* Decorate a signer so it reveals `preimage` on every input it signs.
|
|
3648
|
+
*
|
|
3649
|
+
* The ordering encoded here is the whole point: the condition witness is NOT
|
|
3650
|
+
* part of what is signed, so attaching it before signing leaves a signature
|
|
3651
|
+
* over a PSBT that no longer matches once the field is present — which the
|
|
3652
|
+
* server rejects as `INVALID_SIGNATURE`. Decorate per spend, never wallet-wide.
|
|
3653
|
+
*
|
|
3654
|
+
* For any condition-leaf spend (VHTLC claims on both swap directions); the
|
|
3655
|
+
* generic signature keeps the decorated identity's own type, so the result is
|
|
3656
|
+
* still whatever was passed in.
|
|
3657
|
+
*/
|
|
3658
|
+
declare function claimWithPreimageIdentity<T extends {
|
|
3659
|
+
sign(tx: Transaction, inputIndexes?: number[]): Promise<Transaction>;
|
|
3660
|
+
}>(identity: T, preimage: Uint8Array): T;
|
|
3423
3661
|
|
|
3424
3662
|
/**
|
|
3425
3663
|
* ArkPsbtFieldKey are the available key names for the Arkade PSBT custom fields.
|
|
@@ -5566,4 +5804,4 @@ declare class AssetManager extends ReadonlyAssetManager implements IAssetManager
|
|
|
5566
5804
|
burn(params: BurnParams): Promise<string>;
|
|
5567
5805
|
}
|
|
5568
5806
|
|
|
5569
|
-
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, BatchExpiryPolicy, 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, assertFinalCommitmentMatchesValidated, assertSendableAmount, assertSubmittedArkTxid, index$1 as asset, btcTarget, buildForfeitTx, buildOffchainTx, buildVersion, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, createAssetPacket, createDefaultPaymentRouter, decodeArkContract, deriveDescriptorLeafCompressedPubKey, deserializeExitPackage, encodeArkContract, getArkPsbtFields, getMigrationStatus, 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, validateBatchRecipients, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
|
|
5807
|
+
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, BatchExpiryPolicy, 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 ExcludableVtxo, 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, HDAllocationCapable, HDDescriptorProvider, type HDDeterministicSignCapable, HDWalletCapable, 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, UnannotatableInputError, UnilateralExit, UnknownPacket, Unroll, type VSize, type VerifyServerSignatures, VirtualCoin, VirtualTx, VirtualTxRepository, VtxoBranch, type VtxoExclusion, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, arkRail, arkTarget, index as arkade, assembleBtcdTaprootTree, assertFinalCommitmentMatchesValidated, assertSendableAmount, assertSubmittedArkTxid, index$1 as asset, btcTarget, buildForfeitTx, buildOffchainTx, buildVersion, claimWithPreimageIdentity, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, createAssetPacket, createDefaultPaymentRouter, decodeArkContract, deriveDescriptorLeafCompressedPubKey, deserializeExitPackage, encodeArkContract, gateExclusion, gatedContracts, getArkPsbtFields, getMigrationStatus, hasBoardingTxExpired, invoiceTarget, isArkContract, isBtcAddress, isCltvSatisfied, isContractGenericallySpendable, isCsvSpendable, isHDDeterministicSignCapable, isLightningInvoice, isLnurl, isMessageBusInitializingError, isMessageBusNotInitializedError, isRetryableProviderError, isValidArkAddress, logExcludedVtxos, makeHandle, matchServerCheckpoints, migrateWalletRepository, onchainRail, openDatabase, outpointExclusion, requiresMigration, resolveSendAmount, rollbackMigration, sdkVersion, selectCoinsWithAsset, sequenceToTimelock, serializeExitPackage, setArkPsbtField, setupServiceWorker, signAndSubmitOffchainTx, timelockToSequence, tryResolveSendAmount, validateBatchRecipients, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
|