@arkade-os/sdk 0.4.44 → 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 +35 -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-Dap7qUlF.d.cts → asyncStorageTaskQueue-BmBPvTyh.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-BtSOVZFn.d.ts → asyncStorageTaskQueue-CHpI3moJ.d.ts} +2 -2
- package/dist/{chunk-V7WIZR2B.js → chunk-BOA4SHCD.js} +3 -3
- package/dist/{chunk-V7WIZR2B.js.map → chunk-BOA4SHCD.js.map} +1 -1
- package/dist/{chunk-X37EKDIH.cjs → chunk-HZ7VIN7P.cjs} +11 -11
- package/dist/{chunk-X37EKDIH.cjs.map → chunk-HZ7VIN7P.cjs.map} +1 -1
- package/dist/{chunk-RJ6XVCX4.cjs → chunk-OFQGANH2.cjs} +7 -7
- package/dist/{chunk-RJ6XVCX4.cjs.map → chunk-OFQGANH2.cjs.map} +1 -1
- package/dist/{chunk-LCQQPOIT.js → chunk-QZ6HZZZK.js} +3 -3
- package/dist/{chunk-LCQQPOIT.js.map → chunk-QZ6HZZZK.js.map} +1 -1
- package/dist/{chunk-XIVCG6EP.cjs → chunk-SRCWBFSZ.cjs} +1000 -322
- package/dist/chunk-SRCWBFSZ.cjs.map +1 -0
- package/dist/{chunk-FMI2GKYO.js → chunk-TGRJ5WAX.js} +919 -243
- package/dist/chunk-TGRJ5WAX.js.map +1 -0
- package/dist/{chunk-UBYY2TPK.cjs → chunk-UHOHLN3C.cjs} +119 -69
- package/dist/chunk-UHOHLN3C.cjs.map +1 -0
- package/dist/{chunk-LJ35HPJW.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 +141 -129
- package/dist/index.d.cts +45 -20
- package/dist/index.d.ts +45 -20
- 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-Bptw9UMa.d.ts → taskRunner-BngWSFMi.d.ts} +2 -2
- package/dist/{taskRunner-CeFxKhSH.d.cts → taskRunner-DOiyRuJa.d.cts} +2 -2
- 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-FMI2GKYO.js.map +0 -1
- package/dist/chunk-LJ35HPJW.js.map +0 -1
- package/dist/chunk-UBYY2TPK.cjs.map +0 -1
- package/dist/chunk-XIVCG6EP.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[]>;
|
|
@@ -3244,19 +3261,27 @@ declare const UnilateralExit: {
|
|
|
3244
3261
|
readonly Executor: typeof Executor;
|
|
3245
3262
|
};
|
|
3246
3263
|
|
|
3247
|
-
declare class ArkError extends Error {
|
|
3248
|
-
readonly code: number;
|
|
3249
|
-
readonly message: string;
|
|
3250
|
-
readonly name: string;
|
|
3251
|
-
readonly metadata?: Record<string, string> | undefined;
|
|
3252
|
-
constructor(code: number, message: string, name: string, metadata?: Record<string, string> | undefined);
|
|
3253
|
-
}
|
|
3254
3264
|
/**
|
|
3255
|
-
*
|
|
3256
|
-
*
|
|
3257
|
-
*
|
|
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.
|
|
3258
3283
|
*/
|
|
3259
|
-
declare function
|
|
3284
|
+
declare function isRetryableProviderError(error: unknown): boolean;
|
|
3260
3285
|
|
|
3261
3286
|
declare function validateConnectorsTxGraph(settlementTxB64: string, connectorsGraph: TxTree): void;
|
|
3262
3287
|
declare function validateVtxoTxGraph(graph: TxTree, roundTransaction: Transaction$2, sweepTapTreeRoot: Uint8Array): void;
|
|
@@ -3986,4 +4011,4 @@ declare class AssetManager extends ReadonlyAssetManager implements IAssetManager
|
|
|
3986
4011
|
burn(params: BurnParams): Promise<string>;
|
|
3987
4012
|
}
|
|
3988
4013
|
|
|
3989
|
-
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 };
|
package/dist/index.d.ts
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.js';
|
|
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.js';
|
|
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-Cm2fGeox.js';
|
|
4
|
+
export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-BKNqva1j.js';
|
|
5
|
+
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot, P as ProviderConnectionState } from './wallet-B3awP1Nj.js';
|
|
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-B3awP1Nj.js';
|
|
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[]>;
|
|
@@ -3244,19 +3261,27 @@ declare const UnilateralExit: {
|
|
|
3244
3261
|
readonly Executor: typeof Executor;
|
|
3245
3262
|
};
|
|
3246
3263
|
|
|
3247
|
-
declare class ArkError extends Error {
|
|
3248
|
-
readonly code: number;
|
|
3249
|
-
readonly message: string;
|
|
3250
|
-
readonly name: string;
|
|
3251
|
-
readonly metadata?: Record<string, string> | undefined;
|
|
3252
|
-
constructor(code: number, message: string, name: string, metadata?: Record<string, string> | undefined);
|
|
3253
|
-
}
|
|
3254
3264
|
/**
|
|
3255
|
-
*
|
|
3256
|
-
*
|
|
3257
|
-
*
|
|
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.
|
|
3258
3283
|
*/
|
|
3259
|
-
declare function
|
|
3284
|
+
declare function isRetryableProviderError(error: unknown): boolean;
|
|
3260
3285
|
|
|
3261
3286
|
declare function validateConnectorsTxGraph(settlementTxB64: string, connectorsGraph: TxTree): void;
|
|
3262
3287
|
declare function validateVtxoTxGraph(graph: TxTree, roundTransaction: Transaction$2, sweepTapTreeRoot: Uint8Array): void;
|
|
@@ -3986,4 +4011,4 @@ declare class AssetManager extends ReadonlyAssetManager implements IAssetManager
|
|
|
3986
4011
|
burn(params: BurnParams): Promise<string>;
|
|
3987
4012
|
}
|
|
3988
4013
|
|
|
3989
|
-
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 };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { ActivityRegistry, ArkNote, AssetManager, BIP322, Batch, ChainedTxType, ContractManager, ContractRepositoryImpl, ContractWatcher, DEFAULT_MESSAGE_TIMEOUTS, DelegateManagerImpl, DelegateNotConfiguredError, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EsploraProvider, Estimator, HDDescriptorProvider, INTENT_TERMINAL_STATES, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBWalletRepository, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, P2A, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestDelegatorProvider, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, UnilateralExit, Unroll, VtxoManager, Wallet, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, boardingResolver, buildForfeitTx, buildOffchainTx, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, createDefaultActivityRegistry, decodeArkContract, deserializeExitPackage, encodeArkContract, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isBatchSignable, isCooperativelyMigratable, isDiscoverable, isExpired, isRecoverable, isSpendable, isSubdust, isTerminalIntentState, isValidArkAddress, isVtxoExpiringSoon, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, serializeExitPackage, setupServiceWorker, signerSetFromInfo, toXOnlySignerHex, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds } from './chunk-
|
|
2
|
-
export { ArkError, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ChainTxType, ConditionWitness, CosignerPublicKey, DigestMismatchError, FetchError, IndexerTxType, Intent, RestArkProvider, RestIndexerProvider, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, asset_exports as asset, buildVersion, getArkPsbtFields, maybeArkError, sdkVersion, setArkPsbtField } from './chunk-
|
|
1
|
+
export { ActivityRegistry, ArkNote, AssetManager, BIP322, Batch, ChainedTxType, ContractManager, ContractRepositoryImpl, ContractWatcher, DEFAULT_MESSAGE_TIMEOUTS, DelegateManagerImpl, DelegateNotConfiguredError, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EsploraProvider, Estimator, HDDescriptorProvider, INTENT_TERMINAL_STATES, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBWalletRepository, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, P2A, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestDelegatorProvider, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, UnilateralExit, Unroll, VtxoManager, Wallet, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, boardingResolver, buildForfeitTx, buildOffchainTx, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, createDefaultActivityRegistry, createExitChainResolver, decodeArkContract, deserializeExitPackage, encodeArkContract, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isBatchSignable, isCooperativelyMigratable, isDiscoverable, isExpired, isRecoverable, isRetryableProviderError, isSpendable, isSubdust, isTerminalIntentState, isValidArkAddress, isVtxoExpiringSoon, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, serializeExitPackage, setupServiceWorker, signerSetFromInfo, toXOnlySignerHex, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds } from './chunk-TGRJ5WAX.js';
|
|
2
|
+
export { ArkError, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ChainTxType, ConditionWitness, CosignerPublicKey, DigestMismatchError, FetchError, IndexerTxType, Intent, ProviderUnavailableError, RestArkProvider, RestIndexerProvider, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, asset_exports as asset, buildVersion, getArkPsbtFields, maybeArkError, sdkVersion, setArkPsbtField } from './chunk-YBQV7XBC.js';
|
|
3
3
|
export { BoardingContractHandler, DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, VHTLC, VHTLCContractHandler, contractHandlers, isCltvSatisfied, isCsvSpendable } from './chunk-YNEDJTX2.js';
|
|
4
4
|
export { ArkAddress, CLTVMultisigTapscript, CSVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, MultisigTapscript, TapTreeCoder, VtxoScript, assembleBtcdTaprootTree, decodeTapscript, getNetwork, getSequence, networks, sequenceToTimelock, timelockToSequence } from './chunk-BE5MUB7T.js';
|
|
5
5
|
import './chunk-NSBPE2FW.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
3
|
+
var chunkSRCWBFSZ_cjs = require('../../chunk-SRCWBFSZ.cjs');
|
|
4
|
+
require('../../chunk-UHOHLN3C.cjs');
|
|
5
5
|
require('../../chunk-32YKLQPS.cjs');
|
|
6
6
|
require('../../chunk-HXDZ2QTW.cjs');
|
|
7
7
|
require('../../chunk-5BLDMQED.cjs');
|
|
@@ -37,7 +37,7 @@ var RealmWalletRepository = class {
|
|
|
37
37
|
await this.ensureInit();
|
|
38
38
|
this.realm.write(() => {
|
|
39
39
|
for (const vtxo of vtxos) {
|
|
40
|
-
const s =
|
|
40
|
+
const s = chunkSRCWBFSZ_cjs.serializeVtxo(vtxo);
|
|
41
41
|
this.realm.create(
|
|
42
42
|
"ArkVtxo",
|
|
43
43
|
{
|
|
@@ -85,7 +85,7 @@ var RealmWalletRepository = class {
|
|
|
85
85
|
throw new Error("RealmWalletRepository requires an address");
|
|
86
86
|
}
|
|
87
87
|
for (const vtxo of vtxos) {
|
|
88
|
-
if (!
|
|
88
|
+
if (!chunkSRCWBFSZ_cjs.isVtxoForScript(vtxo, key.script)) {
|
|
89
89
|
throw new Error(
|
|
90
90
|
`VTXO ${vtxo.txid}:${vtxo.vout} script mismatch: expected ${key.script}, got ${vtxo.script}`
|
|
91
91
|
);
|
|
@@ -110,7 +110,7 @@ var RealmWalletRepository = class {
|
|
|
110
110
|
await this.ensureInit();
|
|
111
111
|
this.realm.write(() => {
|
|
112
112
|
for (const utxo of utxos) {
|
|
113
|
-
const s =
|
|
113
|
+
const s = chunkSRCWBFSZ_cjs.serializeUtxo(utxo);
|
|
114
114
|
this.realm.create(
|
|
115
115
|
"ArkUtxo",
|
|
116
116
|
{
|
|
@@ -163,7 +163,7 @@ var RealmWalletRepository = class {
|
|
|
163
163
|
amount: tx.amount,
|
|
164
164
|
settled: tx.settled,
|
|
165
165
|
createdAt: tx.createdAt,
|
|
166
|
-
assetsJson: tx.assets ? JSON.stringify(
|
|
166
|
+
assetsJson: tx.assets ? JSON.stringify(chunkSRCWBFSZ_cjs.serializeAssets(tx.assets)) : null
|
|
167
167
|
},
|
|
168
168
|
"modified"
|
|
169
169
|
);
|
|
@@ -233,9 +233,9 @@ function vtxoObjectToDomain(obj) {
|
|
|
233
233
|
// Post-migration every row has `script`, but the backfill is
|
|
234
234
|
// idempotent: derive from `address` if the legacy column is still
|
|
235
235
|
// null (e.g. the migration hasn't run yet on this handle).
|
|
236
|
-
script: obj.script ??
|
|
236
|
+
script: obj.script ?? chunkSRCWBFSZ_cjs.scriptFromArkAddress(obj.address)
|
|
237
237
|
};
|
|
238
|
-
return
|
|
238
|
+
return chunkSRCWBFSZ_cjs.deserializeVtxo(serialized);
|
|
239
239
|
}
|
|
240
240
|
function utxoObjectToDomain(obj) {
|
|
241
241
|
const serialized = {
|
|
@@ -254,7 +254,7 @@ function utxoObjectToDomain(obj) {
|
|
|
254
254
|
status: JSON.parse(obj.statusJson),
|
|
255
255
|
extraWitness: obj.extraWitnessJson ? JSON.parse(obj.extraWitnessJson) : void 0
|
|
256
256
|
};
|
|
257
|
-
return
|
|
257
|
+
return chunkSRCWBFSZ_cjs.deserializeUtxo(serialized);
|
|
258
258
|
}
|
|
259
259
|
function txObjectToDomain(obj) {
|
|
260
260
|
const tx = {
|
|
@@ -269,7 +269,7 @@ function txObjectToDomain(obj) {
|
|
|
269
269
|
createdAt: obj.createdAt
|
|
270
270
|
};
|
|
271
271
|
if (obj.assetsJson) {
|
|
272
|
-
tx.assets =
|
|
272
|
+
tx.assets = chunkSRCWBFSZ_cjs.deserializeAssets(JSON.parse(obj.assetsJson));
|
|
273
273
|
}
|
|
274
274
|
return tx;
|
|
275
275
|
}
|
|
@@ -428,7 +428,7 @@ var RealmIntentRepository = class {
|
|
|
428
428
|
const clashes = [
|
|
429
429
|
...this.realm.objects("ArkIntent").filtered("intentId == $0", intent.intentId)
|
|
430
430
|
].map(toIntent);
|
|
431
|
-
|
|
431
|
+
chunkSRCWBFSZ_cjs.assertIntentIdUnique(intent, clashes);
|
|
432
432
|
}
|
|
433
433
|
this.realm.create(
|
|
434
434
|
"ArkIntent",
|
|
@@ -457,14 +457,14 @@ var RealmIntentRepository = class {
|
|
|
457
457
|
}
|
|
458
458
|
async getIntents(filter) {
|
|
459
459
|
const all = [...this.realm.objects("ArkIntent")].map(toIntent).sort((a, b) => a.createdAt - b.createdAt || a.intentTxId.localeCompare(b.intentTxId));
|
|
460
|
-
const out = filter ? all.filter((i) =>
|
|
461
|
-
const { skip, end } =
|
|
460
|
+
const out = filter ? all.filter((i) => chunkSRCWBFSZ_cjs.intentMatchesFilter(i, filter)) : all;
|
|
461
|
+
const { skip, end } = chunkSRCWBFSZ_cjs.intentPageBounds(filter, out.length);
|
|
462
462
|
return out.slice(skip, end);
|
|
463
463
|
}
|
|
464
464
|
async getLockedVtxoOutpoints() {
|
|
465
465
|
const out = [];
|
|
466
466
|
for (const o of [...this.realm.objects("ArkIntent")].map(toIntent))
|
|
467
|
-
if (!
|
|
467
|
+
if (!chunkSRCWBFSZ_cjs.isTerminalIntentState(o.state)) out.push(...o.intentVtxos);
|
|
468
468
|
return out;
|
|
469
469
|
}
|
|
470
470
|
async [Symbol.asyncDispose]() {
|
|
@@ -505,7 +505,7 @@ var RealmVirtualTxRepository = class {
|
|
|
505
505
|
txid: t.txid,
|
|
506
506
|
psbt: t.psbt ?? prev?.psbt ?? null,
|
|
507
507
|
expiresAt: t.expiresAt ?? prev?.expiresAt ?? null,
|
|
508
|
-
type:
|
|
508
|
+
type: chunkSRCWBFSZ_cjs.mergeChainedTxType(t.type, prev?.type)
|
|
509
509
|
},
|
|
510
510
|
"modified"
|
|
511
511
|
);
|
|
@@ -738,7 +738,7 @@ function runArkRealmMigrations(oldRealm, newRealm) {
|
|
|
738
738
|
for (let i = 0; i < newVtxos.length; i++) {
|
|
739
739
|
const newVtxo = newVtxos[i];
|
|
740
740
|
if (!newVtxo.script) {
|
|
741
|
-
newVtxo.script =
|
|
741
|
+
newVtxo.script = chunkSRCWBFSZ_cjs.scriptFromArkAddress(newVtxo.address);
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
744
|
const oldHasVirtualTx = Array.isArray(oldRealm?.schema) && oldRealm.schema.some((s) => s.name === "ArkVirtualTx");
|
|
@@ -755,7 +755,7 @@ function runArkRealmMigrations(oldRealm, newRealm) {
|
|
|
755
755
|
|
|
756
756
|
Object.defineProperty(exports, "ChainedTxType", {
|
|
757
757
|
enumerable: true,
|
|
758
|
-
get: function () { return
|
|
758
|
+
get: function () { return chunkSRCWBFSZ_cjs.ChainedTxType; }
|
|
759
759
|
});
|
|
760
760
|
exports.ARK_REALM_SCHEMA_VERSION = ARK_REALM_SCHEMA_VERSION;
|
|
761
761
|
exports.ArkExperimentalRealmSchemas = ArkExperimentalRealmSchemas;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WalletRepository, E as ExtendedVirtualCoin,
|
|
2
|
-
export {
|
|
1
|
+
import { W as WalletRepository, E as ExtendedVirtualCoin, a9 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, aa as WalletState, C as ContractRepository, ab as ContractFilter, t as Contract, P as IntentRepository, ac as ArkIntent, ad as IntentFilter, ae as Outpoint, Q as VirtualTxRepository, af as VirtualTx, ag as VtxoBranch } from '../../ark-C-PjOngm.cjs';
|
|
2
|
+
export { ah as ChainedTxType } from '../../ark-C-PjOngm.cjs';
|
|
3
3
|
import '@scure/btc-signer/transaction.js';
|
|
4
4
|
import '@scure/btc-signer/utils.js';
|
|
5
5
|
import '@scure/btc-signer/psbt.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WalletRepository, E as ExtendedVirtualCoin,
|
|
2
|
-
export {
|
|
1
|
+
import { W as WalletRepository, E as ExtendedVirtualCoin, a9 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, aa as WalletState, C as ContractRepository, ab as ContractFilter, t as Contract, P as IntentRepository, ac as ArkIntent, ad as IntentFilter, ae as Outpoint, Q as VirtualTxRepository, af as VirtualTx, ag as VtxoBranch } from '../../ark-C-PjOngm.js';
|
|
2
|
+
export { ah as ChainedTxType } from '../../ark-C-PjOngm.js';
|
|
3
3
|
import '@scure/btc-signer/transaction.js';
|
|
4
4
|
import '@scure/btc-signer/utils.js';
|
|
5
5
|
import '@scure/btc-signer/psbt.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, assertIntentIdUnique, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-
|
|
2
|
-
export { ChainedTxType } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
1
|
+
import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, assertIntentIdUnique, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-TGRJ5WAX.js';
|
|
2
|
+
export { ChainedTxType } from '../../chunk-TGRJ5WAX.js';
|
|
3
|
+
import '../../chunk-YBQV7XBC.js';
|
|
4
4
|
import '../../chunk-YNEDJTX2.js';
|
|
5
5
|
import '../../chunk-BE5MUB7T.js';
|
|
6
6
|
import '../../chunk-NSBPE2FW.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
3
|
+
var chunkSRCWBFSZ_cjs = require('../../chunk-SRCWBFSZ.cjs');
|
|
4
|
+
require('../../chunk-UHOHLN3C.cjs');
|
|
5
5
|
require('../../chunk-32YKLQPS.cjs');
|
|
6
6
|
require('../../chunk-HXDZ2QTW.cjs');
|
|
7
7
|
require('../../chunk-5BLDMQED.cjs');
|
|
@@ -153,7 +153,7 @@ var SQLiteWalletRepository = class {
|
|
|
153
153
|
for (const row of nullRows) {
|
|
154
154
|
await this.db.run(
|
|
155
155
|
`UPDATE ${this.tables.vtxos} SET script = ? WHERE txid = ? AND vout = ?`,
|
|
156
|
-
[
|
|
156
|
+
[chunkSRCWBFSZ_cjs.scriptFromArkAddress(row.address), row.txid, row.vout]
|
|
157
157
|
);
|
|
158
158
|
}
|
|
159
159
|
const tempName = `${this.tables.vtxos}__migrate_tmp`;
|
|
@@ -224,7 +224,7 @@ var SQLiteWalletRepository = class {
|
|
|
224
224
|
async saveVtxos(address, vtxos) {
|
|
225
225
|
await this.ensureInit();
|
|
226
226
|
for (const vtxo of vtxos) {
|
|
227
|
-
const s =
|
|
227
|
+
const s = chunkSRCWBFSZ_cjs.serializeVtxo(vtxo);
|
|
228
228
|
await this.db.run(
|
|
229
229
|
`INSERT OR REPLACE INTO ${this.tables.vtxos}
|
|
230
230
|
(txid, vout, value, address,
|
|
@@ -279,7 +279,7 @@ var SQLiteWalletRepository = class {
|
|
|
279
279
|
throw new Error("SQLiteWalletRepository requires an address");
|
|
280
280
|
}
|
|
281
281
|
for (const vtxo of vtxos) {
|
|
282
|
-
if (!
|
|
282
|
+
if (!chunkSRCWBFSZ_cjs.isVtxoForScript(vtxo, key.script)) {
|
|
283
283
|
throw new Error(
|
|
284
284
|
`VTXO ${vtxo.txid}:${vtxo.vout} script mismatch: expected ${key.script}, got ${vtxo.script}`
|
|
285
285
|
);
|
|
@@ -303,7 +303,7 @@ var SQLiteWalletRepository = class {
|
|
|
303
303
|
async saveUtxos(address, utxos) {
|
|
304
304
|
await this.ensureInit();
|
|
305
305
|
for (const utxo of utxos) {
|
|
306
|
-
const s =
|
|
306
|
+
const s = chunkSRCWBFSZ_cjs.serializeUtxo(utxo);
|
|
307
307
|
await this.db.run(
|
|
308
308
|
`INSERT OR REPLACE INTO ${this.tables.utxos}
|
|
309
309
|
(txid, vout, value, address,
|
|
@@ -359,7 +359,7 @@ var SQLiteWalletRepository = class {
|
|
|
359
359
|
tx.amount,
|
|
360
360
|
tx.settled ? 1 : 0,
|
|
361
361
|
tx.createdAt,
|
|
362
|
-
tx.assets ? JSON.stringify(
|
|
362
|
+
tx.assets ? JSON.stringify(chunkSRCWBFSZ_cjs.serializeAssets(tx.assets)) : null
|
|
363
363
|
]
|
|
364
364
|
);
|
|
365
365
|
}
|
|
@@ -433,9 +433,9 @@ function vtxoRowToDomain(row) {
|
|
|
433
433
|
// Post-migration every row has `script`, but the backfill is
|
|
434
434
|
// idempotent: derive from `address` if the legacy column is still
|
|
435
435
|
// null (e.g. the migration hasn't run yet on this handle).
|
|
436
|
-
script: row.script ??
|
|
436
|
+
script: row.script ?? chunkSRCWBFSZ_cjs.scriptFromArkAddress(row.address)
|
|
437
437
|
};
|
|
438
|
-
return
|
|
438
|
+
return chunkSRCWBFSZ_cjs.deserializeVtxo(serialized);
|
|
439
439
|
}
|
|
440
440
|
function utxoRowToDomain(row) {
|
|
441
441
|
const serialized = {
|
|
@@ -454,7 +454,7 @@ function utxoRowToDomain(row) {
|
|
|
454
454
|
status: JSON.parse(row.status_json),
|
|
455
455
|
extraWitness: row.extra_witness_json ? JSON.parse(row.extra_witness_json) : void 0
|
|
456
456
|
};
|
|
457
|
-
return
|
|
457
|
+
return chunkSRCWBFSZ_cjs.deserializeUtxo(serialized);
|
|
458
458
|
}
|
|
459
459
|
function txRowToDomain(row) {
|
|
460
460
|
const tx = {
|
|
@@ -469,7 +469,7 @@ function txRowToDomain(row) {
|
|
|
469
469
|
createdAt: row.created_at
|
|
470
470
|
};
|
|
471
471
|
if (row.assets_json) {
|
|
472
|
-
tx.assets =
|
|
472
|
+
tx.assets = chunkSRCWBFSZ_cjs.deserializeAssets(JSON.parse(row.assets_json));
|
|
473
473
|
}
|
|
474
474
|
return tx;
|
|
475
475
|
}
|
|
@@ -715,8 +715,8 @@ var SQLiteIntentRepository = class {
|
|
|
715
715
|
`SELECT * FROM ${this.t} ORDER BY created_at ASC, intent_tx_id ASC`
|
|
716
716
|
);
|
|
717
717
|
let out = rows.map(rowToIntent);
|
|
718
|
-
if (filter) out = out.filter((i) =>
|
|
719
|
-
const { skip, end } =
|
|
718
|
+
if (filter) out = out.filter((i) => chunkSRCWBFSZ_cjs.intentMatchesFilter(i, filter));
|
|
719
|
+
const { skip, end } = chunkSRCWBFSZ_cjs.intentPageBounds(filter, out.length);
|
|
720
720
|
return out.slice(skip, end);
|
|
721
721
|
}
|
|
722
722
|
async getLockedVtxoOutpoints() {
|
|
@@ -724,7 +724,7 @@ var SQLiteIntentRepository = class {
|
|
|
724
724
|
const rows = await this.db.all(`SELECT * FROM ${this.t}`);
|
|
725
725
|
const out = [];
|
|
726
726
|
for (const r of rows) {
|
|
727
|
-
if (
|
|
727
|
+
if (chunkSRCWBFSZ_cjs.isTerminalIntentState(r.state)) continue;
|
|
728
728
|
for (const o of JSON.parse(r.intent_vtxos_json)) out.push(o);
|
|
729
729
|
}
|
|
730
730
|
return out;
|
|
@@ -818,7 +818,7 @@ var SQLiteVirtualTxRepository = class {
|
|
|
818
818
|
const prev = prevByTxid.get(t.txid);
|
|
819
819
|
const psbt = t.psbt ?? prev?.psbt ?? null;
|
|
820
820
|
const expires = t.expiresAt ?? prev?.expires_at ?? null;
|
|
821
|
-
const type =
|
|
821
|
+
const type = chunkSRCWBFSZ_cjs.mergeChainedTxType(t.type, prev?.type);
|
|
822
822
|
await this.db.run(
|
|
823
823
|
`INSERT OR REPLACE INTO ${this.tTx} (txid, psbt, expires_at, type) VALUES (?, ?, ?, ?)`,
|
|
824
824
|
[t.txid, psbt, expires, type]
|
|
@@ -904,7 +904,7 @@ function rowToTx(r) {
|
|
|
904
904
|
|
|
905
905
|
Object.defineProperty(exports, "ChainedTxType", {
|
|
906
906
|
enumerable: true,
|
|
907
|
-
get: function () { return
|
|
907
|
+
get: function () { return chunkSRCWBFSZ_cjs.ChainedTxType; }
|
|
908
908
|
});
|
|
909
909
|
exports.SQLiteContractRepository = SQLiteContractRepository;
|
|
910
910
|
exports.SQLiteIntentRepository = SQLiteIntentRepository;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WalletRepository, E as ExtendedVirtualCoin,
|
|
2
|
-
export {
|
|
1
|
+
import { W as WalletRepository, E as ExtendedVirtualCoin, a9 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, aa as WalletState, C as ContractRepository, ab as ContractFilter, t as Contract, P as IntentRepository, ac as ArkIntent, ad as IntentFilter, ae as Outpoint, Q as VirtualTxRepository, af as VirtualTx, ag as VtxoBranch } from '../../ark-C-PjOngm.cjs';
|
|
2
|
+
export { ah as ChainedTxType } from '../../ark-C-PjOngm.cjs';
|
|
3
3
|
import '@scure/btc-signer/transaction.js';
|
|
4
4
|
import '@scure/btc-signer/utils.js';
|
|
5
5
|
import '@scure/btc-signer/psbt.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WalletRepository, E as ExtendedVirtualCoin,
|
|
2
|
-
export {
|
|
1
|
+
import { W as WalletRepository, E as ExtendedVirtualCoin, a9 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, aa as WalletState, C as ContractRepository, ab as ContractFilter, t as Contract, P as IntentRepository, ac as ArkIntent, ad as IntentFilter, ae as Outpoint, Q as VirtualTxRepository, af as VirtualTx, ag as VtxoBranch } from '../../ark-C-PjOngm.js';
|
|
2
|
+
export { ah as ChainedTxType } from '../../ark-C-PjOngm.js';
|
|
3
3
|
import '@scure/btc-signer/transaction.js';
|
|
4
4
|
import '@scure/btc-signer/utils.js';
|
|
5
5
|
import '@scure/btc-signer/psbt.js';
|