@arkade-os/sdk 0.4.39 → 0.4.41
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 +24 -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/adapters/indexedDB.cjs +5 -5
- package/dist/adapters/indexedDB.js +4 -4
- package/dist/{ark-BzUNnkoc.d.cts → ark-CSqMJczW.d.cts} +111 -4
- package/dist/{ark-BzUNnkoc.d.ts → ark-CSqMJczW.d.ts} +111 -4
- package/dist/{asyncStorageTaskQueue-C0kQoY1x.d.cts → asyncStorageTaskQueue-79XdGsdW.d.cts} +1 -1
- package/dist/{asyncStorageTaskQueue-CIYeI6GM.d.ts → asyncStorageTaskQueue-SZPrhw23.d.ts} +1 -1
- package/dist/{chunk-GUTKJMSF.cjs → chunk-32YKLQPS.cjs} +29 -29
- package/dist/{chunk-GUTKJMSF.cjs.map → chunk-32YKLQPS.cjs.map} +1 -1
- package/dist/{chunk-P5FKMIGY.cjs → chunk-3MPXMLP4.cjs} +538 -282
- package/dist/chunk-3MPXMLP4.cjs.map +1 -0
- package/dist/{chunk-D744IES4.js → chunk-5XAYUPK4.js} +15 -6
- package/dist/chunk-5XAYUPK4.js.map +1 -0
- package/dist/{chunk-LJLEFPWD.cjs → chunk-ALISWEQ5.cjs} +20 -11
- package/dist/chunk-ALISWEQ5.cjs.map +1 -0
- package/dist/{chunk-OUVTG72A.js → chunk-BE5MUB7T.js} +5 -3
- package/dist/chunk-BE5MUB7T.js.map +1 -0
- package/dist/{chunk-SYEGCMNV.js → chunk-D5MQYYYF.js} +355 -104
- package/dist/chunk-D5MQYYYF.js.map +1 -0
- package/dist/{chunk-VGXTJ7HR.js → chunk-DDG4RE5F.js} +4 -4
- package/dist/{chunk-VGXTJ7HR.js.map → chunk-DDG4RE5F.js.map} +1 -1
- package/dist/{chunk-CMPJR3HS.cjs → chunk-HXDZ2QTW.cjs} +5 -3
- package/dist/chunk-HXDZ2QTW.cjs.map +1 -0
- package/dist/{chunk-A5RLZCPO.cjs → chunk-KNASU3QI.cjs} +7 -7
- package/dist/{chunk-A5RLZCPO.cjs.map → chunk-KNASU3QI.cjs.map} +1 -1
- package/dist/{chunk-UIFBMKI7.js → chunk-MYI333YH.js} +3 -3
- package/dist/{chunk-UIFBMKI7.js.map → chunk-MYI333YH.js.map} +1 -1
- package/dist/{chunk-N56IDZON.cjs → chunk-WBF3FNS3.cjs} +14 -14
- package/dist/{chunk-N56IDZON.cjs.map → chunk-WBF3FNS3.cjs.map} +1 -1
- package/dist/{chunk-CUSABEUQ.js → chunk-YNEDJTX2.js} +3 -3
- package/dist/{chunk-CUSABEUQ.js.map → chunk-YNEDJTX2.js.map} +1 -1
- package/dist/contracts/handlers/index.cjs +7 -7
- 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-BjPbX-MR.d.ts → delegate-BTn9BK8E.d.ts} +1 -1
- package/dist/{delegate-DHAgMIS9.d.cts → delegate-Bqwe-kbj.d.cts} +1 -1
- package/dist/{index-YkMAtSfw.d.cts → index-aYiHTMkX.d.cts} +2 -2
- package/dist/{index-BOQKDCmS.d.ts → index-kITujXlS.d.ts} +2 -2
- package/dist/index.cjs +163 -139
- package/dist/index.d.cts +53 -11
- package/dist/index.d.ts +53 -11
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +13 -13
- package/dist/repositories/realm/index.d.cts +1 -1
- package/dist/repositories/realm/index.d.ts +1 -1
- package/dist/repositories/realm/index.js +4 -4
- package/dist/repositories/sqlite/index.cjs +13 -13
- package/dist/repositories/sqlite/index.d.cts +1 -1
- package/dist/repositories/sqlite/index.d.ts +1 -1
- package/dist/repositories/sqlite/index.js +4 -4
- package/dist/{taskRunner-Dfmt7ZPN.d.ts → taskRunner-BuBAZQwB.d.ts} +1 -1
- package/dist/{taskRunner-CVEgBO6d.d.cts → taskRunner-DRHElPMG.d.cts} +1 -1
- 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 +44 -14
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +14 -4
- package/dist/wallet/expo/index.d.ts +14 -4
- package/dist/wallet/expo/index.js +36 -6
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/{wallet-C4Pide44.d.ts → wallet-BZgRfnAE.d.cts} +15 -2
- package/dist/{wallet-_PTv-lMe.d.cts → wallet-CTEQpKG9.d.ts} +15 -2
- 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-CMPJR3HS.cjs.map +0 -1
- package/dist/chunk-D744IES4.js.map +0 -1
- package/dist/chunk-LJLEFPWD.cjs.map +0 -1
- package/dist/chunk-OUVTG72A.js.map +0 -1
- package/dist/chunk-P5FKMIGY.cjs.map +0 -1
- package/dist/chunk-SYEGCMNV.js.map +0 -1
package/README.md
CHANGED
|
@@ -360,6 +360,30 @@ const txid = await wallet.send({
|
|
|
360
360
|
})
|
|
361
361
|
```
|
|
362
362
|
|
|
363
|
+
### Activity history
|
|
364
|
+
|
|
365
|
+
Group the wallet's transaction history into labelled, logical activities. Register an
|
|
366
|
+
`ActivityResolver` object; its optional `prepare()` can refresh correlation data, and
|
|
367
|
+
its synchronous `resolve(tx)` returns memberships. `getActivityHistory()` buckets
|
|
368
|
+
the transactions into `Activity` rows. The `boarding` built-in is pre-registered,
|
|
369
|
+
and a transaction can belong to multiple groups (e.g. a batched settlement).
|
|
370
|
+
|
|
371
|
+
```typescript
|
|
372
|
+
// Tag your app's transactions (correlate by txid however you track them)
|
|
373
|
+
wallet.activity.use({
|
|
374
|
+
id: 'my-app',
|
|
375
|
+
resolve: (tx) => {
|
|
376
|
+
const action = myActions.get(tx.key.arkTxid)
|
|
377
|
+
return action ? [{ groupId: action.id, label: action.label, kind: 'app' }] : undefined
|
|
378
|
+
},
|
|
379
|
+
})
|
|
380
|
+
|
|
381
|
+
// Built-ins (boarding) + your resolver; txs grouped oldest-first per activity
|
|
382
|
+
const activities = await wallet.getActivityHistory()
|
|
383
|
+
// amount is signed sats: positive received, negative sent; same-key change rows are excluded
|
|
384
|
+
// each Activity: { id, intent?, txs, amount, createdAt, settled }
|
|
385
|
+
```
|
|
386
|
+
|
|
363
387
|
### Assets (Issue, Reissue, Burn, Send)
|
|
364
388
|
|
|
365
389
|
The wallet's `assetManager` lets you create and manage assets on Arkade. The `send` method supports sending assets.
|
package/dist/adapters/expo.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
3
|
+
var chunkWBF3FNS3_cjs = require('../chunk-WBF3FNS3.cjs');
|
|
4
|
+
require('../chunk-ALISWEQ5.cjs');
|
|
5
|
+
require('../chunk-HXDZ2QTW.cjs');
|
|
6
6
|
require('../chunk-5BLDMQED.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "ExpoArkProvider", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkWBF3FNS3_cjs.ExpoArkProvider; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "ExpoIndexerProvider", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkWBF3FNS3_cjs.ExpoIndexerProvider; }
|
|
17
17
|
});
|
|
18
18
|
//# sourceMappingURL=expo.cjs.map
|
|
19
19
|
//# sourceMappingURL=expo.cjs.map
|
package/dist/adapters/expo.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { l as RestArkProvider, j as SettlementEvent, T as TxNotification, m as RestIndexerProvider, n as SubscriptionResponse } from '../ark-CSqMJczW.cjs';
|
|
2
|
+
export { o as ArkProvider, p as IndexerProvider } from '../ark-CSqMJczW.cjs';
|
|
3
3
|
import '@scure/btc-signer/transaction.js';
|
|
4
4
|
import '@scure/btc-signer/utils.js';
|
|
5
5
|
import '@scure/btc-signer/psbt.js';
|
package/dist/adapters/expo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { l as RestArkProvider, j as SettlementEvent, T as TxNotification, m as RestIndexerProvider, n as SubscriptionResponse } from '../ark-CSqMJczW.js';
|
|
2
|
+
export { o as ArkProvider, p as IndexerProvider } from '../ark-CSqMJczW.js';
|
|
3
3
|
import '@scure/btc-signer/transaction.js';
|
|
4
4
|
import '@scure/btc-signer/utils.js';
|
|
5
5
|
import '@scure/btc-signer/psbt.js';
|
package/dist/adapters/expo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-DDG4RE5F.js';
|
|
2
|
+
import '../chunk-5XAYUPK4.js';
|
|
3
|
+
import '../chunk-BE5MUB7T.js';
|
|
4
4
|
import '../chunk-NSBPE2FW.js';
|
|
5
5
|
//# sourceMappingURL=expo.js.map
|
|
6
6
|
//# sourceMappingURL=expo.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
3
|
+
var chunk3MPXMLP4_cjs = require('../chunk-3MPXMLP4.cjs');
|
|
4
|
+
require('../chunk-ALISWEQ5.cjs');
|
|
5
|
+
require('../chunk-32YKLQPS.cjs');
|
|
6
|
+
require('../chunk-HXDZ2QTW.cjs');
|
|
7
7
|
require('../chunk-5BLDMQED.cjs');
|
|
8
8
|
|
|
9
9
|
// src/storage/indexedDB.ts
|
|
@@ -11,7 +11,7 @@ var IndexedDBStorageAdapter = class {
|
|
|
11
11
|
dbName;
|
|
12
12
|
version;
|
|
13
13
|
db = null;
|
|
14
|
-
constructor(dbName, version =
|
|
14
|
+
constructor(dbName, version = chunk3MPXMLP4_cjs.DB_VERSION) {
|
|
15
15
|
this.dbName = dbName;
|
|
16
16
|
this.version = version;
|
|
17
17
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DB_VERSION } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
import { DB_VERSION } from '../chunk-D5MQYYYF.js';
|
|
2
|
+
import '../chunk-5XAYUPK4.js';
|
|
3
|
+
import '../chunk-YNEDJTX2.js';
|
|
4
|
+
import '../chunk-BE5MUB7T.js';
|
|
5
5
|
import '../chunk-NSBPE2FW.js';
|
|
6
6
|
|
|
7
7
|
// src/storage/indexedDB.ts
|
|
@@ -1384,6 +1384,7 @@ interface Network {
|
|
|
1384
1384
|
scriptHash: number;
|
|
1385
1385
|
wif: number;
|
|
1386
1386
|
}
|
|
1387
|
+
declare const getNetwork: (network: NetworkName) => Network;
|
|
1387
1388
|
declare const networks: {
|
|
1388
1389
|
bitcoin: Network;
|
|
1389
1390
|
testnet: Network;
|
|
@@ -1404,6 +1405,17 @@ declare const networks: {
|
|
|
1404
1405
|
declare const ESPLORA_URL: Record<NetworkName, string>;
|
|
1405
1406
|
type ExplorerTransaction = {
|
|
1406
1407
|
txid: string;
|
|
1408
|
+
/**
|
|
1409
|
+
* Inputs as returned by Esplora's `/address/:addr/txs`, each carrying the
|
|
1410
|
+
* outpoint it spends (`txid:vout`). Optional: not every provider populates
|
|
1411
|
+
* it (the electrum provider omits inputs), so consumers that correlate
|
|
1412
|
+
* spenders must tolerate its absence. Used to recover a boarding output's
|
|
1413
|
+
* spending (commitment) tx when `/outspends` omits the spender txid.
|
|
1414
|
+
*/
|
|
1415
|
+
vin?: {
|
|
1416
|
+
txid: string;
|
|
1417
|
+
vout: number;
|
|
1418
|
+
}[];
|
|
1407
1419
|
vout: {
|
|
1408
1420
|
scriptpubkey_address: string;
|
|
1409
1421
|
value: string;
|
|
@@ -1443,12 +1455,14 @@ interface OnchainProvider {
|
|
|
1443
1455
|
* Fetch outspend information for every output in a transaction.
|
|
1444
1456
|
*
|
|
1445
1457
|
* @param txid - Transaction id to inspect
|
|
1446
|
-
* @returns Per-output spend status information
|
|
1458
|
+
* @returns Per-output spend status information. `txid` (the spender) may be
|
|
1459
|
+
* absent even when `spent` is true: some Esplora deployments
|
|
1460
|
+
* (e.g. mempool.arkade.sh) omit it from `/outspends`.
|
|
1447
1461
|
* @see getTxStatus
|
|
1448
1462
|
*/
|
|
1449
1463
|
getTxOutspends(txid: string): Promise<{
|
|
1450
1464
|
spent: boolean;
|
|
1451
|
-
txid
|
|
1465
|
+
txid?: string;
|
|
1452
1466
|
}[]>;
|
|
1453
1467
|
/**
|
|
1454
1468
|
* Fetch transactions associated with an address.
|
|
@@ -1519,7 +1533,7 @@ declare class EsploraProvider implements OnchainProvider {
|
|
|
1519
1533
|
broadcastTransaction(...txs: string[]): Promise<string>;
|
|
1520
1534
|
getTxOutspends(txid: string): Promise<{
|
|
1521
1535
|
spent: boolean;
|
|
1522
|
-
txid
|
|
1536
|
+
txid?: string;
|
|
1523
1537
|
}[]>;
|
|
1524
1538
|
getTransactions(address: string): Promise<ExplorerTransaction[]>;
|
|
1525
1539
|
getTxStatus(txid: string): Promise<{
|
|
@@ -2901,6 +2915,90 @@ declare class DelegateManagerImpl implements IDelegateManager {
|
|
|
2901
2915
|
declare const DelegatorManagerImpl: typeof DelegateManagerImpl;
|
|
2902
2916
|
type DelegatorManagerImpl = DelegateManagerImpl;
|
|
2903
2917
|
|
|
2918
|
+
/** One transaction's participation in one logical action. */
|
|
2919
|
+
interface GroupMembership {
|
|
2920
|
+
/**
|
|
2921
|
+
* Stable id of the action; txs sharing it group together. Third-party
|
|
2922
|
+
* resolvers should namespace it (`"vendor:thing"`) to avoid colliding with
|
|
2923
|
+
* other resolvers' groups. SDK built-ins use namespaced ids such as `boarding:`.
|
|
2924
|
+
* A membership with an empty groupId is dropped.
|
|
2925
|
+
*/
|
|
2926
|
+
groupId: string;
|
|
2927
|
+
/** Human label for the action, e.g. "Dice game". */
|
|
2928
|
+
label?: string;
|
|
2929
|
+
/** App category for icon/filtering, e.g. "game". */
|
|
2930
|
+
kind?: string;
|
|
2931
|
+
/**
|
|
2932
|
+
* Free-form row data. Same-group metadata is shallow-merged with
|
|
2933
|
+
* earlier-resolver keys winning.
|
|
2934
|
+
*/
|
|
2935
|
+
metadata?: Record<string, unknown>;
|
|
2936
|
+
/**
|
|
2937
|
+
* This tx's unsigned sat contribution to this group. Defaults to the tx's
|
|
2938
|
+
* full amount; the builder applies direction. Use it to split a batched tx
|
|
2939
|
+
* across groups. Same-key receive rows paired with a sent row are treated
|
|
2940
|
+
* as change and excluded from `Activity.amount`. A membership with a
|
|
2941
|
+
* non-finite amount (NaN/Infinity) is dropped.
|
|
2942
|
+
*/
|
|
2943
|
+
amount?: number;
|
|
2944
|
+
}
|
|
2945
|
+
/** A pluggable resolver keyed by `id`. */
|
|
2946
|
+
interface ActivityResolver {
|
|
2947
|
+
/**
|
|
2948
|
+
* Registry key — override or remove by it. Namespace it (`"vendor:games"`)
|
|
2949
|
+
* so independent libraries don't clobber each other; `use()` overwrites
|
|
2950
|
+
* silently on a duplicate id.
|
|
2951
|
+
*/
|
|
2952
|
+
id: string;
|
|
2953
|
+
/**
|
|
2954
|
+
* Load correlation data before `resolve` runs. If it rejects, this resolver
|
|
2955
|
+
* contributes no memberships.
|
|
2956
|
+
*/
|
|
2957
|
+
prepare?(): Promise<void>;
|
|
2958
|
+
/** Pure and synchronous. The groups this tx belongs to, or undefined to leave it plain. */
|
|
2959
|
+
resolve(tx: ArkTransaction): GroupMembership[] | undefined;
|
|
2960
|
+
}
|
|
2961
|
+
/** The non-id, non-amount part of a {@link GroupMembership}. */
|
|
2962
|
+
interface ActivityIntent {
|
|
2963
|
+
/** Human label for the action, e.g. "Dice game". */
|
|
2964
|
+
label?: string;
|
|
2965
|
+
/** App category for icon/filtering, e.g. "game". */
|
|
2966
|
+
kind?: string;
|
|
2967
|
+
/** Free-form row data, shallow-merged across the group's resolvers (first-writer-wins). */
|
|
2968
|
+
metadata?: Record<string, unknown>;
|
|
2969
|
+
}
|
|
2970
|
+
/** One logical activity. */
|
|
2971
|
+
interface Activity {
|
|
2972
|
+
/** The groupId, or the natural tx key for untagged rows. */
|
|
2973
|
+
id: string;
|
|
2974
|
+
/** Merged intent for the group, if any resolver tagged it. */
|
|
2975
|
+
intent?: ActivityIntent;
|
|
2976
|
+
/** Member txs, oldest-first. */
|
|
2977
|
+
txs: ArkTransaction[];
|
|
2978
|
+
/** Signed net sats: positive received, negative sent; same-key change rows are excluded. */
|
|
2979
|
+
amount: number;
|
|
2980
|
+
/** Earliest member createdAt (ms since epoch). */
|
|
2981
|
+
createdAt: number;
|
|
2982
|
+
/** True once every member tx is settled. */
|
|
2983
|
+
settled: boolean;
|
|
2984
|
+
}
|
|
2985
|
+
/** Resolver registry keyed by id. */
|
|
2986
|
+
declare class ActivityRegistry {
|
|
2987
|
+
private readonly resolvers;
|
|
2988
|
+
/** Add a resolver, or override an existing one with the same id (kept in place). */
|
|
2989
|
+
use(resolver: ActivityResolver): void;
|
|
2990
|
+
/** Remove a resolver (built-in or custom) by id. */
|
|
2991
|
+
remove(id: string): void;
|
|
2992
|
+
/** The registered resolver ids, in registration order. */
|
|
2993
|
+
list(): string[];
|
|
2994
|
+
/** All registered resolvers, in registration (priority) order. */
|
|
2995
|
+
all(): ActivityResolver[];
|
|
2996
|
+
}
|
|
2997
|
+
/** Built-in resolver: labels on-chain boarding (deposit) transactions. */
|
|
2998
|
+
declare function boardingResolver(): ActivityResolver;
|
|
2999
|
+
/** Default registry with SDK built-ins. */
|
|
3000
|
+
declare function createDefaultActivityRegistry(): ActivityRegistry;
|
|
3001
|
+
|
|
2904
3002
|
/**
|
|
2905
3003
|
* Wallet receive-address strategy.
|
|
2906
3004
|
*
|
|
@@ -3672,6 +3770,10 @@ interface IReadonlyWallet {
|
|
|
3672
3770
|
getBoardingUtxos(): Promise<ExtendedCoin[]>;
|
|
3673
3771
|
/** @returns Wallet transaction history derived from boarding and Arkade activity. */
|
|
3674
3772
|
getTransactionHistory(): Promise<ArkTransaction[]>;
|
|
3773
|
+
/** Resolvers that group/label {@link getActivityHistory} rows. */
|
|
3774
|
+
readonly activity: ActivityRegistry;
|
|
3775
|
+
/** @returns Wallet history grouped into logical activities with signed net amounts. */
|
|
3776
|
+
getActivityHistory(): Promise<Activity[]>;
|
|
3675
3777
|
/**
|
|
3676
3778
|
* Get the contract manager associated with this wallet.
|
|
3677
3779
|
* This is useful for querying contract state and watching for contract events.
|
|
@@ -3681,6 +3783,11 @@ interface IReadonlyWallet {
|
|
|
3681
3783
|
getContractManager(): Promise<IContractManager>;
|
|
3682
3784
|
/** Readonly asset manager bound to this wallet instance. */
|
|
3683
3785
|
assetManager: IReadonlyAssetManager;
|
|
3786
|
+
/**
|
|
3787
|
+
* Wipe all locally persisted wallet data (VTXOs, UTXOs, history, sync
|
|
3788
|
+
* cursor, contracts).
|
|
3789
|
+
*/
|
|
3790
|
+
clear(): Promise<void>;
|
|
3684
3791
|
}
|
|
3685
3792
|
|
|
3686
3793
|
type PaginationOptions = {
|
|
@@ -4432,4 +4539,4 @@ declare namespace ProtoTypes {
|
|
|
4432
4539
|
export { };
|
|
4433
4540
|
}
|
|
4434
4541
|
|
|
4435
|
-
export { type
|
|
4542
|
+
export { type Coin as $, type ArkTransaction as A, type BatchStartedEvent as B, type ContractRepository as C, type BatchFinalizationEvent as D, type ExtendedVirtualCoin as E, type BatchFinalizedEvent as F, type GetVtxosFilter as G, type BatchFailedEvent as H, type IWallet as I, type TreeTxEvent as J, type TreeSignatureEvent as K, type DescriptorProvider as L, type IReadonlyWallet as M, type ReadonlyIdentity as N, type Network as O, type OnchainProvider as P, type DelegateProvider as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type ReadonlyWalletConfig as U, VtxoScript as V, type WalletRepository as W, type IReadonlyAssetManager as X, type NetworkName as Y, type ArkInfo as Z, ArkAddress as _, type Identity as a, DelegatorManagerImpl as a$, ContractManager as a0, CSVMultisigTapscript as a1, type SettlementConfig as a2, VtxoManager as a3, type SignerSession as a4, type SignedIntent as a5, Intent as a6, type DescriptorSigningRequest as a7, Transaction as a8, type IntentFeeConfig as a9, type EncodedVtxoScript as aA, type Status as aB, type Outpoint as aC, type ChainTx as aD, type PathContext as aE, type ActivityIntent as aF, type ActivityResolver as aG, type ArkTapscript as aH, type Asset as aI, type AssetMetadata as aJ, type BaseWalletConfig as aK, type BatchInfo as aL, type BatchSignableIdentity as aM, CLTVMultisigTapscript as aN, ChainTxType as aO, type CommitmentTx as aP, ConditionCSVMultisigTapscript as aQ, ConditionMultisigTapscript as aR, type ContractBalance as aS, type ContractEventCallback as aT, type ContractHandler as aU, type ContractManagerConfig as aV, type ContractState as aW, type ContractVtxo as aX, ContractWatcher as aY, DelegateManagerImpl as aZ, type DelegateOptions as a_, type OffchainInput as aa, FeeAmount as ab, type OnchainInput as ac, type FeeOutput as ad, type ContractWatcherConfig as ae, type FeeInfo as af, type CreateContractParams as ag, type GetContractsFilter as ah, type GetSpendablePathsOptions as ai, type GetAllSpendingPathsOptions as aj, type IssuanceParams as ak, type ReissuanceParams as al, type BurnParams as am, type RenewVtxosOptions as an, type ContractWithVtxos as ao, type PathSelection as ap, type ContractEvent as aq, type AssetDetails as ar, type IssuanceResult as as, type DelegateInfo as at, type MigrationGlobalSkipReason as au, type MigrationLegSkipReason as av, type SignerStatus as aw, type StorageConfig as ax, type IVtxoManager as ay, type ExplorerTransaction as az, type WalletConfig as b, isSpendable as b$, type DelegatorProvider as b0, type DeprecatedSignerMigrationReport as b1, type DeprecatedSignerReport as b2, DigestMismatchError as b3, type Discoverable as b4, type DiscoveredContract as b5, type DiscoveryDeps as b6, ESPLORA_URL as b7, EsploraProvider as b8, type ExtendedContractVtxo as b9, type TapLeaves as bA, TapTreeCoder as bB, TapscriptType as bC, type TreeNonces as bD, type TreePartialSigs as bE, type Tx as bF, type TxHistoryRecord as bG, type TxKey as bH, type TxTreeNode as bI, TxType as bJ, type VirtualStatus as bK, type Vtxo as bL, type VtxoChain as bM, type VtxoType as bN, type WalletMode as bO, boardingResolver as bP, classifyAgainstSignerSet as bQ, classifyContractSigner as bR, createDefaultActivityRegistry as bS, decodeTapscript as bT, getNetwork as bU, getSequence as bV, isBatchSignable as bW, isCooperativelyMigratable as bX, isDiscoverable as bY, isExpired as bZ, isRecoverable as b_, type GroupMembership as ba, type HandlerError as bb, type IDelegatorManager as bc, IndexerTxType as bd, type KnownMetadata as be, type MigrateDeprecatedSignerOptions as bf, type MigrationLegReport as bg, type MigrationVtxoRef as bh, MultisigTapscript as bi, type Nonces as bj, type Output as bk, type PageResponse as bl, type PaginationOptions as bm, PartialSig as bn, type ProviderClass as bo, RestDelegateProvider as bp, RestDelegatorProvider as bq, type ScanContractsOptions as br, type ScanResult as bs, type ScheduledSession as bt, SettlementEventType as bu, type SignRequest as bv, type SignerClassification as bw, type SignerSet as bx, type SubscriptionEvent as by, type SubscriptionHeartbeat as bz, type WalletBalance as c, isSubdust as c0, isVtxoExpiringSoon as c1, networks as c2, signerSetFromInfo as c3, toXOnlySignerHex as c4, type ExtendedCoin as d, ActivityRegistry as e, type Activity as f, type IContractManager as g, type IDelegateManager as h, type SettleParams as i, type SettlementEvent as j, type IAssetManager as k, RestArkProvider as l, RestIndexerProvider as m, type SubscriptionResponse as n, type ArkProvider as o, type IndexerProvider as p, type RelativeTimelock as q, type TapLeafScript as r, type VirtualCoin as s, type Contract as t, type VtxoRepositoryKey as u, type WalletState as v, type ContractFilter as w, type TreeSigningStartedEvent as x, TxTree as y, type TreeNoncesEvent as z };
|
|
@@ -1384,6 +1384,7 @@ interface Network {
|
|
|
1384
1384
|
scriptHash: number;
|
|
1385
1385
|
wif: number;
|
|
1386
1386
|
}
|
|
1387
|
+
declare const getNetwork: (network: NetworkName) => Network;
|
|
1387
1388
|
declare const networks: {
|
|
1388
1389
|
bitcoin: Network;
|
|
1389
1390
|
testnet: Network;
|
|
@@ -1404,6 +1405,17 @@ declare const networks: {
|
|
|
1404
1405
|
declare const ESPLORA_URL: Record<NetworkName, string>;
|
|
1405
1406
|
type ExplorerTransaction = {
|
|
1406
1407
|
txid: string;
|
|
1408
|
+
/**
|
|
1409
|
+
* Inputs as returned by Esplora's `/address/:addr/txs`, each carrying the
|
|
1410
|
+
* outpoint it spends (`txid:vout`). Optional: not every provider populates
|
|
1411
|
+
* it (the electrum provider omits inputs), so consumers that correlate
|
|
1412
|
+
* spenders must tolerate its absence. Used to recover a boarding output's
|
|
1413
|
+
* spending (commitment) tx when `/outspends` omits the spender txid.
|
|
1414
|
+
*/
|
|
1415
|
+
vin?: {
|
|
1416
|
+
txid: string;
|
|
1417
|
+
vout: number;
|
|
1418
|
+
}[];
|
|
1407
1419
|
vout: {
|
|
1408
1420
|
scriptpubkey_address: string;
|
|
1409
1421
|
value: string;
|
|
@@ -1443,12 +1455,14 @@ interface OnchainProvider {
|
|
|
1443
1455
|
* Fetch outspend information for every output in a transaction.
|
|
1444
1456
|
*
|
|
1445
1457
|
* @param txid - Transaction id to inspect
|
|
1446
|
-
* @returns Per-output spend status information
|
|
1458
|
+
* @returns Per-output spend status information. `txid` (the spender) may be
|
|
1459
|
+
* absent even when `spent` is true: some Esplora deployments
|
|
1460
|
+
* (e.g. mempool.arkade.sh) omit it from `/outspends`.
|
|
1447
1461
|
* @see getTxStatus
|
|
1448
1462
|
*/
|
|
1449
1463
|
getTxOutspends(txid: string): Promise<{
|
|
1450
1464
|
spent: boolean;
|
|
1451
|
-
txid
|
|
1465
|
+
txid?: string;
|
|
1452
1466
|
}[]>;
|
|
1453
1467
|
/**
|
|
1454
1468
|
* Fetch transactions associated with an address.
|
|
@@ -1519,7 +1533,7 @@ declare class EsploraProvider implements OnchainProvider {
|
|
|
1519
1533
|
broadcastTransaction(...txs: string[]): Promise<string>;
|
|
1520
1534
|
getTxOutspends(txid: string): Promise<{
|
|
1521
1535
|
spent: boolean;
|
|
1522
|
-
txid
|
|
1536
|
+
txid?: string;
|
|
1523
1537
|
}[]>;
|
|
1524
1538
|
getTransactions(address: string): Promise<ExplorerTransaction[]>;
|
|
1525
1539
|
getTxStatus(txid: string): Promise<{
|
|
@@ -2901,6 +2915,90 @@ declare class DelegateManagerImpl implements IDelegateManager {
|
|
|
2901
2915
|
declare const DelegatorManagerImpl: typeof DelegateManagerImpl;
|
|
2902
2916
|
type DelegatorManagerImpl = DelegateManagerImpl;
|
|
2903
2917
|
|
|
2918
|
+
/** One transaction's participation in one logical action. */
|
|
2919
|
+
interface GroupMembership {
|
|
2920
|
+
/**
|
|
2921
|
+
* Stable id of the action; txs sharing it group together. Third-party
|
|
2922
|
+
* resolvers should namespace it (`"vendor:thing"`) to avoid colliding with
|
|
2923
|
+
* other resolvers' groups. SDK built-ins use namespaced ids such as `boarding:`.
|
|
2924
|
+
* A membership with an empty groupId is dropped.
|
|
2925
|
+
*/
|
|
2926
|
+
groupId: string;
|
|
2927
|
+
/** Human label for the action, e.g. "Dice game". */
|
|
2928
|
+
label?: string;
|
|
2929
|
+
/** App category for icon/filtering, e.g. "game". */
|
|
2930
|
+
kind?: string;
|
|
2931
|
+
/**
|
|
2932
|
+
* Free-form row data. Same-group metadata is shallow-merged with
|
|
2933
|
+
* earlier-resolver keys winning.
|
|
2934
|
+
*/
|
|
2935
|
+
metadata?: Record<string, unknown>;
|
|
2936
|
+
/**
|
|
2937
|
+
* This tx's unsigned sat contribution to this group. Defaults to the tx's
|
|
2938
|
+
* full amount; the builder applies direction. Use it to split a batched tx
|
|
2939
|
+
* across groups. Same-key receive rows paired with a sent row are treated
|
|
2940
|
+
* as change and excluded from `Activity.amount`. A membership with a
|
|
2941
|
+
* non-finite amount (NaN/Infinity) is dropped.
|
|
2942
|
+
*/
|
|
2943
|
+
amount?: number;
|
|
2944
|
+
}
|
|
2945
|
+
/** A pluggable resolver keyed by `id`. */
|
|
2946
|
+
interface ActivityResolver {
|
|
2947
|
+
/**
|
|
2948
|
+
* Registry key — override or remove by it. Namespace it (`"vendor:games"`)
|
|
2949
|
+
* so independent libraries don't clobber each other; `use()` overwrites
|
|
2950
|
+
* silently on a duplicate id.
|
|
2951
|
+
*/
|
|
2952
|
+
id: string;
|
|
2953
|
+
/**
|
|
2954
|
+
* Load correlation data before `resolve` runs. If it rejects, this resolver
|
|
2955
|
+
* contributes no memberships.
|
|
2956
|
+
*/
|
|
2957
|
+
prepare?(): Promise<void>;
|
|
2958
|
+
/** Pure and synchronous. The groups this tx belongs to, or undefined to leave it plain. */
|
|
2959
|
+
resolve(tx: ArkTransaction): GroupMembership[] | undefined;
|
|
2960
|
+
}
|
|
2961
|
+
/** The non-id, non-amount part of a {@link GroupMembership}. */
|
|
2962
|
+
interface ActivityIntent {
|
|
2963
|
+
/** Human label for the action, e.g. "Dice game". */
|
|
2964
|
+
label?: string;
|
|
2965
|
+
/** App category for icon/filtering, e.g. "game". */
|
|
2966
|
+
kind?: string;
|
|
2967
|
+
/** Free-form row data, shallow-merged across the group's resolvers (first-writer-wins). */
|
|
2968
|
+
metadata?: Record<string, unknown>;
|
|
2969
|
+
}
|
|
2970
|
+
/** One logical activity. */
|
|
2971
|
+
interface Activity {
|
|
2972
|
+
/** The groupId, or the natural tx key for untagged rows. */
|
|
2973
|
+
id: string;
|
|
2974
|
+
/** Merged intent for the group, if any resolver tagged it. */
|
|
2975
|
+
intent?: ActivityIntent;
|
|
2976
|
+
/** Member txs, oldest-first. */
|
|
2977
|
+
txs: ArkTransaction[];
|
|
2978
|
+
/** Signed net sats: positive received, negative sent; same-key change rows are excluded. */
|
|
2979
|
+
amount: number;
|
|
2980
|
+
/** Earliest member createdAt (ms since epoch). */
|
|
2981
|
+
createdAt: number;
|
|
2982
|
+
/** True once every member tx is settled. */
|
|
2983
|
+
settled: boolean;
|
|
2984
|
+
}
|
|
2985
|
+
/** Resolver registry keyed by id. */
|
|
2986
|
+
declare class ActivityRegistry {
|
|
2987
|
+
private readonly resolvers;
|
|
2988
|
+
/** Add a resolver, or override an existing one with the same id (kept in place). */
|
|
2989
|
+
use(resolver: ActivityResolver): void;
|
|
2990
|
+
/** Remove a resolver (built-in or custom) by id. */
|
|
2991
|
+
remove(id: string): void;
|
|
2992
|
+
/** The registered resolver ids, in registration order. */
|
|
2993
|
+
list(): string[];
|
|
2994
|
+
/** All registered resolvers, in registration (priority) order. */
|
|
2995
|
+
all(): ActivityResolver[];
|
|
2996
|
+
}
|
|
2997
|
+
/** Built-in resolver: labels on-chain boarding (deposit) transactions. */
|
|
2998
|
+
declare function boardingResolver(): ActivityResolver;
|
|
2999
|
+
/** Default registry with SDK built-ins. */
|
|
3000
|
+
declare function createDefaultActivityRegistry(): ActivityRegistry;
|
|
3001
|
+
|
|
2904
3002
|
/**
|
|
2905
3003
|
* Wallet receive-address strategy.
|
|
2906
3004
|
*
|
|
@@ -3672,6 +3770,10 @@ interface IReadonlyWallet {
|
|
|
3672
3770
|
getBoardingUtxos(): Promise<ExtendedCoin[]>;
|
|
3673
3771
|
/** @returns Wallet transaction history derived from boarding and Arkade activity. */
|
|
3674
3772
|
getTransactionHistory(): Promise<ArkTransaction[]>;
|
|
3773
|
+
/** Resolvers that group/label {@link getActivityHistory} rows. */
|
|
3774
|
+
readonly activity: ActivityRegistry;
|
|
3775
|
+
/** @returns Wallet history grouped into logical activities with signed net amounts. */
|
|
3776
|
+
getActivityHistory(): Promise<Activity[]>;
|
|
3675
3777
|
/**
|
|
3676
3778
|
* Get the contract manager associated with this wallet.
|
|
3677
3779
|
* This is useful for querying contract state and watching for contract events.
|
|
@@ -3681,6 +3783,11 @@ interface IReadonlyWallet {
|
|
|
3681
3783
|
getContractManager(): Promise<IContractManager>;
|
|
3682
3784
|
/** Readonly asset manager bound to this wallet instance. */
|
|
3683
3785
|
assetManager: IReadonlyAssetManager;
|
|
3786
|
+
/**
|
|
3787
|
+
* Wipe all locally persisted wallet data (VTXOs, UTXOs, history, sync
|
|
3788
|
+
* cursor, contracts).
|
|
3789
|
+
*/
|
|
3790
|
+
clear(): Promise<void>;
|
|
3684
3791
|
}
|
|
3685
3792
|
|
|
3686
3793
|
type PaginationOptions = {
|
|
@@ -4432,4 +4539,4 @@ declare namespace ProtoTypes {
|
|
|
4432
4539
|
export { };
|
|
4433
4540
|
}
|
|
4434
4541
|
|
|
4435
|
-
export { type
|
|
4542
|
+
export { type Coin as $, type ArkTransaction as A, type BatchStartedEvent as B, type ContractRepository as C, type BatchFinalizationEvent as D, type ExtendedVirtualCoin as E, type BatchFinalizedEvent as F, type GetVtxosFilter as G, type BatchFailedEvent as H, type IWallet as I, type TreeTxEvent as J, type TreeSignatureEvent as K, type DescriptorProvider as L, type IReadonlyWallet as M, type ReadonlyIdentity as N, type Network as O, type OnchainProvider as P, type DelegateProvider as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type ReadonlyWalletConfig as U, VtxoScript as V, type WalletRepository as W, type IReadonlyAssetManager as X, type NetworkName as Y, type ArkInfo as Z, ArkAddress as _, type Identity as a, DelegatorManagerImpl as a$, ContractManager as a0, CSVMultisigTapscript as a1, type SettlementConfig as a2, VtxoManager as a3, type SignerSession as a4, type SignedIntent as a5, Intent as a6, type DescriptorSigningRequest as a7, Transaction as a8, type IntentFeeConfig as a9, type EncodedVtxoScript as aA, type Status as aB, type Outpoint as aC, type ChainTx as aD, type PathContext as aE, type ActivityIntent as aF, type ActivityResolver as aG, type ArkTapscript as aH, type Asset as aI, type AssetMetadata as aJ, type BaseWalletConfig as aK, type BatchInfo as aL, type BatchSignableIdentity as aM, CLTVMultisigTapscript as aN, ChainTxType as aO, type CommitmentTx as aP, ConditionCSVMultisigTapscript as aQ, ConditionMultisigTapscript as aR, type ContractBalance as aS, type ContractEventCallback as aT, type ContractHandler as aU, type ContractManagerConfig as aV, type ContractState as aW, type ContractVtxo as aX, ContractWatcher as aY, DelegateManagerImpl as aZ, type DelegateOptions as a_, type OffchainInput as aa, FeeAmount as ab, type OnchainInput as ac, type FeeOutput as ad, type ContractWatcherConfig as ae, type FeeInfo as af, type CreateContractParams as ag, type GetContractsFilter as ah, type GetSpendablePathsOptions as ai, type GetAllSpendingPathsOptions as aj, type IssuanceParams as ak, type ReissuanceParams as al, type BurnParams as am, type RenewVtxosOptions as an, type ContractWithVtxos as ao, type PathSelection as ap, type ContractEvent as aq, type AssetDetails as ar, type IssuanceResult as as, type DelegateInfo as at, type MigrationGlobalSkipReason as au, type MigrationLegSkipReason as av, type SignerStatus as aw, type StorageConfig as ax, type IVtxoManager as ay, type ExplorerTransaction as az, type WalletConfig as b, isSpendable as b$, type DelegatorProvider as b0, type DeprecatedSignerMigrationReport as b1, type DeprecatedSignerReport as b2, DigestMismatchError as b3, type Discoverable as b4, type DiscoveredContract as b5, type DiscoveryDeps as b6, ESPLORA_URL as b7, EsploraProvider as b8, type ExtendedContractVtxo as b9, type TapLeaves as bA, TapTreeCoder as bB, TapscriptType as bC, type TreeNonces as bD, type TreePartialSigs as bE, type Tx as bF, type TxHistoryRecord as bG, type TxKey as bH, type TxTreeNode as bI, TxType as bJ, type VirtualStatus as bK, type Vtxo as bL, type VtxoChain as bM, type VtxoType as bN, type WalletMode as bO, boardingResolver as bP, classifyAgainstSignerSet as bQ, classifyContractSigner as bR, createDefaultActivityRegistry as bS, decodeTapscript as bT, getNetwork as bU, getSequence as bV, isBatchSignable as bW, isCooperativelyMigratable as bX, isDiscoverable as bY, isExpired as bZ, isRecoverable as b_, type GroupMembership as ba, type HandlerError as bb, type IDelegatorManager as bc, IndexerTxType as bd, type KnownMetadata as be, type MigrateDeprecatedSignerOptions as bf, type MigrationLegReport as bg, type MigrationVtxoRef as bh, MultisigTapscript as bi, type Nonces as bj, type Output as bk, type PageResponse as bl, type PaginationOptions as bm, PartialSig as bn, type ProviderClass as bo, RestDelegateProvider as bp, RestDelegatorProvider as bq, type ScanContractsOptions as br, type ScanResult as bs, type ScheduledSession as bt, SettlementEventType as bu, type SignRequest as bv, type SignerClassification as bw, type SignerSet as bx, type SubscriptionEvent as by, type SubscriptionHeartbeat as bz, type WalletBalance as c, isSubdust as c0, isVtxoExpiringSoon as c1, networks as c2, signerSetFromInfo as c3, toXOnlySignerHex as c4, type ExtendedCoin as d, ActivityRegistry as e, type Activity as f, type IContractManager as g, type IDelegateManager as h, type SettleParams as i, type SettlementEvent as j, type IAssetManager as k, RestArkProvider as l, RestIndexerProvider as m, type SubscriptionResponse as n, type ArkProvider as o, type IndexerProvider as p, type RelativeTimelock as q, type TapLeafScript as r, type VirtualCoin as s, type Contract as t, type VtxoRepositoryKey as u, type WalletState as v, type ContractFilter as w, type TreeSigningStartedEvent as x, TxTree as y, type TreeNoncesEvent as z };
|