@arkade-os/sdk 0.5.4 → 0.5.5

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.
Files changed (112) hide show
  1. package/README.md +103 -17
  2. package/dist/adapters/expo.cjs +7 -6
  3. package/dist/adapters/expo.d.cts +4 -3
  4. package/dist/adapters/expo.d.ts +4 -3
  5. package/dist/adapters/expo.js +4 -3
  6. package/dist/{asyncStorageTaskQueue-DTBa8EH7.d.cts → asyncStorageTaskQueue-BbH-THYJ.d.cts} +1 -1
  7. package/dist/{asyncStorageTaskQueue-DHMIxY04.d.ts → asyncStorageTaskQueue-BlvkJyTa.d.ts} +1 -1
  8. package/dist/base-C-Y5t_0F.d.cts +359 -0
  9. package/dist/base-C-Y5t_0F.d.ts +359 -0
  10. package/dist/{chunk-AG4TFD6F.js → chunk-4I53THL6.js} +79 -884
  11. package/dist/chunk-4I53THL6.js.map +1 -0
  12. package/dist/{chunk-B6VNKGIH.cjs → chunk-5SYUEVJH.cjs} +10 -10
  13. package/dist/{chunk-B6VNKGIH.cjs.map → chunk-5SYUEVJH.cjs.map} +1 -1
  14. package/dist/{chunk-BTRCN4JJ.js → chunk-7GIKLFHC.js} +64 -4
  15. package/dist/chunk-7GIKLFHC.js.map +1 -0
  16. package/dist/{chunk-E6OOJEHL.cjs → chunk-AMH7Q3DF.cjs} +60 -934
  17. package/dist/chunk-AMH7Q3DF.cjs.map +1 -0
  18. package/dist/{chunk-6CUP6ZIF.js → chunk-BCA6D255.js} +17 -841
  19. package/dist/chunk-BCA6D255.js.map +1 -0
  20. package/dist/{chunk-TUOLZBNC.js → chunk-CE46RS6L.js} +5 -4
  21. package/dist/chunk-CE46RS6L.js.map +1 -0
  22. package/dist/chunk-DNFTHG73.js +829 -0
  23. package/dist/chunk-DNFTHG73.js.map +1 -0
  24. package/dist/chunk-FDJ734CH.js +882 -0
  25. package/dist/chunk-FDJ734CH.js.map +1 -0
  26. package/dist/chunk-FLPWNMX3.cjs +930 -0
  27. package/dist/chunk-FLPWNMX3.cjs.map +1 -0
  28. package/dist/{chunk-MWVAWFX6.js → chunk-FVVXCDNE.js} +4 -4
  29. package/dist/{chunk-MWVAWFX6.js.map → chunk-FVVXCDNE.js.map} +1 -1
  30. package/dist/{chunk-DNITZVNG.cjs → chunk-HQQ4NRXI.cjs} +18 -17
  31. package/dist/chunk-HQQ4NRXI.cjs.map +1 -0
  32. package/dist/chunk-JFJNB7ZH.cjs +884 -0
  33. package/dist/chunk-JFJNB7ZH.cjs.map +1 -0
  34. package/dist/{chunk-GHUUT54D.cjs → chunk-KCL5AVML.cjs} +89 -933
  35. package/dist/chunk-KCL5AVML.cjs.map +1 -0
  36. package/dist/{chunk-ZJHLLDBP.js → chunk-OO2KEK64.js} +2624 -1277
  37. package/dist/chunk-OO2KEK64.js.map +1 -0
  38. package/dist/{chunk-F3FAE7VJ.cjs → chunk-T254PXSN.cjs} +3115 -1752
  39. package/dist/chunk-T254PXSN.cjs.map +1 -0
  40. package/dist/chunk-V3ZLL5VY.js +380 -0
  41. package/dist/chunk-V3ZLL5VY.js.map +1 -0
  42. package/dist/chunk-X6ZI53DZ.cjs +383 -0
  43. package/dist/chunk-X6ZI53DZ.cjs.map +1 -0
  44. package/dist/{chunk-WXNSISXK.cjs → chunk-XWUCNMPN.cjs} +79 -18
  45. package/dist/chunk-XWUCNMPN.cjs.map +1 -0
  46. package/dist/compiler.cjs +50 -0
  47. package/dist/compiler.cjs.map +1 -0
  48. package/dist/compiler.d.cts +38 -0
  49. package/dist/compiler.d.ts +38 -0
  50. package/dist/compiler.js +47 -0
  51. package/dist/compiler.js.map +1 -0
  52. package/dist/contracts/handlers/index.cjs +11 -9
  53. package/dist/contracts/handlers/index.d.cts +6 -4
  54. package/dist/contracts/handlers/index.d.ts +6 -4
  55. package/dist/contracts/handlers/index.js +4 -2
  56. package/dist/{delegate-xrSBNybC.d.ts → delegate-gGkUnYpi.d.cts} +1 -1
  57. package/dist/{delegate-f4_t864Z.d.cts → delegate-iyDum4fw.d.ts} +1 -1
  58. package/dist/{index-BJDz15ms.d.ts → index-BWwVnJhU.d.cts} +5 -270
  59. package/dist/{index-BjiVGtp8.d.cts → index-Bx-iArDs.d.ts} +5 -270
  60. package/dist/{index-DRwe0UDN.d.ts → index-DCml4QJn.d.ts} +1593 -1711
  61. package/dist/{index-DRwe0UDN.d.cts → index-DkyzIzKL.d.cts} +1593 -1711
  62. package/dist/index.cjs +457 -378
  63. package/dist/index.d.cts +633 -378
  64. package/dist/index.d.ts +633 -378
  65. package/dist/index.js +7 -4
  66. package/dist/{wallet-jVBDQl6R.d.cts → keyringDescriptorProvider-CS4w4PWd.d.ts} +412 -361
  67. package/dist/{wallet-Oc3Wd5gv.d.ts → keyringDescriptorProvider-CmHXrIXd.d.cts} +412 -361
  68. package/dist/program-BARSNg3X.d.ts +286 -0
  69. package/dist/program-znrWkxE4.d.cts +286 -0
  70. package/dist/repositories/realm/index.cjs +71 -51
  71. package/dist/repositories/realm/index.cjs.map +1 -1
  72. package/dist/repositories/realm/index.d.cts +20 -9
  73. package/dist/repositories/realm/index.d.ts +20 -9
  74. package/dist/repositories/realm/index.js +42 -23
  75. package/dist/repositories/realm/index.js.map +1 -1
  76. package/dist/repositories/sqlite/index.cjs +81 -56
  77. package/dist/repositories/sqlite/index.cjs.map +1 -1
  78. package/dist/repositories/sqlite/index.d.cts +17 -8
  79. package/dist/repositories/sqlite/index.d.ts +17 -8
  80. package/dist/repositories/sqlite/index.js +55 -31
  81. package/dist/repositories/sqlite/index.js.map +1 -1
  82. package/dist/{taskRunner-CDlNeth0.d.ts → taskRunner-DgMLSk_O.d.ts} +1 -1
  83. package/dist/{taskRunner-BPPU-YHG.d.cts → taskRunner-buh6aFpG.d.cts} +1 -1
  84. package/dist/wallet/expo/background.cjs +17 -14
  85. package/dist/wallet/expo/background.cjs.map +1 -1
  86. package/dist/wallet/expo/background.d.cts +5 -4
  87. package/dist/wallet/expo/background.d.ts +5 -4
  88. package/dist/wallet/expo/background.js +9 -6
  89. package/dist/wallet/expo/background.js.map +1 -1
  90. package/dist/wallet/expo/index.cjs +29 -16
  91. package/dist/wallet/expo/index.cjs.map +1 -1
  92. package/dist/wallet/expo/index.d.cts +12 -7
  93. package/dist/wallet/expo/index.d.ts +12 -7
  94. package/dist/wallet/expo/index.js +19 -6
  95. package/dist/wallet/expo/index.js.map +1 -1
  96. package/dist/worker/expo/index.cjs +12 -9
  97. package/dist/worker/expo/index.cjs.map +1 -1
  98. package/dist/worker/expo/index.d.cts +6 -5
  99. package/dist/worker/expo/index.d.ts +6 -5
  100. package/dist/worker/expo/index.js +8 -5
  101. package/dist/worker/expo/index.js.map +1 -1
  102. package/package.json +16 -1
  103. package/dist/chunk-6CUP6ZIF.js.map +0 -1
  104. package/dist/chunk-AG4TFD6F.js.map +0 -1
  105. package/dist/chunk-BTRCN4JJ.js.map +0 -1
  106. package/dist/chunk-DNITZVNG.cjs.map +0 -1
  107. package/dist/chunk-E6OOJEHL.cjs.map +0 -1
  108. package/dist/chunk-F3FAE7VJ.cjs.map +0 -1
  109. package/dist/chunk-GHUUT54D.cjs.map +0 -1
  110. package/dist/chunk-TUOLZBNC.js.map +0 -1
  111. package/dist/chunk-WXNSISXK.cjs.map +0 -1
  112. package/dist/chunk-ZJHLLDBP.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,17 +1,19 @@
1
- import { aj as ReadonlyIdentity, a as Identity, a6 as DescriptorSigningRequest, a7 as Transaction, aE as SignerSession, a5 as DescriptorProvider, aK as IntentFeeConfig, aL as OffchainInput, aM as FeeAmount, aN as OnchainInput, aO as FeeOutput, _ as IntentRepository, $ as ArkIntent, a0 as IntentPageFilter, P as PageRequest, H as PageResult, F as Outpoint, a1 as VirtualTxRepository, a2 as VirtualTx, a3 as VtxoBranch, W as WalletRepository, X as AtomicWalletState, D as ExtendedVirtualCoin, J as ScriptVtxoCursor, K as ScriptVtxoPageOptions, L as StoredVtxo, M as VtxoRepositoryKey, E as ExtendedCoin, Q as TransactionHistoryPageFilter, U as TransactionHistoryPageCursor, h as ArkTransaction, Y as WalletState, B as Contract, C as ContractRepository, Z as ContractFilter, I as IWallet, O as OperatorProvider, at as NetworkName, ak as OnchainProvider, aC as SettlementConfig, aP as ContractWatcherConfig, aQ as Asset, R as Recipient, aR as FeeInfo, o as SettlementEvent, N as NormalizedExtendedVirtualCoin, S as SettleParams, G as GetArkadeInfoOptions, aS as GetVtxosOptions, aT as PaginationOptions, f as GetVtxosFilter, g as GetSpendableVtxosFilter, aU as CreateContractParams, aV as GetContractsFilter, z as VirtualCoin, aW as GetSpendablePathsOptions, aX as GetAllSpendingPathsOptions, l as GetNewAddressesOptions, aY as InputExpiryFloor, aZ as IssuanceParams, a_ as ReissuanceParams, a$ as BurnParams, b0 as RenewVtxosOptions, A as ArkadeInfo, b1 as NormalizedVtxoPage, c as ArkadeReader, d as ArkadeBroadcaster, e as WalletBalance, aq as ContractSyncState, aw as ContractWithVtxos, b2 as WatchedScript, b3 as PathSelection, m as NewAddress, b4 as ContractEvent, b5 as AssetDetails, b6 as IssuanceResult, b7 as DelegateInfo, b8 as MigrationGlobalSkipReason, b9 as MigrationLegSkipReason, ba as SignerStatus, ai as IReadonlyWallet, i as ActivityRegistry, ap as IReadonlyAssetManager, bb as StorageConfig, j as Activity, k as IContractManager, q as IAssetManager, p as SendParams, n as IDelegateManager, bc as IVtxoManager, a8 as Network, ay as Coin, bd as SendBitcoinParams, be as ExplorerTransaction, aF as SignedIntent, aG as Intent, bf as TreeNonces, bg as TreePartialSigs, T as TxNotificationEvent, aH as SignedProof, aI as Proof, bh as PendingTx, y as TapLeafScript, bi as EncodedVtxoScript, aB as CSVMultisigTapscript, x as RelativeTimelock, bj as EmulatorProvider, V as VtxoScript, bk as Status, av as ArkAddress, bl as ChainTx, w as IndexerProvider, ab as TxTree, bm as ArkadeService, bn as ContractVtxoEvent, bo as ExtendedContractVtxo, bp as ResolvedArkadeService, bq as resolveArkadeService, br as PathContext } from './index-DRwe0UDN.cjs';
2
- export { bs as ActivityIntent, bt as ActivityResolver, bu as ArkIntentState, v as ArkProvider, bv as ArkTapscript, bw as AssetMetadata, bx as BITCOIN_EMULATOR_PUBKEY, by as BaseWalletConfig, af as BatchFailedEvent, ad as BatchFinalizationEvent, ae as BatchFinalizedEvent, bz as BatchInfo, bA as BatchSignableIdentity, a9 as BatchStartedEvent, bB as CLTVMultisigTapscript, bC as CandidateDeps, bD as ChainTxType, a4 as ChainedTxType, bE as CommitmentTx, bF as ConditionCSVMultisigTapscript, bG as ConditionMultisigTapscript, bH as ConnectorTreeNode, bI as ContractBalance, bJ as ContractEventCallback, bK as ContractHandler, az as ContractManager, aA as ContractManagerConfig, bL as ContractState, bM as ContractVtxo, bN as ContractWatcher, bO as ContractWatcherEventCallback, bP as DEFAULT_ARKADE_EMULATOR_URL, bQ as DEFAULT_VTXO_PAGE_SIZE, bR as DelegateManagerImpl, bS as DelegateOptions, al as DelegateProvider, bT as DeprecatedSignerMigrationReport, bU as DeprecatedSignerReport, bV as DigestMismatchError, bW as Discoverable, bX as DiscoveredContract, bY as DiscoveryDeps, bZ as ESPLORA_URL, b_ as EmulatorInfo, as as EsploraProvider, b$ as EventSourceCapable, c0 as EventSourceFactory, c1 as EventSourceLike, c2 as EventSourceUnavailableError, an as ExitCaptureMode, c3 as ExitChainResolver, ao as ExitDataSource, c4 as GroupMembership, c5 as HandlerError, c6 as INTENT_TERMINAL_STATES, c7 as IndexerTxType, c8 as IntentCoin, c9 as IntentFilter, ca as KnownMetadata, cb as MAX_PAGE_SIZE, cc as MUTINYNET_EMULATOR_PUBKEY, cd as MigrateDeprecatedSignerOptions, ce as MigrationLegReport, cf as MigrationVtxoRef, cg as MultisigTapscript, ch as NewAddressType, ci as Nonces, au as OperatorInfo, cj as Output, ck as PageResponse, cl as PartialSig, cm as PrevTxSource, cn as PrevTxUnavailableError, co as ProofInput, cp as ProviderClass, cq as REGTEST_EMULATOR_PUBKEY, cr as RawTxSource, am as ReadonlyWalletConfig, ar as RecipientArkadeAddressContext, cs as RenewalSplit, ct as RenewalSplitContext, cu as RestArkProvider, cv as RestDelegateProvider, cw as RestEmulatorProvider, s as RestIndexerProvider, r as RestOperatorProvider, cx as ScanContractsOptions, cy as ScanResult, cz as ScheduledSession, cA as SettlementEventType, cB as SignRequest, cC as SignerClassification, cD as SignerSet, t as SubscriptionEvent, cE as SubscriptionFilter, u as SubscriptionHeartbeat, cF as SubscriptionResponse, cG as SweepTxNotification, cH as TapLeaves, cI as TapTreeCoder, cJ as TapscriptType, aJ as TimeHeight, ac as TreeNoncesEvent, ah as TreeSignatureEvent, cK as TreeSignerSession, aa as TreeSigningStartedEvent, ag as TreeTxEvent, cL as Tx, cM as TxHistoryRecord, cN as TxKey, cO as TxNotification, cP as TxTag, cQ as TxTreeNode, cR as TxType, cS as Vtxo, cT as VtxoChain, aD as VtxoManager, cU as VtxoType, b as WalletConfig, cV as WalletMode, cW as WithPrevTx, cX as assertAllowedSighashTypes, cY as assertPageRequest, cZ as assertRecipientArkadeAddress, c_ as assetMintResolver, c$ as attachPrevArkTxs, d0 as attachPrevoutTxs, d1 as boardingResolver, d2 as canRecoverOnchain, d3 as canSpendOffchain, d4 as canSweepOnchain, d5 as classifyAgainstSignerSet, d6 as classifyContractSigner, d7 as collabExitResolver, d8 as collectContracts, d9 as collectIntents, da as collectPages, db as collectScriptVtxos, dc as collectTransactionHistory, dd as collectUtxos, de as collectVtxos, df as configureEventSource, dg as createDefaultActivityRegistry, dh as createExitChainResolver, di as decodeTapscript, dj as defaultEmulatorPubkey, dk as getAllNormalizedVtxos, dl as getConfiguredEventSource, dm as getNetwork, dn as getNormalizedVtxos, dp as getRandomId, dq as getSequence, dr as hasCandidates, ds as isBatchSignable, dt as isContractVtxoEvent, du as isCooperativelyMigratable, dv as isDiscoverable, dw as isEventSourceUnavailableError, dx as isPastExpiry, dy as isSigningIdentity, dz as isSubdust, dA as isTerminalIntentState, dB as isVirtualCoin, dC as isVtxoExpiringSoon, dD as isVtxoSpent, dE as iteratePages, dF as networkFromArkadeInfo, dG as networkFromOperatorInfo, dH as networks, dI as pageResult, dJ as resolveEmulatorPubkey, dK as resolveEventSource, dL as resolvePrevTxs, dM as scriptFromTapLeafScript, dN as signerSetFromInfo, dO as toOffchainInputFeeParams, dP as toXOnlySignerHex, dQ as withPrevTxs } from './index-DRwe0UDN.cjs';
3
- import { W as Wallet, R as ReadonlyWallet, b as ReceiveRotatorFactory, c as ReceiveRotatorBootOpts, d as ReceiveRotatorBoot, P as ProviderConnectionState, H as HDWalletCapable, a as HDAllocationCapable, A as AddressAllocationCapable, B as BatchExpiryPolicy, e as Batch } from './wallet-jVBDQl6R.cjs';
4
- export { f as AbortError, g as ArkError, h as ArkErrorName, i as ArkadeCashClaimResult, j as ArkadeCashCreateError, k as ArkadeCashOperatorMismatchError, l as ArkadeCashUnclaimedReason, m as ArkadeCashUnclaimedVtxo, n as ArkadeCashVtxoRef, o as BoardingUtxoGroup, D as DEFAULT_MIN_BATCH_EXPIRY_SECONDS, F as ForeignDescriptorError, I as IncomingFunds, p as IndexedDBWalletRepository, K as KeyringDescriptorProvider, M as MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD, q as ProviderKind, r as ProviderUnavailableError, s as REGTEST_MIN_BATCH_EXPIRY_SECONDS, S as ServerInfoSource, t as ServerResponseMismatchError, V as VtxoReservation, u as VtxoReservedError, v as WaitForIncomingFundsOptions, w as WalletCannotAllocateAddressError, x as assertValidBatchExpiry, y as defaultBatchExpiryPolicy, z as isAddressAllocationCapable, C as isArkError, E as isHDAllocationCapable, G as isHDWalletCapable, J as maybeArkError, L as resolveBatchExpiryPolicy, N as resolveDescriptorSigner, O as selectVirtualCoins, Q as signingDescriptorIndex, T as strictSigningDescriptorIndex, U as waitForIncomingFunds } from './wallet-jVBDQl6R.cjs';
5
- import { P as Program, A as ArkadeArgValue, a as ArkadeProgramScript, b as ProgramKeys, c as ArkadeParamValue, d as ArkadeFunction, I as InputDef, e as ArkadeValueType, C as CompiledProgramFunction, f as ArkadeArgType, g as ArkadeContractParams, h as ArkadeSegment, i as AsmToken, j as InputRef, S as SUPPORTED_PROGRAM_VERSION, k as SignerRef, T as TapscriptSegment, l as TweakedSigner, U as UnsupportedProgramVersionError, W as WitnessRef, m as deserializeArkadeContractParams, p as parseArtifact, r as resolveAsm, s as serializeArkadeContractParams, n as stringifyArtifact, v as validateProgram, w as witnessRefToBytes } from './index-BjiVGtp8.cjs';
6
- export { o as ArkadeContractHandler, B as BoardingContractHandler, q as BoardingContractParams, D as DefaultContractHandler, t as DefaultContractParams, u as DelegateContractHandler, x as DelegateContractParams, V as VHTLC, y as VHTLCContractHandler, z as VHTLCContractParams, E as VHTLCV2ContractHandler, F as VHTLCV2ContractParams, G as contractHandlers } from './index-BjiVGtp8.cjs';
7
- import { D as DefaultVtxo } from './delegate-f4_t864Z.cjs';
8
- export { a as DelegateVtxo } from './delegate-f4_t864Z.cjs';
1
+ import { a as Identity, aB as Transaction, aA as SignerSession, ag as ReadonlyIdentity, ae as DescriptorProvider, aH as DescriptorSigningRequest, aI as IntentFeeConfig, aJ as OffchainInput, aK as FeeAmount, aL as OnchainInput, aM as FeeOutput, Y as BatchRegistrationRepository, Z as ArkIntent, _ as IntentPageFilter, P as PageRequest, D as PageResult, B as Outpoint, $ as BatchRegistration, a0 as VirtualTxRepository, a1 as VirtualTx, a2 as VtxoBranch, W as WalletRepository, Q as AtomicWalletState, z as ExtendedVirtualCoin, F as ScriptVtxoCursor, H as ScriptVtxoPageOptions, J as StoredVtxo, K as VtxoRepositoryKey, E as ExtendedCoin, L as TransactionHistoryPageFilter, M as TransactionHistoryPageCursor, h as ArkTransaction, U as WalletState, y as Contract, C as ContractRepository, X as ContractFilter, I as IWallet, O as OperatorProvider, ak as IntentRepository, ar as NetworkName, ah as OnchainProvider, ay as SettlementConfig, aN as ContractWatcherConfig, aO as Asset, R as Recipient, aP as FeeInfo, o as SettlementEvent, N as NormalizedExtendedVirtualCoin, S as SettleParams, G as GetOperatorInfoOptions, aQ as GetVtxosOptions, aR as PaginationOptions, f as GetVtxosFilter, g as GetSpendableVtxosFilter, aS as CreateContractParams, aT as GetContractsFilter, V as VirtualCoin, aU as GetSpendablePathsOptions, aV as GetAllSpendingPathsOptions, l as GetNewAddressesOptions, aW as InputExpiryFloor, aX as IssuanceParams, aY as ReissuanceParams, aZ as BurnParams, a_ as RenewVtxosOptions, q as SendOnchainParams, A as ArkadeInfo, a$ as NormalizedVtxoPage, c as ArkadeReader, d as ArkadeBroadcaster, e as WalletBalance, ao as ContractSyncState, at as ContractWithVtxos, b0 as WatchedScript, b1 as PathSelection, m as NewAddress, b2 as ContractEvent, b3 as AssetDetails, b4 as IssuanceResult, b5 as DelegateInfo, b6 as MigrationGlobalSkipReason, b7 as MigrationLegSkipReason, b8 as SignerStatus, af as IReadonlyWallet, i as ActivityRegistry, an as IReadonlyAssetManager, b9 as StorageConfig, j as Activity, k as IContractManager, r as IAssetManager, p as SendParams, n as IDelegateManager, ba as IVtxoManager, a4 as Network, av as Coin, bb as SendBitcoinParams, bc as ExplorerTransaction, aC as SignedIntent, aD as Intent, bd as TreeNonces, be as TreePartialSigs, T as TxNotificationEvent, aE as SignedProof, aF as Proof, bf as PendingTx, bg as EmulatorProvider, bh as Status, bi as ChainTx, x as IndexerProvider, a7 as TxTree, bj as ArkadeService, bk as ContractVtxoEvent, bl as ExtendedContractVtxo, bm as ResolvedArkadeService, bn as resolveArkadeService, bo as PathContext } from './index-DkyzIzKL.cjs';
2
+ export { bp as ActivityIntent, bq as ActivityResolver, br as ArkIntentState, w as ArkProvider, bs as AssetMetadata, bt as BATCH_REGISTRATION_TERMINAL_STATES, bu as BITCOIN_EMULATOR_PUBKEY, bv as BaseWalletConfig, ab as BatchFailedEvent, a9 as BatchFinalizationEvent, aa as BatchFinalizedEvent, bw as BatchInfo, bx as BatchRegistrationFilter, by as BatchRegistrationPageFilter, bz as BatchRegistrationState, bA as BatchSignableIdentity, a5 as BatchStartedEvent, bB as CandidateDeps, bC as ChainTxType, a3 as ChainedTxType, bD as CommitmentTx, bE as ConnectorTreeNode, bF as ContractBalance, bG as ContractEventCallback, bH as ContractHandler, aw as ContractManager, ax as ContractManagerConfig, bI as ContractScope, bJ as ContractState, bK as ContractVtxo, bL as ContractWatcher, bM as ContractWatcherEventCallback, bN as DEFAULT_ARKADE_EMULATOR_URL, bO as DEFAULT_VTXO_PAGE_SIZE, bP as DelegateManagerImpl, bQ as DelegateOptions, ai as DelegateProvider, bR as DeprecatedSignerMigrationReport, bS as DeprecatedSignerReport, bT as DigestMismatchError, bU as Discoverable, bV as DiscoveredContract, bW as DiscoveryDeps, bX as ESPLORA_URL, bY as EmulatorInfo, aq as EsploraProvider, bZ as EventSourceCapable, b_ as EventSourceFactory, b$ as EventSourceLike, c0 as EventSourceUnavailableError, al as ExitCaptureMode, c1 as ExitChainResolver, am as ExitDataSource, c2 as GetArkadeInfoOptions, c3 as GetUtxosOptions, c4 as GroupMembership, c5 as HandlerError, c6 as INTENT_TERMINAL_STATES, c7 as IndexerTxType, c8 as IndexerUtxo, c9 as IndexerUtxosUnsupportedError, ca as IntentCoin, cb as IntentFilter, cc as KnownMetadata, cd as MAX_PAGE_SIZE, ce as MUTINYNET_EMULATOR_PUBKEY, cf as MigrateDeprecatedSignerOptions, cg as MigrationLegReport, ch as MigrationVtxoRef, ci as NewAddressType, cj as Nonces, ck as OnchainCosignAmbiguousError, cl as OnchainCosignRejectedError, cm as OnchainCosignUnsupportedError, as as OperatorInfo, cn as Output, co as PageResponse, cp as PartialSig, cq as PrevTxSource, cr as PrevTxUnavailableError, cs as ProofInput, ct as ProviderClass, cu as REGTEST_EMULATOR_PUBKEY, cv as RawTxSource, aj as ReadonlyWalletConfig, ap as RecipientArkadeAddressContext, cw as RenewalSplit, cx as RenewalSplitContext, cy as RestArkProvider, cz as RestDelegateProvider, cA as RestEmulatorProvider, t as RestIndexerProvider, s as RestOperatorProvider, cB as ScanContractsOptions, cC as ScanResult, cD as ScheduledSession, cE as SettlementEventType, cF as SignRequest, cG as SignerClassification, cH as SignerSet, u as SubscriptionEvent, cI as SubscriptionFilter, v as SubscriptionHeartbeat, cJ as SubscriptionResponse, cK as SweepTxNotification, cL as TapLeaves, aG as TimeHeight, a8 as TreeNoncesEvent, ad as TreeSignatureEvent, cM as TreeSignerSession, a6 as TreeSigningStartedEvent, ac as TreeTxEvent, cN as Tx, cO as TxHistoryRecord, cP as TxKey, cQ as TxNotification, cR as TxTag, cS as TxTreeNode, cT as TxType, cU as Vtxo, cV as VtxoChain, az as VtxoManager, cW as VtxoType, b as WalletConfig, cX as WalletMode, cY as WithPrevTx, cZ as assertAllowedSighashTypes, c_ as assertPageRequest, c$ as assertRecipientArkadeAddress, d0 as assetMintResolver, d1 as attachPrevArkTxs, d2 as attachPrevoutTxs, d3 as boardingResolver, d4 as canRecoverOnchain, d5 as canSpendOffchain, d6 as canSweepOnchain, d7 as classifyAgainstSignerSet, d8 as classifyContractSigner, d9 as collabExitResolver, da as collectBatchRegistrations, db as collectContracts, dc as collectIntents, dd as collectPages, de as collectScriptVtxos, df as collectTransactionHistory, dg as collectUtxos, dh as collectVtxos, di as configureEventSource, dj as createDefaultActivityRegistry, dk as createExitChainResolver, dl as defaultEmulatorPubkey, dm as getAllNormalizedVtxos, dn as getConfiguredEventSource, dp as getNetwork, dq as getNormalizedVtxos, dr as getRandomId, ds as hasCandidates, dt as isBatchSignable, du as isContractVtxoEvent, dv as isCooperativelyMigratable, dw as isDiscoverable, dx as isEventSourceUnavailableError, dy as isPastExpiry, dz as isSigningIdentity, dA as isSubdust, dB as isTerminalBatchRegistrationState, dC as isTerminalIntentState, dD as isVirtualCoin, dE as isVtxoExpiringSoon, dF as isVtxoSpent, dG as iteratePages, dH as networkFromArkadeInfo, dI as networkFromOperatorInfo, dJ as networks, dK as pageResult, dL as resolveEmulatorPubkey, dM as resolveEventSource, dN as resolvePrevTxs, dO as signerSetFromInfo, dP as toOffchainInputFeeParams, dQ as toXOnlySignerHex, dR as withPrevTxs } from './index-DkyzIzKL.cjs';
3
+ import { W as Wallet, R as ReadonlyWallet, b as ReceiveRotatorFactory, c as ReceiveRotatorBootOpts, d as ReceiveRotatorBoot, P as ProviderConnectionState, H as HDWalletCapable, a as HDAllocationCapable, A as AddressAllocationCapable, B as BatchExpiryPolicy, e as Batch } from './keyringDescriptorProvider-CmHXrIXd.cjs';
4
+ export { f as AbortError, g as ArkError, h as ArkErrorName, i as ArkadeCashClaimResult, j as ArkadeCashCreateError, k as ArkadeCashOperatorMismatchError, l as ArkadeCashUnclaimedReason, m as ArkadeCashUnclaimedVtxo, n as ArkadeCashVtxoRef, o as BoardingUtxoGroup, D as DEFAULT_MIN_BATCH_EXPIRY_SECONDS, F as ForeignDescriptorError, I as IncomingFunds, p as IndexedDBWalletRepository, K as KeyringDescriptorProvider, M as MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD, N as NotifiesIncomingFunds, q as ProviderKind, r as ProviderUnavailableError, s as REGTEST_MIN_BATCH_EXPIRY_SECONDS, S as ServerInfoSource, t as ServerResponseMismatchError, V as VtxoReservation, u as VtxoReservedError, v as WaitForIncomingFundsOptions, w as WalletCannotAllocateAddressError, x as assertValidBatchExpiry, y as defaultBatchExpiryPolicy, z as isAddressAllocationCapable, C as isArkError, E as isHDAllocationCapable, G as isHDWalletCapable, J as maybeArkError, L as resolveBatchExpiryPolicy, O as resolveDescriptorSigner, Q as selectVirtualCoins, T as signingDescriptorIndex, U as strictSigningDescriptorIndex, X as waitForIncomingFunds } from './keyringDescriptorProvider-CmHXrIXd.cjs';
5
+ import { T as TapLeafScript, E as EncodedVtxoScript, C as CSVMultisigTapscript, R as RelativeTimelock, V as VtxoScript, A as ArkAddress } from './base-C-Y5t_0F.cjs';
6
+ export { a as ArkTapscript, b as CLTVMultisigTapscript, c as ConditionCSVMultisigTapscript, d as ConditionMultisigTapscript, M as MultisigTapscript, e as TapTreeCoder, f as TapscriptType, g as decodeTapscript, h as getSequence, s as scriptFromTapLeafScript } from './base-C-Y5t_0F.cjs';
7
+ export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, V as VHTLC, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from './index-BWwVnJhU.cjs';
8
+ import { D as DefaultVtxo } from './delegate-gGkUnYpi.cjs';
9
+ export { a as DelegateVtxo } from './delegate-gGkUnYpi.cjs';
9
10
  import { Bytes, BTC_NETWORK } from '@scure/btc-signer/utils.js';
10
- import { P2TR } from '@scure/btc-signer/payment.js';
11
11
  import { Transaction as Transaction$1, OP, Script, ScriptType } from '@scure/btc-signer';
12
+ import { P2TR } from '@scure/btc-signer/payment.js';
12
13
  import { ElectrumWS } from 'ws-electrumx-client';
13
14
  import { TransactionOutput, TransactionInputUpdate } from '@scure/btc-signer/psbt.js';
14
15
  import * as P from 'micro-packed';
16
+ import { P as Program, A as ArkadeArgValue, a as ArkadeProgramScript, b as ProgramKeys, c as ArkadeParamValue, d as ArkadeFunction, I as InputDef, e as ArkadeValueType, C as CompiledProgramFunction, S as SourceRange, f as ArkadeArgType, g as ArkadeContractParams, h as ArkadeSegment, i as AsmToken, j as InputRef, k as SUPPORTED_PROGRAM_VERSION, l as SignerRef, T as TapscriptSegment, m as TweakedSigner, U as UnsupportedProgramVersionError, W as WitnessRef, n as deserializeArkadeContractParams, p as parseArtifact, r as resolveAsm, s as serializeArkadeContractParams, o as stringifyArtifact, v as validateProgram, w as witnessRefToBytes } from './program-znrWkxE4.cjs';
15
17
  import '@scure/btc-signer/transaction.js';
16
18
 
17
19
  /** Validate an optional millisecond duration; zero retains its caller-defined meaning. */
@@ -19,242 +21,147 @@ declare function assertNonNegativeMs(name: string, ms: number | undefined): void
19
21
  /** Validate a timer delay without changing whether zero disables or immediately fires it. */
20
22
  declare function assertTimerMs(name: string, ms: number | undefined): void;
21
23
 
24
+ /** The two WebAuthn calls a passkey needs; `navigator.credentials` in a browser, or a native bridge. */
25
+ interface WebAuthnClient {
26
+ create(options: CredentialCreationOptions): Promise<Credential | null>;
27
+ get(options: CredentialRequestOptions): Promise<Credential | null>;
28
+ }
29
+ /** The browser or the authenticator cannot return a PRF secret, so this passkey cannot derive a key. */
30
+ declare class PrfUnavailable extends Error {
31
+ name: string;
32
+ /** Set when the passkey was created before this failure, so an app can still use it some other way. */
33
+ credentialId?: Uint8Array;
34
+ }
35
+ /** The user dismissed the passkey prompt. */
36
+ declare class PasskeyCancelled extends Error {
37
+ name: string;
38
+ constructor(message?: string);
39
+ }
22
40
  /**
23
- * Tagged envelope for a signing identity transported across the
24
- * service-worker boundary. All variants are structured-clone safe
25
- * (plain strings only — no functions or prototypes).
26
- *
27
- * `descriptor` carries the wildcard *template* (e.g.
28
- * `tr([fp/86'/0'/0']xpub.../0/*)`), not a concrete index — the
29
- * receiving factories require a template, and storing it directly
30
- * means nothing here has to convert concrete → template on rehydrate.
31
- *
32
- * Adding a new variant is a source change in every worker build; keep
33
- * old variants around until all deployed workers handle them.
34
- */
35
- type SerializedSigningIdentity = {
36
- type: "single-key";
37
- privateKey: string;
38
- } | {
39
- type: "seed";
40
- seed: string;
41
- descriptor: string;
42
- } | {
43
- type: "mnemonic";
44
- mnemonic: string;
45
- descriptor: string;
46
- passphrase?: string;
47
- };
48
- /**
49
- * Tagged envelope for a readonly identity transported across the
50
- * service-worker boundary. All variants are structured-clone safe.
51
- * `descriptor` is the wildcard template (see
52
- * {@link SerializedSigningIdentity}).
41
+ * A new passkey failed its first use. A cancel and an authenticator that never repeats its PRF
42
+ * (Windows Hello) are the same `NotAllowedError`, so offer another way rather than prompt again.
53
43
  */
54
- type SerializedReadonlyIdentity = {
55
- type: "readonly-single-key";
56
- publicKey: string;
57
- } | {
58
- type: "readonly-descriptor";
59
- descriptor: string;
60
- };
61
- type SerializedIdentity = SerializedSigningIdentity | SerializedReadonlyIdentity;
62
-
44
+ declare class PasskeyUnconfirmed extends PrfUnavailable {
45
+ name: string;
46
+ }
47
+ /** The label of a passkey's first wallet, as in Breez's seedless-restore implementation. */
48
+ declare const DEFAULT_PASSKEY_LABEL = "Default";
49
+ /** Whether this browser says its passkeys can do PRF; `"unknown"` where it cannot tell before trying. */
50
+ declare function prfSupport(): Promise<"yes" | "no" | "unknown">;
51
+ /**
52
+ * Creates a discoverable passkey that requires user verification, then uses it once and returns
53
+ * that use's PRF secret: a key must never depend on a secret its passkey cannot give again. When
54
+ * creation returns no PRF result there is nothing to compare that use against, so an authenticator
55
+ * that changes its secret later is not caught here; it derives other words on the next sign-in.
56
+ *
57
+ * @throws PrfUnavailable when the authenticator cannot do PRF or gives another secret on reuse
58
+ * @throws PasskeyUnconfirmed when the passkey fails its first use right after creation, for any
59
+ * reason (`cause` holds the error); this and PrfUnavailable carry the new passkey's
60
+ * `credentialId`, since the passkey exists by then
61
+ * @throws PasskeyCancelled when the user dismisses the prompt
62
+ */
63
+ declare function createPrfPasskey(o: {
64
+ rp: {
65
+ id: string;
66
+ name: string;
67
+ };
68
+ userId: Uint8Array;
69
+ userName: string;
70
+ salt: Uint8Array;
71
+ client?: WebAuthnClient;
72
+ }): Promise<{
73
+ credentialId: Uint8Array;
74
+ prf: Uint8Array;
75
+ }>;
63
76
  /**
64
- * Read-side HD capability marker. Exposes the wildcard-suffixed account
65
- * descriptor *template* and the descriptor-membership predicate, but no
66
- * signing primitives — suitable for watch-only identities backed by an
67
- * xpub.
68
- *
69
- * Extracted from {@link HDCapableIdentity} so that
70
- * `ReadonlyDescriptorIdentity` can stand in for an HD wallet's read-only
71
- * surface (template-aware, derives pubkeys at any index) without having
72
- * to claim signing capability it cannot honour.
77
+ * Uses a passkey and returns its PRF secret for `salt`. With no `credentialIds` the browser offers
78
+ * every passkey for `rpId`; `userHandle` then says which one was picked.
73
79
  */
74
- interface ReadonlyHDCapableIdentity extends ReadonlyIdentity {
75
- /**
76
- * The wildcard-suffixed account descriptor template
77
- * (e.g. `tr([fp/86'/0'/0']xpub/0/*)`). Consumers materialize a
78
- * concrete descriptor by replacing the `*` with a derivation index.
79
- */
80
- readonly descriptor: string;
81
- /** True iff `descriptor` derives from this identity's xpub/seed. */
82
- ownsDescriptor(descriptor: string): boolean;
83
- }
80
+ declare function evaluatePrf(o: {
81
+ rpId: string;
82
+ salt: Uint8Array;
83
+ credentialIds?: Uint8Array[];
84
+ client?: WebAuthnClient;
85
+ }): Promise<{
86
+ credentialId: Uint8Array;
87
+ userHandle: Uint8Array | null;
88
+ prf: Uint8Array;
89
+ }>;
84
90
  /**
85
- * Capability marker for identities that can be rotated through an HD
86
- * derivation tree AND can sign at each rotated index.
87
- *
88
- * Deliberately does NOT extend `DescriptorProvider`: if an HD-capable
89
- * identity were silently usable as a concrete descriptor source, callers
90
- * could bypass receive rotation and unknowingly reuse a single address
91
- * forever. To use this identity as a wallet's descriptor source, wrap
92
- * it explicitly:
93
- *
94
- * - `HDDescriptorProvider` — rotating, recommended for new wallets.
95
- * - `StaticDescriptorProvider` — pinned to a single key, for legacy or
96
- * explicitly-non-rotating use cases.
91
+ * BIP39 words from a PRF secret. Twelve, from its first 16 bytes, is what Breez's SDK derives
92
+ * (`prf_to_mnemonic`), so a Breez wallet using the same passkey and salt gets the same words.
93
+ * Twenty-four, from all 32 bytes, is what the seedless-restore spec text's `BIP39(root_key)` reads as.
97
94
  */
98
- interface HDCapableIdentity extends ReadonlyHDCapableIdentity, Identity {
99
- /** Signs each request with the key derived from its descriptor. */
100
- signDescriptorTransactions(requests: DescriptorSigningRequest[]): Promise<Transaction[]>;
101
- /** Signs a message using the key derived from `descriptor`. */
102
- signDescriptorMessage(descriptor: string, message: Uint8Array, signatureType?: "schnorr" | "ecdsa"): Promise<Uint8Array>;
103
- }
95
+ declare const mnemonicFromPrf: (prfSecret: Uint8Array, words?: 12 | 24) => string;
104
96
 
105
- /** Used for default BIP86 derivation with network selection. */
106
- interface NetworkOptions {
107
- /**
108
- * Mainnet (coin type 0) or testnet (coin type 1).
109
- *
110
- * @defaultValue `true`
111
- */
112
- isMainnet?: boolean;
113
- }
114
- /** Used for a caller-supplied account-descriptor template. */
115
- interface DescriptorOptions {
116
- /**
117
- * Account-descriptor *template*; must end with the BIP-32 wildcard suffix `/*)`. Stored as-is
118
- * on {@link SeedIdentity.descriptor} for HD providers to rotate through indices.
119
- */
120
- descriptor: string;
121
- }
122
- /** Either default BIP86 derivation (with optional network selection) or a caller-supplied template. */
123
- type SeedIdentityOptions = NetworkOptions | DescriptorOptions;
124
- /** Used for deriving an identity from a BIP39 mnemonic. */
125
- type MnemonicOptions = SeedIdentityOptions & {
126
- /** Optional BIP39 passphrase for additional seed entropy. */
127
- passphrase?: string;
128
- };
129
97
  /**
130
- * Seed-based identity derived from a raw seed and an account descriptor *template*.
131
- *
132
- * The recommended identity type: BIP86 (Taproot) derivation by default, or a caller-supplied
133
- * wildcard template. Prefer it (or @see MnemonicIdentity) over `SingleKey`, which exists for
134
- * backward compatibility with raw nsec-style keys.
135
- *
136
- * {@link descriptor} holds the wildcard template (e.g. `tr([fp/86'/0'/0']xpub/0/*)`); consumers
137
- * materialize concrete indices themselves (see `HDDescriptorProvider`).
138
- *
139
- * Deliberately NOT a `DescriptorProvider`, so it can't silently be used as a concrete
140
- * descriptor source and defeat HD rotation. Wrap it in `HDDescriptorProvider` (rotating
141
- * receive addresses) or {@link StaticDescriptorProvider} (legacy single-key behaviour).
98
+ * In-memory single key implementation for Bitcoin transaction signing.
142
99
  *
143
100
  * @example
144
101
  * ```typescript
145
- * const seed = mnemonicToSeedSync(mnemonic);
102
+ * // Create from hex string
103
+ * const key = SingleKey.fromHex('your_private_key_hex');
146
104
  *
147
- * // Testnet (BIP86 wildcard descriptor m/86'/1'/0'/0/*)
148
- * const identity = SeedIdentity.fromSeed(seed, { isMainnet: false });
105
+ * // Create from raw bytes
106
+ * const key = SingleKey.fromPrivateKey(privateKeyBytes);
149
107
  *
150
- * // Mainnet (BIP86 wildcard descriptor m/86'/0'/0'/0/*)
151
- * const identity = SeedIdentity.fromSeed(seed, { isMainnet: true });
108
+ * // Create random key
109
+ * const randomKey = SingleKey.fromRandomBytes();
152
110
  *
153
- * // Caller-supplied wildcard descriptor (must end in `/*)`).
154
- * const identity = SeedIdentity.fromSeed(seed, { descriptor });
111
+ * // Sign a transaction
112
+ * const signedTx = await key.sign(transaction);
155
113
  * ```
156
114
  */
157
- declare class SeedIdentity implements HDCapableIdentity {
158
- private readonly derivedKey;
159
- /** Wildcard account-descriptor template (e.g. `tr([fp/86'/0'/0']xpub/0/*)`). */
160
- readonly descriptor: string;
161
- /**
162
- * Constructs a SeedIdentity from a 64-byte seed and either a wildcard `{ descriptor }` or the
163
- * default BIP86 path for `{ isMainnet }`. Prefer {@link fromSeed}.
164
- *
165
- * Throws on a non-wildcard descriptor, an xpub mismatch with the seed, or a missing
166
- * derivation path.
167
- */
168
- constructor(seed: Uint8Array, opts?: SeedIdentityOptions);
115
+ declare class SingleKey implements Identity {
116
+ private key;
117
+ private constructor();
118
+ /** Create a signing identity from raw private key bytes. */
119
+ static fromPrivateKey(privateKey: Uint8Array): SingleKey;
120
+ /** Create a signing identity from a hex-encoded private key. */
121
+ static fromHex(privateKeyHex: string): SingleKey;
122
+ /** Create a signing identity with a freshly generated random private key. */
123
+ static fromRandomBytes(): SingleKey;
169
124
  /**
170
- * Creates a SeedIdentity from a raw 64-byte seed: `{ isMainnet }` for default BIP86
171
- * derivation, or `{ descriptor }` for a template ending in `/*)`.
125
+ * Export the private key as a hex string.
172
126
  *
173
- * @param seed - 64-byte seed (typically from mnemonicToSeedSync)
127
+ * @returns The private key as a hex string
174
128
  */
175
- static fromSeed(seed: Uint8Array, opts?: SeedIdentityOptions): SeedIdentity;
176
- xOnlyPublicKey(): Promise<Uint8Array>;
177
- compressedPublicKey(): Promise<Uint8Array>;
129
+ toHex(): string;
178
130
  sign(tx: Transaction, inputIndexes?: number[]): Promise<Transaction>;
131
+ compressedPublicKey(): Promise<Uint8Array>;
132
+ xOnlyPublicKey(): Promise<Uint8Array>;
133
+ signerSession(): SignerSession;
179
134
  signMessage(message: Uint8Array, signatureType?: "schnorr" | "ecdsa"): Promise<Uint8Array>;
180
135
  /**
181
- * BIP-340 sign `messageHash` with this identity's own key, aux_rand = 0 (for an `auto`-mode
182
- * wallet whose bare `tr(pubkey)` resolves to the identity itself). NOT via `signMessage`,
183
- * whose random aux_rand would make the signature unreproducible.
136
+ * BIP-340 sign `messageHash` with aux_rand = 0, so the signature — and
137
+ * anything derived from it — is reproducible from the key alone.
138
+ *
139
+ * What lets a static wallet derive a swap preimage instead of storing one
140
+ * (see `wallet/contractSecrets.ts`). Deliberately NOT `signMessage`, whose
141
+ * schnorr branch draws a random aux_rand: a preimage derived from that is
142
+ * unrecoverable, and the loss would only surface at claim time.
184
143
  */
185
144
  signSchnorrDeterministic(messageHash: Uint8Array): Promise<Uint8Array>;
186
- signerSession(): SignerSession;
187
- /** Watch-only copy; carries the template forward, so it stays HD-capable without the seed. */
188
- toReadonly(): Promise<ReadonlyDescriptorIdentity>;
189
- /** Returns true when `descriptor` is derived from this identity's seed. */
190
- ownsDescriptor(descriptor: string): boolean;
191
- /**
192
- * Signs each request with the key derived from its descriptor.
193
- * Each descriptor must share this identity's seed ({@link ownsDescriptor}).
194
- */
195
- signDescriptorTransactions(requests: DescriptorSigningRequest[]): Promise<Transaction[]>;
196
- /** Signs a message with the key derived from `descriptor`. */
197
- signDescriptorMessage(descriptor: string, message: Uint8Array, signatureType?: "schnorr" | "ecdsa"): Promise<Uint8Array>;
198
- /**
199
- * BIP-340 sign `messageHash` with the key derived from `descriptor`,
200
- * aux_rand = 0. Backs {@link DescriptorIdentity.signSchnorrDeterministic},
201
- * which swap preimage derivation reads through.
202
- */
203
- signSchnorrDeterministicWithDescriptor(descriptor: string, messageHash: Uint8Array): Promise<Uint8Array>;
204
- private derivePrivateKeyForDescriptor;
205
- private signTxWithKey;
206
- private signMessageWithKey;
145
+ toReadonly(): Promise<ReadonlySingleKey>;
207
146
  }
208
- /**
209
- * Mnemonic-based identity derived from a BIP39 phrase; recommended where users manage their own
210
- * backup phrase. Extends @see SeedIdentity with mnemonic validation and an optional passphrase.
211
- *
212
- * @example
213
- * ```typescript
214
- * const identity = MnemonicIdentity.fromMnemonic(
215
- * 'abandon abandon abandon ...',
216
- * { isMainnet: true, passphrase: 'secret' }
217
- * );
218
- * ```
219
- */
220
- declare class MnemonicIdentity extends SeedIdentity {
221
- private constructor();
147
+ declare class ReadonlySingleKey implements ReadonlyIdentity {
148
+ private readonly publicKey;
149
+ /** Create a readonly identity from a compressed public key. */
150
+ constructor(publicKey: Uint8Array);
222
151
  /**
223
- * Creates a MnemonicIdentity from a BIP39 phrase: `{ isMainnet }` for default BIP86
224
- * derivation, or `{ descriptor }` for a template ending in `/*)`, plus optional passphrase.
152
+ * Create a ReadonlySingleKey from a compressed public key.
225
153
  *
226
- * @param phrase - BIP39 mnemonic phrase (12 or 24 words)
227
- */
228
- static fromMnemonic(phrase: string, opts?: MnemonicOptions): MnemonicIdentity;
229
- }
230
- /**
231
- * Watch-only HD identity from a wildcard descriptor template (e.g.
232
- * `tr([fp/86'/0'/0']xpub.../0/*)`): derives public keys and rotates HD indices, cannot sign.
233
- *
234
- * @example
235
- * ```typescript
236
- * const ro = ReadonlyDescriptorIdentity.fromDescriptor(
237
- * "tr([fp/86'/0'/0']xpub.../0/*)"
238
- * );
239
- * ro.descriptor;
240
- * // => "tr([fp/86'/0'/0']xpub.../0/*)" — the template
241
- * ```
242
- */
243
- declare class ReadonlyDescriptorIdentity implements ReadonlyHDCapableIdentity {
244
- /**
245
- * Index-0 expansion of {@link descriptor}; the x-only pubkey (32 bytes) and the compressed
246
- * pubkey (via the bip32 node) are both read off it on demand.
154
+ * @param publicKey - 33-byte compressed public key (02/03 prefix + 32-byte x coordinate)
155
+ * @returns A new ReadonlySingleKey instance
156
+ * @example
157
+ * ```typescript
158
+ * const pubkey = new Uint8Array(33); // your compressed public key
159
+ * const readonlyKey = ReadonlySingleKey.fromPublicKey(pubkey);
160
+ * ```
247
161
  */
248
- private readonly indexZero;
249
- /** Wildcard account-descriptor template (e.g. `tr([fp/86'/0'/0']xpub/0/*)`). */
250
- readonly descriptor: string;
251
- private constructor();
252
- /** @param descriptor - Wildcard-suffixed Taproot template (`tr([fp/path']xpub.../child/*)`). */
253
- static fromDescriptor(descriptor: string): ReadonlyDescriptorIdentity;
162
+ static fromPublicKey(publicKey: Uint8Array): ReadonlySingleKey;
254
163
  xOnlyPublicKey(): Promise<Uint8Array>;
255
164
  compressedPublicKey(): Promise<Uint8Array>;
256
- /** Returns true when `descriptor` derives from this identity's xpub. */
257
- ownsDescriptor(descriptor: string): boolean;
258
165
  }
259
166
 
260
167
  /**
@@ -370,6 +277,48 @@ declare class DescriptorIdentity implements Identity {
370
277
  signSchnorrDeterministic(messageHash: Uint8Array): Promise<Uint8Array>;
371
278
  }
372
279
 
280
+ /**
281
+ * Read-side HD capability marker. Exposes the wildcard-suffixed account
282
+ * descriptor *template* and the descriptor-membership predicate, but no
283
+ * signing primitives — suitable for watch-only identities backed by an
284
+ * xpub.
285
+ *
286
+ * Extracted from {@link HDCapableIdentity} so that
287
+ * `ReadonlyDescriptorIdentity` can stand in for an HD wallet's read-only
288
+ * surface (template-aware, derives pubkeys at any index) without having
289
+ * to claim signing capability it cannot honour.
290
+ */
291
+ interface ReadonlyHDCapableIdentity extends ReadonlyIdentity {
292
+ /**
293
+ * The wildcard-suffixed account descriptor template
294
+ * (e.g. `tr([fp/86'/0'/0']xpub/0/*)`). Consumers materialize a
295
+ * concrete descriptor by replacing the `*` with a derivation index.
296
+ */
297
+ readonly descriptor: string;
298
+ /** True iff `descriptor` derives from this identity's xpub/seed. */
299
+ ownsDescriptor(descriptor: string): boolean;
300
+ }
301
+ /**
302
+ * Capability marker for identities that can be rotated through an HD
303
+ * derivation tree AND can sign at each rotated index.
304
+ *
305
+ * Deliberately does NOT extend `DescriptorProvider`: if an HD-capable
306
+ * identity were silently usable as a concrete descriptor source, callers
307
+ * could bypass receive rotation and unknowingly reuse a single address
308
+ * forever. To use this identity as a wallet's descriptor source, wrap
309
+ * it explicitly:
310
+ *
311
+ * - `HDDescriptorProvider` — rotating, recommended for new wallets.
312
+ * - `StaticDescriptorProvider` — pinned to a single key, for legacy or
313
+ * explicitly-non-rotating use cases.
314
+ */
315
+ interface HDCapableIdentity extends ReadonlyHDCapableIdentity, Identity {
316
+ /** Signs each request with the key derived from its descriptor. */
317
+ signDescriptorTransactions(requests: DescriptorSigningRequest[]): Promise<Transaction[]>;
318
+ /** Signs a message using the key derived from `descriptor`. */
319
+ signDescriptorMessage(descriptor: string, message: Uint8Array, signatureType?: "schnorr" | "ecdsa"): Promise<Uint8Array>;
320
+ }
321
+
373
322
  /**
374
323
  * Wraps a legacy Identity (single-key) as a DescriptorProvider.
375
324
  * The descriptor is always a simple tr(pubkey) format.
@@ -435,15 +384,23 @@ declare class Estimator {
435
384
  evaluate(offchainInputs: OffchainInput[], onchainInputs: OnchainInput[], offchainOutputs: FeeOutput[], onchainOutputs: FeeOutput[]): FeeAmount;
436
385
  }
437
386
 
438
- declare class InMemoryIntentRepository implements IntentRepository {
387
+ declare class InMemoryBatchRegistrationRepository implements BatchRegistrationRepository {
439
388
  readonly version: 1;
440
389
  private byId;
441
390
  clear(): Promise<void>;
442
- saveIntent(intent: ArkIntent): Promise<void>;
443
- getIntentsPage(filter: IntentPageFilter | undefined, page: PageRequest): Promise<PageResult<ArkIntent>>;
391
+ saveBatchRegistration(intent: ArkIntent): Promise<void>;
392
+ getBatchRegistrationsPage(filter: IntentPageFilter | undefined, page: PageRequest): Promise<PageResult<ArkIntent>>;
444
393
  getLockedVtxoOutpoints(): Promise<Outpoint[]>;
394
+ /** @deprecated Use {@link saveBatchRegistration}. */
395
+ saveIntent(intent: ArkIntent): Promise<void>;
396
+ /** @deprecated Use {@link getBatchRegistrationsPage}. */
397
+ getIntentsPage(filter: IntentPageFilter | undefined, page: PageRequest): Promise<PageResult<BatchRegistration, string>>;
445
398
  [Symbol.asyncDispose](): Promise<void>;
446
399
  }
400
+ /** @deprecated Use {@link InMemoryBatchRegistrationRepository}. */
401
+ declare const InMemoryIntentRepository: typeof InMemoryBatchRegistrationRepository;
402
+ /** @deprecated Use {@link InMemoryBatchRegistrationRepository}. */
403
+ type InMemoryIntentRepository = InMemoryBatchRegistrationRepository;
447
404
 
448
405
  declare class InMemoryVirtualTxRepository implements VirtualTxRepository {
449
406
  readonly version: 1;
@@ -479,20 +436,28 @@ declare class IndexedDBVirtualTxRepository implements VirtualTxRepository {
479
436
  }
480
437
 
481
438
  /**
482
- * @experimental Intent persistence is opt-in. Stored in its own database,
483
- * {@link BATCHES_DB_NAME} by default, never in the wallet/contract one.
439
+ * @experimental Batch registration persistence is opt-in. Stored in its own
440
+ * database, {@link BATCHES_DB_NAME} by default, never in the wallet/contract one.
484
441
  */
485
- declare class IndexedDBIntentRepository implements IntentRepository {
442
+ declare class IndexedDBBatchRegistrationRepository implements BatchRegistrationRepository {
486
443
  readonly version: 1;
487
444
  private readonly connection;
488
445
  constructor(dbName?: string);
489
446
  private getDB;
490
447
  clear(): Promise<void>;
491
- saveIntent(intent: ArkIntent): Promise<void>;
492
- getIntentsPage(filter: IntentPageFilter | undefined, page: PageRequest): Promise<PageResult<ArkIntent>>;
448
+ saveBatchRegistration(intent: ArkIntent): Promise<void>;
449
+ getBatchRegistrationsPage(filter: IntentPageFilter | undefined, page: PageRequest): Promise<PageResult<ArkIntent>>;
493
450
  getLockedVtxoOutpoints(): Promise<Outpoint[]>;
451
+ /** @deprecated Use {@link saveBatchRegistration}. */
452
+ saveIntent(intent: ArkIntent): Promise<void>;
453
+ /** @deprecated Use {@link getBatchRegistrationsPage}. */
454
+ getIntentsPage(filter: IntentPageFilter | undefined, page: PageRequest): Promise<PageResult<BatchRegistration, string>>;
494
455
  [Symbol.asyncDispose](): Promise<void>;
495
456
  }
457
+ /** @deprecated Use {@link IndexedDBBatchRegistrationRepository}. */
458
+ declare const IndexedDBIntentRepository: typeof IndexedDBBatchRegistrationRepository;
459
+ /** @deprecated Use {@link IndexedDBBatchRegistrationRepository}. */
460
+ type IndexedDBIntentRepository = IndexedDBBatchRegistrationRepository;
496
461
 
497
462
  /**
498
463
  * In-memory implementation of WalletRepository.
@@ -657,12 +622,35 @@ declare function contractFromArkContractWithAddress(encoded: string, serverPubKe
657
622
  /** Check if a string is an arkcontract. */
658
623
  declare function isArkContract(str: string): boolean;
659
624
 
625
+ /**
626
+ * Thrown when a descriptor-capable contract (default, delegate, or boarding)
627
+ * cannot be routed to any signer: its owner key (`params.pubKey`) is not this
628
+ * wallet's baseline signing key, and the record carries no
629
+ * `metadata.signingDescriptor` to send it to a descriptor-aware signer.
630
+ *
631
+ * Note that this can arise also when a contract belongs to a different identity (storage reuse).
632
+ */
633
+ declare class MissingSigningDescriptorError extends Error {
634
+ readonly contractScript: string;
635
+ readonly contractType: "default" | "delegate" | "boarding";
636
+ readonly name = "MissingSigningDescriptorError";
637
+ constructor(contractScript: string, contractType: "default" | "delegate" | "boarding");
638
+ }
639
+ /**
640
+ * Thrown when an input needs descriptor-aware signing but no
641
+ * DescriptorProvider was wired into the wallet.
642
+ */
643
+ declare class DescriptorSigningProviderMissingError extends Error {
644
+ readonly name = "DescriptorSigningProviderMissingError";
645
+ constructor();
646
+ }
647
+
660
648
  /**
661
649
  * In-memory implementation of ContractRepository.
662
650
  * Data is ephemeral and scoped to the instance.
663
651
  */
664
652
  declare class InMemoryContractRepository implements ContractRepository {
665
- readonly version: 3;
653
+ readonly version: 4;
666
654
  private readonly contractsByScript;
667
655
  clear(): Promise<void>;
668
656
  getContractsPage(filter: ContractFilter | undefined, page: PageRequest): Promise<PageResult<Contract>>;
@@ -677,7 +665,7 @@ declare class InMemoryContractRepository implements ContractRepository {
677
665
  * Data is stored as JSON strings in key/value stores.
678
666
  */
679
667
  declare class IndexedDBContractRepository implements ContractRepository {
680
- readonly version: 3;
668
+ readonly version: 4;
681
669
  private readonly connection;
682
670
  constructor(dbName?: string);
683
671
  clear(): Promise<void>;
@@ -695,76 +683,257 @@ interface WalletRestoreHook {
695
683
  id: string;
696
684
  restore(wallet: IWallet): Promise<void>;
697
685
  }
698
- declare function registerWalletRestoreHook(wallet: IWallet, hook: WalletRestoreHook): () => void;
699
-
686
+ declare function registerWalletRestoreHook(wallet: IWallet, hook: WalletRestoreHook): () => void;
687
+
688
+ /**
689
+ * Tagged envelope for a signing identity transported across the
690
+ * service-worker boundary. All variants are structured-clone safe
691
+ * (plain strings only — no functions or prototypes).
692
+ *
693
+ * `descriptor` carries the wildcard *template* (e.g.
694
+ * `tr([fp/86'/0'/0']xpub.../0/*)`), not a concrete index — the
695
+ * receiving factories require a template, and storing it directly
696
+ * means nothing here has to convert concrete → template on rehydrate.
697
+ *
698
+ * Adding a new variant is a source change in every worker build; keep
699
+ * old variants around until all deployed workers handle them.
700
+ */
701
+ type SerializedSigningIdentity = {
702
+ type: "single-key";
703
+ privateKey: string;
704
+ } | {
705
+ type: "seed";
706
+ seed: string;
707
+ descriptor: string;
708
+ } | {
709
+ type: "mnemonic";
710
+ mnemonic: string;
711
+ descriptor: string;
712
+ passphrase?: string;
713
+ };
714
+ /**
715
+ * Tagged envelope for a readonly identity transported across the
716
+ * service-worker boundary. All variants are structured-clone safe.
717
+ * `descriptor` is the wildcard template (see
718
+ * {@link SerializedSigningIdentity}).
719
+ */
720
+ type SerializedReadonlyIdentity = {
721
+ type: "readonly-single-key";
722
+ publicKey: string;
723
+ } | {
724
+ type: "readonly-descriptor";
725
+ descriptor: string;
726
+ };
727
+ type SerializedIdentity = SerializedSigningIdentity | SerializedReadonlyIdentity;
728
+
729
+ /** Used for default BIP86 derivation with network selection. */
730
+ interface NetworkOptions {
731
+ /**
732
+ * Mainnet (coin type 0) or testnet (coin type 1).
733
+ *
734
+ * @defaultValue `true`
735
+ */
736
+ isMainnet?: boolean;
737
+ }
738
+ /** Used for a caller-supplied account-descriptor template. */
739
+ interface DescriptorOptions {
740
+ /**
741
+ * Account-descriptor *template*; must end with the BIP-32 wildcard suffix `/*)`. Stored as-is
742
+ * on {@link SeedIdentity.descriptor} for HD providers to rotate through indices.
743
+ */
744
+ descriptor: string;
745
+ }
746
+ /** Either default BIP86 derivation (with optional network selection) or a caller-supplied template. */
747
+ type SeedIdentityOptions = NetworkOptions | DescriptorOptions;
748
+ /** Used for deriving an identity from a BIP39 mnemonic. */
749
+ type MnemonicOptions = SeedIdentityOptions & {
750
+ /** Optional BIP39 passphrase for additional seed entropy. */
751
+ passphrase?: string;
752
+ };
753
+ /**
754
+ * Where a passkey-derived identity comes from. Each `label` is a separate wallet on the same
755
+ * passkey; its UTF-8 bytes are the PRF salt, unnormalized as in Breez's provider, so an app taking
756
+ * non-ASCII labels from users should normalize them (NFC) itself. Defaults to
757
+ * {@link DEFAULT_PASSKEY_LABEL}. `words` picks 12 (Breez's SDK, the default) or 24 (the spec text),
758
+ * see {@link mnemonicFromPrf}.
759
+ */
760
+ interface PasskeySource {
761
+ client?: WebAuthnClient;
762
+ label?: string;
763
+ words?: 12 | 24;
764
+ }
765
+ /** A passkey-derived identity, with its words so the app can offer them as a backup. */
766
+ interface PasskeyMnemonic {
767
+ identity: MnemonicIdentity;
768
+ mnemonic: string;
769
+ credentialId: Uint8Array;
770
+ }
771
+ /**
772
+ * Seed-based identity derived from a raw seed and an account descriptor *template*.
773
+ *
774
+ * The recommended identity type: BIP86 (Taproot) derivation by default, or a caller-supplied
775
+ * wildcard template. Prefer it (or @see MnemonicIdentity) over `SingleKey`, which exists for
776
+ * backward compatibility with raw nsec-style keys.
777
+ *
778
+ * {@link descriptor} holds the wildcard template (e.g. `tr([fp/86'/0'/0']xpub/0/*)`); consumers
779
+ * materialize concrete indices themselves (see `HDDescriptorProvider`).
780
+ *
781
+ * Deliberately NOT a `DescriptorProvider`, so it can't silently be used as a concrete
782
+ * descriptor source and defeat HD rotation. Wrap it in `HDDescriptorProvider` (rotating
783
+ * receive addresses) or {@link StaticDescriptorProvider} (legacy single-key behaviour).
784
+ *
785
+ * @example
786
+ * ```typescript
787
+ * const seed = mnemonicToSeedSync(mnemonic);
788
+ *
789
+ * // Testnet (BIP86 wildcard descriptor m/86'/1'/0'/0/*)
790
+ * const identity = SeedIdentity.fromSeed(seed, { isMainnet: false });
791
+ *
792
+ * // Mainnet (BIP86 wildcard descriptor m/86'/0'/0'/0/*)
793
+ * const identity = SeedIdentity.fromSeed(seed, { isMainnet: true });
794
+ *
795
+ * // Caller-supplied wildcard descriptor (must end in `/*)`).
796
+ * const identity = SeedIdentity.fromSeed(seed, { descriptor });
797
+ * ```
798
+ */
799
+ declare class SeedIdentity implements HDCapableIdentity {
800
+ private readonly derivedKey;
801
+ /** Wildcard account-descriptor template (e.g. `tr([fp/86'/0'/0']xpub/0/*)`). */
802
+ readonly descriptor: string;
803
+ /**
804
+ * Constructs a SeedIdentity from a 64-byte seed and either a wildcard `{ descriptor }` or the
805
+ * default BIP86 path for `{ isMainnet }`. Prefer {@link fromSeed}.
806
+ *
807
+ * Throws on a non-wildcard descriptor, an xpub mismatch with the seed, or a missing
808
+ * derivation path.
809
+ */
810
+ constructor(seed: Uint8Array, opts?: SeedIdentityOptions);
811
+ /**
812
+ * Creates a SeedIdentity from a raw 64-byte seed: `{ isMainnet }` for default BIP86
813
+ * derivation, or `{ descriptor }` for a template ending in `/*)`.
814
+ *
815
+ * @param seed - 64-byte seed (typically from mnemonicToSeedSync)
816
+ */
817
+ static fromSeed(seed: Uint8Array, opts?: SeedIdentityOptions): SeedIdentity;
818
+ xOnlyPublicKey(): Promise<Uint8Array>;
819
+ compressedPublicKey(): Promise<Uint8Array>;
820
+ sign(tx: Transaction, inputIndexes?: number[]): Promise<Transaction>;
821
+ signMessage(message: Uint8Array, signatureType?: "schnorr" | "ecdsa"): Promise<Uint8Array>;
822
+ /**
823
+ * BIP-340 sign `messageHash` with this identity's own key, aux_rand = 0 (for an `auto`-mode
824
+ * wallet whose bare `tr(pubkey)` resolves to the identity itself). NOT via `signMessage`,
825
+ * whose random aux_rand would make the signature unreproducible.
826
+ */
827
+ signSchnorrDeterministic(messageHash: Uint8Array): Promise<Uint8Array>;
828
+ signerSession(): SignerSession;
829
+ /** Watch-only copy; carries the template forward, so it stays HD-capable without the seed. */
830
+ toReadonly(): Promise<ReadonlyDescriptorIdentity>;
831
+ /** Returns true when `descriptor` is derived from this identity's seed. */
832
+ ownsDescriptor(descriptor: string): boolean;
833
+ /**
834
+ * Signs each request with the key derived from its descriptor.
835
+ * Each descriptor must share this identity's seed ({@link ownsDescriptor}).
836
+ */
837
+ signDescriptorTransactions(requests: DescriptorSigningRequest[]): Promise<Transaction[]>;
838
+ /** Signs a message with the key derived from `descriptor`. */
839
+ signDescriptorMessage(descriptor: string, message: Uint8Array, signatureType?: "schnorr" | "ecdsa"): Promise<Uint8Array>;
840
+ /**
841
+ * BIP-340 sign `messageHash` with the key derived from `descriptor`,
842
+ * aux_rand = 0. Backs {@link DescriptorIdentity.signSchnorrDeterministic},
843
+ * which swap preimage derivation reads through.
844
+ */
845
+ signSchnorrDeterministicWithDescriptor(descriptor: string, messageHash: Uint8Array): Promise<Uint8Array>;
846
+ private derivePrivateKeyForDescriptor;
847
+ private signTxWithKey;
848
+ private signMessageWithKey;
849
+ }
700
850
  /**
701
- * In-memory single key implementation for Bitcoin transaction signing.
851
+ * Mnemonic-based identity derived from a BIP39 phrase; recommended where users manage their own
852
+ * backup phrase. Extends @see SeedIdentity with mnemonic validation and an optional passphrase.
702
853
  *
703
854
  * @example
704
855
  * ```typescript
705
- * // Create from hex string
706
- * const key = SingleKey.fromHex('your_private_key_hex');
707
- *
708
- * // Create from raw bytes
709
- * const key = SingleKey.fromPrivateKey(privateKeyBytes);
710
- *
711
- * // Create random key
712
- * const randomKey = SingleKey.fromRandomBytes();
713
- *
714
- * // Sign a transaction
715
- * const signedTx = await key.sign(transaction);
856
+ * const identity = MnemonicIdentity.fromMnemonic(
857
+ * 'abandon abandon abandon ...',
858
+ * { isMainnet: true, passphrase: 'secret' }
859
+ * );
716
860
  * ```
717
861
  */
718
- declare class SingleKey implements Identity {
719
- private key;
862
+ declare class MnemonicIdentity extends SeedIdentity {
720
863
  private constructor();
721
- /** Create a signing identity from raw private key bytes. */
722
- static fromPrivateKey(privateKey: Uint8Array): SingleKey;
723
- /** Create a signing identity from a hex-encoded private key. */
724
- static fromHex(privateKeyHex: string): SingleKey;
725
- /** Create a signing identity with a freshly generated random private key. */
726
- static fromRandomBytes(): SingleKey;
727
864
  /**
728
- * Export the private key as a hex string.
865
+ * Creates a MnemonicIdentity from a BIP39 phrase: `{ isMainnet }` for default BIP86
866
+ * derivation, or `{ descriptor }` for a template ending in `/*)`, plus optional passphrase.
729
867
  *
730
- * @returns The private key as a hex string
868
+ * @param phrase - BIP39 mnemonic phrase (12 or 24 words)
731
869
  */
732
- toHex(): string;
733
- sign(tx: Transaction, inputIndexes?: number[]): Promise<Transaction>;
734
- compressedPublicKey(): Promise<Uint8Array>;
735
- xOnlyPublicKey(): Promise<Uint8Array>;
736
- signerSession(): SignerSession;
737
- signMessage(message: Uint8Array, signatureType?: "schnorr" | "ecdsa"): Promise<Uint8Array>;
870
+ static fromMnemonic(phrase: string, opts?: MnemonicOptions): MnemonicIdentity;
738
871
  /**
739
- * BIP-340 sign `messageHash` with aux_rand = 0, so the signature — and
740
- * anything derived from it — is reproducible from the key alone.
872
+ * Creates a passkey and derives an identity from its PRF secret. The words are the backup: the
873
+ * passkey re-derives them on any device it syncs to, so whoever controls that passkey (and its
874
+ * sync account) can sign. The derivation follows Breez's seedless-restore implementation, so
875
+ * with the default 12 words the same passkey and label give the same words as a Breez wallet.
741
876
  *
742
- * What lets a static wallet derive a swap preimage instead of storing one
743
- * (see `wallet/contractSecrets.ts`). Deliberately NOT `signMessage`, whose
744
- * schnorr branch draws a random aux_rand: a preimage derived from that is
745
- * unrecoverable, and the loss would only surface at claim time.
746
- */
747
- signSchnorrDeterministic(messageHash: Uint8Array): Promise<Uint8Array>;
748
- toReadonly(): Promise<ReadonlySingleKey>;
749
- }
750
- declare class ReadonlySingleKey implements ReadonlyIdentity {
751
- private readonly publicKey;
752
- /** Create a readonly identity from a compressed public key. */
753
- constructor(publicKey: Uint8Array);
754
- /**
755
- * Create a ReadonlySingleKey from a compressed public key.
877
+ * Each call makes a new passkey with its own words: offer {@link fromPasskey} first, and store
878
+ * `credentialId`. The browser's picker shows only `userName`, so make it tell wallets apart.
879
+ * Reusing an existing passkey's `userId` replaces that passkey, and its words, on most
880
+ * authenticators.
756
881
  *
757
- * @param publicKey - 33-byte compressed public key (02/03 prefix + 32-byte x coordinate)
758
- * @returns A new ReadonlySingleKey instance
759
882
  * @example
760
883
  * ```typescript
761
- * const pubkey = new Uint8Array(33); // your compressed public key
762
- * const readonlyKey = ReadonlySingleKey.fromPublicKey(pubkey);
884
+ * const { identity, mnemonic, credentialId } = await MnemonicIdentity.createPasskey({
885
+ * rp: { id: location.hostname, name: "My wallet" },
886
+ * userName: "alice",
887
+ * });
763
888
  * ```
764
889
  */
765
- static fromPublicKey(publicKey: Uint8Array): ReadonlySingleKey;
890
+ static createPasskey(o: {
891
+ rp: {
892
+ id: string;
893
+ name: string;
894
+ };
895
+ userName: string;
896
+ userId?: Uint8Array;
897
+ } & PasskeySource & MnemonicOptions): Promise<PasskeyMnemonic>;
898
+ /**
899
+ * Re-derives the identity of a passkey made by {@link createPasskey}. Without `credentialIds`
900
+ * the browser offers every passkey for `rpId`, and the one picked decides the wallet: another
901
+ * passkey gives other words, not an error. Pass the stored `credentialId` where there is one;
902
+ * the returned `credentialId` says which passkey was used.
903
+ */
904
+ static fromPasskey(o: {
905
+ rpId: string;
906
+ credentialIds?: Uint8Array[];
907
+ } & PasskeySource & MnemonicOptions): Promise<PasskeyMnemonic>;
908
+ }
909
+ /**
910
+ * Watch-only HD identity from a wildcard descriptor template (e.g.
911
+ * `tr([fp/86'/0'/0']xpub.../0/*)`): derives public keys and rotates HD indices, cannot sign.
912
+ *
913
+ * @example
914
+ * ```typescript
915
+ * const ro = ReadonlyDescriptorIdentity.fromDescriptor(
916
+ * "tr([fp/86'/0'/0']xpub.../0/*)"
917
+ * );
918
+ * ro.descriptor;
919
+ * // => "tr([fp/86'/0'/0']xpub.../0/*)" — the template
920
+ * ```
921
+ */
922
+ declare class ReadonlyDescriptorIdentity implements ReadonlyHDCapableIdentity {
923
+ /**
924
+ * Index-0 expansion of {@link descriptor}; the x-only pubkey (32 bytes) and the compressed
925
+ * pubkey (via the bip32 node) are both read off it on demand.
926
+ */
927
+ private readonly indexZero;
928
+ /** Wildcard account-descriptor template (e.g. `tr([fp/86'/0'/0']xpub/0/*)`). */
929
+ readonly descriptor: string;
930
+ private constructor();
931
+ /** @param descriptor - Wildcard-suffixed Taproot template (`tr([fp/path']xpub.../child/*)`). */
932
+ static fromDescriptor(descriptor: string): ReadonlyDescriptorIdentity;
766
933
  xOnlyPublicKey(): Promise<Uint8Array>;
767
934
  compressedPublicKey(): Promise<Uint8Array>;
935
+ /** Returns true when `descriptor` derives from this identity's xpub. */
936
+ ownsDescriptor(descriptor: string): boolean;
768
937
  }
769
938
 
770
939
  /**
@@ -926,29 +1095,6 @@ declare function isDeterministicSigner(value: unknown): value is DeterministicSi
926
1095
  */
927
1096
  declare function adoptContractDescriptor(wallet: IWallet, descriptor: string): Promise<void>;
928
1097
 
929
- /**
930
- * Thrown when a descriptor-capable contract (default, delegate, or boarding)
931
- * cannot be routed to any signer: its owner key (`params.pubKey`) is not this
932
- * wallet's baseline signing key, and the record carries no
933
- * `metadata.signingDescriptor` to send it to a descriptor-aware signer.
934
- *
935
- * Note that this can arise also when a contract belongs to a different identity (storage reuse).
936
- */
937
- declare class MissingSigningDescriptorError extends Error {
938
- readonly contractScript: string;
939
- readonly contractType: "default" | "delegate" | "boarding";
940
- readonly name = "MissingSigningDescriptorError";
941
- constructor(contractScript: string, contractType: "default" | "delegate" | "boarding");
942
- }
943
- /**
944
- * Thrown when an input needs descriptor-aware signing but no
945
- * DescriptorProvider was wired into the wallet.
946
- */
947
- declare class DescriptorSigningProviderMissingError extends Error {
948
- readonly name = "DescriptorSigningProviderMissingError";
949
- constructor();
950
- }
951
-
952
1098
  type RequestEnvelope = {
953
1099
  tag: string;
954
1100
  id: string;
@@ -1953,6 +2099,9 @@ declare class Ramps {
1953
2099
  * fee on that output rather than on a grossed-up figure. {@link offboard} keeps
1954
2100
  * the other anchor, which needs `g - fee(g) = amount` solved — impossible for
1955
2101
  * a program charging the whole output.
2102
+ *
2103
+ * Returns the onchain txid instead when onchain coins alone cover `amount`
2104
+ * and were spent via arkd cosigning.
1956
2105
  */
1957
2106
  offboardExact(params: {
1958
2107
  destinationAddress: string;
@@ -1962,6 +2111,7 @@ declare class Ramps {
1962
2111
  eventCallback?: (event: SettlementEvent) => void;
1963
2112
  vtxos?: NormalizedExtendedVirtualCoin[];
1964
2113
  }): ReturnType<IWallet["settle"]>;
2114
+ private tryCosign;
1965
2115
  private offboardInputs;
1966
2116
  /** Every candidate, or with `concurrentSpending` the shortest covering prefix in send order. */
1967
2117
  private fundExit;
@@ -2093,12 +2243,12 @@ type ResponseGetBoardingAddress = ResponseEnvelope & {
2093
2243
  address: string;
2094
2244
  };
2095
2245
  };
2096
- type RequestGetArkadeInfo = RequestEnvelope & {
2097
- type: "GET_ARKADE_INFO";
2098
- payload?: GetArkadeInfoOptions;
2246
+ type RequestGetOperatorInfo = RequestEnvelope & {
2247
+ type: "GET_OPERATOR_INFO" | "GET_ARKADE_INFO";
2248
+ payload?: GetOperatorInfoOptions;
2099
2249
  };
2100
- type ResponseGetArkadeInfo = ResponseEnvelope & {
2101
- type: "ARKADE_INFO";
2250
+ type ResponseGetOperatorInfo = ResponseEnvelope & {
2251
+ type: "OPERATOR_INFO";
2102
2252
  payload: {
2103
2253
  info: ArkadeInfo;
2104
2254
  };
@@ -2722,6 +2872,29 @@ type ResponseSweepExpiredBoardingUtxos = ResponseEnvelope & {
2722
2872
  txid: string;
2723
2873
  };
2724
2874
  };
2875
+ type RequestCosignOnchainTx = RequestEnvelope & {
2876
+ type: "COSIGN_ONCHAIN_TX";
2877
+ /** Base64 PSBT. */
2878
+ payload: {
2879
+ psbt: string;
2880
+ };
2881
+ };
2882
+ type ResponseCosignOnchainTx = ResponseEnvelope & {
2883
+ type: "COSIGN_ONCHAIN_TX_SUCCESS";
2884
+ payload: {
2885
+ txid: string;
2886
+ };
2887
+ };
2888
+ type RequestSendOnchain = RequestEnvelope & {
2889
+ type: "SEND_ONCHAIN";
2890
+ payload: SendOnchainParams;
2891
+ };
2892
+ type ResponseSendOnchain = ResponseEnvelope & {
2893
+ type: "SEND_ONCHAIN_SUCCESS";
2894
+ payload: {
2895
+ txid: string;
2896
+ };
2897
+ };
2725
2898
  type WireMigrationVtxoRef = {
2726
2899
  txid: string;
2727
2900
  vout: number;
@@ -2787,8 +2960,8 @@ type RequestRestoreWallet = RequestEnvelope & {
2787
2960
  type ResponseRestoreWallet = ResponseEnvelope & {
2788
2961
  type: "RESTORE_WALLET_SUCCESS";
2789
2962
  };
2790
- type WalletUpdaterRequest = RequestInitWallet | RequestSettle | RequestGetAddress | RequestGetBoardingAddress | RequestGetArkadeInfo | RequestIndexerGetVtxos | RequestIndexerGetVirtualTxs | RequestSubmitTx | RequestFinalizeTx | RequestGetBalance | RequestGetVtxos | RequestGetSpendableVtxos | RequestGetBoardingUtxos | RequestGetTransactionHistory | RequestGetStatus | RequestGetContractSyncState | RequestClear | RequestReloadWallet | RequestSignTransaction | RequestCreateContract | RequestGetContracts | RequestGetContractsWithVtxos | RequestGetStoredContractsWithVtxos | RequestWatchScript | RequestUnwatchScript | RequestGetWatchedScripts | RequestAnnotateVtxos | RequestUpdateContract | RequestDeleteContract | RequestGetSpendablePaths | RequestGetAllSpendingPaths | RequestGetUnsupportedContracts | RequestIsContractManagerWatching | RequestRefreshVtxos | RequestRefreshOutpoints | RequestGetCurrentSigningDescriptor | RequestGetNextSigningDescriptor | RequestGetNewAddresses | RequestGetUsedSigningDescriptors | RequestAdvanceSigningDescriptorWatermark | RequestSend | RequestSendWithDeadline | RequestSendWithInputExpiryFloor | RequestGetAssetDetails | RequestIssue | RequestReissue | RequestBurn | RequestDelegate | RequestGetDelegateInfo | RequestRecoverVtxos | RequestGetRecoverableBalance | RequestGetExpiringVtxos | RequestRenewVtxos | RequestGetExpiredBoardingUtxos | RequestSweepExpiredBoardingUtxos | RequestMigrateDeprecatedSignerVtxos | RequestGetDeprecatedSignerStatus | RequestRestoreWallet;
2791
- type WalletUpdaterResponse = ResponseEnvelope & (ResponseInitWallet | ResponseSettle | ResponseSettleEvent | ResponseGetAddress | ResponseGetBoardingAddress | ResponseGetArkadeInfo | ResponseIndexerGetVtxos | ResponseIndexerGetVirtualTxs | ResponseSubmitTx | ResponseFinalizeTx | ResponseGetBalance | ResponseGetVtxos | ResponseGetSpendableVtxos | ResponseGetBoardingUtxos | ResponseGetTransactionHistory | ResponseGetStatus | ResponseGetContractSyncState | ResponseClear | ResponseReloadWallet | ResponseUtxoUpdate | ResponseVtxoUpdate | ResponseSignTransaction | ResponseCreateContract | ResponseGetContracts | ResponseGetContractsWithVtxos | ResponseGetStoredContractsWithVtxos | ResponseWatchScript | ResponseUnwatchScript | ResponseGetWatchedScripts | ResponseAnnotateVtxos | ResponseUpdateContract | ResponseContractWatchStateSet | ResponseDeleteContract | ResponseGetSpendablePaths | ResponseGetAllSpendingPaths | ResponseGetUnsupportedContracts | ResponseIsContractManagerWatching | ResponseRefreshVtxos | ResponseRefreshOutpoints | ResponseGetCurrentSigningDescriptor | ResponseGetNextSigningDescriptor | ResponseGetNewAddresses | ResponseGetUsedSigningDescriptors | ResponseAdvanceSigningDescriptorWatermark | ResponseContractEvent | ResponseSend | ResponseSendDeadlineExceeded | ResponseGetAssetDetails | ResponseIssue | ResponseReissue | ResponseBurn | ResponseDelegate | ResponseGetDelegateInfo | ResponseRecoverVtxos | ResponseRecoverVtxosEvent | ResponseGetRecoverableBalance | ResponseGetExpiringVtxos | ResponseRenewVtxos | ResponseRenewVtxosEvent | ResponseGetExpiredBoardingUtxos | ResponseSweepExpiredBoardingUtxos | ResponseMigrateDeprecatedSignerVtxos | ResponseMigrateDeprecatedSignerVtxosEvent | ResponseGetDeprecatedSignerStatus | ResponseRestoreWallet);
2963
+ type WalletUpdaterRequest = RequestInitWallet | RequestSettle | RequestGetAddress | RequestGetBoardingAddress | RequestGetOperatorInfo | RequestIndexerGetVtxos | RequestIndexerGetVirtualTxs | RequestSubmitTx | RequestFinalizeTx | RequestGetBalance | RequestGetVtxos | RequestGetSpendableVtxos | RequestGetBoardingUtxos | RequestGetTransactionHistory | RequestGetStatus | RequestGetContractSyncState | RequestClear | RequestReloadWallet | RequestSignTransaction | RequestCreateContract | RequestGetContracts | RequestGetContractsWithVtxos | RequestGetStoredContractsWithVtxos | RequestWatchScript | RequestUnwatchScript | RequestGetWatchedScripts | RequestAnnotateVtxos | RequestUpdateContract | RequestDeleteContract | RequestGetSpendablePaths | RequestGetAllSpendingPaths | RequestGetUnsupportedContracts | RequestIsContractManagerWatching | RequestRefreshVtxos | RequestRefreshOutpoints | RequestGetCurrentSigningDescriptor | RequestGetNextSigningDescriptor | RequestGetNewAddresses | RequestGetUsedSigningDescriptors | RequestAdvanceSigningDescriptorWatermark | RequestSend | RequestSendWithDeadline | RequestSendWithInputExpiryFloor | RequestGetAssetDetails | RequestIssue | RequestReissue | RequestBurn | RequestDelegate | RequestGetDelegateInfo | RequestRecoverVtxos | RequestGetRecoverableBalance | RequestGetExpiringVtxos | RequestRenewVtxos | RequestGetExpiredBoardingUtxos | RequestSweepExpiredBoardingUtxos | RequestCosignOnchainTx | RequestSendOnchain | RequestMigrateDeprecatedSignerVtxos | RequestGetDeprecatedSignerStatus | RequestRestoreWallet;
2964
+ type WalletUpdaterResponse = ResponseEnvelope & (ResponseInitWallet | ResponseSettle | ResponseSettleEvent | ResponseGetAddress | ResponseGetBoardingAddress | ResponseGetOperatorInfo | ResponseIndexerGetVtxos | ResponseIndexerGetVirtualTxs | ResponseSubmitTx | ResponseFinalizeTx | ResponseGetBalance | ResponseGetVtxos | ResponseGetSpendableVtxos | ResponseGetBoardingUtxos | ResponseGetTransactionHistory | ResponseGetStatus | ResponseGetContractSyncState | ResponseClear | ResponseReloadWallet | ResponseUtxoUpdate | ResponseVtxoUpdate | ResponseSignTransaction | ResponseCreateContract | ResponseGetContracts | ResponseGetContractsWithVtxos | ResponseGetStoredContractsWithVtxos | ResponseWatchScript | ResponseUnwatchScript | ResponseGetWatchedScripts | ResponseAnnotateVtxos | ResponseUpdateContract | ResponseContractWatchStateSet | ResponseDeleteContract | ResponseGetSpendablePaths | ResponseGetAllSpendingPaths | ResponseGetUnsupportedContracts | ResponseIsContractManagerWatching | ResponseRefreshVtxos | ResponseRefreshOutpoints | ResponseGetCurrentSigningDescriptor | ResponseGetNextSigningDescriptor | ResponseGetNewAddresses | ResponseGetUsedSigningDescriptors | ResponseAdvanceSigningDescriptorWatermark | ResponseContractEvent | ResponseSend | ResponseSendDeadlineExceeded | ResponseGetAssetDetails | ResponseIssue | ResponseReissue | ResponseBurn | ResponseDelegate | ResponseGetDelegateInfo | ResponseRecoverVtxos | ResponseRecoverVtxosEvent | ResponseGetRecoverableBalance | ResponseGetExpiringVtxos | ResponseRenewVtxos | ResponseRenewVtxosEvent | ResponseGetExpiredBoardingUtxos | ResponseSweepExpiredBoardingUtxos | ResponseCosignOnchainTx | ResponseSendOnchain | ResponseMigrateDeprecatedSignerVtxos | ResponseMigrateDeprecatedSignerVtxosEvent | ResponseGetDeprecatedSignerStatus | ResponseRestoreWallet);
2792
2965
  declare class WalletMessageHandler implements MessageHandler<WalletUpdaterRequest, WalletUpdaterResponse> {
2793
2966
  readonly messageTag: string;
2794
2967
  private wallet;
@@ -2864,11 +3037,7 @@ declare class WalletMessageHandler implements MessageHandler<WalletUpdaterReques
2864
3037
  /** History rows plus the address they are stored under. Does not write. */
2865
3038
  private loadHistoryCache;
2866
3039
  private storeHistoryCache;
2867
- /**
2868
- * @param gen - set by a background caller; each write here is skipped once it goes stale.
2869
- * The fetch saves the fetched rows itself, before control returns, so that one write is
2870
- * outside this check.
2871
- */
3040
+ /** @param gen - set by a background caller; the refresh is skipped once it goes stale. */
2872
3041
  private refreshBoardingCache;
2873
3042
  /**
2874
3043
  * Force a full VTXO refresh from the indexer, then refresh cached data.
@@ -2889,7 +3058,7 @@ declare class WalletMessageHandler implements MessageHandler<WalletUpdaterReques
2889
3058
  * Read all virtual outputs from the repository, aggregated across all contract
2890
3059
  * addresses and the wallet's primary address, with deduplication.
2891
3060
  *
2892
- * Recovery-only contracts (imported by `claimCash` for server-swept
3061
+ * Recovery-only contracts (imported by `claimCash` for operator-swept
2893
3062
  * arkcash) are excluded by default, mirroring {@link ReadonlyWallet.getVtxos}:
2894
3063
  * they are settled in their own isolated intent and must stay out of the
2895
3064
  * wallet's balance / VTXO / coin-selection / pending-tx views that read this.
@@ -2969,7 +3138,7 @@ interface ServiceWorkerWalletOptions {
2969
3138
  lazyInitialization?: boolean;
2970
3139
  /** Defer boarding and history loading; render boarding.loaded=false as unknown. */
2971
3140
  lazyBoarding?: boolean;
2972
- /** Arkade server endpoint and optional public key. */
3141
+ /** The operator's endpoint and optional public key. */
2973
3142
  arkServer?: {
2974
3143
  url: string;
2975
3144
  publicKey?: string;
@@ -3137,12 +3306,14 @@ declare class ServiceWorkerReadonlyWallet implements IReadonlyWallet {
3137
3306
  getBoardingAddress(): Promise<string>;
3138
3307
  /**
3139
3308
  * Delegated to the worker, which holds the wallet that owns the connection.
3140
- * The payload crosses raw — see {@link ResponseGetArkadeInfo} for why.
3309
+ * The payload crosses raw — see {@link ResponseGetOperatorInfo} for why.
3141
3310
  */
3142
- getArkadeInfo(opts?: GetArkadeInfoOptions): Promise<ArkadeInfo>;
3311
+ getOperatorInfo(opts?: GetOperatorInfoOptions): Promise<ArkadeInfo>;
3312
+ /** @deprecated Use {@link getOperatorInfo}. */
3313
+ getArkadeInfo(opts?: GetOperatorInfoOptions): Promise<ArkadeInfo>;
3143
3314
  /**
3144
3315
  * An {@link ArkadeReader} that speaks to the worker rather than to the
3145
- * server. The page holds no provider, so a caller that built its own from a
3316
+ * operator. The page holds no provider, so a caller that built its own from a
3146
3317
  * URL would open a second connection outside the worker's rate gate and
3147
3318
  * caches — this proxy is what keeps chain reads in one place.
3148
3319
  */
@@ -3281,6 +3452,8 @@ declare class ServiceWorkerWallet extends ServiceWorkerReadonlyWallet implements
3281
3452
  }): Promise<void>;
3282
3453
  private _restoreWorkerWallet;
3283
3454
  send(...args: [SendParams] | [Recipient, ...Recipient[]]): Promise<string>;
3455
+ cosignOnchainTx(psbt: string | Transaction$1): Promise<string>;
3456
+ sendOnchain(params: SendOnchainParams): Promise<string>;
3284
3457
  getDelegateManager(): Promise<IDelegateManager | undefined>;
3285
3458
  getVtxoManager(): Promise<IVtxoManager>;
3286
3459
  }
@@ -3700,6 +3873,12 @@ declare class ElectrumOnchainProvider implements OnchainProvider {
3700
3873
  }>;
3701
3874
  private resolveOutspends;
3702
3875
  getTransactions(address: string): Promise<ExplorerTransaction[]>;
3876
+ /**
3877
+ * Timestamps of the blocks at the given heights (unconfirmed, `<= 0`, are skipped), one header
3878
+ * fetch per distinct height. A height whose header cannot be fetched, typically an indexer
3879
+ * lagging a fresh block, is absent from the map: callers see no block time, not a failure.
3880
+ */
3881
+ private fetchBlockTimes;
3703
3882
  /**
3704
3883
  * Resolve a list of `{tx_hash, height}` entries (as returned by the
3705
3884
  * scripthash history endpoint) into ExplorerTransaction shape **without
@@ -3738,6 +3917,7 @@ declare class ElectrumOnchainProvider implements OnchainProvider {
3738
3917
  time: number;
3739
3918
  hash: string;
3740
3919
  }>;
3920
+ getMedianTimePast(height: number): Promise<number>;
3741
3921
  /**
3742
3922
  * Consensus's `GetMedianTimePast`, ending at and including `height`.
3743
3923
  *
@@ -3769,6 +3949,7 @@ declare class CachingOperatorProvider implements OperatorProvider {
3769
3949
  /** Bumped on every event-driven cache write; see {@link getInfo}. */
3770
3950
  private generation;
3771
3951
  private readonly unsubscribe;
3952
+ readonly cosignOnchainTx?: (psbtB64: string) => Promise<string>;
3772
3953
  constructor(inner: OperatorProvider, ttlMs?: number);
3773
3954
  /** Releases the inner provider's server-info subscription. */
3774
3955
  dispose(): void;
@@ -3808,7 +3989,7 @@ type OffchainTx = {
3808
3989
  *
3809
3990
  * Creates one checkpoint transaction per input and a virtual transaction that
3810
3991
  * combines all the checkpoints, sending to the specified outputs. This is the
3811
- * core function for creating Arkade transactions.
3992
+ * core function for creating virtual transactions.
3812
3993
  *
3813
3994
  * @param inputs - Array of virtual transaction inputs
3814
3995
  * @param outputs - Array of transaction outputs
@@ -3816,7 +3997,7 @@ type OffchainTx = {
3816
3997
  * @returns Object containing the virtual transaction and checkpoint transactions
3817
3998
  */
3818
3999
  declare function buildOffchainTx(inputs: ArkTxInput[], outputs: TransactionOutput[], serverUnrollScript: CSVMultisigTapscript.Type): OffchainTx;
3819
- declare function hasBoardingTxExpired(coin: ExtendedCoin, boardingTimelock: RelativeTimelock, chainTipHeight?: number): boolean;
4000
+ declare function hasBoardingTxExpired(coin: ExtendedCoin, boardingTimelock: RelativeTimelock, chainTipHeight?: number, chainTipMedianTime?: number, confirmationParentMedianTime?: number): boolean;
3820
4001
  /**
3821
4002
  * Verify tapscript signatures on a transaction input
3822
4003
  * @param tx Transaction to verify
@@ -4165,7 +4346,7 @@ declare class ArkNote implements ExtendedCoin {
4165
4346
  readonly txid: string;
4166
4347
  readonly vout = 0;
4167
4348
  readonly forfeitTapLeafScript: TapLeafScript;
4168
- readonly intentTapLeafScript: TapLeafScript;
4349
+ readonly proofTapLeafScript: TapLeafScript;
4169
4350
  readonly tapTree: Bytes;
4170
4351
  readonly status: Status;
4171
4352
  readonly extraWitness?: Bytes[] | undefined;
@@ -4177,6 +4358,8 @@ declare class ArkNote implements ExtendedCoin {
4177
4358
  * @param HRP - Optional human-readable prefix for string encoding
4178
4359
  */
4179
4360
  constructor(preimage: Uint8Array, value: number, HRP?: string);
4361
+ /** @deprecated Use {@link proofTapLeafScript}. */
4362
+ get intentTapLeafScript(): TapLeafScript;
4180
4363
  /**
4181
4364
  * Encode the note as raw bytes.
4182
4365
  *
@@ -4275,7 +4458,13 @@ type ArkadeExtendedVirtualCoin = ExtendedVirtualCoin & {
4275
4458
  * silently treat as boarding and settle without a forfeit.
4276
4459
  */
4277
4460
  type ArkadeBatchInput = ArkadeExtendedCoin | ArkadeExtendedVirtualCoin;
4278
- declare function createArkadeBatchHandler(intentId: string, inputs: ArkadeBatchInput[], signer: Identity, signedProof: string, message: Proof.RegisterMessage, session: SignerSession, arkProvider: OperatorProvider, emulator: EmulatorProvider, network: Network,
4461
+ declare function createArkadeBatchHandler(intentId: string, inputs: ArkadeBatchInput[],
4462
+ /**
4463
+ * Signs forfeits and boarding inputs. `undefined` only when every input's forfeit leaf names
4464
+ * just the server and the emulator, which co-signs at finalization: a leaf that also needs a
4465
+ * user key would reach arkd unsigned and fail the batch.
4466
+ */
4467
+ signer: Identity | undefined, signedProof: string, message: Proof.RegisterMessage, session: SignerSession, arkProvider: OperatorProvider, emulator: EmulatorProvider, network: Network,
4279
4468
  /**
4280
4469
  * Expected recipients of the settlement, validated against the virtual
4281
4470
  * output tree before co-signing it, and — when tree signing did not run —
@@ -5360,51 +5549,6 @@ declare namespace bignum {
5360
5549
  export { bignum_BIGNUM_MAX_BYTES as BIGNUM_MAX_BYTES, bignum_decode as decode, bignum_encode as encode };
5361
5550
  }
5362
5551
 
5363
- /**
5364
- * Read the JSON `arkadec` writes into a {@link Program}: `$param` placeholders,
5365
- * @scure opcode names, and one structured tapleaf per compiler leaf.
5366
- */
5367
-
5368
- interface ArtifactParameter {
5369
- name: string;
5370
- type: string;
5371
- }
5372
- interface ArtifactStruct {
5373
- name: string;
5374
- fields: ArtifactParameter[];
5375
- }
5376
- interface ArtifactWitnessElement {
5377
- name: string;
5378
- type: string;
5379
- encoding?: string;
5380
- injected?: boolean;
5381
- }
5382
- interface ArtifactLeaf {
5383
- name: string;
5384
- witness?: ArtifactWitnessElement[];
5385
- asm: string[];
5386
- }
5387
- interface ArtifactCovenant {
5388
- inputs: ArtifactParameter[];
5389
- asm: string[];
5390
- }
5391
- interface ArtifactGroup {
5392
- name: string;
5393
- arkade?: ArtifactCovenant;
5394
- leaves: ArtifactLeaf[];
5395
- }
5396
- interface ContractArtifact {
5397
- formatVersion?: number;
5398
- contractName: string;
5399
- constructorInputs: ArtifactParameter[];
5400
- structs?: ArtifactStruct[];
5401
- functions: ArtifactGroup[];
5402
- }
5403
- /** `true` when `value` is an arkadec artifact rather than a Program. */
5404
- declare function isContractArtifact(value: unknown): value is ContractArtifact;
5405
- /** Adds `server`, and one param per child-output placeholder for the caller to bind to that output key. */
5406
- declare function programFromArtifact(artifact: ContractArtifact): Program;
5407
-
5408
5552
  /**
5409
5553
  * Arkade Contract — artifact-driven, high-level covenant API.
5410
5554
  *
@@ -5448,7 +5592,7 @@ declare function programFromArtifact(artifact: ContractArtifact): Program;
5448
5592
  * } satisfies Program;
5449
5593
  *
5450
5594
  * const arkade = await Arkade.connect({ arkade: ark, emulator, indexer, identity, network });
5451
- * // `server` is declared in `params`, so it defaults to the client's server key.
5595
+ * // `server` is declared in `params`, so it defaults to the client's operator key.
5452
5596
  * const htlc = arkade.contract(htlcProgram, { hash, receiver, amount: 10_000n });
5453
5597
  * // `preimage` is typed Uint8Array; calling `claim()` with no args is a type error.
5454
5598
  * const { txid } = await htlc.functions.claim(preimage).to(receiver, 10_000n).send();
@@ -5495,7 +5639,7 @@ interface Utxo {
5495
5639
  */
5496
5640
  script?: string;
5497
5641
  /**
5498
- * Whether the server swept the coin's batch, as {@link ArkadeContract.getUtxos} reports it. A
5642
+ * Whether the operator swept the coin's batch, as {@link ArkadeContract.getUtxos} reports it. A
5499
5643
  * swept coin can't be spent offchain, so `.from()` refuses it; recover it into a batch instead.
5500
5644
  */
5501
5645
  isSwept?: boolean;
@@ -5560,14 +5704,16 @@ interface ArkadeSpendResult {
5560
5704
  /** The callable spending paths of a contract. */
5561
5705
  type CallableFunctions = Record<string, (...args: ArkadeNestedValue[]) => ArkadeTransactionBuilder>;
5562
5706
  /** What {@link Arkade} needs from the Arkade server; see {@link ArkadeConnectOptions.arkade}. */
5563
- type ArkadeServerProvider = Pick<OperatorProvider, "getInfo"> & Partial<ArkadeBroadcaster>;
5707
+ type ArkadeServerProvider = Pick<OperatorProvider, "getInfo"> & Partial<ArkadeBroadcaster & Pick<OperatorProvider, "cosignOnchainTx">>;
5564
5708
  /** Fields shared by both forms of {@link ArkadeConnectOptions}. */
5565
5709
  interface ArkadeConnectCommonOptions {
5710
+ /** Onchain provider for onchain spends; defaults to the service's when `service` is used. */
5711
+ onchain?: Pick<OnchainProvider, "getRawTransaction" | "broadcastTransaction">;
5566
5712
  /** Signer for paths that require a user signature; optional for watch-only. */
5567
5713
  identity?: Identity;
5568
5714
  /**
5569
- * Network for address derivation. Defaults to the network the server
5570
- * reports on `getInfo` — or the SDK default when the server names none.
5715
+ * Network for address derivation. Defaults to the network the operator
5716
+ * reports on `getInfo` — or the SDK default when the operator names none.
5571
5717
  */
5572
5718
  network?: Network;
5573
5719
  /**
@@ -5612,9 +5758,9 @@ interface ArkadeConnectServiceOptions extends ArkadeConnectCommonOptions {
5612
5758
  /** The provider form: hand over providers you already hold (e.g. a wallet's). */
5613
5759
  interface ArkadeConnectProviderOptions extends ArkadeConnectCommonOptions {
5614
5760
  /**
5615
- * The Arkade server provider. Only `getInfo` is required (enough to derive, register and
5761
+ * The operator provider. Only `getInfo` is required (enough to derive, register and
5616
5762
  * inspect contracts); without `submitTx`/`finalizeTx`, `.send()` throws. So a caller already
5617
- * holding `wallet.getArkadeInfo()` can connect without a second `/v1/info` round-trip.
5763
+ * holding `wallet.getOperatorInfo()` can connect without a second `/v1/info` round-trip.
5618
5764
  */
5619
5765
  arkade: ArkadeServerProvider;
5620
5766
  /**
@@ -5651,11 +5797,12 @@ type EventHandle = {
5651
5797
  callback: (event: ArkadeContractEvent) => void | Promise<void>;
5652
5798
  };
5653
5799
  /**
5654
- * A connected Arkade client holding the providers and resolved network constants (server key,
5800
+ * A connected Arkade client holding the providers and resolved network constants (operator key,
5655
5801
  * co-signer key, checkpoint closure), so creating contracts is synchronous.
5656
5802
  */
5657
5803
  declare class Arkade {
5658
5804
  readonly arkProvider: ArkadeServerProvider;
5805
+ readonly onchain?: Pick<OnchainProvider, "getRawTransaction" | "broadcastTransaction">;
5659
5806
  /** The co-signing service, or undefined for emulator-less (pure tapscript) usage. */
5660
5807
  readonly emulator: EmulatorProvider | undefined;
5661
5808
  readonly network: Network;
@@ -5686,7 +5833,7 @@ declare class Arkade {
5686
5833
  private disposed;
5687
5834
  private constructor();
5688
5835
  /**
5689
- * Connect and resolve the server key, checkpoint closure and (if present) the co-signer key.
5836
+ * Connect and resolve the operator key, checkpoint closure and (if present) the cosigner key.
5690
5837
  *
5691
5838
  * @example
5692
5839
  * ```typescript
@@ -5714,7 +5861,7 @@ declare class Arkade {
5714
5861
  * the program's literal type, so `functions` is strongly typed.
5715
5862
  *
5716
5863
  * Declared `server`/`user` params default to the client's keys. Compiler
5717
- * artifacts reserve the server key and exit delay to the connected server.
5864
+ * artifacts reserve the operator key and exit delay to the connected operator.
5718
5865
  * Struct and array params are passed whole by name (see {@link ArkadeNestedValue}).
5719
5866
  */
5720
5867
  contract<const P extends Program>(program: P, args?: Record<string, ArkadeNestedValue>): ArkadeContract<P>;
@@ -5741,7 +5888,7 @@ declare class ArkadeContract<P extends Program = Program> {
5741
5888
  constructor(client: Arkade, program: P, args?: Record<string, ArkadeNestedValue>, keys?: ProgramKeys);
5742
5889
  /**
5743
5890
  * Rebuild a callable contract from a persisted `"arkade"` row. Compiles with the stored keys,
5744
- * not the client's current ones, so script and address survive a server signer rotation.
5891
+ * not the client's current ones, so script and address survive a rotation of the operator's signer.
5745
5892
  */
5746
5893
  static fromContract(client: Arkade, contract: Contract): ArkadeContract;
5747
5894
  /** Resolve the {@link TapLeafScript} for a spending path by its index. */
@@ -5820,6 +5967,7 @@ declare class ArkadeTransactionBuilder {
5820
5967
  private readonly extraPackets;
5821
5968
  private readonly inputs;
5822
5969
  private changeScript?;
5970
+ private feeSats?;
5823
5971
  /** @internal */
5824
5972
  constructor(client: Arkade, unlocker?: ArkadeUnlocker | undefined);
5825
5973
  /**
@@ -5842,6 +5990,8 @@ declare class ArkadeTransactionBuilder {
5842
5990
  withPacket(packet: ExtensionPacket): this;
5843
5991
  /** Destination for any surplus (inputs − outputs). Required when the spend is not exact. */
5844
5992
  change(script: Uint8Array): this;
5993
+ /** Onchain only: the fee taken out of the surplus; without `.change()` it must equal the surplus. */
5994
+ onchainFee(sats: bigint): this;
5845
5995
  /** Add an output — `(script, amount)` or a list of outputs. */
5846
5996
  to(script: Uint8Array, amount: bigint): this;
5847
5997
  to(outputs: TransactionOutput[]): this;
@@ -5851,6 +6001,12 @@ declare class ArkadeTransactionBuilder {
5851
6001
  checkpoints: Transaction[];
5852
6002
  }>;
5853
6003
  private assemble;
6004
+ /** Assemble the unsigned onchain spend of a coin sitting at the contract address. */
6005
+ buildOnchain(): Promise<Transaction>;
6006
+ /** Build, cosign and broadcast the onchain spend; returns its txid. */
6007
+ sendOnchain(): Promise<string>;
6008
+ private serverSigns;
6009
+ private leafTimelocks;
5854
6010
  /** Build, submit and return the finalized transaction. */
5855
6011
  send(): Promise<ArkadeSpendResult>;
5856
6012
  /** Sign the client-owned inputs of the ark tx (no-op when there are none). */
@@ -5868,6 +6024,92 @@ declare class ArkadeTransactionBuilder {
5868
6024
  private buildAssetPacket;
5869
6025
  }
5870
6026
 
6027
+ /** A covenant VTXO and the function that renews it. */
6028
+ interface ProgramContractRenewTarget {
6029
+ contract: ArkadeContract<any>;
6030
+ coin: VirtualCoin;
6031
+ /**
6032
+ * Covenant function that lets proof input k+1 through to proof output k unchanged (the
6033
+ * emulator enforces it), e.g.
6034
+ * `require(tx.version == 2); require(this.tunnel(this.activeInputIndex - 1));`. Default `renew`.
6035
+ */
6036
+ fn?: string;
6037
+ }
6038
+ /**
6039
+ * Renews covenant VTXOs into a new batch without any owner key: the emulator signs the intent
6040
+ * proof after running each covenant and co-signs the forfeits, so a keeper can keep coins alive
6041
+ * while their owners are offline. Returns the commitment txid.
6042
+ *
6043
+ * A renewal that fails or is aborted after registering deletes its intent, freeing the coins for a
6044
+ * retry. `signal` is honoured until the batch's forfeits are being sent; from then on the renewal
6045
+ * waits for the batch to finalize or fail, since it may commit either way.
6046
+ */
6047
+ declare function renewProgramContractOutputs(client: Arkade, targets: ProgramContractRenewTarget[], opts?: {
6048
+ session?: SignerSession;
6049
+ signal?: AbortSignal;
6050
+ }): Promise<{
6051
+ commitmentTxid: string;
6052
+ intentId: string;
6053
+ }>;
6054
+
6055
+ /**
6056
+ * Read the JSON `arkadec` writes into a {@link Program}: `$param` placeholders,
6057
+ * @scure opcode names, and one structured tapleaf per compiler leaf.
6058
+ */
6059
+
6060
+ interface ArtifactParameter {
6061
+ name: string;
6062
+ type: string;
6063
+ }
6064
+ interface ArtifactStruct {
6065
+ name: string;
6066
+ fields: ArtifactParameter[];
6067
+ }
6068
+ interface ArtifactWitnessElement {
6069
+ name: string;
6070
+ type: string;
6071
+ encoding?: string;
6072
+ injected?: boolean;
6073
+ }
6074
+ interface ArtifactLeaf {
6075
+ name: string;
6076
+ witness?: ArtifactWitnessElement[];
6077
+ asm: string[];
6078
+ }
6079
+ interface ArtifactCovenant {
6080
+ inputs: ArtifactParameter[];
6081
+ asm: string[];
6082
+ }
6083
+ interface ArtifactGroup {
6084
+ name: string;
6085
+ arkade?: ArtifactCovenant;
6086
+ leaves: ArtifactLeaf[];
6087
+ }
6088
+ interface ContractArtifact {
6089
+ formatVersion?: number;
6090
+ contractName: string;
6091
+ constructorInputs: ArtifactParameter[];
6092
+ structs?: ArtifactStruct[];
6093
+ functions: ArtifactGroup[];
6094
+ fingerprint?: string;
6095
+ }
6096
+ /** The compiler's debug file: each covenant's source map, keyed by spend group. */
6097
+ interface ContractDebugInfo {
6098
+ formatVersion: number;
6099
+ /** The {@link ContractArtifact.fingerprint} of the build that wrote it. */
6100
+ artifactFingerprint?: string;
6101
+ functions: Record<string, {
6102
+ sourceMap: SourceRange[];
6103
+ }>;
6104
+ }
6105
+ /** `true` when `value` is an arkadec artifact rather than a Program. */
6106
+ declare function isContractArtifact(value: unknown): value is ContractArtifact;
6107
+ /**
6108
+ * Adds `server`, and one param per child-output placeholder for the caller to bind to that output key.
6109
+ * With the build's `debug` file, each covenant segment also carries its `sourceMap`.
6110
+ */
6111
+ declare function programFromArtifact(artifact: ContractArtifact, debug?: ContractDebugInfo): Program;
6112
+
5871
6113
  /**
5872
6114
  * Arkade Script Support
5873
6115
  *
@@ -5924,6 +6166,7 @@ type index_AssetSpec = AssetSpec;
5924
6166
  type index_CallableFunctions = CallableFunctions;
5925
6167
  declare const index_CompiledProgramFunction: typeof CompiledProgramFunction;
5926
6168
  type index_ContractArtifact = ContractArtifact;
6169
+ type index_ContractDebugInfo = ContractDebugInfo;
5927
6170
  type index_ContractFunctions<P extends Program> = ContractFunctions<P>;
5928
6171
  type index_ContractUnlockers<P extends Program> = ContractUnlockers<P>;
5929
6172
  declare const index_InputDef: typeof InputDef;
@@ -5932,12 +6175,14 @@ declare const index_OP: typeof OP;
5932
6175
  declare const index_OPCODE_NAMES: typeof OPCODE_NAMES;
5933
6176
  declare const index_OPCODE_VALUES: typeof OPCODE_VALUES;
5934
6177
  declare const index_Program: typeof Program;
6178
+ type index_ProgramContractRenewTarget = ProgramContractRenewTarget;
5935
6179
  declare const index_ProgramKeys: typeof ProgramKeys;
5936
6180
  declare const index_ResolvedArkadeService: typeof ResolvedArkadeService;
5937
6181
  declare const index_SUPPORTED_PROGRAM_VERSION: typeof SUPPORTED_PROGRAM_VERSION;
5938
6182
  declare const index_Script: typeof Script;
5939
6183
  declare const index_ScriptType: typeof ScriptType;
5940
6184
  declare const index_SignerRef: typeof SignerRef;
6185
+ declare const index_SourceRange: typeof SourceRange;
5941
6186
  declare const index_TapscriptSegment: typeof TapscriptSegment;
5942
6187
  declare const index_TweakedSigner: typeof TweakedSigner;
5943
6188
  declare const index_UnsupportedProgramVersionError: typeof UnsupportedProgramVersionError;
@@ -5956,6 +6201,7 @@ declare const index_getOpcodeValue: typeof getOpcodeValue;
5956
6201
  declare const index_isContractArtifact: typeof isContractArtifact;
5957
6202
  declare const index_parseArtifact: typeof parseArtifact;
5958
6203
  declare const index_programFromArtifact: typeof programFromArtifact;
6204
+ declare const index_renewProgramContractOutputs: typeof renewProgramContractOutputs;
5959
6205
  declare const index_resolveArkadeService: typeof resolveArkadeService;
5960
6206
  declare const index_resolveAsm: typeof resolveAsm;
5961
6207
  declare const index_serializeArkadeContractParams: typeof serializeArkadeContractParams;
@@ -5964,7 +6210,7 @@ declare const index_toASM: typeof toASM;
5964
6210
  declare const index_validateProgram: typeof validateProgram;
5965
6211
  declare const index_witnessRefToBytes: typeof witnessRefToBytes;
5966
6212
  declare namespace index {
5967
- 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, type index_ArkadeConnectProviderOptions as ArkadeConnectProviderOptions, type index_ArkadeConnectServiceOptions as ArkadeConnectServiceOptions, index_ArkadeContract as ArkadeContract, type index_ArkadeContractEvent as ArkadeContractEvent, type index_ArkadeContractEventType as ArkadeContractEventType, index_ArkadeContractParams as ArkadeContractParams, type index_ArkadeContractSubscription as ArkadeContractSubscription, type index_ArkadeExtendedCoin as ArkadeExtendedCoin, type index_ArkadeExtendedVirtualCoin as ArkadeExtendedVirtualCoin, index_ArkadeFunction as ArkadeFunction, type index_ArkadeNestedValue as ArkadeNestedValue, 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_ArkadeServerProvider as ArkadeServerProvider, index_ArkadeService as ArkadeService, type index_ArkadeSpendResult as ArkadeSpendResult, index_ArkadeTransactionBuilder as ArkadeTransactionBuilder, type index_ArkadeUnlocker as ArkadeUnlocker, index_AsmToken as AsmToken, type index_AssetSpec as AssetSpec, bignum as BigNum, type index_CallableFunctions as CallableFunctions, index_CompiledProgramFunction as CompiledProgramFunction, type index_ContractArtifact as ContractArtifact, type index_ContractFunctions as ContractFunctions, type index_ContractUnlockers as ContractUnlockers, 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_ResolvedArkadeService as ResolvedArkadeService, index_SUPPORTED_PROGRAM_VERSION as SUPPORTED_PROGRAM_VERSION, index_Script as Script, index_ScriptType as ScriptType, index_SignerRef as SignerRef, index_TapscriptSegment as TapscriptSegment, index_TweakedSigner as TweakedSigner, index_UnsupportedProgramVersionError as UnsupportedProgramVersionError, 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_isContractArtifact as isContractArtifact, index_parseArtifact as parseArtifact, index_programFromArtifact as programFromArtifact, index_resolveArkadeService as resolveArkadeService, index_resolveAsm as resolveAsm, index_serializeArkadeContractParams as serializeArkadeContractParams, index_stringifyArtifact as stringifyArtifact, index_toASM as toASM, index_validateProgram as validateProgram, index_witnessRefToBytes as witnessRefToBytes };
6213
+ 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, type index_ArkadeConnectProviderOptions as ArkadeConnectProviderOptions, type index_ArkadeConnectServiceOptions as ArkadeConnectServiceOptions, index_ArkadeContract as ArkadeContract, type index_ArkadeContractEvent as ArkadeContractEvent, type index_ArkadeContractEventType as ArkadeContractEventType, index_ArkadeContractParams as ArkadeContractParams, type index_ArkadeContractSubscription as ArkadeContractSubscription, type index_ArkadeExtendedCoin as ArkadeExtendedCoin, type index_ArkadeExtendedVirtualCoin as ArkadeExtendedVirtualCoin, index_ArkadeFunction as ArkadeFunction, type index_ArkadeNestedValue as ArkadeNestedValue, 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_ArkadeServerProvider as ArkadeServerProvider, index_ArkadeService as ArkadeService, type index_ArkadeSpendResult as ArkadeSpendResult, index_ArkadeTransactionBuilder as ArkadeTransactionBuilder, type index_ArkadeUnlocker as ArkadeUnlocker, index_AsmToken as AsmToken, type index_AssetSpec as AssetSpec, bignum as BigNum, type index_CallableFunctions as CallableFunctions, index_CompiledProgramFunction as CompiledProgramFunction, type index_ContractArtifact as ContractArtifact, type index_ContractDebugInfo as ContractDebugInfo, type index_ContractFunctions as ContractFunctions, type index_ContractUnlockers as ContractUnlockers, 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, type index_ProgramContractRenewTarget as ProgramContractRenewTarget, index_ProgramKeys as ProgramKeys, index_ResolvedArkadeService as ResolvedArkadeService, index_SUPPORTED_PROGRAM_VERSION as SUPPORTED_PROGRAM_VERSION, index_Script as Script, index_ScriptType as ScriptType, index_SignerRef as SignerRef, index_SourceRange as SourceRange, index_TapscriptSegment as TapscriptSegment, index_TweakedSigner as TweakedSigner, index_UnsupportedProgramVersionError as UnsupportedProgramVersionError, 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_isContractArtifact as isContractArtifact, index_parseArtifact as parseArtifact, index_programFromArtifact as programFromArtifact, index_renewProgramContractOutputs as renewProgramContractOutputs, index_resolveArkadeService as resolveArkadeService, index_resolveAsm as resolveAsm, index_serializeArkadeContractParams as serializeArkadeContractParams, index_stringifyArtifact as stringifyArtifact, index_toASM as toASM, index_validateProgram as validateProgram, index_witnessRefToBytes as witnessRefToBytes };
5968
6214
  }
5969
6215
 
5970
6216
  /** Known BIP21 parameters including Arkade-specific extensions. */
@@ -6319,6 +6565,15 @@ declare function isCltvSatisfied(context: PathContext, locktime: bigint): boolea
6319
6565
  */
6320
6566
  declare function isCsvSpendable(context: PathContext, sequence?: number): boolean;
6321
6567
 
6568
+ declare class OnchainCosignPreflightError extends Error {
6569
+ readonly reason: string;
6570
+ constructor(reason: string, options?: {
6571
+ cause?: unknown;
6572
+ });
6573
+ }
6574
+ /** True only when the coins were definitely not spent, so paying another way is safe. */
6575
+ declare function isCosignFallback(e: unknown): boolean;
6576
+
6322
6577
  /**
6323
6578
  * Convert RelativeTimelock to BIP68 sequence number.
6324
6579
  */
@@ -6562,4 +6817,4 @@ declare class AssetManager extends ReadonlyAssetManager implements IAssetManager
6562
6817
  private burnWith;
6563
6818
  }
6564
6819
 
6565
- export { ARKADE_MAGIC, ARKADE_SALTED_PREIMAGE_TAG, ARKADE_SWAP_PREIMAGE_TAG, ASSET_CARRIER_SATS, Activity, ActivityRegistry, AddressAllocationCapable, AmbiguousRouteError, type AnchorBumper, ArkAddress, ArkIntent, ArkNote, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, Arkade, type ArkadeBatchInput, ArkadeBroadcaster, ArkadeCash, ArkadeContractParams, type ArkadeExtendedCoin, type ArkadeExtendedVirtualCoin, ArkadeInfo, ArkadeReader, ArkadeService, Asset, AssetDetails, AssetManager, AtomicWalletState, BIP21, BIP21Error, type BIP21Params, type BIP21ParseResult, BIP322, BLOCKED_UPGRADE_TIMEOUT_MS, Batch, BatchExpiryPolicy, BurnParams, CSVMultisigTapscript, CachingArkProvider, CachingOperatorProvider, ChainTx, Coin, ConditionWitness, ConnectionDisposedError, Contract, ContractEvent, ContractFilter, ContractRepository, ContractSyncState, ContractVtxoEvent, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DatabaseUpgradeBlockedError, DefaultVtxo, DelegateInfo, DelegateNotConfiguredError, DescriptorIdentity, type DescriptorIdentityOptions, type DescriptorOptions, DescriptorProvider, type DescriptorSigner, DescriptorSigningProviderMissingError, DescriptorSigningRequest, type DeterministicSigner, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, type EmulatorEntry, EmulatorPacket, EmulatorProvider, EncodedVtxoScript, Estimator, type ExcludableVtxo, type ExecutorEvent, type ExecutorOptions, type ExitDelay, type ExitFeeWallet, type ExitMode, type ExitOptions, type ExitPackage, type ExitQuote, type ExitStep, type ExitTotals, type ExitVtxoInfo, ExplorerTransaction, ExtendedCoin, ExtendedContractVtxo, ExtendedVirtualCoin, Extension, ExtensionNotFoundError, type ExtensionPacket, FeeAmount, FeeInfo, FeeOutput, FetchError, GetArkadeInfoOptions, GetNewAddressesOptions, GetSpendableVtxosFilter, GetVtxosFilter, GetVtxosOptions, HDAllocationCapable, HDDescriptorProvider, type HDDeterministicSignCapable, HDWalletCapable, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexerProvider, InputExpiryFloor, Intent, IntentFeeConfig, IntentPageFilter, IntentRepository, IssuanceParams, IssuanceResult, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, type ManagedConnection, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, MigrationGlobalSkipReason, MigrationLegSkipReason, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, NewAddress, NormalizedExtendedVirtualCoin, NormalizedVtxoPage, OffchainInput, type OffchainTx, type OnExitObserved, OnchainInput, OnchainProvider, OnchainWallet, OperatorProvider, Outpoint, OversizedChangeError, P2A, PageRequest, PageResult, PaginationOptions, type ParsedArkContract, PathContext, PathSelection, type PaymentHandle, type PaymentOption, type PaymentRail, type PaymentRequest, PaymentRouter, type PaymentStatus, PrevArkTxField, PrevoutTxField, Proof, ProviderConnectionState, type ProvisionedClaimSecret, type ProvisionedKey, READ_TIMEOUT_MS, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, type RouteQuote, type RouteResult, type RouterContext, type RouterPreferences, ScriptVtxoCursor, ScriptVtxoPageOptions, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, SendDeadlineExceededError, SendParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignedIntent, SignedProof, SignerSession, SignerStatus, SingleKey, StaticDescriptorProvider, Status, StorageConfig, StoredVtxo, TapLeafScript, Transaction, TransactionHistoryPageCursor, TransactionHistoryPageFilter, TreeNonces, TreePartialSigs, TxNotificationEvent, TxTree, TxWeightEstimator, UnannotatableInputError, UnilateralExit, UnknownPacket, Unroll, UnsupportedProgramVersionError, type VSize, type VerifyServerSignatures, VirtualCoin, VirtualTx, VirtualTxRepository, VtxoBranch, type VtxoExclusion, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletCannotSignError, WalletMessageHandler, WalletNotInitializedError, WalletRepository, type WalletRestoreHook, WatchedScript, WsElectrumChainSource, adoptContractDescriptor, arkAssetRail, arkRail, arkTarget, index as arkade, assembleBtcdTaprootTree, assertFinalCommitmentMatchesValidated, assertNoAssets, assertNoSelection, assertNonNegativeMs, assertSendDeadline, assertSendableAmount, assertSubmittedArkTxid, assertTimerMs, assertValidServerUnrollScript, index$1 as asset, assetsOf, awaitTransaction, btcTarget, buildForfeitTx, buildOffchainTx, buildPreimageMessage, buildSaltedPreimageMessage, buildVersion, captureSendDeadline, claimWithPreimageIdentity, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, contractPreimage, contractSigner, createAssetPacket, createDefaultPaymentRouter, createManagedConnection, decodeArkContract, deleteByIndex, deriveDescriptorLeafCompressedPubKey, deriveDescriptorLeafPubKey, deserializeExitPackage, encodeArkContract, exitObserverFor, gateExclusion, gatedContracts, getAllByIndexValues, getArkPsbtFields, hasBoardingTxExpired, identityDescriptor, invoiceTarget, isArkContract, isBtcAddress, isCltvSatisfied, isContractGenericallySpendable, isCsvSpendable, isDeterministicSigner, isHDDeterministicSignCapable, isLightningInvoice, isLnurl, isMessageBusInitializingError, isMessageBusNotInitializedError, isPerArtifactDescriptor, isRetryableProviderError, isValidArkAddress, logExcludedVtxos, makeHandle, matchServerCheckpoints, normalizeToDescriptor, notifyExitObserved, onchainRail, openDatabase, outpointExclusion, outpointReasons, parseHDDescriptor, promisifyRequest, provisionClaimSecret, provisionRefundKey, registerWalletRestoreHook, resolveAssetAmount, resolveSendAmount, sdkVersion, selectCoinsWithAsset, selectionOf, sequenceToTimelock, serializeExitPackage, setArkPsbtField, setupServiceWorker, signAndSubmitOffchainTx, submitViaEmulator, timelockToSequence, toXOnly, tryResolveSendAmount, validateBatchRecipients, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, walletFeeSource };
6820
+ export { ARKADE_MAGIC, ARKADE_SALTED_PREIMAGE_TAG, ARKADE_SWAP_PREIMAGE_TAG, ASSET_CARRIER_SATS, Activity, ActivityRegistry, AddressAllocationCapable, AmbiguousRouteError, type AnchorBumper, ArkAddress, ArkIntent, ArkNote, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, Arkade, type ArkadeBatchInput, ArkadeBroadcaster, ArkadeCash, ArkadeContractParams, type ArkadeExtendedCoin, type ArkadeExtendedVirtualCoin, ArkadeInfo, ArkadeReader, ArkadeService, Asset, AssetDetails, AssetManager, AtomicWalletState, BIP21, BIP21Error, type BIP21Params, type BIP21ParseResult, BIP322, BLOCKED_UPGRADE_TIMEOUT_MS, Batch, BatchExpiryPolicy, BatchRegistration, BatchRegistrationRepository, BurnParams, CSVMultisigTapscript, CachingArkProvider, CachingOperatorProvider, ChainTx, Coin, ConditionWitness, ConnectionDisposedError, Contract, ContractEvent, ContractFilter, ContractRepository, ContractSyncState, ContractVtxoEvent, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DEFAULT_PASSKEY_LABEL, DatabaseUpgradeBlockedError, DefaultVtxo, DelegateInfo, DelegateNotConfiguredError, DescriptorIdentity, type DescriptorIdentityOptions, type DescriptorOptions, DescriptorProvider, type DescriptorSigner, DescriptorSigningProviderMissingError, DescriptorSigningRequest, type DeterministicSigner, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, type EmulatorEntry, EmulatorPacket, EmulatorProvider, EncodedVtxoScript, Estimator, type ExcludableVtxo, type ExecutorEvent, type ExecutorOptions, type ExitDelay, type ExitFeeWallet, type ExitMode, type ExitOptions, type ExitPackage, type ExitQuote, type ExitStep, type ExitTotals, type ExitVtxoInfo, ExplorerTransaction, ExtendedCoin, ExtendedContractVtxo, ExtendedVirtualCoin, Extension, ExtensionNotFoundError, type ExtensionPacket, FeeAmount, FeeInfo, FeeOutput, FetchError, GetNewAddressesOptions, GetOperatorInfoOptions, GetSpendableVtxosFilter, GetVtxosFilter, GetVtxosOptions, HDAllocationCapable, HDDescriptorProvider, type HDDeterministicSignCapable, HDWalletCapable, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryBatchRegistrationRepository, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBBatchRegistrationRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexerProvider, InputExpiryFloor, Intent, IntentFeeConfig, IntentPageFilter, IntentRepository, IssuanceParams, IssuanceResult, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, type ManagedConnection, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, MigrationGlobalSkipReason, MigrationLegSkipReason, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, NewAddress, NormalizedExtendedVirtualCoin, NormalizedVtxoPage, OffchainInput, type OffchainTx, type OnExitObserved, OnchainCosignPreflightError, OnchainInput, OnchainProvider, OnchainWallet, OperatorProvider, Outpoint, OversizedChangeError, P2A, PageRequest, PageResult, PaginationOptions, type ParsedArkContract, PasskeyCancelled, type PasskeyMnemonic, type PasskeySource, PasskeyUnconfirmed, PathContext, PathSelection, type PaymentHandle, type PaymentOption, type PaymentRail, type PaymentRequest, PaymentRouter, type PaymentStatus, PrevArkTxField, PrevoutTxField, PrfUnavailable, Proof, ProviderConnectionState, type ProvisionedClaimSecret, type ProvisionedKey, READ_TIMEOUT_MS, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, type RouteQuote, type RouteResult, type RouterContext, type RouterPreferences, ScriptVtxoCursor, ScriptVtxoPageOptions, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, SendDeadlineExceededError, SendOnchainParams, SendParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignedIntent, SignedProof, SignerSession, SignerStatus, SingleKey, StaticDescriptorProvider, Status, StorageConfig, StoredVtxo, TapLeafScript, Transaction, TransactionHistoryPageCursor, TransactionHistoryPageFilter, TreeNonces, TreePartialSigs, TxNotificationEvent, TxTree, TxWeightEstimator, UnannotatableInputError, UnilateralExit, UnknownPacket, Unroll, UnsupportedProgramVersionError, type VSize, type VerifyServerSignatures, VirtualCoin, VirtualTx, VirtualTxRepository, VtxoBranch, type VtxoExclusion, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletCannotSignError, WalletMessageHandler, WalletNotInitializedError, WalletRepository, type WalletRestoreHook, WatchedScript, type WebAuthnClient, WsElectrumChainSource, adoptContractDescriptor, arkAssetRail, arkRail, arkTarget, index as arkade, assembleBtcdTaprootTree, assertFinalCommitmentMatchesValidated, assertNoAssets, assertNoSelection, assertNonNegativeMs, assertSendDeadline, assertSendableAmount, assertSubmittedArkTxid, assertTimerMs, assertValidServerUnrollScript, index$1 as asset, assetsOf, awaitTransaction, btcTarget, buildForfeitTx, buildOffchainTx, buildPreimageMessage, buildSaltedPreimageMessage, buildVersion, captureSendDeadline, claimWithPreimageIdentity, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, contractPreimage, contractSigner, createAssetPacket, createDefaultPaymentRouter, createManagedConnection, createPrfPasskey, decodeArkContract, deleteByIndex, deriveDescriptorLeafCompressedPubKey, deriveDescriptorLeafPubKey, deserializeExitPackage, encodeArkContract, evaluatePrf, exitObserverFor, gateExclusion, gatedContracts, getAllByIndexValues, getArkPsbtFields, hasBoardingTxExpired, identityDescriptor, invoiceTarget, isArkContract, isBtcAddress, isCltvSatisfied, isContractGenericallySpendable, isCosignFallback, isCsvSpendable, isDeterministicSigner, isHDDeterministicSignCapable, isLightningInvoice, isLnurl, isMessageBusInitializingError, isMessageBusNotInitializedError, isPerArtifactDescriptor, isRetryableProviderError, isValidArkAddress, logExcludedVtxos, makeHandle, matchServerCheckpoints, mnemonicFromPrf, normalizeToDescriptor, notifyExitObserved, onchainRail, openDatabase, outpointExclusion, outpointReasons, parseHDDescriptor, prfSupport, promisifyRequest, provisionClaimSecret, provisionRefundKey, registerWalletRestoreHook, resolveAssetAmount, resolveSendAmount, sdkVersion, selectCoinsWithAsset, selectionOf, sequenceToTimelock, serializeExitPackage, setArkPsbtField, setupServiceWorker, signAndSubmitOffchainTx, submitViaEmulator, timelockToSequence, toXOnly, tryResolveSendAmount, validateBatchRecipients, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, walletFeeSource };