@arkade-os/sdk 0.4.28 → 0.4.30
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 +14 -16
- 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/adapters/indexedDB.cjs +5 -5
- package/dist/adapters/indexedDB.js +4 -4
- package/dist/{ark-TZ1gXAXU.d.cts → ark-C0TMXvwO.d.cts} +92 -63
- package/dist/{ark-TZ1gXAXU.d.ts → ark-C0TMXvwO.d.ts} +92 -63
- package/dist/{asyncStorageTaskQueue-EFqSmYTg.d.cts → asyncStorageTaskQueue-DHOoNvRy.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-Cb1F_Z9s.d.ts → asyncStorageTaskQueue-Iip3xMF_.d.ts} +2 -2
- package/dist/{chunk-ADV27S4N.cjs → chunk-6FLL2Q36.cjs} +8 -8
- package/dist/chunk-6FLL2Q36.cjs.map +1 -0
- package/dist/{chunk-ZBUDLTBO.js → chunk-6NWNOLL3.js} +5 -5
- package/dist/chunk-6NWNOLL3.js.map +1 -0
- package/dist/{chunk-BQLHADL7.js → chunk-6NY27WL6.js} +341 -183
- package/dist/chunk-6NY27WL6.js.map +1 -0
- package/dist/{chunk-CFZMTDWI.js → chunk-ABWRLTX5.js} +6 -5
- package/dist/chunk-ABWRLTX5.js.map +1 -0
- package/dist/{chunk-FG5ACJJW.cjs → chunk-GIGILVVP.cjs} +11 -10
- package/dist/chunk-GIGILVVP.cjs.map +1 -0
- package/dist/{chunk-A3EMF7RN.js → chunk-GRJKJNBO.js} +3 -3
- package/dist/{chunk-A3EMF7RN.js.map → chunk-GRJKJNBO.js.map} +1 -1
- package/dist/{chunk-I3DGUUCT.cjs → chunk-IEO3XDKI.cjs} +28 -28
- package/dist/{chunk-I3DGUUCT.cjs.map → chunk-IEO3XDKI.cjs.map} +1 -1
- package/dist/{chunk-IPX2R7FR.cjs → chunk-PCEE6DRL.cjs} +7 -7
- package/dist/{chunk-IPX2R7FR.cjs.map → chunk-PCEE6DRL.cjs.map} +1 -1
- package/dist/{chunk-HW3JJ323.js → chunk-TU3LVAPX.js} +32 -31
- package/dist/chunk-TU3LVAPX.js.map +1 -0
- package/dist/{chunk-5PG7DV7A.cjs → chunk-WMIPYZSB.cjs} +34 -36
- package/dist/chunk-WMIPYZSB.cjs.map +1 -0
- package/dist/{chunk-ZLO6NETT.cjs → chunk-XWJFOP5G.cjs} +505 -337
- package/dist/chunk-XWJFOP5G.cjs.map +1 -0
- package/dist/{chunk-T64LAI7L.js → chunk-YA4G7RFB.js} +3 -3
- package/dist/{chunk-T64LAI7L.js.map → chunk-YA4G7RFB.js.map} +1 -1
- package/dist/contracts/handlers/index.cjs +6 -6
- 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-aaVGfWsV.d.ts → delegate-CEk9RHVj.d.cts} +2 -2
- package/dist/{delegate-BFZs69hp.d.cts → delegate-Ds4Hi7Xy.d.ts} +2 -2
- package/dist/{index-NDla_UoJ.d.ts → index-DA9r_7Vg.d.ts} +2 -2
- package/dist/{index-B22cA64m.d.cts → index-WIAY0DDn.d.cts} +2 -2
- package/dist/index.cjs +161 -137
- package/dist/index.d.cts +144 -17
- package/dist/index.d.ts +144 -17
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +13 -13
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- 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-C6Ff4OaU.d.cts → taskRunner-CdEVYgoP.d.cts} +2 -2
- package/dist/{taskRunner-yvPN8Z0K.d.ts → taskRunner-JNjIWWJi.d.ts} +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 +19 -15
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +9 -7
- package/dist/wallet/expo/index.d.ts +9 -7
- package/dist/wallet/expo/index.js +11 -7
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/{wallet-D9NBRqvC.d.ts → wallet-BGL6SzKQ.d.ts} +19 -15
- package/dist/{wallet-AF-p-OWj.d.cts → wallet-CMgzKP0o.d.cts} +19 -15
- 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-5PG7DV7A.cjs.map +0 -1
- package/dist/chunk-ADV27S4N.cjs.map +0 -1
- package/dist/chunk-BQLHADL7.js.map +0 -1
- package/dist/chunk-CFZMTDWI.js.map +0 -1
- package/dist/chunk-FG5ACJJW.cjs.map +0 -1
- package/dist/chunk-HW3JJ323.js.map +0 -1
- package/dist/chunk-ZBUDLTBO.js.map +0 -1
- package/dist/chunk-ZLO6NETT.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { D as DefaultContractHandler, a as DefaultContractParams, b as DelegateContractHandler, c as DelegateContractParams, V as VHTLC, d as VHTLCContractHandler, e as VHTLCContractParams, f as contractHandlers } from './index-
|
|
4
|
-
export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-
|
|
5
|
-
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-
|
|
6
|
-
export { B as Batch, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-
|
|
1
|
+
import { H as ReadonlyIdentity, a as Identity, a5 as DescriptorSigningRequest, a6 as Transaction, $ as SignerSession, W as WalletRepository, E as ExtendedVirtualCoin, a2 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, a3 as WalletState, r as Contract, C as ContractRepository, a4 as ContractFilter, a7 as IntentFeeConfig, a8 as OffchainInput, a9 as FeeAmount, aa as OnchainInput, ab as FeeOutput, m as ArkProvider, Z as SettlementConfig, ac as ContractWatcherConfig, I as IWallet, ad as FeeInfo, h as SettlementEvent, D as DescriptorProvider, g as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, ae as CreateContractParams, af as GetContractsFilter, q as VirtualCoin, ag as GetSpendablePathsOptions, ah as GetAllSpendingPathsOptions, R as Recipient, ai as IssuanceParams, aj as ReissuanceParams, ak as BurnParams, al as RenewVtxosOptions, c as WalletBalance, am as ContractWithVtxos, an as PathSelection, ao as ContractEvent, ap as AssetDetails, aq as IssuanceResult, ar as DelegateInfo, F as IReadonlyWallet, L as IReadonlyAssetManager, as as StorageConfig, e as IContractManager, i as IAssetManager, f as IDelegateManager, at as IVtxoManager, O as OnchainProvider, N as Network, M as NetworkName, U as Coin, au as ExplorerTransaction, p as TapLeafScript, av as EncodedVtxoScript, Y as CSVMultisigTapscript, o as RelativeTimelock, V as VtxoScript, aw as Status, ax as Outpoint, ay as ChainTx, n as IndexerProvider, t as TxTree } from './ark-C0TMXvwO.cjs';
|
|
2
|
+
export { Q as ArkAddress, P as ArkInfo, az as ArkTapscript, aA as Asset, aB as AssetMetadata, aC as BaseWalletConfig, x as BatchFailedEvent, v as BatchFinalizationEvent, w as BatchFinalizedEvent, aD as BatchInfo, aE as BatchSignableIdentity, B as BatchStartedEvent, aF as CLTVMultisigTapscript, aG as ChainTxType, aH as CommitmentTx, aI as ConditionCSVMultisigTapscript, aJ as ConditionMultisigTapscript, aK as ContractBalance, aL as ContractEventCallback, aM as ContractHandler, X as ContractManager, aN as ContractManagerConfig, aO as ContractState, aP as ContractVtxo, aQ as ContractWatcher, aR as DelegateManagerImpl, aS as DelegateOptions, J as DelegateProvider, aT as DelegatorManagerImpl, aU as DelegatorProvider, aV as Discoverable, aW as DiscoveredContract, aX as DiscoveryDeps, aY as ESPLORA_URL, aZ as EsploraProvider, a_ as ExtendedContractVtxo, a$ as HandlerError, b0 as IDelegatorManager, b1 as IndexerTxType, a1 as Intent, b2 as KnownMetadata, b3 as MultisigTapscript, b4 as Nonces, b5 as Output, b6 as PageResponse, b7 as PaginationOptions, b8 as PartialSig, b9 as PathContext, ba as ProviderClass, K as ReadonlyWalletConfig, j as RestArkProvider, bb as RestDelegateProvider, bc as RestDelegatorProvider, k as RestIndexerProvider, bd as ScanContractsOptions, be as ScanResult, bf as ScheduledSession, bg as SettlementEventType, bh as SignRequest, a0 as SignedIntent, bi as SubscriptionEvent, bj as SubscriptionHeartbeat, l as SubscriptionResponse, bk as TapLeaves, bl as TapTreeCoder, bm as TapscriptType, bn as TreeNonces, u as TreeNoncesEvent, bo as TreePartialSigs, z as TreeSignatureEvent, s as TreeSigningStartedEvent, y as TreeTxEvent, bp as Tx, bq as TxHistoryRecord, br as TxKey, T as TxNotification, bs as TxTreeNode, bt as TxType, bu as VirtualStatus, bv as Vtxo, bw as VtxoChain, _ as VtxoManager, bx as VtxoType, b as WalletConfig, by as WalletMode, bz as decodeTapscript, bA as getSequence, bB as isBatchSignable, bC as isDiscoverable, bD as isExpired, bE as isRecoverable, bF as isSpendable, bG as isSubdust, bH as isVtxoExpiringSoon, bI as networks } from './ark-C0TMXvwO.cjs';
|
|
3
|
+
export { D as DefaultContractHandler, a as DefaultContractParams, b as DelegateContractHandler, c as DelegateContractParams, V as VHTLC, d as VHTLCContractHandler, e as VHTLCContractParams, f as contractHandlers } from './index-WIAY0DDn.cjs';
|
|
4
|
+
export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-CEk9RHVj.cjs';
|
|
5
|
+
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-CMgzKP0o.cjs';
|
|
6
|
+
export { B as Batch, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-CMgzKP0o.cjs';
|
|
7
7
|
import { P2TR } from '@scure/btc-signer/payment.js';
|
|
8
8
|
import { Transaction as Transaction$1 } from '@scure/btc-signer';
|
|
9
9
|
import { ElectrumWS } from 'ws-electrumx-client';
|
|
@@ -817,6 +817,8 @@ type Initialize = {
|
|
|
817
817
|
url: string;
|
|
818
818
|
publicKey?: string;
|
|
819
819
|
};
|
|
820
|
+
delegateUrl?: string;
|
|
821
|
+
/** @deprecated alias for @see Initialize.config.delegateUrl */
|
|
820
822
|
delegatorUrl?: string;
|
|
821
823
|
indexerUrl?: string;
|
|
822
824
|
esploraUrl?: string;
|
|
@@ -919,6 +921,17 @@ declare class MessageBus {
|
|
|
919
921
|
static setup(path: string): Promise<ServiceWorker>;
|
|
920
922
|
}
|
|
921
923
|
|
|
924
|
+
/**
|
|
925
|
+
* Thrown when a collaborative-exit / offboard would leave a change VTXO below
|
|
926
|
+
* the dust threshold. Lets callers (e.g. wallet UI) react with appropriate UX
|
|
927
|
+
* — for instance, offering to exit the full balance — instead of forwarding a
|
|
928
|
+
* server-side dust rejection to the user.
|
|
929
|
+
*/
|
|
930
|
+
declare class DustChangeError extends Error {
|
|
931
|
+
readonly change: bigint;
|
|
932
|
+
readonly dustAmount: bigint;
|
|
933
|
+
constructor(change: bigint, dustAmount: bigint);
|
|
934
|
+
}
|
|
922
935
|
/**
|
|
923
936
|
* Ramps is a class wrapping `settle` method to provide a more convenient interface for onboarding and offboarding operations.
|
|
924
937
|
*
|
|
@@ -1113,9 +1126,12 @@ declare class WalletNotInitializedError extends Error {
|
|
|
1113
1126
|
declare class ReadonlyWalletError extends Error {
|
|
1114
1127
|
constructor();
|
|
1115
1128
|
}
|
|
1116
|
-
declare class
|
|
1129
|
+
declare class DelegateNotConfiguredError extends Error {
|
|
1117
1130
|
constructor();
|
|
1118
1131
|
}
|
|
1132
|
+
/** @deprecated alias for DelegateNotConfiguredError */
|
|
1133
|
+
declare const DelegatorNotConfiguredError: typeof DelegateNotConfiguredError;
|
|
1134
|
+
type DelegatorNotConfiguredError = DelegateNotConfiguredError;
|
|
1119
1135
|
type RequestInitWallet = RequestEnvelope & {
|
|
1120
1136
|
type: "INIT_WALLET";
|
|
1121
1137
|
payload: {
|
|
@@ -1551,6 +1567,7 @@ type ResponseGetExpiringVtxos = ResponseEnvelope & {
|
|
|
1551
1567
|
};
|
|
1552
1568
|
type RequestRenewVtxos = RequestEnvelope & {
|
|
1553
1569
|
type: "RENEW_VTXOS";
|
|
1570
|
+
payload?: RenewVtxosOptions;
|
|
1554
1571
|
};
|
|
1555
1572
|
type ResponseRenewVtxos = ResponseEnvelope & {
|
|
1556
1573
|
type: "RENEW_VTXOS_SUCCESS";
|
|
@@ -1576,8 +1593,17 @@ type ResponseSweepExpiredBoardingUtxos = ResponseEnvelope & {
|
|
|
1576
1593
|
txid: string;
|
|
1577
1594
|
};
|
|
1578
1595
|
};
|
|
1579
|
-
type
|
|
1580
|
-
type
|
|
1596
|
+
type RequestRestoreWallet = RequestEnvelope & {
|
|
1597
|
+
type: "RESTORE_WALLET";
|
|
1598
|
+
payload: {
|
|
1599
|
+
gapLimit?: number;
|
|
1600
|
+
};
|
|
1601
|
+
};
|
|
1602
|
+
type ResponseRestoreWallet = ResponseEnvelope & {
|
|
1603
|
+
type: "RESTORE_WALLET_SUCCESS";
|
|
1604
|
+
};
|
|
1605
|
+
type WalletUpdaterRequest = RequestInitWallet | RequestSettle | RequestSendBitcoin | RequestGetAddress | RequestGetBoardingAddress | RequestGetBalance | RequestGetVtxos | RequestGetBoardingUtxos | RequestGetTransactionHistory | RequestGetStatus | RequestClear | RequestReloadWallet | RequestSignTransaction | RequestCreateContract | RequestGetContracts | RequestGetContractsWithVtxos | RequestAnnotateVtxos | RequestUpdateContract | RequestDeleteContract | RequestGetSpendablePaths | RequestGetAllSpendingPaths | RequestIsContractManagerWatching | RequestRefreshVtxos | RequestRefreshOutpoints | RequestSend | RequestGetAssetDetails | RequestIssue | RequestReissue | RequestBurn | RequestDelegate | RequestGetDelegateInfo | RequestRecoverVtxos | RequestGetRecoverableBalance | RequestGetExpiringVtxos | RequestRenewVtxos | RequestGetExpiredBoardingUtxos | RequestSweepExpiredBoardingUtxos | RequestRestoreWallet;
|
|
1606
|
+
type WalletUpdaterResponse = ResponseEnvelope & (ResponseInitWallet | ResponseSettle | ResponseSettleEvent | ResponseSendBitcoin | ResponseGetAddress | ResponseGetBoardingAddress | ResponseGetBalance | ResponseGetVtxos | ResponseGetBoardingUtxos | ResponseGetTransactionHistory | ResponseGetStatus | ResponseClear | ResponseReloadWallet | ResponseUtxoUpdate | ResponseVtxoUpdate | ResponseSignTransaction | ResponseCreateContract | ResponseGetContracts | ResponseGetContractsWithVtxos | ResponseAnnotateVtxos | ResponseUpdateContract | ResponseDeleteContract | ResponseGetSpendablePaths | ResponseGetAllSpendingPaths | ResponseIsContractManagerWatching | ResponseRefreshVtxos | ResponseRefreshOutpoints | ResponseContractEvent | ResponseSend | ResponseGetAssetDetails | ResponseIssue | ResponseReissue | ResponseBurn | ResponseDelegate | ResponseGetDelegateInfo | ResponseRecoverVtxos | ResponseRecoverVtxosEvent | ResponseGetRecoverableBalance | ResponseGetExpiringVtxos | ResponseRenewVtxos | ResponseRenewVtxosEvent | ResponseGetExpiredBoardingUtxos | ResponseSweepExpiredBoardingUtxos | ResponseRestoreWallet);
|
|
1581
1607
|
declare class WalletMessageHandler implements MessageHandler<WalletUpdaterRequest, WalletUpdaterResponse> {
|
|
1582
1608
|
readonly messageTag: string;
|
|
1583
1609
|
private wallet;
|
|
@@ -1680,11 +1706,24 @@ declare const DEFAULT_MESSAGE_TIMEOUTS: Readonly<Record<RequestType, number>>;
|
|
|
1680
1706
|
interface ServiceWorkerWalletOptions {
|
|
1681
1707
|
/** Optional Arkade server public key used to construct and validate Arkade addresses. */
|
|
1682
1708
|
arkServerPublicKey?: string;
|
|
1683
|
-
/**
|
|
1709
|
+
/**
|
|
1710
|
+
* Base URL of the Arkade server.
|
|
1711
|
+
*
|
|
1712
|
+
* @deprecated Provide an explicit provider via the worker config instead.
|
|
1713
|
+
* URL-based configuration will be removed in a future major version.
|
|
1714
|
+
*/
|
|
1684
1715
|
arkServerUrl?: string;
|
|
1685
|
-
/**
|
|
1716
|
+
/**
|
|
1717
|
+
* Optional override for the indexer URL.
|
|
1718
|
+
*
|
|
1719
|
+
* @deprecated Provide an explicit provider via the worker config instead.
|
|
1720
|
+
*/
|
|
1686
1721
|
indexerUrl?: string;
|
|
1687
|
-
/**
|
|
1722
|
+
/**
|
|
1723
|
+
* Optional override for the Esplora API URL.
|
|
1724
|
+
*
|
|
1725
|
+
* @deprecated Provide an explicit provider via the worker config instead.
|
|
1726
|
+
*/
|
|
1688
1727
|
esploraUrl?: string;
|
|
1689
1728
|
/**
|
|
1690
1729
|
* Repository-backed storage configuration overrides.
|
|
@@ -1694,6 +1733,8 @@ interface ServiceWorkerWalletOptions {
|
|
|
1694
1733
|
/** Identity used to derive addresses and optionally sign operations. */
|
|
1695
1734
|
identity: ReadonlyIdentity | Identity;
|
|
1696
1735
|
/** Optional delegation service URL. */
|
|
1736
|
+
delegateUrl?: string;
|
|
1737
|
+
/** @deprecated alias for @see ServiceWorkerWalletOptions.delegateUrl */
|
|
1697
1738
|
delegatorUrl?: string;
|
|
1698
1739
|
/**
|
|
1699
1740
|
* Override the default tag used for messages sent to and received from the service worker.
|
|
@@ -1748,6 +1789,8 @@ type MessageBusInitConfig = {
|
|
|
1748
1789
|
url: string;
|
|
1749
1790
|
publicKey?: string;
|
|
1750
1791
|
};
|
|
1792
|
+
delegateUrl?: string;
|
|
1793
|
+
/** @deprecated alias for @see MessageBusInitConfig.delegateUrl */
|
|
1751
1794
|
delegatorUrl?: string;
|
|
1752
1795
|
indexerUrl?: string;
|
|
1753
1796
|
esploraUrl?: string;
|
|
@@ -1770,6 +1813,8 @@ declare class ServiceWorkerReadonlyWallet implements IReadonlyWallet {
|
|
|
1770
1813
|
protected messageTimeouts: Record<RequestType, number>;
|
|
1771
1814
|
protected arkServerUrl?: string;
|
|
1772
1815
|
protected arkServerPublicKey?: string;
|
|
1816
|
+
protected delegateUrl?: string;
|
|
1817
|
+
/** @deprecated alias for @see ServiceWorkerReadonlyWallet.delegateUrl */
|
|
1773
1818
|
protected delegatorUrl?: string;
|
|
1774
1819
|
protected indexerUrl?: string;
|
|
1775
1820
|
protected esploraUrl?: string;
|
|
@@ -1855,8 +1900,8 @@ declare class ServiceWorkerWallet extends ServiceWorkerReadonlyWallet implements
|
|
|
1855
1900
|
readonly contractRepository: ContractRepository;
|
|
1856
1901
|
readonly identity: Identity;
|
|
1857
1902
|
private readonly _assetManager;
|
|
1858
|
-
private readonly
|
|
1859
|
-
protected constructor(serviceWorker: ServiceWorker, identity: Identity, walletRepository: WalletRepository, contractRepository: ContractRepository, messageTag: string,
|
|
1903
|
+
private readonly hasDelegate;
|
|
1904
|
+
protected constructor(serviceWorker: ServiceWorker, identity: Identity, walletRepository: WalletRepository, contractRepository: ContractRepository, messageTag: string, hasDelegate: boolean);
|
|
1860
1905
|
get assetManager(): IAssetManager;
|
|
1861
1906
|
protected serializeIdentity(): Promise<SerializedIdentity>;
|
|
1862
1907
|
static create(options: ServiceWorkerWalletCreateOptions): Promise<ServiceWorkerWallet>;
|
|
@@ -1876,8 +1921,24 @@ declare class ServiceWorkerWallet extends ServiceWorkerReadonlyWallet implements
|
|
|
1876
1921
|
static setup(options: ServiceWorkerWalletSetupOptions): Promise<ServiceWorkerWallet>;
|
|
1877
1922
|
sendBitcoin(params: SendBitcoinParams): Promise<string>;
|
|
1878
1923
|
settle(params?: SettleParams, callback?: (event: SettlementEvent) => void): Promise<string>;
|
|
1924
|
+
/**
|
|
1925
|
+
* Explicitly recover this wallet's contracts and balance on a fresh repo.
|
|
1926
|
+
* Mirrors {@link Wallet.restore} but drives the scan inside the service
|
|
1927
|
+
* worker — the materialize() callback used by `scanContracts` cannot
|
|
1928
|
+
* cross the postMessage boundary, so the entire flow runs worker-side
|
|
1929
|
+
* and only the gapLimit / outcome cross the wire.
|
|
1930
|
+
*
|
|
1931
|
+
* Uses the streaming send path so the bus deadline does not race a
|
|
1932
|
+
* long indexer-bound scan. AggregateError thrown by the worker is
|
|
1933
|
+
* reconstructed here so callers can inspect `.errors`.
|
|
1934
|
+
*/
|
|
1935
|
+
restore(opts?: {
|
|
1936
|
+
gapLimit?: number;
|
|
1937
|
+
}): Promise<void>;
|
|
1879
1938
|
send(...recipients: [Recipient, ...Recipient[]]): Promise<string>;
|
|
1880
|
-
|
|
1939
|
+
getDelegateManager(): Promise<IDelegateManager | undefined>;
|
|
1940
|
+
/** @deprecated alias for @see ServiceWorkerWallet.getDelegateManager */
|
|
1941
|
+
getDelegatorManager(): Promise<IDelegateManager | undefined>;
|
|
1881
1942
|
getVtxoManager(): Promise<IVtxoManager>;
|
|
1882
1943
|
}
|
|
1883
1944
|
|
|
@@ -1923,7 +1984,6 @@ declare class OnchainWallet implements AnchorBumper {
|
|
|
1923
1984
|
* @param networkName - Bitcoin network name, @see NetworkName
|
|
1924
1985
|
* @param provider - Optional onchain provider override, @see OnchainProvider
|
|
1925
1986
|
* @returns Configured onchain wallet
|
|
1926
|
-
* @defaultValue `provider = new EsploraProvider('https://mempool.space/api')`
|
|
1927
1987
|
* @throws Error if the configured identity cannot produce a valid x-only public key
|
|
1928
1988
|
*/
|
|
1929
1989
|
static create(identity: Identity, networkName?: NetworkName, provider?: OnchainProvider): Promise<OnchainWallet>;
|
|
@@ -3340,4 +3400,71 @@ declare class ServiceWorkerTimeoutError extends Error {
|
|
|
3340
3400
|
constructor(detail: string);
|
|
3341
3401
|
}
|
|
3342
3402
|
|
|
3343
|
-
|
|
3403
|
+
declare class ReadonlyAssetManager implements IReadonlyAssetManager {
|
|
3404
|
+
readonly indexer: IndexerProvider;
|
|
3405
|
+
constructor(indexer: IndexerProvider);
|
|
3406
|
+
getAssetDetails(assetId: string): Promise<AssetDetails>;
|
|
3407
|
+
}
|
|
3408
|
+
declare class AssetManager extends ReadonlyAssetManager implements IAssetManager {
|
|
3409
|
+
readonly wallet: Wallet;
|
|
3410
|
+
constructor(wallet: Wallet);
|
|
3411
|
+
/**
|
|
3412
|
+
* Issue a new asset.
|
|
3413
|
+
* @param params - Parameters for asset issuance
|
|
3414
|
+
* @param params.amount - Amount of asset units to issue
|
|
3415
|
+
* @param params.controlAssetId - Optional control asset ID (for reissuable assets)
|
|
3416
|
+
* @param params.metadata - Optional metadata to attach to the asset
|
|
3417
|
+
* @returns Promise resolving to the Arkade transaction ID and asset ID
|
|
3418
|
+
*
|
|
3419
|
+
* @example
|
|
3420
|
+
* ```typescript
|
|
3421
|
+
* // Issue a simple non-reissuable asset
|
|
3422
|
+
* const result = await wallet.assetManager.issue({ amount: 1000 });
|
|
3423
|
+
* console.log('Asset ID:', result.assetId);
|
|
3424
|
+
*
|
|
3425
|
+
* // Issue a reissuable asset with an existing control asset
|
|
3426
|
+
* const result = await wallet.assetManager.issue({
|
|
3427
|
+
* amount: 1000,
|
|
3428
|
+
* controlAssetId: 'existingControlAssetId'
|
|
3429
|
+
* });
|
|
3430
|
+
* console.log('Asset ID:', result.assetId);
|
|
3431
|
+
* ```
|
|
3432
|
+
*/
|
|
3433
|
+
issue(params: IssuanceParams): Promise<IssuanceResult>;
|
|
3434
|
+
/**
|
|
3435
|
+
* Reissue more units of an existing asset.
|
|
3436
|
+
* Requires ownership of the control asset.
|
|
3437
|
+
*
|
|
3438
|
+
* @param params - Parameters for asset reissuance
|
|
3439
|
+
* @param params.assetId - The asset ID to reissue (control asset ID is resolved via getAssetDetails)
|
|
3440
|
+
* @param params.amount - Amount of additional units to issue
|
|
3441
|
+
* @returns Promise resolving to the Arkade transaction ID
|
|
3442
|
+
*
|
|
3443
|
+
* @example
|
|
3444
|
+
* ```typescript
|
|
3445
|
+
* const txid = await wallet.assetManager.reissue({
|
|
3446
|
+
* assetId: 'def456...',
|
|
3447
|
+
* amount: 500
|
|
3448
|
+
* });
|
|
3449
|
+
* ```
|
|
3450
|
+
*/
|
|
3451
|
+
reissue(params: ReissuanceParams): Promise<string>;
|
|
3452
|
+
/**
|
|
3453
|
+
* Burn assets.
|
|
3454
|
+
* @param params - Parameters for burning
|
|
3455
|
+
* @param params.assetId - The asset ID to burn
|
|
3456
|
+
* @param params.amount - Amount of units to burn
|
|
3457
|
+
* @returns Promise resolving to the Arkade transaction ID
|
|
3458
|
+
*
|
|
3459
|
+
* @example
|
|
3460
|
+
* ```typescript
|
|
3461
|
+
* const txid = await wallet.assetManager.burn({
|
|
3462
|
+
* assetId: 'abc123...',
|
|
3463
|
+
* amount: 100
|
|
3464
|
+
* });
|
|
3465
|
+
* ```
|
|
3466
|
+
*/
|
|
3467
|
+
burn(params: BurnParams): Promise<string>;
|
|
3468
|
+
}
|
|
3469
|
+
|
|
3470
|
+
export { type AnchorBumper, ArkError, ArkNote, ArkProvider, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, AssetDetails, AssetManager, BIP322, BurnParams, CSVMultisigTapscript, ChainTx, Coin, ConditionWitness, Contract, ContractEvent, ContractRepository, ContractRepositoryImpl, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DelegateInfo, DelegateNotConfiguredError, DelegatorNotConfiguredError, type DescriptorOptions, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, EncodedVtxoScript, Estimator, ExplorerTransaction, ExtendedCoin, ExtendedVirtualCoin, FeeAmount, FeeInfo, FeeOutput, GetVtxosFilter, HDDescriptorProvider, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, IndexerProvider, IntentFeeConfig, IssuanceParams, IssuanceResult, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathSelection, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignerSession, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, Unroll, type VSize, VirtualCoin, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, index as asset, buildForfeitTx, buildOffchainTx, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isValidArkAddress, maybeArkError, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sequenceToTimelock, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { D as DefaultContractHandler, a as DefaultContractParams, b as DelegateContractHandler, c as DelegateContractParams, V as VHTLC, d as VHTLCContractHandler, e as VHTLCContractParams, f as contractHandlers } from './index-
|
|
4
|
-
export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-
|
|
5
|
-
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-
|
|
6
|
-
export { B as Batch, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-
|
|
1
|
+
import { H as ReadonlyIdentity, a as Identity, a5 as DescriptorSigningRequest, a6 as Transaction, $ as SignerSession, W as WalletRepository, E as ExtendedVirtualCoin, a2 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, a3 as WalletState, r as Contract, C as ContractRepository, a4 as ContractFilter, a7 as IntentFeeConfig, a8 as OffchainInput, a9 as FeeAmount, aa as OnchainInput, ab as FeeOutput, m as ArkProvider, Z as SettlementConfig, ac as ContractWatcherConfig, I as IWallet, ad as FeeInfo, h as SettlementEvent, D as DescriptorProvider, g as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, ae as CreateContractParams, af as GetContractsFilter, q as VirtualCoin, ag as GetSpendablePathsOptions, ah as GetAllSpendingPathsOptions, R as Recipient, ai as IssuanceParams, aj as ReissuanceParams, ak as BurnParams, al as RenewVtxosOptions, c as WalletBalance, am as ContractWithVtxos, an as PathSelection, ao as ContractEvent, ap as AssetDetails, aq as IssuanceResult, ar as DelegateInfo, F as IReadonlyWallet, L as IReadonlyAssetManager, as as StorageConfig, e as IContractManager, i as IAssetManager, f as IDelegateManager, at as IVtxoManager, O as OnchainProvider, N as Network, M as NetworkName, U as Coin, au as ExplorerTransaction, p as TapLeafScript, av as EncodedVtxoScript, Y as CSVMultisigTapscript, o as RelativeTimelock, V as VtxoScript, aw as Status, ax as Outpoint, ay as ChainTx, n as IndexerProvider, t as TxTree } from './ark-C0TMXvwO.js';
|
|
2
|
+
export { Q as ArkAddress, P as ArkInfo, az as ArkTapscript, aA as Asset, aB as AssetMetadata, aC as BaseWalletConfig, x as BatchFailedEvent, v as BatchFinalizationEvent, w as BatchFinalizedEvent, aD as BatchInfo, aE as BatchSignableIdentity, B as BatchStartedEvent, aF as CLTVMultisigTapscript, aG as ChainTxType, aH as CommitmentTx, aI as ConditionCSVMultisigTapscript, aJ as ConditionMultisigTapscript, aK as ContractBalance, aL as ContractEventCallback, aM as ContractHandler, X as ContractManager, aN as ContractManagerConfig, aO as ContractState, aP as ContractVtxo, aQ as ContractWatcher, aR as DelegateManagerImpl, aS as DelegateOptions, J as DelegateProvider, aT as DelegatorManagerImpl, aU as DelegatorProvider, aV as Discoverable, aW as DiscoveredContract, aX as DiscoveryDeps, aY as ESPLORA_URL, aZ as EsploraProvider, a_ as ExtendedContractVtxo, a$ as HandlerError, b0 as IDelegatorManager, b1 as IndexerTxType, a1 as Intent, b2 as KnownMetadata, b3 as MultisigTapscript, b4 as Nonces, b5 as Output, b6 as PageResponse, b7 as PaginationOptions, b8 as PartialSig, b9 as PathContext, ba as ProviderClass, K as ReadonlyWalletConfig, j as RestArkProvider, bb as RestDelegateProvider, bc as RestDelegatorProvider, k as RestIndexerProvider, bd as ScanContractsOptions, be as ScanResult, bf as ScheduledSession, bg as SettlementEventType, bh as SignRequest, a0 as SignedIntent, bi as SubscriptionEvent, bj as SubscriptionHeartbeat, l as SubscriptionResponse, bk as TapLeaves, bl as TapTreeCoder, bm as TapscriptType, bn as TreeNonces, u as TreeNoncesEvent, bo as TreePartialSigs, z as TreeSignatureEvent, s as TreeSigningStartedEvent, y as TreeTxEvent, bp as Tx, bq as TxHistoryRecord, br as TxKey, T as TxNotification, bs as TxTreeNode, bt as TxType, bu as VirtualStatus, bv as Vtxo, bw as VtxoChain, _ as VtxoManager, bx as VtxoType, b as WalletConfig, by as WalletMode, bz as decodeTapscript, bA as getSequence, bB as isBatchSignable, bC as isDiscoverable, bD as isExpired, bE as isRecoverable, bF as isSpendable, bG as isSubdust, bH as isVtxoExpiringSoon, bI as networks } from './ark-C0TMXvwO.js';
|
|
3
|
+
export { D as DefaultContractHandler, a as DefaultContractParams, b as DelegateContractHandler, c as DelegateContractParams, V as VHTLC, d as VHTLCContractHandler, e as VHTLCContractParams, f as contractHandlers } from './index-DA9r_7Vg.js';
|
|
4
|
+
export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-Ds4Hi7Xy.js';
|
|
5
|
+
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-BGL6SzKQ.js';
|
|
6
|
+
export { B as Batch, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-BGL6SzKQ.js';
|
|
7
7
|
import { P2TR } from '@scure/btc-signer/payment.js';
|
|
8
8
|
import { Transaction as Transaction$1 } from '@scure/btc-signer';
|
|
9
9
|
import { ElectrumWS } from 'ws-electrumx-client';
|
|
@@ -817,6 +817,8 @@ type Initialize = {
|
|
|
817
817
|
url: string;
|
|
818
818
|
publicKey?: string;
|
|
819
819
|
};
|
|
820
|
+
delegateUrl?: string;
|
|
821
|
+
/** @deprecated alias for @see Initialize.config.delegateUrl */
|
|
820
822
|
delegatorUrl?: string;
|
|
821
823
|
indexerUrl?: string;
|
|
822
824
|
esploraUrl?: string;
|
|
@@ -919,6 +921,17 @@ declare class MessageBus {
|
|
|
919
921
|
static setup(path: string): Promise<ServiceWorker>;
|
|
920
922
|
}
|
|
921
923
|
|
|
924
|
+
/**
|
|
925
|
+
* Thrown when a collaborative-exit / offboard would leave a change VTXO below
|
|
926
|
+
* the dust threshold. Lets callers (e.g. wallet UI) react with appropriate UX
|
|
927
|
+
* — for instance, offering to exit the full balance — instead of forwarding a
|
|
928
|
+
* server-side dust rejection to the user.
|
|
929
|
+
*/
|
|
930
|
+
declare class DustChangeError extends Error {
|
|
931
|
+
readonly change: bigint;
|
|
932
|
+
readonly dustAmount: bigint;
|
|
933
|
+
constructor(change: bigint, dustAmount: bigint);
|
|
934
|
+
}
|
|
922
935
|
/**
|
|
923
936
|
* Ramps is a class wrapping `settle` method to provide a more convenient interface for onboarding and offboarding operations.
|
|
924
937
|
*
|
|
@@ -1113,9 +1126,12 @@ declare class WalletNotInitializedError extends Error {
|
|
|
1113
1126
|
declare class ReadonlyWalletError extends Error {
|
|
1114
1127
|
constructor();
|
|
1115
1128
|
}
|
|
1116
|
-
declare class
|
|
1129
|
+
declare class DelegateNotConfiguredError extends Error {
|
|
1117
1130
|
constructor();
|
|
1118
1131
|
}
|
|
1132
|
+
/** @deprecated alias for DelegateNotConfiguredError */
|
|
1133
|
+
declare const DelegatorNotConfiguredError: typeof DelegateNotConfiguredError;
|
|
1134
|
+
type DelegatorNotConfiguredError = DelegateNotConfiguredError;
|
|
1119
1135
|
type RequestInitWallet = RequestEnvelope & {
|
|
1120
1136
|
type: "INIT_WALLET";
|
|
1121
1137
|
payload: {
|
|
@@ -1551,6 +1567,7 @@ type ResponseGetExpiringVtxos = ResponseEnvelope & {
|
|
|
1551
1567
|
};
|
|
1552
1568
|
type RequestRenewVtxos = RequestEnvelope & {
|
|
1553
1569
|
type: "RENEW_VTXOS";
|
|
1570
|
+
payload?: RenewVtxosOptions;
|
|
1554
1571
|
};
|
|
1555
1572
|
type ResponseRenewVtxos = ResponseEnvelope & {
|
|
1556
1573
|
type: "RENEW_VTXOS_SUCCESS";
|
|
@@ -1576,8 +1593,17 @@ type ResponseSweepExpiredBoardingUtxos = ResponseEnvelope & {
|
|
|
1576
1593
|
txid: string;
|
|
1577
1594
|
};
|
|
1578
1595
|
};
|
|
1579
|
-
type
|
|
1580
|
-
type
|
|
1596
|
+
type RequestRestoreWallet = RequestEnvelope & {
|
|
1597
|
+
type: "RESTORE_WALLET";
|
|
1598
|
+
payload: {
|
|
1599
|
+
gapLimit?: number;
|
|
1600
|
+
};
|
|
1601
|
+
};
|
|
1602
|
+
type ResponseRestoreWallet = ResponseEnvelope & {
|
|
1603
|
+
type: "RESTORE_WALLET_SUCCESS";
|
|
1604
|
+
};
|
|
1605
|
+
type WalletUpdaterRequest = RequestInitWallet | RequestSettle | RequestSendBitcoin | RequestGetAddress | RequestGetBoardingAddress | RequestGetBalance | RequestGetVtxos | RequestGetBoardingUtxos | RequestGetTransactionHistory | RequestGetStatus | RequestClear | RequestReloadWallet | RequestSignTransaction | RequestCreateContract | RequestGetContracts | RequestGetContractsWithVtxos | RequestAnnotateVtxos | RequestUpdateContract | RequestDeleteContract | RequestGetSpendablePaths | RequestGetAllSpendingPaths | RequestIsContractManagerWatching | RequestRefreshVtxos | RequestRefreshOutpoints | RequestSend | RequestGetAssetDetails | RequestIssue | RequestReissue | RequestBurn | RequestDelegate | RequestGetDelegateInfo | RequestRecoverVtxos | RequestGetRecoverableBalance | RequestGetExpiringVtxos | RequestRenewVtxos | RequestGetExpiredBoardingUtxos | RequestSweepExpiredBoardingUtxos | RequestRestoreWallet;
|
|
1606
|
+
type WalletUpdaterResponse = ResponseEnvelope & (ResponseInitWallet | ResponseSettle | ResponseSettleEvent | ResponseSendBitcoin | ResponseGetAddress | ResponseGetBoardingAddress | ResponseGetBalance | ResponseGetVtxos | ResponseGetBoardingUtxos | ResponseGetTransactionHistory | ResponseGetStatus | ResponseClear | ResponseReloadWallet | ResponseUtxoUpdate | ResponseVtxoUpdate | ResponseSignTransaction | ResponseCreateContract | ResponseGetContracts | ResponseGetContractsWithVtxos | ResponseAnnotateVtxos | ResponseUpdateContract | ResponseDeleteContract | ResponseGetSpendablePaths | ResponseGetAllSpendingPaths | ResponseIsContractManagerWatching | ResponseRefreshVtxos | ResponseRefreshOutpoints | ResponseContractEvent | ResponseSend | ResponseGetAssetDetails | ResponseIssue | ResponseReissue | ResponseBurn | ResponseDelegate | ResponseGetDelegateInfo | ResponseRecoverVtxos | ResponseRecoverVtxosEvent | ResponseGetRecoverableBalance | ResponseGetExpiringVtxos | ResponseRenewVtxos | ResponseRenewVtxosEvent | ResponseGetExpiredBoardingUtxos | ResponseSweepExpiredBoardingUtxos | ResponseRestoreWallet);
|
|
1581
1607
|
declare class WalletMessageHandler implements MessageHandler<WalletUpdaterRequest, WalletUpdaterResponse> {
|
|
1582
1608
|
readonly messageTag: string;
|
|
1583
1609
|
private wallet;
|
|
@@ -1680,11 +1706,24 @@ declare const DEFAULT_MESSAGE_TIMEOUTS: Readonly<Record<RequestType, number>>;
|
|
|
1680
1706
|
interface ServiceWorkerWalletOptions {
|
|
1681
1707
|
/** Optional Arkade server public key used to construct and validate Arkade addresses. */
|
|
1682
1708
|
arkServerPublicKey?: string;
|
|
1683
|
-
/**
|
|
1709
|
+
/**
|
|
1710
|
+
* Base URL of the Arkade server.
|
|
1711
|
+
*
|
|
1712
|
+
* @deprecated Provide an explicit provider via the worker config instead.
|
|
1713
|
+
* URL-based configuration will be removed in a future major version.
|
|
1714
|
+
*/
|
|
1684
1715
|
arkServerUrl?: string;
|
|
1685
|
-
/**
|
|
1716
|
+
/**
|
|
1717
|
+
* Optional override for the indexer URL.
|
|
1718
|
+
*
|
|
1719
|
+
* @deprecated Provide an explicit provider via the worker config instead.
|
|
1720
|
+
*/
|
|
1686
1721
|
indexerUrl?: string;
|
|
1687
|
-
/**
|
|
1722
|
+
/**
|
|
1723
|
+
* Optional override for the Esplora API URL.
|
|
1724
|
+
*
|
|
1725
|
+
* @deprecated Provide an explicit provider via the worker config instead.
|
|
1726
|
+
*/
|
|
1688
1727
|
esploraUrl?: string;
|
|
1689
1728
|
/**
|
|
1690
1729
|
* Repository-backed storage configuration overrides.
|
|
@@ -1694,6 +1733,8 @@ interface ServiceWorkerWalletOptions {
|
|
|
1694
1733
|
/** Identity used to derive addresses and optionally sign operations. */
|
|
1695
1734
|
identity: ReadonlyIdentity | Identity;
|
|
1696
1735
|
/** Optional delegation service URL. */
|
|
1736
|
+
delegateUrl?: string;
|
|
1737
|
+
/** @deprecated alias for @see ServiceWorkerWalletOptions.delegateUrl */
|
|
1697
1738
|
delegatorUrl?: string;
|
|
1698
1739
|
/**
|
|
1699
1740
|
* Override the default tag used for messages sent to and received from the service worker.
|
|
@@ -1748,6 +1789,8 @@ type MessageBusInitConfig = {
|
|
|
1748
1789
|
url: string;
|
|
1749
1790
|
publicKey?: string;
|
|
1750
1791
|
};
|
|
1792
|
+
delegateUrl?: string;
|
|
1793
|
+
/** @deprecated alias for @see MessageBusInitConfig.delegateUrl */
|
|
1751
1794
|
delegatorUrl?: string;
|
|
1752
1795
|
indexerUrl?: string;
|
|
1753
1796
|
esploraUrl?: string;
|
|
@@ -1770,6 +1813,8 @@ declare class ServiceWorkerReadonlyWallet implements IReadonlyWallet {
|
|
|
1770
1813
|
protected messageTimeouts: Record<RequestType, number>;
|
|
1771
1814
|
protected arkServerUrl?: string;
|
|
1772
1815
|
protected arkServerPublicKey?: string;
|
|
1816
|
+
protected delegateUrl?: string;
|
|
1817
|
+
/** @deprecated alias for @see ServiceWorkerReadonlyWallet.delegateUrl */
|
|
1773
1818
|
protected delegatorUrl?: string;
|
|
1774
1819
|
protected indexerUrl?: string;
|
|
1775
1820
|
protected esploraUrl?: string;
|
|
@@ -1855,8 +1900,8 @@ declare class ServiceWorkerWallet extends ServiceWorkerReadonlyWallet implements
|
|
|
1855
1900
|
readonly contractRepository: ContractRepository;
|
|
1856
1901
|
readonly identity: Identity;
|
|
1857
1902
|
private readonly _assetManager;
|
|
1858
|
-
private readonly
|
|
1859
|
-
protected constructor(serviceWorker: ServiceWorker, identity: Identity, walletRepository: WalletRepository, contractRepository: ContractRepository, messageTag: string,
|
|
1903
|
+
private readonly hasDelegate;
|
|
1904
|
+
protected constructor(serviceWorker: ServiceWorker, identity: Identity, walletRepository: WalletRepository, contractRepository: ContractRepository, messageTag: string, hasDelegate: boolean);
|
|
1860
1905
|
get assetManager(): IAssetManager;
|
|
1861
1906
|
protected serializeIdentity(): Promise<SerializedIdentity>;
|
|
1862
1907
|
static create(options: ServiceWorkerWalletCreateOptions): Promise<ServiceWorkerWallet>;
|
|
@@ -1876,8 +1921,24 @@ declare class ServiceWorkerWallet extends ServiceWorkerReadonlyWallet implements
|
|
|
1876
1921
|
static setup(options: ServiceWorkerWalletSetupOptions): Promise<ServiceWorkerWallet>;
|
|
1877
1922
|
sendBitcoin(params: SendBitcoinParams): Promise<string>;
|
|
1878
1923
|
settle(params?: SettleParams, callback?: (event: SettlementEvent) => void): Promise<string>;
|
|
1924
|
+
/**
|
|
1925
|
+
* Explicitly recover this wallet's contracts and balance on a fresh repo.
|
|
1926
|
+
* Mirrors {@link Wallet.restore} but drives the scan inside the service
|
|
1927
|
+
* worker — the materialize() callback used by `scanContracts` cannot
|
|
1928
|
+
* cross the postMessage boundary, so the entire flow runs worker-side
|
|
1929
|
+
* and only the gapLimit / outcome cross the wire.
|
|
1930
|
+
*
|
|
1931
|
+
* Uses the streaming send path so the bus deadline does not race a
|
|
1932
|
+
* long indexer-bound scan. AggregateError thrown by the worker is
|
|
1933
|
+
* reconstructed here so callers can inspect `.errors`.
|
|
1934
|
+
*/
|
|
1935
|
+
restore(opts?: {
|
|
1936
|
+
gapLimit?: number;
|
|
1937
|
+
}): Promise<void>;
|
|
1879
1938
|
send(...recipients: [Recipient, ...Recipient[]]): Promise<string>;
|
|
1880
|
-
|
|
1939
|
+
getDelegateManager(): Promise<IDelegateManager | undefined>;
|
|
1940
|
+
/** @deprecated alias for @see ServiceWorkerWallet.getDelegateManager */
|
|
1941
|
+
getDelegatorManager(): Promise<IDelegateManager | undefined>;
|
|
1881
1942
|
getVtxoManager(): Promise<IVtxoManager>;
|
|
1882
1943
|
}
|
|
1883
1944
|
|
|
@@ -1923,7 +1984,6 @@ declare class OnchainWallet implements AnchorBumper {
|
|
|
1923
1984
|
* @param networkName - Bitcoin network name, @see NetworkName
|
|
1924
1985
|
* @param provider - Optional onchain provider override, @see OnchainProvider
|
|
1925
1986
|
* @returns Configured onchain wallet
|
|
1926
|
-
* @defaultValue `provider = new EsploraProvider('https://mempool.space/api')`
|
|
1927
1987
|
* @throws Error if the configured identity cannot produce a valid x-only public key
|
|
1928
1988
|
*/
|
|
1929
1989
|
static create(identity: Identity, networkName?: NetworkName, provider?: OnchainProvider): Promise<OnchainWallet>;
|
|
@@ -3340,4 +3400,71 @@ declare class ServiceWorkerTimeoutError extends Error {
|
|
|
3340
3400
|
constructor(detail: string);
|
|
3341
3401
|
}
|
|
3342
3402
|
|
|
3343
|
-
|
|
3403
|
+
declare class ReadonlyAssetManager implements IReadonlyAssetManager {
|
|
3404
|
+
readonly indexer: IndexerProvider;
|
|
3405
|
+
constructor(indexer: IndexerProvider);
|
|
3406
|
+
getAssetDetails(assetId: string): Promise<AssetDetails>;
|
|
3407
|
+
}
|
|
3408
|
+
declare class AssetManager extends ReadonlyAssetManager implements IAssetManager {
|
|
3409
|
+
readonly wallet: Wallet;
|
|
3410
|
+
constructor(wallet: Wallet);
|
|
3411
|
+
/**
|
|
3412
|
+
* Issue a new asset.
|
|
3413
|
+
* @param params - Parameters for asset issuance
|
|
3414
|
+
* @param params.amount - Amount of asset units to issue
|
|
3415
|
+
* @param params.controlAssetId - Optional control asset ID (for reissuable assets)
|
|
3416
|
+
* @param params.metadata - Optional metadata to attach to the asset
|
|
3417
|
+
* @returns Promise resolving to the Arkade transaction ID and asset ID
|
|
3418
|
+
*
|
|
3419
|
+
* @example
|
|
3420
|
+
* ```typescript
|
|
3421
|
+
* // Issue a simple non-reissuable asset
|
|
3422
|
+
* const result = await wallet.assetManager.issue({ amount: 1000 });
|
|
3423
|
+
* console.log('Asset ID:', result.assetId);
|
|
3424
|
+
*
|
|
3425
|
+
* // Issue a reissuable asset with an existing control asset
|
|
3426
|
+
* const result = await wallet.assetManager.issue({
|
|
3427
|
+
* amount: 1000,
|
|
3428
|
+
* controlAssetId: 'existingControlAssetId'
|
|
3429
|
+
* });
|
|
3430
|
+
* console.log('Asset ID:', result.assetId);
|
|
3431
|
+
* ```
|
|
3432
|
+
*/
|
|
3433
|
+
issue(params: IssuanceParams): Promise<IssuanceResult>;
|
|
3434
|
+
/**
|
|
3435
|
+
* Reissue more units of an existing asset.
|
|
3436
|
+
* Requires ownership of the control asset.
|
|
3437
|
+
*
|
|
3438
|
+
* @param params - Parameters for asset reissuance
|
|
3439
|
+
* @param params.assetId - The asset ID to reissue (control asset ID is resolved via getAssetDetails)
|
|
3440
|
+
* @param params.amount - Amount of additional units to issue
|
|
3441
|
+
* @returns Promise resolving to the Arkade transaction ID
|
|
3442
|
+
*
|
|
3443
|
+
* @example
|
|
3444
|
+
* ```typescript
|
|
3445
|
+
* const txid = await wallet.assetManager.reissue({
|
|
3446
|
+
* assetId: 'def456...',
|
|
3447
|
+
* amount: 500
|
|
3448
|
+
* });
|
|
3449
|
+
* ```
|
|
3450
|
+
*/
|
|
3451
|
+
reissue(params: ReissuanceParams): Promise<string>;
|
|
3452
|
+
/**
|
|
3453
|
+
* Burn assets.
|
|
3454
|
+
* @param params - Parameters for burning
|
|
3455
|
+
* @param params.assetId - The asset ID to burn
|
|
3456
|
+
* @param params.amount - Amount of units to burn
|
|
3457
|
+
* @returns Promise resolving to the Arkade transaction ID
|
|
3458
|
+
*
|
|
3459
|
+
* @example
|
|
3460
|
+
* ```typescript
|
|
3461
|
+
* const txid = await wallet.assetManager.burn({
|
|
3462
|
+
* assetId: 'abc123...',
|
|
3463
|
+
* amount: 100
|
|
3464
|
+
* });
|
|
3465
|
+
* ```
|
|
3466
|
+
*/
|
|
3467
|
+
burn(params: BurnParams): Promise<string>;
|
|
3468
|
+
}
|
|
3469
|
+
|
|
3470
|
+
export { type AnchorBumper, ArkError, ArkNote, ArkProvider, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, AssetDetails, AssetManager, BIP322, BurnParams, CSVMultisigTapscript, ChainTx, Coin, ConditionWitness, Contract, ContractEvent, ContractRepository, ContractRepositoryImpl, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DelegateInfo, DelegateNotConfiguredError, DelegatorNotConfiguredError, type DescriptorOptions, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, EncodedVtxoScript, Estimator, ExplorerTransaction, ExtendedCoin, ExtendedVirtualCoin, FeeAmount, FeeInfo, FeeOutput, GetVtxosFilter, HDDescriptorProvider, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, IndexerProvider, IntentFeeConfig, IssuanceParams, IssuanceResult, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathSelection, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignerSession, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, Unroll, type VSize, VirtualCoin, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, index as asset, buildForfeitTx, buildOffchainTx, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isValidArkAddress, maybeArkError, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sequenceToTimelock, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ArkNote, BIP322, Batch, ContractManager, ContractRepositoryImpl, ContractWatcher, DEFAULT_MESSAGE_TIMEOUTS, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorSigningProviderMissingError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EsploraProvider, Estimator, HDDescriptorProvider, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, P2A, Ramps, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegatorProvider, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxWeightEstimator, Unroll, VtxoManager, Wallet, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, buildForfeitTx, buildOffchainTx, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isBatchSignable, isDiscoverable, isValidArkAddress, isVtxoExpiringSoon, migrateWalletRepository,
|
|
2
|
-
export { ArkError, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ChainTxType, ConditionWitness, CosignerPublicKey, IndexerTxType, Intent, RestArkProvider, RestIndexerProvider, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, asset_exports as asset, getArkPsbtFields, maybeArkError, setArkPsbtField } from './chunk-
|
|
3
|
-
export { DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, VHTLC, VHTLCContractHandler, contractHandlers } from './chunk-
|
|
4
|
-
export { ArkAddress, CLTVMultisigTapscript, CSVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, MultisigTapscript, TapTreeCoder,
|
|
1
|
+
export { ArkNote, AssetManager, BIP322, Batch, ContractManager, ContractRepositoryImpl, ContractWatcher, DEFAULT_MESSAGE_TIMEOUTS, DelegateManagerImpl, DelegateNotConfiguredError, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EsploraProvider, Estimator, HDDescriptorProvider, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, P2A, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestDelegatorProvider, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, Unroll, VtxoManager, Wallet, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, buildForfeitTx, buildOffchainTx, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isBatchSignable, isDiscoverable, isExpired, isRecoverable, isSpendable, isSubdust, isValidArkAddress, isVtxoExpiringSoon, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, setupServiceWorker, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds } from './chunk-6NY27WL6.js';
|
|
2
|
+
export { ArkError, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ChainTxType, ConditionWitness, CosignerPublicKey, IndexerTxType, Intent, RestArkProvider, RestIndexerProvider, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, asset_exports as asset, getArkPsbtFields, maybeArkError, setArkPsbtField } from './chunk-6NWNOLL3.js';
|
|
3
|
+
export { DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, VHTLC, VHTLCContractHandler, contractHandlers } from './chunk-YA4G7RFB.js';
|
|
4
|
+
export { ArkAddress, CLTVMultisigTapscript, CSVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, MultisigTapscript, TapTreeCoder, VtxoScript, decodeTapscript, getSequence, networks, sequenceToTimelock, timelockToSequence } from './chunk-TU3LVAPX.js';
|
|
5
5
|
import './chunk-NSBPE2FW.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
7
7
|
//# sourceMappingURL=index.js.map
|