@arkade-os/sdk 0.5.0-rc.10 → 0.5.0-rc.12
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/README.md +42 -11
- package/dist/adapters/expo.cjs +5 -5
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +3 -3
- package/dist/{asyncStorageTaskQueue-BNvkUO09.d.ts → asyncStorageTaskQueue-DDVTySuO.d.ts} +1 -1
- package/dist/{asyncStorageTaskQueue-CcOeZy9Y.d.cts → asyncStorageTaskQueue-ZJ0uB_km.d.cts} +1 -1
- package/dist/{chunk-4AO4SYFM.js → chunk-2G3XR3E7.js} +119 -194
- package/dist/chunk-2G3XR3E7.js.map +1 -0
- package/dist/{chunk-OQTQPHW3.js → chunk-6UKMLPWP.js} +263 -1036
- package/dist/chunk-6UKMLPWP.js.map +1 -0
- package/dist/{chunk-MHMFI2Q3.cjs → chunk-6ZBLIJ3N.cjs} +10 -10
- package/dist/chunk-6ZBLIJ3N.cjs.map +1 -0
- package/dist/{chunk-NCSSQITM.cjs → chunk-73NPW5LY.cjs} +327 -1080
- package/dist/chunk-73NPW5LY.cjs.map +1 -0
- package/dist/{chunk-P3IY7EVL.js → chunk-C7ARQI5U.js} +12 -14
- package/dist/chunk-C7ARQI5U.js.map +1 -0
- package/dist/{chunk-W7E44EAT.js → chunk-F5P5V3XR.js} +1987 -2982
- package/dist/chunk-F5P5V3XR.js.map +1 -0
- package/dist/{chunk-AGKVSRBX.cjs → chunk-HQTM6HLJ.cjs} +2396 -3377
- package/dist/chunk-HQTM6HLJ.cjs.map +1 -0
- package/dist/{chunk-D7XQK6VK.js → chunk-KBXBS4WO.js} +75 -237
- package/dist/chunk-KBXBS4WO.js.map +1 -0
- package/dist/{chunk-ZJTTNDRG.cjs → chunk-LG4B4CFA.cjs} +22 -24
- package/dist/chunk-LG4B4CFA.cjs.map +1 -0
- package/dist/{chunk-7NZTSBVR.js → chunk-QD3N3ZS7.js} +5 -5
- package/dist/chunk-QD3N3ZS7.js.map +1 -0
- package/dist/{chunk-7NWWFC7O.cjs → chunk-VKM6VUOZ.cjs} +120 -194
- package/dist/chunk-VKM6VUOZ.cjs.map +1 -0
- package/dist/{chunk-NKJ6BSSM.cjs → chunk-XDT24LBQ.cjs} +87 -248
- package/dist/chunk-XDT24LBQ.cjs.map +1 -0
- package/dist/contracts/handlers/index.cjs +9 -9
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/contracts/handlers/index.js +2 -2
- package/dist/{delegate-Nm_rbfti.d.cts → delegate--_TwHqAa.d.cts} +1 -1
- package/dist/{delegate-DzEPFKb6.d.ts → delegate-DbYSf9lY.d.ts} +1 -1
- package/dist/index--rMssbOo.d.cts +637 -0
- package/dist/index-BwYXDgZM.d.ts +637 -0
- package/dist/{index-DQYGp3A1.d.ts → index-D-zl1tea.d.cts} +1140 -2259
- package/dist/{index-DQYGp3A1.d.cts → index-D-zl1tea.d.ts} +1140 -2259
- package/dist/index.cjs +341 -297
- package/dist/index.d.cts +375 -784
- package/dist/index.d.ts +375 -784
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +140 -99
- package/dist/repositories/realm/index.cjs.map +1 -1
- package/dist/repositories/realm/index.d.cts +11 -9
- package/dist/repositories/realm/index.d.ts +11 -9
- package/dist/repositories/realm/index.js +128 -87
- package/dist/repositories/realm/index.js.map +1 -1
- package/dist/repositories/sqlite/index.cjs +156 -116
- package/dist/repositories/sqlite/index.cjs.map +1 -1
- package/dist/repositories/sqlite/index.d.cts +12 -11
- package/dist/repositories/sqlite/index.d.ts +12 -11
- package/dist/repositories/sqlite/index.js +145 -105
- package/dist/repositories/sqlite/index.js.map +1 -1
- package/dist/{taskRunner-DxG06PKN.d.ts → taskRunner-ChQpqvfy.d.ts} +1 -1
- package/dist/{taskRunner-DGTvO-ne.d.cts → taskRunner-DjzP-n_3.d.cts} +1 -1
- package/dist/wallet/expo/background.cjs +14 -14
- package/dist/wallet/expo/background.cjs.map +1 -1
- package/dist/wallet/expo/background.d.cts +8 -14
- package/dist/wallet/expo/background.d.ts +8 -14
- package/dist/wallet/expo/background.js +6 -6
- package/dist/wallet/expo/background.js.map +1 -1
- package/dist/wallet/expo/index.cjs +14 -14
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +5 -5
- package/dist/wallet/expo/index.d.ts +5 -5
- package/dist/wallet/expo/index.js +5 -5
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/wallet-BwCcOWEI.d.ts +1542 -0
- package/dist/wallet-DfYA1QzQ.d.cts +1542 -0
- package/dist/worker/expo/index.cjs +9 -9
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +5 -5
- package/package.json +3 -2
- package/dist/chunk-4AO4SYFM.js.map +0 -1
- package/dist/chunk-7NWWFC7O.cjs.map +0 -1
- package/dist/chunk-7NZTSBVR.js.map +0 -1
- package/dist/chunk-AGKVSRBX.cjs.map +0 -1
- package/dist/chunk-D7XQK6VK.js.map +0 -1
- package/dist/chunk-MHMFI2Q3.cjs.map +0 -1
- package/dist/chunk-NCSSQITM.cjs.map +0 -1
- package/dist/chunk-NKJ6BSSM.cjs.map +0 -1
- package/dist/chunk-OQTQPHW3.js.map +0 -1
- package/dist/chunk-P3IY7EVL.js.map +0 -1
- package/dist/chunk-W7E44EAT.js.map +0 -1
- package/dist/chunk-ZJTTNDRG.cjs.map +0 -1
- package/dist/hdWalletCapable-KFhu6_49.d.ts +0 -2206
- package/dist/hdWalletCapable-vpYZROpY.d.cts +0 -2206
- package/dist/index-4xd-xYf7.d.ts +0 -850
- package/dist/index-CHCtOzAa.d.cts +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`,
|
|
@@ -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
|
|
1503
|
-
const utxos = await wallet.walletRepository
|
|
1504
|
-
const history = await wallet.walletRepository
|
|
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
|
|
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/
|
|
1522
|
-
pnpm -C packages/
|
|
1523
|
-
pnpm -C packages/
|
|
1524
|
-
pnpm -C packages/
|
|
1525
|
-
pnpm -C packages/
|
|
1526
|
-
pnpm -C packages/
|
|
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:
|
|
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
|
|
package/dist/adapters/expo.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
3
|
+
var chunkLG4B4CFA_cjs = require('../chunk-LG4B4CFA.cjs');
|
|
4
|
+
require('../chunk-XDT24LBQ.cjs');
|
|
5
|
+
require('../chunk-VKM6VUOZ.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "ExpoArkProvider", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkLG4B4CFA_cjs.ExpoArkProvider; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "ExpoIndexerProvider", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkLG4B4CFA_cjs.ExpoIndexerProvider; }
|
|
16
16
|
});
|
|
17
17
|
//# sourceMappingURL=expo.cjs.map
|
|
18
18
|
//# sourceMappingURL=expo.cjs.map
|
package/dist/adapters/expo.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { r as RestArkProvider, o as SettlementEvent, T as TxNotificationEvent, s as RestIndexerProvider, t as SubscriptionResponse } from '../index-D-zl1tea.cjs';
|
|
2
|
+
export { u as ArkProvider, v as IndexerProvider } from '../index-D-zl1tea.cjs';
|
|
3
3
|
import '@scure/btc-signer/utils.js';
|
|
4
4
|
import '@scure/btc-signer/transaction.js';
|
|
5
5
|
import '@scure/btc-signer';
|
package/dist/adapters/expo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { r as RestArkProvider, o as SettlementEvent, T as TxNotificationEvent, s as RestIndexerProvider, t as SubscriptionResponse } from '../index-D-zl1tea.js';
|
|
2
|
+
export { u as ArkProvider, v as IndexerProvider } from '../index-D-zl1tea.js';
|
|
3
3
|
import '@scure/btc-signer/utils.js';
|
|
4
4
|
import '@scure/btc-signer/transaction.js';
|
|
5
5
|
import '@scure/btc-signer';
|
package/dist/adapters/expo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-C7ARQI5U.js';
|
|
2
|
+
import '../chunk-KBXBS4WO.js';
|
|
3
|
+
import '../chunk-2G3XR3E7.js';
|
|
4
4
|
//# sourceMappingURL=expo.js.map
|
|
5
5
|
//# sourceMappingURL=expo.js.map
|