@arkade-os/sdk 0.4.50 → 0.4.52
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 -8
- 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 +4 -4
- package/dist/adapters/indexedDB.js +3 -3
- package/dist/{ark-ApoclKQZ.d.cts → ark-B69ugeJw.d.cts} +133 -1
- package/dist/{ark-ApoclKQZ.d.ts → ark-B69ugeJw.d.ts} +133 -1
- package/dist/{asyncStorageTaskQueue-BCWmdVg8.d.ts → asyncStorageTaskQueue-BImF14sj.d.ts} +2 -2
- package/dist/{asyncStorageTaskQueue-CIjgv1co.d.cts → asyncStorageTaskQueue-DScPdQAy.d.cts} +2 -2
- package/dist/{chunk-Q4K2RSMY.cjs → chunk-3Z5HK35D.cjs} +7 -7
- package/dist/{chunk-Q4K2RSMY.cjs.map → chunk-3Z5HK35D.cjs.map} +1 -1
- package/dist/{chunk-7WSVP7DK.js → chunk-3ZGANANS.js} +3 -3
- package/dist/{chunk-7WSVP7DK.js.map → chunk-3ZGANANS.js.map} +1 -1
- package/dist/{chunk-SNTSB6M2.js → chunk-AXCKRS2D.js} +354 -60
- package/dist/chunk-AXCKRS2D.js.map +1 -0
- package/dist/{chunk-TO3SR7TY.cjs → chunk-E6RT5XYB.cjs} +11 -11
- package/dist/{chunk-TO3SR7TY.cjs.map → chunk-E6RT5XYB.cjs.map} +1 -1
- package/dist/{chunk-SIAVTHMZ.cjs → chunk-FZPYPEWN.cjs} +3 -3
- package/dist/{chunk-SIAVTHMZ.cjs.map → chunk-FZPYPEWN.cjs.map} +1 -1
- package/dist/{chunk-LJQ2VQBE.cjs → chunk-IEMPH7J6.cjs} +52 -44
- package/dist/chunk-IEMPH7J6.cjs.map +1 -0
- package/dist/{chunk-6BQTROB4.cjs → chunk-ML33GFCH.cjs} +538 -243
- package/dist/chunk-ML33GFCH.cjs.map +1 -0
- package/dist/{chunk-MBSYQ3WX.js → chunk-UZLQUWYP.js} +52 -45
- package/dist/chunk-UZLQUWYP.js.map +1 -0
- package/dist/{chunk-ZXRSSBCF.js → chunk-WIVQWYPZ.js} +3 -3
- package/dist/{chunk-ZXRSSBCF.js.map → chunk-WIVQWYPZ.js.map} +1 -1
- package/dist/{chunk-AA4Q2J57.js → chunk-ZK3JITHP.js} +3 -3
- package/dist/{chunk-AA4Q2J57.js.map → chunk-ZK3JITHP.js.map} +1 -1
- package/dist/contracts/handlers/index.cjs +7 -7
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/contracts/handlers/index.js +1 -1
- package/dist/{delegate-hJYMZN1D.d.ts → delegate-BU-Cpyjw.d.ts} +1 -1
- package/dist/{delegate-CCHPwQft.d.cts → delegate-C_Y2YrXC.d.cts} +1 -1
- package/dist/{index-5Y9h9OnO.d.ts → index-BWF-C9eh.d.ts} +2 -2
- package/dist/{index-8jE1XJpT.d.cts → index-tzAInyiX.d.cts} +2 -2
- package/dist/index.cjs +161 -157
- package/dist/index.d.cts +24 -8
- package/dist/index.d.ts +24 -8
- package/dist/index.js +3 -3
- package/dist/repositories/realm/index.cjs +18 -18
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/realm/index.js +4 -4
- package/dist/repositories/sqlite/index.cjs +17 -17
- package/dist/repositories/sqlite/index.d.cts +2 -2
- package/dist/repositories/sqlite/index.d.ts +2 -2
- package/dist/repositories/sqlite/index.js +4 -4
- package/dist/{taskRunner-ChvV6Xrh.d.ts → taskRunner-Cf80BqSy.d.ts} +2 -2
- package/dist/{taskRunner-C3YLaM2x.d.cts → taskRunner-ClwI8jU8.d.cts} +2 -2
- package/dist/wallet/expo/background.cjs +13 -13
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +5 -5
- package/dist/wallet/expo/index.cjs +13 -13
- package/dist/wallet/expo/index.d.cts +4 -4
- package/dist/wallet/expo/index.d.ts +4 -4
- package/dist/wallet/expo/index.js +4 -4
- package/dist/{wallet-DIH0gVfW.d.ts → wallet-B6Xiferv.d.cts} +33 -3
- package/dist/{wallet-B260BTJs.d.cts → wallet-CuHAI-eW.d.ts} +33 -3
- package/dist/worker/expo/index.cjs +8 -8
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-6BQTROB4.cjs.map +0 -1
- package/dist/chunk-LJQ2VQBE.cjs.map +0 -1
- package/dist/chunk-MBSYQ3WX.js.map +0 -1
- package/dist/chunk-SNTSB6M2.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { K as ReadonlyIdentity, a as Identity,
|
|
2
|
-
export {
|
|
3
|
-
import { P as Program, A as ArkadeParamValue, a as ArkadeProgramScript, b as ProgramKeys, c as ArkadeArgValue, C as CompiledProgramFunction, d as ArkadeFunction, I as InputRef, e as InputDef, f as ArkadeValueType, g as ArkadeArgType, h as ArkadeContractParams, i as ArkadeSegment, j as AsmToken, S as SUPPORTED_PROGRAM_VERSION, k as SignerRef, T as TapscriptSegment, W as WitnessRef, l as deserializeArkadeContractParams, p as parseArtifact, r as resolveAsm, s as serializeArkadeContractParams, m as stringifyArtifact, v as validateProgram, w as witnessRefToBytes } from './index-
|
|
4
|
-
export { n as ArkadeContractHandler, B as BoardingContractHandler, o as BoardingContractParams, D as DefaultContractHandler, q as DefaultContractParams, t as DelegateContractHandler, u as DelegateContractParams, V as VHTLC, x as VHTLCContractHandler, y as VHTLCContractParams, z as contractHandlers } from './index-
|
|
5
|
-
import { D as DefaultVtxo } from './delegate-
|
|
6
|
-
export { a as DelegateVtxo } from './delegate-
|
|
7
|
-
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot, P as ProviderConnectionState, B as Batch } from './wallet-
|
|
8
|
-
export { A as ArkError, d as ArkErrorName, e as ArkadeCashClaimResult, f as ArkadeCashCreateError, g as ArkadeCashUnclaimedReason, h as ArkadeCashUnclaimedVtxo, i as BoardingUtxoGroup, I as IncomingFunds, j as ProviderKind, k as ProviderUnavailableError, S as ServerInfoSource, l as isArkError, m as maybeArkError, s as selectVirtualCoins, w as waitForIncomingFunds } from './wallet-
|
|
1
|
+
import { K as ReadonlyIdentity, a as Identity, al as DescriptorSigningRequest, am as Transaction, a8 as SignerSession, Q as IntentRepository, af as ArkIntent, ag as IntentFilter, ah as Outpoint, U as VirtualTxRepository, ai as VirtualTx, aj as VtxoBranch, W as WalletRepository, t as ExtendedVirtualCoin, ac as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, ad as WalletState, s as Contract, C as ContractRepository, ae as ContractFilter, an as IntentFeeConfig, ao as OffchainInput, ap as FeeAmount, aq as OnchainInput, ar as FeeOutput, n as ArkProvider, a6 as SettlementConfig, as as ContractWatcherConfig, at as Asset, R as Recipient, I as IWallet, au as FeeInfo, i as SettlementEvent, H as DescriptorProvider, h as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, av as CreateContractParams, aw as GetContractsFilter, r as VirtualCoin, ax as GetSpendablePathsOptions, ay as GetAllSpendingPathsOptions, az as IssuanceParams, aA as ReissuanceParams, aB as BurnParams, aC as RenewVtxosOptions, c as WalletBalance, _ as ContractSyncState, aD as ContractWithVtxos, aE as PathSelection, aF as ContractEvent, aG as AssetDetails, aH as IssuanceResult, aI as DelegateInfo, aJ as MigrationGlobalSkipReason, aK as MigrationLegSkipReason, aL as SignerStatus, J as IReadonlyWallet, d as ActivityRegistry, Z as IReadonlyAssetManager, aM as StorageConfig, e as Activity, N as NormalizedExtendedVirtualCoin, f as IContractManager, j as IAssetManager, g as IDelegateManager, aN as IVtxoManager, O as OnchainProvider, L as Network, $ as NetworkName, a2 as Coin, aO as ExplorerTransaction, q as TapLeafScript, aP as EncodedVtxoScript, a5 as CSVMultisigTapscript, p as RelativeTimelock, V as VtxoScript, aQ as Status, a1 as ArkAddress, aa as Intent, aR as ChainTx, o as IndexerProvider, v as TxTree, aS as PathContext } from './ark-B69ugeJw.cjs';
|
|
2
|
+
export { aT as ActivityIntent, aU as ActivityResolver, a0 as ArkInfo, aV as ArkIntentState, aW as ArkTapscript, aX as AssetMetadata, aY as BaseWalletConfig, z as BatchFailedEvent, x as BatchFinalizationEvent, y as BatchFinalizedEvent, aZ as BatchInfo, a_ as BatchSignableIdentity, B as BatchStartedEvent, a$ as CLTVMultisigTapscript, b0 as CandidateDeps, b1 as ChainTxType, ak as ChainedTxType, b2 as CommitmentTx, b3 as ConditionCSVMultisigTapscript, b4 as ConditionMultisigTapscript, b5 as ContractBalance, b6 as ContractEventCallback, b7 as ContractHandler, a3 as ContractManager, a4 as ContractManagerConfig, b8 as ContractState, b9 as ContractVtxo, ba as ContractWatcher, bb as DelegateManagerImpl, bc as DelegateOptions, M as DelegateProvider, bd as DelegatorManagerImpl, be as DelegatorProvider, bf as DeprecatedSignerMigrationReport, bg as DeprecatedSignerReport, bh as DigestMismatchError, bi as Discoverable, bj as DiscoveredContract, bk as DiscoveryDeps, bl as ESPLORA_URL, bm as EsploraProvider, X as ExitCaptureMode, bn as ExitChainResolver, Y as ExitDataSource, bo as ExtendedContractVtxo, bp as GroupMembership, bq as HandlerError, br as IDelegatorManager, bs as INTENT_TERMINAL_STATES, bt as IndexerTxType, bu as KnownMetadata, bv as MigrateDeprecatedSignerOptions, bw as MigrationLegReport, bx as MigrationVtxoRef, by as MultisigTapscript, bz as Nonces, bA as Output, bB as PageResponse, bC as PaginationOptions, bD as PartialSig, bE as ProviderClass, P as ReadonlyWalletConfig, k as RestArkProvider, bF as RestDelegateProvider, bG as RestDelegatorProvider, l as RestIndexerProvider, bH as ScanContractsOptions, bI as ScanResult, bJ as ScheduledSession, bK as SettlementEventType, bL as SignRequest, a9 as SignedIntent, bM as SignerClassification, bN as SignerSet, bO as SubscriptionEvent, bP as SubscriptionHeartbeat, m as SubscriptionResponse, bQ as TapLeaves, bR as TapTreeCoder, bS as TapscriptType, ab as TimeHeight, bT as TreeNonces, w as TreeNoncesEvent, bU as TreePartialSigs, F as TreeSignatureEvent, u as TreeSigningStartedEvent, D as TreeTxEvent, bV as Tx, bW as TxHistoryRecord, bX as TxKey, T as TxNotification, bY as TxTreeNode, bZ as TxType, b_ as VirtualStatus, b$ as Vtxo, c0 as VtxoChain, a7 as VtxoManager, c1 as VtxoType, b as WalletConfig, c2 as WalletMode, c3 as boardingResolver, c4 as canRecoverOnchain, c5 as canSpendOffchain, c6 as classifyAgainstSignerSet, c7 as classifyContractSigner, c8 as createDefaultActivityRegistry, c9 as createExitChainResolver, ca as decodeTapscript, cb as getNetwork, cc as getSequence, cd as hasCandidates, ce as hasTerminalSpend, cf as isBatchSignable, cg as isCooperativelyMigratable, ch as isDiscoverable, ci as isExpired, cj as isPastExpiry, ck as isRecoverable, cl as isSpendable, cm as isSubdust, cn as isTerminalIntentState, co as isVirtualCoin, cp as isVtxoExpiringSoon, cq as networks, cr as signerSetFromInfo, cs as toXOnlySignerHex } from './ark-B69ugeJw.cjs';
|
|
3
|
+
import { P as Program, A as ArkadeParamValue, a as ArkadeProgramScript, b as ProgramKeys, c as ArkadeArgValue, C as CompiledProgramFunction, d as ArkadeFunction, I as InputRef, e as InputDef, f as ArkadeValueType, g as ArkadeArgType, h as ArkadeContractParams, i as ArkadeSegment, j as AsmToken, S as SUPPORTED_PROGRAM_VERSION, k as SignerRef, T as TapscriptSegment, W as WitnessRef, l as deserializeArkadeContractParams, p as parseArtifact, r as resolveAsm, s as serializeArkadeContractParams, m as stringifyArtifact, v as validateProgram, w as witnessRefToBytes } from './index-tzAInyiX.cjs';
|
|
4
|
+
export { n as ArkadeContractHandler, B as BoardingContractHandler, o as BoardingContractParams, D as DefaultContractHandler, q as DefaultContractParams, t as DelegateContractHandler, u as DelegateContractParams, V as VHTLC, x as VHTLCContractHandler, y as VHTLCContractParams, z as contractHandlers } from './index-tzAInyiX.cjs';
|
|
5
|
+
import { D as DefaultVtxo } from './delegate-C_Y2YrXC.cjs';
|
|
6
|
+
export { a as DelegateVtxo } from './delegate-C_Y2YrXC.cjs';
|
|
7
|
+
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot, P as ProviderConnectionState, B as Batch } from './wallet-B6Xiferv.cjs';
|
|
8
|
+
export { A as ArkError, d as ArkErrorName, e as ArkadeCashClaimResult, f as ArkadeCashCreateError, g as ArkadeCashUnclaimedReason, h as ArkadeCashUnclaimedVtxo, i as BoardingUtxoGroup, I as IncomingFunds, j as ProviderKind, k as ProviderUnavailableError, S as ServerInfoSource, l as isArkError, m as maybeArkError, s as selectVirtualCoins, w as waitForIncomingFunds } from './wallet-B6Xiferv.cjs';
|
|
9
9
|
import { Bytes, BTC_NETWORK } from '@scure/btc-signer/utils.js';
|
|
10
10
|
import { P2TR } from '@scure/btc-signer/payment.js';
|
|
11
11
|
import { Transaction as Transaction$1, OP, Script, ScriptType } from '@scure/btc-signer';
|
|
@@ -898,6 +898,8 @@ type Initialize = {
|
|
|
898
898
|
settlementConfig?: SettlementConfig | false;
|
|
899
899
|
walletMode?: "auto" | "static" | "hd";
|
|
900
900
|
watcherConfig?: Partial<Omit<ContractWatcherConfig, "indexerProvider">>;
|
|
901
|
+
/** @see WalletConfig.lookAheadWindow */
|
|
902
|
+
lookAheadWindow?: number;
|
|
901
903
|
/**
|
|
902
904
|
* Page-supplied per-operation timeout map. Keys are message types
|
|
903
905
|
* (e.g. "SETTLE"). Overrides constructor-supplied
|
|
@@ -1792,6 +1794,12 @@ declare class HDDescriptorProvider implements DescriptorProvider, ReceiveRotator
|
|
|
1792
1794
|
* re-derive the existing index rather than burn a new one.
|
|
1793
1795
|
*/
|
|
1794
1796
|
getCurrentSigningDescriptor(): Promise<string | undefined>;
|
|
1797
|
+
/**
|
|
1798
|
+
* The most recently allocated index, or `undefined` when nothing has ever
|
|
1799
|
+
* been allocated on this repo. Read-only peek at the watermark that
|
|
1800
|
+
* {@link getNextSigningDescriptor} advances.
|
|
1801
|
+
*/
|
|
1802
|
+
getLastIndexUsed(): Promise<number | undefined>;
|
|
1795
1803
|
/**
|
|
1796
1804
|
* Monotonically advance the allocation watermark so the next
|
|
1797
1805
|
* `getNextSigningDescriptor()` skips indices discovered by a restore
|
|
@@ -2564,6 +2572,13 @@ interface ServiceWorkerWalletOptions {
|
|
|
2564
2572
|
walletMode?: ServiceWorkerWalletMode;
|
|
2565
2573
|
/** Optional contract watcher configuration forwarded to the worker wallet. */
|
|
2566
2574
|
watcherConfig?: Partial<Omit<ContractWatcherConfig, "indexerProvider">>;
|
|
2575
|
+
/**
|
|
2576
|
+
* HD look-ahead window forwarded to the worker wallet. Only takes effect
|
|
2577
|
+
* together with `walletMode: 'hd'`.
|
|
2578
|
+
*
|
|
2579
|
+
* @see WalletConfig.lookAheadWindow
|
|
2580
|
+
*/
|
|
2581
|
+
lookAheadWindow?: number;
|
|
2567
2582
|
/**
|
|
2568
2583
|
* Per-request timeout overrides for wallet-updater messages.
|
|
2569
2584
|
* @see DEFAULT_MESSAGE_TIMEOUTS
|
|
@@ -2607,6 +2622,7 @@ type MessageBusInitConfig = {
|
|
|
2607
2622
|
settlementConfig?: SettlementConfig | false;
|
|
2608
2623
|
walletMode?: ServiceWorkerWalletMode;
|
|
2609
2624
|
watcherConfig?: Partial<Omit<ContractWatcherConfig, "indexerProvider">>;
|
|
2625
|
+
lookAheadWindow?: number;
|
|
2610
2626
|
messageTimeouts?: Record<string, number>;
|
|
2611
2627
|
};
|
|
2612
2628
|
declare class ServiceWorkerReadonlyWallet implements IReadonlyWallet {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { K as ReadonlyIdentity, a as Identity,
|
|
2
|
-
export {
|
|
3
|
-
import { P as Program, A as ArkadeParamValue, a as ArkadeProgramScript, b as ProgramKeys, c as ArkadeArgValue, C as CompiledProgramFunction, d as ArkadeFunction, I as InputRef, e as InputDef, f as ArkadeValueType, g as ArkadeArgType, h as ArkadeContractParams, i as ArkadeSegment, j as AsmToken, S as SUPPORTED_PROGRAM_VERSION, k as SignerRef, T as TapscriptSegment, W as WitnessRef, l as deserializeArkadeContractParams, p as parseArtifact, r as resolveAsm, s as serializeArkadeContractParams, m as stringifyArtifact, v as validateProgram, w as witnessRefToBytes } from './index-
|
|
4
|
-
export { n as ArkadeContractHandler, B as BoardingContractHandler, o as BoardingContractParams, D as DefaultContractHandler, q as DefaultContractParams, t as DelegateContractHandler, u as DelegateContractParams, V as VHTLC, x as VHTLCContractHandler, y as VHTLCContractParams, z as contractHandlers } from './index-
|
|
5
|
-
import { D as DefaultVtxo } from './delegate-
|
|
6
|
-
export { a as DelegateVtxo } from './delegate-
|
|
7
|
-
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot, P as ProviderConnectionState, B as Batch } from './wallet-
|
|
8
|
-
export { A as ArkError, d as ArkErrorName, e as ArkadeCashClaimResult, f as ArkadeCashCreateError, g as ArkadeCashUnclaimedReason, h as ArkadeCashUnclaimedVtxo, i as BoardingUtxoGroup, I as IncomingFunds, j as ProviderKind, k as ProviderUnavailableError, S as ServerInfoSource, l as isArkError, m as maybeArkError, s as selectVirtualCoins, w as waitForIncomingFunds } from './wallet-
|
|
1
|
+
import { K as ReadonlyIdentity, a as Identity, al as DescriptorSigningRequest, am as Transaction, a8 as SignerSession, Q as IntentRepository, af as ArkIntent, ag as IntentFilter, ah as Outpoint, U as VirtualTxRepository, ai as VirtualTx, aj as VtxoBranch, W as WalletRepository, t as ExtendedVirtualCoin, ac as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, ad as WalletState, s as Contract, C as ContractRepository, ae as ContractFilter, an as IntentFeeConfig, ao as OffchainInput, ap as FeeAmount, aq as OnchainInput, ar as FeeOutput, n as ArkProvider, a6 as SettlementConfig, as as ContractWatcherConfig, at as Asset, R as Recipient, I as IWallet, au as FeeInfo, i as SettlementEvent, H as DescriptorProvider, h as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, av as CreateContractParams, aw as GetContractsFilter, r as VirtualCoin, ax as GetSpendablePathsOptions, ay as GetAllSpendingPathsOptions, az as IssuanceParams, aA as ReissuanceParams, aB as BurnParams, aC as RenewVtxosOptions, c as WalletBalance, _ as ContractSyncState, aD as ContractWithVtxos, aE as PathSelection, aF as ContractEvent, aG as AssetDetails, aH as IssuanceResult, aI as DelegateInfo, aJ as MigrationGlobalSkipReason, aK as MigrationLegSkipReason, aL as SignerStatus, J as IReadonlyWallet, d as ActivityRegistry, Z as IReadonlyAssetManager, aM as StorageConfig, e as Activity, N as NormalizedExtendedVirtualCoin, f as IContractManager, j as IAssetManager, g as IDelegateManager, aN as IVtxoManager, O as OnchainProvider, L as Network, $ as NetworkName, a2 as Coin, aO as ExplorerTransaction, q as TapLeafScript, aP as EncodedVtxoScript, a5 as CSVMultisigTapscript, p as RelativeTimelock, V as VtxoScript, aQ as Status, a1 as ArkAddress, aa as Intent, aR as ChainTx, o as IndexerProvider, v as TxTree, aS as PathContext } from './ark-B69ugeJw.js';
|
|
2
|
+
export { aT as ActivityIntent, aU as ActivityResolver, a0 as ArkInfo, aV as ArkIntentState, aW as ArkTapscript, aX as AssetMetadata, aY as BaseWalletConfig, z as BatchFailedEvent, x as BatchFinalizationEvent, y as BatchFinalizedEvent, aZ as BatchInfo, a_ as BatchSignableIdentity, B as BatchStartedEvent, a$ as CLTVMultisigTapscript, b0 as CandidateDeps, b1 as ChainTxType, ak as ChainedTxType, b2 as CommitmentTx, b3 as ConditionCSVMultisigTapscript, b4 as ConditionMultisigTapscript, b5 as ContractBalance, b6 as ContractEventCallback, b7 as ContractHandler, a3 as ContractManager, a4 as ContractManagerConfig, b8 as ContractState, b9 as ContractVtxo, ba as ContractWatcher, bb as DelegateManagerImpl, bc as DelegateOptions, M as DelegateProvider, bd as DelegatorManagerImpl, be as DelegatorProvider, bf as DeprecatedSignerMigrationReport, bg as DeprecatedSignerReport, bh as DigestMismatchError, bi as Discoverable, bj as DiscoveredContract, bk as DiscoveryDeps, bl as ESPLORA_URL, bm as EsploraProvider, X as ExitCaptureMode, bn as ExitChainResolver, Y as ExitDataSource, bo as ExtendedContractVtxo, bp as GroupMembership, bq as HandlerError, br as IDelegatorManager, bs as INTENT_TERMINAL_STATES, bt as IndexerTxType, bu as KnownMetadata, bv as MigrateDeprecatedSignerOptions, bw as MigrationLegReport, bx as MigrationVtxoRef, by as MultisigTapscript, bz as Nonces, bA as Output, bB as PageResponse, bC as PaginationOptions, bD as PartialSig, bE as ProviderClass, P as ReadonlyWalletConfig, k as RestArkProvider, bF as RestDelegateProvider, bG as RestDelegatorProvider, l as RestIndexerProvider, bH as ScanContractsOptions, bI as ScanResult, bJ as ScheduledSession, bK as SettlementEventType, bL as SignRequest, a9 as SignedIntent, bM as SignerClassification, bN as SignerSet, bO as SubscriptionEvent, bP as SubscriptionHeartbeat, m as SubscriptionResponse, bQ as TapLeaves, bR as TapTreeCoder, bS as TapscriptType, ab as TimeHeight, bT as TreeNonces, w as TreeNoncesEvent, bU as TreePartialSigs, F as TreeSignatureEvent, u as TreeSigningStartedEvent, D as TreeTxEvent, bV as Tx, bW as TxHistoryRecord, bX as TxKey, T as TxNotification, bY as TxTreeNode, bZ as TxType, b_ as VirtualStatus, b$ as Vtxo, c0 as VtxoChain, a7 as VtxoManager, c1 as VtxoType, b as WalletConfig, c2 as WalletMode, c3 as boardingResolver, c4 as canRecoverOnchain, c5 as canSpendOffchain, c6 as classifyAgainstSignerSet, c7 as classifyContractSigner, c8 as createDefaultActivityRegistry, c9 as createExitChainResolver, ca as decodeTapscript, cb as getNetwork, cc as getSequence, cd as hasCandidates, ce as hasTerminalSpend, cf as isBatchSignable, cg as isCooperativelyMigratable, ch as isDiscoverable, ci as isExpired, cj as isPastExpiry, ck as isRecoverable, cl as isSpendable, cm as isSubdust, cn as isTerminalIntentState, co as isVirtualCoin, cp as isVtxoExpiringSoon, cq as networks, cr as signerSetFromInfo, cs as toXOnlySignerHex } from './ark-B69ugeJw.js';
|
|
3
|
+
import { P as Program, A as ArkadeParamValue, a as ArkadeProgramScript, b as ProgramKeys, c as ArkadeArgValue, C as CompiledProgramFunction, d as ArkadeFunction, I as InputRef, e as InputDef, f as ArkadeValueType, g as ArkadeArgType, h as ArkadeContractParams, i as ArkadeSegment, j as AsmToken, S as SUPPORTED_PROGRAM_VERSION, k as SignerRef, T as TapscriptSegment, W as WitnessRef, l as deserializeArkadeContractParams, p as parseArtifact, r as resolveAsm, s as serializeArkadeContractParams, m as stringifyArtifact, v as validateProgram, w as witnessRefToBytes } from './index-BWF-C9eh.js';
|
|
4
|
+
export { n as ArkadeContractHandler, B as BoardingContractHandler, o as BoardingContractParams, D as DefaultContractHandler, q as DefaultContractParams, t as DelegateContractHandler, u as DelegateContractParams, V as VHTLC, x as VHTLCContractHandler, y as VHTLCContractParams, z as contractHandlers } from './index-BWF-C9eh.js';
|
|
5
|
+
import { D as DefaultVtxo } from './delegate-BU-Cpyjw.js';
|
|
6
|
+
export { a as DelegateVtxo } from './delegate-BU-Cpyjw.js';
|
|
7
|
+
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot, P as ProviderConnectionState, B as Batch } from './wallet-CuHAI-eW.js';
|
|
8
|
+
export { A as ArkError, d as ArkErrorName, e as ArkadeCashClaimResult, f as ArkadeCashCreateError, g as ArkadeCashUnclaimedReason, h as ArkadeCashUnclaimedVtxo, i as BoardingUtxoGroup, I as IncomingFunds, j as ProviderKind, k as ProviderUnavailableError, S as ServerInfoSource, l as isArkError, m as maybeArkError, s as selectVirtualCoins, w as waitForIncomingFunds } from './wallet-CuHAI-eW.js';
|
|
9
9
|
import { Bytes, BTC_NETWORK } from '@scure/btc-signer/utils.js';
|
|
10
10
|
import { P2TR } from '@scure/btc-signer/payment.js';
|
|
11
11
|
import { Transaction as Transaction$1, OP, Script, ScriptType } from '@scure/btc-signer';
|
|
@@ -898,6 +898,8 @@ type Initialize = {
|
|
|
898
898
|
settlementConfig?: SettlementConfig | false;
|
|
899
899
|
walletMode?: "auto" | "static" | "hd";
|
|
900
900
|
watcherConfig?: Partial<Omit<ContractWatcherConfig, "indexerProvider">>;
|
|
901
|
+
/** @see WalletConfig.lookAheadWindow */
|
|
902
|
+
lookAheadWindow?: number;
|
|
901
903
|
/**
|
|
902
904
|
* Page-supplied per-operation timeout map. Keys are message types
|
|
903
905
|
* (e.g. "SETTLE"). Overrides constructor-supplied
|
|
@@ -1792,6 +1794,12 @@ declare class HDDescriptorProvider implements DescriptorProvider, ReceiveRotator
|
|
|
1792
1794
|
* re-derive the existing index rather than burn a new one.
|
|
1793
1795
|
*/
|
|
1794
1796
|
getCurrentSigningDescriptor(): Promise<string | undefined>;
|
|
1797
|
+
/**
|
|
1798
|
+
* The most recently allocated index, or `undefined` when nothing has ever
|
|
1799
|
+
* been allocated on this repo. Read-only peek at the watermark that
|
|
1800
|
+
* {@link getNextSigningDescriptor} advances.
|
|
1801
|
+
*/
|
|
1802
|
+
getLastIndexUsed(): Promise<number | undefined>;
|
|
1795
1803
|
/**
|
|
1796
1804
|
* Monotonically advance the allocation watermark so the next
|
|
1797
1805
|
* `getNextSigningDescriptor()` skips indices discovered by a restore
|
|
@@ -2564,6 +2572,13 @@ interface ServiceWorkerWalletOptions {
|
|
|
2564
2572
|
walletMode?: ServiceWorkerWalletMode;
|
|
2565
2573
|
/** Optional contract watcher configuration forwarded to the worker wallet. */
|
|
2566
2574
|
watcherConfig?: Partial<Omit<ContractWatcherConfig, "indexerProvider">>;
|
|
2575
|
+
/**
|
|
2576
|
+
* HD look-ahead window forwarded to the worker wallet. Only takes effect
|
|
2577
|
+
* together with `walletMode: 'hd'`.
|
|
2578
|
+
*
|
|
2579
|
+
* @see WalletConfig.lookAheadWindow
|
|
2580
|
+
*/
|
|
2581
|
+
lookAheadWindow?: number;
|
|
2567
2582
|
/**
|
|
2568
2583
|
* Per-request timeout overrides for wallet-updater messages.
|
|
2569
2584
|
* @see DEFAULT_MESSAGE_TIMEOUTS
|
|
@@ -2607,6 +2622,7 @@ type MessageBusInitConfig = {
|
|
|
2607
2622
|
settlementConfig?: SettlementConfig | false;
|
|
2608
2623
|
walletMode?: ServiceWorkerWalletMode;
|
|
2609
2624
|
watcherConfig?: Partial<Omit<ContractWatcherConfig, "indexerProvider">>;
|
|
2625
|
+
lookAheadWindow?: number;
|
|
2610
2626
|
messageTimeouts?: Record<string, number>;
|
|
2611
2627
|
};
|
|
2612
2628
|
declare class ServiceWorkerReadonlyWallet implements IReadonlyWallet {
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ARKADE_MAGIC, ActivityRegistry, ArkNote, ArkadeCash, ArkadeCashCreateError, 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, EmulatorPacket, EsploraProvider, Estimator, Extension, ExtensionNotFoundError, 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, RestEmulatorProvider, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, UnilateralExit, UnknownPacket, Unroll, VtxoManager, Wallet, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, arkade_exports as arkade, boardingResolver, buildForfeitTx, buildOffchainTx, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, createAssetPacket, createDefaultActivityRegistry, createExitChainResolver, decodeArkContract, deserializeExitPackage, encodeArkContract, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isBatchSignable, isCooperativelyMigratable, isDiscoverable, isRetryableProviderError, isSubdust, isTerminalIntentState, isValidArkAddress, isVtxoExpiringSoon, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, selectCoinsWithAsset, selectVirtualCoins, serializeExitPackage, setupServiceWorker, signerSetFromInfo, toXOnlySignerHex, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds } from './chunk-
|
|
2
|
-
export { ArkError, ArkErrorName, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ChainTxType, ConditionWitness, CosignerPublicKey, DigestMismatchError, FetchError, IndexerTxType, Intent, PrevArkTxField, PrevoutTxField, ProviderUnavailableError, RestArkProvider, RestIndexerProvider, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, asset_exports as asset, buildVersion, getArkPsbtFields, isArkError, maybeArkError, sdkVersion, setArkPsbtField } from './chunk-
|
|
3
|
-
export { ArkadeContractHandler, BoardingContractHandler, DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, VHTLC, VHTLCContractHandler, contractHandlers, isCltvSatisfied, isCsvSpendable } from './chunk-
|
|
1
|
+
export { ARKADE_MAGIC, ActivityRegistry, ArkNote, ArkadeCash, ArkadeCashCreateError, 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, EmulatorPacket, EsploraProvider, Estimator, Extension, ExtensionNotFoundError, 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, RestEmulatorProvider, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, UnilateralExit, UnknownPacket, Unroll, VtxoManager, Wallet, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, arkade_exports as arkade, boardingResolver, buildForfeitTx, buildOffchainTx, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, createAssetPacket, createDefaultActivityRegistry, createExitChainResolver, decodeArkContract, deserializeExitPackage, encodeArkContract, getMigrationStatus, getRandomId, hasBoardingTxExpired, hasCandidates, isArkContract, isBatchSignable, isCooperativelyMigratable, isDiscoverable, isRetryableProviderError, isSubdust, isTerminalIntentState, isValidArkAddress, isVtxoExpiringSoon, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, selectCoinsWithAsset, selectVirtualCoins, serializeExitPackage, setupServiceWorker, signerSetFromInfo, toXOnlySignerHex, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds } from './chunk-AXCKRS2D.js';
|
|
2
|
+
export { ArkError, ArkErrorName, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ChainTxType, ConditionWitness, CosignerPublicKey, DigestMismatchError, FetchError, IndexerTxType, Intent, PrevArkTxField, PrevoutTxField, ProviderUnavailableError, RestArkProvider, RestIndexerProvider, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, asset_exports as asset, buildVersion, getArkPsbtFields, isArkError, maybeArkError, sdkVersion, setArkPsbtField } from './chunk-ZK3JITHP.js';
|
|
3
|
+
export { ArkadeContractHandler, BoardingContractHandler, DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, VHTLC, VHTLCContractHandler, contractHandlers, isCltvSatisfied, isCsvSpendable } from './chunk-UZLQUWYP.js';
|
|
4
4
|
export { ArkAddress, CLTVMultisigTapscript, CSVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, MultisigTapscript, TapTreeCoder, VtxoScript, assembleBtcdTaprootTree, canRecoverOnchain, canSpendOffchain, decodeTapscript, getNetwork, getSequence, hasTerminalSpend, isExpired, isPastExpiry, isRecoverable, isSpendable, isVirtualCoin, networks, sequenceToTimelock, timelockToSequence } from './chunk-EFNLTS6Q.js';
|
|
5
5
|
import './chunk-NSBPE2FW.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
3
|
+
var chunkML33GFCH_cjs = require('../../chunk-ML33GFCH.cjs');
|
|
4
|
+
require('../../chunk-FZPYPEWN.cjs');
|
|
5
|
+
require('../../chunk-IEMPH7J6.cjs');
|
|
6
6
|
require('../../chunk-E7HB3GKK.cjs');
|
|
7
7
|
require('../../chunk-5BLDMQED.cjs');
|
|
8
8
|
|
|
@@ -38,7 +38,7 @@ var RealmWalletRepository = class {
|
|
|
38
38
|
await this.ensureInit();
|
|
39
39
|
this.realm.write(() => {
|
|
40
40
|
for (const vtxo of vtxos) {
|
|
41
|
-
const s =
|
|
41
|
+
const s = chunkML33GFCH_cjs.serializeVtxo(vtxo);
|
|
42
42
|
this.realm.create(
|
|
43
43
|
"ArkVtxo",
|
|
44
44
|
{
|
|
@@ -86,7 +86,7 @@ var RealmWalletRepository = class {
|
|
|
86
86
|
throw new Error("RealmWalletRepository requires an address");
|
|
87
87
|
}
|
|
88
88
|
for (const vtxo of vtxos) {
|
|
89
|
-
if (!
|
|
89
|
+
if (!chunkML33GFCH_cjs.isVtxoForScript(vtxo, key.script)) {
|
|
90
90
|
throw new Error(
|
|
91
91
|
`VTXO ${vtxo.txid}:${vtxo.vout} script mismatch: expected ${key.script}, got ${vtxo.script}`
|
|
92
92
|
);
|
|
@@ -111,7 +111,7 @@ var RealmWalletRepository = class {
|
|
|
111
111
|
await this.ensureInit();
|
|
112
112
|
this.realm.write(() => {
|
|
113
113
|
for (const utxo of utxos) {
|
|
114
|
-
const s =
|
|
114
|
+
const s = chunkML33GFCH_cjs.serializeUtxo(utxo);
|
|
115
115
|
this.realm.create(
|
|
116
116
|
"ArkUtxo",
|
|
117
117
|
{
|
|
@@ -164,7 +164,7 @@ var RealmWalletRepository = class {
|
|
|
164
164
|
amount: tx.amount,
|
|
165
165
|
settled: tx.settled,
|
|
166
166
|
createdAt: tx.createdAt,
|
|
167
|
-
assetsJson: tx.assets ? JSON.stringify(
|
|
167
|
+
assetsJson: tx.assets ? JSON.stringify(chunkML33GFCH_cjs.serializeAssets(tx.assets)) : null
|
|
168
168
|
},
|
|
169
169
|
"modified"
|
|
170
170
|
);
|
|
@@ -234,9 +234,9 @@ function vtxoObjectToDomain(obj) {
|
|
|
234
234
|
// Post-migration every row has `script`, but the backfill is
|
|
235
235
|
// idempotent: derive from `address` if the legacy column is still
|
|
236
236
|
// null (e.g. the migration hasn't run yet on this handle).
|
|
237
|
-
script: obj.script ??
|
|
237
|
+
script: obj.script ?? chunkML33GFCH_cjs.scriptFromArkAddress(obj.address)
|
|
238
238
|
};
|
|
239
|
-
return
|
|
239
|
+
return chunkML33GFCH_cjs.deserializeVtxo(serialized);
|
|
240
240
|
}
|
|
241
241
|
function utxoObjectToDomain(obj) {
|
|
242
242
|
const serialized = {
|
|
@@ -255,7 +255,7 @@ function utxoObjectToDomain(obj) {
|
|
|
255
255
|
status: JSON.parse(obj.statusJson),
|
|
256
256
|
extraWitness: obj.extraWitnessJson ? JSON.parse(obj.extraWitnessJson) : void 0
|
|
257
257
|
};
|
|
258
|
-
return
|
|
258
|
+
return chunkML33GFCH_cjs.deserializeUtxo(serialized);
|
|
259
259
|
}
|
|
260
260
|
function txObjectToDomain(obj) {
|
|
261
261
|
const tx = {
|
|
@@ -270,7 +270,7 @@ function txObjectToDomain(obj) {
|
|
|
270
270
|
createdAt: obj.createdAt
|
|
271
271
|
};
|
|
272
272
|
if (obj.assetsJson) {
|
|
273
|
-
tx.assets =
|
|
273
|
+
tx.assets = chunkML33GFCH_cjs.deserializeAssets(JSON.parse(obj.assetsJson));
|
|
274
274
|
}
|
|
275
275
|
return tx;
|
|
276
276
|
}
|
|
@@ -431,7 +431,7 @@ var RealmIntentRepository = class {
|
|
|
431
431
|
const clashes = [
|
|
432
432
|
...this.realm.objects("ArkIntent").filtered("intentId == $0", intent.intentId)
|
|
433
433
|
].map(toIntent);
|
|
434
|
-
|
|
434
|
+
chunkML33GFCH_cjs.assertIntentIdUnique(intent, clashes);
|
|
435
435
|
}
|
|
436
436
|
this.realm.create(
|
|
437
437
|
"ArkIntent",
|
|
@@ -460,14 +460,14 @@ var RealmIntentRepository = class {
|
|
|
460
460
|
}
|
|
461
461
|
async getIntents(filter) {
|
|
462
462
|
const all = [...this.realm.objects("ArkIntent")].map(toIntent).sort((a, b) => a.createdAt - b.createdAt || a.intentTxId.localeCompare(b.intentTxId));
|
|
463
|
-
const out = filter ? all.filter((i) =>
|
|
464
|
-
const { skip, end } =
|
|
463
|
+
const out = filter ? all.filter((i) => chunkML33GFCH_cjs.intentMatchesFilter(i, filter)) : all;
|
|
464
|
+
const { skip, end } = chunkML33GFCH_cjs.intentPageBounds(filter, out.length);
|
|
465
465
|
return out.slice(skip, end);
|
|
466
466
|
}
|
|
467
467
|
async getLockedVtxoOutpoints() {
|
|
468
468
|
const out = [];
|
|
469
469
|
for (const o of [...this.realm.objects("ArkIntent")].map(toIntent))
|
|
470
|
-
if (!
|
|
470
|
+
if (!chunkML33GFCH_cjs.isTerminalIntentState(o.state)) out.push(...o.intentVtxos);
|
|
471
471
|
return out;
|
|
472
472
|
}
|
|
473
473
|
async [Symbol.asyncDispose]() {
|
|
@@ -509,7 +509,7 @@ var RealmVirtualTxRepository = class {
|
|
|
509
509
|
txid: t.txid,
|
|
510
510
|
psbt: t.psbt ?? prev?.psbt ?? null,
|
|
511
511
|
expiresAt: t.expiresAt ?? prev?.expiresAt ?? null,
|
|
512
|
-
type:
|
|
512
|
+
type: chunkML33GFCH_cjs.mergeChainedTxType(t.type, prev?.type)
|
|
513
513
|
},
|
|
514
514
|
"modified"
|
|
515
515
|
);
|
|
@@ -742,7 +742,7 @@ function runArkRealmMigrations(oldRealm, newRealm) {
|
|
|
742
742
|
for (let i = 0; i < newVtxos.length; i++) {
|
|
743
743
|
const newVtxo = newVtxos[i];
|
|
744
744
|
if (!newVtxo.script) {
|
|
745
|
-
newVtxo.script =
|
|
745
|
+
newVtxo.script = chunkML33GFCH_cjs.scriptFromArkAddress(newVtxo.address);
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
748
|
const oldHasVirtualTx = Array.isArray(oldRealm?.schema) && oldRealm.schema.some((s) => s.name === "ArkVirtualTx");
|
|
@@ -759,7 +759,7 @@ function runArkRealmMigrations(oldRealm, newRealm) {
|
|
|
759
759
|
|
|
760
760
|
Object.defineProperty(exports, "ChainedTxType", {
|
|
761
761
|
enumerable: true,
|
|
762
|
-
get: function () { return
|
|
762
|
+
get: function () { return chunkML33GFCH_cjs.ChainedTxType; }
|
|
763
763
|
});
|
|
764
764
|
exports.ARK_REALM_SCHEMA_VERSION = ARK_REALM_SCHEMA_VERSION;
|
|
765
765
|
exports.ArkExperimentalRealmSchemas = ArkExperimentalRealmSchemas;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WalletRepository, t as ExtendedVirtualCoin,
|
|
2
|
-
export {
|
|
1
|
+
import { W as WalletRepository, t as ExtendedVirtualCoin, ac as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, ad as WalletState, C as ContractRepository, ae as ContractFilter, s as Contract, Q as IntentRepository, af as ArkIntent, ag as IntentFilter, ah as Outpoint, U as VirtualTxRepository, ai as VirtualTx, aj as VtxoBranch } from '../../ark-B69ugeJw.cjs';
|
|
2
|
+
export { ak as ChainedTxType } from '../../ark-B69ugeJw.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, t as ExtendedVirtualCoin,
|
|
2
|
-
export {
|
|
1
|
+
import { W as WalletRepository, t as ExtendedVirtualCoin, ac as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, ad as WalletState, C as ContractRepository, ae as ContractFilter, s as Contract, Q as IntentRepository, af as ArkIntent, ag as IntentFilter, ah as Outpoint, U as VirtualTxRepository, ai as VirtualTx, aj as VtxoBranch } from '../../ark-B69ugeJw.js';
|
|
2
|
+
export { ak as ChainedTxType } from '../../ark-B69ugeJw.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,7 +1,7 @@
|
|
|
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-
|
|
4
|
-
import '../../chunk-
|
|
1
|
+
import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, assertIntentIdUnique, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-AXCKRS2D.js';
|
|
2
|
+
export { ChainedTxType } from '../../chunk-AXCKRS2D.js';
|
|
3
|
+
import '../../chunk-ZK3JITHP.js';
|
|
4
|
+
import '../../chunk-UZLQUWYP.js';
|
|
5
5
|
import '../../chunk-EFNLTS6Q.js';
|
|
6
6
|
import '../../chunk-NSBPE2FW.js';
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
3
|
+
var chunkML33GFCH_cjs = require('../../chunk-ML33GFCH.cjs');
|
|
4
|
+
require('../../chunk-FZPYPEWN.cjs');
|
|
5
|
+
require('../../chunk-IEMPH7J6.cjs');
|
|
6
6
|
require('../../chunk-E7HB3GKK.cjs');
|
|
7
7
|
require('../../chunk-5BLDMQED.cjs');
|
|
8
8
|
|
|
@@ -154,7 +154,7 @@ var SQLiteWalletRepository = class {
|
|
|
154
154
|
for (const row of nullRows) {
|
|
155
155
|
await this.db.run(
|
|
156
156
|
`UPDATE ${this.tables.vtxos} SET script = ? WHERE txid = ? AND vout = ?`,
|
|
157
|
-
[
|
|
157
|
+
[chunkML33GFCH_cjs.scriptFromArkAddress(row.address), row.txid, row.vout]
|
|
158
158
|
);
|
|
159
159
|
}
|
|
160
160
|
const tempName = `${this.tables.vtxos}__migrate_tmp`;
|
|
@@ -225,7 +225,7 @@ var SQLiteWalletRepository = class {
|
|
|
225
225
|
async saveVtxos(address, vtxos) {
|
|
226
226
|
await this.ensureInit();
|
|
227
227
|
for (const vtxo of vtxos) {
|
|
228
|
-
const s =
|
|
228
|
+
const s = chunkML33GFCH_cjs.serializeVtxo(vtxo);
|
|
229
229
|
await this.db.run(
|
|
230
230
|
`INSERT OR REPLACE INTO ${this.tables.vtxos}
|
|
231
231
|
(txid, vout, value, address,
|
|
@@ -280,7 +280,7 @@ var SQLiteWalletRepository = class {
|
|
|
280
280
|
throw new Error("SQLiteWalletRepository requires an address");
|
|
281
281
|
}
|
|
282
282
|
for (const vtxo of vtxos) {
|
|
283
|
-
if (!
|
|
283
|
+
if (!chunkML33GFCH_cjs.isVtxoForScript(vtxo, key.script)) {
|
|
284
284
|
throw new Error(
|
|
285
285
|
`VTXO ${vtxo.txid}:${vtxo.vout} script mismatch: expected ${key.script}, got ${vtxo.script}`
|
|
286
286
|
);
|
|
@@ -304,7 +304,7 @@ var SQLiteWalletRepository = class {
|
|
|
304
304
|
async saveUtxos(address, utxos) {
|
|
305
305
|
await this.ensureInit();
|
|
306
306
|
for (const utxo of utxos) {
|
|
307
|
-
const s =
|
|
307
|
+
const s = chunkML33GFCH_cjs.serializeUtxo(utxo);
|
|
308
308
|
await this.db.run(
|
|
309
309
|
`INSERT OR REPLACE INTO ${this.tables.utxos}
|
|
310
310
|
(txid, vout, value, address,
|
|
@@ -360,7 +360,7 @@ var SQLiteWalletRepository = class {
|
|
|
360
360
|
tx.amount,
|
|
361
361
|
tx.settled ? 1 : 0,
|
|
362
362
|
tx.createdAt,
|
|
363
|
-
tx.assets ? JSON.stringify(
|
|
363
|
+
tx.assets ? JSON.stringify(chunkML33GFCH_cjs.serializeAssets(tx.assets)) : null
|
|
364
364
|
]
|
|
365
365
|
);
|
|
366
366
|
}
|
|
@@ -434,9 +434,9 @@ function vtxoRowToDomain(row) {
|
|
|
434
434
|
// Post-migration every row has `script`, but the backfill is
|
|
435
435
|
// idempotent: derive from `address` if the legacy column is still
|
|
436
436
|
// null (e.g. the migration hasn't run yet on this handle).
|
|
437
|
-
script: row.script ??
|
|
437
|
+
script: row.script ?? chunkML33GFCH_cjs.scriptFromArkAddress(row.address)
|
|
438
438
|
};
|
|
439
|
-
return
|
|
439
|
+
return chunkML33GFCH_cjs.deserializeVtxo(serialized);
|
|
440
440
|
}
|
|
441
441
|
function utxoRowToDomain(row) {
|
|
442
442
|
const serialized = {
|
|
@@ -455,7 +455,7 @@ function utxoRowToDomain(row) {
|
|
|
455
455
|
status: JSON.parse(row.status_json),
|
|
456
456
|
extraWitness: row.extra_witness_json ? JSON.parse(row.extra_witness_json) : void 0
|
|
457
457
|
};
|
|
458
|
-
return
|
|
458
|
+
return chunkML33GFCH_cjs.deserializeUtxo(serialized);
|
|
459
459
|
}
|
|
460
460
|
function txRowToDomain(row) {
|
|
461
461
|
const tx = {
|
|
@@ -470,7 +470,7 @@ function txRowToDomain(row) {
|
|
|
470
470
|
createdAt: row.created_at
|
|
471
471
|
};
|
|
472
472
|
if (row.assets_json) {
|
|
473
|
-
tx.assets =
|
|
473
|
+
tx.assets = chunkML33GFCH_cjs.deserializeAssets(JSON.parse(row.assets_json));
|
|
474
474
|
}
|
|
475
475
|
return tx;
|
|
476
476
|
}
|
|
@@ -718,8 +718,8 @@ var SQLiteIntentRepository = class {
|
|
|
718
718
|
`SELECT * FROM ${this.t} ORDER BY created_at ASC, intent_tx_id ASC`
|
|
719
719
|
);
|
|
720
720
|
let out = rows.map(rowToIntent);
|
|
721
|
-
if (filter) out = out.filter((i) =>
|
|
722
|
-
const { skip, end } =
|
|
721
|
+
if (filter) out = out.filter((i) => chunkML33GFCH_cjs.intentMatchesFilter(i, filter));
|
|
722
|
+
const { skip, end } = chunkML33GFCH_cjs.intentPageBounds(filter, out.length);
|
|
723
723
|
return out.slice(skip, end);
|
|
724
724
|
}
|
|
725
725
|
async getLockedVtxoOutpoints() {
|
|
@@ -727,7 +727,7 @@ var SQLiteIntentRepository = class {
|
|
|
727
727
|
const rows = await this.db.all(`SELECT * FROM ${this.t}`);
|
|
728
728
|
const out = [];
|
|
729
729
|
for (const r of rows) {
|
|
730
|
-
if (
|
|
730
|
+
if (chunkML33GFCH_cjs.isTerminalIntentState(r.state)) continue;
|
|
731
731
|
for (const o of JSON.parse(r.intent_vtxos_json)) out.push(o);
|
|
732
732
|
}
|
|
733
733
|
return out;
|
|
@@ -822,7 +822,7 @@ var SQLiteVirtualTxRepository = class {
|
|
|
822
822
|
const prev = prevByTxid.get(t.txid);
|
|
823
823
|
const psbt = t.psbt ?? prev?.psbt ?? null;
|
|
824
824
|
const expires = t.expiresAt ?? prev?.expires_at ?? null;
|
|
825
|
-
const type =
|
|
825
|
+
const type = chunkML33GFCH_cjs.mergeChainedTxType(t.type, prev?.type);
|
|
826
826
|
await this.db.run(
|
|
827
827
|
`INSERT OR REPLACE INTO ${this.tTx} (txid, psbt, expires_at, type) VALUES (?, ?, ?, ?)`,
|
|
828
828
|
[t.txid, psbt, expires, type]
|
|
@@ -908,7 +908,7 @@ function rowToTx(r) {
|
|
|
908
908
|
|
|
909
909
|
Object.defineProperty(exports, "ChainedTxType", {
|
|
910
910
|
enumerable: true,
|
|
911
|
-
get: function () { return
|
|
911
|
+
get: function () { return chunkML33GFCH_cjs.ChainedTxType; }
|
|
912
912
|
});
|
|
913
913
|
exports.SQLiteContractRepository = SQLiteContractRepository;
|
|
914
914
|
exports.SQLiteIntentRepository = SQLiteIntentRepository;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WalletRepository, t as ExtendedVirtualCoin,
|
|
2
|
-
export {
|
|
1
|
+
import { W as WalletRepository, t as ExtendedVirtualCoin, ac as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, ad as WalletState, C as ContractRepository, ae as ContractFilter, s as Contract, Q as IntentRepository, af as ArkIntent, ag as IntentFilter, ah as Outpoint, U as VirtualTxRepository, ai as VirtualTx, aj as VtxoBranch } from '../../ark-B69ugeJw.cjs';
|
|
2
|
+
export { ak as ChainedTxType } from '../../ark-B69ugeJw.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, t as ExtendedVirtualCoin,
|
|
2
|
-
export {
|
|
1
|
+
import { W as WalletRepository, t as ExtendedVirtualCoin, ac as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, ad as WalletState, C as ContractRepository, ae as ContractFilter, s as Contract, Q as IntentRepository, af as ArkIntent, ag as IntentFilter, ah as Outpoint, U as VirtualTxRepository, ai as VirtualTx, aj as VtxoBranch } from '../../ark-B69ugeJw.js';
|
|
2
|
+
export { ak as ChainedTxType } from '../../ark-B69ugeJw.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,7 +1,7 @@
|
|
|
1
|
-
import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-
|
|
2
|
-
export { ChainedTxType } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
1
|
+
import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-AXCKRS2D.js';
|
|
2
|
+
export { ChainedTxType } from '../../chunk-AXCKRS2D.js';
|
|
3
|
+
import '../../chunk-ZK3JITHP.js';
|
|
4
|
+
import '../../chunk-UZLQUWYP.js';
|
|
5
5
|
import '../../chunk-EFNLTS6Q.js';
|
|
6
6
|
import '../../chunk-NSBPE2FW.js';
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletRepository, C as ContractRepository, o as IndexerProvider, n as ArkProvider, r as VirtualCoin, s as Contract, t as ExtendedVirtualCoin } from './ark-
|
|
1
|
+
import { W as WalletRepository, C as ContractRepository, o as IndexerProvider, n as ArkProvider, r as VirtualCoin, s as Contract, t as ExtendedVirtualCoin } from './ark-B69ugeJw.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A task item represents a unit of work in the inbox.
|
|
@@ -111,4 +111,4 @@ interface CreateTaskDependenciesOptions {
|
|
|
111
111
|
*/
|
|
112
112
|
declare function createTaskDependencies(options: CreateTaskDependenciesOptions): TaskDependencies;
|
|
113
113
|
|
|
114
|
-
export { type CreateTaskDependenciesOptions as C, InMemoryTaskQueue as I, type TaskProcessor as T, type
|
|
114
|
+
export { type CreateTaskDependenciesOptions as C, InMemoryTaskQueue as I, type TaskProcessor as T, type TaskDependencies as a, type TaskItem as b, type TaskQueue as c, type TaskResult as d, createTaskDependencies as e, runTasks as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletRepository, C as ContractRepository, o as IndexerProvider, n as ArkProvider, r as VirtualCoin, s as Contract, t as ExtendedVirtualCoin } from './ark-
|
|
1
|
+
import { W as WalletRepository, C as ContractRepository, o as IndexerProvider, n as ArkProvider, r as VirtualCoin, s as Contract, t as ExtendedVirtualCoin } from './ark-B69ugeJw.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A task item represents a unit of work in the inbox.
|
|
@@ -111,4 +111,4 @@ interface CreateTaskDependenciesOptions {
|
|
|
111
111
|
*/
|
|
112
112
|
declare function createTaskDependencies(options: CreateTaskDependenciesOptions): TaskDependencies;
|
|
113
113
|
|
|
114
|
-
export { type CreateTaskDependenciesOptions as C, InMemoryTaskQueue as I, type TaskProcessor as T, type
|
|
114
|
+
export { type CreateTaskDependenciesOptions as C, InMemoryTaskQueue as I, type TaskProcessor as T, type TaskDependencies as a, type TaskItem as b, type TaskQueue as c, type TaskResult as d, createTaskDependencies as e, runTasks as r };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
require('../../chunk-
|
|
7
|
-
require('../../chunk-
|
|
3
|
+
var chunkE6RT5XYB_cjs = require('../../chunk-E6RT5XYB.cjs');
|
|
4
|
+
var chunk3Z5HK35D_cjs = require('../../chunk-3Z5HK35D.cjs');
|
|
5
|
+
var chunkML33GFCH_cjs = require('../../chunk-ML33GFCH.cjs');
|
|
6
|
+
require('../../chunk-FZPYPEWN.cjs');
|
|
7
|
+
require('../../chunk-IEMPH7J6.cjs');
|
|
8
8
|
require('../../chunk-E7HB3GKK.cjs');
|
|
9
9
|
require('../../chunk-5BLDMQED.cjs');
|
|
10
10
|
var TaskManager = require('expo-task-manager');
|
|
@@ -36,7 +36,7 @@ function defineExpoBackgroundTask(taskName, options) {
|
|
|
36
36
|
taskQueue,
|
|
37
37
|
walletRepository,
|
|
38
38
|
contractRepository,
|
|
39
|
-
processors = [
|
|
39
|
+
processors = [chunk3Z5HK35D_cjs.contractPollProcessor]
|
|
40
40
|
} = options;
|
|
41
41
|
TaskManager__namespace.defineTask(taskName, async () => {
|
|
42
42
|
try {
|
|
@@ -44,24 +44,24 @@ function defineExpoBackgroundTask(taskName, options) {
|
|
|
44
44
|
if (!config) {
|
|
45
45
|
return BackgroundTask__namespace.BackgroundTaskResult.Success;
|
|
46
46
|
}
|
|
47
|
-
const indexerProvider = new
|
|
48
|
-
const arkProvider = new
|
|
49
|
-
const deps =
|
|
47
|
+
const indexerProvider = new chunkE6RT5XYB_cjs.ExpoIndexerProvider(config.arkServerUrl);
|
|
48
|
+
const arkProvider = new chunkE6RT5XYB_cjs.ExpoArkProvider(config.arkServerUrl);
|
|
49
|
+
const deps = chunk3Z5HK35D_cjs.createTaskDependencies({
|
|
50
50
|
walletRepository,
|
|
51
51
|
contractRepository,
|
|
52
52
|
indexerProvider,
|
|
53
53
|
arkProvider
|
|
54
54
|
});
|
|
55
|
-
await
|
|
55
|
+
await chunk3Z5HK35D_cjs.runTasks(taskQueue, processors, deps);
|
|
56
56
|
const results = await taskQueue.getResults();
|
|
57
57
|
if (results.length > 0) {
|
|
58
58
|
await taskQueue.acknowledgeResults(results.map((r) => r.id));
|
|
59
59
|
}
|
|
60
|
-
const existing = await taskQueue.getTasks(
|
|
60
|
+
const existing = await taskQueue.getTasks(chunk3Z5HK35D_cjs.CONTRACT_POLL_TASK_TYPE);
|
|
61
61
|
if (existing.length === 0) {
|
|
62
62
|
const task = {
|
|
63
|
-
id:
|
|
64
|
-
type:
|
|
63
|
+
id: chunkML33GFCH_cjs.getRandomId(),
|
|
64
|
+
type: chunk3Z5HK35D_cjs.CONTRACT_POLL_TASK_TYPE,
|
|
65
65
|
data: {},
|
|
66
66
|
createdAt: Date.now()
|
|
67
67
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { W as WalletRepository, C as ContractRepository } from '../../ark-
|
|
2
|
-
import {
|
|
3
|
-
import { T as TaskProcessor } from '../../taskRunner-
|
|
1
|
+
import { W as WalletRepository, C as ContractRepository } from '../../ark-B69ugeJw.cjs';
|
|
2
|
+
import { a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-DScPdQAy.cjs';
|
|
3
|
+
import { T as TaskProcessor } from '../../taskRunner-ClwI8jU8.cjs';
|
|
4
4
|
import '@scure/btc-signer/transaction.js';
|
|
5
5
|
import '@scure/btc-signer/utils.js';
|
|
6
6
|
import '@scure/btc-signer/psbt.js';
|