@arkade-os/sdk 0.4.68 → 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 +35 -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-DaZlVTbM.d.ts → asyncStorageTaskQueue-BCzN3Y45.d.ts} +1 -1
  9. package/dist/{asyncStorageTaskQueue-B2CcXIHU.d.cts → asyncStorageTaskQueue-CdF_ELX8.d.cts} +1 -1
  10. package/dist/{chunk-WCJVKFAP.cjs → chunk-5MJHZHG7.cjs} +726 -468
  11. package/dist/chunk-5MJHZHG7.cjs.map +1 -0
  12. package/dist/{chunk-EJOFL5WH.cjs → chunk-6AFUNKK7.cjs} +19 -7
  13. package/dist/chunk-6AFUNKK7.cjs.map +1 -0
  14. package/dist/{chunk-VBHXBI7F.js → chunk-6F2Q32KA.js} +298 -41
  15. package/dist/chunk-6F2Q32KA.js.map +1 -0
  16. package/dist/{chunk-GQ4NMQGR.js → chunk-ABJPM4JF.js} +4 -4
  17. package/dist/{chunk-GQ4NMQGR.js.map → chunk-ABJPM4JF.js.map} +1 -1
  18. package/dist/{chunk-PJR63FTK.cjs → chunk-CZ32XADN.cjs} +17 -17
  19. package/dist/{chunk-PJR63FTK.cjs.map → chunk-CZ32XADN.cjs.map} +1 -1
  20. package/dist/{chunk-33Q2RFET.js → chunk-FVTJJQNM.js} +3 -3
  21. package/dist/{chunk-33Q2RFET.js.map → chunk-FVTJJQNM.js.map} +1 -1
  22. package/dist/{chunk-6YUACVX4.cjs → chunk-HL7EC2Z5.cjs} +52 -53
  23. package/dist/chunk-HL7EC2Z5.cjs.map +1 -0
  24. package/dist/{chunk-G4I6PU5H.js → chunk-JYP7YXT2.js} +4 -4
  25. package/dist/{chunk-G4I6PU5H.js.map → chunk-JYP7YXT2.js.map} +1 -1
  26. package/dist/{chunk-45FKMOJH.js → chunk-KTU44AEH.js} +6 -7
  27. package/dist/chunk-KTU44AEH.js.map +1 -0
  28. package/dist/{chunk-4KCVS4ZN.cjs → chunk-PB5KJI4U.cjs} +10 -10
  29. package/dist/{chunk-4KCVS4ZN.cjs.map → chunk-PB5KJI4U.cjs.map} +1 -1
  30. package/dist/{chunk-4CMXV5SF.js → chunk-PPG6W34P.js} +18 -8
  31. package/dist/chunk-PPG6W34P.js.map +1 -0
  32. package/dist/{chunk-JGMSZIE4.cjs → chunk-RXWKCEZP.cjs} +17 -17
  33. package/dist/{chunk-JGMSZIE4.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-Bffc5f54.d.cts → delegate-DLIOBQ5x.d.cts} +1 -1
  39. package/dist/{delegate-AomVWxO_.d.ts → delegate-Dyn5L80J.d.ts} +1 -1
  40. package/dist/{hdWalletCapable-B5nRs3RH.d.cts → hdWalletCapable-D9tooZ6F.d.ts} +102 -27
  41. package/dist/{hdWalletCapable-DZdIVa23.d.ts → hdWalletCapable-Dt3MUiGE.d.cts} +102 -27
  42. package/dist/{index-jouvy8FD.d.ts → index-D3hmsuKs.d.cts} +6 -6
  43. package/dist/{index-nfyQM33h.d.cts → index-D9tXd-tN.d.ts} +6 -6
  44. package/dist/{index-C7RZCfoY.d.cts → index-Udm5V2xW.d.cts} +168 -19
  45. package/dist/{index-C7RZCfoY.d.ts → index-Udm5V2xW.d.ts} +168 -19
  46. package/dist/index.cjs +306 -290
  47. package/dist/index.d.cts +121 -29
  48. package/dist/index.d.ts +121 -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-D2vnpPBT.d.cts → taskRunner-DxZciNaa.d.cts} +1 -1
  59. package/dist/{taskRunner-DuwK9t8O.d.ts → taskRunner-ZdS16Ypm.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 +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-45FKMOJH.js.map +0 -1
  76. package/dist/chunk-4CMXV5SF.js.map +0 -1
  77. package/dist/chunk-6YUACVX4.cjs.map +0 -1
  78. package/dist/chunk-EJOFL5WH.cjs.map +0 -1
  79. package/dist/chunk-VBHXBI7F.js.map +0 -1
  80. package/dist/chunk-WCJVKFAP.cjs.map +0 -1
package/README.md CHANGED
@@ -754,7 +754,7 @@ const wallet = await Wallet.create({
754
754
  })
755
755
 
756
756
  // Get fee information from the server
757
- const { fees: feeInfo } = await wallet.arkProvider.getInfo();
757
+ const { fees: feeInfo } = await wallet.getArkadeInfo();
758
758
 
759
759
  const exitTxid = await new Ramps(wallet).offboard(
760
760
  'bc1p...',
@@ -762,6 +762,37 @@ const exitTxid = await new Ramps(wallet).offboard(
762
762
  );
763
763
  ```
764
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
+
765
796
  ### Unilateral Exit
766
797
 
767
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:
@@ -1102,13 +1133,12 @@ The `StorageAdapter` API is deprecated. Use repositories instead. If you omit `s
1102
1133
  > Anything related to contract repository migration must be handled by the
1103
1134
  > package that created the contracts. The SDK doesn't manage external contracts
1104
1135
  > in V1; data persisted by other packages remains untouched in its original
1105
- > location. For example, see `@arkade-os/boltz-swap`'s `migrateToSwapRepository`
1106
- > for migrating legacy `reverseSwaps` / `submarineSwaps` collections.
1136
+ > location.
1107
1137
 
1108
1138
  #### Repository Versioning
1109
1139
 
1110
1140
  `WalletRepository`, `ContractRepository`, and `SwapRepository` (in
1111
- `@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
1112
1142
  type. All built-in implementations set this to the current version. If you
1113
1143
  maintain a custom repository implementation, TypeScript will produce a compile
1114
1144
  error when the version is bumped, signaling that a semantic update is required:
@@ -1493,7 +1523,7 @@ For integration tests, use the root commands (`pnpm run test:integration:ts-sdk`
1493
1523
 
1494
1524
  ### Releasing
1495
1525
 
1496
- 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`.
1497
1527
 
1498
1528
  ## License
1499
1529
 
@@ -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 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 chunkJGMSZIE4_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 chunkJGMSZIE4_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-C7RZCfoY.cjs';
2
- export { q as ArkProvider, r as IndexerProvider } from '../index-C7RZCfoY.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-C7RZCfoY.js';
2
- export { q as ArkProvider, r as IndexerProvider } from '../index-C7RZCfoY.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-G4I6PU5H.js';
2
- import '../chunk-33Q2RFET.js';
3
- import '../chunk-4CMXV5SF.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 chunkWCJVKFAP_cjs = require('../chunk-WCJVKFAP.cjs');
4
- require('../chunk-PJR63FTK.cjs');
5
- require('../chunk-6YUACVX4.cjs');
6
- require('../chunk-EJOFL5WH.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 = chunkWCJVKFAP_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-VBHXBI7F.js';
2
- import '../chunk-33Q2RFET.js';
3
- import '../chunk-45FKMOJH.js';
4
- import '../chunk-4CMXV5SF.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 { 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-ZdS16Ypm.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-DxZciNaa.cjs';
2
2
 
3
3
  /**
4
4
  * Minimal async key-value storage interface.