@arkade-os/sdk 0.4.49 → 0.4.50
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.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-nkSiPYNf.d.cts → ark-ApoclKQZ.d.cts} +59 -52
- package/dist/{ark-nkSiPYNf.d.ts → ark-ApoclKQZ.d.ts} +59 -52
- package/dist/{asyncStorageTaskQueue-DCaEE83p.d.ts → asyncStorageTaskQueue-BCWmdVg8.d.ts} +1 -1
- package/dist/{asyncStorageTaskQueue-DdxhsEz6.d.cts → asyncStorageTaskQueue-CIjgv1co.d.cts} +1 -1
- package/dist/{chunk-2LAJ3RTH.cjs → chunk-6BQTROB4.cjs} +139 -148
- package/dist/chunk-6BQTROB4.cjs.map +1 -0
- package/dist/{chunk-BLJQV3N4.js → chunk-7WSVP7DK.js} +3 -3
- package/dist/{chunk-BLJQV3N4.js.map → chunk-7WSVP7DK.js.map} +1 -1
- package/dist/{chunk-CPO2UB7L.js → chunk-AA4Q2J57.js} +3 -3
- package/dist/{chunk-CPO2UB7L.js.map → chunk-AA4Q2J57.js.map} +1 -1
- package/dist/{chunk-6UI5BFE7.cjs → chunk-Q4K2RSMY.cjs} +7 -7
- package/dist/{chunk-6UI5BFE7.cjs.map → chunk-Q4K2RSMY.cjs.map} +1 -1
- package/dist/{chunk-QDXQULVM.cjs → chunk-SIAVTHMZ.cjs} +3 -3
- package/dist/{chunk-QDXQULVM.cjs.map → chunk-SIAVTHMZ.cjs.map} +1 -1
- package/dist/{chunk-5QVBJUOG.js → chunk-SNTSB6M2.js} +34 -43
- package/dist/chunk-SNTSB6M2.js.map +1 -0
- package/dist/{chunk-XOLH3LFO.cjs → chunk-TO3SR7TY.cjs} +11 -11
- package/dist/{chunk-XOLH3LFO.cjs.map → chunk-TO3SR7TY.cjs.map} +1 -1
- package/dist/{chunk-HN25T276.js → chunk-ZXRSSBCF.js} +3 -3
- package/dist/{chunk-HN25T276.js.map → chunk-ZXRSSBCF.js.map} +1 -1
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/{delegate-Cqqw1T1J.d.cts → delegate-CCHPwQft.d.cts} +1 -1
- package/dist/{delegate-D6Orvyq7.d.ts → delegate-hJYMZN1D.d.ts} +1 -1
- package/dist/{index-CWoogah0.d.ts → index-5Y9h9OnO.d.ts} +2 -2
- package/dist/{index-Yd4hecbM.d.cts → index-8jE1XJpT.d.cts} +2 -2
- package/dist/index.cjs +145 -145
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- 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-BjB5QINR.d.cts → taskRunner-C3YLaM2x.d.cts} +1 -1
- package/dist/{taskRunner-Dw7xs60Q.d.ts → taskRunner-ChvV6Xrh.d.ts} +1 -1
- package/dist/wallet/expo/background.cjs +12 -12
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +4 -4
- package/dist/wallet/expo/index.cjs +12 -12
- package/dist/wallet/expo/index.d.cts +4 -4
- package/dist/wallet/expo/index.d.ts +4 -4
- package/dist/wallet/expo/index.js +3 -3
- package/dist/{wallet-CGkWu3xV.d.cts → wallet-B260BTJs.d.cts} +2 -2
- package/dist/{wallet-DyUHrPyN.d.ts → wallet-DIH0gVfW.d.ts} +2 -2
- 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-2LAJ3RTH.cjs.map +0 -1
- package/dist/chunk-5QVBJUOG.js.map +0 -1
package/dist/adapters/expo.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkTO3SR7TY_cjs = require('../chunk-TO3SR7TY.cjs');
|
|
4
|
+
require('../chunk-SIAVTHMZ.cjs');
|
|
5
5
|
require('../chunk-E7HB3GKK.cjs');
|
|
6
6
|
require('../chunk-5BLDMQED.cjs');
|
|
7
7
|
|
|
@@ -9,11 +9,11 @@ require('../chunk-5BLDMQED.cjs');
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "ExpoArkProvider", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkTO3SR7TY_cjs.ExpoArkProvider; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "ExpoIndexerProvider", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkTO3SR7TY_cjs.ExpoIndexerProvider; }
|
|
17
17
|
});
|
|
18
18
|
//# sourceMappingURL=expo.cjs.map
|
|
19
19
|
//# sourceMappingURL=expo.cjs.map
|
package/dist/adapters/expo.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../ark-
|
|
2
|
-
export { n as ArkProvider, o as IndexerProvider } from '../ark-
|
|
1
|
+
import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../ark-ApoclKQZ.cjs';
|
|
2
|
+
export { n as ArkProvider, o as IndexerProvider } from '../ark-ApoclKQZ.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 { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../ark-
|
|
2
|
-
export { n as ArkProvider, o as IndexerProvider } from '../ark-
|
|
1
|
+
import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../ark-ApoclKQZ.js';
|
|
2
|
+
export { n as ArkProvider, o as IndexerProvider } from '../ark-ApoclKQZ.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';
|
package/dist/adapters/expo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-ZXRSSBCF.js';
|
|
2
|
+
import '../chunk-AA4Q2J57.js';
|
|
3
3
|
import '../chunk-EFNLTS6Q.js';
|
|
4
4
|
import '../chunk-NSBPE2FW.js';
|
|
5
5
|
//# sourceMappingURL=expo.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunk6BQTROB4_cjs = require('../chunk-6BQTROB4.cjs');
|
|
4
|
+
require('../chunk-SIAVTHMZ.cjs');
|
|
5
5
|
require('../chunk-LJQ2VQBE.cjs');
|
|
6
6
|
require('../chunk-E7HB3GKK.cjs');
|
|
7
7
|
require('../chunk-5BLDMQED.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 = chunk6BQTROB4_cjs.DB_VERSION) {
|
|
15
15
|
this.dbName = dbName;
|
|
16
16
|
this.version = version;
|
|
17
17
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DB_VERSION } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { DB_VERSION } from '../chunk-SNTSB6M2.js';
|
|
2
|
+
import '../chunk-AA4Q2J57.js';
|
|
3
3
|
import '../chunk-MBSYQ3WX.js';
|
|
4
4
|
import '../chunk-EFNLTS6Q.js';
|
|
5
5
|
import '../chunk-NSBPE2FW.js';
|
|
@@ -1890,22 +1890,30 @@ interface VirtualTxRepository extends AsyncDisposable {
|
|
|
1890
1890
|
}
|
|
1891
1891
|
|
|
1892
1892
|
type RefreshVtxosOptions = {
|
|
1893
|
+
/**
|
|
1894
|
+
* Narrow the refresh to these scripts. A subset query, so the
|
|
1895
|
+
* cursor is not advanced: contracts outside the list may have data
|
|
1896
|
+
* we'd skip.
|
|
1897
|
+
*/
|
|
1893
1898
|
scripts?: string[];
|
|
1899
|
+
/**
|
|
1900
|
+
* Time window overriding the cursor-derived one. The cursor never
|
|
1901
|
+
* advances on a windowed query because the window may skip data
|
|
1902
|
+
* outside its bounds.
|
|
1903
|
+
*/
|
|
1894
1904
|
after?: number;
|
|
1905
|
+
/** @see after */
|
|
1895
1906
|
before?: number;
|
|
1896
1907
|
/**
|
|
1897
1908
|
* When true and `scripts` is not set, refresh every contract in
|
|
1898
|
-
* the repository
|
|
1899
|
-
*
|
|
1900
|
-
*
|
|
1901
|
-
*
|
|
1909
|
+
* the repository rather than the watcher's watched set — which
|
|
1910
|
+
* differs only for rows the watcher never registered, since
|
|
1911
|
+
* retirement doesn't narrow that set
|
|
1912
|
+
* (see {@link ContractWatcher.getWatchedContracts}).
|
|
1902
1913
|
*
|
|
1903
|
-
* Because this is a *superset* of the
|
|
1904
|
-
*
|
|
1905
|
-
*
|
|
1906
|
-
*
|
|
1907
|
-
* Ignored when `scripts` is set (the explicit list already
|
|
1908
|
-
* specifies what to refresh, regardless of contract state).
|
|
1914
|
+
* Because this is a *superset* of the watched set, the cursor
|
|
1915
|
+
* invariant still holds and the cursor advances normally (unless
|
|
1916
|
+
* `after` / `before` is also supplied).
|
|
1909
1917
|
*
|
|
1910
1918
|
* @defaultValue `false`
|
|
1911
1919
|
*/
|
|
@@ -2044,11 +2052,14 @@ interface IContractManager extends Disposable {
|
|
|
2044
2052
|
*/
|
|
2045
2053
|
updateContract(script: string, updates: Partial<Omit<Contract, "script" | "createdAt">>): Promise<Contract>;
|
|
2046
2054
|
/**
|
|
2047
|
-
* Convenience helper to update only the contract state.
|
|
2055
|
+
* Convenience helper to update only the contract state. Note
|
|
2056
|
+
* `inactive` does not stop watching; see {@link ContractState} and
|
|
2057
|
+
* {@link deleteContract}.
|
|
2048
2058
|
*/
|
|
2049
2059
|
setContractState(script: string, state: ContractState): Promise<void>;
|
|
2050
2060
|
/**
|
|
2051
|
-
* Delete a contract by script and stop watching it
|
|
2061
|
+
* Delete a contract by script and stop watching it. This — not
|
|
2062
|
+
* retiring via {@link setContractState} — is the stop-watching path.
|
|
2052
2063
|
*/
|
|
2053
2064
|
deleteContract(script: string): Promise<void>;
|
|
2054
2065
|
/**
|
|
@@ -2251,8 +2262,8 @@ declare class ContractManager implements IContractManager {
|
|
|
2251
2262
|
* Static factory method for creating a new ContractManager.
|
|
2252
2263
|
* Initialize the manager by loading persisted contracts and starting to watch.
|
|
2253
2264
|
*
|
|
2254
|
-
* After initialization, the manager automatically watches
|
|
2255
|
-
*
|
|
2265
|
+
* After initialization, the manager automatically watches every persisted
|
|
2266
|
+
* contract. Use `onContractEvent()` to register event callbacks.
|
|
2256
2267
|
*
|
|
2257
2268
|
* @param config ContractManagerConfig
|
|
2258
2269
|
*/
|
|
@@ -2398,11 +2409,15 @@ declare class ContractManager implements IContractManager {
|
|
|
2398
2409
|
*/
|
|
2399
2410
|
updateContractParams(script: string, updates: Contract["params"]): Promise<Contract>;
|
|
2400
2411
|
/**
|
|
2401
|
-
* Set a contract's state.
|
|
2412
|
+
* Set a contract's state. Retiring (`inactive`) keeps it watched;
|
|
2413
|
+
* see {@link ContractState}. To stop watching, use
|
|
2414
|
+
* {@link deleteContract}.
|
|
2402
2415
|
*/
|
|
2403
2416
|
setContractState(script: string, state: ContractState): Promise<void>;
|
|
2404
2417
|
/**
|
|
2405
|
-
* Delete a contract.
|
|
2418
|
+
* Delete a contract. Also removes it from the watcher — the only way
|
|
2419
|
+
* to stop watching a contract (retiring it via
|
|
2420
|
+
* {@link setContractState} does not).
|
|
2406
2421
|
*
|
|
2407
2422
|
* @param script - Contract script
|
|
2408
2423
|
*/
|
|
@@ -2442,22 +2457,10 @@ declare class ContractManager implements IContractManager {
|
|
|
2442
2457
|
/**
|
|
2443
2458
|
* Force refresh virtual outputs from the indexer.
|
|
2444
2459
|
*
|
|
2445
|
-
* Without options, re-fetches
|
|
2446
|
-
*
|
|
2447
|
-
*
|
|
2448
|
-
*
|
|
2449
|
-
* cursor is not advanced because contracts outside the list may
|
|
2450
|
-
* have data we'd skip).
|
|
2451
|
-
*
|
|
2452
|
-
* `includeInactive: true` (and no `scripts`) widens the refresh to
|
|
2453
|
-
* every contract in the repository, including ones marked
|
|
2454
|
-
* `inactive` and ones that have dropped out of the watcher's
|
|
2455
|
-
* active set. This is a *superset* of the watched set, so the
|
|
2456
|
-
* cursor invariant still holds and the cursor advances normally.
|
|
2457
|
-
*
|
|
2458
|
-
* `after` / `before` apply a caller-supplied time window. The
|
|
2459
|
-
* cursor never advances on a windowed query because the window
|
|
2460
|
-
* may skip data outside its bounds.
|
|
2460
|
+
* Without options, re-fetches the watcher's watched set and
|
|
2461
|
+
* advances the global cursor. Each option narrows or widens that
|
|
2462
|
+
* scope and may hold the cursor back — see
|
|
2463
|
+
* {@link RefreshVtxosOptions}.
|
|
2461
2464
|
*/
|
|
2462
2465
|
refreshVtxos(opts?: RefreshVtxosOptions): Promise<void>;
|
|
2463
2466
|
refreshOutpoints(outpoints: Outpoint[]): Promise<void>;
|
|
@@ -2478,11 +2481,10 @@ declare class ContractManager implements IContractManager {
|
|
|
2478
2481
|
* Sync virtual outputs for the given contracts against the indexer.
|
|
2479
2482
|
*
|
|
2480
2483
|
* When `options.contracts` is omitted the sync covers the full
|
|
2481
|
-
* watched set (
|
|
2482
|
-
*
|
|
2483
|
-
*
|
|
2484
|
-
*
|
|
2485
|
-
* pick up.
|
|
2484
|
+
* watched set ({@link ContractWatcher.getWatchedContracts}) and the
|
|
2485
|
+
* global cursor is advanced on success. Passing an explicit subset
|
|
2486
|
+
* leaves the cursor alone so a narrow poll can't hide data that
|
|
2487
|
+
* other contracts still need to pick up.
|
|
2486
2488
|
*/
|
|
2487
2489
|
private syncContracts;
|
|
2488
2490
|
/**
|
|
@@ -2516,7 +2518,12 @@ declare class ContractManager implements IContractManager {
|
|
|
2516
2518
|
}
|
|
2517
2519
|
|
|
2518
2520
|
/**
|
|
2519
|
-
* Contract state
|
|
2521
|
+
* Contract lifecycle state. Both states stay monitored — the watcher
|
|
2522
|
+
* subscribes and sweeps every registered contract regardless
|
|
2523
|
+
* (see {@link ContractWatcher.getWatchedContracts}), because a retired
|
|
2524
|
+
* receive address can still be paid. `inactive` only demotes a contract
|
|
2525
|
+
* out of receive-address selection; it does **not** unsubscribe it.
|
|
2526
|
+
* Use {@link IContractManager.deleteContract} to stop watching.
|
|
2520
2527
|
*/
|
|
2521
2528
|
type ContractState = "active" | "inactive";
|
|
2522
2529
|
/**
|
|
@@ -2985,10 +2992,10 @@ declare class ContractWatcher {
|
|
|
2985
2992
|
/**
|
|
2986
2993
|
* Add a contract to be watched.
|
|
2987
2994
|
*
|
|
2988
|
-
*
|
|
2995
|
+
* Once watching, every contract is subscribed and polled whatever
|
|
2996
|
+
* its state.
|
|
2989
2997
|
*
|
|
2990
|
-
*
|
|
2991
|
-
* (which may cause them to be watched even if inactive).
|
|
2998
|
+
* @see getWatchedContracts
|
|
2992
2999
|
*/
|
|
2993
3000
|
addContract(contract: Contract): Promise<void>;
|
|
2994
3001
|
/**
|
|
@@ -3012,15 +3019,15 @@ declare class ContractWatcher {
|
|
|
3012
3019
|
*/
|
|
3013
3020
|
getAllContracts(): Contract[];
|
|
3014
3021
|
/**
|
|
3015
|
-
*
|
|
3016
|
-
* - all active contracts, plus
|
|
3017
|
-
* - inactive contracts that still hold known virtual outputs
|
|
3018
|
-
* (the subscription keeps watching them so `vtxo_spent` events for
|
|
3019
|
-
* those unspent outputs are still observed).
|
|
3022
|
+
* Every registered contract, retired (`inactive`) ones included.
|
|
3020
3023
|
*
|
|
3021
|
-
*
|
|
3022
|
-
*
|
|
3023
|
-
*
|
|
3024
|
+
* Feeds both the subscription and the indexer sweep scope, so
|
|
3025
|
+
* narrowing it drops a contract from every background channel at
|
|
3026
|
+
* once. Nothing may be narrowed out: an Ark receive address can be
|
|
3027
|
+
* paid again after the wallet has rotated past it, and a payment
|
|
3028
|
+
* that lands outside every background channel is invisible until
|
|
3029
|
+
* some foreground read happens to sweep it. Retirement therefore
|
|
3030
|
+
* governs receive-address selection, not coverage.
|
|
3024
3031
|
*/
|
|
3025
3032
|
getWatchedContracts(): Contract[];
|
|
3026
3033
|
/**
|
|
@@ -3029,7 +3036,7 @@ declare class ContractWatcher {
|
|
|
3029
3036
|
*/
|
|
3030
3037
|
private getContractVtxos;
|
|
3031
3038
|
/**
|
|
3032
|
-
* Start watching for virtual output events across all
|
|
3039
|
+
* Start watching for virtual output events across all watched contracts.
|
|
3033
3040
|
*/
|
|
3034
3041
|
startWatching(callback: ContractEventCallback): Promise<() => void>;
|
|
3035
3042
|
/**
|
|
@@ -3045,7 +3052,7 @@ declare class ContractWatcher {
|
|
|
3045
3052
|
*/
|
|
3046
3053
|
getConnectionState(): ConnectionState;
|
|
3047
3054
|
/**
|
|
3048
|
-
* Force a poll of all
|
|
3055
|
+
* Force a poll of all watched contracts.
|
|
3049
3056
|
* Useful for manual refresh or after app resume.
|
|
3050
3057
|
*/
|
|
3051
3058
|
forcePoll(): Promise<void>;
|
|
@@ -3091,7 +3098,7 @@ declare class ContractWatcher {
|
|
|
3091
3098
|
/**
|
|
3092
3099
|
* Update the subscription with scripts that should be watched.
|
|
3093
3100
|
*
|
|
3094
|
-
*
|
|
3101
|
+
* @see getWatchedContracts
|
|
3095
3102
|
*/
|
|
3096
3103
|
private updateSubscription;
|
|
3097
3104
|
/**
|
|
@@ -1890,22 +1890,30 @@ interface VirtualTxRepository extends AsyncDisposable {
|
|
|
1890
1890
|
}
|
|
1891
1891
|
|
|
1892
1892
|
type RefreshVtxosOptions = {
|
|
1893
|
+
/**
|
|
1894
|
+
* Narrow the refresh to these scripts. A subset query, so the
|
|
1895
|
+
* cursor is not advanced: contracts outside the list may have data
|
|
1896
|
+
* we'd skip.
|
|
1897
|
+
*/
|
|
1893
1898
|
scripts?: string[];
|
|
1899
|
+
/**
|
|
1900
|
+
* Time window overriding the cursor-derived one. The cursor never
|
|
1901
|
+
* advances on a windowed query because the window may skip data
|
|
1902
|
+
* outside its bounds.
|
|
1903
|
+
*/
|
|
1894
1904
|
after?: number;
|
|
1905
|
+
/** @see after */
|
|
1895
1906
|
before?: number;
|
|
1896
1907
|
/**
|
|
1897
1908
|
* When true and `scripts` is not set, refresh every contract in
|
|
1898
|
-
* the repository
|
|
1899
|
-
*
|
|
1900
|
-
*
|
|
1901
|
-
*
|
|
1909
|
+
* the repository rather than the watcher's watched set — which
|
|
1910
|
+
* differs only for rows the watcher never registered, since
|
|
1911
|
+
* retirement doesn't narrow that set
|
|
1912
|
+
* (see {@link ContractWatcher.getWatchedContracts}).
|
|
1902
1913
|
*
|
|
1903
|
-
* Because this is a *superset* of the
|
|
1904
|
-
*
|
|
1905
|
-
*
|
|
1906
|
-
*
|
|
1907
|
-
* Ignored when `scripts` is set (the explicit list already
|
|
1908
|
-
* specifies what to refresh, regardless of contract state).
|
|
1914
|
+
* Because this is a *superset* of the watched set, the cursor
|
|
1915
|
+
* invariant still holds and the cursor advances normally (unless
|
|
1916
|
+
* `after` / `before` is also supplied).
|
|
1909
1917
|
*
|
|
1910
1918
|
* @defaultValue `false`
|
|
1911
1919
|
*/
|
|
@@ -2044,11 +2052,14 @@ interface IContractManager extends Disposable {
|
|
|
2044
2052
|
*/
|
|
2045
2053
|
updateContract(script: string, updates: Partial<Omit<Contract, "script" | "createdAt">>): Promise<Contract>;
|
|
2046
2054
|
/**
|
|
2047
|
-
* Convenience helper to update only the contract state.
|
|
2055
|
+
* Convenience helper to update only the contract state. Note
|
|
2056
|
+
* `inactive` does not stop watching; see {@link ContractState} and
|
|
2057
|
+
* {@link deleteContract}.
|
|
2048
2058
|
*/
|
|
2049
2059
|
setContractState(script: string, state: ContractState): Promise<void>;
|
|
2050
2060
|
/**
|
|
2051
|
-
* Delete a contract by script and stop watching it
|
|
2061
|
+
* Delete a contract by script and stop watching it. This — not
|
|
2062
|
+
* retiring via {@link setContractState} — is the stop-watching path.
|
|
2052
2063
|
*/
|
|
2053
2064
|
deleteContract(script: string): Promise<void>;
|
|
2054
2065
|
/**
|
|
@@ -2251,8 +2262,8 @@ declare class ContractManager implements IContractManager {
|
|
|
2251
2262
|
* Static factory method for creating a new ContractManager.
|
|
2252
2263
|
* Initialize the manager by loading persisted contracts and starting to watch.
|
|
2253
2264
|
*
|
|
2254
|
-
* After initialization, the manager automatically watches
|
|
2255
|
-
*
|
|
2265
|
+
* After initialization, the manager automatically watches every persisted
|
|
2266
|
+
* contract. Use `onContractEvent()` to register event callbacks.
|
|
2256
2267
|
*
|
|
2257
2268
|
* @param config ContractManagerConfig
|
|
2258
2269
|
*/
|
|
@@ -2398,11 +2409,15 @@ declare class ContractManager implements IContractManager {
|
|
|
2398
2409
|
*/
|
|
2399
2410
|
updateContractParams(script: string, updates: Contract["params"]): Promise<Contract>;
|
|
2400
2411
|
/**
|
|
2401
|
-
* Set a contract's state.
|
|
2412
|
+
* Set a contract's state. Retiring (`inactive`) keeps it watched;
|
|
2413
|
+
* see {@link ContractState}. To stop watching, use
|
|
2414
|
+
* {@link deleteContract}.
|
|
2402
2415
|
*/
|
|
2403
2416
|
setContractState(script: string, state: ContractState): Promise<void>;
|
|
2404
2417
|
/**
|
|
2405
|
-
* Delete a contract.
|
|
2418
|
+
* Delete a contract. Also removes it from the watcher — the only way
|
|
2419
|
+
* to stop watching a contract (retiring it via
|
|
2420
|
+
* {@link setContractState} does not).
|
|
2406
2421
|
*
|
|
2407
2422
|
* @param script - Contract script
|
|
2408
2423
|
*/
|
|
@@ -2442,22 +2457,10 @@ declare class ContractManager implements IContractManager {
|
|
|
2442
2457
|
/**
|
|
2443
2458
|
* Force refresh virtual outputs from the indexer.
|
|
2444
2459
|
*
|
|
2445
|
-
* Without options, re-fetches
|
|
2446
|
-
*
|
|
2447
|
-
*
|
|
2448
|
-
*
|
|
2449
|
-
* cursor is not advanced because contracts outside the list may
|
|
2450
|
-
* have data we'd skip).
|
|
2451
|
-
*
|
|
2452
|
-
* `includeInactive: true` (and no `scripts`) widens the refresh to
|
|
2453
|
-
* every contract in the repository, including ones marked
|
|
2454
|
-
* `inactive` and ones that have dropped out of the watcher's
|
|
2455
|
-
* active set. This is a *superset* of the watched set, so the
|
|
2456
|
-
* cursor invariant still holds and the cursor advances normally.
|
|
2457
|
-
*
|
|
2458
|
-
* `after` / `before` apply a caller-supplied time window. The
|
|
2459
|
-
* cursor never advances on a windowed query because the window
|
|
2460
|
-
* may skip data outside its bounds.
|
|
2460
|
+
* Without options, re-fetches the watcher's watched set and
|
|
2461
|
+
* advances the global cursor. Each option narrows or widens that
|
|
2462
|
+
* scope and may hold the cursor back — see
|
|
2463
|
+
* {@link RefreshVtxosOptions}.
|
|
2461
2464
|
*/
|
|
2462
2465
|
refreshVtxos(opts?: RefreshVtxosOptions): Promise<void>;
|
|
2463
2466
|
refreshOutpoints(outpoints: Outpoint[]): Promise<void>;
|
|
@@ -2478,11 +2481,10 @@ declare class ContractManager implements IContractManager {
|
|
|
2478
2481
|
* Sync virtual outputs for the given contracts against the indexer.
|
|
2479
2482
|
*
|
|
2480
2483
|
* When `options.contracts` is omitted the sync covers the full
|
|
2481
|
-
* watched set (
|
|
2482
|
-
*
|
|
2483
|
-
*
|
|
2484
|
-
*
|
|
2485
|
-
* pick up.
|
|
2484
|
+
* watched set ({@link ContractWatcher.getWatchedContracts}) and the
|
|
2485
|
+
* global cursor is advanced on success. Passing an explicit subset
|
|
2486
|
+
* leaves the cursor alone so a narrow poll can't hide data that
|
|
2487
|
+
* other contracts still need to pick up.
|
|
2486
2488
|
*/
|
|
2487
2489
|
private syncContracts;
|
|
2488
2490
|
/**
|
|
@@ -2516,7 +2518,12 @@ declare class ContractManager implements IContractManager {
|
|
|
2516
2518
|
}
|
|
2517
2519
|
|
|
2518
2520
|
/**
|
|
2519
|
-
* Contract state
|
|
2521
|
+
* Contract lifecycle state. Both states stay monitored — the watcher
|
|
2522
|
+
* subscribes and sweeps every registered contract regardless
|
|
2523
|
+
* (see {@link ContractWatcher.getWatchedContracts}), because a retired
|
|
2524
|
+
* receive address can still be paid. `inactive` only demotes a contract
|
|
2525
|
+
* out of receive-address selection; it does **not** unsubscribe it.
|
|
2526
|
+
* Use {@link IContractManager.deleteContract} to stop watching.
|
|
2520
2527
|
*/
|
|
2521
2528
|
type ContractState = "active" | "inactive";
|
|
2522
2529
|
/**
|
|
@@ -2985,10 +2992,10 @@ declare class ContractWatcher {
|
|
|
2985
2992
|
/**
|
|
2986
2993
|
* Add a contract to be watched.
|
|
2987
2994
|
*
|
|
2988
|
-
*
|
|
2995
|
+
* Once watching, every contract is subscribed and polled whatever
|
|
2996
|
+
* its state.
|
|
2989
2997
|
*
|
|
2990
|
-
*
|
|
2991
|
-
* (which may cause them to be watched even if inactive).
|
|
2998
|
+
* @see getWatchedContracts
|
|
2992
2999
|
*/
|
|
2993
3000
|
addContract(contract: Contract): Promise<void>;
|
|
2994
3001
|
/**
|
|
@@ -3012,15 +3019,15 @@ declare class ContractWatcher {
|
|
|
3012
3019
|
*/
|
|
3013
3020
|
getAllContracts(): Contract[];
|
|
3014
3021
|
/**
|
|
3015
|
-
*
|
|
3016
|
-
* - all active contracts, plus
|
|
3017
|
-
* - inactive contracts that still hold known virtual outputs
|
|
3018
|
-
* (the subscription keeps watching them so `vtxo_spent` events for
|
|
3019
|
-
* those unspent outputs are still observed).
|
|
3022
|
+
* Every registered contract, retired (`inactive`) ones included.
|
|
3020
3023
|
*
|
|
3021
|
-
*
|
|
3022
|
-
*
|
|
3023
|
-
*
|
|
3024
|
+
* Feeds both the subscription and the indexer sweep scope, so
|
|
3025
|
+
* narrowing it drops a contract from every background channel at
|
|
3026
|
+
* once. Nothing may be narrowed out: an Ark receive address can be
|
|
3027
|
+
* paid again after the wallet has rotated past it, and a payment
|
|
3028
|
+
* that lands outside every background channel is invisible until
|
|
3029
|
+
* some foreground read happens to sweep it. Retirement therefore
|
|
3030
|
+
* governs receive-address selection, not coverage.
|
|
3024
3031
|
*/
|
|
3025
3032
|
getWatchedContracts(): Contract[];
|
|
3026
3033
|
/**
|
|
@@ -3029,7 +3036,7 @@ declare class ContractWatcher {
|
|
|
3029
3036
|
*/
|
|
3030
3037
|
private getContractVtxos;
|
|
3031
3038
|
/**
|
|
3032
|
-
* Start watching for virtual output events across all
|
|
3039
|
+
* Start watching for virtual output events across all watched contracts.
|
|
3033
3040
|
*/
|
|
3034
3041
|
startWatching(callback: ContractEventCallback): Promise<() => void>;
|
|
3035
3042
|
/**
|
|
@@ -3045,7 +3052,7 @@ declare class ContractWatcher {
|
|
|
3045
3052
|
*/
|
|
3046
3053
|
getConnectionState(): ConnectionState;
|
|
3047
3054
|
/**
|
|
3048
|
-
* Force a poll of all
|
|
3055
|
+
* Force a poll of all watched contracts.
|
|
3049
3056
|
* Useful for manual refresh or after app resume.
|
|
3050
3057
|
*/
|
|
3051
3058
|
forcePoll(): Promise<void>;
|
|
@@ -3091,7 +3098,7 @@ declare class ContractWatcher {
|
|
|
3091
3098
|
/**
|
|
3092
3099
|
* Update the subscription with scripts that should be watched.
|
|
3093
3100
|
*
|
|
3094
|
-
*
|
|
3101
|
+
* @see getWatchedContracts
|
|
3095
3102
|
*/
|
|
3096
3103
|
private updateSubscription;
|
|
3097
3104
|
/**
|