@arkade-os/sdk 0.4.67 → 0.5.0-rc.0

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 (80) hide show
  1. package/README.md +40 -5
  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-Za-e_zMk.d.ts → asyncStorageTaskQueue-BCzN3Y45.d.ts} +2 -2
  9. package/dist/{asyncStorageTaskQueue-LTpeXYaD.d.cts → asyncStorageTaskQueue-CdF_ELX8.d.cts} +2 -2
  10. package/dist/{chunk-MJUTO3PY.cjs → chunk-5MJHZHG7.cjs} +771 -477
  11. package/dist/chunk-5MJHZHG7.cjs.map +1 -0
  12. package/dist/{chunk-2JV4VQ7C.cjs → chunk-6AFUNKK7.cjs} +33 -7
  13. package/dist/chunk-6AFUNKK7.cjs.map +1 -0
  14. package/dist/{chunk-AEWJU6NZ.js → chunk-6F2Q32KA.js} +352 -59
  15. package/dist/chunk-6F2Q32KA.js.map +1 -0
  16. package/dist/{chunk-EALWOVHK.js → chunk-ABJPM4JF.js} +4 -4
  17. package/dist/{chunk-EALWOVHK.js.map → chunk-ABJPM4JF.js.map} +1 -1
  18. package/dist/{chunk-CO3KKSWM.cjs → chunk-CZ32XADN.cjs} +17 -17
  19. package/dist/{chunk-CO3KKSWM.cjs.map → chunk-CZ32XADN.cjs.map} +1 -1
  20. package/dist/{chunk-X3VEMUVV.js → chunk-FVTJJQNM.js} +3 -3
  21. package/dist/{chunk-X3VEMUVV.js.map → chunk-FVTJJQNM.js.map} +1 -1
  22. package/dist/{chunk-OIZ2V2VD.cjs → chunk-HL7EC2Z5.cjs} +121 -170
  23. package/dist/chunk-HL7EC2Z5.cjs.map +1 -0
  24. package/dist/{chunk-MZFUZUTQ.js → chunk-JYP7YXT2.js} +4 -4
  25. package/dist/{chunk-MZFUZUTQ.js.map → chunk-JYP7YXT2.js.map} +1 -1
  26. package/dist/{chunk-6TAQF6EV.js → chunk-KTU44AEH.js} +75 -124
  27. package/dist/chunk-KTU44AEH.js.map +1 -0
  28. package/dist/{chunk-YDRZDZPP.cjs → chunk-PB5KJI4U.cjs} +10 -10
  29. package/dist/{chunk-YDRZDZPP.cjs.map → chunk-PB5KJI4U.cjs.map} +1 -1
  30. package/dist/{chunk-3WIWNE4P.js → chunk-PPG6W34P.js} +30 -8
  31. package/dist/chunk-PPG6W34P.js.map +1 -0
  32. package/dist/{chunk-R2YAMONM.cjs → chunk-RXWKCEZP.cjs} +17 -17
  33. package/dist/{chunk-R2YAMONM.cjs.map → chunk-RXWKCEZP.cjs.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-Bz2e2zXY.d.cts → delegate-DLIOBQ5x.d.cts} +1 -1
  39. package/dist/{delegate-cdmzb2f9.d.ts → delegate-Dyn5L80J.d.ts} +1 -1
  40. package/dist/{hdWalletCapable-BSjuUYOO.d.cts → hdWalletCapable-D9tooZ6F.d.ts} +102 -27
  41. package/dist/{hdWalletCapable-Hi12xjCJ.d.ts → hdWalletCapable-Dt3MUiGE.d.cts} +102 -27
  42. package/dist/{index-BiACuWaf.d.ts → index-D3hmsuKs.d.cts} +100 -123
  43. package/dist/{index-D2GjZxBr.d.cts → index-D9tXd-tN.d.ts} +100 -123
  44. package/dist/{index-DU5o_hz7.d.ts → index-Udm5V2xW.d.cts} +184 -19
  45. package/dist/{index-DU5o_hz7.d.cts → index-Udm5V2xW.d.ts} +184 -19
  46. package/dist/index.cjs +309 -289
  47. package/dist/index.d.cts +125 -29
  48. package/dist/index.d.ts +125 -29
  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-BZJMLQ6g.d.cts → taskRunner-DxZciNaa.d.cts} +2 -2
  59. package/dist/{taskRunner-DATaRQus.d.ts → taskRunner-ZdS16Ypm.d.ts} +2 -2
  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 +23 -14
  65. package/dist/wallet/expo/index.cjs.map +1 -1
  66. package/dist/wallet/expo/index.d.cts +7 -4
  67. package/dist/wallet/expo/index.d.ts +7 -4
  68. package/dist/wallet/expo/index.js +14 -5
  69. package/dist/wallet/expo/index.js.map +1 -1
  70. package/dist/worker/expo/index.cjs +9 -9
  71. package/dist/worker/expo/index.d.cts +4 -4
  72. package/dist/worker/expo/index.d.ts +4 -4
  73. package/dist/worker/expo/index.js +5 -5
  74. package/package.json +3 -2
  75. package/dist/chunk-2JV4VQ7C.cjs.map +0 -1
  76. package/dist/chunk-3WIWNE4P.js.map +0 -1
  77. package/dist/chunk-6TAQF6EV.js.map +0 -1
  78. package/dist/chunk-AEWJU6NZ.js.map +0 -1
  79. package/dist/chunk-MJUTO3PY.cjs.map +0 -1
  80. package/dist/chunk-OIZ2V2VD.cjs.map +0 -1
package/README.md CHANGED
@@ -574,6 +574,11 @@ const expiringVtxos = await manager.getExpiringVtxos()
574
574
  const urgentlyExpiring = await manager.getExpiringVtxos(60_000)
575
575
  ```
576
576
 
577
+ A virtual output whose unilateral exit already happened is never offered for renewal, and the
578
+ exported `isVtxoExpiringSoon` answers `false` for it regardless of its batch expiry: "expiring
579
+ soon" is a renewal signal, and no batch can take an output that already lives onchain. Its remedy
580
+ is `Unroll.completeUnroll`, and its value shows up in `balance.unrolled`.
581
+
577
582
  #### Boarding Input Sweep
578
583
 
579
584
  When a boarding input's CSV timelock expires, it can no longer be onboarded into Arkade cooperatively. The sweep feature detects these expired UTXOs and builds a raw onchain transaction that spends them via the unilateral exit path back to a fresh boarding address, restarting the timelock.
@@ -749,7 +754,7 @@ const wallet = await Wallet.create({
749
754
  })
750
755
 
751
756
  // Get fee information from the server
752
- const { fees: feeInfo } = await wallet.arkProvider.getInfo();
757
+ const { fees: feeInfo } = await wallet.getArkadeInfo();
753
758
 
754
759
  const exitTxid = await new Ramps(wallet).offboard(
755
760
  'bc1p...',
@@ -757,6 +762,37 @@ const exitTxid = await new Ramps(wallet).offboard(
757
762
  );
758
763
  ```
759
764
 
765
+ `getArkadeInfo()` is part of the `IReadonlyWallet` interface, so the same call works on the
766
+ service-worker and Expo wallets too. It answers with the server's live `ArkadeInfo`, falling back
767
+ to the snapshot persisted at wallet construction when the server is unreachable.
768
+
769
+ ### Talking to the server through the wallet
770
+
771
+ `getArkadeInfo()` is one of three seams that let a plugin work from a wallet alone, never a
772
+ server URL of its own:
773
+
774
+ | Seam | Interface | For |
775
+ | --- | --- | --- |
776
+ | `getArkadeInfo()` | `IReadonlyWallet` | Network, signer key, delays, dust, fees, limits |
777
+ | `getArkadeReader()` | `IReadonlyWallet` | Chain reads for scripts the wallet does not own |
778
+ | `getArkadeBroadcaster()` | `IWallet` | `submitTx` / `finalizeTx` |
779
+
780
+ ```typescript
781
+ const reader = await wallet.getArkadeReader();
782
+ const { vtxos } = await reader.getVtxos({ scripts: [covenantScriptHex], spendableOnly: true });
783
+ const { txs } = await reader.getVirtualTxs([spendTxid]);
784
+ ```
785
+
786
+ `getVtxos()` here queries the server for an arbitrary script — distinct from
787
+ `wallet.getVtxos()`, which answers the wallet's own outputs from local repositories. Everything
788
+ it returns is normalized, so each VTXO carries its canonical facts.
789
+
790
+ Broadcasting sits on `IWallet` rather than `IReadonlyWallet` on purpose: a readonly wallet must
791
+ not submit, and a service-worker wallet in readonly mode refuses the message outright.
792
+
793
+ All three are proxied to the worker on a service-worker wallet, so a plugin shares the wallet's
794
+ connection instead of opening a second one outside its rate gate and caches.
795
+
760
796
  ### Unilateral Exit
761
797
 
762
798
  Unilateral exit allows you to withdraw your funds from the Arkade protocol back to the Bitcoin blockchain without requiring cooperation from the Arkade server. This process involves two main steps:
@@ -1097,13 +1133,12 @@ The `StorageAdapter` API is deprecated. Use repositories instead. If you omit `s
1097
1133
  > Anything related to contract repository migration must be handled by the
1098
1134
  > package that created the contracts. The SDK doesn't manage external contracts
1099
1135
  > in V1; data persisted by other packages remains untouched in its original
1100
- > location. For example, see `@arkade-os/boltz-swap`'s `migrateToSwapRepository`
1101
- > for migrating legacy `reverseSwaps` / `submarineSwaps` collections.
1136
+ > location.
1102
1137
 
1103
1138
  #### Repository Versioning
1104
1139
 
1105
1140
  `WalletRepository`, `ContractRepository`, and `SwapRepository` (in
1106
- `@arkade-os/boltz-swap`) each declare a `readonly version` field with a literal
1141
+ `@arkade-os/swap`) each declare a `readonly version` field with a literal
1107
1142
  type. All built-in implementations set this to the current version. If you
1108
1143
  maintain a custom repository implementation, TypeScript will produce a compile
1109
1144
  error when the version is bumped, signaling that a semantic update is required:
@@ -1488,7 +1523,7 @@ For integration tests, use the root commands (`pnpm run test:integration:ts-sdk`
1488
1523
 
1489
1524
  ### Releasing
1490
1525
 
1491
- Package-local releases are disabled. Releases run from the monorepo root and are package-scoped: `pnpm run release -- sdk patch` bumps `@arkade-os/sdk`, creates a `@arkade-os/sdk/<version>` tag, and also bumps `@arkade-os/boltz-swap` (which depends on SDK via `workspace:*`). See the [root README](../../README.md#releasing) for full flags and `pnpm run release -- --help`.
1526
+ Package-local releases are disabled. Releases run from the monorepo root and are package-scoped: `pnpm run release -- sdk patch` bumps `@arkade-os/sdk`, creates a `@arkade-os/sdk/<version>` tag, and also bumps `@arkade-os/swap` (which depends on SDK via `workspace:*`). See the [root README](../../README.md#releasing) for full flags and `pnpm run release -- --help`.
1492
1527
 
1493
1528
  ## License
1494
1529
 
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var chunkR2YAMONM_cjs = require('../chunk-R2YAMONM.cjs');
4
- require('../chunk-CO3KKSWM.cjs');
5
- require('../chunk-2JV4VQ7C.cjs');
3
+ var chunkRXWKCEZP_cjs = require('../chunk-RXWKCEZP.cjs');
4
+ require('../chunk-CZ32XADN.cjs');
5
+ require('../chunk-6AFUNKK7.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 chunkR2YAMONM_cjs.ExpoArkProvider; }
12
+ get: function () { return chunkRXWKCEZP_cjs.ExpoArkProvider; }
13
13
  });
14
14
  Object.defineProperty(exports, "ExpoIndexerProvider", {
15
15
  enumerable: true,
16
- get: function () { return chunkR2YAMONM_cjs.ExpoIndexerProvider; }
16
+ get: function () { return chunkRXWKCEZP_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-DU5o_hz7.cjs';
2
- export { q as ArkProvider, r as IndexerProvider } from '../index-DU5o_hz7.cjs';
1
+ import { r as RestArkProvider, o as SettlementEvent, T as TxNotificationEvent, s as RestIndexerProvider, t as SubscriptionResponse } from '../index-Udm5V2xW.cjs';
2
+ export { u as ArkProvider, v as IndexerProvider } from '../index-Udm5V2xW.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-DU5o_hz7.js';
2
- export { q as ArkProvider, r as IndexerProvider } from '../index-DU5o_hz7.js';
1
+ import { r as RestArkProvider, o as SettlementEvent, T as TxNotificationEvent, s as RestIndexerProvider, t as SubscriptionResponse } from '../index-Udm5V2xW.js';
2
+ export { u as ArkProvider, v as IndexerProvider } from '../index-Udm5V2xW.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-MZFUZUTQ.js';
2
- import '../chunk-X3VEMUVV.js';
3
- import '../chunk-3WIWNE4P.js';
1
+ export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-JYP7YXT2.js';
2
+ import '../chunk-FVTJJQNM.js';
3
+ import '../chunk-PPG6W34P.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 chunkMJUTO3PY_cjs = require('../chunk-MJUTO3PY.cjs');
4
- require('../chunk-CO3KKSWM.cjs');
5
- require('../chunk-OIZ2V2VD.cjs');
6
- require('../chunk-2JV4VQ7C.cjs');
3
+ var chunk5MJHZHG7_cjs = require('../chunk-5MJHZHG7.cjs');
4
+ require('../chunk-CZ32XADN.cjs');
5
+ require('../chunk-HL7EC2Z5.cjs');
6
+ require('../chunk-6AFUNKK7.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 = chunkMJUTO3PY_cjs.DB_VERSION) {
14
+ constructor(dbName, version = chunk5MJHZHG7_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-AEWJU6NZ.js';
2
- import '../chunk-X3VEMUVV.js';
3
- import '../chunk-6TAQF6EV.js';
4
- import '../chunk-3WIWNE4P.js';
1
+ import { DB_VERSION } from '../chunk-6F2Q32KA.js';
2
+ import '../chunk-FVTJJQNM.js';
3
+ import '../chunk-KTU44AEH.js';
4
+ import '../chunk-PPG6W34P.js';
5
5
  import '../chunk-NSBPE2FW.js';
6
6
 
7
7
  // src/storage/indexedDB.ts
@@ -1,4 +1,4 @@
1
- import { c as TaskQueue, b as TaskItem, d as TaskResult } from './taskRunner-DATaRQus.js';
1
+ import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-ZdS16Ypm.js';
2
2
 
3
3
  /**
4
4
  * Minimal async key-value storage interface.
@@ -46,4 +46,4 @@ declare class AsyncStorageTaskQueue implements TaskQueue {
46
46
  private writeList;
47
47
  }
48
48
 
49
- export { type AsyncStorageLike as A, AsyncStorageTaskQueue as a };
49
+ export { AsyncStorageTaskQueue as A, type AsyncStorageLike as a };
@@ -1,4 +1,4 @@
1
- import { c as TaskQueue, b as TaskItem, d as TaskResult } from './taskRunner-BZJMLQ6g.cjs';
1
+ import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-DxZciNaa.cjs';
2
2
 
3
3
  /**
4
4
  * Minimal async key-value storage interface.
@@ -46,4 +46,4 @@ declare class AsyncStorageTaskQueue implements TaskQueue {
46
46
  private writeList;
47
47
  }
48
48
 
49
- export { type AsyncStorageLike as A, AsyncStorageTaskQueue as a };
49
+ export { AsyncStorageTaskQueue as A, type AsyncStorageLike as a };