@arkade-os/sdk 0.5.0-rc.11 → 0.5.0-rc.13

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 (94) hide show
  1. package/README.md +43 -12
  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/{asyncStorageTaskQueue-DBaZsltv.d.cts → asyncStorageTaskQueue-0EeSeCAt.d.cts} +1 -1
  7. package/dist/{asyncStorageTaskQueue-uAG3XLyg.d.ts → asyncStorageTaskQueue-DV94jhwq.d.ts} +1 -1
  8. package/dist/{chunk-WSQAWSEH.js → chunk-3JLYJ5KZ.js} +75 -237
  9. package/dist/chunk-3JLYJ5KZ.js.map +1 -0
  10. package/dist/{chunk-VMLLYEYM.js → chunk-4EU2Q6YT.js} +12 -14
  11. package/dist/chunk-4EU2Q6YT.js.map +1 -0
  12. package/dist/{chunk-IA32YGLH.cjs → chunk-7BACS4XK.cjs} +10 -10
  13. package/dist/chunk-7BACS4XK.cjs.map +1 -0
  14. package/dist/{chunk-5OBGYL6U.cjs → chunk-7NK6XFC3.cjs} +120 -194
  15. package/dist/chunk-7NK6XFC3.cjs.map +1 -0
  16. package/dist/{chunk-CQPQ7D4U.cjs → chunk-BFQX2KS3.cjs} +87 -248
  17. package/dist/chunk-BFQX2KS3.cjs.map +1 -0
  18. package/dist/{chunk-DD6MTNAS.js → chunk-D7JLTHSZ.js} +5 -5
  19. package/dist/chunk-D7JLTHSZ.js.map +1 -0
  20. package/dist/{chunk-CMLSTGOC.js → chunk-EJYWGTZ7.js} +119 -194
  21. package/dist/chunk-EJYWGTZ7.js.map +1 -0
  22. package/dist/{chunk-T2ILYGWE.cjs → chunk-FDQQOF3F.cjs} +327 -1080
  23. package/dist/chunk-FDQQOF3F.cjs.map +1 -0
  24. package/dist/{chunk-MGDXN74N.cjs → chunk-I4YBVHAK.cjs} +2357 -3374
  25. package/dist/chunk-I4YBVHAK.cjs.map +1 -0
  26. package/dist/{chunk-M2ZUPLKQ.js → chunk-IV2252XM.js} +1946 -2977
  27. package/dist/chunk-IV2252XM.js.map +1 -0
  28. package/dist/{chunk-OMJRW2D5.js → chunk-JOUPIZ32.js} +263 -1036
  29. package/dist/chunk-JOUPIZ32.js.map +1 -0
  30. package/dist/{chunk-PWEBQNIE.cjs → chunk-RDQSVIXD.cjs} +22 -24
  31. package/dist/chunk-RDQSVIXD.cjs.map +1 -0
  32. package/dist/contracts/handlers/index.cjs +9 -9
  33. package/dist/contracts/handlers/index.d.cts +3 -3
  34. package/dist/contracts/handlers/index.d.ts +3 -3
  35. package/dist/contracts/handlers/index.js +2 -2
  36. package/dist/{delegate-DFwlkVYR.d.cts → delegate-BgpUJW5B.d.cts} +1 -1
  37. package/dist/{delegate-D3YHDERL.d.ts → delegate-BuagcGnG.d.ts} +1 -1
  38. package/dist/{index-DTvUv5lD.d.cts → index-CKmB14Yu.d.cts} +1145 -2263
  39. package/dist/{index-DTvUv5lD.d.ts → index-CKmB14Yu.d.ts} +1145 -2263
  40. package/dist/index-D0BuYwhF.d.cts +637 -0
  41. package/dist/index-DbzyrqK7.d.ts +637 -0
  42. package/dist/index.cjs +341 -297
  43. package/dist/index.d.cts +379 -788
  44. package/dist/index.d.ts +379 -788
  45. package/dist/index.js +4 -4
  46. package/dist/repositories/realm/index.cjs +142 -101
  47. package/dist/repositories/realm/index.cjs.map +1 -1
  48. package/dist/repositories/realm/index.d.cts +13 -11
  49. package/dist/repositories/realm/index.d.ts +13 -11
  50. package/dist/repositories/realm/index.js +130 -89
  51. package/dist/repositories/realm/index.js.map +1 -1
  52. package/dist/repositories/sqlite/index.cjs +158 -118
  53. package/dist/repositories/sqlite/index.cjs.map +1 -1
  54. package/dist/repositories/sqlite/index.d.cts +14 -13
  55. package/dist/repositories/sqlite/index.d.ts +14 -13
  56. package/dist/repositories/sqlite/index.js +147 -107
  57. package/dist/repositories/sqlite/index.js.map +1 -1
  58. package/dist/{taskRunner-B5bl0YRt.d.ts → taskRunner-BX-pB0sv.d.ts} +1 -1
  59. package/dist/{taskRunner--sKy9Inv.d.cts → taskRunner-DJrFFyus.d.cts} +1 -1
  60. package/dist/wallet/expo/background.cjs +14 -14
  61. package/dist/wallet/expo/background.cjs.map +1 -1
  62. package/dist/wallet/expo/background.d.cts +8 -14
  63. package/dist/wallet/expo/background.d.ts +8 -14
  64. package/dist/wallet/expo/background.js +6 -6
  65. package/dist/wallet/expo/background.js.map +1 -1
  66. package/dist/wallet/expo/index.cjs +14 -14
  67. package/dist/wallet/expo/index.cjs.map +1 -1
  68. package/dist/wallet/expo/index.d.cts +5 -5
  69. package/dist/wallet/expo/index.d.ts +5 -5
  70. package/dist/wallet/expo/index.js +5 -5
  71. package/dist/wallet/expo/index.js.map +1 -1
  72. package/dist/wallet-BsL2G3Qb.d.cts +1542 -0
  73. package/dist/wallet-DXNiCmq8.d.ts +1542 -0
  74. package/dist/worker/expo/index.cjs +9 -9
  75. package/dist/worker/expo/index.d.cts +4 -4
  76. package/dist/worker/expo/index.d.ts +4 -4
  77. package/dist/worker/expo/index.js +5 -5
  78. package/package.json +3 -2
  79. package/dist/chunk-5OBGYL6U.cjs.map +0 -1
  80. package/dist/chunk-CMLSTGOC.js.map +0 -1
  81. package/dist/chunk-CQPQ7D4U.cjs.map +0 -1
  82. package/dist/chunk-DD6MTNAS.js.map +0 -1
  83. package/dist/chunk-IA32YGLH.cjs.map +0 -1
  84. package/dist/chunk-M2ZUPLKQ.js.map +0 -1
  85. package/dist/chunk-MGDXN74N.cjs.map +0 -1
  86. package/dist/chunk-OMJRW2D5.js.map +0 -1
  87. package/dist/chunk-PWEBQNIE.cjs.map +0 -1
  88. package/dist/chunk-T2ILYGWE.cjs.map +0 -1
  89. package/dist/chunk-VMLLYEYM.js.map +0 -1
  90. package/dist/chunk-WSQAWSEH.js.map +0 -1
  91. package/dist/hdWalletCapable-C350s3bP.d.ts +0 -2206
  92. package/dist/hdWalletCapable-rrOmXcbT.d.cts +0 -2206
  93. package/dist/index-C0ZyGoyP.d.cts +0 -850
  94. package/dist/index-DASN1cVk.d.ts +0 -850
package/README.md CHANGED
@@ -1111,6 +1111,33 @@ examples.
1111
1111
  Use repository implementations via `StorageConfig`. If you omit `storage`, the
1112
1112
  SDK uses IndexedDB repositories with the default database name.
1113
1113
 
1114
+ #### Paged repository reads
1115
+
1116
+ Collection repositories expose `getVtxosPage`, `getVtxosForScriptPage`, `getUtxosPage`,
1117
+ `getTransactionHistoryPage`, `getContractsPage`, and `getIntentsPage`.
1118
+ Each accepts `{ limit, after? }` and returns
1119
+ `{ items, nextCursor? }`; pass `nextCursor` as `after` until it is absent.
1120
+ Limits must be 1–500. History pages are ordered by `(createdAt, transaction key)`;
1121
+ `since` is inclusive Unix milliseconds. Contract and intent pages are ordered
1122
+ by their script and intent transaction ID. Filters must stay the same across
1123
+ pages. Repository collection reads use pages directly; `collectVtxos`,
1124
+ `collectScriptVtxos`, `collectUtxos`, `collectTransactionHistory`, `collectContracts`, and
1125
+ `collectIntents` traverse all pages when a complete snapshot is required.
1126
+ Wallet spending paths consume every VTXO or UTXO page before coin selection.
1127
+ In `@arkade-os/swap`, RFQ page `since` values use Unix seconds instead.
1128
+
1129
+ ```ts
1130
+ let after;
1131
+ do {
1132
+ const page = await walletRepo.getTransactionHistoryPage(
1133
+ { address, since: Date.now() - 86_400_000 },
1134
+ { limit: 100, after },
1135
+ );
1136
+ for (const transaction of page.items) handle(transaction);
1137
+ after = page.nextCursor;
1138
+ } while (after);
1139
+ ```
1140
+
1114
1141
  #### Repository Versioning
1115
1142
 
1116
1143
  `WalletRepository`, `ContractRepository`, `IntentRepository`,
@@ -1124,7 +1151,7 @@ version is bumped, signaling that a semantic update is required:
1124
1151
  import { WalletRepository } from '@arkade-os/sdk'
1125
1152
 
1126
1153
  class MyWalletRepository implements WalletRepository {
1127
- readonly version = 1 // must match the interface's literal type
1154
+ readonly version = 2 // must match the interface's literal type
1128
1155
  // ...
1129
1156
  }
1130
1157
  ```
@@ -1134,6 +1161,8 @@ class MyWalletRepository implements WalletRepository {
1134
1161
  For Node.js or React Native environments, use the SQLite repository with any
1135
1162
  SQLite driver. The SDK accepts a `SQLExecutor` interface — you provide the
1136
1163
  driver, the SDK handles the schema.
1164
+ Paged wallet reads require SQLite 3.15.0 or newer because they use
1165
+ [row-value comparisons](https://sqlite.org/rowvalue.html#backwards_compatibility).
1137
1166
 
1138
1167
  See [examples/node/multiple-wallets.ts](examples/node/multiple-wallets.ts) for
1139
1168
  a full working example using `better-sqlite3`.
@@ -1497,14 +1526,16 @@ versions keep the coverage they have today.
1497
1526
  Most users don't need to touch repositories directly — `Wallet` reads through them and `ContractManager` owns VTXO/contract synchronization into them. They are documented here for advanced integrations (custom storage backends, offline-first apps, repository inspection).
1498
1527
 
1499
1528
  ```typescript
1529
+ import { collectContracts, collectTransactionHistory, collectUtxos, collectVtxos } from '@arkade-os/sdk'
1530
+
1500
1531
  // Wallet repository — VTXOs, UTXOs, transaction history, settings
1501
1532
  const addr = await wallet.getAddress()
1502
- const vtxos = await wallet.walletRepository.getVtxos(addr)
1503
- const utxos = await wallet.walletRepository.getUtxos(addr)
1504
- const history = await wallet.walletRepository.getTransactionHistory(addr)
1533
+ const vtxos = await collectVtxos(wallet.walletRepository, addr)
1534
+ const utxos = await collectUtxos(wallet.walletRepository, addr)
1535
+ const history = await collectTransactionHistory(wallet.walletRepository, addr)
1505
1536
 
1506
1537
  // Contract repository — script-keyed contracts (default address, VHTLCs, etc.)
1507
- const contracts = await wallet.contractRepository.getContracts({ type: 'vhtlc' })
1538
+ const contracts = await collectContracts(wallet.contractRepository, { type: 'vhtlc' })
1508
1539
  await wallet.contractRepository.saveContract(myContract)
1509
1540
  await wallet.contractRepository.deleteContract(myContract.script)
1510
1541
  ```
@@ -1518,15 +1549,15 @@ This package is developed inside the [arkade-os/ts-sdk](../..) monorepo. See the
1518
1549
  Common package-local commands (run from the repo root):
1519
1550
 
1520
1551
  ```bash
1521
- pnpm -C packages/ts-sdk run typecheck # Type-check the SDK
1522
- pnpm -C packages/ts-sdk test:unit # Unit tests, excluding e2e
1523
- pnpm -C packages/ts-sdk test:watch # Vitest watch mode
1524
- pnpm -C packages/ts-sdk test:coverage # Coverage report
1525
- pnpm -C packages/ts-sdk docs:build # Build TypeDoc API docs
1526
- pnpm -C packages/ts-sdk docs:open # Open API docs in the browser
1552
+ pnpm -C packages/sdk run typecheck # Type-check the SDK
1553
+ pnpm -C packages/sdk test:unit # Unit tests, excluding e2e
1554
+ pnpm -C packages/sdk test:watch # Vitest watch mode
1555
+ pnpm -C packages/sdk test:coverage # Coverage report
1556
+ pnpm -C packages/sdk docs:build # Build TypeDoc API docs
1557
+ pnpm -C packages/sdk docs:open # Open API docs in the browser
1527
1558
  ```
1528
1559
 
1529
- For integration tests, use the root commands (`pnpm run test:integration:ts-sdk` and the `regtest:*:ts-sdk` family) — see the root README.
1560
+ For integration tests, use the root commands (`pnpm run test:integration:sdk` and the `regtest:*:sdk` family) — see the root README.
1530
1561
 
1531
1562
  ### Releasing
1532
1563
 
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkPWEBQNIE_cjs = require('../chunk-PWEBQNIE.cjs');
4
- require('../chunk-CQPQ7D4U.cjs');
5
- require('../chunk-5OBGYL6U.cjs');
3
+ var chunkRDQSVIXD_cjs = require('../chunk-RDQSVIXD.cjs');
4
+ require('../chunk-BFQX2KS3.cjs');
5
+ require('../chunk-7NK6XFC3.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "ExpoArkProvider", {
10
10
  enumerable: true,
11
- get: function () { return chunkPWEBQNIE_cjs.ExpoArkProvider; }
11
+ get: function () { return chunkRDQSVIXD_cjs.ExpoArkProvider; }
12
12
  });
13
13
  Object.defineProperty(exports, "ExpoIndexerProvider", {
14
14
  enumerable: true,
15
- get: function () { return chunkPWEBQNIE_cjs.ExpoIndexerProvider; }
15
+ get: function () { return chunkRDQSVIXD_cjs.ExpoIndexerProvider; }
16
16
  });
17
17
  //# sourceMappingURL=expo.cjs.map
18
18
  //# sourceMappingURL=expo.cjs.map
@@ -1,5 +1,5 @@
1
- import { q as RestArkProvider, n as SettlementEvent, T as TxNotificationEvent, r as RestIndexerProvider, s as SubscriptionResponse } from '../index-DTvUv5lD.cjs';
2
- export { t as ArkProvider, u as IndexerProvider } from '../index-DTvUv5lD.cjs';
1
+ import { r as RestArkProvider, o as SettlementEvent, T as TxNotificationEvent, s as RestIndexerProvider, t as SubscriptionResponse } from '../index-CKmB14Yu.cjs';
2
+ export { u as ArkProvider, v as IndexerProvider } from '../index-CKmB14Yu.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 { q as RestArkProvider, n as SettlementEvent, T as TxNotificationEvent, r as RestIndexerProvider, s as SubscriptionResponse } from '../index-DTvUv5lD.js';
2
- export { t as ArkProvider, u as IndexerProvider } from '../index-DTvUv5lD.js';
1
+ import { r as RestArkProvider, o as SettlementEvent, T as TxNotificationEvent, s as RestIndexerProvider, t as SubscriptionResponse } from '../index-CKmB14Yu.js';
2
+ export { u as ArkProvider, v as IndexerProvider } from '../index-CKmB14Yu.js';
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
- export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-VMLLYEYM.js';
2
- import '../chunk-WSQAWSEH.js';
3
- import '../chunk-CMLSTGOC.js';
1
+ export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-4EU2Q6YT.js';
2
+ import '../chunk-3JLYJ5KZ.js';
3
+ import '../chunk-EJYWGTZ7.js';
4
4
  //# sourceMappingURL=expo.js.map
5
5
  //# sourceMappingURL=expo.js.map
@@ -1,4 +1,4 @@
1
- import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner--sKy9Inv.cjs';
1
+ import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-DJrFFyus.cjs';
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-B5bl0YRt.js';
1
+ import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-BX-pB0sv.js';
2
2
 
3
3
  /**
4
4
  * Minimal async key-value storage interface.