@arkade-os/sdk 0.4.29 → 0.4.30
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/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/indexedDB.cjs +2 -2
- package/dist/adapters/indexedDB.js +1 -1
- package/dist/{ark-ChhTwpLf.d.cts → ark-C0TMXvwO.d.cts} +20 -3
- package/dist/{ark-ChhTwpLf.d.ts → ark-C0TMXvwO.d.ts} +20 -3
- package/dist/{asyncStorageTaskQueue-DW1-BpI7.d.cts → asyncStorageTaskQueue-DHOoNvRy.d.cts} +1 -1
- package/dist/{asyncStorageTaskQueue-DZ0nUuEJ.d.ts → asyncStorageTaskQueue-Iip3xMF_.d.ts} +1 -1
- package/dist/{chunk-BVP2U66Q.js → chunk-6NY27WL6.js} +27 -7
- package/dist/chunk-6NY27WL6.js.map +1 -0
- package/dist/{chunk-TH6T23XG.js → chunk-GRJKJNBO.js} +3 -3
- package/dist/{chunk-TH6T23XG.js.map → chunk-GRJKJNBO.js.map} +1 -1
- package/dist/{chunk-PJUFOJ2L.cjs → chunk-PCEE6DRL.cjs} +7 -7
- package/dist/{chunk-PJUFOJ2L.cjs.map → chunk-PCEE6DRL.cjs.map} +1 -1
- package/dist/{chunk-GDCTOSMV.cjs → chunk-XWJFOP5G.cjs} +27 -7
- package/dist/chunk-XWJFOP5G.cjs.map +1 -0
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/{delegate-4JBUkUhR.d.cts → delegate-CEk9RHVj.d.cts} +1 -1
- package/dist/{delegate-DN7RELL1.d.ts → delegate-Ds4Hi7Xy.d.ts} +1 -1
- package/dist/{index-Cn82bBUu.d.ts → index-DA9r_7Vg.d.ts} +2 -2
- package/dist/{index-DfT5xzgY.d.cts → index-WIAY0DDn.d.cts} +2 -2
- package/dist/index.cjs +86 -86
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +1 -1
- package/dist/repositories/realm/index.cjs +10 -10
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/realm/index.js +1 -1
- package/dist/repositories/sqlite/index.cjs +10 -10
- package/dist/repositories/sqlite/index.d.cts +1 -1
- package/dist/repositories/sqlite/index.d.ts +1 -1
- package/dist/repositories/sqlite/index.js +1 -1
- package/dist/{taskRunner-B-aPfHhK.d.cts → taskRunner-CdEVYgoP.d.cts} +1 -1
- package/dist/{taskRunner-B-vG08pX.d.ts → taskRunner-JNjIWWJi.d.ts} +1 -1
- package/dist/wallet/expo/background.cjs +8 -8
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +2 -2
- package/dist/wallet/expo/index.cjs +9 -9
- package/dist/wallet/expo/index.d.cts +4 -4
- package/dist/wallet/expo/index.d.ts +4 -4
- package/dist/wallet/expo/index.js +2 -2
- package/dist/{wallet-CCtqT2Wb.d.ts → wallet-BGL6SzKQ.d.ts} +2 -2
- package/dist/{wallet-DjgFb_4T.d.cts → wallet-CMgzKP0o.d.cts} +2 -2
- package/dist/worker/expo/index.cjs +6 -6
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-BVP2U66Q.js.map +0 -1
- package/dist/chunk-GDCTOSMV.cjs.map +0 -1
package/dist/adapters/expo.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as RestArkProvider, h as SettlementEvent, T as TxNotification, k as RestIndexerProvider, l as SubscriptionResponse } from '../ark-
|
|
2
|
-
export { m as ArkProvider, n as IndexerProvider } from '../ark-
|
|
1
|
+
import { j as RestArkProvider, h as SettlementEvent, T as TxNotification, k as RestIndexerProvider, l as SubscriptionResponse } from '../ark-C0TMXvwO.cjs';
|
|
2
|
+
export { m as ArkProvider, n as IndexerProvider } from '../ark-C0TMXvwO.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';
|
package/dist/adapters/expo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as RestArkProvider, h as SettlementEvent, T as TxNotification, k as RestIndexerProvider, l as SubscriptionResponse } from '../ark-
|
|
2
|
-
export { m as ArkProvider, n as IndexerProvider } from '../ark-
|
|
1
|
+
import { j as RestArkProvider, h as SettlementEvent, T as TxNotification, k as RestIndexerProvider, l as SubscriptionResponse } from '../ark-C0TMXvwO.js';
|
|
2
|
+
export { m as ArkProvider, n as IndexerProvider } from '../ark-C0TMXvwO.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
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXWJFOP5G_cjs = require('../chunk-XWJFOP5G.cjs');
|
|
4
4
|
require('../chunk-6FLL2Q36.cjs');
|
|
5
5
|
require('../chunk-IEO3XDKI.cjs');
|
|
6
6
|
require('../chunk-WMIPYZSB.cjs');
|
|
@@ -11,7 +11,7 @@ var IndexedDBStorageAdapter = class {
|
|
|
11
11
|
dbName;
|
|
12
12
|
version;
|
|
13
13
|
db = null;
|
|
14
|
-
constructor(dbName, version =
|
|
14
|
+
constructor(dbName, version = chunkXWJFOP5G_cjs.DB_VERSION) {
|
|
15
15
|
this.dbName = dbName;
|
|
16
16
|
this.version = version;
|
|
17
17
|
}
|
|
@@ -608,6 +608,19 @@ interface SettlementConfig {
|
|
|
608
608
|
* @returns true if virtual output expires within threshold, false otherwise
|
|
609
609
|
*/
|
|
610
610
|
declare function isVtxoExpiringSoon(vtxo: ExtendedVirtualCoin, thresholdMs: number): boolean;
|
|
611
|
+
/**
|
|
612
|
+
* Optional arguments for {@link IVtxoManager.renewVtxos}.
|
|
613
|
+
*/
|
|
614
|
+
interface RenewVtxosOptions {
|
|
615
|
+
/**
|
|
616
|
+
* Override the renewal threshold for this call only, in seconds.
|
|
617
|
+
*
|
|
618
|
+
* When provided, takes precedence over `SettlementConfig.vtxoThreshold`
|
|
619
|
+
* and the default (3 days). Useful for renewing only VTXOs that are
|
|
620
|
+
* more urgently expiring than the globally configured threshold.
|
|
621
|
+
*/
|
|
622
|
+
thresholdSeconds?: number;
|
|
623
|
+
}
|
|
611
624
|
/**
|
|
612
625
|
* VtxoManager is a unified class for managing virtual output lifecycle operations including
|
|
613
626
|
* recovery of swept/expired virtual outputs and renewal to prevent expiration.
|
|
@@ -662,7 +675,7 @@ interface IVtxoManager {
|
|
|
662
675
|
vtxoCount: number;
|
|
663
676
|
}>;
|
|
664
677
|
getExpiringVtxos(thresholdMs?: number): Promise<ExtendedVirtualCoin[]>;
|
|
665
|
-
renewVtxos(eventCallback?: (event: SettlementEvent) => void): Promise<string>;
|
|
678
|
+
renewVtxos(eventCallback?: (event: SettlementEvent) => void, options?: RenewVtxosOptions): Promise<string>;
|
|
666
679
|
getExpiredBoardingUtxos(): Promise<ExtendedCoin[]>;
|
|
667
680
|
sweepExpiredBoardingUtxos(): Promise<string>;
|
|
668
681
|
dispose(): Promise<void>;
|
|
@@ -784,6 +797,7 @@ declare class VtxoManager implements AsyncDisposable, IVtxoManager {
|
|
|
784
797
|
* primary way to prevent virtual outputs from expiring.
|
|
785
798
|
*
|
|
786
799
|
* @param eventCallback - Optional callback for settlement events
|
|
800
|
+
* @param options - Optional per-call overrides; see {@link RenewVtxosOptions}
|
|
787
801
|
* @returns Settlement transaction ID
|
|
788
802
|
* @throws Error if no virtual outputs available to renew
|
|
789
803
|
* @throws Error if total amount is below dust threshold
|
|
@@ -799,9 +813,12 @@ declare class VtxoManager implements AsyncDisposable, IVtxoManager {
|
|
|
799
813
|
* const txid = await manager.renewVtxos((event) => {
|
|
800
814
|
* console.log('Settlement event:', event.type);
|
|
801
815
|
* });
|
|
816
|
+
*
|
|
817
|
+
* // Renew only VTXOs that expire within 6 hours
|
|
818
|
+
* const txid = await manager.renewVtxos(undefined, { thresholdSeconds: 6 * 60 * 60 });
|
|
802
819
|
* ```
|
|
803
820
|
*/
|
|
804
|
-
renewVtxos(eventCallback?: (event: SettlementEvent) => void): Promise<string>;
|
|
821
|
+
renewVtxos(eventCallback?: (event: SettlementEvent) => void, options?: RenewVtxosOptions): Promise<string>;
|
|
805
822
|
/**
|
|
806
823
|
* Get boarding inputs whose timelock has expired.
|
|
807
824
|
*
|
|
@@ -3889,4 +3906,4 @@ declare namespace ProtoTypes {
|
|
|
3889
3906
|
export { };
|
|
3890
3907
|
}
|
|
3891
3908
|
|
|
3892
|
-
export {
|
|
3909
|
+
export { type SignerSession as $, type ArkTransaction as A, type BatchStartedEvent as B, type ContractRepository as C, type DescriptorProvider as D, type ExtendedVirtualCoin as E, type IReadonlyWallet as F, type GetVtxosFilter as G, type ReadonlyIdentity as H, type IWallet as I, type DelegateProvider as J, type ReadonlyWalletConfig as K, type IReadonlyAssetManager as L, type NetworkName as M, type Network as N, type OnchainProvider as O, type ArkInfo as P, ArkAddress as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type Coin as U, VtxoScript as V, type WalletRepository as W, ContractManager as X, CSVMultisigTapscript as Y, type SettlementConfig as Z, VtxoManager as _, type Identity as a, type HandlerError as a$, type SignedIntent as a0, Intent as a1, type VtxoRepositoryKey as a2, type WalletState as a3, type ContractFilter as a4, type DescriptorSigningRequest as a5, Transaction as a6, type IntentFeeConfig as a7, type OffchainInput as a8, FeeAmount as a9, type Asset as aA, type AssetMetadata as aB, type BaseWalletConfig as aC, type BatchInfo as aD, type BatchSignableIdentity as aE, CLTVMultisigTapscript as aF, ChainTxType as aG, type CommitmentTx as aH, ConditionCSVMultisigTapscript as aI, ConditionMultisigTapscript as aJ, type ContractBalance as aK, type ContractEventCallback as aL, type ContractHandler as aM, type ContractManagerConfig as aN, type ContractState as aO, type ContractVtxo as aP, ContractWatcher as aQ, DelegateManagerImpl as aR, type DelegateOptions as aS, DelegatorManagerImpl as aT, type DelegatorProvider as aU, type Discoverable as aV, type DiscoveredContract as aW, type DiscoveryDeps as aX, ESPLORA_URL as aY, EsploraProvider as aZ, type ExtendedContractVtxo as a_, type OnchainInput as aa, type FeeOutput as ab, type ContractWatcherConfig as ac, type FeeInfo as ad, type CreateContractParams as ae, type GetContractsFilter as af, type GetSpendablePathsOptions as ag, type GetAllSpendingPathsOptions as ah, type IssuanceParams as ai, type ReissuanceParams as aj, type BurnParams as ak, type RenewVtxosOptions as al, type ContractWithVtxos as am, type PathSelection as an, type ContractEvent as ao, type AssetDetails as ap, type IssuanceResult as aq, type DelegateInfo as ar, type StorageConfig as as, type IVtxoManager as at, type ExplorerTransaction as au, type EncodedVtxoScript as av, type Status as aw, type Outpoint as ax, type ChainTx as ay, type ArkTapscript as az, type WalletConfig as b, type IDelegatorManager as b0, IndexerTxType as b1, type KnownMetadata as b2, MultisigTapscript as b3, type Nonces as b4, type Output as b5, type PageResponse as b6, type PaginationOptions as b7, PartialSig as b8, type PathContext as b9, getSequence as bA, isBatchSignable as bB, isDiscoverable as bC, isExpired as bD, isRecoverable as bE, isSpendable as bF, isSubdust as bG, isVtxoExpiringSoon as bH, networks as bI, type ProviderClass as ba, RestDelegateProvider as bb, RestDelegatorProvider as bc, type ScanContractsOptions as bd, type ScanResult as be, type ScheduledSession as bf, SettlementEventType as bg, type SignRequest as bh, type SubscriptionEvent as bi, type SubscriptionHeartbeat as bj, type TapLeaves as bk, TapTreeCoder as bl, TapscriptType as bm, type TreeNonces as bn, type TreePartialSigs as bo, type Tx as bp, type TxHistoryRecord as bq, type TxKey as br, type TxTreeNode as bs, TxType as bt, type VirtualStatus as bu, type Vtxo as bv, type VtxoChain as bw, type VtxoType as bx, type WalletMode as by, decodeTapscript as bz, type WalletBalance as c, type ExtendedCoin as d, type IContractManager as e, type IDelegateManager as f, type SettleParams as g, type SettlementEvent as h, type IAssetManager as i, RestArkProvider as j, RestIndexerProvider as k, type SubscriptionResponse as l, type ArkProvider as m, type IndexerProvider as n, type RelativeTimelock as o, type TapLeafScript as p, type VirtualCoin as q, type Contract as r, type TreeSigningStartedEvent as s, TxTree as t, type TreeNoncesEvent as u, type BatchFinalizationEvent as v, type BatchFinalizedEvent as w, type BatchFailedEvent as x, type TreeTxEvent as y, type TreeSignatureEvent as z };
|
|
@@ -608,6 +608,19 @@ interface SettlementConfig {
|
|
|
608
608
|
* @returns true if virtual output expires within threshold, false otherwise
|
|
609
609
|
*/
|
|
610
610
|
declare function isVtxoExpiringSoon(vtxo: ExtendedVirtualCoin, thresholdMs: number): boolean;
|
|
611
|
+
/**
|
|
612
|
+
* Optional arguments for {@link IVtxoManager.renewVtxos}.
|
|
613
|
+
*/
|
|
614
|
+
interface RenewVtxosOptions {
|
|
615
|
+
/**
|
|
616
|
+
* Override the renewal threshold for this call only, in seconds.
|
|
617
|
+
*
|
|
618
|
+
* When provided, takes precedence over `SettlementConfig.vtxoThreshold`
|
|
619
|
+
* and the default (3 days). Useful for renewing only VTXOs that are
|
|
620
|
+
* more urgently expiring than the globally configured threshold.
|
|
621
|
+
*/
|
|
622
|
+
thresholdSeconds?: number;
|
|
623
|
+
}
|
|
611
624
|
/**
|
|
612
625
|
* VtxoManager is a unified class for managing virtual output lifecycle operations including
|
|
613
626
|
* recovery of swept/expired virtual outputs and renewal to prevent expiration.
|
|
@@ -662,7 +675,7 @@ interface IVtxoManager {
|
|
|
662
675
|
vtxoCount: number;
|
|
663
676
|
}>;
|
|
664
677
|
getExpiringVtxos(thresholdMs?: number): Promise<ExtendedVirtualCoin[]>;
|
|
665
|
-
renewVtxos(eventCallback?: (event: SettlementEvent) => void): Promise<string>;
|
|
678
|
+
renewVtxos(eventCallback?: (event: SettlementEvent) => void, options?: RenewVtxosOptions): Promise<string>;
|
|
666
679
|
getExpiredBoardingUtxos(): Promise<ExtendedCoin[]>;
|
|
667
680
|
sweepExpiredBoardingUtxos(): Promise<string>;
|
|
668
681
|
dispose(): Promise<void>;
|
|
@@ -784,6 +797,7 @@ declare class VtxoManager implements AsyncDisposable, IVtxoManager {
|
|
|
784
797
|
* primary way to prevent virtual outputs from expiring.
|
|
785
798
|
*
|
|
786
799
|
* @param eventCallback - Optional callback for settlement events
|
|
800
|
+
* @param options - Optional per-call overrides; see {@link RenewVtxosOptions}
|
|
787
801
|
* @returns Settlement transaction ID
|
|
788
802
|
* @throws Error if no virtual outputs available to renew
|
|
789
803
|
* @throws Error if total amount is below dust threshold
|
|
@@ -799,9 +813,12 @@ declare class VtxoManager implements AsyncDisposable, IVtxoManager {
|
|
|
799
813
|
* const txid = await manager.renewVtxos((event) => {
|
|
800
814
|
* console.log('Settlement event:', event.type);
|
|
801
815
|
* });
|
|
816
|
+
*
|
|
817
|
+
* // Renew only VTXOs that expire within 6 hours
|
|
818
|
+
* const txid = await manager.renewVtxos(undefined, { thresholdSeconds: 6 * 60 * 60 });
|
|
802
819
|
* ```
|
|
803
820
|
*/
|
|
804
|
-
renewVtxos(eventCallback?: (event: SettlementEvent) => void): Promise<string>;
|
|
821
|
+
renewVtxos(eventCallback?: (event: SettlementEvent) => void, options?: RenewVtxosOptions): Promise<string>;
|
|
805
822
|
/**
|
|
806
823
|
* Get boarding inputs whose timelock has expired.
|
|
807
824
|
*
|
|
@@ -3889,4 +3906,4 @@ declare namespace ProtoTypes {
|
|
|
3889
3906
|
export { };
|
|
3890
3907
|
}
|
|
3891
3908
|
|
|
3892
|
-
export {
|
|
3909
|
+
export { type SignerSession as $, type ArkTransaction as A, type BatchStartedEvent as B, type ContractRepository as C, type DescriptorProvider as D, type ExtendedVirtualCoin as E, type IReadonlyWallet as F, type GetVtxosFilter as G, type ReadonlyIdentity as H, type IWallet as I, type DelegateProvider as J, type ReadonlyWalletConfig as K, type IReadonlyAssetManager as L, type NetworkName as M, type Network as N, type OnchainProvider as O, type ArkInfo as P, ArkAddress as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type Coin as U, VtxoScript as V, type WalletRepository as W, ContractManager as X, CSVMultisigTapscript as Y, type SettlementConfig as Z, VtxoManager as _, type Identity as a, type HandlerError as a$, type SignedIntent as a0, Intent as a1, type VtxoRepositoryKey as a2, type WalletState as a3, type ContractFilter as a4, type DescriptorSigningRequest as a5, Transaction as a6, type IntentFeeConfig as a7, type OffchainInput as a8, FeeAmount as a9, type Asset as aA, type AssetMetadata as aB, type BaseWalletConfig as aC, type BatchInfo as aD, type BatchSignableIdentity as aE, CLTVMultisigTapscript as aF, ChainTxType as aG, type CommitmentTx as aH, ConditionCSVMultisigTapscript as aI, ConditionMultisigTapscript as aJ, type ContractBalance as aK, type ContractEventCallback as aL, type ContractHandler as aM, type ContractManagerConfig as aN, type ContractState as aO, type ContractVtxo as aP, ContractWatcher as aQ, DelegateManagerImpl as aR, type DelegateOptions as aS, DelegatorManagerImpl as aT, type DelegatorProvider as aU, type Discoverable as aV, type DiscoveredContract as aW, type DiscoveryDeps as aX, ESPLORA_URL as aY, EsploraProvider as aZ, type ExtendedContractVtxo as a_, type OnchainInput as aa, type FeeOutput as ab, type ContractWatcherConfig as ac, type FeeInfo as ad, type CreateContractParams as ae, type GetContractsFilter as af, type GetSpendablePathsOptions as ag, type GetAllSpendingPathsOptions as ah, type IssuanceParams as ai, type ReissuanceParams as aj, type BurnParams as ak, type RenewVtxosOptions as al, type ContractWithVtxos as am, type PathSelection as an, type ContractEvent as ao, type AssetDetails as ap, type IssuanceResult as aq, type DelegateInfo as ar, type StorageConfig as as, type IVtxoManager as at, type ExplorerTransaction as au, type EncodedVtxoScript as av, type Status as aw, type Outpoint as ax, type ChainTx as ay, type ArkTapscript as az, type WalletConfig as b, type IDelegatorManager as b0, IndexerTxType as b1, type KnownMetadata as b2, MultisigTapscript as b3, type Nonces as b4, type Output as b5, type PageResponse as b6, type PaginationOptions as b7, PartialSig as b8, type PathContext as b9, getSequence as bA, isBatchSignable as bB, isDiscoverable as bC, isExpired as bD, isRecoverable as bE, isSpendable as bF, isSubdust as bG, isVtxoExpiringSoon as bH, networks as bI, type ProviderClass as ba, RestDelegateProvider as bb, RestDelegatorProvider as bc, type ScanContractsOptions as bd, type ScanResult as be, type ScheduledSession as bf, SettlementEventType as bg, type SignRequest as bh, type SubscriptionEvent as bi, type SubscriptionHeartbeat as bj, type TapLeaves as bk, TapTreeCoder as bl, TapscriptType as bm, type TreeNonces as bn, type TreePartialSigs as bo, type Tx as bp, type TxHistoryRecord as bq, type TxKey as br, type TxTreeNode as bs, TxType as bt, type VirtualStatus as bu, type Vtxo as bv, type VtxoChain as bw, type VtxoType as bx, type WalletMode as by, decodeTapscript as bz, type WalletBalance as c, type ExtendedCoin as d, type IContractManager as e, type IDelegateManager as f, type SettleParams as g, type SettlementEvent as h, type IAssetManager as i, RestArkProvider as j, RestIndexerProvider as k, type SubscriptionResponse as l, type ArkProvider as m, type IndexerProvider as n, type RelativeTimelock as o, type TapLeafScript as p, type VirtualCoin as q, type Contract as r, type TreeSigningStartedEvent as s, TxTree as t, type TreeNoncesEvent as u, type BatchFinalizationEvent as v, type BatchFinalizedEvent as w, type BatchFailedEvent as x, type TreeTxEvent as y, type TreeSignatureEvent as z };
|
|
@@ -2599,6 +2599,7 @@ var VtxoManager = class _VtxoManager {
|
|
|
2599
2599
|
* primary way to prevent virtual outputs from expiring.
|
|
2600
2600
|
*
|
|
2601
2601
|
* @param eventCallback - Optional callback for settlement events
|
|
2602
|
+
* @param options - Optional per-call overrides; see {@link RenewVtxosOptions}
|
|
2602
2603
|
* @returns Settlement transaction ID
|
|
2603
2604
|
* @throws Error if no virtual outputs available to renew
|
|
2604
2605
|
* @throws Error if total amount is below dust threshold
|
|
@@ -2614,15 +2615,33 @@ var VtxoManager = class _VtxoManager {
|
|
|
2614
2615
|
* const txid = await manager.renewVtxos((event) => {
|
|
2615
2616
|
* console.log('Settlement event:', event.type);
|
|
2616
2617
|
* });
|
|
2618
|
+
*
|
|
2619
|
+
* // Renew only VTXOs that expire within 6 hours
|
|
2620
|
+
* const txid = await manager.renewVtxos(undefined, { thresholdSeconds: 6 * 60 * 60 });
|
|
2617
2621
|
* ```
|
|
2618
2622
|
*/
|
|
2619
|
-
async renewVtxos(eventCallback) {
|
|
2623
|
+
async renewVtxos(eventCallback, options) {
|
|
2624
|
+
if (options?.thresholdSeconds !== void 0) {
|
|
2625
|
+
const { thresholdSeconds } = options;
|
|
2626
|
+
if (typeof thresholdSeconds !== "number" || !Number.isFinite(thresholdSeconds) || thresholdSeconds <= 0) {
|
|
2627
|
+
throw new TypeError(
|
|
2628
|
+
`Invalid thresholdSeconds: expected a positive finite number, got ${String(thresholdSeconds)}`
|
|
2629
|
+
);
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2620
2632
|
if (this.renewalInProgress) {
|
|
2621
2633
|
throw new Error("Renewal already in progress");
|
|
2622
2634
|
}
|
|
2623
2635
|
this.renewalInProgress = true;
|
|
2624
2636
|
try {
|
|
2625
|
-
|
|
2637
|
+
let threshold;
|
|
2638
|
+
if (options?.thresholdSeconds !== void 0) {
|
|
2639
|
+
threshold = options.thresholdSeconds * 1e3;
|
|
2640
|
+
} else if (this.settlementConfig !== false && this.settlementConfig?.vtxoThreshold !== void 0) {
|
|
2641
|
+
threshold = this.settlementConfig.vtxoThreshold * 1e3;
|
|
2642
|
+
} else {
|
|
2643
|
+
threshold = DEFAULT_RENEWAL_CONFIG.thresholdMs;
|
|
2644
|
+
}
|
|
2626
2645
|
let vtxos = await this.getExpiringVtxos(threshold);
|
|
2627
2646
|
if (vtxos.length === 0) {
|
|
2628
2647
|
throw new Error("No VTXOs available to renew");
|
|
@@ -10907,7 +10926,7 @@ var WalletMessageHandler = class {
|
|
|
10907
10926
|
payload: e
|
|
10908
10927
|
})
|
|
10909
10928
|
);
|
|
10910
|
-
});
|
|
10929
|
+
}, message.payload);
|
|
10911
10930
|
return this.tagged({
|
|
10912
10931
|
id,
|
|
10913
10932
|
type: "RENEW_VTXOS_SUCCESS",
|
|
@@ -12524,11 +12543,12 @@ var ServiceWorkerWallet = class _ServiceWorkerWallet extends ServiceWorkerReadon
|
|
|
12524
12543
|
throw new Error(`Failed to get expiring vtxos: ${e}`);
|
|
12525
12544
|
}
|
|
12526
12545
|
},
|
|
12527
|
-
async renewVtxos(eventCallback) {
|
|
12546
|
+
async renewVtxos(eventCallback, options) {
|
|
12528
12547
|
const message = {
|
|
12529
12548
|
tag: messageTag,
|
|
12530
12549
|
type: "RENEW_VTXOS",
|
|
12531
|
-
id: getRandomId()
|
|
12550
|
+
id: getRandomId(),
|
|
12551
|
+
payload: options
|
|
12532
12552
|
};
|
|
12533
12553
|
try {
|
|
12534
12554
|
const response = await wallet.sendMessageWithEvents(
|
|
@@ -13939,5 +13959,5 @@ function isArkContract(str) {
|
|
|
13939
13959
|
}
|
|
13940
13960
|
|
|
13941
13961
|
export { ArkNote, AssetManager, BIP322, Batch, ContractManager, ContractRepositoryImpl, ContractWatcher, DB_VERSION, DEFAULT_MESSAGE_TIMEOUTS, DelegateManagerImpl, DelegateNotConfiguredError, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EsploraProvider, Estimator, HDDescriptorProvider, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, P2A, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestDelegatorProvider, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, Unroll, VtxoManager, Wallet2 as Wallet, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, buildForfeitTx, buildOffchainTx, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, deserializeAssets, deserializeUtxo, deserializeVtxo, encodeArkContract, extendVirtualCoinForContract, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isBatchSignable, isDiscoverable, isExpired, isRecoverable, isSpendable, isSubdust, isValidArkAddress, isVtxoExpiringSoon, isVtxoForScript, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, saveVtxosForContract, scriptFromArkAddress, serializeAssets, serializeUtxo, serializeVtxo, setupServiceWorker, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds, warnAndFilterVtxosForScript };
|
|
13942
|
-
//# sourceMappingURL=chunk-
|
|
13943
|
-
//# sourceMappingURL=chunk-
|
|
13962
|
+
//# sourceMappingURL=chunk-6NY27WL6.js.map
|
|
13963
|
+
//# sourceMappingURL=chunk-6NY27WL6.js.map
|