@arkade-os/sdk 0.4.33 → 0.4.35
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 +1 -1
- package/dist/adapters/expo.cjs +5 -5
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +3 -3
- package/dist/adapters/indexedDB.cjs +5 -5
- package/dist/adapters/indexedDB.js +4 -4
- package/dist/{ark-DEsDMYGv.d.cts → ark-D6sau_6-.d.cts} +522 -9
- package/dist/{ark-DEsDMYGv.d.ts → ark-D6sau_6-.d.ts} +522 -9
- package/dist/{asyncStorageTaskQueue-D8T1VXEx.d.cts → asyncStorageTaskQueue-CpC027t_.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-CMrTYlKG.d.ts → asyncStorageTaskQueue-GT8fmPUG.d.ts} +2 -2
- package/dist/{chunk-E22HEKLN.js → chunk-3JR77WQ4.js} +140 -42
- package/dist/chunk-3JR77WQ4.js.map +1 -0
- package/dist/{chunk-WMIPYZSB.cjs → chunk-CMPJR3HS.cjs} +42 -9
- package/dist/chunk-CMPJR3HS.cjs.map +1 -0
- package/dist/{chunk-AOJUURHM.js → chunk-CUSABEUQ.js} +141 -37
- package/dist/chunk-CUSABEUQ.js.map +1 -0
- package/dist/{chunk-HAVA4XB7.cjs → chunk-FM7T7JVL.cjs} +7 -7
- package/dist/{chunk-HAVA4XB7.cjs.map → chunk-FM7T7JVL.cjs.map} +1 -1
- package/dist/{chunk-GYSK5R57.cjs → chunk-GUTKJMSF.cjs} +164 -59
- package/dist/chunk-GUTKJMSF.cjs.map +1 -0
- package/dist/{chunk-7K3ROJF6.cjs → chunk-H2LX2KKY.cjs} +2161 -466
- package/dist/chunk-H2LX2KKY.cjs.map +1 -0
- package/dist/{chunk-DSS2GQUG.js → chunk-NOR7XOKN.js} +2021 -331
- package/dist/chunk-NOR7XOKN.js.map +1 -0
- package/dist/{chunk-BU3BU6XK.js → chunk-OURFR4UR.js} +3 -3
- package/dist/{chunk-BU3BU6XK.js.map → chunk-OURFR4UR.js.map} +1 -1
- package/dist/{chunk-TU3LVAPX.js → chunk-OUVTG72A.js} +43 -11
- package/dist/chunk-OUVTG72A.js.map +1 -0
- package/dist/{chunk-5CCRRL5S.cjs → chunk-VYS3KGRI.cjs} +19 -13
- package/dist/chunk-VYS3KGRI.cjs.map +1 -0
- package/dist/{chunk-SPDNHPM4.cjs → chunk-X2EQLK4O.cjs} +149 -46
- package/dist/chunk-X2EQLK4O.cjs.map +1 -0
- package/dist/{chunk-L6ZETTX3.js → chunk-XQS2HW4Q.js} +11 -5
- package/dist/chunk-XQS2HW4Q.js.map +1 -0
- package/dist/contracts/handlers/index.cjs +7 -7
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/contracts/handlers/index.js +2 -2
- package/dist/{delegate-BJeBNP5a.d.cts → delegate-C-L6gSZx.d.cts} +1 -1
- package/dist/{delegate-EXN2mfkb.d.ts → delegate-De5__fpZ.d.ts} +1 -1
- package/dist/{index-BG2ooYKO.d.ts → index-BETdjE_o.d.ts} +22 -16
- package/dist/{index-DHjEeHEp.d.cts → index-jwQfHP6D.d.cts} +22 -16
- package/dist/index.cjs +158 -130
- package/dist/index.d.cts +125 -16
- package/dist/index.d.ts +125 -16
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +14 -14
- package/dist/repositories/realm/index.cjs.map +1 -1
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/realm/index.js +5 -5
- package/dist/repositories/realm/index.js.map +1 -1
- 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-pIGyarFG.d.cts → taskRunner-DCyp6Gea.d.cts} +2 -2
- package/dist/{taskRunner-B7lBU45X.d.ts → taskRunner-DnxtObeq.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 +13 -13
- package/dist/wallet/expo/index.d.cts +5 -5
- package/dist/wallet/expo/index.d.ts +5 -5
- package/dist/wallet/expo/index.js +5 -5
- package/dist/{wallet-D4Dll5Gu.d.cts → wallet-BWHbd5b1.d.cts} +388 -10
- package/dist/{wallet-C4L_X0i6.d.ts → wallet-Bth5uucA.d.ts} +388 -10
- 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 +5 -5
- package/dist/chunk-5CCRRL5S.cjs.map +0 -1
- package/dist/chunk-7K3ROJF6.cjs.map +0 -1
- package/dist/chunk-AOJUURHM.js.map +0 -1
- package/dist/chunk-DSS2GQUG.js.map +0 -1
- package/dist/chunk-E22HEKLN.js.map +0 -1
- package/dist/chunk-GYSK5R57.cjs.map +0 -1
- package/dist/chunk-L6ZETTX3.js.map +0 -1
- package/dist/chunk-SPDNHPM4.cjs.map +0 -1
- package/dist/chunk-TU3LVAPX.js.map +0 -1
- package/dist/chunk-WMIPYZSB.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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, al as RenewVtxosOptions, c as WalletBalance, am as ContractWithVtxos, an as PathSelection, ao as ContractEvent, ap as AssetDetails, aq as IssuanceResult, ar as DelegateInfo, K as IReadonlyWallet, Q as IReadonlyAssetManager,
|
|
2
|
-
export { Y as ArkAddress, X as ArkInfo,
|
|
3
|
-
export { B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, V as VHTLC, e as VHTLCContractHandler, f as VHTLCContractParams, g 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, al as RenewVtxosOptions, c as WalletBalance, am as ContractWithVtxos, an as PathSelection, ao as ContractEvent, ap as AssetDetails, aq as IssuanceResult, ar as DelegateInfo, as as MigrationGlobalSkipReason, at as MigrationLegSkipReason, au as SignerStatus, K as IReadonlyWallet, Q as IReadonlyAssetManager, av as StorageConfig, e as IContractManager, i as IAssetManager, f as IDelegateManager, aw as IVtxoManager, O as OnchainProvider, N as Network, U as NetworkName, Z as Coin, ax as ExplorerTransaction, p as TapLeafScript, ay as EncodedVtxoScript, $ as CSVMultisigTapscript, o as RelativeTimelock, V as VtxoScript, az as Status, aA as Outpoint, aB as ChainTx, n as IndexerProvider, w as TxTree, aC as PathContext } from './ark-D6sau_6-.cjs';
|
|
2
|
+
export { Y as ArkAddress, X as ArkInfo, aD as ArkTapscript, aE as Asset, aF as AssetMetadata, aG as BaseWalletConfig, D as BatchFailedEvent, y as BatchFinalizationEvent, z as BatchFinalizedEvent, aH as BatchInfo, aI as BatchSignableIdentity, B as BatchStartedEvent, aJ as CLTVMultisigTapscript, aK as ChainTxType, aL as CommitmentTx, aM as ConditionCSVMultisigTapscript, aN as ConditionMultisigTapscript, aO as ContractBalance, aP as ContractEventCallback, aQ as ContractHandler, _ as ContractManager, aR as ContractManagerConfig, aS as ContractState, aT as ContractVtxo, aU as ContractWatcher, aV as DelegateManagerImpl, aW as DelegateOptions, M as DelegateProvider, aX as DelegatorManagerImpl, aY as DelegatorProvider, aZ as DeprecatedSignerMigrationReport, a_ as DeprecatedSignerReport, a$ as DigestMismatchError, b0 as Discoverable, b1 as DiscoveredContract, b2 as DiscoveryDeps, b3 as ESPLORA_URL, b4 as EsploraProvider, b5 as ExtendedContractVtxo, b6 as HandlerError, b7 as IDelegatorManager, b8 as IndexerTxType, a4 as Intent, b9 as KnownMetadata, ba as MigrateDeprecatedSignerOptions, bb as MigrationLegReport, bc as MigrationVtxoRef, bd as MultisigTapscript, be as Nonces, bf as Output, bg as PageResponse, bh as PaginationOptions, bi as PartialSig, bj as ProviderClass, P as ReadonlyWalletConfig, j as RestArkProvider, bk as RestDelegateProvider, bl as RestDelegatorProvider, k as RestIndexerProvider, bm as ScanContractsOptions, bn as ScanResult, bo as ScheduledSession, bp as SettlementEventType, bq as SignRequest, a3 as SignedIntent, br as SignerClassification, bs as SignerSet, bt as SubscriptionEvent, bu as SubscriptionHeartbeat, l as SubscriptionResponse, bv as TapLeaves, bw as TapTreeCoder, bx as TapscriptType, by as TreeNonces, x as TreeNoncesEvent, bz as TreePartialSigs, H as TreeSignatureEvent, v as TreeSigningStartedEvent, F as TreeTxEvent, bA as Tx, bB as TxHistoryRecord, bC as TxKey, T as TxNotification, bD as TxTreeNode, bE as TxType, bF as VirtualStatus, bG as Vtxo, bH as VtxoChain, a1 as VtxoManager, bI as VtxoType, b as WalletConfig, bJ as WalletMode, bK as classifyAgainstSignerSet, bL as classifyContractSigner, bM as decodeTapscript, bN as getSequence, bO as isBatchSignable, bP as isCooperativelyMigratable, bQ as isDiscoverable, bR as isExpired, bS as isRecoverable, bT as isSpendable, bU as isSubdust, bV as isVtxoExpiringSoon, bW as networks, bX as signerSetFromInfo, bY as toXOnlySignerHex } from './ark-D6sau_6-.cjs';
|
|
3
|
+
export { B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, V as VHTLC, e as VHTLCContractHandler, f as VHTLCContractParams, g as contractHandlers } from './index-jwQfHP6D.cjs';
|
|
4
|
+
export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-C-L6gSZx.cjs';
|
|
5
|
+
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-BWHbd5b1.cjs';
|
|
6
|
+
export { B as Batch, d as BoardingUtxoGroup, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-BWHbd5b1.cjs';
|
|
7
|
+
import { Bytes, BTC_NETWORK } from '@scure/btc-signer/utils.js';
|
|
7
8
|
import { P2TR } from '@scure/btc-signer/payment.js';
|
|
8
9
|
import { Transaction as Transaction$1 } from '@scure/btc-signer';
|
|
9
10
|
import { ElectrumWS } from 'ws-electrumx-client';
|
|
10
11
|
import { TransactionOutput, TransactionInputUpdate } from '@scure/btc-signer/psbt.js';
|
|
11
|
-
import { BTC_NETWORK, Bytes } from '@scure/btc-signer/utils.js';
|
|
12
12
|
import { Transaction as Transaction$2 } from '@scure/btc-signer/transaction.js';
|
|
13
13
|
import { S as StorageAdapter } from './index-C0IanN1m.cjs';
|
|
14
14
|
|
|
@@ -717,15 +717,15 @@ declare class Estimator {
|
|
|
717
717
|
}
|
|
718
718
|
|
|
719
719
|
/**
|
|
720
|
-
* Thrown when a rotated contract (default or
|
|
721
|
-
* metadata.signingDescriptor required to route it to a descriptor-aware
|
|
720
|
+
* Thrown when a rotated contract (default, delegate, or boarding) is missing
|
|
721
|
+
* the metadata.signingDescriptor required to route it to a descriptor-aware
|
|
722
722
|
* signer.
|
|
723
723
|
*/
|
|
724
724
|
declare class MissingSigningDescriptorError extends Error {
|
|
725
725
|
readonly contractScript: string;
|
|
726
|
-
readonly contractType: "default" | "delegate";
|
|
726
|
+
readonly contractType: "default" | "delegate" | "boarding";
|
|
727
727
|
readonly name = "MissingSigningDescriptorError";
|
|
728
|
-
constructor(contractScript: string, contractType: "default" | "delegate");
|
|
728
|
+
constructor(contractScript: string, contractType: "default" | "delegate" | "boarding");
|
|
729
729
|
}
|
|
730
730
|
/**
|
|
731
731
|
* Thrown when an input needs descriptor-aware signing but no
|
|
@@ -921,6 +921,55 @@ declare class MessageBus {
|
|
|
921
921
|
static setup(path: string): Promise<ServiceWorker>;
|
|
922
922
|
}
|
|
923
923
|
|
|
924
|
+
/**
|
|
925
|
+
* A leaf node in the Taproot script tree, as consumed by
|
|
926
|
+
* `@scure/btc-signer`'s `p2tr(internalKey, tree, ...)`.
|
|
927
|
+
*/
|
|
928
|
+
interface TaprootLeaf {
|
|
929
|
+
script: Bytes;
|
|
930
|
+
leafVersion: number;
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* Internal tree node shape consumed by `@scure/btc-signer`'s `p2tr`:
|
|
934
|
+
* - A leaf is `{ script, leafVersion }`
|
|
935
|
+
* - A branch is a 2-element tuple `[leftNode, rightNode]` of nodes
|
|
936
|
+
*/
|
|
937
|
+
type TaprootTreeNode = TaprootLeaf | [TaprootTreeNode, TaprootTreeNode];
|
|
938
|
+
/**
|
|
939
|
+
* Assemble a Taproot script tree from a flat list of scripts using the
|
|
940
|
+
* exact algorithm arkd's btcd dependency uses
|
|
941
|
+
* (`txscript.AssembleTaprootScriptTree`, see
|
|
942
|
+
* https://github.com/btcsuite/btcd/blob/master/txscript/taproot.go).
|
|
943
|
+
*
|
|
944
|
+
* The algorithm:
|
|
945
|
+
*
|
|
946
|
+
* Phase 1 — pair leaves left-to-right:
|
|
947
|
+
* for i := 0; i < len(leaves); i += 2:
|
|
948
|
+
* if i is the last index (odd leaf at end):
|
|
949
|
+
* merge with the LAST branch built so far (do NOT pair as a fresh leaf)
|
|
950
|
+
* else:
|
|
951
|
+
* create a new branch from (leaves[i], leaves[i+1])
|
|
952
|
+
*
|
|
953
|
+
* Phase 2 — FIFO-queue merge branches:
|
|
954
|
+
* while branches has ≥ 2 items:
|
|
955
|
+
* take front two, combine into a new branch, push to back of queue
|
|
956
|
+
*
|
|
957
|
+
* This matters because `@scure/btc-signer`'s `taprootListToTree` builds a
|
|
958
|
+
* Huffman tree (weight-1 leaves combine by smallest-weight pairs). For
|
|
959
|
+
* power-of-2 leaf counts both algorithms happen to produce the same
|
|
960
|
+
* perfectly-balanced binary tree and agree. For any other count they
|
|
961
|
+
* produce DIFFERENT shapes → different merkle roots → different taproot
|
|
962
|
+
* output keys → arkd rejects spends with `INVALID_PSBT_INPUT`.
|
|
963
|
+
*
|
|
964
|
+
* Reproducing btcd's algorithm here lets the SDK construct taptrees that
|
|
965
|
+
* arkd accepts for arbitrary leaf counts.
|
|
966
|
+
*
|
|
967
|
+
* @param scripts - Raw tapscript bytes for each leaf, in the order they
|
|
968
|
+
* should be encoded in the TapTree PSBT field.
|
|
969
|
+
* @returns The nested-tuple form `p2tr` accepts.
|
|
970
|
+
*/
|
|
971
|
+
declare function assembleBtcdTaprootTree(scripts: Bytes[]): TaprootTreeNode;
|
|
972
|
+
|
|
924
973
|
/**
|
|
925
974
|
* Thrown when a collaborative-exit / offboard would leave a change VTXO below
|
|
926
975
|
* the dust threshold. Lets callers (e.g. wallet UI) react with appropriate UX
|
|
@@ -1413,6 +1462,10 @@ type ResponseRenewVtxosEvent = ResponseEnvelope & {
|
|
|
1413
1462
|
type: "RENEW_VTXOS_EVENT";
|
|
1414
1463
|
payload: SettlementEvent;
|
|
1415
1464
|
};
|
|
1465
|
+
type ResponseMigrateDeprecatedSignerVtxosEvent = ResponseEnvelope & {
|
|
1466
|
+
type: "MIGRATE_DEPRECATED_SIGNER_VTXOS_EVENT";
|
|
1467
|
+
payload: SettlementEvent;
|
|
1468
|
+
};
|
|
1416
1469
|
type ResponseUtxoUpdate = ResponseEnvelope & {
|
|
1417
1470
|
broadcast: true;
|
|
1418
1471
|
type: "UTXO_UPDATE";
|
|
@@ -1593,6 +1646,62 @@ type ResponseSweepExpiredBoardingUtxos = ResponseEnvelope & {
|
|
|
1593
1646
|
txid: string;
|
|
1594
1647
|
};
|
|
1595
1648
|
};
|
|
1649
|
+
type WireMigrationVtxoRef = {
|
|
1650
|
+
txid: string;
|
|
1651
|
+
vout: number;
|
|
1652
|
+
value: number;
|
|
1653
|
+
signerPubKey: string;
|
|
1654
|
+
cutoffDate?: string;
|
|
1655
|
+
};
|
|
1656
|
+
type WireDeprecatedSignerReport = {
|
|
1657
|
+
signerPubKey: string;
|
|
1658
|
+
status: SignerStatus;
|
|
1659
|
+
cutoffDate?: string;
|
|
1660
|
+
secondsUntilCutoff?: number;
|
|
1661
|
+
vtxoCount: number;
|
|
1662
|
+
totalValue: number;
|
|
1663
|
+
boardingCount: number;
|
|
1664
|
+
boardingValue: number;
|
|
1665
|
+
recoverableCount: number;
|
|
1666
|
+
recoverableValue: number;
|
|
1667
|
+
awaitingSweepCount: number;
|
|
1668
|
+
awaitingSweepValue: number;
|
|
1669
|
+
nextSweepEta?: number;
|
|
1670
|
+
};
|
|
1671
|
+
type WireMigrationLegReport = {
|
|
1672
|
+
txid?: string;
|
|
1673
|
+
migrated: WireMigrationVtxoRef[];
|
|
1674
|
+
skipped?: MigrationLegSkipReason;
|
|
1675
|
+
deferred?: number;
|
|
1676
|
+
oversized?: WireMigrationVtxoRef[];
|
|
1677
|
+
error?: string;
|
|
1678
|
+
};
|
|
1679
|
+
type WireDeprecatedSignerMigrationReport = {
|
|
1680
|
+
rotated: boolean;
|
|
1681
|
+
skipped?: MigrationGlobalSkipReason;
|
|
1682
|
+
vtxos?: WireMigrationLegReport;
|
|
1683
|
+
boarding?: WireMigrationLegReport;
|
|
1684
|
+
expired: WireMigrationVtxoRef[];
|
|
1685
|
+
signers: WireDeprecatedSignerReport[];
|
|
1686
|
+
};
|
|
1687
|
+
type RequestMigrateDeprecatedSignerVtxos = RequestEnvelope & {
|
|
1688
|
+
type: "MIGRATE_DEPRECATED_SIGNER_VTXOS";
|
|
1689
|
+
};
|
|
1690
|
+
type ResponseMigrateDeprecatedSignerVtxos = ResponseEnvelope & {
|
|
1691
|
+
type: "MIGRATE_DEPRECATED_SIGNER_VTXOS_SUCCESS";
|
|
1692
|
+
payload: {
|
|
1693
|
+
report: WireDeprecatedSignerMigrationReport;
|
|
1694
|
+
};
|
|
1695
|
+
};
|
|
1696
|
+
type RequestGetDeprecatedSignerStatus = RequestEnvelope & {
|
|
1697
|
+
type: "GET_DEPRECATED_SIGNER_STATUS";
|
|
1698
|
+
};
|
|
1699
|
+
type ResponseGetDeprecatedSignerStatus = ResponseEnvelope & {
|
|
1700
|
+
type: "DEPRECATED_SIGNER_STATUS";
|
|
1701
|
+
payload: {
|
|
1702
|
+
signers: WireDeprecatedSignerReport[];
|
|
1703
|
+
};
|
|
1704
|
+
};
|
|
1596
1705
|
type RequestRestoreWallet = RequestEnvelope & {
|
|
1597
1706
|
type: "RESTORE_WALLET";
|
|
1598
1707
|
payload: {
|
|
@@ -1602,8 +1711,8 @@ type RequestRestoreWallet = RequestEnvelope & {
|
|
|
1602
1711
|
type ResponseRestoreWallet = ResponseEnvelope & {
|
|
1603
1712
|
type: "RESTORE_WALLET_SUCCESS";
|
|
1604
1713
|
};
|
|
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);
|
|
1714
|
+
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 | RequestMigrateDeprecatedSignerVtxos | RequestGetDeprecatedSignerStatus | RequestRestoreWallet;
|
|
1715
|
+
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 | ResponseMigrateDeprecatedSignerVtxos | ResponseMigrateDeprecatedSignerVtxosEvent | ResponseGetDeprecatedSignerStatus | ResponseRestoreWallet);
|
|
1607
1716
|
declare class WalletMessageHandler implements MessageHandler<WalletUpdaterRequest, WalletUpdaterResponse> {
|
|
1608
1717
|
readonly messageTag: string;
|
|
1609
1718
|
private wallet;
|
|
@@ -2065,8 +2174,8 @@ declare function setupServiceWorker(pathOrOptions: string | SetupServiceWorkerOp
|
|
|
2065
2174
|
* `blockchain.transaction.broadcast_package` for atomic 1P1C TRUC
|
|
2066
2175
|
* relay; see `ElectrumOnchainProvider.broadcastTransaction`). Testnet
|
|
2067
2176
|
* defaults to Blockstream's public Fulcrum because Ark doesn't host
|
|
2068
|
-
* it. Regtest assumes the
|
|
2069
|
-
* `
|
|
2177
|
+
* it. Regtest assumes the Fulcrum WebSocket endpoint exposed by the
|
|
2178
|
+
* local `arkade-regtest` stack.
|
|
2070
2179
|
*
|
|
2071
2180
|
* @example
|
|
2072
2181
|
* ```typescript
|
|
@@ -3491,4 +3600,4 @@ declare class AssetManager extends ReadonlyAssetManager implements IAssetManager
|
|
|
3491
3600
|
burn(params: BurnParams): Promise<string>;
|
|
3492
3601
|
}
|
|
3493
3602
|
|
|
3494
|
-
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, PathContext, 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, isCltvSatisfied, isCsvSpendable, isValidArkAddress, maybeArkError, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sequenceToTimelock, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
|
|
3603
|
+
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, MigrationGlobalSkipReason, MigrationLegSkipReason, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathContext, 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, SignerStatus, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, Unroll, type VSize, VirtualCoin, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, assembleBtcdTaprootTree, index as asset, buildForfeitTx, buildOffchainTx, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isCltvSatisfied, isCsvSpendable, isValidArkAddress, maybeArkError, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sequenceToTimelock, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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, al as RenewVtxosOptions, c as WalletBalance, am as ContractWithVtxos, an as PathSelection, ao as ContractEvent, ap as AssetDetails, aq as IssuanceResult, ar as DelegateInfo, K as IReadonlyWallet, Q as IReadonlyAssetManager,
|
|
2
|
-
export { Y as ArkAddress, X as ArkInfo,
|
|
3
|
-
export { B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, V as VHTLC, e as VHTLCContractHandler, f as VHTLCContractParams, g 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, al as RenewVtxosOptions, c as WalletBalance, am as ContractWithVtxos, an as PathSelection, ao as ContractEvent, ap as AssetDetails, aq as IssuanceResult, ar as DelegateInfo, as as MigrationGlobalSkipReason, at as MigrationLegSkipReason, au as SignerStatus, K as IReadonlyWallet, Q as IReadonlyAssetManager, av as StorageConfig, e as IContractManager, i as IAssetManager, f as IDelegateManager, aw as IVtxoManager, O as OnchainProvider, N as Network, U as NetworkName, Z as Coin, ax as ExplorerTransaction, p as TapLeafScript, ay as EncodedVtxoScript, $ as CSVMultisigTapscript, o as RelativeTimelock, V as VtxoScript, az as Status, aA as Outpoint, aB as ChainTx, n as IndexerProvider, w as TxTree, aC as PathContext } from './ark-D6sau_6-.js';
|
|
2
|
+
export { Y as ArkAddress, X as ArkInfo, aD as ArkTapscript, aE as Asset, aF as AssetMetadata, aG as BaseWalletConfig, D as BatchFailedEvent, y as BatchFinalizationEvent, z as BatchFinalizedEvent, aH as BatchInfo, aI as BatchSignableIdentity, B as BatchStartedEvent, aJ as CLTVMultisigTapscript, aK as ChainTxType, aL as CommitmentTx, aM as ConditionCSVMultisigTapscript, aN as ConditionMultisigTapscript, aO as ContractBalance, aP as ContractEventCallback, aQ as ContractHandler, _ as ContractManager, aR as ContractManagerConfig, aS as ContractState, aT as ContractVtxo, aU as ContractWatcher, aV as DelegateManagerImpl, aW as DelegateOptions, M as DelegateProvider, aX as DelegatorManagerImpl, aY as DelegatorProvider, aZ as DeprecatedSignerMigrationReport, a_ as DeprecatedSignerReport, a$ as DigestMismatchError, b0 as Discoverable, b1 as DiscoveredContract, b2 as DiscoveryDeps, b3 as ESPLORA_URL, b4 as EsploraProvider, b5 as ExtendedContractVtxo, b6 as HandlerError, b7 as IDelegatorManager, b8 as IndexerTxType, a4 as Intent, b9 as KnownMetadata, ba as MigrateDeprecatedSignerOptions, bb as MigrationLegReport, bc as MigrationVtxoRef, bd as MultisigTapscript, be as Nonces, bf as Output, bg as PageResponse, bh as PaginationOptions, bi as PartialSig, bj as ProviderClass, P as ReadonlyWalletConfig, j as RestArkProvider, bk as RestDelegateProvider, bl as RestDelegatorProvider, k as RestIndexerProvider, bm as ScanContractsOptions, bn as ScanResult, bo as ScheduledSession, bp as SettlementEventType, bq as SignRequest, a3 as SignedIntent, br as SignerClassification, bs as SignerSet, bt as SubscriptionEvent, bu as SubscriptionHeartbeat, l as SubscriptionResponse, bv as TapLeaves, bw as TapTreeCoder, bx as TapscriptType, by as TreeNonces, x as TreeNoncesEvent, bz as TreePartialSigs, H as TreeSignatureEvent, v as TreeSigningStartedEvent, F as TreeTxEvent, bA as Tx, bB as TxHistoryRecord, bC as TxKey, T as TxNotification, bD as TxTreeNode, bE as TxType, bF as VirtualStatus, bG as Vtxo, bH as VtxoChain, a1 as VtxoManager, bI as VtxoType, b as WalletConfig, bJ as WalletMode, bK as classifyAgainstSignerSet, bL as classifyContractSigner, bM as decodeTapscript, bN as getSequence, bO as isBatchSignable, bP as isCooperativelyMigratable, bQ as isDiscoverable, bR as isExpired, bS as isRecoverable, bT as isSpendable, bU as isSubdust, bV as isVtxoExpiringSoon, bW as networks, bX as signerSetFromInfo, bY as toXOnlySignerHex } from './ark-D6sau_6-.js';
|
|
3
|
+
export { B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, V as VHTLC, e as VHTLCContractHandler, f as VHTLCContractParams, g as contractHandlers } from './index-BETdjE_o.js';
|
|
4
|
+
export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-De5__fpZ.js';
|
|
5
|
+
import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-Bth5uucA.js';
|
|
6
|
+
export { B as Batch, d as BoardingUtxoGroup, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-Bth5uucA.js';
|
|
7
|
+
import { Bytes, BTC_NETWORK } from '@scure/btc-signer/utils.js';
|
|
7
8
|
import { P2TR } from '@scure/btc-signer/payment.js';
|
|
8
9
|
import { Transaction as Transaction$1 } from '@scure/btc-signer';
|
|
9
10
|
import { ElectrumWS } from 'ws-electrumx-client';
|
|
10
11
|
import { TransactionOutput, TransactionInputUpdate } from '@scure/btc-signer/psbt.js';
|
|
11
|
-
import { BTC_NETWORK, Bytes } from '@scure/btc-signer/utils.js';
|
|
12
12
|
import { Transaction as Transaction$2 } from '@scure/btc-signer/transaction.js';
|
|
13
13
|
import { S as StorageAdapter } from './index-C0IanN1m.js';
|
|
14
14
|
|
|
@@ -717,15 +717,15 @@ declare class Estimator {
|
|
|
717
717
|
}
|
|
718
718
|
|
|
719
719
|
/**
|
|
720
|
-
* Thrown when a rotated contract (default or
|
|
721
|
-
* metadata.signingDescriptor required to route it to a descriptor-aware
|
|
720
|
+
* Thrown when a rotated contract (default, delegate, or boarding) is missing
|
|
721
|
+
* the metadata.signingDescriptor required to route it to a descriptor-aware
|
|
722
722
|
* signer.
|
|
723
723
|
*/
|
|
724
724
|
declare class MissingSigningDescriptorError extends Error {
|
|
725
725
|
readonly contractScript: string;
|
|
726
|
-
readonly contractType: "default" | "delegate";
|
|
726
|
+
readonly contractType: "default" | "delegate" | "boarding";
|
|
727
727
|
readonly name = "MissingSigningDescriptorError";
|
|
728
|
-
constructor(contractScript: string, contractType: "default" | "delegate");
|
|
728
|
+
constructor(contractScript: string, contractType: "default" | "delegate" | "boarding");
|
|
729
729
|
}
|
|
730
730
|
/**
|
|
731
731
|
* Thrown when an input needs descriptor-aware signing but no
|
|
@@ -921,6 +921,55 @@ declare class MessageBus {
|
|
|
921
921
|
static setup(path: string): Promise<ServiceWorker>;
|
|
922
922
|
}
|
|
923
923
|
|
|
924
|
+
/**
|
|
925
|
+
* A leaf node in the Taproot script tree, as consumed by
|
|
926
|
+
* `@scure/btc-signer`'s `p2tr(internalKey, tree, ...)`.
|
|
927
|
+
*/
|
|
928
|
+
interface TaprootLeaf {
|
|
929
|
+
script: Bytes;
|
|
930
|
+
leafVersion: number;
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* Internal tree node shape consumed by `@scure/btc-signer`'s `p2tr`:
|
|
934
|
+
* - A leaf is `{ script, leafVersion }`
|
|
935
|
+
* - A branch is a 2-element tuple `[leftNode, rightNode]` of nodes
|
|
936
|
+
*/
|
|
937
|
+
type TaprootTreeNode = TaprootLeaf | [TaprootTreeNode, TaprootTreeNode];
|
|
938
|
+
/**
|
|
939
|
+
* Assemble a Taproot script tree from a flat list of scripts using the
|
|
940
|
+
* exact algorithm arkd's btcd dependency uses
|
|
941
|
+
* (`txscript.AssembleTaprootScriptTree`, see
|
|
942
|
+
* https://github.com/btcsuite/btcd/blob/master/txscript/taproot.go).
|
|
943
|
+
*
|
|
944
|
+
* The algorithm:
|
|
945
|
+
*
|
|
946
|
+
* Phase 1 — pair leaves left-to-right:
|
|
947
|
+
* for i := 0; i < len(leaves); i += 2:
|
|
948
|
+
* if i is the last index (odd leaf at end):
|
|
949
|
+
* merge with the LAST branch built so far (do NOT pair as a fresh leaf)
|
|
950
|
+
* else:
|
|
951
|
+
* create a new branch from (leaves[i], leaves[i+1])
|
|
952
|
+
*
|
|
953
|
+
* Phase 2 — FIFO-queue merge branches:
|
|
954
|
+
* while branches has ≥ 2 items:
|
|
955
|
+
* take front two, combine into a new branch, push to back of queue
|
|
956
|
+
*
|
|
957
|
+
* This matters because `@scure/btc-signer`'s `taprootListToTree` builds a
|
|
958
|
+
* Huffman tree (weight-1 leaves combine by smallest-weight pairs). For
|
|
959
|
+
* power-of-2 leaf counts both algorithms happen to produce the same
|
|
960
|
+
* perfectly-balanced binary tree and agree. For any other count they
|
|
961
|
+
* produce DIFFERENT shapes → different merkle roots → different taproot
|
|
962
|
+
* output keys → arkd rejects spends with `INVALID_PSBT_INPUT`.
|
|
963
|
+
*
|
|
964
|
+
* Reproducing btcd's algorithm here lets the SDK construct taptrees that
|
|
965
|
+
* arkd accepts for arbitrary leaf counts.
|
|
966
|
+
*
|
|
967
|
+
* @param scripts - Raw tapscript bytes for each leaf, in the order they
|
|
968
|
+
* should be encoded in the TapTree PSBT field.
|
|
969
|
+
* @returns The nested-tuple form `p2tr` accepts.
|
|
970
|
+
*/
|
|
971
|
+
declare function assembleBtcdTaprootTree(scripts: Bytes[]): TaprootTreeNode;
|
|
972
|
+
|
|
924
973
|
/**
|
|
925
974
|
* Thrown when a collaborative-exit / offboard would leave a change VTXO below
|
|
926
975
|
* the dust threshold. Lets callers (e.g. wallet UI) react with appropriate UX
|
|
@@ -1413,6 +1462,10 @@ type ResponseRenewVtxosEvent = ResponseEnvelope & {
|
|
|
1413
1462
|
type: "RENEW_VTXOS_EVENT";
|
|
1414
1463
|
payload: SettlementEvent;
|
|
1415
1464
|
};
|
|
1465
|
+
type ResponseMigrateDeprecatedSignerVtxosEvent = ResponseEnvelope & {
|
|
1466
|
+
type: "MIGRATE_DEPRECATED_SIGNER_VTXOS_EVENT";
|
|
1467
|
+
payload: SettlementEvent;
|
|
1468
|
+
};
|
|
1416
1469
|
type ResponseUtxoUpdate = ResponseEnvelope & {
|
|
1417
1470
|
broadcast: true;
|
|
1418
1471
|
type: "UTXO_UPDATE";
|
|
@@ -1593,6 +1646,62 @@ type ResponseSweepExpiredBoardingUtxos = ResponseEnvelope & {
|
|
|
1593
1646
|
txid: string;
|
|
1594
1647
|
};
|
|
1595
1648
|
};
|
|
1649
|
+
type WireMigrationVtxoRef = {
|
|
1650
|
+
txid: string;
|
|
1651
|
+
vout: number;
|
|
1652
|
+
value: number;
|
|
1653
|
+
signerPubKey: string;
|
|
1654
|
+
cutoffDate?: string;
|
|
1655
|
+
};
|
|
1656
|
+
type WireDeprecatedSignerReport = {
|
|
1657
|
+
signerPubKey: string;
|
|
1658
|
+
status: SignerStatus;
|
|
1659
|
+
cutoffDate?: string;
|
|
1660
|
+
secondsUntilCutoff?: number;
|
|
1661
|
+
vtxoCount: number;
|
|
1662
|
+
totalValue: number;
|
|
1663
|
+
boardingCount: number;
|
|
1664
|
+
boardingValue: number;
|
|
1665
|
+
recoverableCount: number;
|
|
1666
|
+
recoverableValue: number;
|
|
1667
|
+
awaitingSweepCount: number;
|
|
1668
|
+
awaitingSweepValue: number;
|
|
1669
|
+
nextSweepEta?: number;
|
|
1670
|
+
};
|
|
1671
|
+
type WireMigrationLegReport = {
|
|
1672
|
+
txid?: string;
|
|
1673
|
+
migrated: WireMigrationVtxoRef[];
|
|
1674
|
+
skipped?: MigrationLegSkipReason;
|
|
1675
|
+
deferred?: number;
|
|
1676
|
+
oversized?: WireMigrationVtxoRef[];
|
|
1677
|
+
error?: string;
|
|
1678
|
+
};
|
|
1679
|
+
type WireDeprecatedSignerMigrationReport = {
|
|
1680
|
+
rotated: boolean;
|
|
1681
|
+
skipped?: MigrationGlobalSkipReason;
|
|
1682
|
+
vtxos?: WireMigrationLegReport;
|
|
1683
|
+
boarding?: WireMigrationLegReport;
|
|
1684
|
+
expired: WireMigrationVtxoRef[];
|
|
1685
|
+
signers: WireDeprecatedSignerReport[];
|
|
1686
|
+
};
|
|
1687
|
+
type RequestMigrateDeprecatedSignerVtxos = RequestEnvelope & {
|
|
1688
|
+
type: "MIGRATE_DEPRECATED_SIGNER_VTXOS";
|
|
1689
|
+
};
|
|
1690
|
+
type ResponseMigrateDeprecatedSignerVtxos = ResponseEnvelope & {
|
|
1691
|
+
type: "MIGRATE_DEPRECATED_SIGNER_VTXOS_SUCCESS";
|
|
1692
|
+
payload: {
|
|
1693
|
+
report: WireDeprecatedSignerMigrationReport;
|
|
1694
|
+
};
|
|
1695
|
+
};
|
|
1696
|
+
type RequestGetDeprecatedSignerStatus = RequestEnvelope & {
|
|
1697
|
+
type: "GET_DEPRECATED_SIGNER_STATUS";
|
|
1698
|
+
};
|
|
1699
|
+
type ResponseGetDeprecatedSignerStatus = ResponseEnvelope & {
|
|
1700
|
+
type: "DEPRECATED_SIGNER_STATUS";
|
|
1701
|
+
payload: {
|
|
1702
|
+
signers: WireDeprecatedSignerReport[];
|
|
1703
|
+
};
|
|
1704
|
+
};
|
|
1596
1705
|
type RequestRestoreWallet = RequestEnvelope & {
|
|
1597
1706
|
type: "RESTORE_WALLET";
|
|
1598
1707
|
payload: {
|
|
@@ -1602,8 +1711,8 @@ type RequestRestoreWallet = RequestEnvelope & {
|
|
|
1602
1711
|
type ResponseRestoreWallet = ResponseEnvelope & {
|
|
1603
1712
|
type: "RESTORE_WALLET_SUCCESS";
|
|
1604
1713
|
};
|
|
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);
|
|
1714
|
+
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 | RequestMigrateDeprecatedSignerVtxos | RequestGetDeprecatedSignerStatus | RequestRestoreWallet;
|
|
1715
|
+
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 | ResponseMigrateDeprecatedSignerVtxos | ResponseMigrateDeprecatedSignerVtxosEvent | ResponseGetDeprecatedSignerStatus | ResponseRestoreWallet);
|
|
1607
1716
|
declare class WalletMessageHandler implements MessageHandler<WalletUpdaterRequest, WalletUpdaterResponse> {
|
|
1608
1717
|
readonly messageTag: string;
|
|
1609
1718
|
private wallet;
|
|
@@ -2065,8 +2174,8 @@ declare function setupServiceWorker(pathOrOptions: string | SetupServiceWorkerOp
|
|
|
2065
2174
|
* `blockchain.transaction.broadcast_package` for atomic 1P1C TRUC
|
|
2066
2175
|
* relay; see `ElectrumOnchainProvider.broadcastTransaction`). Testnet
|
|
2067
2176
|
* defaults to Blockstream's public Fulcrum because Ark doesn't host
|
|
2068
|
-
* it. Regtest assumes the
|
|
2069
|
-
* `
|
|
2177
|
+
* it. Regtest assumes the Fulcrum WebSocket endpoint exposed by the
|
|
2178
|
+
* local `arkade-regtest` stack.
|
|
2070
2179
|
*
|
|
2071
2180
|
* @example
|
|
2072
2181
|
* ```typescript
|
|
@@ -3491,4 +3600,4 @@ declare class AssetManager extends ReadonlyAssetManager implements IAssetManager
|
|
|
3491
3600
|
burn(params: BurnParams): Promise<string>;
|
|
3492
3601
|
}
|
|
3493
3602
|
|
|
3494
|
-
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, PathContext, 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, isCltvSatisfied, isCsvSpendable, isValidArkAddress, maybeArkError, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sequenceToTimelock, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
|
|
3603
|
+
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, MigrationGlobalSkipReason, MigrationLegSkipReason, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathContext, 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, SignerStatus, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, Unroll, type VSize, VirtualCoin, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, assembleBtcdTaprootTree, index as asset, buildForfeitTx, buildOffchainTx, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isCltvSatisfied, isCsvSpendable, 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, 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-
|
|
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 { BoardingContractHandler, DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, VHTLC, VHTLCContractHandler, contractHandlers, isCltvSatisfied, isCsvSpendable } from './chunk-
|
|
4
|
-
export { ArkAddress, CLTVMultisigTapscript, CSVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, MultisigTapscript, TapTreeCoder, VtxoScript, decodeTapscript, getSequence, networks, sequenceToTimelock, timelockToSequence } from './chunk-
|
|
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, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isBatchSignable, isCooperativelyMigratable, isDiscoverable, isExpired, isRecoverable, isSpendable, isSubdust, isValidArkAddress, isVtxoExpiringSoon, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, setupServiceWorker, signerSetFromInfo, toXOnlySignerHex, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds } from './chunk-NOR7XOKN.js';
|
|
2
|
+
export { ArkError, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ChainTxType, ConditionWitness, CosignerPublicKey, DigestMismatchError, IndexerTxType, Intent, RestArkProvider, RestIndexerProvider, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, asset_exports as asset, getArkPsbtFields, maybeArkError, setArkPsbtField } from './chunk-3JR77WQ4.js';
|
|
3
|
+
export { BoardingContractHandler, DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, VHTLC, VHTLCContractHandler, contractHandlers, isCltvSatisfied, isCsvSpendable } from './chunk-CUSABEUQ.js';
|
|
4
|
+
export { ArkAddress, CLTVMultisigTapscript, CSVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, MultisigTapscript, TapTreeCoder, VtxoScript, assembleBtcdTaprootTree, decodeTapscript, getSequence, networks, sequenceToTimelock, timelockToSequence } from './chunk-OUVTG72A.js';
|
|
5
5
|
import './chunk-NSBPE2FW.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
6
|
-
require('../../chunk-
|
|
3
|
+
var chunkH2LX2KKY_cjs = require('../../chunk-H2LX2KKY.cjs');
|
|
4
|
+
require('../../chunk-X2EQLK4O.cjs');
|
|
5
|
+
require('../../chunk-GUTKJMSF.cjs');
|
|
6
|
+
require('../../chunk-CMPJR3HS.cjs');
|
|
7
7
|
require('../../chunk-5BLDMQED.cjs');
|
|
8
8
|
|
|
9
9
|
// src/repositories/realm/walletRepository.ts
|
|
@@ -37,7 +37,7 @@ var RealmWalletRepository = class {
|
|
|
37
37
|
await this.ensureInit();
|
|
38
38
|
this.realm.write(() => {
|
|
39
39
|
for (const vtxo of vtxos) {
|
|
40
|
-
const s =
|
|
40
|
+
const s = chunkH2LX2KKY_cjs.serializeVtxo(vtxo);
|
|
41
41
|
this.realm.create(
|
|
42
42
|
"ArkVtxo",
|
|
43
43
|
{
|
|
@@ -85,7 +85,7 @@ var RealmWalletRepository = class {
|
|
|
85
85
|
throw new Error("RealmWalletRepository requires an address");
|
|
86
86
|
}
|
|
87
87
|
for (const vtxo of vtxos) {
|
|
88
|
-
if (!
|
|
88
|
+
if (!chunkH2LX2KKY_cjs.isVtxoForScript(vtxo, key.script)) {
|
|
89
89
|
throw new Error(
|
|
90
90
|
`VTXO ${vtxo.txid}:${vtxo.vout} script mismatch: expected ${key.script}, got ${vtxo.script}`
|
|
91
91
|
);
|
|
@@ -110,7 +110,7 @@ var RealmWalletRepository = class {
|
|
|
110
110
|
await this.ensureInit();
|
|
111
111
|
this.realm.write(() => {
|
|
112
112
|
for (const utxo of utxos) {
|
|
113
|
-
const s =
|
|
113
|
+
const s = chunkH2LX2KKY_cjs.serializeUtxo(utxo);
|
|
114
114
|
this.realm.create(
|
|
115
115
|
"ArkUtxo",
|
|
116
116
|
{
|
|
@@ -163,7 +163,7 @@ var RealmWalletRepository = class {
|
|
|
163
163
|
amount: tx.amount,
|
|
164
164
|
settled: tx.settled,
|
|
165
165
|
createdAt: tx.createdAt,
|
|
166
|
-
assetsJson: tx.assets ? JSON.stringify(
|
|
166
|
+
assetsJson: tx.assets ? JSON.stringify(chunkH2LX2KKY_cjs.serializeAssets(tx.assets)) : null
|
|
167
167
|
},
|
|
168
168
|
"modified"
|
|
169
169
|
);
|
|
@@ -233,9 +233,9 @@ function vtxoObjectToDomain(obj) {
|
|
|
233
233
|
// Post-migration every row has `script`, but the backfill is
|
|
234
234
|
// idempotent: derive from `address` if the legacy column is still
|
|
235
235
|
// null (e.g. the migration hasn't run yet on this handle).
|
|
236
|
-
script: obj.script ??
|
|
236
|
+
script: obj.script ?? chunkH2LX2KKY_cjs.scriptFromArkAddress(obj.address)
|
|
237
237
|
};
|
|
238
|
-
return
|
|
238
|
+
return chunkH2LX2KKY_cjs.deserializeVtxo(serialized);
|
|
239
239
|
}
|
|
240
240
|
function utxoObjectToDomain(obj) {
|
|
241
241
|
const serialized = {
|
|
@@ -254,7 +254,7 @@ function utxoObjectToDomain(obj) {
|
|
|
254
254
|
status: JSON.parse(obj.statusJson),
|
|
255
255
|
extraWitness: obj.extraWitnessJson ? JSON.parse(obj.extraWitnessJson) : void 0
|
|
256
256
|
};
|
|
257
|
-
return
|
|
257
|
+
return chunkH2LX2KKY_cjs.deserializeUtxo(serialized);
|
|
258
258
|
}
|
|
259
259
|
function txObjectToDomain(obj) {
|
|
260
260
|
const tx = {
|
|
@@ -269,7 +269,7 @@ function txObjectToDomain(obj) {
|
|
|
269
269
|
createdAt: obj.createdAt
|
|
270
270
|
};
|
|
271
271
|
if (obj.assetsJson) {
|
|
272
|
-
tx.assets =
|
|
272
|
+
tx.assets = chunkH2LX2KKY_cjs.deserializeAssets(JSON.parse(obj.assetsJson));
|
|
273
273
|
}
|
|
274
274
|
return tx;
|
|
275
275
|
}
|
|
@@ -494,12 +494,12 @@ var ArkRealmSchemas = [
|
|
|
494
494
|
ArkContractSchema
|
|
495
495
|
];
|
|
496
496
|
var ARK_REALM_SCHEMA_VERSION = 2;
|
|
497
|
-
function runArkRealmMigrations(
|
|
497
|
+
function runArkRealmMigrations(_oldRealm, newRealm) {
|
|
498
498
|
const newVtxos = newRealm.objects("ArkVtxo");
|
|
499
499
|
for (let i = 0; i < newVtxos.length; i++) {
|
|
500
500
|
const newVtxo = newVtxos[i];
|
|
501
501
|
if (!newVtxo.script) {
|
|
502
|
-
newVtxo.script =
|
|
502
|
+
newVtxo.script = chunkH2LX2KKY_cjs.scriptFromArkAddress(newVtxo.address);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
}
|