@arkade-os/sdk 0.5.4 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -17
- package/dist/adapters/expo.cjs +7 -6
- package/dist/adapters/expo.d.cts +4 -3
- package/dist/adapters/expo.d.ts +4 -3
- package/dist/adapters/expo.js +4 -3
- package/dist/{asyncStorageTaskQueue-DTBa8EH7.d.cts → asyncStorageTaskQueue-Bh2n0msM.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-DHMIxY04.d.ts → asyncStorageTaskQueue-CpkstKZ5.d.ts} +2 -2
- package/dist/base-C-Y5t_0F.d.cts +359 -0
- package/dist/base-C-Y5t_0F.d.ts +359 -0
- package/dist/{chunk-6CUP6ZIF.js → chunk-47Z4LEIW.js} +17 -841
- package/dist/chunk-47Z4LEIW.js.map +1 -0
- package/dist/{chunk-DNITZVNG.cjs → chunk-4X67IB2V.cjs} +18 -17
- package/dist/chunk-4X67IB2V.cjs.map +1 -0
- package/dist/{chunk-BTRCN4JJ.js → chunk-C7NY6WSA.js} +64 -4
- package/dist/chunk-C7NY6WSA.js.map +1 -0
- package/dist/{chunk-TUOLZBNC.js → chunk-DJYX73W2.js} +5 -4
- package/dist/chunk-DJYX73W2.js.map +1 -0
- package/dist/chunk-DNFTHG73.js +829 -0
- package/dist/chunk-DNFTHG73.js.map +1 -0
- package/dist/chunk-FDJ734CH.js +882 -0
- package/dist/chunk-FDJ734CH.js.map +1 -0
- package/dist/chunk-FLPWNMX3.cjs +930 -0
- package/dist/chunk-FLPWNMX3.cjs.map +1 -0
- package/dist/{chunk-WXNSISXK.cjs → chunk-HKEPJBTY.cjs} +79 -18
- package/dist/chunk-HKEPJBTY.cjs.map +1 -0
- package/dist/chunk-JFJNB7ZH.cjs +884 -0
- package/dist/chunk-JFJNB7ZH.cjs.map +1 -0
- package/dist/{chunk-GHUUT54D.cjs → chunk-LZAINCGU.cjs} +89 -933
- package/dist/chunk-LZAINCGU.cjs.map +1 -0
- package/dist/{chunk-E6OOJEHL.cjs → chunk-NDQ4LB4X.cjs} +60 -934
- package/dist/chunk-NDQ4LB4X.cjs.map +1 -0
- package/dist/{chunk-AG4TFD6F.js → chunk-QTMK34TP.js} +79 -884
- package/dist/chunk-QTMK34TP.js.map +1 -0
- package/dist/chunk-V3ZLL5VY.js +380 -0
- package/dist/chunk-V3ZLL5VY.js.map +1 -0
- package/dist/{chunk-MWVAWFX6.js → chunk-VWW2ZBPI.js} +4 -4
- package/dist/{chunk-MWVAWFX6.js.map → chunk-VWW2ZBPI.js.map} +1 -1
- package/dist/chunk-X6ZI53DZ.cjs +383 -0
- package/dist/chunk-X6ZI53DZ.cjs.map +1 -0
- package/dist/{chunk-F3FAE7VJ.cjs → chunk-Y3CDDPWI.cjs} +3138 -1764
- package/dist/chunk-Y3CDDPWI.cjs.map +1 -0
- package/dist/{chunk-ZJHLLDBP.js → chunk-YKT4NAQG.js} +2653 -1295
- package/dist/chunk-YKT4NAQG.js.map +1 -0
- package/dist/{chunk-B6VNKGIH.cjs → chunk-YS76JSGP.cjs} +10 -10
- package/dist/{chunk-B6VNKGIH.cjs.map → chunk-YS76JSGP.cjs.map} +1 -1
- package/dist/compiler.cjs +50 -0
- package/dist/compiler.cjs.map +1 -0
- package/dist/compiler.d.cts +38 -0
- package/dist/compiler.d.ts +38 -0
- package/dist/compiler.js +47 -0
- package/dist/compiler.js.map +1 -0
- package/dist/contracts/handlers/index.cjs +11 -9
- package/dist/contracts/handlers/index.d.cts +6 -4
- package/dist/contracts/handlers/index.d.ts +6 -4
- package/dist/contracts/handlers/index.js +4 -2
- package/dist/{delegate-xrSBNybC.d.ts → delegate-gGkUnYpi.d.cts} +1 -1
- package/dist/{delegate-f4_t864Z.d.cts → delegate-iyDum4fw.d.ts} +1 -1
- package/dist/{index-BJDz15ms.d.ts → index-2wKMrT0a.d.ts} +5 -270
- package/dist/{index-BjiVGtp8.d.cts → index-46g577Ka.d.cts} +5 -270
- package/dist/{index-DRwe0UDN.d.cts → index-C66rjxz2.d.ts} +1603 -1721
- package/dist/{index-DRwe0UDN.d.ts → index-Dqk07NwJ.d.cts} +1603 -1721
- package/dist/index.cjs +457 -378
- package/dist/index.d.cts +640 -385
- package/dist/index.d.ts +640 -385
- package/dist/index.js +7 -4
- package/dist/{wallet-jVBDQl6R.d.cts → keyringDescriptorProvider-DiBM4GmB.d.ts} +417 -366
- package/dist/{wallet-Oc3Wd5gv.d.ts → keyringDescriptorProvider-DnaLUC7v.d.cts} +417 -366
- package/dist/program-BARSNg3X.d.ts +286 -0
- package/dist/program-znrWkxE4.d.cts +286 -0
- package/dist/repositories/realm/index.cjs +71 -51
- package/dist/repositories/realm/index.cjs.map +1 -1
- package/dist/repositories/realm/index.d.cts +20 -9
- package/dist/repositories/realm/index.d.ts +20 -9
- package/dist/repositories/realm/index.js +42 -23
- package/dist/repositories/realm/index.js.map +1 -1
- package/dist/repositories/sqlite/index.cjs +81 -56
- package/dist/repositories/sqlite/index.cjs.map +1 -1
- package/dist/repositories/sqlite/index.d.cts +17 -8
- package/dist/repositories/sqlite/index.d.ts +17 -8
- package/dist/repositories/sqlite/index.js +55 -31
- package/dist/repositories/sqlite/index.js.map +1 -1
- package/dist/{taskRunner-CDlNeth0.d.ts → taskRunner-BM6IAKlS.d.ts} +2 -2
- package/dist/{taskRunner-BPPU-YHG.d.cts → taskRunner-BmDIZiSl.d.cts} +2 -2
- package/dist/wallet/expo/background.cjs +17 -14
- package/dist/wallet/expo/background.cjs.map +1 -1
- package/dist/wallet/expo/background.d.cts +5 -4
- package/dist/wallet/expo/background.d.ts +5 -4
- package/dist/wallet/expo/background.js +9 -6
- package/dist/wallet/expo/background.js.map +1 -1
- package/dist/wallet/expo/index.cjs +29 -16
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +12 -7
- package/dist/wallet/expo/index.d.ts +12 -7
- package/dist/wallet/expo/index.js +19 -6
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/worker/expo/index.cjs +12 -9
- package/dist/worker/expo/index.cjs.map +1 -1
- package/dist/worker/expo/index.d.cts +6 -5
- package/dist/worker/expo/index.d.ts +6 -5
- package/dist/worker/expo/index.js +8 -5
- package/dist/worker/expo/index.js.map +1 -1
- package/package.json +16 -1
- package/dist/chunk-6CUP6ZIF.js.map +0 -1
- package/dist/chunk-AG4TFD6F.js.map +0 -1
- package/dist/chunk-BTRCN4JJ.js.map +0 -1
- package/dist/chunk-DNITZVNG.cjs.map +0 -1
- package/dist/chunk-E6OOJEHL.cjs.map +0 -1
- package/dist/chunk-F3FAE7VJ.cjs.map +0 -1
- package/dist/chunk-GHUUT54D.cjs.map +0 -1
- package/dist/chunk-TUOLZBNC.js.map +0 -1
- package/dist/chunk-WXNSISXK.cjs.map +0 -1
- package/dist/chunk-ZJHLLDBP.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
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 './
|
|
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,
|
|
5
|
-
import {
|
|
6
|
-
export {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { a as Identity, ay as Transaction, ax as SignerSession, af as ReadonlyIdentity, ad as DescriptorProvider, aE as DescriptorSigningRequest, aF as IntentFeeConfig, aG as OffchainInput, aH as FeeAmount, aI as OnchainInput, aJ as FeeOutput, Y as BatchRegistrationRepository, Z as BatchRegistration, _ as BatchRegistrationPageFilter, P as PageRequest, D as PageResult, B as Outpoint, $ as VirtualTxRepository, a0 as VirtualTx, a1 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, g as ArkTransaction, U as WalletState, y as Contract, C as ContractRepository, X as ContractFilter, I as IWallet, x as OperatorProvider, ap as NetworkName, ag as OnchainProvider, av as SettlementConfig, aK as ContractWatcherConfig, aL as Asset, R as Recipient, aM as FeeInfo, n as SettlementEvent, N as NormalizedExtendedVirtualCoin, S as SettleParams, G as GetOperatorInfoOptions, aN as GetVtxosOptions, aO as PaginationOptions, e as GetVtxosFilter, f as GetSpendableVtxosFilter, aP as CreateContractParams, aQ as GetContractsFilter, V as VirtualCoin, aR as GetSpendablePathsOptions, aS as GetAllSpendingPathsOptions, k as GetNewAddressesOptions, aT as InputExpiryFloor, aU as IssuanceParams, aV as ReissuanceParams, aW as BurnParams, aX as RenewVtxosOptions, p as SendOnchainParams, O as OperatorInfo, aY as NormalizedVtxoPage, A as ArkadeReader, c as ArkadeBroadcaster, d as WalletBalance, am as ContractSyncState, aq as ContractWithVtxos, aZ as WatchedScript, a_ as PathSelection, l as NewAddress, a$ as ContractEvent, b0 as AssetDetails, b1 as IssuanceResult, b2 as DelegateInfo, b3 as MigrationGlobalSkipReason, b4 as MigrationLegSkipReason, b5 as SignerStatus, ae as IReadonlyWallet, h as ActivityRegistry, al as IReadonlyAssetManager, b6 as StorageConfig, i as Activity, j as IContractManager, q as IAssetManager, o as SendParams, m as IDelegateManager, b7 as IVtxoManager, a3 as Network, as as Coin, b8 as SendBitcoinParams, b9 as ExplorerTransaction, aB as SignedProof, aC as Proof, ba as TreeNonces, bb as TreePartialSigs, T as TxNotificationEvent, bc as PendingTx, bd as EmulatorProvider, be as Status, bf as ChainTx, w as IndexerProvider, a6 as TxTree, bg as ArkadeService, bh as ContractVtxoEvent, bi as ExtendedContractVtxo, bj as ResolvedArkadeService, bk as resolveArkadeService, bl as PathContext } from './index-C66rjxz2.js';
|
|
2
|
+
export { bm as ActivityIntent, bn as ActivityResolver, bo as ArkIntent, bp as ArkIntentState, v as ArkProvider, bq as ArkadeInfo, br as AssetMetadata, bs as BATCH_REGISTRATION_TERMINAL_STATES, bt as BITCOIN_EMULATOR_PUBKEY, bu as BaseWalletConfig, aa as BatchFailedEvent, a8 as BatchFinalizationEvent, a9 as BatchFinalizedEvent, bv as BatchInfo, bw as BatchRegistrationFilter, bx as BatchRegistrationState, by as BatchSignableIdentity, a4 as BatchStartedEvent, bz as CandidateDeps, bA as ChainTxType, a2 as ChainedTxType, bB as CommitmentTx, bC as ConnectorTreeNode, bD as ContractBalance, bE as ContractEventCallback, bF as ContractHandler, at as ContractManager, au as ContractManagerConfig, bG as ContractScope, bH as ContractState, bI as ContractVtxo, bJ as ContractWatcher, bK as ContractWatcherEventCallback, bL as DEFAULT_ARKADE_EMULATOR_URL, bM as DEFAULT_VTXO_PAGE_SIZE, bN as DelegateManagerImpl, bO as DelegateOptions, ah as DelegateProvider, bP as DeprecatedSignerMigrationReport, bQ as DeprecatedSignerReport, bR as DigestMismatchError, bS as Discoverable, bT as DiscoveredContract, bU as DiscoveryDeps, bV as ESPLORA_URL, bW as EmulatorInfo, ao as EsploraProvider, bX as EventSourceCapable, bY as EventSourceFactory, bZ as EventSourceLike, b_ as EventSourceUnavailableError, aj as ExitCaptureMode, b$ as ExitChainResolver, ak as ExitDataSource, c0 as GetArkadeInfoOptions, c1 as GetUtxosOptions, c2 as GroupMembership, c3 as HandlerError, c4 as INTENT_TERMINAL_STATES, c5 as IndexerTxType, c6 as IndexerUtxo, c7 as IndexerUtxosUnsupportedError, aA as Intent, c8 as IntentCoin, c9 as IntentFilter, ca as IntentPageFilter, cb as IntentRepository, 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, 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, ai as ReadonlyWalletConfig, an as RecipientArkadeAddressContext, cw as RenewalSplit, cx as RenewalSplitContext, cy as RestArkProvider, cz as RestDelegateProvider, cA as RestEmulatorProvider, s as RestIndexerProvider, r as RestOperatorProvider, cB as ScanContractsOptions, cC as ScanResult, cD as ScheduledSession, cE as SettlementEventType, cF as SignRequest, az as SignedIntent, cG as SignerClassification, cH as SignerSet, t as SubscriptionEvent, cI as SubscriptionFilter, u as SubscriptionHeartbeat, cJ as SubscriptionResponse, cK as SweepTxNotification, cL as TapLeaves, aD as TimeHeight, a7 as TreeNoncesEvent, ac as TreeSignatureEvent, cM as TreeSignerSession, a5 as TreeSigningStartedEvent, ab 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, aw 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-C66rjxz2.js';
|
|
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-DiBM4GmB.js';
|
|
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-DiBM4GmB.js';
|
|
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.js';
|
|
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.js';
|
|
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-2wKMrT0a.js';
|
|
8
|
+
import { D as DefaultVtxo } from './delegate-iyDum4fw.js';
|
|
9
|
+
export { a as DelegateVtxo } from './delegate-iyDum4fw.js';
|
|
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-BARSNg3X.js';
|
|
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
|
-
*
|
|
24
|
-
*
|
|
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.
|
|
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.
|
|
34
43
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
+
}>;
|
|
48
76
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* `descriptor` is the wildcard template (see
|
|
52
|
-
* {@link SerializedSigningIdentity}).
|
|
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.
|
|
53
79
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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.
|
|
73
|
-
*/
|
|
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
|
-
*
|
|
86
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
102
|
+
* // Create from hex string
|
|
103
|
+
* const key = SingleKey.fromHex('your_private_key_hex');
|
|
146
104
|
*
|
|
147
|
-
* //
|
|
148
|
-
* const
|
|
105
|
+
* // Create from raw bytes
|
|
106
|
+
* const key = SingleKey.fromPrivateKey(privateKeyBytes);
|
|
149
107
|
*
|
|
150
|
-
* //
|
|
151
|
-
* const
|
|
108
|
+
* // Create random key
|
|
109
|
+
* const randomKey = SingleKey.fromRandomBytes();
|
|
152
110
|
*
|
|
153
|
-
* //
|
|
154
|
-
* const
|
|
111
|
+
* // Sign a transaction
|
|
112
|
+
* const signedTx = await key.sign(transaction);
|
|
155
113
|
* ```
|
|
156
114
|
*/
|
|
157
|
-
declare class
|
|
158
|
-
private
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
*
|
|
171
|
-
* derivation, or `{ descriptor }` for a template ending in `/*)`.
|
|
125
|
+
* Export the private key as a hex string.
|
|
172
126
|
*
|
|
173
|
-
* @
|
|
127
|
+
* @returns The private key as a hex string
|
|
174
128
|
*/
|
|
175
|
-
|
|
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
|
|
182
|
-
*
|
|
183
|
-
*
|
|
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
|
-
|
|
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
|
-
|
|
210
|
-
|
|
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
|
-
*
|
|
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
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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
|
-
|
|
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
|
|
387
|
+
declare class InMemoryBatchRegistrationRepository implements BatchRegistrationRepository {
|
|
439
388
|
readonly version: 1;
|
|
440
389
|
private byId;
|
|
441
390
|
clear(): Promise<void>;
|
|
442
|
-
|
|
443
|
-
|
|
391
|
+
saveBatchRegistration(intent: BatchRegistration): Promise<void>;
|
|
392
|
+
getBatchRegistrationsPage(filter: BatchRegistrationPageFilter | undefined, page: PageRequest): Promise<PageResult<BatchRegistration>>;
|
|
444
393
|
getLockedVtxoOutpoints(): Promise<Outpoint[]>;
|
|
394
|
+
/** @deprecated Use {@link saveBatchRegistration}. */
|
|
395
|
+
saveIntent(intent: BatchRegistration): Promise<void>;
|
|
396
|
+
/** @deprecated Use {@link getBatchRegistrationsPage}. */
|
|
397
|
+
getIntentsPage(filter: BatchRegistrationPageFilter | 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
|
|
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
|
|
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
|
-
|
|
492
|
-
|
|
448
|
+
saveBatchRegistration(intent: BatchRegistration): Promise<void>;
|
|
449
|
+
getBatchRegistrationsPage(filter: BatchRegistrationPageFilter | undefined, page: PageRequest): Promise<PageResult<BatchRegistration>>;
|
|
493
450
|
getLockedVtxoOutpoints(): Promise<Outpoint[]>;
|
|
451
|
+
/** @deprecated Use {@link saveBatchRegistration}. */
|
|
452
|
+
saveIntent(intent: BatchRegistration): Promise<void>;
|
|
453
|
+
/** @deprecated Use {@link getBatchRegistrationsPage}. */
|
|
454
|
+
getIntentsPage(filter: BatchRegistrationPageFilter | 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:
|
|
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:
|
|
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
|
-
*
|
|
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
|
-
*
|
|
706
|
-
*
|
|
707
|
-
*
|
|
708
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
-
* @
|
|
868
|
+
* @param phrase - BIP39 mnemonic phrase (12 or 24 words)
|
|
731
869
|
*/
|
|
732
|
-
|
|
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
|
-
*
|
|
740
|
-
*
|
|
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
|
-
*
|
|
743
|
-
*
|
|
744
|
-
*
|
|
745
|
-
*
|
|
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
|
|
762
|
-
*
|
|
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
|
|
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;
|
|
@@ -1043,7 +1189,7 @@ type Options = {
|
|
|
1043
1189
|
*
|
|
1044
1190
|
* Ignored when `buildServices` is supplied — that override owns `storage`.
|
|
1045
1191
|
*/
|
|
1046
|
-
intentRepository?:
|
|
1192
|
+
intentRepository?: BatchRegistrationRepository;
|
|
1047
1193
|
/** The worker wallet's onchain provider, per network: an instance cannot cross `postMessage`.
|
|
1048
1194
|
* Called on every init and never closed, so return one instance per network. Defaults to
|
|
1049
1195
|
* Esplora; ignored when `buildServices` is supplied. */
|
|
@@ -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,14 +2243,14 @@ type ResponseGetBoardingAddress = ResponseEnvelope & {
|
|
|
2093
2243
|
address: string;
|
|
2094
2244
|
};
|
|
2095
2245
|
};
|
|
2096
|
-
type
|
|
2097
|
-
type: "GET_ARKADE_INFO";
|
|
2098
|
-
payload?:
|
|
2246
|
+
type RequestGetOperatorInfo = RequestEnvelope & {
|
|
2247
|
+
type: "GET_OPERATOR_INFO" | "GET_ARKADE_INFO";
|
|
2248
|
+
payload?: GetOperatorInfoOptions;
|
|
2099
2249
|
};
|
|
2100
|
-
type
|
|
2101
|
-
type: "
|
|
2250
|
+
type ResponseGetOperatorInfo = ResponseEnvelope & {
|
|
2251
|
+
type: "OPERATOR_INFO";
|
|
2102
2252
|
payload: {
|
|
2103
|
-
info:
|
|
2253
|
+
info: OperatorInfo;
|
|
2104
2254
|
};
|
|
2105
2255
|
};
|
|
2106
2256
|
type RequestIndexerGetVtxos = RequestEnvelope & {
|
|
@@ -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 |
|
|
2791
|
-
type WalletUpdaterResponse = ResponseEnvelope & (ResponseInitWallet | ResponseSettle | ResponseSettleEvent | ResponseGetAddress | ResponseGetBoardingAddress |
|
|
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
|
|
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
|
-
/**
|
|
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
|
|
3309
|
+
* The payload crosses raw — see {@link ResponseGetOperatorInfo} for why.
|
|
3141
3310
|
*/
|
|
3142
|
-
|
|
3311
|
+
getOperatorInfo(opts?: GetOperatorInfoOptions): Promise<OperatorInfo>;
|
|
3312
|
+
/** @deprecated Use {@link getOperatorInfo}. */
|
|
3313
|
+
getArkadeInfo(opts?: GetOperatorInfoOptions): Promise<OperatorInfo>;
|
|
3143
3314
|
/**
|
|
3144
3315
|
* An {@link ArkadeReader} that speaks to the worker rather than to the
|
|
3145
|
-
*
|
|
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,19 +3949,20 @@ 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;
|
|
3775
3956
|
get serverUrl(): string | undefined;
|
|
3776
|
-
getInfo(): Promise<
|
|
3957
|
+
getInfo(): Promise<OperatorInfo>;
|
|
3777
3958
|
submitTx(signedArkTx: string, checkpointTxs: string[]): Promise<{
|
|
3778
3959
|
arkTxid: string;
|
|
3779
3960
|
finalArkTx: string;
|
|
3780
3961
|
signedCheckpointTxs: string[];
|
|
3781
3962
|
}>;
|
|
3782
3963
|
finalizeTx(arkTxid: string, finalCheckpointTxs: string[]): Promise<void>;
|
|
3783
|
-
registerIntent(intent:
|
|
3784
|
-
deleteIntent(intent:
|
|
3964
|
+
registerIntent(intent: SignedProof<Proof.RegisterMessage>): Promise<string>;
|
|
3965
|
+
deleteIntent(intent: SignedProof<Proof.DeleteMessage>): Promise<void>;
|
|
3785
3966
|
confirmRegistration(intentId: string): Promise<void>;
|
|
3786
3967
|
submitTreeNonces(batchId: string, pubkey: string, nonces: TreeNonces): Promise<void>;
|
|
3787
3968
|
submitTreeSignatures(batchId: string, pubkey: string, signatures: TreePartialSigs): Promise<void>;
|
|
@@ -3789,7 +3970,7 @@ declare class CachingOperatorProvider implements OperatorProvider {
|
|
|
3789
3970
|
getEventStream(signal: AbortSignal, topics: string[]): AsyncIterableIterator<SettlementEvent>;
|
|
3790
3971
|
getTransactionsStream(signal: AbortSignal): AsyncIterableIterator<TxNotificationEvent>;
|
|
3791
3972
|
getPendingTxs(intent: SignedProof<Proof.GetPendingTxMessage>): Promise<PendingTx[]>;
|
|
3792
|
-
onServerInfoChanged(listener: (info:
|
|
3973
|
+
onServerInfoChanged(listener: (info: OperatorInfo) => void): () => void;
|
|
3793
3974
|
}
|
|
3794
3975
|
/** @deprecated Use {@link CachingOperatorProvider}. */
|
|
3795
3976
|
declare const CachingArkProvider: typeof CachingOperatorProvider;
|
|
@@ -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
|
|
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
|
|
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[],
|
|
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
|
|
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
|
|
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;
|
|
@@ -5559,15 +5703,17 @@ interface ArkadeSpendResult {
|
|
|
5559
5703
|
}
|
|
5560
5704
|
/** The callable spending paths of a contract. */
|
|
5561
5705
|
type CallableFunctions = Record<string, (...args: ArkadeNestedValue[]) => ArkadeTransactionBuilder>;
|
|
5562
|
-
/** What {@link Arkade} needs from the
|
|
5563
|
-
type ArkadeServerProvider = Pick<OperatorProvider, "getInfo"> & Partial<ArkadeBroadcaster
|
|
5706
|
+
/** What {@link Arkade} needs from the operator; see {@link ArkadeConnectOptions.arkade}. */
|
|
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
|
|
5570
|
-
* reports on `getInfo` — or the SDK default when the
|
|
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
|
|
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.
|
|
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 (
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
6820
|
+
export { ARKADE_MAGIC, ARKADE_SALTED_PREIMAGE_TAG, ARKADE_SWAP_PREIMAGE_TAG, ASSET_CARRIER_SATS, Activity, ActivityRegistry, AddressAllocationCapable, AmbiguousRouteError, type AnchorBumper, ArkAddress, ArkNote, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, Arkade, type ArkadeBatchInput, ArkadeBroadcaster, ArkadeCash, ArkadeContractParams, type ArkadeExtendedCoin, type ArkadeExtendedVirtualCoin, ArkadeReader, ArkadeService, Asset, AssetDetails, AssetManager, AtomicWalletState, BIP21, BIP21Error, type BIP21Params, type BIP21ParseResult, BIP322, BLOCKED_UPGRADE_TIMEOUT_MS, Batch, BatchExpiryPolicy, BatchRegistration, BatchRegistrationPageFilter, 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, IntentFeeConfig, 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, OperatorInfo, 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, 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 };
|