@arkade-os/sdk 0.4.65 → 0.4.67
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 +66 -15
- package/dist/adapters/expo.cjs +5 -5
- package/dist/adapters/expo.d.cts +3 -6
- package/dist/adapters/expo.d.ts +3 -6
- package/dist/adapters/expo.js +3 -3
- package/dist/adapters/indexedDB.cjs +5 -5
- package/dist/adapters/indexedDB.js +4 -4
- package/dist/{asyncStorageTaskQueue-Chwe60Ce.d.cts → asyncStorageTaskQueue-LTpeXYaD.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-Dq_UcvDx.d.ts → asyncStorageTaskQueue-Za-e_zMk.d.ts} +2 -2
- package/dist/{chunk-G552MISJ.cjs → chunk-2JV4VQ7C.cjs} +56 -28
- package/dist/chunk-2JV4VQ7C.cjs.map +1 -0
- package/dist/{chunk-TFSVXMTM.js → chunk-3WIWNE4P.js} +56 -29
- package/dist/chunk-3WIWNE4P.js.map +1 -0
- package/dist/{chunk-XMOIRDLF.js → chunk-6TAQF6EV.js} +118 -16
- package/dist/chunk-6TAQF6EV.js.map +1 -0
- package/dist/{chunk-5YTSQSLE.js → chunk-AEWJU6NZ.js} +1033 -193
- package/dist/chunk-AEWJU6NZ.js.map +1 -0
- package/dist/{chunk-XN55B6EP.cjs → chunk-CO3KKSWM.cjs} +46 -19
- package/dist/chunk-CO3KKSWM.cjs.map +1 -0
- package/dist/{chunk-RESN6QHP.js → chunk-EALWOVHK.js} +4 -4
- package/dist/{chunk-RESN6QHP.js.map → chunk-EALWOVHK.js.map} +1 -1
- package/dist/{chunk-GFZNEMGL.cjs → chunk-MJUTO3PY.cjs} +1425 -574
- package/dist/chunk-MJUTO3PY.cjs.map +1 -0
- package/dist/{chunk-TYTPVPKD.js → chunk-MZFUZUTQ.js} +4 -4
- package/dist/{chunk-TYTPVPKD.js.map → chunk-MZFUZUTQ.js.map} +1 -1
- package/dist/{chunk-BABJ77NG.cjs → chunk-OIZ2V2VD.cjs} +163 -60
- package/dist/chunk-OIZ2V2VD.cjs.map +1 -0
- package/dist/{chunk-SJQM5AVB.cjs → chunk-R2YAMONM.cjs} +17 -17
- package/dist/{chunk-SJQM5AVB.cjs.map → chunk-R2YAMONM.cjs.map} +1 -1
- package/dist/{chunk-3G5V564P.js → chunk-X3VEMUVV.js} +32 -6
- package/dist/chunk-X3VEMUVV.js.map +1 -0
- package/dist/{chunk-7X744EFF.cjs → chunk-YDRZDZPP.cjs} +10 -10
- package/dist/{chunk-7X744EFF.cjs.map → chunk-YDRZDZPP.cjs.map} +1 -1
- package/dist/contracts/handlers/index.cjs +9 -9
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/contracts/handlers/index.js +2 -2
- package/dist/{delegate-BBQW61ym.d.cts → delegate-Bz2e2zXY.d.cts} +1 -1
- package/dist/{delegate-Dv_9OVHv.d.ts → delegate-cdmzb2f9.d.ts} +1 -1
- package/dist/{wallet-DJUnN939.d.ts → hdWalletCapable-BSjuUYOO.d.cts} +319 -128
- package/dist/{wallet-C2NvHjWB.d.cts → hdWalletCapable-Hi12xjCJ.d.ts} +319 -128
- package/dist/{index-fDDiA1-L.d.ts → index-BiACuWaf.d.ts} +109 -13
- package/dist/{index-BtTtQFUX.d.cts → index-D2GjZxBr.d.cts} +109 -13
- package/dist/{index-CFOMyVMt.d.cts → index-DU5o_hz7.d.cts} +275 -51
- package/dist/{index-CFOMyVMt.d.ts → index-DU5o_hz7.d.ts} +275 -51
- package/dist/index.cjs +328 -276
- package/dist/index.d.cts +312 -41
- package/dist/index.d.ts +312 -41
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +19 -19
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/realm/index.js +5 -5
- package/dist/repositories/sqlite/index.cjs +18 -18
- package/dist/repositories/sqlite/index.d.cts +2 -2
- package/dist/repositories/sqlite/index.d.ts +2 -2
- package/dist/repositories/sqlite/index.js +5 -5
- package/dist/{taskRunner-CIKOS2OO.d.cts → taskRunner-BZJMLQ6g.d.cts} +2 -2
- package/dist/{taskRunner-BDzWbpct.d.ts → taskRunner-DATaRQus.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 +18 -14
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +7 -5
- package/dist/wallet/expo/index.d.ts +7 -5
- package/dist/wallet/expo/index.js +10 -6
- package/dist/wallet/expo/index.js.map +1 -1
- 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 +3 -3
- package/dist/chunk-3G5V564P.js.map +0 -1
- package/dist/chunk-5YTSQSLE.js.map +0 -1
- package/dist/chunk-BABJ77NG.cjs.map +0 -1
- package/dist/chunk-G552MISJ.cjs.map +0 -1
- package/dist/chunk-GFZNEMGL.cjs.map +0 -1
- package/dist/chunk-TFSVXMTM.js.map +0 -1
- package/dist/chunk-XMOIRDLF.js.map +0 -1
- package/dist/chunk-XN55B6EP.cjs.map +0 -1
|
@@ -290,6 +290,11 @@ type PaginationOptions = {
|
|
|
290
290
|
pageIndex?: number;
|
|
291
291
|
pageSize?: number;
|
|
292
292
|
};
|
|
293
|
+
/**
|
|
294
|
+
* Page size {@link RestIndexerProvider.getVtxos} uses when the caller named no
|
|
295
|
+
* pagination of its own and it pages the query out itself.
|
|
296
|
+
*/
|
|
297
|
+
declare const DEFAULT_VTXO_PAGE_SIZE = 500;
|
|
293
298
|
declare enum IndexerTxType {
|
|
294
299
|
INDEXER_TX_TYPE_UNSPECIFIED = 0,
|
|
295
300
|
INDEXER_TX_TYPE_RECEIVED = 1,
|
|
@@ -586,6 +591,12 @@ declare class RestIndexerProvider implements IndexerProvider {
|
|
|
586
591
|
vtxos: VirtualCoin[];
|
|
587
592
|
page?: PageResponse;
|
|
588
593
|
}>;
|
|
594
|
+
/**
|
|
595
|
+
* Fetch a single page of vtxos. Callers paging to exhaustion get no
|
|
596
|
+
* deliberate inter-page backoff here: `indexerFetch` already enforces
|
|
597
|
+
* politeness through the rate gate, so don't add a redundant sleep.
|
|
598
|
+
*/
|
|
599
|
+
private fetchVtxosPage;
|
|
589
600
|
getAssetDetails(assetId: string): Promise<AssetDetails>;
|
|
590
601
|
subscribeForScripts(scripts: string[], subscriptionId?: string): Promise<string>;
|
|
591
602
|
unsubscribeForScripts(subscriptionId: string, scripts?: string[]): Promise<void>;
|
|
@@ -630,6 +641,86 @@ interface FeeOutput {
|
|
|
630
641
|
script: string;
|
|
631
642
|
}
|
|
632
643
|
|
|
644
|
+
/**
|
|
645
|
+
* Off-chain source of previous transactions: ark, tree and checkpoint txs, as
|
|
646
|
+
* base64 PSBTs keyed by txid. Structurally satisfied by `IndexerProvider`.
|
|
647
|
+
*/
|
|
648
|
+
interface PrevTxSource {
|
|
649
|
+
getVirtualTxs(txids: string[]): Promise<{
|
|
650
|
+
txs: string[];
|
|
651
|
+
}>;
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* On-chain source of previous transactions — boarding and commitment txs, which
|
|
655
|
+
* `getVirtualTxs` does not serve. Structurally satisfied by `OnchainProvider`.
|
|
656
|
+
*/
|
|
657
|
+
interface RawTxSource {
|
|
658
|
+
getRawTransaction(txid: string): Promise<Uint8Array>;
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* A previous transaction could not be resolved, so the emulator would reject the
|
|
662
|
+
* submission with `missing prevout tx for input N`. Distinguishes "no source is
|
|
663
|
+
* wired up" from "the source did not have it" — the remedies differ.
|
|
664
|
+
*/
|
|
665
|
+
declare class PrevTxUnavailableError extends Error {
|
|
666
|
+
readonly txids: string[];
|
|
667
|
+
constructor(message: string, txids?: string[]);
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Resolve raw wire-format bytes for each txid, batched and de-duplicated.
|
|
671
|
+
*
|
|
672
|
+
* Emulator v0.0.7+ requires the raw tx behind every input of a submitted ark tx
|
|
673
|
+
* or intent proof (`PrevArkTxField`) and of an onchain tx (`PrevoutTxField`).
|
|
674
|
+
* The value is a serialized `wire.MsgTx`, *not* a PSBT — `Transaction.toBytes()`
|
|
675
|
+
* with the default `(withScriptSig=false, withWitness=false)` is exactly the
|
|
676
|
+
* preimage the emulator hashes to check the tx against the outpoint.
|
|
677
|
+
*
|
|
678
|
+
* Off-chain txs are fetched in one batched call; anything the indexer does not
|
|
679
|
+
* serve (a commitment or boarding tx) falls through to `onchain` when supplied.
|
|
680
|
+
*/
|
|
681
|
+
declare function resolvePrevTxs(txids: string[], source: PrevTxSource, onchain?: RawTxSource): Promise<Map<string, Uint8Array>>;
|
|
682
|
+
/**
|
|
683
|
+
* Attach `PrevArkTxField` to every input of `tx` that does not already carry
|
|
684
|
+
* one, resolving the bytes for `txids[i]` — the coin input `i` ultimately
|
|
685
|
+
* spends.
|
|
686
|
+
*
|
|
687
|
+
* Inputs already carrying the field are skipped rather than overwritten: the
|
|
688
|
+
* emulator rejects an input with more than one field of the same type, so a
|
|
689
|
+
* caller-supplied value (`Utxo.sourceTx`) must win outright. Nothing is fetched
|
|
690
|
+
* when every input is already covered.
|
|
691
|
+
*/
|
|
692
|
+
declare function attachPrevArkTxs(tx: Transaction, txids: string[], source: PrevTxSource, onchain?: RawTxSource): Promise<void>;
|
|
693
|
+
/**
|
|
694
|
+
* Attach `PrevoutTxField` to every input of an onchain PSBT, reading each
|
|
695
|
+
* input's own outpoint — unlike an ark tx, an onchain tx spends its prevout
|
|
696
|
+
* directly, so the txid is in the PSBT already.
|
|
697
|
+
*/
|
|
698
|
+
declare function attachPrevoutTxs(tx: Transaction, source: RawTxSource): Promise<void>;
|
|
699
|
+
/**
|
|
700
|
+
* A coin an intent proof spends, carrying the raw previous tx the emulator needs
|
|
701
|
+
* to resolve its prevout pkScript.
|
|
702
|
+
*/
|
|
703
|
+
type WithPrevTx<T> = T & {
|
|
704
|
+
prevTx?: Uint8Array;
|
|
705
|
+
};
|
|
706
|
+
/**
|
|
707
|
+
* Fill in `prevTx` on every coin an intent proof will spend, in one batched
|
|
708
|
+
* lookup. The proof's synthetic input 0 needs nothing — the emulator synthesises
|
|
709
|
+
* a one-output tx for it — so this covers exactly the coins, which land on proof
|
|
710
|
+
* inputs `1..n`.
|
|
711
|
+
*/
|
|
712
|
+
declare function withPrevTxs<T extends {
|
|
713
|
+
txid: string;
|
|
714
|
+
prevTx?: Uint8Array;
|
|
715
|
+
}>(coins: T[], source: PrevTxSource, onchain?: RawTxSource): Promise<T[]>;
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* A coin an intent proof proves ownership of. `prevTx` carries the raw wire
|
|
719
|
+
* bytes of the transaction that created it — required by emulator v0.0.7+ on
|
|
720
|
+
* every real input of a submitted proof. {@link Intent.create} is synchronous,
|
|
721
|
+
* so the bytes are supplied rather than fetched; `withPrevTxs` fills them in.
|
|
722
|
+
*/
|
|
723
|
+
type IntentCoin = WithPrevTx<ExtendedCoin>;
|
|
633
724
|
/**
|
|
634
725
|
* Intent proof implementation for Bitcoin message signing.
|
|
635
726
|
*
|
|
@@ -668,7 +759,7 @@ declare namespace Intent {
|
|
|
668
759
|
* @param outputs - Optional array of transaction outputs
|
|
669
760
|
* @returns An unsigned Intent proof transaction
|
|
670
761
|
*/
|
|
671
|
-
function create(message: string | Message, ins: (TransactionInput |
|
|
762
|
+
function create(message: string | Message, ins: (TransactionInput | IntentCoin)[], outputs?: TransactionOutput[]): Proof;
|
|
672
763
|
/**
|
|
673
764
|
* Compute the fee paid by an intent proof transaction.
|
|
674
765
|
*
|
|
@@ -836,6 +927,23 @@ interface ArkInfo {
|
|
|
836
927
|
* satisfy any floor comparison.
|
|
837
928
|
*/
|
|
838
929
|
vtxoTreeExpiry?: bigint;
|
|
930
|
+
/**
|
|
931
|
+
* Weight budget an ark transaction must stay under; the server answers
|
|
932
|
+
* `TX_TOO_LARGE` past it.
|
|
933
|
+
*
|
|
934
|
+
* `undefined` when not advertised — a server that omits the field and one
|
|
935
|
+
* that sends `0` both mean "no limit stated". Never `0n`, which would read
|
|
936
|
+
* as a server that accepts no transaction at all.
|
|
937
|
+
*/
|
|
938
|
+
maxTxWeight?: bigint;
|
|
939
|
+
/**
|
|
940
|
+
* Maximum OP_RETURN outputs the server accepts per transaction.
|
|
941
|
+
*
|
|
942
|
+
* `undefined` when not advertised — a server that omits the field and one
|
|
943
|
+
* that sends `0` both mean "no limit stated". Never `0n`, which would read
|
|
944
|
+
* as a server that forbids them outright.
|
|
945
|
+
*/
|
|
946
|
+
maxOpReturnOutputs?: bigint;
|
|
839
947
|
/**
|
|
840
948
|
* Maximum boarding input amount.
|
|
841
949
|
*
|
|
@@ -877,6 +985,28 @@ interface TxNotification {
|
|
|
877
985
|
tx: string;
|
|
878
986
|
}>;
|
|
879
987
|
}
|
|
988
|
+
/**
|
|
989
|
+
* A `sweepTx` notification. Only a sweep carries swept outpoints, so only this
|
|
990
|
+
* arm declares them: reading `sweptVtxos` off another arm is a type error, and
|
|
991
|
+
* a sweep handler never has to narrow the field it came for.
|
|
992
|
+
*/
|
|
993
|
+
interface SweepTxNotification extends TxNotification {
|
|
994
|
+
/**
|
|
995
|
+
* Outpoints the transaction swept — outpoints rather than virtual outputs,
|
|
996
|
+
* because a swept output is gone: the server has nothing left to describe
|
|
997
|
+
* beyond where it was. Empty when the sweep touched none of them.
|
|
998
|
+
*/
|
|
999
|
+
sweptVtxos: Outpoint[];
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* One frame of {@link ArkProvider.getTransactionsStream}. Exactly one arm is
|
|
1003
|
+
* set; an unrecognized frame is dropped rather than yielded.
|
|
1004
|
+
*/
|
|
1005
|
+
interface TxNotificationEvent {
|
|
1006
|
+
commitmentTx?: TxNotification;
|
|
1007
|
+
arkTx?: TxNotification;
|
|
1008
|
+
sweepTx?: SweepTxNotification;
|
|
1009
|
+
}
|
|
880
1010
|
interface ArkProvider {
|
|
881
1011
|
/** Fetch Arkade server configuration and fee settings. */
|
|
882
1012
|
getInfo(): Promise<ArkInfo>;
|
|
@@ -903,10 +1033,7 @@ interface ArkProvider {
|
|
|
903
1033
|
/** Open the settlement event stream for the given topics. */
|
|
904
1034
|
getEventStream(signal: AbortSignal, topics: string[]): AsyncIterableIterator<SettlementEvent>;
|
|
905
1035
|
/** Stream transaction notifications emitted by the Arkade server. */
|
|
906
|
-
getTransactionsStream(signal: AbortSignal): AsyncIterableIterator<
|
|
907
|
-
commitmentTx?: TxNotification;
|
|
908
|
-
arkTx?: TxNotification;
|
|
909
|
-
}>;
|
|
1036
|
+
getTransactionsStream(signal: AbortSignal): AsyncIterableIterator<TxNotificationEvent>;
|
|
910
1037
|
/** Fetch pending transactions for a signed get-pending-tx intent. */
|
|
911
1038
|
getPendingTxs(intent: SignedIntent<Intent.GetPendingTxMessage>): Promise<PendingTx[]>;
|
|
912
1039
|
}
|
|
@@ -926,17 +1053,17 @@ declare class RestArkProvider implements ArkProvider {
|
|
|
926
1053
|
protected readonly eventSource?: EventSourceFactory;
|
|
927
1054
|
constructor(serverUrl?: string, options?: EventSourceCapable);
|
|
928
1055
|
/**
|
|
929
|
-
* Last server-info digest seen
|
|
930
|
-
*
|
|
931
|
-
* stale. Empty until the first {@link getInfo}.
|
|
1056
|
+
* Last server-info digest seen from {@link getInfo}. Sent as `X-Digest`
|
|
1057
|
+
* so arkd can reject stale client configuration.
|
|
932
1058
|
*/
|
|
933
1059
|
private _digest;
|
|
1060
|
+
private _hasServerInfo;
|
|
1061
|
+
private _suppressNextGetInfoChangeEmit;
|
|
934
1062
|
private _serverInfoListeners;
|
|
935
1063
|
/**
|
|
936
|
-
* Subscribe to server-info changes. Fired
|
|
937
|
-
* `DIGEST_MISMATCH`
|
|
938
|
-
*
|
|
939
|
-
* an unsubscribe function.
|
|
1064
|
+
* Subscribe to server-info changes. Fired after a stale-info
|
|
1065
|
+
* `DIGEST_MISMATCH` refresh or when {@link getInfo} observes a changed digest.
|
|
1066
|
+
* Returns an unsubscribe function.
|
|
940
1067
|
*/
|
|
941
1068
|
onServerInfoChanged(listener: (info: ArkInfo) => void): () => void;
|
|
942
1069
|
private emitServerInfoChanged;
|
|
@@ -965,16 +1092,10 @@ declare class RestArkProvider implements ArkProvider {
|
|
|
965
1092
|
submitTreeSignatures(batchId: string, pubkey: string, signatures: TreePartialSigs): Promise<void>;
|
|
966
1093
|
submitSignedForfeitTxs(signedForfeitTxs: string[], signedCommitmentTx?: string): Promise<void>;
|
|
967
1094
|
getEventStream(signal: AbortSignal, topics: string[]): AsyncIterableIterator<SettlementEvent>;
|
|
968
|
-
getTransactionsStream(signal: AbortSignal): AsyncIterableIterator<
|
|
969
|
-
commitmentTx?: TxNotification;
|
|
970
|
-
arkTx?: TxNotification;
|
|
971
|
-
}>;
|
|
1095
|
+
getTransactionsStream(signal: AbortSignal): AsyncIterableIterator<TxNotificationEvent>;
|
|
972
1096
|
getPendingTxs(intent: SignedIntent<Intent.GetPendingTxMessage>): Promise<PendingTx[]>;
|
|
973
1097
|
protected parseSettlementEvent(data: ProtoTypes.GetEventStreamResponse): SettlementEvent | null;
|
|
974
|
-
protected parseTransactionNotification(data: ProtoTypes.GetTransactionsStreamResponse):
|
|
975
|
-
commitmentTx?: TxNotification;
|
|
976
|
-
arkTx?: TxNotification;
|
|
977
|
-
} | null;
|
|
1098
|
+
protected parseTransactionNotification(data: ProtoTypes.GetTransactionsStreamResponse): TxNotificationEvent | null;
|
|
978
1099
|
}
|
|
979
1100
|
declare namespace ProtoTypes {
|
|
980
1101
|
interface BatchStartedEvent {
|
|
@@ -1060,27 +1181,24 @@ declare namespace ProtoTypes {
|
|
|
1060
1181
|
streamStarted?: StreamStartedEvent;
|
|
1061
1182
|
heartbeat?: Heartbeat;
|
|
1062
1183
|
}
|
|
1063
|
-
export interface
|
|
1064
|
-
|
|
1184
|
+
export interface TxNotificationData {
|
|
1185
|
+
txid: string;
|
|
1186
|
+
tx: string;
|
|
1187
|
+
spentVtxos: VtxoData[];
|
|
1188
|
+
spendableVtxos: VtxoData[];
|
|
1189
|
+
checkpointTxs?: Record<string, {
|
|
1065
1190
|
txid: string;
|
|
1066
1191
|
tx: string;
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
checkpointTxs?: Record<string, {
|
|
1070
|
-
txid: string;
|
|
1071
|
-
tx: string;
|
|
1072
|
-
}>;
|
|
1073
|
-
};
|
|
1074
|
-
arkTx?: {
|
|
1192
|
+
}>;
|
|
1193
|
+
sweptVtxos?: {
|
|
1075
1194
|
txid: string;
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
};
|
|
1195
|
+
vout: number;
|
|
1196
|
+
}[];
|
|
1197
|
+
}
|
|
1198
|
+
export interface GetTransactionsStreamResponse {
|
|
1199
|
+
commitmentTx?: TxNotificationData;
|
|
1200
|
+
arkTx?: TxNotificationData;
|
|
1201
|
+
sweepTx?: TxNotificationData;
|
|
1084
1202
|
heartbeat?: Heartbeat;
|
|
1085
1203
|
}
|
|
1086
1204
|
export interface EventData {
|
|
@@ -1624,6 +1742,17 @@ interface OnchainProvider {
|
|
|
1624
1742
|
* @see ExplorerTransaction
|
|
1625
1743
|
*/
|
|
1626
1744
|
getTransactions(address: string): Promise<ExplorerTransaction[]>;
|
|
1745
|
+
/**
|
|
1746
|
+
* Fetch the raw wire-format bytes of a transaction.
|
|
1747
|
+
*
|
|
1748
|
+
* @param txid - Transaction id to fetch
|
|
1749
|
+
* @returns Serialized transaction bytes
|
|
1750
|
+
* @throws Error if the transaction is unknown to the backend
|
|
1751
|
+
* @remarks
|
|
1752
|
+
* Needed to carry a boarding or commitment tx as a PSBT prevout field —
|
|
1753
|
+
* those have no off-chain source, so the indexer cannot serve them.
|
|
1754
|
+
*/
|
|
1755
|
+
getRawTransaction(txid: string): Promise<Uint8Array>;
|
|
1627
1756
|
/**
|
|
1628
1757
|
* Fetch confirmation status for a transaction.
|
|
1629
1758
|
*
|
|
@@ -1688,6 +1817,7 @@ declare class EsploraProvider implements OnchainProvider {
|
|
|
1688
1817
|
txid?: string;
|
|
1689
1818
|
}[]>;
|
|
1690
1819
|
getTransactions(address: string): Promise<ExplorerTransaction[]>;
|
|
1820
|
+
getRawTransaction(txid: string): Promise<Uint8Array>;
|
|
1691
1821
|
getTxStatus(txid: string): Promise<{
|
|
1692
1822
|
confirmed: false;
|
|
1693
1823
|
} | {
|
|
@@ -1742,6 +1872,10 @@ type NormalizedExtendedVirtualCoin = ExtendedVirtualCoin & NormalizedVirtualCoin
|
|
|
1742
1872
|
* `isSpent: true` with an empty `spentBy` (settlement inputs needing no forfeit are written that
|
|
1743
1873
|
* way), so a `spentBy || settledBy` definition would classify a spent VTXO as spendable — inflating
|
|
1744
1874
|
* balance and selecting it for a send that must fail.
|
|
1875
|
+
*
|
|
1876
|
+
* `isUnrolled` is deliberately **not** part of this union: it says where the output lives, not that
|
|
1877
|
+
* it was consumed. Mirrors NArk's `ArkVtxo.IsSpent()`. The location axis is {@link canSweepOnchain},
|
|
1878
|
+
* which the two capability predicates below subtract instead.
|
|
1745
1879
|
*/
|
|
1746
1880
|
declare function hasTerminalSpend(vtxo: VirtualCoin): boolean;
|
|
1747
1881
|
/**
|
|
@@ -1763,6 +1897,18 @@ declare function canSpendOffchain(vtxo: VirtualCoin, now: TimeHeight): boolean;
|
|
|
1763
1897
|
* recovery/renewal test and the `recoverable` balance bucket.
|
|
1764
1898
|
*/
|
|
1765
1899
|
declare function canRecoverOnchain(vtxo: VirtualCoin, now: TimeHeight): boolean;
|
|
1900
|
+
/**
|
|
1901
|
+
* Whether a virtual output's exit already happened: the output lives onchain and `completeUnroll`
|
|
1902
|
+
* is the only remedy. The third and last capability, on the location axis rather than the spend
|
|
1903
|
+
* one — together the three partition the live set, since this claims every unrolled coin and the
|
|
1904
|
+
* other two refuse them.
|
|
1905
|
+
*
|
|
1906
|
+
* @remarks
|
|
1907
|
+
* The ts-sdk analogue of NArk's `OnchainSweepService` filter, minus the expiry clause: the relevant
|
|
1908
|
+
* maturity here is the exit tx's CSV timelock, which `prepareUnrollTransaction` checks against the
|
|
1909
|
+
* chain tip, not the batch expiry.
|
|
1910
|
+
*/
|
|
1911
|
+
declare function canSweepOnchain(vtxo: VirtualCoin): boolean;
|
|
1766
1912
|
/**
|
|
1767
1913
|
* Narrow a settle input to a virtual output.
|
|
1768
1914
|
*
|
|
@@ -1780,8 +1926,8 @@ declare function isVirtualCoin<T>(input: T): input is T & VirtualCoin;
|
|
|
1780
1926
|
* @param vtxo - virtual output to inspect
|
|
1781
1927
|
* @returns `true` when the virtual output has not been consumed
|
|
1782
1928
|
*
|
|
1783
|
-
* @deprecated Ambiguous: `true` for swept or
|
|
1784
|
-
* offchain. Use {@link canSpendOffchain}.
|
|
1929
|
+
* @deprecated Ambiguous: `true` for swept, expired or unrolled virtual outputs, none of which can
|
|
1930
|
+
* in fact be spent offchain. Use {@link canSpendOffchain}.
|
|
1785
1931
|
*/
|
|
1786
1932
|
declare function isSpendable(vtxo: VirtualCoin): boolean;
|
|
1787
1933
|
/**
|
|
@@ -1791,7 +1937,8 @@ declare function isSpendable(vtxo: VirtualCoin): boolean;
|
|
|
1791
1937
|
* @returns `true` when the virtual output is swept but not yet consumed
|
|
1792
1938
|
*
|
|
1793
1939
|
* @deprecated Swept-only: ignores virtual outputs that are past expiry but not yet swept, which are
|
|
1794
|
-
* equally recoverable
|
|
1940
|
+
* equally recoverable, and claims unrolled ones, which are not recoverable at all. Use
|
|
1941
|
+
* {@link canRecoverOnchain}.
|
|
1795
1942
|
*/
|
|
1796
1943
|
declare function isRecoverable(vtxo: VirtualCoin): boolean;
|
|
1797
1944
|
/**
|
|
@@ -1873,8 +2020,7 @@ interface SignerSet {
|
|
|
1873
2020
|
/**
|
|
1874
2021
|
* Normalize a server signer pubkey hex to the x-only (32-byte) form contract
|
|
1875
2022
|
* scripts and `params.serverPubKey` use. A 33-byte compressed key drops its
|
|
1876
|
-
* parity prefix; a 32-byte key is canonicalized to lowercase.
|
|
1877
|
-
* wallet's `hex.decode(info.signerPubkey).slice(1)` setup path so the active
|
|
2023
|
+
* parity prefix; a 32-byte key is canonicalized to lowercase. The active
|
|
1878
2024
|
* signer and the deprecated signers (which arkd may advertise compressed)
|
|
1879
2025
|
* compare equal to the x-only `params.serverPubKey` persisted on contracts.
|
|
1880
2026
|
*/
|
|
@@ -2190,7 +2336,12 @@ interface MigrationLegReport {
|
|
|
2190
2336
|
* separate settle-backed migration. They are never combined into one intent.
|
|
2191
2337
|
*/
|
|
2192
2338
|
interface DeprecatedSignerMigrationReport {
|
|
2193
|
-
/**
|
|
2339
|
+
/**
|
|
2340
|
+
* Whether this pass moved the wallet's receive state onto the active
|
|
2341
|
+
* signer — directly, or through the server-info refresh it opens with.
|
|
2342
|
+
* `false` when the wallet was already there, which includes a rotation an
|
|
2343
|
+
* earlier refresh elsewhere in the session already applied.
|
|
2344
|
+
*/
|
|
2194
2345
|
rotated: boolean;
|
|
2195
2346
|
/** Global skip; when set, neither leg is present. */
|
|
2196
2347
|
skipped?: MigrationGlobalSkipReason;
|
|
@@ -4968,6 +5119,59 @@ declare class ContractWatcher {
|
|
|
4968
5119
|
* provider.
|
|
4969
5120
|
*/
|
|
4970
5121
|
type WalletMode = "auto" | "static" | "hd" | DescriptorProvider;
|
|
5122
|
+
/**
|
|
5123
|
+
* Address flavours {@link Wallet.getNewAddresses} can mint. Both derive from
|
|
5124
|
+
* the same HD index within one call — `default` is the offchain Arkade
|
|
5125
|
+
* receive script, `boarding` the onchain deposit script.
|
|
5126
|
+
*/
|
|
5127
|
+
type NewAddressType = "default" | "boarding";
|
|
5128
|
+
/** Options for {@link Wallet.getNewAddresses}. */
|
|
5129
|
+
interface GetNewAddressesOptions {
|
|
5130
|
+
/**
|
|
5131
|
+
* Flavours to mint, in the order they are returned.
|
|
5132
|
+
*
|
|
5133
|
+
* @defaultValue `["default"]`
|
|
5134
|
+
*/
|
|
5135
|
+
types?: readonly NewAddressType[];
|
|
5136
|
+
/**
|
|
5137
|
+
* Require a genuinely fresh index. A wallet with no HD stream to advance
|
|
5138
|
+
* (`walletMode: 'static'` / `'auto'`, or a provider that declines to
|
|
5139
|
+
* allocate) throws {@link WalletCannotAllocateAddressError} rather than
|
|
5140
|
+
* silently handing back the address it already gave you — which, for a
|
|
5141
|
+
* caller issuing one address per counterparty, surfaces only as two
|
|
5142
|
+
* people paying the same script.
|
|
5143
|
+
*
|
|
5144
|
+
* @defaultValue `false`
|
|
5145
|
+
*/
|
|
5146
|
+
forceNew?: boolean;
|
|
5147
|
+
}
|
|
5148
|
+
/** One minted address and the contract row backing it. */
|
|
5149
|
+
interface NewAddress {
|
|
5150
|
+
/**
|
|
5151
|
+
* The address to hand out: the onchain address for `boarding`, the Arkade
|
|
5152
|
+
* address for `default`.
|
|
5153
|
+
*
|
|
5154
|
+
* Not always `contract.address`. A boarding row persists the *ark*
|
|
5155
|
+
* encoding of its script, so reading `contract.address` on a boarding
|
|
5156
|
+
* entry yields an address no onchain sender can pay.
|
|
5157
|
+
*/
|
|
5158
|
+
address: string;
|
|
5159
|
+
/**
|
|
5160
|
+
* The descriptor this address was derived from — hand it to
|
|
5161
|
+
* `signerForDescriptor` to recover the key later. Every entry from a
|
|
5162
|
+
* single call carries the same one, because they share an index.
|
|
5163
|
+
*
|
|
5164
|
+
* Also present on `contract.metadata.signingDescriptor`, but surfaced here
|
|
5165
|
+
* typed: `Contract.metadata` is `Record<string, unknown>`, so reading it
|
|
5166
|
+
* there costs the caller an `as string` on the one field they are most
|
|
5167
|
+
* likely to persist beside an invoice.
|
|
5168
|
+
*/
|
|
5169
|
+
signingDescriptor: string;
|
|
5170
|
+
/**
|
|
5171
|
+
* The persisted, watched contract row — script, type, state and metadata.
|
|
5172
|
+
*/
|
|
5173
|
+
contract: Contract;
|
|
5174
|
+
}
|
|
4971
5175
|
/**
|
|
4972
5176
|
* Base configuration options shared by all wallet types.
|
|
4973
5177
|
*
|
|
@@ -5256,9 +5460,9 @@ interface WalletBalance {
|
|
|
5256
5460
|
* obtainable split under a different predicate and is not counted here.
|
|
5257
5461
|
*
|
|
5258
5462
|
* Subtract this from `settled + preconfirmed`, never from `total`. `total`
|
|
5259
|
-
* also carries {@link boarding}, {@link recoverable}
|
|
5260
|
-
* {@link
|
|
5261
|
-
*
|
|
5463
|
+
* also carries {@link boarding}, {@link recoverable}, {@link pendingRecovery}
|
|
5464
|
+
* and {@link unrolled}, which are still the user's funds — netting a bucket
|
|
5465
|
+
* out of it drops them from the figure with no signal.
|
|
5262
5466
|
*/
|
|
5263
5467
|
gated: number;
|
|
5264
5468
|
/**
|
|
@@ -5286,7 +5490,18 @@ interface WalletBalance {
|
|
|
5286
5490
|
* still the wallet's funds, so counted in `total`.
|
|
5287
5491
|
*/
|
|
5288
5492
|
pendingRecovery: number;
|
|
5289
|
-
/**
|
|
5493
|
+
/**
|
|
5494
|
+
* Funds whose unilateral exit already happened — the output is onchain
|
|
5495
|
+
* behind its CSV timelock, so `Unroll.completeUnroll` is the only thing
|
|
5496
|
+
* that moves it. Excluded from `available`/`settled`/`preconfirmed`, from
|
|
5497
|
+
* `recoverable` (no batch can lift an onchain output), and from coin
|
|
5498
|
+
* selection — but still the wallet's funds, so counted in `total`.
|
|
5499
|
+
*/
|
|
5500
|
+
unrolled: number;
|
|
5501
|
+
/**
|
|
5502
|
+
* Total balance across offchain, recoverable, pending-recovery, unrolled,
|
|
5503
|
+
* and boarding funds.
|
|
5504
|
+
*/
|
|
5290
5505
|
total: number;
|
|
5291
5506
|
/** Asset balance entries (`assetId` & `amount`) the wallet owns. */
|
|
5292
5507
|
assets: Asset[];
|
|
@@ -5294,7 +5509,8 @@ interface WalletBalance {
|
|
|
5294
5509
|
* The subset of {@link assets} generic spending will accept, i.e. the asset
|
|
5295
5510
|
* analogue of {@link available}. `assets - availableAssets` is what is held
|
|
5296
5511
|
* but not selectable, for the {@link gated} and {@link intentLocked} causes
|
|
5297
|
-
* plus recovery — assets have no per-cause split of
|
|
5512
|
+
* plus recovery and {@link unrolled} — assets have no per-cause split of
|
|
5513
|
+
* their own.
|
|
5298
5514
|
*/
|
|
5299
5515
|
availableAssets: Asset[];
|
|
5300
5516
|
}
|
|
@@ -5753,7 +5969,15 @@ declare function isSubdust(vtxo: {
|
|
|
5753
5969
|
type GetVtxosFilter = {
|
|
5754
5970
|
/** Include swept but still unspent virtual outputs. */
|
|
5755
5971
|
withRecoverable?: boolean;
|
|
5756
|
-
/**
|
|
5972
|
+
/**
|
|
5973
|
+
* Include virtual outputs that have been unrolled onchain.
|
|
5974
|
+
*
|
|
5975
|
+
* Authoritative on the *location* axis and only that: an exited output is
|
|
5976
|
+
* returned whatever else is true of it, spent ones included. So unlike
|
|
5977
|
+
* {@link withRecoverable}, this flag does not narrow to a capability —
|
|
5978
|
+
* test {@link canSweepOnchain} before acting on what comes back.
|
|
5979
|
+
* `Unroll.prepareUnrollTransaction`, the flag's main consumer, does.
|
|
5980
|
+
*/
|
|
5757
5981
|
withUnrolled?: boolean;
|
|
5758
5982
|
};
|
|
5759
5983
|
/**
|
|
@@ -5935,4 +6159,4 @@ interface IReadonlyWallet {
|
|
|
5935
6159
|
clear(): Promise<void>;
|
|
5936
6160
|
}
|
|
5937
6161
|
|
|
5938
|
-
export { type
|
|
6162
|
+
export { type BatchFailedEvent as $, type ArkTransaction as A, type IntentRepository as B, type ContractRepository as C, type ArkIntent as D, type ExtendedCoin as E, type IntentFilter as F, type GetVtxosFilter as G, type VirtualTxRepository as H, type IWallet as I, type VirtualTx as J, type VtxoBranch as K, ChainedTxType as L, type Network as M, type NormalizedExtendedVirtualCoin as N, type Outpoint as O, CSVMultisigTapscript as P, type BatchStartedEvent as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotificationEvent as T, type TreeSigningStartedEvent as U, VtxoScript as V, type WalletRepository as W, TxTree as X, type TreeNoncesEvent as Y, type BatchFinalizationEvent as Z, type BatchFinalizedEvent as _, type Identity as a, type ActivityIntent as a$, type TreeTxEvent as a0, type TreeSignatureEvent as a1, type DescriptorProvider as a2, type IReadonlyWallet as a3, type ReadonlyIdentity as a4, type OnchainProvider as a5, type DelegateProvider as a6, type ReadonlyWalletConfig as a7, type ExitCaptureMode as a8, type ExitDataSource as a9, type FeeInfo as aA, type CreateContractParams as aB, type GetContractsFilter as aC, type GetSpendablePathsOptions as aD, type GetAllSpendingPathsOptions as aE, type IssuanceParams as aF, type ReissuanceParams as aG, type BurnParams as aH, type RenewVtxosOptions as aI, type PathSelection as aJ, type ContractEvent as aK, type AssetDetails as aL, type IssuanceResult as aM, type DelegateInfo as aN, type MigrationGlobalSkipReason as aO, type MigrationLegSkipReason as aP, type SignerStatus as aQ, type StorageConfig as aR, type IVtxoManager as aS, type ExplorerTransaction as aT, type TreeNonces as aU, type TreePartialSigs as aV, type PendingTx as aW, type EncodedVtxoScript as aX, type Status as aY, type ChainTx as aZ, type PathContext as a_, type IReadonlyAssetManager as aa, type ContractSyncState as ab, type RecipientAddressContext as ac, type NetworkName as ad, type ArkInfo as ae, ArkAddress as af, type ContractWithVtxos as ag, selectPendingRecoveryOutpoints as ah, type Coin as ai, ContractManager as aj, type ContractManagerConfig as ak, type SettlementConfig as al, VtxoManager as am, type SignerSession as an, type SignedIntent as ao, Intent as ap, type TimeHeight as aq, type DescriptorSigningRequest as ar, Transaction as as, type IntentFeeConfig as at, type OffchainInput as au, FeeAmount as av, type OnchainInput as aw, type FeeOutput as ax, type ContractWatcherConfig as ay, type Asset as az, type WalletConfig as b, RestDelegatorProvider as b$, type ActivityResolver as b0, type ArkIntentState as b1, type ArkTapscript as b2, type AssetMetadata as b3, BITCOIN_EMULATOR_PUBKEY as b4, type BaseWalletConfig as b5, type BatchInfo as b6, type BatchSignableIdentity as b7, CLTVMultisigTapscript as b8, type CandidateDeps as b9, EventSourceUnavailableError as bA, type ExitChainResolver as bB, type ExtendedContractVtxo as bC, type GroupMembership as bD, type HandlerError as bE, type IDelegatorManager as bF, INTENT_TERMINAL_STATES as bG, IndexerTxType as bH, type IntentCoin as bI, type KnownMetadata as bJ, MUTINYNET_EMULATOR_PUBKEY as bK, type MigrateDeprecatedSignerOptions as bL, type MigrationLegReport as bM, type MigrationVtxoRef as bN, MultisigTapscript as bO, type NewAddressType as bP, type Nonces as bQ, type Output as bR, type PageResponse as bS, type PaginationOptions as bT, PartialSig as bU, type PrevTxSource as bV, PrevTxUnavailableError as bW, type ProviderClass as bX, REGTEST_EMULATOR_PUBKEY as bY, type RawTxSource as bZ, RestDelegateProvider as b_, ChainTxType as ba, type CommitmentTx as bb, ConditionCSVMultisigTapscript as bc, ConditionMultisigTapscript as bd, type ContractBalance as be, type ContractEventCallback as bf, type ContractHandler as bg, type ContractState as bh, type ContractVtxo as bi, ContractWatcher as bj, DEFAULT_VTXO_PAGE_SIZE as bk, DelegateManagerImpl as bl, type DelegateOptions as bm, DelegatorManagerImpl as bn, type DelegatorProvider as bo, type DeprecatedSignerMigrationReport as bp, type DeprecatedSignerReport as bq, DigestMismatchError as br, type Discoverable as bs, type DiscoveredContract as bt, type DiscoveryDeps as bu, ESPLORA_URL as bv, EsploraProvider as bw, type EventSourceCapable as bx, type EventSourceFactory as by, type EventSourceLike as bz, type WalletBalance as c, resolvePrevTxs as c$, type ScanContractsOptions as c0, type ScanResult as c1, type ScheduledSession as c2, SettlementEventType as c3, type SignRequest as c4, type SignerClassification as c5, type SignerSet as c6, type SubscriptionEvent as c7, type SubscriptionHeartbeat as c8, type SweepTxNotification as c9, configureEventSource as cA, createDefaultActivityRegistry as cB, createExitChainResolver as cC, decodeTapscript as cD, defaultEmulatorPubkey as cE, getConfiguredEventSource as cF, getNetwork as cG, getRandomId as cH, getSequence as cI, hasCandidates as cJ, hasTerminalSpend as cK, isBatchSignable as cL, isCooperativelyMigratable as cM, isDiscoverable as cN, isEventSourceUnavailableError as cO, isExpired as cP, isPastExpiry as cQ, isRecoverable as cR, isSigningIdentity as cS, isSpendable as cT, isSubdust as cU, isTerminalIntentState as cV, isVirtualCoin as cW, isVtxoExpiringSoon as cX, networks as cY, resolveEmulatorPubkey as cZ, resolveEventSource as c_, type TapLeaves as ca, TapTreeCoder as cb, TapscriptType as cc, type Tx as cd, type TxHistoryRecord as ce, type TxKey as cf, type TxNotification as cg, type TxTag as ch, type TxTreeNode as ci, TxType as cj, type VirtualStatus as ck, type Vtxo as cl, type VtxoChain as cm, type VtxoType as cn, type WalletMode as co, type WithPrevTx as cp, assetMintResolver as cq, attachPrevArkTxs as cr, attachPrevoutTxs as cs, boardingResolver as ct, canRecoverOnchain as cu, canSpendOffchain as cv, canSweepOnchain as cw, classifyAgainstSignerSet as cx, classifyContractSigner as cy, collabExitResolver as cz, ActivityRegistry as d, scriptFromTapLeafScript as d0, signerSetFromInfo as d1, toXOnlySignerHex as d2, withPrevTxs as d3, type TapscriptDeriving as d4, type Activity as e, type IContractManager as f, type GetNewAddressesOptions as g, type NewAddress as h, type IDelegateManager as i, type SettleParams as j, type SettlementEvent as k, type SendParams as l, type IAssetManager as m, RestArkProvider as n, RestIndexerProvider as o, type SubscriptionResponse as p, type ArkProvider as q, type IndexerProvider as r, type RelativeTimelock as s, type TapLeafScript as t, type VirtualCoin as u, type Contract as v, type ExtendedVirtualCoin as w, type VtxoRepositoryKey as x, type WalletState as y, type ContractFilter as z };
|