@arkade-os/sdk 0.4.28 → 0.4.29
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-ChhTwpLf.d.cts} +73 -61
- package/dist/{ark-TZ1gXAXU.d.ts → ark-ChhTwpLf.d.ts} +73 -61
- package/dist/{asyncStorageTaskQueue-EFqSmYTg.d.cts → asyncStorageTaskQueue-DW1-BpI7.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-Cb1F_Z9s.d.ts → asyncStorageTaskQueue-DZ0nUuEJ.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-CFZMTDWI.js → chunk-ABWRLTX5.js} +6 -5
- package/dist/chunk-ABWRLTX5.js.map +1 -0
- package/dist/{chunk-BQLHADL7.js → chunk-BVP2U66Q.js} +316 -178
- package/dist/chunk-BVP2U66Q.js.map +1 -0
- package/dist/{chunk-ZLO6NETT.cjs → chunk-GDCTOSMV.cjs} +480 -332
- package/dist/chunk-GDCTOSMV.cjs.map +1 -0
- package/dist/{chunk-FG5ACJJW.cjs → chunk-GIGILVVP.cjs} +11 -10
- package/dist/chunk-GIGILVVP.cjs.map +1 -0
- 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-PJUFOJ2L.cjs} +7 -7
- package/dist/{chunk-IPX2R7FR.cjs.map → chunk-PJUFOJ2L.cjs.map} +1 -1
- package/dist/{chunk-A3EMF7RN.js → chunk-TH6T23XG.js} +3 -3
- package/dist/{chunk-A3EMF7RN.js.map → chunk-TH6T23XG.js.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-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-4JBUkUhR.d.cts} +2 -2
- package/dist/{delegate-BFZs69hp.d.cts → delegate-DN7RELL1.d.ts} +2 -2
- package/dist/{index-NDla_UoJ.d.ts → index-Cn82bBUu.d.ts} +2 -2
- package/dist/{index-B22cA64m.d.cts → index-DfT5xzgY.d.cts} +2 -2
- package/dist/index.cjs +161 -137
- package/dist/index.d.cts +143 -17
- package/dist/index.d.ts +143 -17
- 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-C6Ff4OaU.d.cts → taskRunner-B-aPfHhK.d.cts} +2 -2
- package/dist/{taskRunner-yvPN8Z0K.d.ts → taskRunner-B-vG08pX.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-CCtqT2Wb.d.ts} +19 -15
- package/dist/{wallet-AF-p-OWj.d.cts → wallet-DjgFb_4T.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 { L as ReadonlyIdentity, a as Identity, a5 as DescriptorSigningRequest, a6 as Transaction, a2 as SignerSession, W as WalletRepository, E as ExtendedVirtualCoin, s as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, t as WalletState, r as Contract, C as ContractRepository, u as ContractFilter, a7 as IntentFeeConfig, a8 as OffchainInput, a9 as FeeAmount, aa as OnchainInput, ab as FeeOutput, m as ArkProvider, a0 as SettlementConfig, ac as ContractWatcherConfig, I as IWallet, ad as FeeInfo, h as SettlementEvent, J 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, c as WalletBalance, al as ContractWithVtxos, am as PathSelection, an as ContractEvent, ao as AssetDetails, ap as IssuanceResult, aq as DelegateInfo, K as IReadonlyWallet, Q as IReadonlyAssetManager, ar as StorageConfig, e as IContractManager, i as IAssetManager, f as IDelegateManager, as as IVtxoManager, O as OnchainProvider, N as Network, U as NetworkName, Z as Coin, at as ExplorerTransaction, p as TapLeafScript, au as EncodedVtxoScript, $ as CSVMultisigTapscript, o as RelativeTimelock, V as VtxoScript, av as Status, aw as Outpoint, ax as ChainTx, n as IndexerProvider, w as TxTree } from './ark-ChhTwpLf.cjs';
|
|
2
|
+
export { Y as ArkAddress, X as ArkInfo, ay as ArkTapscript, az as Asset, aA as AssetMetadata, aB as BaseWalletConfig, D as BatchFailedEvent, y as BatchFinalizationEvent, z as BatchFinalizedEvent, aC as BatchInfo, aD as BatchSignableIdentity, B as BatchStartedEvent, aE as CLTVMultisigTapscript, aF as ChainTxType, aG as CommitmentTx, aH as ConditionCSVMultisigTapscript, aI as ConditionMultisigTapscript, aJ as ContractBalance, aK as ContractEventCallback, aL as ContractHandler, _ as ContractManager, aM as ContractManagerConfig, aN as ContractState, aO as ContractVtxo, aP as ContractWatcher, aQ as DelegateManagerImpl, aR as DelegateOptions, M as DelegateProvider, aS as DelegatorManagerImpl, aT as DelegatorProvider, aU as Discoverable, aV as DiscoveredContract, aW as DiscoveryDeps, aX as ESPLORA_URL, aY as EsploraProvider, aZ as ExtendedContractVtxo, a_ as HandlerError, a$ as IDelegatorManager, b0 as IndexerTxType, a4 as Intent, b1 as KnownMetadata, b2 as MultisigTapscript, b3 as Nonces, b4 as Output, b5 as PageResponse, b6 as PaginationOptions, b7 as PartialSig, b8 as PathContext, b9 as ProviderClass, P as ReadonlyWalletConfig, j as RestArkProvider, ba as RestDelegateProvider, bb as RestDelegatorProvider, k as RestIndexerProvider, bc as ScanContractsOptions, bd as ScanResult, be as ScheduledSession, bf as SettlementEventType, bg as SignRequest, a3 as SignedIntent, bh as SubscriptionEvent, bi as SubscriptionHeartbeat, l as SubscriptionResponse, bj as TapLeaves, bk as TapTreeCoder, bl as TapscriptType, bm as TreeNonces, x as TreeNoncesEvent, bn as TreePartialSigs, H as TreeSignatureEvent, v as TreeSigningStartedEvent, F as TreeTxEvent, bo as Tx, bp as TxHistoryRecord, bq as TxKey, T as TxNotification, br as TxTreeNode, bs as TxType, bt as VirtualStatus, bu as Vtxo, bv as VtxoChain, a1 as VtxoManager, bw as VtxoType, b as WalletConfig, bx as WalletMode, by as decodeTapscript, bz as getSequence, bA as isBatchSignable, bB as isDiscoverable, bC as isExpired, bD as isRecoverable, bE as isSpendable, bF as isSubdust, bG as isVtxoExpiringSoon, bH as networks } from './ark-ChhTwpLf.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-DfT5xzgY.cjs';
|
|
4
|
+
export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-4JBUkUhR.cjs';
|
|
5
|
+
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-DjgFb_4T.cjs';
|
|
6
|
+
export { B as Batch, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-DjgFb_4T.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: {
|
|
@@ -1576,8 +1592,17 @@ type ResponseSweepExpiredBoardingUtxos = ResponseEnvelope & {
|
|
|
1576
1592
|
txid: string;
|
|
1577
1593
|
};
|
|
1578
1594
|
};
|
|
1579
|
-
type
|
|
1580
|
-
type
|
|
1595
|
+
type RequestRestoreWallet = RequestEnvelope & {
|
|
1596
|
+
type: "RESTORE_WALLET";
|
|
1597
|
+
payload: {
|
|
1598
|
+
gapLimit?: number;
|
|
1599
|
+
};
|
|
1600
|
+
};
|
|
1601
|
+
type ResponseRestoreWallet = ResponseEnvelope & {
|
|
1602
|
+
type: "RESTORE_WALLET_SUCCESS";
|
|
1603
|
+
};
|
|
1604
|
+
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;
|
|
1605
|
+
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
1606
|
declare class WalletMessageHandler implements MessageHandler<WalletUpdaterRequest, WalletUpdaterResponse> {
|
|
1582
1607
|
readonly messageTag: string;
|
|
1583
1608
|
private wallet;
|
|
@@ -1680,11 +1705,24 @@ declare const DEFAULT_MESSAGE_TIMEOUTS: Readonly<Record<RequestType, number>>;
|
|
|
1680
1705
|
interface ServiceWorkerWalletOptions {
|
|
1681
1706
|
/** Optional Arkade server public key used to construct and validate Arkade addresses. */
|
|
1682
1707
|
arkServerPublicKey?: string;
|
|
1683
|
-
/**
|
|
1708
|
+
/**
|
|
1709
|
+
* Base URL of the Arkade server.
|
|
1710
|
+
*
|
|
1711
|
+
* @deprecated Provide an explicit provider via the worker config instead.
|
|
1712
|
+
* URL-based configuration will be removed in a future major version.
|
|
1713
|
+
*/
|
|
1684
1714
|
arkServerUrl?: string;
|
|
1685
|
-
/**
|
|
1715
|
+
/**
|
|
1716
|
+
* Optional override for the indexer URL.
|
|
1717
|
+
*
|
|
1718
|
+
* @deprecated Provide an explicit provider via the worker config instead.
|
|
1719
|
+
*/
|
|
1686
1720
|
indexerUrl?: string;
|
|
1687
|
-
/**
|
|
1721
|
+
/**
|
|
1722
|
+
* Optional override for the Esplora API URL.
|
|
1723
|
+
*
|
|
1724
|
+
* @deprecated Provide an explicit provider via the worker config instead.
|
|
1725
|
+
*/
|
|
1688
1726
|
esploraUrl?: string;
|
|
1689
1727
|
/**
|
|
1690
1728
|
* Repository-backed storage configuration overrides.
|
|
@@ -1694,6 +1732,8 @@ interface ServiceWorkerWalletOptions {
|
|
|
1694
1732
|
/** Identity used to derive addresses and optionally sign operations. */
|
|
1695
1733
|
identity: ReadonlyIdentity | Identity;
|
|
1696
1734
|
/** Optional delegation service URL. */
|
|
1735
|
+
delegateUrl?: string;
|
|
1736
|
+
/** @deprecated alias for @see ServiceWorkerWalletOptions.delegateUrl */
|
|
1697
1737
|
delegatorUrl?: string;
|
|
1698
1738
|
/**
|
|
1699
1739
|
* Override the default tag used for messages sent to and received from the service worker.
|
|
@@ -1748,6 +1788,8 @@ type MessageBusInitConfig = {
|
|
|
1748
1788
|
url: string;
|
|
1749
1789
|
publicKey?: string;
|
|
1750
1790
|
};
|
|
1791
|
+
delegateUrl?: string;
|
|
1792
|
+
/** @deprecated alias for @see MessageBusInitConfig.delegateUrl */
|
|
1751
1793
|
delegatorUrl?: string;
|
|
1752
1794
|
indexerUrl?: string;
|
|
1753
1795
|
esploraUrl?: string;
|
|
@@ -1770,6 +1812,8 @@ declare class ServiceWorkerReadonlyWallet implements IReadonlyWallet {
|
|
|
1770
1812
|
protected messageTimeouts: Record<RequestType, number>;
|
|
1771
1813
|
protected arkServerUrl?: string;
|
|
1772
1814
|
protected arkServerPublicKey?: string;
|
|
1815
|
+
protected delegateUrl?: string;
|
|
1816
|
+
/** @deprecated alias for @see ServiceWorkerReadonlyWallet.delegateUrl */
|
|
1773
1817
|
protected delegatorUrl?: string;
|
|
1774
1818
|
protected indexerUrl?: string;
|
|
1775
1819
|
protected esploraUrl?: string;
|
|
@@ -1855,8 +1899,8 @@ declare class ServiceWorkerWallet extends ServiceWorkerReadonlyWallet implements
|
|
|
1855
1899
|
readonly contractRepository: ContractRepository;
|
|
1856
1900
|
readonly identity: Identity;
|
|
1857
1901
|
private readonly _assetManager;
|
|
1858
|
-
private readonly
|
|
1859
|
-
protected constructor(serviceWorker: ServiceWorker, identity: Identity, walletRepository: WalletRepository, contractRepository: ContractRepository, messageTag: string,
|
|
1902
|
+
private readonly hasDelegate;
|
|
1903
|
+
protected constructor(serviceWorker: ServiceWorker, identity: Identity, walletRepository: WalletRepository, contractRepository: ContractRepository, messageTag: string, hasDelegate: boolean);
|
|
1860
1904
|
get assetManager(): IAssetManager;
|
|
1861
1905
|
protected serializeIdentity(): Promise<SerializedIdentity>;
|
|
1862
1906
|
static create(options: ServiceWorkerWalletCreateOptions): Promise<ServiceWorkerWallet>;
|
|
@@ -1876,8 +1920,24 @@ declare class ServiceWorkerWallet extends ServiceWorkerReadonlyWallet implements
|
|
|
1876
1920
|
static setup(options: ServiceWorkerWalletSetupOptions): Promise<ServiceWorkerWallet>;
|
|
1877
1921
|
sendBitcoin(params: SendBitcoinParams): Promise<string>;
|
|
1878
1922
|
settle(params?: SettleParams, callback?: (event: SettlementEvent) => void): Promise<string>;
|
|
1923
|
+
/**
|
|
1924
|
+
* Explicitly recover this wallet's contracts and balance on a fresh repo.
|
|
1925
|
+
* Mirrors {@link Wallet.restore} but drives the scan inside the service
|
|
1926
|
+
* worker — the materialize() callback used by `scanContracts` cannot
|
|
1927
|
+
* cross the postMessage boundary, so the entire flow runs worker-side
|
|
1928
|
+
* and only the gapLimit / outcome cross the wire.
|
|
1929
|
+
*
|
|
1930
|
+
* Uses the streaming send path so the bus deadline does not race a
|
|
1931
|
+
* long indexer-bound scan. AggregateError thrown by the worker is
|
|
1932
|
+
* reconstructed here so callers can inspect `.errors`.
|
|
1933
|
+
*/
|
|
1934
|
+
restore(opts?: {
|
|
1935
|
+
gapLimit?: number;
|
|
1936
|
+
}): Promise<void>;
|
|
1879
1937
|
send(...recipients: [Recipient, ...Recipient[]]): Promise<string>;
|
|
1880
|
-
|
|
1938
|
+
getDelegateManager(): Promise<IDelegateManager | undefined>;
|
|
1939
|
+
/** @deprecated alias for @see ServiceWorkerWallet.getDelegateManager */
|
|
1940
|
+
getDelegatorManager(): Promise<IDelegateManager | undefined>;
|
|
1881
1941
|
getVtxoManager(): Promise<IVtxoManager>;
|
|
1882
1942
|
}
|
|
1883
1943
|
|
|
@@ -1923,7 +1983,6 @@ declare class OnchainWallet implements AnchorBumper {
|
|
|
1923
1983
|
* @param networkName - Bitcoin network name, @see NetworkName
|
|
1924
1984
|
* @param provider - Optional onchain provider override, @see OnchainProvider
|
|
1925
1985
|
* @returns Configured onchain wallet
|
|
1926
|
-
* @defaultValue `provider = new EsploraProvider('https://mempool.space/api')`
|
|
1927
1986
|
* @throws Error if the configured identity cannot produce a valid x-only public key
|
|
1928
1987
|
*/
|
|
1929
1988
|
static create(identity: Identity, networkName?: NetworkName, provider?: OnchainProvider): Promise<OnchainWallet>;
|
|
@@ -3340,4 +3399,71 @@ declare class ServiceWorkerTimeoutError extends Error {
|
|
|
3340
3399
|
constructor(detail: string);
|
|
3341
3400
|
}
|
|
3342
3401
|
|
|
3343
|
-
|
|
3402
|
+
declare class ReadonlyAssetManager implements IReadonlyAssetManager {
|
|
3403
|
+
readonly indexer: IndexerProvider;
|
|
3404
|
+
constructor(indexer: IndexerProvider);
|
|
3405
|
+
getAssetDetails(assetId: string): Promise<AssetDetails>;
|
|
3406
|
+
}
|
|
3407
|
+
declare class AssetManager extends ReadonlyAssetManager implements IAssetManager {
|
|
3408
|
+
readonly wallet: Wallet;
|
|
3409
|
+
constructor(wallet: Wallet);
|
|
3410
|
+
/**
|
|
3411
|
+
* Issue a new asset.
|
|
3412
|
+
* @param params - Parameters for asset issuance
|
|
3413
|
+
* @param params.amount - Amount of asset units to issue
|
|
3414
|
+
* @param params.controlAssetId - Optional control asset ID (for reissuable assets)
|
|
3415
|
+
* @param params.metadata - Optional metadata to attach to the asset
|
|
3416
|
+
* @returns Promise resolving to the Arkade transaction ID and asset ID
|
|
3417
|
+
*
|
|
3418
|
+
* @example
|
|
3419
|
+
* ```typescript
|
|
3420
|
+
* // Issue a simple non-reissuable asset
|
|
3421
|
+
* const result = await wallet.assetManager.issue({ amount: 1000 });
|
|
3422
|
+
* console.log('Asset ID:', result.assetId);
|
|
3423
|
+
*
|
|
3424
|
+
* // Issue a reissuable asset with an existing control asset
|
|
3425
|
+
* const result = await wallet.assetManager.issue({
|
|
3426
|
+
* amount: 1000,
|
|
3427
|
+
* controlAssetId: 'existingControlAssetId'
|
|
3428
|
+
* });
|
|
3429
|
+
* console.log('Asset ID:', result.assetId);
|
|
3430
|
+
* ```
|
|
3431
|
+
*/
|
|
3432
|
+
issue(params: IssuanceParams): Promise<IssuanceResult>;
|
|
3433
|
+
/**
|
|
3434
|
+
* Reissue more units of an existing asset.
|
|
3435
|
+
* Requires ownership of the control asset.
|
|
3436
|
+
*
|
|
3437
|
+
* @param params - Parameters for asset reissuance
|
|
3438
|
+
* @param params.assetId - The asset ID to reissue (control asset ID is resolved via getAssetDetails)
|
|
3439
|
+
* @param params.amount - Amount of additional units to issue
|
|
3440
|
+
* @returns Promise resolving to the Arkade transaction ID
|
|
3441
|
+
*
|
|
3442
|
+
* @example
|
|
3443
|
+
* ```typescript
|
|
3444
|
+
* const txid = await wallet.assetManager.reissue({
|
|
3445
|
+
* assetId: 'def456...',
|
|
3446
|
+
* amount: 500
|
|
3447
|
+
* });
|
|
3448
|
+
* ```
|
|
3449
|
+
*/
|
|
3450
|
+
reissue(params: ReissuanceParams): Promise<string>;
|
|
3451
|
+
/**
|
|
3452
|
+
* Burn assets.
|
|
3453
|
+
* @param params - Parameters for burning
|
|
3454
|
+
* @param params.assetId - The asset ID to burn
|
|
3455
|
+
* @param params.amount - Amount of units to burn
|
|
3456
|
+
* @returns Promise resolving to the Arkade transaction ID
|
|
3457
|
+
*
|
|
3458
|
+
* @example
|
|
3459
|
+
* ```typescript
|
|
3460
|
+
* const txid = await wallet.assetManager.burn({
|
|
3461
|
+
* assetId: 'abc123...',
|
|
3462
|
+
* amount: 100
|
|
3463
|
+
* });
|
|
3464
|
+
* ```
|
|
3465
|
+
*/
|
|
3466
|
+
burn(params: BurnParams): Promise<string>;
|
|
3467
|
+
}
|
|
3468
|
+
|
|
3469
|
+
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, 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 { L as ReadonlyIdentity, a as Identity, a5 as DescriptorSigningRequest, a6 as Transaction, a2 as SignerSession, W as WalletRepository, E as ExtendedVirtualCoin, s as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, t as WalletState, r as Contract, C as ContractRepository, u as ContractFilter, a7 as IntentFeeConfig, a8 as OffchainInput, a9 as FeeAmount, aa as OnchainInput, ab as FeeOutput, m as ArkProvider, a0 as SettlementConfig, ac as ContractWatcherConfig, I as IWallet, ad as FeeInfo, h as SettlementEvent, J 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, c as WalletBalance, al as ContractWithVtxos, am as PathSelection, an as ContractEvent, ao as AssetDetails, ap as IssuanceResult, aq as DelegateInfo, K as IReadonlyWallet, Q as IReadonlyAssetManager, ar as StorageConfig, e as IContractManager, i as IAssetManager, f as IDelegateManager, as as IVtxoManager, O as OnchainProvider, N as Network, U as NetworkName, Z as Coin, at as ExplorerTransaction, p as TapLeafScript, au as EncodedVtxoScript, $ as CSVMultisigTapscript, o as RelativeTimelock, V as VtxoScript, av as Status, aw as Outpoint, ax as ChainTx, n as IndexerProvider, w as TxTree } from './ark-ChhTwpLf.js';
|
|
2
|
+
export { Y as ArkAddress, X as ArkInfo, ay as ArkTapscript, az as Asset, aA as AssetMetadata, aB as BaseWalletConfig, D as BatchFailedEvent, y as BatchFinalizationEvent, z as BatchFinalizedEvent, aC as BatchInfo, aD as BatchSignableIdentity, B as BatchStartedEvent, aE as CLTVMultisigTapscript, aF as ChainTxType, aG as CommitmentTx, aH as ConditionCSVMultisigTapscript, aI as ConditionMultisigTapscript, aJ as ContractBalance, aK as ContractEventCallback, aL as ContractHandler, _ as ContractManager, aM as ContractManagerConfig, aN as ContractState, aO as ContractVtxo, aP as ContractWatcher, aQ as DelegateManagerImpl, aR as DelegateOptions, M as DelegateProvider, aS as DelegatorManagerImpl, aT as DelegatorProvider, aU as Discoverable, aV as DiscoveredContract, aW as DiscoveryDeps, aX as ESPLORA_URL, aY as EsploraProvider, aZ as ExtendedContractVtxo, a_ as HandlerError, a$ as IDelegatorManager, b0 as IndexerTxType, a4 as Intent, b1 as KnownMetadata, b2 as MultisigTapscript, b3 as Nonces, b4 as Output, b5 as PageResponse, b6 as PaginationOptions, b7 as PartialSig, b8 as PathContext, b9 as ProviderClass, P as ReadonlyWalletConfig, j as RestArkProvider, ba as RestDelegateProvider, bb as RestDelegatorProvider, k as RestIndexerProvider, bc as ScanContractsOptions, bd as ScanResult, be as ScheduledSession, bf as SettlementEventType, bg as SignRequest, a3 as SignedIntent, bh as SubscriptionEvent, bi as SubscriptionHeartbeat, l as SubscriptionResponse, bj as TapLeaves, bk as TapTreeCoder, bl as TapscriptType, bm as TreeNonces, x as TreeNoncesEvent, bn as TreePartialSigs, H as TreeSignatureEvent, v as TreeSigningStartedEvent, F as TreeTxEvent, bo as Tx, bp as TxHistoryRecord, bq as TxKey, T as TxNotification, br as TxTreeNode, bs as TxType, bt as VirtualStatus, bu as Vtxo, bv as VtxoChain, a1 as VtxoManager, bw as VtxoType, b as WalletConfig, bx as WalletMode, by as decodeTapscript, bz as getSequence, bA as isBatchSignable, bB as isDiscoverable, bC as isExpired, bD as isRecoverable, bE as isSpendable, bF as isSubdust, bG as isVtxoExpiringSoon, bH as networks } from './ark-ChhTwpLf.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-Cn82bBUu.js';
|
|
4
|
+
export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-DN7RELL1.js';
|
|
5
|
+
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-CCtqT2Wb.js';
|
|
6
|
+
export { B as Batch, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-CCtqT2Wb.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: {
|
|
@@ -1576,8 +1592,17 @@ type ResponseSweepExpiredBoardingUtxos = ResponseEnvelope & {
|
|
|
1576
1592
|
txid: string;
|
|
1577
1593
|
};
|
|
1578
1594
|
};
|
|
1579
|
-
type
|
|
1580
|
-
type
|
|
1595
|
+
type RequestRestoreWallet = RequestEnvelope & {
|
|
1596
|
+
type: "RESTORE_WALLET";
|
|
1597
|
+
payload: {
|
|
1598
|
+
gapLimit?: number;
|
|
1599
|
+
};
|
|
1600
|
+
};
|
|
1601
|
+
type ResponseRestoreWallet = ResponseEnvelope & {
|
|
1602
|
+
type: "RESTORE_WALLET_SUCCESS";
|
|
1603
|
+
};
|
|
1604
|
+
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;
|
|
1605
|
+
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
1606
|
declare class WalletMessageHandler implements MessageHandler<WalletUpdaterRequest, WalletUpdaterResponse> {
|
|
1582
1607
|
readonly messageTag: string;
|
|
1583
1608
|
private wallet;
|
|
@@ -1680,11 +1705,24 @@ declare const DEFAULT_MESSAGE_TIMEOUTS: Readonly<Record<RequestType, number>>;
|
|
|
1680
1705
|
interface ServiceWorkerWalletOptions {
|
|
1681
1706
|
/** Optional Arkade server public key used to construct and validate Arkade addresses. */
|
|
1682
1707
|
arkServerPublicKey?: string;
|
|
1683
|
-
/**
|
|
1708
|
+
/**
|
|
1709
|
+
* Base URL of the Arkade server.
|
|
1710
|
+
*
|
|
1711
|
+
* @deprecated Provide an explicit provider via the worker config instead.
|
|
1712
|
+
* URL-based configuration will be removed in a future major version.
|
|
1713
|
+
*/
|
|
1684
1714
|
arkServerUrl?: string;
|
|
1685
|
-
/**
|
|
1715
|
+
/**
|
|
1716
|
+
* Optional override for the indexer URL.
|
|
1717
|
+
*
|
|
1718
|
+
* @deprecated Provide an explicit provider via the worker config instead.
|
|
1719
|
+
*/
|
|
1686
1720
|
indexerUrl?: string;
|
|
1687
|
-
/**
|
|
1721
|
+
/**
|
|
1722
|
+
* Optional override for the Esplora API URL.
|
|
1723
|
+
*
|
|
1724
|
+
* @deprecated Provide an explicit provider via the worker config instead.
|
|
1725
|
+
*/
|
|
1688
1726
|
esploraUrl?: string;
|
|
1689
1727
|
/**
|
|
1690
1728
|
* Repository-backed storage configuration overrides.
|
|
@@ -1694,6 +1732,8 @@ interface ServiceWorkerWalletOptions {
|
|
|
1694
1732
|
/** Identity used to derive addresses and optionally sign operations. */
|
|
1695
1733
|
identity: ReadonlyIdentity | Identity;
|
|
1696
1734
|
/** Optional delegation service URL. */
|
|
1735
|
+
delegateUrl?: string;
|
|
1736
|
+
/** @deprecated alias for @see ServiceWorkerWalletOptions.delegateUrl */
|
|
1697
1737
|
delegatorUrl?: string;
|
|
1698
1738
|
/**
|
|
1699
1739
|
* Override the default tag used for messages sent to and received from the service worker.
|
|
@@ -1748,6 +1788,8 @@ type MessageBusInitConfig = {
|
|
|
1748
1788
|
url: string;
|
|
1749
1789
|
publicKey?: string;
|
|
1750
1790
|
};
|
|
1791
|
+
delegateUrl?: string;
|
|
1792
|
+
/** @deprecated alias for @see MessageBusInitConfig.delegateUrl */
|
|
1751
1793
|
delegatorUrl?: string;
|
|
1752
1794
|
indexerUrl?: string;
|
|
1753
1795
|
esploraUrl?: string;
|
|
@@ -1770,6 +1812,8 @@ declare class ServiceWorkerReadonlyWallet implements IReadonlyWallet {
|
|
|
1770
1812
|
protected messageTimeouts: Record<RequestType, number>;
|
|
1771
1813
|
protected arkServerUrl?: string;
|
|
1772
1814
|
protected arkServerPublicKey?: string;
|
|
1815
|
+
protected delegateUrl?: string;
|
|
1816
|
+
/** @deprecated alias for @see ServiceWorkerReadonlyWallet.delegateUrl */
|
|
1773
1817
|
protected delegatorUrl?: string;
|
|
1774
1818
|
protected indexerUrl?: string;
|
|
1775
1819
|
protected esploraUrl?: string;
|
|
@@ -1855,8 +1899,8 @@ declare class ServiceWorkerWallet extends ServiceWorkerReadonlyWallet implements
|
|
|
1855
1899
|
readonly contractRepository: ContractRepository;
|
|
1856
1900
|
readonly identity: Identity;
|
|
1857
1901
|
private readonly _assetManager;
|
|
1858
|
-
private readonly
|
|
1859
|
-
protected constructor(serviceWorker: ServiceWorker, identity: Identity, walletRepository: WalletRepository, contractRepository: ContractRepository, messageTag: string,
|
|
1902
|
+
private readonly hasDelegate;
|
|
1903
|
+
protected constructor(serviceWorker: ServiceWorker, identity: Identity, walletRepository: WalletRepository, contractRepository: ContractRepository, messageTag: string, hasDelegate: boolean);
|
|
1860
1904
|
get assetManager(): IAssetManager;
|
|
1861
1905
|
protected serializeIdentity(): Promise<SerializedIdentity>;
|
|
1862
1906
|
static create(options: ServiceWorkerWalletCreateOptions): Promise<ServiceWorkerWallet>;
|
|
@@ -1876,8 +1920,24 @@ declare class ServiceWorkerWallet extends ServiceWorkerReadonlyWallet implements
|
|
|
1876
1920
|
static setup(options: ServiceWorkerWalletSetupOptions): Promise<ServiceWorkerWallet>;
|
|
1877
1921
|
sendBitcoin(params: SendBitcoinParams): Promise<string>;
|
|
1878
1922
|
settle(params?: SettleParams, callback?: (event: SettlementEvent) => void): Promise<string>;
|
|
1923
|
+
/**
|
|
1924
|
+
* Explicitly recover this wallet's contracts and balance on a fresh repo.
|
|
1925
|
+
* Mirrors {@link Wallet.restore} but drives the scan inside the service
|
|
1926
|
+
* worker — the materialize() callback used by `scanContracts` cannot
|
|
1927
|
+
* cross the postMessage boundary, so the entire flow runs worker-side
|
|
1928
|
+
* and only the gapLimit / outcome cross the wire.
|
|
1929
|
+
*
|
|
1930
|
+
* Uses the streaming send path so the bus deadline does not race a
|
|
1931
|
+
* long indexer-bound scan. AggregateError thrown by the worker is
|
|
1932
|
+
* reconstructed here so callers can inspect `.errors`.
|
|
1933
|
+
*/
|
|
1934
|
+
restore(opts?: {
|
|
1935
|
+
gapLimit?: number;
|
|
1936
|
+
}): Promise<void>;
|
|
1879
1937
|
send(...recipients: [Recipient, ...Recipient[]]): Promise<string>;
|
|
1880
|
-
|
|
1938
|
+
getDelegateManager(): Promise<IDelegateManager | undefined>;
|
|
1939
|
+
/** @deprecated alias for @see ServiceWorkerWallet.getDelegateManager */
|
|
1940
|
+
getDelegatorManager(): Promise<IDelegateManager | undefined>;
|
|
1881
1941
|
getVtxoManager(): Promise<IVtxoManager>;
|
|
1882
1942
|
}
|
|
1883
1943
|
|
|
@@ -1923,7 +1983,6 @@ declare class OnchainWallet implements AnchorBumper {
|
|
|
1923
1983
|
* @param networkName - Bitcoin network name, @see NetworkName
|
|
1924
1984
|
* @param provider - Optional onchain provider override, @see OnchainProvider
|
|
1925
1985
|
* @returns Configured onchain wallet
|
|
1926
|
-
* @defaultValue `provider = new EsploraProvider('https://mempool.space/api')`
|
|
1927
1986
|
* @throws Error if the configured identity cannot produce a valid x-only public key
|
|
1928
1987
|
*/
|
|
1929
1988
|
static create(identity: Identity, networkName?: NetworkName, provider?: OnchainProvider): Promise<OnchainWallet>;
|
|
@@ -3340,4 +3399,71 @@ declare class ServiceWorkerTimeoutError extends Error {
|
|
|
3340
3399
|
constructor(detail: string);
|
|
3341
3400
|
}
|
|
3342
3401
|
|
|
3343
|
-
|
|
3402
|
+
declare class ReadonlyAssetManager implements IReadonlyAssetManager {
|
|
3403
|
+
readonly indexer: IndexerProvider;
|
|
3404
|
+
constructor(indexer: IndexerProvider);
|
|
3405
|
+
getAssetDetails(assetId: string): Promise<AssetDetails>;
|
|
3406
|
+
}
|
|
3407
|
+
declare class AssetManager extends ReadonlyAssetManager implements IAssetManager {
|
|
3408
|
+
readonly wallet: Wallet;
|
|
3409
|
+
constructor(wallet: Wallet);
|
|
3410
|
+
/**
|
|
3411
|
+
* Issue a new asset.
|
|
3412
|
+
* @param params - Parameters for asset issuance
|
|
3413
|
+
* @param params.amount - Amount of asset units to issue
|
|
3414
|
+
* @param params.controlAssetId - Optional control asset ID (for reissuable assets)
|
|
3415
|
+
* @param params.metadata - Optional metadata to attach to the asset
|
|
3416
|
+
* @returns Promise resolving to the Arkade transaction ID and asset ID
|
|
3417
|
+
*
|
|
3418
|
+
* @example
|
|
3419
|
+
* ```typescript
|
|
3420
|
+
* // Issue a simple non-reissuable asset
|
|
3421
|
+
* const result = await wallet.assetManager.issue({ amount: 1000 });
|
|
3422
|
+
* console.log('Asset ID:', result.assetId);
|
|
3423
|
+
*
|
|
3424
|
+
* // Issue a reissuable asset with an existing control asset
|
|
3425
|
+
* const result = await wallet.assetManager.issue({
|
|
3426
|
+
* amount: 1000,
|
|
3427
|
+
* controlAssetId: 'existingControlAssetId'
|
|
3428
|
+
* });
|
|
3429
|
+
* console.log('Asset ID:', result.assetId);
|
|
3430
|
+
* ```
|
|
3431
|
+
*/
|
|
3432
|
+
issue(params: IssuanceParams): Promise<IssuanceResult>;
|
|
3433
|
+
/**
|
|
3434
|
+
* Reissue more units of an existing asset.
|
|
3435
|
+
* Requires ownership of the control asset.
|
|
3436
|
+
*
|
|
3437
|
+
* @param params - Parameters for asset reissuance
|
|
3438
|
+
* @param params.assetId - The asset ID to reissue (control asset ID is resolved via getAssetDetails)
|
|
3439
|
+
* @param params.amount - Amount of additional units to issue
|
|
3440
|
+
* @returns Promise resolving to the Arkade transaction ID
|
|
3441
|
+
*
|
|
3442
|
+
* @example
|
|
3443
|
+
* ```typescript
|
|
3444
|
+
* const txid = await wallet.assetManager.reissue({
|
|
3445
|
+
* assetId: 'def456...',
|
|
3446
|
+
* amount: 500
|
|
3447
|
+
* });
|
|
3448
|
+
* ```
|
|
3449
|
+
*/
|
|
3450
|
+
reissue(params: ReissuanceParams): Promise<string>;
|
|
3451
|
+
/**
|
|
3452
|
+
* Burn assets.
|
|
3453
|
+
* @param params - Parameters for burning
|
|
3454
|
+
* @param params.assetId - The asset ID to burn
|
|
3455
|
+
* @param params.amount - Amount of units to burn
|
|
3456
|
+
* @returns Promise resolving to the Arkade transaction ID
|
|
3457
|
+
*
|
|
3458
|
+
* @example
|
|
3459
|
+
* ```typescript
|
|
3460
|
+
* const txid = await wallet.assetManager.burn({
|
|
3461
|
+
* assetId: 'abc123...',
|
|
3462
|
+
* amount: 100
|
|
3463
|
+
* });
|
|
3464
|
+
* ```
|
|
3465
|
+
*/
|
|
3466
|
+
burn(params: BurnParams): Promise<string>;
|
|
3467
|
+
}
|
|
3468
|
+
|
|
3469
|
+
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, 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-BVP2U66Q.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
|