@arkade-os/sdk 0.5.3 → 0.5.5
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 +138 -50
- package/dist/adapters/expo.cjs +10 -5
- package/dist/adapters/expo.d.cts +13 -8
- package/dist/adapters/expo.d.ts +13 -8
- package/dist/adapters/expo.js +4 -3
- package/dist/{asyncStorageTaskQueue-C9PkPcW_.d.cts → asyncStorageTaskQueue-BbH-THYJ.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-B3U5gQ-i.d.ts → asyncStorageTaskQueue-BlvkJyTa.d.ts} +2 -2
- package/dist/base-C-Y5t_0F.d.cts +359 -0
- package/dist/base-C-Y5t_0F.d.ts +359 -0
- package/dist/{chunk-OPX2HRWM.js → chunk-4I53THL6.js} +210 -937
- package/dist/chunk-4I53THL6.js.map +1 -0
- package/dist/{chunk-5WRA66RV.cjs → chunk-5SYUEVJH.cjs} +10 -10
- package/dist/chunk-5SYUEVJH.cjs.map +1 -0
- package/dist/{chunk-6FL4N4S2.js → chunk-7GIKLFHC.js} +83 -20
- package/dist/chunk-7GIKLFHC.js.map +1 -0
- package/dist/{chunk-BYPBVHVA.cjs → chunk-AMH7Q3DF.cjs} +61 -935
- package/dist/chunk-AMH7Q3DF.cjs.map +1 -0
- package/dist/{chunk-P7B4LQ3H.js → chunk-BCA6D255.js} +18 -842
- package/dist/chunk-BCA6D255.js.map +1 -0
- package/dist/{chunk-T7C3E2HL.js → chunk-CE46RS6L.js} +20 -39
- package/dist/chunk-CE46RS6L.js.map +1 -0
- package/dist/chunk-DNFTHG73.js +829 -0
- package/dist/chunk-DNFTHG73.js.map +1 -0
- package/dist/chunk-FDJ734CH.js +882 -0
- package/dist/chunk-FDJ734CH.js.map +1 -0
- package/dist/chunk-FLPWNMX3.cjs +930 -0
- package/dist/chunk-FLPWNMX3.cjs.map +1 -0
- package/dist/{chunk-Y4BL3YYX.js → chunk-FVVXCDNE.js} +4 -4
- package/dist/chunk-FVVXCDNE.js.map +1 -0
- package/dist/{chunk-ZPF4I3K2.cjs → chunk-HQQ4NRXI.cjs} +29 -47
- package/dist/chunk-HQQ4NRXI.cjs.map +1 -0
- package/dist/chunk-JFJNB7ZH.cjs +884 -0
- package/dist/chunk-JFJNB7ZH.cjs.map +1 -0
- package/dist/{chunk-KW7ZEWYS.cjs → chunk-KCL5AVML.cjs} +223 -985
- package/dist/chunk-KCL5AVML.cjs.map +1 -0
- package/dist/{chunk-HAQAWBYG.js → chunk-OO2KEK64.js} +2860 -1366
- package/dist/chunk-OO2KEK64.js.map +1 -0
- package/dist/{chunk-OUTWUYJ4.cjs → chunk-T254PXSN.cjs} +3337 -1824
- package/dist/chunk-T254PXSN.cjs.map +1 -0
- package/dist/chunk-V3ZLL5VY.js +380 -0
- package/dist/chunk-V3ZLL5VY.js.map +1 -0
- package/dist/chunk-X6ZI53DZ.cjs +383 -0
- package/dist/chunk-X6ZI53DZ.cjs.map +1 -0
- package/dist/{chunk-ZMSM3NOH.cjs → chunk-XWUCNMPN.cjs} +98 -34
- package/dist/chunk-XWUCNMPN.cjs.map +1 -0
- package/dist/compiler.cjs +50 -0
- package/dist/compiler.cjs.map +1 -0
- package/dist/compiler.d.cts +38 -0
- package/dist/compiler.d.ts +38 -0
- package/dist/compiler.js +47 -0
- package/dist/compiler.js.map +1 -0
- package/dist/contracts/handlers/index.cjs +11 -9
- package/dist/contracts/handlers/index.d.cts +6 -4
- package/dist/contracts/handlers/index.d.ts +6 -4
- package/dist/contracts/handlers/index.js +4 -2
- package/dist/{delegate-Cd28gxpM.d.ts → delegate-gGkUnYpi.d.cts} +1 -1
- package/dist/{delegate-ByfKszb6.d.cts → delegate-iyDum4fw.d.ts} +1 -1
- package/dist/{index-B6X2E7W_.d.ts → index-BWwVnJhU.d.cts} +7 -272
- package/dist/{index-DgH_0j14.d.cts → index-Bx-iArDs.d.ts} +7 -272
- package/dist/{index-BURzbRup.d.cts → index-DCml4QJn.d.ts} +1090 -1140
- package/dist/{index-BURzbRup.d.ts → index-DkyzIzKL.d.cts} +1090 -1140
- package/dist/index.cjs +470 -371
- package/dist/index.d.cts +687 -410
- package/dist/index.d.ts +687 -410
- package/dist/index.js +7 -4
- package/dist/{wallet-BnmhohgZ.d.ts → keyringDescriptorProvider-CS4w4PWd.d.ts} +427 -372
- package/dist/{wallet-BjQugVUt.d.cts → keyringDescriptorProvider-CmHXrIXd.d.cts} +427 -372
- package/dist/program-BARSNg3X.d.ts +286 -0
- package/dist/program-znrWkxE4.d.cts +286 -0
- package/dist/repositories/realm/index.cjs +100 -51
- package/dist/repositories/realm/index.cjs.map +1 -1
- package/dist/repositories/realm/index.d.cts +25 -10
- package/dist/repositories/realm/index.d.ts +25 -10
- package/dist/repositories/realm/index.js +72 -24
- package/dist/repositories/realm/index.js.map +1 -1
- package/dist/repositories/sqlite/index.cjs +222 -131
- package/dist/repositories/sqlite/index.cjs.map +1 -1
- package/dist/repositories/sqlite/index.d.cts +36 -17
- package/dist/repositories/sqlite/index.d.ts +36 -17
- package/dist/repositories/sqlite/index.js +196 -107
- package/dist/repositories/sqlite/index.js.map +1 -1
- package/dist/{taskRunner-BaNCSxqK.d.ts → taskRunner-DgMLSk_O.d.ts} +4 -4
- package/dist/{taskRunner-i56-drQV.d.cts → taskRunner-buh6aFpG.d.cts} +4 -4
- package/dist/wallet/expo/background.cjs +17 -14
- package/dist/wallet/expo/background.cjs.map +1 -1
- package/dist/wallet/expo/background.d.cts +5 -4
- package/dist/wallet/expo/background.d.ts +5 -4
- package/dist/wallet/expo/background.js +10 -7
- package/dist/wallet/expo/background.js.map +1 -1
- package/dist/wallet/expo/index.cjs +29 -16
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +12 -7
- package/dist/wallet/expo/index.d.ts +12 -7
- package/dist/wallet/expo/index.js +20 -7
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/worker/expo/index.cjs +12 -9
- package/dist/worker/expo/index.cjs.map +1 -1
- package/dist/worker/expo/index.d.cts +6 -5
- package/dist/worker/expo/index.d.ts +6 -5
- package/dist/worker/expo/index.js +8 -5
- package/dist/worker/expo/index.js.map +1 -1
- package/package.json +16 -1
- package/dist/chunk-5WRA66RV.cjs.map +0 -1
- package/dist/chunk-6FL4N4S2.js.map +0 -1
- package/dist/chunk-BYPBVHVA.cjs.map +0 -1
- package/dist/chunk-HAQAWBYG.js.map +0 -1
- package/dist/chunk-KW7ZEWYS.cjs.map +0 -1
- package/dist/chunk-OPX2HRWM.js.map +0 -1
- package/dist/chunk-OUTWUYJ4.cjs.map +0 -1
- package/dist/chunk-P7B4LQ3H.js.map +0 -1
- package/dist/chunk-T7C3E2HL.js.map +0 -1
- package/dist/chunk-Y4BL3YYX.js.map +0 -1
- package/dist/chunk-ZMSM3NOH.cjs.map +0 -1
- package/dist/chunk-ZPF4I3K2.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Arkade TypeScript SDK
|
|
2
2
|
|
|
3
|
-
The Arkade SDK is a TypeScript library for building Bitcoin wallets using
|
|
3
|
+
The Arkade SDK is a TypeScript library for building Bitcoin wallets using Arkade.
|
|
4
4
|
|
|
5
5
|
[](https://arkade-os.github.io/ts-sdk/)
|
|
6
6
|
[](https://deepwiki.com/arkade-os/ts-sdk)
|
|
@@ -32,7 +32,7 @@ const wallet = await Wallet.create({ identity }) // defaults to mainnet
|
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
`Wallet.create` also accepts short spellings: `service` in place of the
|
|
35
|
-
`
|
|
35
|
+
`operatorProvider`/`indexerProvider`/`onchainProvider` trio, `mode` for `walletMode` and
|
|
36
36
|
`settlement` for `settlementConfig`. Setting both spellings of one field throws.
|
|
37
37
|
|
|
38
38
|
### Read-Only Wallets (Watch-Only)
|
|
@@ -183,6 +183,8 @@ const balance = await readonlyWallet.getBalance()
|
|
|
183
183
|
- Coin type 0 for mainnet, 1 for testnet
|
|
184
184
|
- Account 0, external chain, wildcard index — `identity.descriptor` is the wildcard template that drives HD rotation; consumers materialize a concrete descriptor at a specific index when they need one.
|
|
185
185
|
|
|
186
|
+
For custom `Identity` implementations, see [`TreeSignerSession`](./src/tree/signingSession.ts).
|
|
187
|
+
|
|
186
188
|
### Batch Signing for Browser Wallets
|
|
187
189
|
|
|
188
190
|
Arkade send transactions require N+1 PSBT signatures (N checkpoints + 1 main tx). With local identities like `SingleKey` or `SeedIdentity` this is invisible, but browser wallet extensions (Xverse, UniSat, OKX, etc.) show a confirmation popup per signature. The `BatchSignableIdentity` interface lets wallet providers reduce N+1 popups to a single batch confirmation.
|
|
@@ -220,28 +222,28 @@ await wallet.send({ address: 'ark1q...', amount: 1000 })
|
|
|
220
222
|
|
|
221
223
|
Identities without `signMultiple` continue to work unchanged — each checkpoint is signed individually via `sign()`.
|
|
222
224
|
|
|
223
|
-
###
|
|
225
|
+
### Operator Provider Caching
|
|
224
226
|
|
|
225
|
-
`
|
|
226
|
-
with `
|
|
227
|
+
`RestOperatorProvider.getInfo()` fetches current operator parameters on every call. Wrap it
|
|
228
|
+
with `CachingOperatorProvider` when you reuse that response for fee, signer, or limit lookups:
|
|
227
229
|
|
|
228
230
|
```typescript
|
|
229
|
-
import {
|
|
231
|
+
import { CachingOperatorProvider, RestOperatorProvider, Wallet } from '@arkade-os/sdk'
|
|
230
232
|
|
|
231
|
-
const
|
|
232
|
-
new
|
|
233
|
+
const operatorProvider = new CachingOperatorProvider(
|
|
234
|
+
new RestOperatorProvider('https://arkade.computer'),
|
|
233
235
|
60_000, // optional TTL in milliseconds; defaults to 60 seconds
|
|
234
236
|
)
|
|
235
237
|
|
|
236
|
-
const wallet = await Wallet.create({ identity,
|
|
238
|
+
const wallet = await Wallet.create({ identity, operatorProvider })
|
|
237
239
|
```
|
|
238
240
|
|
|
239
|
-
Only `getInfo()` is cached; all other
|
|
240
|
-
after the TTL and updates when the inner provider reports
|
|
241
|
-
signer rotation. Wrapping `
|
|
241
|
+
Only `getInfo()` is cached; all other provider methods pass through. The cache expires
|
|
242
|
+
after the TTL and updates when the inner provider reports operator info changes, including
|
|
243
|
+
signer rotation. Wrapping `RestOperatorProvider` preserves its `serverUrl`, so `Wallet.create`
|
|
242
244
|
can still derive the default indexer URL. Expired refresh failures propagate;
|
|
243
245
|
wallet boot fallback lives in the persisted ArkInfo snapshot. Call `dispose()` if the
|
|
244
|
-
inner provider outlives the wrapper, to drop its
|
|
246
|
+
inner provider outlives the wrapper, to drop its operator info subscription.
|
|
245
247
|
|
|
246
248
|
### Onchain Providers
|
|
247
249
|
|
|
@@ -396,6 +398,68 @@ import { Ramps } from '@arkade-os/sdk'
|
|
|
396
398
|
const boardingTxId = await new Ramps(wallet).onboard();
|
|
397
399
|
```
|
|
398
400
|
|
|
401
|
+
### Onchain cosigning
|
|
402
|
+
|
|
403
|
+
Boarding UTXOs and server-supported unrolled virtual outputs can be spent immediately with a server cosignature, without waiting for the exit timelock or joining a batch. This needs an Arkade server that exposes onchain cosigning (`POST /v1/tx/onchain/cosign`) and accepts the selected coin type; automatic flows fall back to the previous paths on an unsupported endpoint or a definite server rejection.
|
|
404
|
+
|
|
405
|
+
```typescript
|
|
406
|
+
// Pay onchain from boarding / unrolled coins
|
|
407
|
+
const txid = await wallet.sendOnchain({
|
|
408
|
+
outputs: [{ address: 'bc1q...', amount: 50_000 }]
|
|
409
|
+
})
|
|
410
|
+
|
|
411
|
+
// Sweep every cosignable onchain coin (inputs minus fee) to one address
|
|
412
|
+
await wallet.sendOnchain({ outputs: [], sweepTo: 'bc1q...' })
|
|
413
|
+
|
|
414
|
+
// Cosign a PSBT built elsewhere; returns the broadcast txid
|
|
415
|
+
await wallet.cosignOnchainTx(psbt) // base64 string or Transaction
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
For `cosignOnchainTx`, foreign inputs must already be signed but not finalized: the wallet signs only its own inputs, and arkd refuses a finalized input and finalizes the transaction itself.
|
|
419
|
+
|
|
420
|
+
Preflight: a confirmed wallet input must be more than `onchainCosignMarginBlocks` (wallet config, default 6) blocks from exit maturity; an unconfirmed one is accepted, since its exit cannot have matured. arkd cosigns at most 64 inputs, so a sweep takes the 64 largest coins and leaves the rest for the next one. Failures surface as `OnchainCosignPreflightError` (nothing was submitted), `OnchainCosignRejectedError` (server refused; `arkErrorName` holds its error code) or `OnchainCosignUnsupportedError` (server lacks the endpoint). Use `isCosignFallback(e)` to decide whether paying another way is safe; the automatic paths below do exactly that:
|
|
421
|
+
|
|
422
|
+
```typescript
|
|
423
|
+
import { isCosignFallback, OnchainCosignAmbiguousError } from '@arkade-os/sdk'
|
|
424
|
+
|
|
425
|
+
try {
|
|
426
|
+
await wallet.sendOnchain({ outputs: [{ address, amount }] })
|
|
427
|
+
} catch (e) {
|
|
428
|
+
if (!isCosignFallback(e)) throw e // includes OnchainCosignAmbiguousError
|
|
429
|
+
await payThroughABatch()
|
|
430
|
+
}
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
`OnchainCosignAmbiguousError` means the transaction may have been broadcast (a transport failure, or a server error after submission): do not retry with other coins. The inputs stay pending until the chain resolves.
|
|
434
|
+
|
|
435
|
+
Contracts carry a `scope`: `"offchain"`, `"onchain"` or `"both"`. It controls whether the contract's onchain coins are watched and spent through cosigning; boarding contracts default to `"onchain"`.
|
|
436
|
+
|
|
437
|
+
Automatic behaviour:
|
|
438
|
+
|
|
439
|
+
- `VtxoManager` renews boarding coins that are near expiry via cosign, falling back to the CSV path. It never sweeps unrolled outputs (that would undo the exit); spend those with `sendOnchain` or `cosignOnchainTx`.
|
|
440
|
+
- `Ramps.offboardExact` and the payment router's onchain rail spend onchain coins directly when they alone cover the amount; otherwise they use the batch path. `Ramps.offboard` always uses the batch path.
|
|
441
|
+
|
|
442
|
+
#### Arkade contracts
|
|
443
|
+
|
|
444
|
+
Arkade contracts can spend their own onchain UTXOs. Pass an `emulator` (cosigner for covenant leaves) and an `onchain` provider to `connect`:
|
|
445
|
+
|
|
446
|
+
```typescript
|
|
447
|
+
import { arkade } from '@arkade-os/sdk'
|
|
448
|
+
|
|
449
|
+
const ark = await arkade.Arkade.connect({ arkade: arkProvider, emulator, onchain })
|
|
450
|
+
const contract = ark.contract(program)
|
|
451
|
+
|
|
452
|
+
const txid = await contract.functions
|
|
453
|
+
.claim(/* args */)
|
|
454
|
+
.from(utxo)
|
|
455
|
+
.to(destinationScript, 40_000n)
|
|
456
|
+
.onchainFee(500n) // must not exceed the surplus; without change() it must equal it
|
|
457
|
+
.change(changeScript)
|
|
458
|
+
.sendOnchain() // or .buildOnchain() for the unsigned Transaction
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
Covenant leaves spent onchain must not include the Arkade server key; the emulator's onchain endpoint refuses them.
|
|
462
|
+
|
|
399
463
|
### Checking Balance
|
|
400
464
|
|
|
401
465
|
```typescript
|
|
@@ -412,10 +476,10 @@ const balance = await wallet.getBalance()
|
|
|
412
476
|
| `preconfirmed` | Owned offchain funds not yet finalized in a batch. |
|
|
413
477
|
| `available` | What `send` and every other automatic coin selection can spend now. |
|
|
414
478
|
| `contractLocked` | Held by a contract that generic spending refuses (chiefly swap escrow); only that contract can spend it ([Contract Management](#contract-management)). |
|
|
415
|
-
| `pendingSettlement` | Committed to an in-flight
|
|
479
|
+
| `pendingSettlement` | Committed to an in-flight batch registration; back in `available` when the registration ends. Always `0` without `storage.intentRepository`. |
|
|
416
480
|
| `reserved` | Held by [`reserveVtxos`](#holding-vtxos-for-your-own-use) until released. |
|
|
417
481
|
| `recoverable` | Swept or subdust virtual outputs that [`recoverVtxos`](#recovery-reclaim-swept-vtxos) can reclaim; `getRecoverableBalance()` gives what a batch would return today. |
|
|
418
|
-
| `deprecatedSignerLocked` | Under
|
|
482
|
+
| `deprecatedSignerLocked` | Under an operator signer past its cutoff, which the operator no longer cosigns; recovers once swept and re-settled. |
|
|
419
483
|
| `unrolled` | Already [unilaterally exited](#unilateral-exit): onchain behind its CSV timelock, movable only by `Unroll.completeUnroll`. |
|
|
420
484
|
| `total` | Everything the wallet owns: `boarding.total + settled + preconfirmed + recoverable + deprecatedSignerLocked + unrolled`. |
|
|
421
485
|
| `assets` | Every [asset](#assets-issue-reissue-burn-send) balance the wallet owns. |
|
|
@@ -651,7 +715,7 @@ try {
|
|
|
651
715
|
|
|
652
716
|
#### Recovery: Reclaim Swept VTXOs
|
|
653
717
|
|
|
654
|
-
Recover virtual outputs that have been swept by the
|
|
718
|
+
Recover virtual outputs that have been swept by the operator or consolidate small amounts (subdust).
|
|
655
719
|
|
|
656
720
|
```typescript
|
|
657
721
|
// Recover swept virtual outputs and preconfirmed subdust
|
|
@@ -672,7 +736,7 @@ Instead of the delegating user renewing virtual outputs by themselves, their del
|
|
|
672
736
|
|
|
673
737
|
This is useful for wallets that cannot be online 24/7.
|
|
674
738
|
|
|
675
|
-
When a `delegateProvider` is configured, the wallet address includes an extra tapscript path that authorizes the delegate to
|
|
739
|
+
When a `delegateProvider` is configured, the wallet address includes an extra tapscript path that authorizes the delegate to cosign renewals alongside the operator.
|
|
676
740
|
|
|
677
741
|
To run a delegation service, you'll need to set up a [Fulmine server](https://github.com/ArkLabsHQ/fulmine) with the [Delegation API](https://github.com/ArkLabsHQ/fulmine?tab=readme-ov-file#-delegate-api) enabled.
|
|
678
742
|
|
|
@@ -802,8 +866,8 @@ const wallet = await Wallet.create({
|
|
|
802
866
|
identity: MnemonicIdentity.fromMnemonic('abandon abandon...'),
|
|
803
867
|
})
|
|
804
868
|
|
|
805
|
-
// Get fee information from the
|
|
806
|
-
const { fees: feeInfo } = await wallet.
|
|
869
|
+
// Get fee information from the operator
|
|
870
|
+
const { fees: feeInfo } = await wallet.getOperatorInfo();
|
|
807
871
|
|
|
808
872
|
const exitTxid = await new Ramps(wallet).offboard(
|
|
809
873
|
'bc1p...',
|
|
@@ -811,9 +875,9 @@ const exitTxid = await new Ramps(wallet).offboard(
|
|
|
811
875
|
);
|
|
812
876
|
```
|
|
813
877
|
|
|
814
|
-
`
|
|
815
|
-
service-worker and Expo wallets too. It answers with the
|
|
816
|
-
to the snapshot persisted at wallet construction when the
|
|
878
|
+
`getOperatorInfo()` is part of the `IReadonlyWallet` interface, so the same call works on the
|
|
879
|
+
service-worker and Expo wallets too. It answers with the operator's live `OperatorInfo`, falling back
|
|
880
|
+
to the snapshot persisted at wallet construction when the operator is unreachable.
|
|
817
881
|
|
|
818
882
|
### Concurrent Spending & Coin Reservations
|
|
819
883
|
|
|
@@ -822,7 +886,7 @@ exit waits for its batch swap queues until that batch swap finalizes, and an exi
|
|
|
822
886
|
spends every spendable VTXO. Opt in to let spends overlap on disjoint VTXOs:
|
|
823
887
|
|
|
824
888
|
```typescript
|
|
825
|
-
const wallet = await Wallet.create({ identity,
|
|
889
|
+
const wallet = await Wallet.create({ identity, operatorProvider, concurrentSpending: true })
|
|
826
890
|
```
|
|
827
891
|
|
|
828
892
|
With `concurrentSpending`:
|
|
@@ -870,7 +934,7 @@ Limits:
|
|
|
870
934
|
- Deprecated-signer migration and recovery name the VTXOs they move, so they can spend a held VTXO.
|
|
871
935
|
- Renewal skips a held VTXO even once it is inside the renewal threshold, since renewing would
|
|
872
936
|
change the outpoint you are holding. It logs a warning naming each such VTXO; spend or release a
|
|
873
|
-
long-lived hold before the VTXO expires, or the
|
|
937
|
+
long-lived hold before the VTXO expires, or the operator sweeps it and it comes back only through
|
|
874
938
|
recovery.
|
|
875
939
|
- `toReadonly()` views and the service worker's balance reads do not see reservations.
|
|
876
940
|
- `reserveVtxos` is on `Wallet`; the service-worker and Expo wallets accept `concurrentSpending`
|
|
@@ -880,14 +944,14 @@ If your app keeps its own reserved-outpoint set, call `reserveVtxos` where you a
|
|
|
880
944
|
`release()` where you remove, then let the SDK pick: plain `send`, router payments without
|
|
881
945
|
`selectedVtxos`, and exits without `vtxos` all skip what you hold.
|
|
882
946
|
|
|
883
|
-
### Talking to the
|
|
947
|
+
### Talking to the operator through the wallet
|
|
884
948
|
|
|
885
|
-
`
|
|
886
|
-
|
|
949
|
+
`getOperatorInfo()` is one of three seams that let a plugin work from a wallet alone, never an
|
|
950
|
+
operator URL of its own:
|
|
887
951
|
|
|
888
952
|
| Seam | Interface | For |
|
|
889
953
|
| --- | --- | --- |
|
|
890
|
-
| `
|
|
954
|
+
| `getOperatorInfo()` | `IReadonlyWallet` | Network, signer key, delays, dust, fees, limits |
|
|
891
955
|
| `getArkadeReader()` | `IReadonlyWallet` | Chain reads for scripts the wallet does not own |
|
|
892
956
|
| `getArkadeBroadcaster()` | `IWallet` | `submitTx` / `finalizeTx` |
|
|
893
957
|
|
|
@@ -897,7 +961,7 @@ const { vtxos } = await reader.getVtxos({ scripts: [covenantScriptHex], spendabl
|
|
|
897
961
|
const { txs } = await reader.getVirtualTxs([spendTxid]);
|
|
898
962
|
```
|
|
899
963
|
|
|
900
|
-
`getVtxos()` here queries the
|
|
964
|
+
`getVtxos()` here queries the operator for an arbitrary script — distinct from
|
|
901
965
|
`wallet.getVtxos()`, which answers the wallet's own outputs from local repositories. Everything
|
|
902
966
|
it returns is normalized, so each VTXO carries its canonical facts.
|
|
903
967
|
|
|
@@ -909,7 +973,7 @@ connection instead of opening a second one outside its rate gate and caches.
|
|
|
909
973
|
|
|
910
974
|
### Unilateral Exit
|
|
911
975
|
|
|
912
|
-
Unilateral exit
|
|
976
|
+
Unilateral exit lets you move your funds from virtual outputs to onchain outputs without cooperation from the operator. This process involves two main steps:
|
|
913
977
|
|
|
914
978
|
1. **Unrolling**: Broadcasting the transaction chain from offchain back to onchain
|
|
915
979
|
2. **Completing the exit**: Spending the unrolled virtual outputs after the timelock expires
|
|
@@ -1085,7 +1149,7 @@ Key properties:
|
|
|
1085
1149
|
|
|
1086
1150
|
### Exit data available offline
|
|
1087
1151
|
|
|
1088
|
-
The exit above resolves a VTXO's transaction chain from the
|
|
1152
|
+
The exit above resolves a VTXO's transaction chain from the Arkade **indexer** at
|
|
1089
1153
|
exit time. To make a unilateral exit work even when the indexer is unreachable,
|
|
1090
1154
|
configure a `virtualTxRepository` (SQLite / Realm / IndexedDB / InMemory): the
|
|
1091
1155
|
wallet then captures each received VTXO's exit branch locally and prunes it on
|
|
@@ -1103,7 +1167,7 @@ const wallet = await Wallet.create({
|
|
|
1103
1167
|
virtualTxRepository: new InMemoryVirtualTxRepository(),
|
|
1104
1168
|
// Optional. `mode` defaults to "lite" (structure only, cheap — most VTXOs
|
|
1105
1169
|
// never exit). Use "full" to also store the pre-signed PSBTs, so an exit
|
|
1106
|
-
// needs no
|
|
1170
|
+
// needs no Arkade indexer (only an Esplora endpoint to broadcast).
|
|
1107
1171
|
exitDataCapture: { mode: 'full' },
|
|
1108
1172
|
},
|
|
1109
1173
|
})
|
|
@@ -1135,7 +1199,7 @@ import {
|
|
|
1135
1199
|
WalletMessageHandler,
|
|
1136
1200
|
IndexedDBWalletRepository,
|
|
1137
1201
|
IndexedDBContractRepository,
|
|
1138
|
-
|
|
1202
|
+
IndexedDBBatchRegistrationRepository,
|
|
1139
1203
|
} from '@arkade-os/sdk'
|
|
1140
1204
|
|
|
1141
1205
|
const walletRepo = new IndexedDBWalletRepository()
|
|
@@ -1145,10 +1209,10 @@ const bus = new MessageBus(walletRepo, contractRepo, {
|
|
|
1145
1209
|
messageHandlers: [new WalletMessageHandler()],
|
|
1146
1210
|
tickIntervalMs: 10_000, // default 10s
|
|
1147
1211
|
// Optional, same opt-in as `storage.intentRepository` on a main-thread
|
|
1148
|
-
// wallet. Omit it and the worker persists no
|
|
1149
|
-
// none on restart, and counts
|
|
1212
|
+
// wallet. Omit it and the worker persists no batch registration, reconciles
|
|
1213
|
+
// none on restart, and counts registration-locked virtual outputs as available
|
|
1150
1214
|
// (`pendingSettlement` stays 0).
|
|
1151
|
-
intentRepository: new
|
|
1215
|
+
intentRepository: new IndexedDBBatchRegistrationRepository(),
|
|
1152
1216
|
})
|
|
1153
1217
|
|
|
1154
1218
|
bus.start()
|
|
@@ -1193,7 +1257,7 @@ display after completion; cached reads do not guarantee a change event.
|
|
|
1193
1257
|
`getStoredBalance().boarding.loaded` is false until this wallet instance has fetched
|
|
1194
1258
|
boarding inputs. Call `getBoardingUtxos()` to refresh them. Stored methods are for
|
|
1195
1259
|
display, not transaction inputs; use the normal reads and spending APIs for actions.
|
|
1196
|
-
New contract registration, identity setup, and
|
|
1260
|
+
New contract registration, identity setup, and operator info validation can still
|
|
1197
1261
|
require provider calls even with lazy initialization enabled.
|
|
1198
1262
|
|
|
1199
1263
|
Service-worker factories expose the same `lazyInitialization` option and a separate
|
|
@@ -1228,7 +1292,7 @@ SDK uses IndexedDB repositories with the default database name.
|
|
|
1228
1292
|
#### Paged repository reads
|
|
1229
1293
|
|
|
1230
1294
|
Collection repositories expose `getVtxosPage`, `getVtxosForScriptPage`, `getUtxosPage`,
|
|
1231
|
-
`getTransactionHistoryPage`, `getContractsPage`, and `
|
|
1295
|
+
`getTransactionHistoryPage`, `getContractsPage`, and `getBatchRegistrationsPage`.
|
|
1232
1296
|
Each accepts `{ limit, after? }` and returns
|
|
1233
1297
|
`{ items, nextCursor? }`; pass `nextCursor` as `after` until it is absent.
|
|
1234
1298
|
Limits must be 1–500. History pages are ordered by `(createdAt, transaction key)`;
|
|
@@ -1236,7 +1300,7 @@ Limits must be 1–500. History pages are ordered by `(createdAt, transaction ke
|
|
|
1236
1300
|
by their script and intent transaction ID. Filters must stay the same across
|
|
1237
1301
|
pages. Repository collection reads use pages directly; `collectVtxos`,
|
|
1238
1302
|
`collectScriptVtxos`, `collectUtxos`, `collectTransactionHistory`, `collectContracts`, and
|
|
1239
|
-
`
|
|
1303
|
+
`collectBatchRegistrations` traverse all pages when a complete snapshot is required.
|
|
1240
1304
|
Wallet spending paths consume every VTXO or UTXO page before coin selection.
|
|
1241
1305
|
In `@arkade-os/swap`, RFQ page `since` values use Unix seconds instead.
|
|
1242
1306
|
|
|
@@ -1254,7 +1318,7 @@ do {
|
|
|
1254
1318
|
|
|
1255
1319
|
#### Repository Versioning
|
|
1256
1320
|
|
|
1257
|
-
`WalletRepository`, `ContractRepository`, `
|
|
1321
|
+
`WalletRepository`, `ContractRepository`, `BatchRegistrationRepository`,
|
|
1258
1322
|
`VirtualTxRepository`, and `AssetSwapRepository` (in `@arkade-os/swap`) each
|
|
1259
1323
|
declare a `readonly version` field with a literal type. All built-in
|
|
1260
1324
|
implementations set this to the current version. If you maintain a custom
|
|
@@ -1415,13 +1479,13 @@ For React Native and Expo applications where standard EventSource and fetch stre
|
|
|
1415
1479
|
|
|
1416
1480
|
```typescript
|
|
1417
1481
|
import { Wallet, MnemonicIdentity } from '@arkade-os/sdk'
|
|
1418
|
-
import {
|
|
1482
|
+
import { ExpoOperatorProvider, ExpoIndexerProvider } from '@arkade-os/sdk/adapters/expo'
|
|
1419
1483
|
|
|
1420
1484
|
const identity = MnemonicIdentity.fromMnemonic('abandon abandon...')
|
|
1421
1485
|
|
|
1422
1486
|
const wallet = await Wallet.create({
|
|
1423
1487
|
identity: identity,
|
|
1424
|
-
|
|
1488
|
+
operatorProvider: new ExpoOperatorProvider('https://arkade.computer'), // For settlement events and transactions streaming
|
|
1425
1489
|
indexerProvider: new ExpoIndexerProvider('https://arkade.computer'), // For address subscriptions and virtual output state updates
|
|
1426
1490
|
})
|
|
1427
1491
|
|
|
@@ -1431,9 +1495,9 @@ const balance = await wallet.getBalance()
|
|
|
1431
1495
|
const address = await wallet.getAddress()
|
|
1432
1496
|
```
|
|
1433
1497
|
|
|
1434
|
-
Both
|
|
1498
|
+
Both ExpoOperatorProvider and ExpoIndexerProvider are available as adapters following the SDK's modular architecture pattern. This keeps the main SDK bundle clean while providing opt-in functionality for specific environments:
|
|
1435
1499
|
|
|
1436
|
-
- **
|
|
1500
|
+
- **ExpoOperatorProvider**: Handles settlement events and transaction streaming using expo/fetch for Server-Sent Events
|
|
1437
1501
|
- **ExpoIndexerProvider**: Handles address subscriptions and virtual output state updates using expo/fetch for JSON streaming
|
|
1438
1502
|
|
|
1439
1503
|
For persistence in Expo/React Native, use the SQLite repository with `expo-sqlite`:
|
|
@@ -1451,7 +1515,7 @@ const executor = {
|
|
|
1451
1515
|
|
|
1452
1516
|
const wallet = await Wallet.create({
|
|
1453
1517
|
identity,
|
|
1454
|
-
|
|
1518
|
+
operatorProvider: new ExpoOperatorProvider('https://arkade.computer'),
|
|
1455
1519
|
indexerProvider: new ExpoIndexerProvider('https://arkade.computer'),
|
|
1456
1520
|
storage: {
|
|
1457
1521
|
walletRepository: new SQLiteWalletRepository(executor),
|
|
@@ -1476,7 +1540,7 @@ global.crypto.getRandomValues = Crypto.getRandomValues;
|
|
|
1476
1540
|
|
|
1477
1541
|
// Now import the SDK
|
|
1478
1542
|
import { Wallet, MnemonicIdentity } from '@arkade-os/sdk';
|
|
1479
|
-
import {
|
|
1543
|
+
import { ExpoOperatorProvider, ExpoIndexerProvider } from '@arkade-os/sdk/adapters/expo';
|
|
1480
1544
|
```
|
|
1481
1545
|
|
|
1482
1546
|
This is required for MuSig2 settlements and cryptographic operations.
|
|
@@ -1495,7 +1559,7 @@ To watch transactions at scripts you don't know in advance (extension packets at
|
|
|
1495
1559
|
|
|
1496
1560
|
Read compiler format v1 JSON with `arkade.programFromArtifact`, which returns a normalized Program at version 1. `arkade.parseArtifact` reads normalized Program JSON and defaults omitted versions to 1. Only version 1 is supported, with typed `{ name, type }` declarations for every constructor parameter and call argument. Explicit version 0 programs, including persisted contracts, are rejected; there is no automatic migration. Older SDKs reject version 1 programs rather than silently reconstructing a different script. An Arkade function and its same-named Taproot leaf share one call, such as `contract.functions.claim(...)`. Standalone Taproot functions use their own names, such as `contract.functions.unilateral()`. Leaf order in the artifact still determines the Taproot tree. This example assumes a `digest: bytes32` constructor and a `claim` function with one `preimage: bytes32` covenant argument; wallet, artifact JSON and matching digest/preimage values are already available.
|
|
1497
1561
|
|
|
1498
|
-
Declarations retain the compiler's native scalar names: `pubkey`, `signature`, `bytes`, `bytes20`, `bytes32`, `asset`, `int`, `bool` and `AssetGroup`. There are no `hash` or `sig` type aliases. Byte types take `Uint8Array`; `int`, `bool` and `AssetGroup` take `bigint | number`, with `bool` restricted to `0` or `1`. Fixed widths follow the type itself, without extra width or boolean flags. The SDK requires every `pubkey` to be a 32-byte x-only key, although the language treats it as a bytes alias. Structs and arrays retain the compiler's flattened scalar field names and ordering.
|
|
1562
|
+
Declarations retain the compiler's native scalar names: `pubkey`, `signature`, `bytes`, `bytes20`, `bytes32`, `asset`, `int`, `bool` and `AssetGroup`. There are no `hash` or `sig` type aliases. Byte types take `Uint8Array`; `int`, `bool` and `AssetGroup` take `bigint | number`, with `bool` restricted to `0` or `1`. Fixed widths follow the type itself, without extra width or boolean flags. The SDK requires every `pubkey` to be a 32-byte x-only key, although the language treats it as a bytes alias. Structs and arrays retain the compiler's flattened scalar field names and ordering in the normalized Program, but deployments and calls take them whole: an object for a struct, an array for a fixed array, nested to any depth.
|
|
1499
1563
|
|
|
1500
1564
|
The normalized Program remains an SDK representation: compiler `constructorInputs` become `params`, spend groups and leaves become named `functions`, and covenant `arkade` becomes `arkadeScript`. `parseArtifact` and `stringifyArtifact` read and write that normalized representation; `programFromArtifact` reads the compiler format. Existing deployment and call methods use the same syntax for imported and hand-written programs.
|
|
1501
1565
|
|
|
@@ -1506,7 +1570,7 @@ import { arkade, Arkade, ArkAddress } from '@arkade-os/sdk'
|
|
|
1506
1570
|
|
|
1507
1571
|
const program = arkade.programFromArtifact(artifactJson)
|
|
1508
1572
|
const client = await Arkade.connect({
|
|
1509
|
-
service: { network: 'bitcoin' }, // operator, indexer
|
|
1573
|
+
service: { network: 'bitcoin' }, // operator, indexer and esplora
|
|
1510
1574
|
identity: wallet.identity,
|
|
1511
1575
|
contractManager: await wallet.getContractManager(),
|
|
1512
1576
|
})
|
|
@@ -1526,9 +1590,33 @@ await wallet.send({ address: contract.address, amount: 10_000 })
|
|
|
1526
1590
|
|
|
1527
1591
|
`contract.on('vtxo_received' | 'vtxo_spent' | 'connection_reset', cb)` reports activity from subscription on and returns a handle with `off()`. Coins that predate it are not replayed and a reconnect re-syncs silently, so read `contract.getVtxos()` (every stored VTXO, spent ones included) after subscribing and on each `connection_reset`.
|
|
1528
1592
|
|
|
1529
|
-
The connected
|
|
1593
|
+
The connected operator supplies `<SERVER_KEY>` (the reserved `server` parameter in normalized Programs) and `<SERVER_EXIT_DELAY>`; conflicting overrides fail, and time-based delays that are not multiples of 512 seconds fail rather than changing the advertised delay. Resolved bindings are persisted, so restoring the contract keeps its script through server key or policy changes. A declared constructor named `user` defaults to the connected identity; other constructor keys remain caller-provided. Pass a struct or array param whole by its source name, such as `{ owners: [{ key }, { key }] }`; the flattened names it binds, such as `owners.0.key`, are also accepted, and a missing, extra or duplicated field fails with its full name. Child-output placeholders remain explicit `bytes32` constructor bindings. Leaf call inputs used as script operands cannot produce a fixed address and are rejected; raw CSV operands must be canonical BIP68 encodings.
|
|
1594
|
+
|
|
1595
|
+
For compiler-derived programs, call arguments are covenant inputs in declaration order, followed by non-signature leaf inputs in declaration order, one argument per source parameter: a struct or array input is passed whole, as in `contract.functions.spend(request, oracles)`. Same-named inputs in the two scopes remain separate positional arguments. Leaf signatures are PSBT signatures, not condition arguments: `send()` supports the connected identity and infrastructure signers; additional identities and covenant-tweaked leaf keys require explicit PSBT signing via `build()`. Covenant signature arguments remain caller-provided; transaction-bound Arkade `checkSig` signatures require an Arkade-specific digest helper, which is deferred. CSV leaves require aged onchain outputs and cannot use this offchain builder. Typed call validation and these spending limits apply to every normalized Program. The public `SignerRef` union is unchanged; version 1 programs store emulator signer placement in optional `emulatorIndex` metadata.
|
|
1596
|
+
|
|
1597
|
+
#### Compiling Arkade source
|
|
1598
|
+
|
|
1599
|
+
`@arkade-os/sdk/compiler` compiles Arkade source into the same Program, without a separate compile step. It needs the optional peer `@arkade-os/compiler`, which you install and pin yourself: `npm install --save-exact @arkade-os/compiler`. The root SDK never loads it. `files` maps relative `.ark` paths to their source, and imports resolve relative to the importing file.
|
|
1600
|
+
|
|
1601
|
+
```typescript
|
|
1602
|
+
import { compile, CompileError } from '@arkade-os/sdk/compiler'
|
|
1603
|
+
|
|
1604
|
+
try {
|
|
1605
|
+
const { program, diagnostics } = await compile({
|
|
1606
|
+
entry: 'contracts/vault.ark',
|
|
1607
|
+
files: { 'contracts/vault.ark': vaultSource, 'shared/limits.ark': limitsSource },
|
|
1608
|
+
})
|
|
1609
|
+
for (const d of diagnostics) console.warn(`${d.file}:${d.start?.line} ${d.message}`)
|
|
1610
|
+
const contract = client.contract(program, { owner, minimum: 1_000n })
|
|
1611
|
+
} catch (e) {
|
|
1612
|
+
if (e instanceof CompileError) for (const d of e.diagnostics) console.error(d.message)
|
|
1613
|
+
else throw e
|
|
1614
|
+
}
|
|
1615
|
+
```
|
|
1616
|
+
|
|
1617
|
+
Warnings come back in `diagnostics`, and source errors reject with `CompileError`. The result's `artifact` is the compiler's raw output, with the source bundle, compiler version and fingerprint. CommonJS callers can `require('@arkade-os/sdk/compiler')`, which loads the ESM-only compiler through `import()` on the first call. In a browser, the bundler must emit the compiler's WASM asset; see the `@arkade-os/compiler` README.
|
|
1530
1618
|
|
|
1531
|
-
|
|
1619
|
+
By default the result also carries `debug`, the compiler's debug file, and each covenant in `program` carries its `sourceMap`: the `asm` range of each statement, its line and column in the entry file, and its `require()` message when it has one. Pass `{ debug: false }` to leave both out. A file written by `arkadec --debug` attaches the same way through `arkade.programFromArtifact(artifact, debug)`, which refuses a file whose fingerprint does not match the artifact's. Source maps live in memory only: `stringifyArtifact` does not write them, so a restored contract has none.
|
|
1532
1620
|
|
|
1533
1621
|
#### HD look-ahead window
|
|
1534
1622
|
|
package/dist/adapters/expo.cjs
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
3
|
+
var chunkHQQ4NRXI_cjs = require('../chunk-HQQ4NRXI.cjs');
|
|
4
|
+
require('../chunk-XWUCNMPN.cjs');
|
|
5
|
+
require('../chunk-KCL5AVML.cjs');
|
|
6
|
+
require('../chunk-FLPWNMX3.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
Object.defineProperty(exports, "ExpoArkProvider", {
|
|
10
11
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkHQQ4NRXI_cjs.ExpoArkProvider; }
|
|
12
13
|
});
|
|
13
14
|
Object.defineProperty(exports, "ExpoIndexerProvider", {
|
|
14
15
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkHQQ4NRXI_cjs.ExpoIndexerProvider; }
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "ExpoOperatorProvider", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return chunkHQQ4NRXI_cjs.ExpoOperatorProvider; }
|
|
16
21
|
});
|
|
17
22
|
//# sourceMappingURL=expo.cjs.map
|
|
18
23
|
//# sourceMappingURL=expo.cjs.map
|
package/dist/adapters/expo.d.cts
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { s as RestOperatorProvider, o as SettlementEvent, T as TxNotificationEvent, t as RestIndexerProvider, u as SubscriptionEvent, v as SubscriptionHeartbeat } from '../index-DkyzIzKL.cjs';
|
|
2
|
+
export { w as ArkProvider, x as IndexerProvider, O as OperatorProvider } from '../index-DkyzIzKL.cjs';
|
|
3
3
|
import '@scure/btc-signer/utils.js';
|
|
4
|
-
import '@scure/btc-signer/psbt.js';
|
|
5
4
|
import '@scure/btc-signer';
|
|
5
|
+
import '@scure/btc-signer/psbt.js';
|
|
6
|
+
import '../base-C-Y5t_0F.cjs';
|
|
6
7
|
import '@scure/btc-signer/transaction.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
|
-
* Expo-compatible
|
|
10
|
+
* Expo-compatible operator provider implementation using expo/fetch for SSE support.
|
|
10
11
|
* This provider works specifically in React Native/Expo environments where
|
|
11
12
|
* standard EventSource is not available but expo/fetch provides SSE capabilities.
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```typescript
|
|
15
|
-
* import {
|
|
16
|
+
* import { ExpoOperatorProvider } from '@arkade-os/sdk/adapters/expo';
|
|
16
17
|
*
|
|
17
|
-
* const provider = new
|
|
18
|
+
* const provider = new ExpoOperatorProvider('https://arkade.computer');
|
|
18
19
|
* const info = await provider.getInfo();
|
|
19
20
|
* ```
|
|
20
21
|
*/
|
|
21
|
-
declare class
|
|
22
|
+
declare class ExpoOperatorProvider extends RestOperatorProvider {
|
|
22
23
|
constructor(serverUrl?: string);
|
|
23
24
|
getEventStream(signal: AbortSignal, topics: string[]): AsyncIterableIterator<SettlementEvent>;
|
|
24
25
|
getTransactionsStream(signal: AbortSignal): AsyncIterableIterator<TxNotificationEvent>;
|
|
25
26
|
}
|
|
27
|
+
/** @deprecated Use {@link ExpoOperatorProvider}. */
|
|
28
|
+
declare const ExpoArkProvider: typeof ExpoOperatorProvider;
|
|
29
|
+
/** @deprecated Use {@link ExpoOperatorProvider}. */
|
|
30
|
+
type ExpoArkProvider = ExpoOperatorProvider;
|
|
26
31
|
|
|
27
32
|
/**
|
|
28
33
|
* Expo-compatible Indexer provider implementation using expo/fetch for streaming support.
|
|
@@ -42,4 +47,4 @@ declare class ExpoIndexerProvider extends RestIndexerProvider {
|
|
|
42
47
|
protected subscriptionStream(url: string, abortSignal: AbortSignal): AsyncIterableIterator<SubscriptionEvent | SubscriptionHeartbeat>;
|
|
43
48
|
}
|
|
44
49
|
|
|
45
|
-
export { ExpoArkProvider, ExpoIndexerProvider };
|
|
50
|
+
export { ExpoArkProvider, ExpoIndexerProvider, ExpoOperatorProvider };
|
package/dist/adapters/expo.d.ts
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { s as RestOperatorProvider, o as SettlementEvent, T as TxNotificationEvent, t as RestIndexerProvider, u as SubscriptionEvent, v as SubscriptionHeartbeat } from '../index-DCml4QJn.js';
|
|
2
|
+
export { w as ArkProvider, x as IndexerProvider, O as OperatorProvider } from '../index-DCml4QJn.js';
|
|
3
3
|
import '@scure/btc-signer/utils.js';
|
|
4
|
-
import '@scure/btc-signer/psbt.js';
|
|
5
4
|
import '@scure/btc-signer';
|
|
5
|
+
import '@scure/btc-signer/psbt.js';
|
|
6
|
+
import '../base-C-Y5t_0F.js';
|
|
6
7
|
import '@scure/btc-signer/transaction.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
|
-
* Expo-compatible
|
|
10
|
+
* Expo-compatible operator provider implementation using expo/fetch for SSE support.
|
|
10
11
|
* This provider works specifically in React Native/Expo environments where
|
|
11
12
|
* standard EventSource is not available but expo/fetch provides SSE capabilities.
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```typescript
|
|
15
|
-
* import {
|
|
16
|
+
* import { ExpoOperatorProvider } from '@arkade-os/sdk/adapters/expo';
|
|
16
17
|
*
|
|
17
|
-
* const provider = new
|
|
18
|
+
* const provider = new ExpoOperatorProvider('https://arkade.computer');
|
|
18
19
|
* const info = await provider.getInfo();
|
|
19
20
|
* ```
|
|
20
21
|
*/
|
|
21
|
-
declare class
|
|
22
|
+
declare class ExpoOperatorProvider extends RestOperatorProvider {
|
|
22
23
|
constructor(serverUrl?: string);
|
|
23
24
|
getEventStream(signal: AbortSignal, topics: string[]): AsyncIterableIterator<SettlementEvent>;
|
|
24
25
|
getTransactionsStream(signal: AbortSignal): AsyncIterableIterator<TxNotificationEvent>;
|
|
25
26
|
}
|
|
27
|
+
/** @deprecated Use {@link ExpoOperatorProvider}. */
|
|
28
|
+
declare const ExpoArkProvider: typeof ExpoOperatorProvider;
|
|
29
|
+
/** @deprecated Use {@link ExpoOperatorProvider}. */
|
|
30
|
+
type ExpoArkProvider = ExpoOperatorProvider;
|
|
26
31
|
|
|
27
32
|
/**
|
|
28
33
|
* Expo-compatible Indexer provider implementation using expo/fetch for streaming support.
|
|
@@ -42,4 +47,4 @@ declare class ExpoIndexerProvider extends RestIndexerProvider {
|
|
|
42
47
|
protected subscriptionStream(url: string, abortSignal: AbortSignal): AsyncIterableIterator<SubscriptionEvent | SubscriptionHeartbeat>;
|
|
43
48
|
}
|
|
44
49
|
|
|
45
|
-
export { ExpoArkProvider, ExpoIndexerProvider };
|
|
50
|
+
export { ExpoArkProvider, ExpoIndexerProvider, ExpoOperatorProvider };
|
package/dist/adapters/expo.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { ExpoArkProvider, ExpoIndexerProvider, ExpoOperatorProvider } from '../chunk-CE46RS6L.js';
|
|
2
|
+
import '../chunk-7GIKLFHC.js';
|
|
3
|
+
import '../chunk-4I53THL6.js';
|
|
4
|
+
import '../chunk-FDJ734CH.js';
|
|
4
5
|
//# sourceMappingURL=expo.js.map
|
|
5
6
|
//# sourceMappingURL=expo.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as TaskQueue, b as TaskItem, d as TaskResult } from './taskRunner-buh6aFpG.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 {
|
|
49
|
+
export { type AsyncStorageLike as A, AsyncStorageTaskQueue as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as TaskQueue, b as TaskItem, d as TaskResult } from './taskRunner-DgMLSk_O.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 {
|
|
49
|
+
export { type AsyncStorageLike as A, AsyncStorageTaskQueue as a };
|