@arkade-os/sdk 0.5.0-rc.6 → 0.5.0-rc.8
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 +29 -0
- 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-BHOhjFiF.d.cts → asyncStorageTaskQueue-Bn3FoNkc.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-BedBOEpT.d.ts → asyncStorageTaskQueue-CeYTmuGU.d.ts} +2 -2
- package/dist/{chunk-TVG3GDEO.cjs → chunk-2AWDPVZI.cjs} +18 -18
- package/dist/{chunk-TVG3GDEO.cjs.map → chunk-2AWDPVZI.cjs.map} +1 -1
- package/dist/{chunk-BMYEJA3W.cjs → chunk-56RCBKNF.cjs} +17 -17
- package/dist/{chunk-BMYEJA3W.cjs.map → chunk-56RCBKNF.cjs.map} +1 -1
- package/dist/{chunk-7PW4GV2Q.js → chunk-BIRUBLP3.js} +4 -4
- package/dist/{chunk-7PW4GV2Q.js.map → chunk-BIRUBLP3.js.map} +1 -1
- package/dist/{chunk-3LGOKP52.cjs → chunk-BMPGUGYZ.cjs} +10 -10
- package/dist/{chunk-3LGOKP52.cjs.map → chunk-BMPGUGYZ.cjs.map} +1 -1
- package/dist/{chunk-IRXEWL2A.js → chunk-G6S4XSFI.js} +3 -3
- package/dist/{chunk-IRXEWL2A.js.map → chunk-G6S4XSFI.js.map} +1 -1
- package/dist/{chunk-BWHKCHJN.js → chunk-INTEA7D3.js} +4 -4
- package/dist/{chunk-BWHKCHJN.js.map → chunk-INTEA7D3.js.map} +1 -1
- package/dist/{chunk-ZF52B7BV.cjs → chunk-K5RED5VE.cjs} +50 -50
- package/dist/{chunk-ZF52B7BV.cjs.map → chunk-K5RED5VE.cjs.map} +1 -1
- package/dist/{chunk-ISA3HWFN.js → chunk-LN4ZJZK4.js} +96 -11
- package/dist/chunk-LN4ZJZK4.js.map +1 -0
- package/dist/{chunk-2P75JIT5.js → chunk-MTYQXZ2T.js} +4 -4
- package/dist/{chunk-2P75JIT5.js.map → chunk-MTYQXZ2T.js.map} +1 -1
- package/dist/{chunk-XR23C6TF.cjs → chunk-NY5FN4VV.cjs} +3 -3
- package/dist/{chunk-XR23C6TF.cjs.map → chunk-NY5FN4VV.cjs.map} +1 -1
- package/dist/{chunk-QKHXUTXM.js → chunk-XCNAGBFR.js} +3 -3
- package/dist/{chunk-QKHXUTXM.js.map → chunk-XCNAGBFR.js.map} +1 -1
- package/dist/{chunk-4I6KPFCB.cjs → chunk-ZTCDT7KB.cjs} +525 -439
- package/dist/chunk-ZTCDT7KB.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-Hl92NVgS.d.ts → delegate-CyBnNY9v.d.ts} +1 -1
- package/dist/{delegate-Dv8aEvSp.d.cts → delegate-Cyv2suFd.d.cts} +1 -1
- package/dist/{hdWalletCapable-QiCK1B9d.d.cts → hdWalletCapable-D1ImQqlu.d.cts} +3 -3
- package/dist/{hdWalletCapable-Bqcb-XtC.d.ts → hdWalletCapable-DvumVrKW.d.ts} +3 -3
- package/dist/{index-F-X4BWxi.d.cts → index-BIL9boGL.d.cts} +14 -1
- package/dist/{index-F-X4BWxi.d.ts → index-BIL9boGL.d.ts} +14 -1
- package/dist/{index-CeC9FiJt.d.cts → index-DleNQcz5.d.cts} +3 -3
- package/dist/{index-BwEO0Yb-.d.ts → index-QVhQgYvU.d.ts} +3 -3
- package/dist/index.cjs +294 -290
- package/dist/index.d.cts +17 -9
- package/dist/index.d.ts +17 -9
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +20 -20
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/realm/index.js +5 -5
- package/dist/repositories/sqlite/index.cjs +19 -19
- package/dist/repositories/sqlite/index.d.cts +2 -2
- package/dist/repositories/sqlite/index.d.ts +2 -2
- package/dist/repositories/sqlite/index.js +5 -5
- package/dist/{taskRunner-BdU_d__J.d.ts → taskRunner-CRbuzUXR.d.ts} +2 -2
- package/dist/{taskRunner-CDCz7MTW.d.cts → taskRunner-z_BGID85.d.cts} +2 -2
- package/dist/wallet/expo/background.cjs +14 -14
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +6 -6
- package/dist/wallet/expo/index.cjs +14 -14
- 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/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 +1 -1
- package/dist/chunk-4I6KPFCB.cjs.map +0 -1
- package/dist/chunk-ISA3HWFN.js.map +0 -1
package/README.md
CHANGED
|
@@ -1371,6 +1371,35 @@ const swWallet = await ServiceWorkerWallet.setup({
|
|
|
1371
1371
|
|
|
1372
1372
|
Raise it when the external issuer is expected to burn more than `N` consecutive addresses without any of them being paid — every index in such a run is a miss, and the funded one sits past the band. When that happens the funds are invisible until a `restore()` whose `gapLimit` is large enough to cross the run (`wallet.restore({ gapLimit: 200 })`); a default restore closes its gap window before reaching the funded index. Keep the value modest: the band adds up to `2N + 1` indices × the candidate matrix (typically 1-4 scripts each) to the wallet's subscription.
|
|
1373
1373
|
|
|
1374
|
+
#### Restoring plugin state
|
|
1375
|
+
|
|
1376
|
+
`wallet.restore()` is the explicit imported-wallet recovery boundary. It first restores the
|
|
1377
|
+
wallet's own addresses, contracts, history, and balances, then runs every restore hook registered
|
|
1378
|
+
for that wallet instance. `Wallet` and `ServiceWorkerWallet` both follow this ordering, and
|
|
1379
|
+
concurrent calls coalesce until the hooks finish.
|
|
1380
|
+
|
|
1381
|
+
```typescript
|
|
1382
|
+
import { registerWalletRestoreHook } from '@arkade-os/sdk'
|
|
1383
|
+
|
|
1384
|
+
const unregister = registerWalletRestoreHook(wallet, {
|
|
1385
|
+
id: 'my-plugin',
|
|
1386
|
+
restore: async (restoredWallet) => {
|
|
1387
|
+
await rebuildPluginState(await restoredWallet.getTransactionHistory())
|
|
1388
|
+
},
|
|
1389
|
+
})
|
|
1390
|
+
|
|
1391
|
+
await wallet.restore()
|
|
1392
|
+
```
|
|
1393
|
+
|
|
1394
|
+
Registering the same `id` again replaces that hook without changing its position. A run uses a
|
|
1395
|
+
stable snapshot, attempts every hook in registration order, and throws an `AggregateError` after
|
|
1396
|
+
all failures have been collected. If core recovery fails, hooks do not run. The returned function
|
|
1397
|
+
removes only that exact registration and is safe to call more than once.
|
|
1398
|
+
|
|
1399
|
+
Hooks do not run during `Wallet.create()`, `ServiceWorkerWallet.setup()`, or ordinary startup. A
|
|
1400
|
+
plugin should register before an application calls `restore()` and keep its normal incremental
|
|
1401
|
+
reconciliation for state that arrives later.
|
|
1402
|
+
|
|
1374
1403
|
For advanced use cases, you can access the ContractManager directly to register external contracts:
|
|
1375
1404
|
|
|
1376
1405
|
```typescript
|
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 chunk56RCBKNF_cjs = require('../chunk-56RCBKNF.cjs');
|
|
4
|
+
require('../chunk-2AWDPVZI.cjs');
|
|
5
|
+
require('../chunk-NY5FN4VV.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 chunk56RCBKNF_cjs.ExpoArkProvider; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "ExpoIndexerProvider", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunk56RCBKNF_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 { q as RestArkProvider, n as SettlementEvent, T as TxNotificationEvent, r as RestIndexerProvider, s as SubscriptionResponse } from '../index-
|
|
2
|
-
export { t as ArkProvider, u as IndexerProvider } from '../index-
|
|
1
|
+
import { q as RestArkProvider, n as SettlementEvent, T as TxNotificationEvent, r as RestIndexerProvider, s as SubscriptionResponse } from '../index-BIL9boGL.cjs';
|
|
2
|
+
export { t as ArkProvider, u as IndexerProvider } from '../index-BIL9boGL.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 { q as RestArkProvider, n as SettlementEvent, T as TxNotificationEvent, r as RestIndexerProvider, s as SubscriptionResponse } from '../index-
|
|
2
|
-
export { t as ArkProvider, u as IndexerProvider } from '../index-
|
|
1
|
+
import { q as RestArkProvider, n as SettlementEvent, T as TxNotificationEvent, r as RestIndexerProvider, s as SubscriptionResponse } from '../index-BIL9boGL.js';
|
|
2
|
+
export { t as ArkProvider, u as IndexerProvider } from '../index-BIL9boGL.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-INTEA7D3.js';
|
|
2
|
+
import '../chunk-G6S4XSFI.js';
|
|
3
|
+
import '../chunk-MTYQXZ2T.js';
|
|
4
4
|
//# sourceMappingURL=expo.js.map
|
|
5
5
|
//# sourceMappingURL=expo.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as TaskQueue, b as TaskItem, d as TaskResult } from './taskRunner-z_BGID85.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-CRbuzUXR.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 };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNY5FN4VV_cjs = require('./chunk-NY5FN4VV.cjs');
|
|
4
4
|
var base = require('@scure/base');
|
|
5
5
|
var secp256k1_js = require('@noble/curves/secp256k1.js');
|
|
6
6
|
var utils_js = require('@scure/btc-signer/utils.js');
|
|
7
7
|
|
|
8
8
|
// src/extension/asset/index.ts
|
|
9
9
|
var asset_exports = {};
|
|
10
|
-
|
|
10
|
+
chunkNY5FN4VV_cjs.__export(asset_exports, {
|
|
11
11
|
ASSET_ID_VECTORS: () => ASSET_ID_VECTORS,
|
|
12
12
|
AssetGroup: () => AssetGroup,
|
|
13
13
|
AssetId: () => AssetId,
|
|
@@ -1419,10 +1419,10 @@ async function indexerFetch(input, init) {
|
|
|
1419
1419
|
const lastAttempt = attempt >= maxAttempts;
|
|
1420
1420
|
let res;
|
|
1421
1421
|
try {
|
|
1422
|
-
res = await
|
|
1422
|
+
res = await chunkNY5FN4VV_cjs.rateGate.runHttp(input, () => chunkNY5FN4VV_cjs.baseFetch(input, init));
|
|
1423
1423
|
} catch (err) {
|
|
1424
|
-
const mapped =
|
|
1425
|
-
if (lastAttempt || !(mapped instanceof
|
|
1424
|
+
const mapped = chunkNY5FN4VV_cjs.toProviderUnavailable(err, "indexer");
|
|
1425
|
+
if (lastAttempt || !(mapped instanceof chunkNY5FN4VV_cjs.ProviderUnavailableError)) throw mapped;
|
|
1426
1426
|
await sleep(retryDelayMs(attempt));
|
|
1427
1427
|
continue;
|
|
1428
1428
|
}
|
|
@@ -1434,7 +1434,7 @@ async function indexerFetch(input, init) {
|
|
|
1434
1434
|
body = void 0;
|
|
1435
1435
|
}
|
|
1436
1436
|
try {
|
|
1437
|
-
|
|
1437
|
+
chunkNY5FN4VV_cjs.throwIfHttpUnavailable(res, "indexer", body);
|
|
1438
1438
|
} catch (err) {
|
|
1439
1439
|
if (lastAttempt) throw err;
|
|
1440
1440
|
await sleep(retryDelayMs(attempt));
|
|
@@ -1463,7 +1463,7 @@ var ChainTxType = /* @__PURE__ */ ((ChainTxType2) => {
|
|
|
1463
1463
|
return ChainTxType2;
|
|
1464
1464
|
})(ChainTxType || {});
|
|
1465
1465
|
var RestIndexerProvider = class {
|
|
1466
|
-
constructor(serverUrl =
|
|
1466
|
+
constructor(serverUrl = chunkNY5FN4VV_cjs.DEFAULT_ARKADE_SERVER_URL, options = {}) {
|
|
1467
1467
|
this.serverUrl = serverUrl;
|
|
1468
1468
|
this.eventSource = options.eventSource;
|
|
1469
1469
|
}
|
|
@@ -1601,8 +1601,8 @@ var RestIndexerProvider = class {
|
|
|
1601
1601
|
try {
|
|
1602
1602
|
while (!abortSignal?.aborted) {
|
|
1603
1603
|
try {
|
|
1604
|
-
const currentIterator =
|
|
1605
|
-
|
|
1604
|
+
const currentIterator = chunkNY5FN4VV_cjs.eventSourceIterator(
|
|
1605
|
+
chunkNY5FN4VV_cjs.resolveEventSource(override)(url)
|
|
1606
1606
|
);
|
|
1607
1607
|
iterator = currentIterator;
|
|
1608
1608
|
for await (const event of currentIterator) {
|
|
@@ -1613,9 +1613,9 @@ var RestIndexerProvider = class {
|
|
|
1613
1613
|
yield {
|
|
1614
1614
|
txid: data.event.txid,
|
|
1615
1615
|
scripts: data.event.scripts || [],
|
|
1616
|
-
newVtxos: (data.event.newVtxos || []).map(
|
|
1617
|
-
spentVtxos: (data.event.spentVtxos || []).map(
|
|
1618
|
-
sweptVtxos: (data.event.sweptVtxos || []).map(
|
|
1616
|
+
newVtxos: (data.event.newVtxos || []).map(chunkNY5FN4VV_cjs.convertVtxo),
|
|
1617
|
+
spentVtxos: (data.event.spentVtxos || []).map(chunkNY5FN4VV_cjs.convertVtxo),
|
|
1618
|
+
sweptVtxos: (data.event.sweptVtxos || []).map(chunkNY5FN4VV_cjs.convertVtxo),
|
|
1619
1619
|
tx: data.event.tx,
|
|
1620
1620
|
checkpointTxs: data.event.checkpointTxs
|
|
1621
1621
|
};
|
|
@@ -1629,14 +1629,14 @@ var RestIndexerProvider = class {
|
|
|
1629
1629
|
if (abortSignal?.aborted || error instanceof Error && error.name === "AbortError") {
|
|
1630
1630
|
break;
|
|
1631
1631
|
}
|
|
1632
|
-
if (
|
|
1632
|
+
if (chunkNY5FN4VV_cjs.isFetchTimeoutError(error)) {
|
|
1633
1633
|
console.debug("Timeout error ignored");
|
|
1634
1634
|
continue;
|
|
1635
1635
|
}
|
|
1636
|
-
if (
|
|
1636
|
+
if (chunkNY5FN4VV_cjs.isEventSourceError(error)) {
|
|
1637
1637
|
throw error;
|
|
1638
1638
|
}
|
|
1639
|
-
if (
|
|
1639
|
+
if (chunkNY5FN4VV_cjs.isEventSourceUnavailableError(error)) throw error;
|
|
1640
1640
|
console.error("Subscription error:", error);
|
|
1641
1641
|
throw error;
|
|
1642
1642
|
} finally {
|
|
@@ -1780,7 +1780,7 @@ var RestIndexerProvider = class {
|
|
|
1780
1780
|
}
|
|
1781
1781
|
const data = await this.fetchVtxosJson(url);
|
|
1782
1782
|
return {
|
|
1783
|
-
vtxos: data.vtxos.map(
|
|
1783
|
+
vtxos: data.vtxos.map(chunkNY5FN4VV_cjs.convertVtxo),
|
|
1784
1784
|
page: data.page
|
|
1785
1785
|
};
|
|
1786
1786
|
}
|
|
@@ -1994,5 +1994,5 @@ exports.Metadata = Metadata;
|
|
|
1994
1994
|
exports.Packet = Packet;
|
|
1995
1995
|
exports.RestIndexerProvider = RestIndexerProvider;
|
|
1996
1996
|
exports.asset_exports = asset_exports;
|
|
1997
|
-
//# sourceMappingURL=chunk-
|
|
1998
|
-
//# sourceMappingURL=chunk-
|
|
1997
|
+
//# sourceMappingURL=chunk-2AWDPVZI.cjs.map
|
|
1998
|
+
//# sourceMappingURL=chunk-2AWDPVZI.cjs.map
|