@arkade-os/sdk 0.4.68 → 0.4.69

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.
Files changed (74) hide show
  1. package/README.md +33 -0
  2. package/dist/adapters/expo.cjs +5 -5
  3. package/dist/adapters/expo.d.cts +2 -2
  4. package/dist/adapters/expo.d.ts +2 -2
  5. package/dist/adapters/expo.js +3 -3
  6. package/dist/adapters/indexedDB.cjs +5 -5
  7. package/dist/adapters/indexedDB.js +4 -4
  8. package/dist/{asyncStorageTaskQueue-DaZlVTbM.d.ts → asyncStorageTaskQueue-BgUJN-3X.d.ts} +1 -1
  9. package/dist/{asyncStorageTaskQueue-B2CcXIHU.d.cts → asyncStorageTaskQueue-Cstx6hS7.d.cts} +1 -1
  10. package/dist/{chunk-45FKMOJH.js → chunk-2PPL3O7Z.js} +3 -3
  11. package/dist/{chunk-45FKMOJH.js.map → chunk-2PPL3O7Z.js.map} +1 -1
  12. package/dist/{chunk-EJOFL5WH.cjs → chunk-5MLC2HU3.cjs} +3 -3
  13. package/dist/{chunk-EJOFL5WH.cjs.map → chunk-5MLC2HU3.cjs.map} +1 -1
  14. package/dist/{chunk-WCJVKFAP.cjs → chunk-EBYCTLET.cjs} +787 -479
  15. package/dist/chunk-EBYCTLET.cjs.map +1 -0
  16. package/dist/{chunk-PJR63FTK.cjs → chunk-GVHUHTRH.cjs} +17 -17
  17. package/dist/{chunk-PJR63FTK.cjs.map → chunk-GVHUHTRH.cjs.map} +1 -1
  18. package/dist/{chunk-4KCVS4ZN.cjs → chunk-HQ4DMGA4.cjs} +10 -10
  19. package/dist/{chunk-4KCVS4ZN.cjs.map → chunk-HQ4DMGA4.cjs.map} +1 -1
  20. package/dist/{chunk-4CMXV5SF.js → chunk-L5SCQYHF.js} +3 -3
  21. package/dist/{chunk-4CMXV5SF.js.map → chunk-L5SCQYHF.js.map} +1 -1
  22. package/dist/{chunk-G4I6PU5H.js → chunk-MNMPGEK2.js} +4 -4
  23. package/dist/{chunk-G4I6PU5H.js.map → chunk-MNMPGEK2.js.map} +1 -1
  24. package/dist/{chunk-VBHXBI7F.js → chunk-TA7XLEP2.js} +357 -50
  25. package/dist/chunk-TA7XLEP2.js.map +1 -0
  26. package/dist/{chunk-6YUACVX4.cjs → chunk-WIFL5QYZ.cjs} +49 -49
  27. package/dist/{chunk-6YUACVX4.cjs.map → chunk-WIFL5QYZ.cjs.map} +1 -1
  28. package/dist/{chunk-GQ4NMQGR.js → chunk-XLWDX7QZ.js} +4 -4
  29. package/dist/{chunk-GQ4NMQGR.js.map → chunk-XLWDX7QZ.js.map} +1 -1
  30. package/dist/{chunk-JGMSZIE4.cjs → chunk-XQPN5YP2.cjs} +17 -17
  31. package/dist/{chunk-JGMSZIE4.cjs.map → chunk-XQPN5YP2.cjs.map} +1 -1
  32. package/dist/{chunk-33Q2RFET.js → chunk-YG7T6LI3.js} +3 -3
  33. package/dist/{chunk-33Q2RFET.js.map → chunk-YG7T6LI3.js.map} +1 -1
  34. package/dist/contracts/handlers/index.cjs +9 -9
  35. package/dist/contracts/handlers/index.d.cts +3 -3
  36. package/dist/contracts/handlers/index.d.ts +3 -3
  37. package/dist/contracts/handlers/index.js +2 -2
  38. package/dist/{delegate-AomVWxO_.d.ts → delegate-BPdzTbwN.d.ts} +1 -1
  39. package/dist/{delegate-Bffc5f54.d.cts → delegate-DrwIar11.d.cts} +1 -1
  40. package/dist/{hdWalletCapable-DZdIVa23.d.ts → hdWalletCapable-D4WH35z0.d.cts} +49 -5
  41. package/dist/{hdWalletCapable-B5nRs3RH.d.cts → hdWalletCapable-DyxCiNVE.d.ts} +49 -5
  42. package/dist/{index-nfyQM33h.d.cts → index-BqhpAqqj.d.cts} +2 -2
  43. package/dist/{index-jouvy8FD.d.ts → index-TZJvbIaA.d.ts} +2 -2
  44. package/dist/{index-C7RZCfoY.d.cts → index-dWRqYSdS.d.cts} +53 -1
  45. package/dist/{index-C7RZCfoY.d.ts → index-dWRqYSdS.d.ts} +53 -1
  46. package/dist/index.cjs +294 -290
  47. package/dist/index.d.cts +25 -8
  48. package/dist/index.d.ts +25 -8
  49. package/dist/index.js +4 -4
  50. package/dist/repositories/realm/index.cjs +19 -19
  51. package/dist/repositories/realm/index.d.cts +2 -2
  52. package/dist/repositories/realm/index.d.ts +2 -2
  53. package/dist/repositories/realm/index.js +5 -5
  54. package/dist/repositories/sqlite/index.cjs +18 -18
  55. package/dist/repositories/sqlite/index.d.cts +2 -2
  56. package/dist/repositories/sqlite/index.d.ts +2 -2
  57. package/dist/repositories/sqlite/index.js +5 -5
  58. package/dist/{taskRunner-D2vnpPBT.d.cts → taskRunner-CzYKyJ9c.d.cts} +1 -1
  59. package/dist/{taskRunner-DuwK9t8O.d.ts → taskRunner-D2fnbqYw.d.ts} +1 -1
  60. package/dist/wallet/expo/background.cjs +14 -14
  61. package/dist/wallet/expo/background.d.cts +3 -3
  62. package/dist/wallet/expo/background.d.ts +3 -3
  63. package/dist/wallet/expo/background.js +6 -6
  64. package/dist/wallet/expo/index.cjs +14 -14
  65. package/dist/wallet/expo/index.d.cts +4 -4
  66. package/dist/wallet/expo/index.d.ts +4 -4
  67. package/dist/wallet/expo/index.js +5 -5
  68. package/dist/worker/expo/index.cjs +9 -9
  69. package/dist/worker/expo/index.d.cts +4 -4
  70. package/dist/worker/expo/index.d.ts +4 -4
  71. package/dist/worker/expo/index.js +5 -5
  72. package/package.json +1 -1
  73. package/dist/chunk-VBHXBI7F.js.map +0 -1
  74. package/dist/chunk-WCJVKFAP.cjs.map +0 -1
package/README.md CHANGED
@@ -346,6 +346,39 @@ if (incomingFunds.type === "vtxo") {
346
346
  }
347
347
  ```
348
348
 
349
+ #### Cancelling a wait
350
+
351
+ `waitForIncomingFunds` is **a live subscription, not a one-shot query**. It opens an onchain address watcher plus an indexer stream and holds them until it settles. Cancel it whenever you might not await it to completion — pass a `timeoutMs`, or an `AbortSignal`:
352
+
353
+ ```typescript
354
+ const controller = new AbortController()
355
+
356
+ try {
357
+ const funds = await waitForIncomingFunds(wallet, { signal: controller.signal })
358
+ } catch (error) {
359
+ if ((error as Error).name !== "AbortError") throw error
360
+ // cancelled — watchers already released
361
+ }
362
+
363
+ // or bound the wait directly
364
+ await waitForIncomingFunds(wallet, { timeoutMs: 30_000 })
365
+ ```
366
+
367
+ Do **not** `Promise.race` an uncancelled call against a timer:
368
+
369
+ ```typescript
370
+ // WRONG: race abandons the loser without stopping it. Repeat this on a
371
+ // polling loop and the subscriptions stack until the process exits.
372
+ await Promise.race([sleep(15_000), waitForIncomingFunds(wallet)])
373
+
374
+ // Right: the signal tears the watcher down when the timer wins.
375
+ await waitForIncomingFunds(wallet, { timeoutMs: 15_000 }).catch(() => null)
376
+ ```
377
+
378
+ If you want a plain polling loop, use your own timer plus `wallet.getBalance()` — it observes new funds on the next cycle. If you want to keep a watcher across many iterations, call `wallet.notifyIncomingFunds(cb)` **once** and hold its `stop()` function, rather than resubscribing per tick.
379
+
380
+ Concurrent watchers over the same address set share a single Esplora subscription, so a duplicated or leaked watcher no longer multiplies explorer traffic. That is a safety net, not a licence to skip `stop()`.
381
+
349
382
  ### Onboarding
350
383
 
351
384
  Onboarding allows you to swap onchain funds into virtual outputs:
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var chunkJGMSZIE4_cjs = require('../chunk-JGMSZIE4.cjs');
4
- require('../chunk-PJR63FTK.cjs');
5
- require('../chunk-EJOFL5WH.cjs');
3
+ var chunkXQPN5YP2_cjs = require('../chunk-XQPN5YP2.cjs');
4
+ require('../chunk-GVHUHTRH.cjs');
5
+ require('../chunk-5MLC2HU3.cjs');
6
6
  require('../chunk-5BLDMQED.cjs');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "ExpoArkProvider", {
11
11
  enumerable: true,
12
- get: function () { return chunkJGMSZIE4_cjs.ExpoArkProvider; }
12
+ get: function () { return chunkXQPN5YP2_cjs.ExpoArkProvider; }
13
13
  });
14
14
  Object.defineProperty(exports, "ExpoIndexerProvider", {
15
15
  enumerable: true,
16
- get: function () { return chunkJGMSZIE4_cjs.ExpoIndexerProvider; }
16
+ get: function () { return chunkXQPN5YP2_cjs.ExpoIndexerProvider; }
17
17
  });
18
18
  //# sourceMappingURL=expo.cjs.map
19
19
  //# sourceMappingURL=expo.cjs.map
@@ -1,5 +1,5 @@
1
- import { n as RestArkProvider, k as SettlementEvent, T as TxNotificationEvent, o as RestIndexerProvider, p as SubscriptionResponse } from '../index-C7RZCfoY.cjs';
2
- export { q as ArkProvider, r as IndexerProvider } from '../index-C7RZCfoY.cjs';
1
+ import { n as RestArkProvider, k as SettlementEvent, T as TxNotificationEvent, o as RestIndexerProvider, p as SubscriptionResponse } from '../index-dWRqYSdS.cjs';
2
+ export { q as ArkProvider, r as IndexerProvider } from '../index-dWRqYSdS.cjs';
3
3
  import '@scure/btc-signer/utils.js';
4
4
  import '@scure/btc-signer/transaction.js';
5
5
  import '@scure/btc-signer';
@@ -1,5 +1,5 @@
1
- import { n as RestArkProvider, k as SettlementEvent, T as TxNotificationEvent, o as RestIndexerProvider, p as SubscriptionResponse } from '../index-C7RZCfoY.js';
2
- export { q as ArkProvider, r as IndexerProvider } from '../index-C7RZCfoY.js';
1
+ import { n as RestArkProvider, k as SettlementEvent, T as TxNotificationEvent, o as RestIndexerProvider, p as SubscriptionResponse } from '../index-dWRqYSdS.js';
2
+ export { q as ArkProvider, r as IndexerProvider } from '../index-dWRqYSdS.js';
3
3
  import '@scure/btc-signer/utils.js';
4
4
  import '@scure/btc-signer/transaction.js';
5
5
  import '@scure/btc-signer';
@@ -1,6 +1,6 @@
1
- export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-G4I6PU5H.js';
2
- import '../chunk-33Q2RFET.js';
3
- import '../chunk-4CMXV5SF.js';
1
+ export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-MNMPGEK2.js';
2
+ import '../chunk-YG7T6LI3.js';
3
+ import '../chunk-L5SCQYHF.js';
4
4
  import '../chunk-NSBPE2FW.js';
5
5
  //# sourceMappingURL=expo.js.map
6
6
  //# sourceMappingURL=expo.js.map
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkWCJVKFAP_cjs = require('../chunk-WCJVKFAP.cjs');
4
- require('../chunk-PJR63FTK.cjs');
5
- require('../chunk-6YUACVX4.cjs');
6
- require('../chunk-EJOFL5WH.cjs');
3
+ var chunkEBYCTLET_cjs = require('../chunk-EBYCTLET.cjs');
4
+ require('../chunk-GVHUHTRH.cjs');
5
+ require('../chunk-WIFL5QYZ.cjs');
6
+ require('../chunk-5MLC2HU3.cjs');
7
7
  require('../chunk-5BLDMQED.cjs');
8
8
 
9
9
  // src/storage/indexedDB.ts
@@ -11,7 +11,7 @@ var IndexedDBStorageAdapter = class {
11
11
  dbName;
12
12
  version;
13
13
  db = null;
14
- constructor(dbName, version = chunkWCJVKFAP_cjs.DB_VERSION) {
14
+ constructor(dbName, version = chunkEBYCTLET_cjs.DB_VERSION) {
15
15
  this.dbName = dbName;
16
16
  this.version = version;
17
17
  }
@@ -1,7 +1,7 @@
1
- import { DB_VERSION } from '../chunk-VBHXBI7F.js';
2
- import '../chunk-33Q2RFET.js';
3
- import '../chunk-45FKMOJH.js';
4
- import '../chunk-4CMXV5SF.js';
1
+ import { DB_VERSION } from '../chunk-TA7XLEP2.js';
2
+ import '../chunk-YG7T6LI3.js';
3
+ import '../chunk-2PPL3O7Z.js';
4
+ import '../chunk-L5SCQYHF.js';
5
5
  import '../chunk-NSBPE2FW.js';
6
6
 
7
7
  // src/storage/indexedDB.ts
@@ -1,4 +1,4 @@
1
- import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-DuwK9t8O.js';
1
+ import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-D2fnbqYw.js';
2
2
 
3
3
  /**
4
4
  * Minimal async key-value storage interface.
@@ -1,4 +1,4 @@
1
- import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-D2vnpPBT.cjs';
1
+ import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-CzYKyJ9c.cjs';
2
2
 
3
3
  /**
4
4
  * Minimal async key-value storage interface.
@@ -1,4 +1,4 @@
1
- import { VtxoScript, MultisigTapscript, CSVMultisigTapscript, timelockToSequence, sequenceToTimelock, ConditionMultisigTapscript, CLTVMultisigTapscript, ConditionCSVMultisigTapscript, SCRIPT_QUERY_CHUNK_SIZE, getNormalizedVtxos, DEFAULT_PAGE_SIZE } from './chunk-4CMXV5SF.js';
1
+ import { VtxoScript, MultisigTapscript, CSVMultisigTapscript, timelockToSequence, sequenceToTimelock, ConditionMultisigTapscript, CLTVMultisigTapscript, ConditionCSVMultisigTapscript, SCRIPT_QUERY_CHUNK_SIZE, getNormalizedVtxos, DEFAULT_PAGE_SIZE } from './chunk-L5SCQYHF.js';
2
2
  import { __export } from './chunk-NSBPE2FW.js';
3
3
  import { hex } from '@scure/base';
4
4
  import { networks, expand } from '@bitcoinerlab/descriptors-scure';
@@ -2988,5 +2988,5 @@ contractHandlers.register(BoardingContractHandler);
2988
2988
  contractHandlers.register(ArkadeContractHandler);
2989
2989
 
2990
2990
  export { ARKADE_OP, ARKADE_OPCODES, ARKADE_OPCODE_NAMES, ARKADE_OPCODE_VALUES, ARKADE_OPS, ArkadeContractHandler, ArkadeProgramScript, ArkadeScript, BoardingContractHandler, DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, OPCODE_NAMES, OPCODE_VALUES, SUPPORTED_PROGRAM_VERSION, VHTLC, VHTLCContractHandler, VHTLCV2ContractHandler, WALLET_RECEIVE_SOURCE, arkadeScriptHash, arkadeWitnessHash, asmToBytes, bignum_exports, bytesToASM, computeArkadeScriptPublicKey, contractHandlers, deriveDescriptorLeafCompressedPubKey, deriveDescriptorLeafPubKey, descriptorIsOurs, deserializeArkadeContractParams, fromASM, getOpcodeName, getOpcodeValue, identityDescriptor, inputName, isCltvSatisfied, isCsvSpendable, isMainnetDescriptor, normalizeToDescriptor, parseArtifact, parseHDDescriptor, resolveAsm, serializeArkadeContractParams, speculativeReceiveMetadata, stringifyArtifact, toASM, toXOnly, validateProgram, witnessRefToBytes };
2991
- //# sourceMappingURL=chunk-45FKMOJH.js.map
2992
- //# sourceMappingURL=chunk-45FKMOJH.js.map
2991
+ //# sourceMappingURL=chunk-2PPL3O7Z.js.map
2992
+ //# sourceMappingURL=chunk-2PPL3O7Z.js.map