@arkade-os/sdk 0.4.43 → 0.4.45
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 +100 -0
- package/dist/adapters/expo.cjs +4 -4
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +2 -2
- package/dist/adapters/indexedDB.cjs +3 -3
- package/dist/adapters/indexedDB.js +2 -2
- package/dist/{ark-I8jfe5VE.d.cts → ark-C-PjOngm.d.cts} +89 -1
- package/dist/{ark-I8jfe5VE.d.ts → ark-C-PjOngm.d.ts} +89 -1
- package/dist/{asyncStorageTaskQueue-D1FfHfgK.d.cts → asyncStorageTaskQueue-BmBPvTyh.d.cts} +1 -1
- package/dist/{asyncStorageTaskQueue-CjoL-35w.d.ts → asyncStorageTaskQueue-CHpI3moJ.d.ts} +1 -1
- package/dist/{chunk-VKKLOT2E.js → chunk-BOA4SHCD.js} +3 -3
- package/dist/{chunk-VKKLOT2E.js.map → chunk-BOA4SHCD.js.map} +1 -1
- package/dist/{chunk-PLJZRIFZ.cjs → chunk-HZ7VIN7P.cjs} +11 -11
- package/dist/{chunk-PLJZRIFZ.cjs.map → chunk-HZ7VIN7P.cjs.map} +1 -1
- package/dist/{chunk-JIWCE2IK.cjs → chunk-OFQGANH2.cjs} +7 -7
- package/dist/{chunk-JIWCE2IK.cjs.map → chunk-OFQGANH2.cjs.map} +1 -1
- package/dist/{chunk-US274KZO.js → chunk-QZ6HZZZK.js} +3 -3
- package/dist/{chunk-US274KZO.js.map → chunk-QZ6HZZZK.js.map} +1 -1
- package/dist/{chunk-QGNTDGMN.cjs → chunk-SRCWBFSZ.cjs} +1945 -357
- package/dist/chunk-SRCWBFSZ.cjs.map +1 -0
- package/dist/{chunk-B4R36PRN.js → chunk-TGRJ5WAX.js} +1868 -285
- package/dist/chunk-TGRJ5WAX.js.map +1 -0
- package/dist/{chunk-3AQNLQPM.cjs → chunk-UHOHLN3C.cjs} +119 -69
- package/dist/chunk-UHOHLN3C.cjs.map +1 -0
- package/dist/{chunk-763XHDAJ.js → chunk-YBQV7XBC.js} +119 -70
- package/dist/chunk-YBQV7XBC.js.map +1 -0
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/{delegate-CgjVjYOP.d.ts → delegate-BKNqva1j.d.ts} +1 -1
- package/dist/{delegate-BRqbh2fW.d.cts → delegate-DOEobYwH.d.cts} +1 -1
- package/dist/{index-DHuXlDEg.d.cts → index-BlW4I30l.d.cts} +2 -2
- package/dist/{index-DvWNB_rl.d.ts → index-Cm2fGeox.d.ts} +2 -2
- package/dist/index.cjs +150 -126
- package/dist/index.d.cts +275 -19
- package/dist/index.d.ts +275 -19
- package/dist/index.js +2 -2
- package/dist/repositories/realm/index.cjs +17 -17
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/realm/index.js +3 -3
- package/dist/repositories/sqlite/index.cjs +16 -16
- package/dist/repositories/sqlite/index.d.cts +2 -2
- package/dist/repositories/sqlite/index.d.ts +2 -2
- package/dist/repositories/sqlite/index.js +3 -3
- package/dist/{taskRunner-Djlhfgi1.d.ts → taskRunner-BngWSFMi.d.ts} +1 -1
- package/dist/{taskRunner-BSnslNmq.d.cts → taskRunner-DOiyRuJa.d.cts} +1 -1
- package/dist/wallet/expo/background.cjs +12 -12
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +4 -4
- package/dist/wallet/expo/index.cjs +21 -12
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +11 -4
- package/dist/wallet/expo/index.d.ts +11 -4
- package/dist/wallet/expo/index.js +12 -3
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/{wallet-BsqRU8KM.d.cts → wallet-B3awP1Nj.d.ts} +105 -3
- package/dist/{wallet-D9z7wssl.d.ts → wallet-DBjumS42.d.cts} +105 -3
- package/dist/worker/expo/index.cjs +7 -7
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-3AQNLQPM.cjs.map +0 -1
- package/dist/chunk-763XHDAJ.js.map +0 -1
- package/dist/chunk-B4R36PRN.js.map +0 -1
- package/dist/chunk-QGNTDGMN.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { K as ReadonlyIdentity, a as Identity,
|
|
2
|
-
export {
|
|
3
|
-
export { 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 contractHandlers } from './index-
|
|
4
|
-
export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-
|
|
5
|
-
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-
|
|
6
|
-
export { B as Batch, d as BoardingUtxoGroup, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-
|
|
1
|
+
import { K as ReadonlyIdentity, a as Identity, ai as DescriptorSigningRequest, aj as Transaction, a6 as SignerSession, P as IntentRepository, ac as ArkIntent, ad as IntentFilter, ae as Outpoint, Q as VirtualTxRepository, af as VirtualTx, ag as VtxoBranch, W as WalletRepository, E as ExtendedVirtualCoin, a9 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, aa as WalletState, t as Contract, C as ContractRepository, ab as ContractFilter, ak as IntentFeeConfig, al as OffchainInput, am as FeeAmount, an as OnchainInput, ao as FeeOutput, o as ArkProvider, a4 as SettlementConfig, ap as ContractWatcherConfig, I as IWallet, aq as FeeInfo, j as SettlementEvent, H as DescriptorProvider, i as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, ar as CreateContractParams, as as GetContractsFilter, s as VirtualCoin, at as GetSpendablePathsOptions, au as GetAllSpendingPathsOptions, R as Recipient, av as IssuanceParams, aw as ReissuanceParams, ax as BurnParams, ay as RenewVtxosOptions, c as WalletBalance, Z as ContractSyncState, az as ContractWithVtxos, aA as PathSelection, aB as ContractEvent, aC as AssetDetails, aD as IssuanceResult, aE as DelegateInfo, aF as MigrationGlobalSkipReason, aG as MigrationLegSkipReason, aH as SignerStatus, J as IReadonlyWallet, e as ActivityRegistry, Y as IReadonlyAssetManager, aI as StorageConfig, f as Activity, g as IContractManager, k as IAssetManager, h as IDelegateManager, aJ as IVtxoManager, O as OnchainProvider, N as Network, _ as NetworkName, a1 as Coin, aK as ExplorerTransaction, r as TapLeafScript, aL as EncodedVtxoScript, a3 as CSVMultisigTapscript, q as RelativeTimelock, V as VtxoScript, aM as Status, aN as ChainTx, p as IndexerProvider, v as TxTree, aO as PathContext } from './ark-C-PjOngm.cjs';
|
|
2
|
+
export { aP as ActivityIntent, aQ as ActivityResolver, a0 as ArkAddress, $ as ArkInfo, aR as ArkIntentState, aS as ArkTapscript, aT as Asset, aU as AssetMetadata, aV as BaseWalletConfig, z as BatchFailedEvent, x as BatchFinalizationEvent, y as BatchFinalizedEvent, aW as BatchInfo, aX as BatchSignableIdentity, B as BatchStartedEvent, aY as CLTVMultisigTapscript, aZ as ChainTxType, ah as ChainedTxType, a_ as CommitmentTx, a$ as ConditionCSVMultisigTapscript, b0 as ConditionMultisigTapscript, b1 as ContractBalance, b2 as ContractEventCallback, b3 as ContractHandler, a2 as ContractManager, b4 as ContractManagerConfig, b5 as ContractState, b6 as ContractVtxo, b7 as ContractWatcher, b8 as DelegateManagerImpl, b9 as DelegateOptions, L as DelegateProvider, ba as DelegatorManagerImpl, bb as DelegatorProvider, bc as DeprecatedSignerMigrationReport, bd as DeprecatedSignerReport, be as DigestMismatchError, bf as Discoverable, bg as DiscoveredContract, bh as DiscoveryDeps, bi as ESPLORA_URL, bj as EsploraProvider, U as ExitCaptureMode, bk as ExitChainResolver, X as ExitDataSource, bl as ExtendedContractVtxo, bm as GroupMembership, bn as HandlerError, bo as IDelegatorManager, bp as INTENT_TERMINAL_STATES, bq as IndexerTxType, a8 as Intent, br as KnownMetadata, bs as MigrateDeprecatedSignerOptions, bt as MigrationLegReport, bu as MigrationVtxoRef, bv as MultisigTapscript, bw as Nonces, bx as Output, by as PageResponse, bz as PaginationOptions, bA as PartialSig, bB as ProviderClass, M as ReadonlyWalletConfig, l as RestArkProvider, bC as RestDelegateProvider, bD as RestDelegatorProvider, m as RestIndexerProvider, bE as ScanContractsOptions, bF as ScanResult, bG as ScheduledSession, bH as SettlementEventType, bI as SignRequest, a7 as SignedIntent, bJ as SignerClassification, bK as SignerSet, bL as SubscriptionEvent, bM as SubscriptionHeartbeat, n as SubscriptionResponse, bN as TapLeaves, bO as TapTreeCoder, bP as TapscriptType, bQ as TreeNonces, w as TreeNoncesEvent, bR as TreePartialSigs, F as TreeSignatureEvent, u as TreeSigningStartedEvent, D as TreeTxEvent, bS as Tx, bT as TxHistoryRecord, bU as TxKey, T as TxNotification, bV as TxTreeNode, bW as TxType, bX as VirtualStatus, bY as Vtxo, bZ as VtxoChain, a5 as VtxoManager, b_ as VtxoType, b as WalletConfig, b$ as WalletMode, c0 as boardingResolver, c1 as classifyAgainstSignerSet, c2 as classifyContractSigner, c3 as createDefaultActivityRegistry, c4 as createExitChainResolver, c5 as decodeTapscript, c6 as getNetwork, c7 as getSequence, c8 as isBatchSignable, c9 as isCooperativelyMigratable, ca as isDiscoverable, cb as isExpired, cc as isRecoverable, cd as isSpendable, ce as isSubdust, cf as isTerminalIntentState, cg as isVtxoExpiringSoon, ch as networks, ci as signerSetFromInfo, cj as toXOnlySignerHex } from './ark-C-PjOngm.cjs';
|
|
3
|
+
export { 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 contractHandlers } from './index-BlW4I30l.cjs';
|
|
4
|
+
export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-DOEobYwH.cjs';
|
|
5
|
+
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot, P as ProviderConnectionState } from './wallet-DBjumS42.cjs';
|
|
6
|
+
export { A as ArkError, B as Batch, d as BoardingUtxoGroup, I as IncomingFunds, e as ProviderKind, f as ProviderUnavailableError, S as ServerInfoSource, m as maybeArkError, w as waitForIncomingFunds } from './wallet-DBjumS42.cjs';
|
|
7
7
|
import { Bytes, BTC_NETWORK } from '@scure/btc-signer/utils.js';
|
|
8
8
|
import { P2TR } from '@scure/btc-signer/payment.js';
|
|
9
9
|
import { Transaction as Transaction$1 } from '@scure/btc-signer';
|
|
@@ -1379,6 +1379,16 @@ type ResponseGetStatus = ResponseEnvelope & {
|
|
|
1379
1379
|
payload: {
|
|
1380
1380
|
walletInitialized: boolean;
|
|
1381
1381
|
xOnlyPublicKey: Uint8Array | undefined;
|
|
1382
|
+
providerConnectionState?: ProviderConnectionState;
|
|
1383
|
+
};
|
|
1384
|
+
};
|
|
1385
|
+
type RequestGetContractSyncState = RequestEnvelope & {
|
|
1386
|
+
type: "GET_CONTRACT_SYNC_STATE";
|
|
1387
|
+
};
|
|
1388
|
+
type ResponseGetContractSyncState = ResponseEnvelope & {
|
|
1389
|
+
type: "CONTRACT_SYNC_STATE";
|
|
1390
|
+
payload: {
|
|
1391
|
+
syncState: ContractSyncState;
|
|
1382
1392
|
};
|
|
1383
1393
|
};
|
|
1384
1394
|
type RequestClear = RequestEnvelope & {
|
|
@@ -1801,8 +1811,8 @@ type RequestRestoreWallet = RequestEnvelope & {
|
|
|
1801
1811
|
type ResponseRestoreWallet = ResponseEnvelope & {
|
|
1802
1812
|
type: "RESTORE_WALLET_SUCCESS";
|
|
1803
1813
|
};
|
|
1804
|
-
type WalletUpdaterRequest = RequestInitWallet | RequestSettle | RequestSendBitcoin | RequestGetAddress | RequestGetBoardingAddress | RequestGetBalance | RequestGetVtxos | RequestGetBoardingUtxos | RequestGetTransactionHistory | RequestGetStatus | RequestClear | RequestReloadWallet | RequestSignTransaction | RequestCreateContract | RequestGetContracts | RequestGetContractsWithVtxos | RequestAnnotateVtxos | RequestUpdateContract | RequestDeleteContract | RequestGetSpendablePaths | RequestGetAllSpendingPaths | RequestIsContractManagerWatching | RequestRefreshVtxos | RequestRefreshOutpoints | RequestSend | RequestGetAssetDetails | RequestIssue | RequestReissue | RequestBurn | RequestDelegate | RequestGetDelegateInfo | RequestRecoverVtxos | RequestGetRecoverableBalance | RequestGetExpiringVtxos | RequestRenewVtxos | RequestGetExpiredBoardingUtxos | RequestSweepExpiredBoardingUtxos | RequestMigrateDeprecatedSignerVtxos | RequestGetDeprecatedSignerStatus | RequestRestoreWallet;
|
|
1805
|
-
type WalletUpdaterResponse = ResponseEnvelope & (ResponseInitWallet | ResponseSettle | ResponseSettleEvent | ResponseSendBitcoin | ResponseGetAddress | ResponseGetBoardingAddress | ResponseGetBalance | ResponseGetVtxos | ResponseGetBoardingUtxos | ResponseGetTransactionHistory | ResponseGetStatus | ResponseClear | ResponseReloadWallet | ResponseUtxoUpdate | ResponseVtxoUpdate | ResponseSignTransaction | ResponseCreateContract | ResponseGetContracts | ResponseGetContractsWithVtxos | ResponseAnnotateVtxos | ResponseUpdateContract | ResponseDeleteContract | ResponseGetSpendablePaths | ResponseGetAllSpendingPaths | ResponseIsContractManagerWatching | ResponseRefreshVtxos | ResponseRefreshOutpoints | ResponseContractEvent | ResponseSend | ResponseGetAssetDetails | ResponseIssue | ResponseReissue | ResponseBurn | ResponseDelegate | ResponseGetDelegateInfo | ResponseRecoverVtxos | ResponseRecoverVtxosEvent | ResponseGetRecoverableBalance | ResponseGetExpiringVtxos | ResponseRenewVtxos | ResponseRenewVtxosEvent | ResponseGetExpiredBoardingUtxos | ResponseSweepExpiredBoardingUtxos | ResponseMigrateDeprecatedSignerVtxos | ResponseMigrateDeprecatedSignerVtxosEvent | ResponseGetDeprecatedSignerStatus | ResponseRestoreWallet);
|
|
1814
|
+
type WalletUpdaterRequest = RequestInitWallet | RequestSettle | RequestSendBitcoin | RequestGetAddress | RequestGetBoardingAddress | RequestGetBalance | RequestGetVtxos | RequestGetBoardingUtxos | RequestGetTransactionHistory | RequestGetStatus | RequestGetContractSyncState | RequestClear | RequestReloadWallet | RequestSignTransaction | RequestCreateContract | RequestGetContracts | RequestGetContractsWithVtxos | RequestAnnotateVtxos | RequestUpdateContract | RequestDeleteContract | RequestGetSpendablePaths | RequestGetAllSpendingPaths | RequestIsContractManagerWatching | RequestRefreshVtxos | RequestRefreshOutpoints | RequestSend | RequestGetAssetDetails | RequestIssue | RequestReissue | RequestBurn | RequestDelegate | RequestGetDelegateInfo | RequestRecoverVtxos | RequestGetRecoverableBalance | RequestGetExpiringVtxos | RequestRenewVtxos | RequestGetExpiredBoardingUtxos | RequestSweepExpiredBoardingUtxos | RequestMigrateDeprecatedSignerVtxos | RequestGetDeprecatedSignerStatus | RequestRestoreWallet;
|
|
1815
|
+
type WalletUpdaterResponse = ResponseEnvelope & (ResponseInitWallet | ResponseSettle | ResponseSettleEvent | ResponseSendBitcoin | ResponseGetAddress | ResponseGetBoardingAddress | ResponseGetBalance | ResponseGetVtxos | ResponseGetBoardingUtxos | ResponseGetTransactionHistory | ResponseGetStatus | ResponseGetContractSyncState | ResponseClear | ResponseReloadWallet | ResponseUtxoUpdate | ResponseVtxoUpdate | ResponseSignTransaction | ResponseCreateContract | ResponseGetContracts | ResponseGetContractsWithVtxos | ResponseAnnotateVtxos | ResponseUpdateContract | ResponseDeleteContract | ResponseGetSpendablePaths | ResponseGetAllSpendingPaths | ResponseIsContractManagerWatching | ResponseRefreshVtxos | ResponseRefreshOutpoints | ResponseContractEvent | ResponseSend | ResponseGetAssetDetails | ResponseIssue | ResponseReissue | ResponseBurn | ResponseDelegate | ResponseGetDelegateInfo | ResponseRecoverVtxos | ResponseRecoverVtxosEvent | ResponseGetRecoverableBalance | ResponseGetExpiringVtxos | ResponseRenewVtxos | ResponseRenewVtxosEvent | ResponseGetExpiredBoardingUtxos | ResponseSweepExpiredBoardingUtxos | ResponseMigrateDeprecatedSignerVtxos | ResponseMigrateDeprecatedSignerVtxosEvent | ResponseGetDeprecatedSignerStatus | ResponseRestoreWallet);
|
|
1806
1816
|
declare class WalletMessageHandler implements MessageHandler<WalletUpdaterRequest, WalletUpdaterResponse> {
|
|
1807
1817
|
readonly messageTag: string;
|
|
1808
1818
|
private wallet;
|
|
@@ -2095,6 +2105,13 @@ declare class ServiceWorkerReadonlyWallet implements IReadonlyWallet {
|
|
|
2095
2105
|
* @returns Current service-worker wallet status payload including `walletInitalized` and `xOnlyPublicKey`
|
|
2096
2106
|
*/
|
|
2097
2107
|
getStatus(): Promise<ResponseGetStatus["payload"]>;
|
|
2108
|
+
/**
|
|
2109
|
+
* Wallet-level provider-connection freshness, delegated to the worker via
|
|
2110
|
+
* `GET_STATUS`. Async by necessity (the worker boundary is asynchronous); no
|
|
2111
|
+
* synchronous variant is offered because it would have the same transport
|
|
2112
|
+
* mismatch as the contract-manager proxy's cached `getSyncState()`.
|
|
2113
|
+
*/
|
|
2114
|
+
getProviderConnectionState(): Promise<ProviderConnectionState>;
|
|
2098
2115
|
getActivityHistory(): Promise<Activity[]>;
|
|
2099
2116
|
getTransactionHistory(): Promise<ArkTransaction[]>;
|
|
2100
2117
|
getVtxos(filter?: GetVtxosFilter): Promise<ExtendedVirtualCoin[]>;
|
|
@@ -2254,6 +2271,27 @@ declare class OnchainWallet implements AnchorBumper {
|
|
|
2254
2271
|
* @see send
|
|
2255
2272
|
*/
|
|
2256
2273
|
bumpP2A(parent: Transaction): Promise<[string, string]>;
|
|
2274
|
+
/**
|
|
2275
|
+
* Build and sign a CPFP fee child for a parent tx (given as raw hex)
|
|
2276
|
+
* carrying a P2A anchor, funding it from this wallet's **confirmed**
|
|
2277
|
+
* coins, and return the 1P1C package hexes WITHOUT broadcasting.
|
|
2278
|
+
*
|
|
2279
|
+
* This is the graph-mode fee source ({@link ExitFeeWallet}): the exit
|
|
2280
|
+
* executor calls it to bump each transported virtual tx at execution
|
|
2281
|
+
* time, so funding can be deferred rather than pre-signed.
|
|
2282
|
+
*
|
|
2283
|
+
* @param parentHex - Finalized parent transaction, raw network hex
|
|
2284
|
+
* @param feeRate - sat/vB floor for the package (raised to MIN_FEE_RATE)
|
|
2285
|
+
* @returns Tuple of parent hex (unchanged) and signed child hex
|
|
2286
|
+
* @throws If the parent has no anchor, or funding cannot be selected/signed
|
|
2287
|
+
*/
|
|
2288
|
+
bumpAnchor(parentHex: string, feeRate: number): Promise<[string, string]>;
|
|
2289
|
+
/**
|
|
2290
|
+
* Shared core of {@link bumpP2A} and {@link bumpAnchor}: probe the package
|
|
2291
|
+
* fee with a single-input child, select coins for it, then build and sign
|
|
2292
|
+
* with the actual selection (the fee grows per extra input).
|
|
2293
|
+
*/
|
|
2294
|
+
private buildBumpPackage;
|
|
2257
2295
|
}
|
|
2258
2296
|
|
|
2259
2297
|
type SetupServiceWorkerOptions = {
|
|
@@ -3013,19 +3051,237 @@ declare namespace Unroll {
|
|
|
3013
3051
|
function completeUnroll(wallet: Wallet, vtxoTxids: string[], outputAddress: string): Promise<string>;
|
|
3014
3052
|
}
|
|
3015
3053
|
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3054
|
+
/** Relative delay before a sweep becomes valid, decoded from BIP-68. */
|
|
3055
|
+
type ExitDelay = {
|
|
3056
|
+
type: "blocks" | "seconds";
|
|
3057
|
+
value: number;
|
|
3058
|
+
};
|
|
3059
|
+
/** Broadcast a single pre-signed transaction (the funding splitter). */
|
|
3060
|
+
type BroadcastStep = {
|
|
3061
|
+
kind: "broadcast";
|
|
3062
|
+
txid: string;
|
|
3063
|
+
hex: string;
|
|
3064
|
+
};
|
|
3065
|
+
/** Broadcast a 1P1C package: virtual tx + its pre-signed CPFP fee child. */
|
|
3066
|
+
type PackageStep = {
|
|
3067
|
+
kind: "package";
|
|
3068
|
+
parentTxid: string;
|
|
3069
|
+
parentHex: string;
|
|
3070
|
+
childTxid: string;
|
|
3071
|
+
childHex: string;
|
|
3072
|
+
/** Outpoints (txid:vout) of the VTXOs this step serves. */
|
|
3073
|
+
forVtxos: string[];
|
|
3074
|
+
};
|
|
3075
|
+
/**
|
|
3076
|
+
* A virtual tx that must go onchain but whose CPFP fee child is NOT
|
|
3077
|
+
* pre-signed (graph mode). The executor builds and signs the child at
|
|
3078
|
+
* execution time using its own fee wallet — this is how "send funds to
|
|
3079
|
+
* this address and we proceed" works: funding is deferred, not baked in.
|
|
3080
|
+
*/
|
|
3081
|
+
type BumpStep = {
|
|
3082
|
+
kind: "bump";
|
|
3083
|
+
parentTxid: string;
|
|
3084
|
+
parentHex: string;
|
|
3085
|
+
/** Outpoints (txid:vout) of the VTXOs this step serves. */
|
|
3086
|
+
forVtxos: string[];
|
|
3087
|
+
};
|
|
3088
|
+
/** Broadcast a pre-signed CSV sweep once its dependency matured. */
|
|
3089
|
+
type SweepStep = {
|
|
3090
|
+
kind: "sweep";
|
|
3091
|
+
vtxo: string;
|
|
3092
|
+
txid: string;
|
|
3093
|
+
hex: string;
|
|
3094
|
+
/** The VTXO-creating leaf tx whose confirmation starts the CSV clock. */
|
|
3095
|
+
dependsOnTxid: string;
|
|
3096
|
+
delay: ExitDelay;
|
|
3097
|
+
};
|
|
3098
|
+
type ExitStep = BroadcastStep | PackageStep | BumpStep | SweepStep;
|
|
3099
|
+
/**
|
|
3100
|
+
* How fee funding is provided:
|
|
3101
|
+
* - `"funded"`: a splitter tx (broadcast at prepare time) pre-funds
|
|
3102
|
+
* pre-signed fee children — execution is fully keyless.
|
|
3103
|
+
* - `"graph"`: only the tx graph + sweeps are transported; the executor
|
|
3104
|
+
* funds and signs the CPFP bumps at execution time from its own fee
|
|
3105
|
+
* wallet ("send funds to this address and we proceed").
|
|
3106
|
+
*/
|
|
3107
|
+
type ExitMode = "funded" | "graph";
|
|
3108
|
+
/** Per-VTXO metadata; skipped VTXOs carry a human-readable reason. */
|
|
3109
|
+
type ExitVtxoInfo = {
|
|
3110
|
+
outpoint: string;
|
|
3111
|
+
value?: number;
|
|
3112
|
+
sweepFee?: number;
|
|
3113
|
+
/** `${contractType}:${pathLabel}` for observability, e.g. "vhtlc:unilateral". */
|
|
3114
|
+
path?: string;
|
|
3115
|
+
delay?: ExitDelay;
|
|
3116
|
+
skipped?: string;
|
|
3117
|
+
};
|
|
3118
|
+
type ExitTotals = {
|
|
3119
|
+
/** Distinct transactions the executor ensures onchain. */
|
|
3120
|
+
txCount: number;
|
|
3121
|
+
totalFeeSats: number;
|
|
3122
|
+
/** Sats consumed from the onchain wallet by the splitter (fees + funding outputs). */
|
|
3123
|
+
fundingRequiredSats: number;
|
|
3124
|
+
/** Sats arriving at the sweep address once all sweeps confirm. */
|
|
3125
|
+
recoveredSats: number;
|
|
3126
|
+
};
|
|
3127
|
+
/**
|
|
3128
|
+
* Versioned, language-agnostic unilateral exit package.
|
|
3129
|
+
* Everything inside is pre-signed; executing it requires no keys and no
|
|
3130
|
+
* Arkade infrastructure — only an Esplora-compatible API.
|
|
3131
|
+
*/
|
|
3132
|
+
type ExitPackage = {
|
|
3133
|
+
version: 1;
|
|
3134
|
+
/** Fee-funding strategy. Absent is treated as "funded" (v1 default). */
|
|
3135
|
+
mode?: ExitMode;
|
|
3136
|
+
network: NetworkName;
|
|
3137
|
+
createdAt: number;
|
|
3138
|
+
/** Min batch expiry (unix seconds) across included txs. Informational. */
|
|
3139
|
+
validUntil?: number;
|
|
3140
|
+
feeRate: number;
|
|
3141
|
+
sweepAddress: string;
|
|
3142
|
+
totals: ExitTotals;
|
|
3143
|
+
vtxos: ExitVtxoInfo[];
|
|
3144
|
+
/** Topologically ordered: a step's txs confirm before dependents proceed. */
|
|
3145
|
+
steps: ExitStep[];
|
|
3146
|
+
};
|
|
3147
|
+
/** Cost/size quote returned by `UnilateralExit.estimate` — no funds needed. */
|
|
3148
|
+
type ExitQuote = {
|
|
3149
|
+
feeRate: number;
|
|
3150
|
+
fundingAddress: string;
|
|
3151
|
+
currentBalanceSats: number;
|
|
3152
|
+
shortfallSats: number;
|
|
3153
|
+
validUntil?: number;
|
|
3154
|
+
totals: ExitTotals;
|
|
3155
|
+
vtxos: ExitVtxoInfo[];
|
|
3156
|
+
};
|
|
3157
|
+
declare function serializeExitPackage(pkg: ExitPackage): string;
|
|
3158
|
+
declare function deserializeExitPackage(json: string): ExitPackage;
|
|
3159
|
+
|
|
3160
|
+
type ExitOptions = {
|
|
3161
|
+
/** Wallet owning the VTXOs: identity (signing) + indexer + onchain provider. */
|
|
3162
|
+
wallet: Wallet;
|
|
3163
|
+
/** Fee funding source and change/funding address. Must share the wallet identity. */
|
|
3164
|
+
onchainWallet: OnchainWallet;
|
|
3165
|
+
/** Destination for the exited funds. */
|
|
3166
|
+
sweepAddress: string;
|
|
3167
|
+
/** sat/vB; defaults to the onchain provider estimate, floored at MIN_FEE_RATE. */
|
|
3168
|
+
feeRate?: number;
|
|
3169
|
+
/** Defaults to all spendable VTXOs. */
|
|
3170
|
+
vtxos?: Outpoint[];
|
|
3171
|
+
/**
|
|
3172
|
+
* Fee-funding strategy (default `"funded"`):
|
|
3173
|
+
* - `"funded"`: broadcast a splitter at prepare time and pre-sign the
|
|
3174
|
+
* fee children — the package executes fully keyless.
|
|
3175
|
+
* - `"graph"`: transport only the tx graph + sweeps; the executor funds
|
|
3176
|
+
* and signs the CPFP bumps at execution time ("send funds to this
|
|
3177
|
+
* address and we proceed"). No splitter, no `onchainWallet` funds used.
|
|
3178
|
+
*/
|
|
3179
|
+
mode?: ExitMode;
|
|
3180
|
+
/**
|
|
3181
|
+
* Network label embedded in the package (executor sanity check).
|
|
3182
|
+
* Resolved from the wallet's network when omitted — exact for
|
|
3183
|
+
* "bitcoin" and "regtest"; the tb-family defaults to "testnet", so
|
|
3184
|
+
* pass this explicitly on signet/mutinynet.
|
|
3185
|
+
*/
|
|
3186
|
+
networkName?: NetworkName;
|
|
3187
|
+
};
|
|
3188
|
+
/**
|
|
3189
|
+
* Quote a unilateral exit: how many transactions, how many sats of fees,
|
|
3190
|
+
* and how much must be deposited to the funding address. Requires no
|
|
3191
|
+
* onchain funds and signs nothing.
|
|
3192
|
+
*/
|
|
3193
|
+
declare function estimate(opts: ExitOptions): Promise<ExitQuote>;
|
|
3194
|
+
|
|
3195
|
+
type ExecutorEvent = {
|
|
3196
|
+
stepIndex: number;
|
|
3197
|
+
kind: ExitStep["kind"];
|
|
3198
|
+
status: "skipped" | "broadcast" | "confirmed" | "waiting_csv" | "failed" | "warning";
|
|
3199
|
+
forVtxos?: string[];
|
|
3200
|
+
txid?: string;
|
|
3201
|
+
reason?: string;
|
|
3202
|
+
/** For waiting_csv with a blocks delay: absolute height at maturity. */
|
|
3203
|
+
maturesAtHeight?: number;
|
|
3204
|
+
/** For waiting_csv with a seconds delay: unix time at maturity. */
|
|
3205
|
+
maturesAtTime?: number;
|
|
3206
|
+
};
|
|
3207
|
+
/**
|
|
3208
|
+
* Fee source for graph-mode `bump` steps. Given a parent tx carrying a P2A
|
|
3209
|
+
* anchor, it builds and signs the CPFP fee child from its own funds and
|
|
3210
|
+
* returns the 1P1C package hexes (parent unchanged, child signed) — WITHOUT
|
|
3211
|
+
* broadcasting; the executor owns broadcast. `OnchainWallet` implements it.
|
|
3212
|
+
*/
|
|
3213
|
+
interface ExitFeeWallet {
|
|
3214
|
+
bumpAnchor(parentHex: string, feeRate: number): Promise<[parentHex: string, childHex: string]>;
|
|
3022
3215
|
}
|
|
3023
3216
|
/**
|
|
3024
|
-
*
|
|
3025
|
-
*
|
|
3026
|
-
*
|
|
3217
|
+
* Keyless, stateless executor for a pre-signed exit package.
|
|
3218
|
+
*
|
|
3219
|
+
* The blockchain is the only state: every action re-checks tx status first,
|
|
3220
|
+
* so the executor can be killed and re-run anywhere at any time. It never
|
|
3221
|
+
* parses transaction hex — it only relays it.
|
|
3222
|
+
*/
|
|
3223
|
+
declare class Executor implements AsyncIterable<ExecutorEvent> {
|
|
3224
|
+
readonly pkg: ExitPackage;
|
|
3225
|
+
readonly provider: OnchainProvider;
|
|
3226
|
+
private readonly pollIntervalMs;
|
|
3227
|
+
private readonly feeWallet?;
|
|
3228
|
+
constructor(pkg: ExitPackage, provider: OnchainProvider, opts?: {
|
|
3229
|
+
pollIntervalMs?: number;
|
|
3230
|
+
feeWallet?: ExitFeeWallet;
|
|
3231
|
+
});
|
|
3232
|
+
private sleep;
|
|
3233
|
+
private status;
|
|
3234
|
+
private waitConfirmed;
|
|
3235
|
+
[Symbol.asyncIterator](): AsyncIterator<ExecutorEvent>;
|
|
3236
|
+
}
|
|
3237
|
+
|
|
3238
|
+
/**
|
|
3239
|
+
* Build the fully pre-signed unilateral exit package.
|
|
3240
|
+
*
|
|
3241
|
+
* Signs every transaction needed to land the selected VTXOs onchain and
|
|
3242
|
+
* **broadcasts the funding splitter** as a side effect — reserving the fee
|
|
3243
|
+
* budget so later wallet activity cannot invalidate the package. The
|
|
3244
|
+
* returned package is keyless to execute: hand it to
|
|
3245
|
+
* `UnilateralExit.Executor` (or any Esplora-speaking watchtower).
|
|
3246
|
+
*/
|
|
3247
|
+
declare function prepare(opts: ExitOptions): Promise<ExitPackage>;
|
|
3248
|
+
|
|
3249
|
+
/**
|
|
3250
|
+
* Pre-signed unilateral exit.
|
|
3251
|
+
*
|
|
3252
|
+
* `estimate` quotes the cost (tx count, fees, funding required) without
|
|
3253
|
+
* touching funds; `prepare` signs every transaction needed to land the
|
|
3254
|
+
* VTXOs onchain and broadcasts the fee-funding splitter; `Executor` drives
|
|
3255
|
+
* the resulting package to completion with nothing but an
|
|
3256
|
+
* Esplora-compatible endpoint — no keys, no Arkade infrastructure.
|
|
3257
|
+
*/
|
|
3258
|
+
declare const UnilateralExit: {
|
|
3259
|
+
readonly estimate: typeof estimate;
|
|
3260
|
+
readonly prepare: typeof prepare;
|
|
3261
|
+
readonly Executor: typeof Executor;
|
|
3262
|
+
};
|
|
3263
|
+
|
|
3264
|
+
/**
|
|
3265
|
+
* Whether a provider error is a *retryable* availability failure (operator or
|
|
3266
|
+
* indexer temporarily unreachable) rather than a terminal one.
|
|
3267
|
+
*
|
|
3268
|
+
* Retryable:
|
|
3269
|
+
* - {@link ProviderUnavailableError} — already-classified 5xx/429/unavailable
|
|
3270
|
+
* (see e.g. {@link https | RestArkProvider.getInfo}'s non-2xx branch);
|
|
3271
|
+
* - {@link FetchError} — transport-level `fetch` rejection (DNS failure,
|
|
3272
|
+
* connection refused, TLS/CORS), which also carries undici timeouts as its
|
|
3273
|
+
* `cause`;
|
|
3274
|
+
* - {@link isFetchTimeoutError} — header/body timeouts that surface directly.
|
|
3275
|
+
*
|
|
3276
|
+
* Everything else (4xx, invalid JSON, schema violations, network mismatch,
|
|
3277
|
+
* unsupported network) is terminal and returns `false`.
|
|
3278
|
+
*
|
|
3279
|
+
* NOTE (Step 2, Scope 2): this classifies the errors currently produced by the
|
|
3280
|
+
* boot-critical `getInfo` path. Normalizing the indexer's per-branch
|
|
3281
|
+
* `!res.ok` throws and the remaining Ark RPC methods into
|
|
3282
|
+
* {@link ProviderUnavailableError} is the broader Scope-2 work still pending.
|
|
3027
3283
|
*/
|
|
3028
|
-
declare function
|
|
3284
|
+
declare function isRetryableProviderError(error: unknown): boolean;
|
|
3029
3285
|
|
|
3030
3286
|
declare function validateConnectorsTxGraph(settlementTxB64: string, connectorsGraph: TxTree): void;
|
|
3031
3287
|
declare function validateVtxoTxGraph(graph: TxTree, roundTransaction: Transaction$2, sweepTapTreeRoot: Uint8Array): void;
|
|
@@ -3755,4 +4011,4 @@ declare class AssetManager extends ReadonlyAssetManager implements IAssetManager
|
|
|
3755
4011
|
burn(params: BurnParams): Promise<string>;
|
|
3756
4012
|
}
|
|
3757
4013
|
|
|
3758
|
-
export { Activity, ActivityRegistry, type AnchorBumper,
|
|
4014
|
+
export { Activity, ActivityRegistry, type AnchorBumper, ArkIntent, ArkNote, ArkProvider, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, AssetDetails, AssetManager, BIP322, BurnParams, CSVMultisigTapscript, ChainTx, Coin, ConditionWitness, Contract, ContractEvent, ContractRepository, ContractRepositoryImpl, ContractSyncState, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DelegateInfo, DelegateNotConfiguredError, DelegatorNotConfiguredError, type DescriptorOptions, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, EncodedVtxoScript, Estimator, type ExecutorEvent, type ExitDelay, type ExitFeeWallet, type ExitMode, type ExitOptions, type ExitPackage, type ExitQuote, type ExitStep, type ExitTotals, type ExitVtxoInfo, ExplorerTransaction, ExtendedCoin, ExtendedVirtualCoin, FeeAmount, FeeInfo, FeeOutput, FetchError, GetVtxosFilter, HDDescriptorProvider, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBWalletRepository, IndexerProvider, IntentFeeConfig, IntentFilter, IntentRepository, IssuanceParams, IssuanceResult, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, MigrationGlobalSkipReason, MigrationLegSkipReason, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathContext, PathSelection, ProviderConnectionState, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignerSession, SignerStatus, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, UnilateralExit, Unroll, type VSize, VirtualCoin, VirtualTx, VirtualTxRepository, VtxoBranch, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, assembleBtcdTaprootTree, index as asset, buildForfeitTx, buildOffchainTx, buildVersion, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, deserializeExitPackage, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isCltvSatisfied, isCsvSpendable, isRetryableProviderError, isValidArkAddress, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sdkVersion, sequenceToTimelock, serializeExitPackage, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
|