@arkade-os/sdk 0.5.0-rc.27 → 0.5.0-rc.28
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 +35 -0
- package/dist/adapters/expo.cjs +5 -5
- package/dist/adapters/expo.d.cts +4 -4
- package/dist/adapters/expo.d.ts +4 -4
- package/dist/adapters/expo.js +3 -3
- package/dist/{index-BpiwCcFb.d.cts → ark-CgZYyMpf.d.cts} +4367 -4203
- package/dist/{index-BpiwCcFb.d.ts → ark-CgZYyMpf.d.ts} +4367 -4203
- package/dist/{asyncStorageTaskQueue-CGZMG8Mc.d.cts → asyncStorageTaskQueue-B099Jii3.d.cts} +1 -1
- package/dist/{asyncStorageTaskQueue-Ca-mM3NR.d.ts → asyncStorageTaskQueue-BeQji1Ee.d.ts} +1 -1
- package/dist/{chunk-DKHBOT5W.cjs → chunk-3P7SXAAC.cjs} +16 -16
- package/dist/{chunk-DKHBOT5W.cjs.map → chunk-3P7SXAAC.cjs.map} +1 -1
- package/dist/{chunk-PM6KYV7S.cjs → chunk-4BT6HBZQ.cjs} +1150 -701
- package/dist/chunk-4BT6HBZQ.cjs.map +1 -0
- package/dist/{chunk-URILS6HH.cjs → chunk-6BJJ47JM.cjs} +18 -18
- package/dist/{chunk-URILS6HH.cjs.map → chunk-6BJJ47JM.cjs.map} +1 -1
- package/dist/{chunk-BULTXVEN.js → chunk-BDTASM5W.js} +4 -4
- package/dist/{chunk-BULTXVEN.js.map → chunk-BDTASM5W.js.map} +1 -1
- package/dist/{chunk-I4ZWKG7B.js → chunk-BIN2DVKS.js} +670 -222
- package/dist/chunk-BIN2DVKS.js.map +1 -0
- package/dist/{chunk-RUWTAAJK.js → chunk-CG7S6CDR.js} +5 -4
- package/dist/chunk-CG7S6CDR.js.map +1 -0
- package/dist/{chunk-PO6AJUWK.js → chunk-CR5YHHEM.js} +154 -51
- package/dist/chunk-CR5YHHEM.js.map +1 -0
- package/dist/{chunk-ZN7BX5XT.cjs → chunk-FGKBQH5S.cjs} +5 -3
- package/dist/chunk-FGKBQH5S.cjs.map +1 -0
- package/dist/{chunk-X42Z36L5.js → chunk-FSSINCR6.js} +4 -4
- package/dist/{chunk-X42Z36L5.js.map → chunk-FSSINCR6.js.map} +1 -1
- package/dist/{chunk-QXZS4J3V.cjs → chunk-HFSC7T5I.cjs} +10 -10
- package/dist/{chunk-QXZS4J3V.cjs.map → chunk-HFSC7T5I.cjs.map} +1 -1
- package/dist/{chunk-FTJ2YWJJ.js → chunk-PHSUZSRH.js} +3 -3
- package/dist/{chunk-FTJ2YWJJ.js.map → chunk-PHSUZSRH.js.map} +1 -1
- package/dist/{chunk-EP6XF7JX.cjs → chunk-YFQOJTG3.cjs} +201 -96
- package/dist/chunk-YFQOJTG3.cjs.map +1 -0
- package/dist/contracts/handlers/index.cjs +9 -9
- package/dist/contracts/handlers/index.d.cts +5 -5
- package/dist/contracts/handlers/index.d.ts +5 -5
- package/dist/contracts/handlers/index.js +2 -2
- package/dist/{delegate-CG3EwryS.d.ts → delegate-B8KSoeVz.d.ts} +1 -1
- package/dist/{delegate-CH-QUGok.d.cts → delegate-wuf6DBpr.d.cts} +1 -1
- package/dist/{index-DLn2XUIl.d.ts → index-1pLGuueL.d.ts} +58 -52
- package/dist/{index-BPS3Ki3l.d.cts → index-CP3v0PVS.d.cts} +58 -52
- package/dist/index.cjs +328 -316
- package/dist/index.d.cts +326 -285
- package/dist/index.d.ts +326 -285
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +35 -35
- package/dist/repositories/realm/index.d.cts +4 -4
- package/dist/repositories/realm/index.d.ts +4 -4
- package/dist/repositories/realm/index.js +5 -5
- package/dist/repositories/sqlite/index.cjs +33 -33
- package/dist/repositories/sqlite/index.d.cts +4 -4
- package/dist/repositories/sqlite/index.d.ts +4 -4
- package/dist/repositories/sqlite/index.js +5 -5
- package/dist/{taskRunner-Dbdr9WMQ.d.ts → taskRunner-D4IF7tc8.d.cts} +1 -1
- package/dist/{taskRunner-DtphXKXv.d.cts → taskRunner-DzEg63qV.d.ts} +1 -1
- package/dist/wallet/expo/background.cjs +14 -14
- package/dist/wallet/expo/background.d.cts +5 -5
- package/dist/wallet/expo/background.d.ts +5 -5
- package/dist/wallet/expo/background.js +6 -6
- package/dist/wallet/expo/index.cjs +15 -15
- package/dist/wallet/expo/index.d.cts +4 -4
- package/dist/wallet/expo/index.d.ts +4 -4
- package/dist/wallet/expo/index.js +5 -5
- package/dist/{wallet-QvS_5Jjd.d.ts → walletRepository-BA5C6Slk.d.cts} +29 -29
- package/dist/{wallet-CTrmow5R.d.cts → walletRepository-BE2yiIHF.d.ts} +29 -29
- package/dist/worker/expo/index.cjs +9 -9
- package/dist/worker/expo/index.d.cts +6 -6
- package/dist/worker/expo/index.d.ts +6 -6
- package/dist/worker/expo/index.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-EP6XF7JX.cjs.map +0 -1
- package/dist/chunk-I4ZWKG7B.js.map +0 -1
- package/dist/chunk-PM6KYV7S.cjs.map +0 -1
- package/dist/chunk-PO6AJUWK.js.map +0 -1
- package/dist/chunk-RUWTAAJK.js.map +0 -1
- package/dist/chunk-ZN7BX5XT.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -1476,6 +1476,41 @@ When you call `wallet.notifyIncomingFunds()` or use `waitForIncomingFunds()`, it
|
|
|
1476
1476
|
|
|
1477
1477
|
`watcherConfig.failsafePollIntervalMs` (default `20_000`) controls how often the watcher replays repository changes into contract events; it does not fetch fresh VTXOs from the indexer.
|
|
1478
1478
|
|
|
1479
|
+
#### Compiler artifacts
|
|
1480
|
+
|
|
1481
|
+
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; providers, wallet, artifact JSON and matching digest/preimage values are already available.
|
|
1482
|
+
|
|
1483
|
+
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.
|
|
1484
|
+
|
|
1485
|
+
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.
|
|
1486
|
+
|
|
1487
|
+
Before upgrading a wallet with persisted v0 contracts, back up its contract rows and retain a compatible SDK. After the upgrade, `manager.getUnsupportedContracts()` lists the v0 rows the wallet still holds: they stay stored, but their VTXOs are not synced and they cannot be spent or exited. To recover a contract in v1, reconstruct its program with typed declarations while preserving the stored constructor values, signer keys, leaf order and emulator position. Compile with the stored keys and compare the resulting `pkScript` with the original; reconnecting to a server with new keys or defaults can change the address. Only after the scripts match, register the reconstructed contract: over a v0 row with the same script, `register()` (like `manager.createContract`) replaces the row's params in place, then syncs its VTXOs. The row keeps its history, and its label and metadata unless you pass new ones. It leaves any other existing row unchanged. If the scripts differ, continue managing the contract with the compatible SDK. Changing the version number alone is not a migration.
|
|
1488
|
+
|
|
1489
|
+
```typescript
|
|
1490
|
+
import { arkade, ArkAddress } from '@arkade-os/sdk'
|
|
1491
|
+
|
|
1492
|
+
const program = arkade.programFromArtifact(artifactJson)
|
|
1493
|
+
const client = await arkade.Arkade.connect({
|
|
1494
|
+
arkade: arkProvider,
|
|
1495
|
+
emulator: emulatorProvider,
|
|
1496
|
+
indexer: indexerProvider,
|
|
1497
|
+
identity: wallet.identity,
|
|
1498
|
+
contractManager: await wallet.getContractManager(),
|
|
1499
|
+
})
|
|
1500
|
+
const contract = client.contract(program, { digest })
|
|
1501
|
+
await contract.register({ label: 'Hashlock' })
|
|
1502
|
+
await wallet.send({ address: contract.address, amount: 10_000 })
|
|
1503
|
+
|
|
1504
|
+
// Call after funding appears in contract.getUtxos().
|
|
1505
|
+
const { txid } = await contract.functions.claim(preimage)
|
|
1506
|
+
.to(ArkAddress.decode(recipientAddress).pkScript, 10_000n)
|
|
1507
|
+
.send()
|
|
1508
|
+
```
|
|
1509
|
+
|
|
1510
|
+
The connected server 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 and flattened struct/array fields remain caller-provided, using names such as `owners.0.key`. 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.
|
|
1511
|
+
|
|
1512
|
+
For compiler-derived programs, call arguments are covenant inputs in declaration order, followed by non-signature leaf inputs in declaration order. 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.
|
|
1513
|
+
|
|
1479
1514
|
#### HD look-ahead window
|
|
1480
1515
|
|
|
1481
1516
|
HD wallets (`walletMode: 'hd'`, or an explicit HD `DescriptorProvider`) also watch a band of *unused* offchain receive scripts around their allocation watermark, so a payment to an address that some other party issued from the same seed — a merchant backend such as BTCPay Server, or the .NET SDK driving the same wallet — arrives without the user calling `restore()`. `lookAheadWindow` (default `20`) is the per-side width of that band: the wallet watches `[watermark - N, watermark + N]`. Speculative entries are subscription-only; they become contract rows, and enter balances, only once funded.
|
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 chunk3P7SXAAC_cjs = require('../chunk-3P7SXAAC.cjs');
|
|
4
|
+
require('../chunk-6BJJ47JM.cjs');
|
|
5
|
+
require('../chunk-FGKBQH5S.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 chunk3P7SXAAC_cjs.ExpoArkProvider; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "ExpoIndexerProvider", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunk3P7SXAAC_cjs.ExpoIndexerProvider; }
|
|
16
16
|
});
|
|
17
17
|
//# sourceMappingURL=expo.cjs.map
|
|
18
18
|
//# sourceMappingURL=expo.cjs.map
|
package/dist/adapters/expo.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as RestArkProvider, o as SettlementEvent, T as TxNotificationEvent, s as RestIndexerProvider, t as SubscriptionResponse } from '../
|
|
2
|
-
export { u as ArkProvider, v as IndexerProvider } from '../
|
|
3
|
-
import '@scure/btc-signer/utils.js';
|
|
4
|
-
import '@scure/btc-signer/psbt.js';
|
|
1
|
+
import { r as RestArkProvider, o as SettlementEvent, T as TxNotificationEvent, s as RestIndexerProvider, t as SubscriptionResponse } from '../ark-CgZYyMpf.cjs';
|
|
2
|
+
export { u as ArkProvider, v as IndexerProvider } from '../ark-CgZYyMpf.cjs';
|
|
5
3
|
import '@scure/btc-signer';
|
|
6
4
|
import '@scure/btc-signer/transaction.js';
|
|
5
|
+
import '@scure/btc-signer/utils.js';
|
|
6
|
+
import '@scure/btc-signer/psbt.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Expo-compatible Arkade provider implementation using expo/fetch for SSE support.
|
package/dist/adapters/expo.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as RestArkProvider, o as SettlementEvent, T as TxNotificationEvent, s as RestIndexerProvider, t as SubscriptionResponse } from '../
|
|
2
|
-
export { u as ArkProvider, v as IndexerProvider } from '../
|
|
3
|
-
import '@scure/btc-signer/utils.js';
|
|
4
|
-
import '@scure/btc-signer/psbt.js';
|
|
1
|
+
import { r as RestArkProvider, o as SettlementEvent, T as TxNotificationEvent, s as RestIndexerProvider, t as SubscriptionResponse } from '../ark-CgZYyMpf.js';
|
|
2
|
+
export { u as ArkProvider, v as IndexerProvider } from '../ark-CgZYyMpf.js';
|
|
5
3
|
import '@scure/btc-signer';
|
|
6
4
|
import '@scure/btc-signer/transaction.js';
|
|
5
|
+
import '@scure/btc-signer/utils.js';
|
|
6
|
+
import '@scure/btc-signer/psbt.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Expo-compatible Arkade provider implementation using expo/fetch for SSE support.
|
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-FSSINCR6.js';
|
|
2
|
+
import '../chunk-PHSUZSRH.js';
|
|
3
|
+
import '../chunk-CG7S6CDR.js';
|
|
4
4
|
//# sourceMappingURL=expo.js.map
|
|
5
5
|
//# sourceMappingURL=expo.js.map
|