@arkade-os/sdk 0.4.69 → 0.5.0-rc.1
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 +35 -5
- 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/{asyncStorageTaskQueue-BgUJN-3X.d.ts → asyncStorageTaskQueue-DAs_n1xr.d.ts} +2 -2
- package/dist/{asyncStorageTaskQueue-Cstx6hS7.d.cts → asyncStorageTaskQueue-DqGRG66E.d.cts} +2 -2
- package/dist/{chunk-L5SCQYHF.js → chunk-6COJWPBO.js} +19 -9
- package/dist/chunk-6COJWPBO.js.map +1 -0
- package/dist/{chunk-XQPN5YP2.cjs → chunk-KB7OP3FG.cjs} +17 -17
- package/dist/{chunk-XQPN5YP2.cjs.map → chunk-KB7OP3FG.cjs.map} +1 -1
- package/dist/{chunk-XLWDX7QZ.js → chunk-LPK4UBNJ.js} +4 -4
- package/dist/{chunk-XLWDX7QZ.js.map → chunk-LPK4UBNJ.js.map} +1 -1
- package/dist/{chunk-MNMPGEK2.js → chunk-MEJSBJVH.js} +4 -4
- package/dist/{chunk-MNMPGEK2.js.map → chunk-MEJSBJVH.js.map} +1 -1
- package/dist/{chunk-HQ4DMGA4.cjs → chunk-MXY23OPP.cjs} +10 -10
- package/dist/{chunk-HQ4DMGA4.cjs.map → chunk-MXY23OPP.cjs.map} +1 -1
- package/dist/{chunk-WIFL5QYZ.cjs → chunk-Q5WQ4Y2I.cjs} +53 -54
- package/dist/chunk-Q5WQ4Y2I.cjs.map +1 -0
- package/dist/{chunk-5MLC2HU3.cjs → chunk-RZ2NGS6A.cjs} +19 -7
- package/dist/chunk-RZ2NGS6A.cjs.map +1 -0
- package/dist/{chunk-YG7T6LI3.js → chunk-SG4XYCS7.js} +3 -3
- package/dist/{chunk-YG7T6LI3.js.map → chunk-SG4XYCS7.js.map} +1 -1
- package/dist/{chunk-TA7XLEP2.js → chunk-VTE3NYVD.js} +298 -41
- package/dist/chunk-VTE3NYVD.js.map +1 -0
- package/dist/{chunk-GVHUHTRH.cjs → chunk-WQIWUTYS.cjs} +17 -17
- package/dist/{chunk-GVHUHTRH.cjs.map → chunk-WQIWUTYS.cjs.map} +1 -1
- package/dist/{chunk-EBYCTLET.cjs → chunk-YEUXBECG.cjs} +727 -469
- package/dist/chunk-YEUXBECG.cjs.map +1 -0
- package/dist/{chunk-2PPL3O7Z.js → chunk-ZPSUBAWQ.js} +7 -8
- package/dist/chunk-ZPSUBAWQ.js.map +1 -0
- 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-BPdzTbwN.d.ts → delegate-B9Bmrns7.d.ts} +1 -1
- package/dist/{delegate-DrwIar11.d.cts → delegate-CZzIduW4.d.cts} +1 -1
- package/dist/{hdWalletCapable-D4WH35z0.d.cts → hdWalletCapable-BIl3yLVM.d.cts} +103 -28
- package/dist/{hdWalletCapable-DyxCiNVE.d.ts → hdWalletCapable-Cr5nGpK5.d.ts} +103 -28
- package/dist/{index-TZJvbIaA.d.ts → index-Ci5MmNnK.d.cts} +7 -7
- package/dist/{index-BqhpAqqj.d.cts → index-DQ1Hb2w_.d.ts} +7 -7
- package/dist/{index-dWRqYSdS.d.ts → index-DnNIOqHS.d.cts} +168 -19
- package/dist/{index-dWRqYSdS.d.cts → index-DnNIOqHS.d.ts} +168 -19
- package/dist/index.cjs +307 -291
- package/dist/index.d.cts +121 -29
- package/dist/index.d.ts +121 -29
- 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-CzYKyJ9c.d.cts → taskRunner-BDb5Ee2J.d.cts} +2 -2
- package/dist/{taskRunner-D2fnbqYw.d.ts → taskRunner-F7wNJcF3.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 +23 -14
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +7 -4
- package/dist/wallet/expo/index.d.ts +7 -4
- package/dist/wallet/expo/index.js +14 -5
- 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 -2
- package/dist/chunk-2PPL3O7Z.js.map +0 -1
- package/dist/chunk-5MLC2HU3.cjs.map +0 -1
- package/dist/chunk-EBYCTLET.cjs.map +0 -1
- package/dist/chunk-L5SCQYHF.js.map +0 -1
- package/dist/chunk-TA7XLEP2.js.map +0 -1
- package/dist/chunk-WIFL5QYZ.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-
|
|
1
|
+
import { cL as ContractHandler, w as RelativeTimelock, cN as Discoverable, V as VtxoScript, x as TapLeafScript, df as TapscriptDeriving } from './index-DnNIOqHS.cjs';
|
|
2
|
+
import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-CZzIduW4.cjs';
|
|
3
3
|
import { Bytes } from '@scure/btc-signer/utils.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -482,7 +482,7 @@ interface VHTLCV2ContractParams {
|
|
|
482
482
|
/**
|
|
483
483
|
* Handler for {@link VHTLC.ScriptV2} — the VHTLC whose preimage leaves carry an
|
|
484
484
|
* explicit `OP_SIZE 32 OP_EQUALVERIFY` before the hash check, and which the RFQ
|
|
485
|
-
* swap corridor builds (`@arkade-os/swap`'s `
|
|
485
|
+
* swap corridor builds (`@arkade-os/swap`'s `lightningSendContract`).
|
|
486
486
|
*
|
|
487
487
|
* **Why a separate type string rather than a flag on `vhtlc`.** A handler's
|
|
488
488
|
* `type` names the script class it derives, the way every other registered type
|
|
@@ -541,7 +541,7 @@ declare const VHTLCV2ContractHandler: ContractHandler<VHTLCV2ContractParams, VHT
|
|
|
541
541
|
* (`pubKey` / `serverPubKey` / `csvTimelock`) rather than inventing
|
|
542
542
|
* boarding-specific names — the boarding semantics come from the
|
|
543
543
|
* contract type and from populating `csvTimelock` with the server's
|
|
544
|
-
* boarding-exit delay (`
|
|
544
|
+
* boarding-exit delay (`ArkadeInfo.boardingExitDelay`) instead of the
|
|
545
545
|
* offchain unilateral-exit delay.
|
|
546
546
|
*/
|
|
547
547
|
type BoardingContractParams = DefaultContractParams;
|
|
@@ -557,8 +557,8 @@ type BoardingContractParams = DefaultContractParams;
|
|
|
557
557
|
*
|
|
558
558
|
* Boarding semantics come entirely from the contract type and from
|
|
559
559
|
* sourcing the CSV timelock from the server's boarding-exit delay
|
|
560
|
-
* (`
|
|
561
|
-
* offchain `default` contract is built from `
|
|
560
|
+
* (`ArkadeInfo.boardingExitDelay`), not from renamed parameters. The
|
|
561
|
+
* offchain `default` contract is built from `ArkadeInfo.unilateralExitDelay`
|
|
562
562
|
* instead, so the two share a script shape but differ in their CSV
|
|
563
563
|
* timelock value. Parameters round-trip through the same
|
|
564
564
|
* `timelockToSequence` / `sequenceToTimelock` helpers and BIP68 sequence
|
|
@@ -847,4 +847,4 @@ declare function deserializeArkadeContractParams(params: Record<string, string>)
|
|
|
847
847
|
*/
|
|
848
848
|
declare const ArkadeContractHandler: ContractHandler<ArkadeContractParams, ArkadeProgramScript> & TapscriptDeriving<ArkadeProgramScript>;
|
|
849
849
|
|
|
850
|
-
export { type ArkadeParamValue as A, BoardingContractHandler as B, type CompiledProgramFunction as C, DefaultContractHandler as D, type VHTLCV2ContractParams as E,
|
|
850
|
+
export { type ArkadeParamValue as A, BoardingContractHandler as B, type CompiledProgramFunction as C, DefaultContractHandler as D, type VHTLCV2ContractParams as E, type BoardingContractParams as F, type InputRef as I, type Program as P, SUPPORTED_PROGRAM_VERSION as S, type TapscriptSegment as T, VHTLC as V, type WitnessRef as W, ArkadeProgramScript as a, type ProgramKeys as b, type ArkadeArgValue as c, type ArkadeFunction as d, type InputDef as e, type ArkadeValueType as f, type ArkadeArgType as g, type ArkadeContractParams as h, type ArkadeSegment as i, type AsmToken as j, type SignerRef as k, deserializeArkadeContractParams as l, stringifyArtifact as m, contractHandlers as n, DelegateContractHandler as o, parseArtifact as p, VHTLCContractHandler as q, resolveAsm as r, serializeArkadeContractParams as s, VHTLCV2ContractHandler as t, ArkadeContractHandler as u, validateProgram as v, witnessRefToBytes as w, type DefaultContractParams as x, type DelegateContractParams as y, type VHTLCContractParams as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-
|
|
1
|
+
import { cL as ContractHandler, w as RelativeTimelock, cN as Discoverable, V as VtxoScript, x as TapLeafScript, df as TapscriptDeriving } from './index-DnNIOqHS.js';
|
|
2
|
+
import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-B9Bmrns7.js';
|
|
3
3
|
import { Bytes } from '@scure/btc-signer/utils.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -482,7 +482,7 @@ interface VHTLCV2ContractParams {
|
|
|
482
482
|
/**
|
|
483
483
|
* Handler for {@link VHTLC.ScriptV2} — the VHTLC whose preimage leaves carry an
|
|
484
484
|
* explicit `OP_SIZE 32 OP_EQUALVERIFY` before the hash check, and which the RFQ
|
|
485
|
-
* swap corridor builds (`@arkade-os/swap`'s `
|
|
485
|
+
* swap corridor builds (`@arkade-os/swap`'s `lightningSendContract`).
|
|
486
486
|
*
|
|
487
487
|
* **Why a separate type string rather than a flag on `vhtlc`.** A handler's
|
|
488
488
|
* `type` names the script class it derives, the way every other registered type
|
|
@@ -541,7 +541,7 @@ declare const VHTLCV2ContractHandler: ContractHandler<VHTLCV2ContractParams, VHT
|
|
|
541
541
|
* (`pubKey` / `serverPubKey` / `csvTimelock`) rather than inventing
|
|
542
542
|
* boarding-specific names — the boarding semantics come from the
|
|
543
543
|
* contract type and from populating `csvTimelock` with the server's
|
|
544
|
-
* boarding-exit delay (`
|
|
544
|
+
* boarding-exit delay (`ArkadeInfo.boardingExitDelay`) instead of the
|
|
545
545
|
* offchain unilateral-exit delay.
|
|
546
546
|
*/
|
|
547
547
|
type BoardingContractParams = DefaultContractParams;
|
|
@@ -557,8 +557,8 @@ type BoardingContractParams = DefaultContractParams;
|
|
|
557
557
|
*
|
|
558
558
|
* Boarding semantics come entirely from the contract type and from
|
|
559
559
|
* sourcing the CSV timelock from the server's boarding-exit delay
|
|
560
|
-
* (`
|
|
561
|
-
* offchain `default` contract is built from `
|
|
560
|
+
* (`ArkadeInfo.boardingExitDelay`), not from renamed parameters. The
|
|
561
|
+
* offchain `default` contract is built from `ArkadeInfo.unilateralExitDelay`
|
|
562
562
|
* instead, so the two share a script shape but differ in their CSV
|
|
563
563
|
* timelock value. Parameters round-trip through the same
|
|
564
564
|
* `timelockToSequence` / `sequenceToTimelock` helpers and BIP68 sequence
|
|
@@ -847,4 +847,4 @@ declare function deserializeArkadeContractParams(params: Record<string, string>)
|
|
|
847
847
|
*/
|
|
848
848
|
declare const ArkadeContractHandler: ContractHandler<ArkadeContractParams, ArkadeProgramScript> & TapscriptDeriving<ArkadeProgramScript>;
|
|
849
849
|
|
|
850
|
-
export { type ArkadeParamValue as A, BoardingContractHandler as B, type CompiledProgramFunction as C, DefaultContractHandler as D, type VHTLCV2ContractParams as E,
|
|
850
|
+
export { type ArkadeParamValue as A, BoardingContractHandler as B, type CompiledProgramFunction as C, DefaultContractHandler as D, type VHTLCV2ContractParams as E, type BoardingContractParams as F, type InputRef as I, type Program as P, SUPPORTED_PROGRAM_VERSION as S, type TapscriptSegment as T, VHTLC as V, type WitnessRef as W, ArkadeProgramScript as a, type ProgramKeys as b, type ArkadeArgValue as c, type ArkadeFunction as d, type InputDef as e, type ArkadeValueType as f, type ArkadeArgType as g, type ArkadeContractParams as h, type ArkadeSegment as i, type AsmToken as j, type SignerRef as k, deserializeArkadeContractParams as l, stringifyArtifact as m, contractHandlers as n, DelegateContractHandler as o, parseArtifact as p, VHTLCContractHandler as q, resolveAsm as r, serializeArkadeContractParams as s, VHTLCV2ContractHandler as t, ArkadeContractHandler as u, validateProgram as v, witnessRefToBytes as w, type DefaultContractParams as x, type DelegateContractParams as y, type VHTLCContractParams as z };
|
|
@@ -912,7 +912,20 @@ interface DeprecatedSigner {
|
|
|
912
912
|
pubkey: string;
|
|
913
913
|
}
|
|
914
914
|
type ServiceStatus = Record<string, string>;
|
|
915
|
-
|
|
915
|
+
/**
|
|
916
|
+
* The Arkade server's advertised configuration — the `/v1/info` response.
|
|
917
|
+
*
|
|
918
|
+
* Naming/placement vs the NArk reference (AGENTS.md asks divergences to be
|
|
919
|
+
* noted): NArk calls this `ArkServerInfo`, reads it via `GetServerInfoAsync`
|
|
920
|
+
* on the *transport*, and caches it in a dedicated `CachingClientTransport`.
|
|
921
|
+
* This SDK names it for the product (`ArkadeInfo`, per #734) and hangs the
|
|
922
|
+
* read off the wallet (`getArkadeInfo()`), because here the wallet is the one
|
|
923
|
+
* object every consumer already holds and — in the service-worker model — the
|
|
924
|
+
* only side that has a transport at all; the page has no provider to hang it
|
|
925
|
+
* on. The `CachingClientTransport`-style memo lives at this layer instead, as
|
|
926
|
+
* `CachingArkProvider`.
|
|
927
|
+
*/
|
|
928
|
+
interface ArkadeInfo {
|
|
916
929
|
boardingExitDelay: bigint;
|
|
917
930
|
checkpointTapscript: string;
|
|
918
931
|
deprecatedSigners: DeprecatedSigner[];
|
|
@@ -968,6 +981,8 @@ interface ArkInfo {
|
|
|
968
981
|
vtxoMaxAmount: bigint;
|
|
969
982
|
vtxoMinAmount: bigint;
|
|
970
983
|
}
|
|
984
|
+
/** @deprecated alias for @see ArkadeInfo */
|
|
985
|
+
type ArkInfo = ArkadeInfo;
|
|
971
986
|
/** Signed intent payload sent to the Arkade server. */
|
|
972
987
|
interface SignedIntent<T extends Intent.Message> {
|
|
973
988
|
/** Base64-encoded signed proof transaction. */
|
|
@@ -1015,7 +1030,7 @@ interface TxNotificationEvent {
|
|
|
1015
1030
|
}
|
|
1016
1031
|
interface ArkProvider {
|
|
1017
1032
|
/** Fetch Arkade server configuration and fee settings. */
|
|
1018
|
-
getInfo(): Promise<
|
|
1033
|
+
getInfo(): Promise<ArkadeInfo>;
|
|
1019
1034
|
/** Submit a signed Arkade transaction and its checkpoint transactions. */
|
|
1020
1035
|
submitTx(signedArkTx: string, checkpointTxs: string[]): Promise<{
|
|
1021
1036
|
arkTxid: string;
|
|
@@ -1059,8 +1074,9 @@ declare class RestArkProvider implements ArkProvider {
|
|
|
1059
1074
|
protected readonly eventSource?: EventSourceFactory;
|
|
1060
1075
|
constructor(serverUrl?: string, options?: EventSourceCapable);
|
|
1061
1076
|
/**
|
|
1062
|
-
* Last server-info digest seen from {@link getInfo}. Sent as `X-Digest`
|
|
1063
|
-
* so arkd can reject
|
|
1077
|
+
* Last server-info digest seen (from {@link getInfo}). Sent as `X-Digest`
|
|
1078
|
+
* on outgoing requests so arkd can reject a client whose cached info is
|
|
1079
|
+
* stale. Empty until the first {@link getInfo}.
|
|
1064
1080
|
*/
|
|
1065
1081
|
private _digest;
|
|
1066
1082
|
private _hasServerInfo;
|
|
@@ -1071,7 +1087,7 @@ declare class RestArkProvider implements ArkProvider {
|
|
|
1071
1087
|
* `DIGEST_MISMATCH` refresh or when {@link getInfo} observes a changed digest.
|
|
1072
1088
|
* Returns an unsubscribe function.
|
|
1073
1089
|
*/
|
|
1074
|
-
onServerInfoChanged(listener: (info:
|
|
1090
|
+
onServerInfoChanged(listener: (info: ArkadeInfo) => void): () => void;
|
|
1075
1091
|
private emitServerInfoChanged;
|
|
1076
1092
|
/**
|
|
1077
1093
|
* `fetch` wrapper for arkd requests that participates in server-info digest
|
|
@@ -1084,7 +1100,7 @@ declare class RestArkProvider implements ArkProvider {
|
|
|
1084
1100
|
* routes through here: it is the refresh path and must not be digest-gated.
|
|
1085
1101
|
*/
|
|
1086
1102
|
private authedFetch;
|
|
1087
|
-
getInfo(): Promise<
|
|
1103
|
+
getInfo(): Promise<ArkadeInfo>;
|
|
1088
1104
|
submitTx(signedArkTx: string, checkpointTxs: string[]): Promise<{
|
|
1089
1105
|
arkTxid: string;
|
|
1090
1106
|
finalArkTx: string;
|
|
@@ -1605,6 +1621,21 @@ interface Network {
|
|
|
1605
1621
|
name?: NetworkName;
|
|
1606
1622
|
}
|
|
1607
1623
|
declare const getNetwork: (network: NetworkName) => Network;
|
|
1624
|
+
/**
|
|
1625
|
+
* The {@link Network} an Arkade server's info names.
|
|
1626
|
+
*
|
|
1627
|
+
* `ArkadeInfo.network` is a plain string on the wire, so every consumer that
|
|
1628
|
+
* wanted a `Network` from it was writing the same unchecked narrowing. This
|
|
1629
|
+
* owns it once: {@link getNetwork} fails closed on a name it does not know, so
|
|
1630
|
+
* an unrecognized server network throws here rather than silently resolving to
|
|
1631
|
+
* mainnet parameters downstream.
|
|
1632
|
+
*
|
|
1633
|
+
* Structurally typed rather than importing `ArkadeInfo`, which would make the
|
|
1634
|
+
* network table depend on the provider layer.
|
|
1635
|
+
*/
|
|
1636
|
+
declare const networkFromArkadeInfo: (info: {
|
|
1637
|
+
network: string;
|
|
1638
|
+
}) => Network;
|
|
1608
1639
|
declare const networks: {
|
|
1609
1640
|
bitcoin: Network;
|
|
1610
1641
|
testnet: Network;
|
|
@@ -1922,6 +1953,29 @@ type NormalizedVirtualCoin = Omit<VirtualCoin, "isSwept" | "isPreconfirmed" | "i
|
|
|
1922
1953
|
commitmentTxIds: string[];
|
|
1923
1954
|
};
|
|
1924
1955
|
type NormalizedExtendedVirtualCoin = ExtendedVirtualCoin & NormalizedVirtualCoin;
|
|
1956
|
+
/** What a normalized VTXO read answers with. @see getNormalizedVtxos */
|
|
1957
|
+
type NormalizedVtxoPage = {
|
|
1958
|
+
vtxos: NormalizedVirtualCoin[];
|
|
1959
|
+
page?: PageResponse;
|
|
1960
|
+
};
|
|
1961
|
+
/**
|
|
1962
|
+
* The only sanctioned way for SDK logic to read VTXOs from an `IndexerProvider`: a drop-in for
|
|
1963
|
+
* `provider.getVtxos()` that normalizes whatever came back. A cheap pass-through for the built-in
|
|
1964
|
+
* providers, which already populate the facts.
|
|
1965
|
+
*/
|
|
1966
|
+
declare function getNormalizedVtxos(provider: Pick<IndexerProvider, "getVtxos">, opts?: GetVtxosOptions): Promise<NormalizedVtxoPage>;
|
|
1967
|
+
/** Everything a script query can filter on, minus the cursor this reader owns. */
|
|
1968
|
+
type VtxoScriptQuery = Omit<GetVtxosOptions, "scripts" | "outpoints" | "pageIndex">;
|
|
1969
|
+
/**
|
|
1970
|
+
* Read every virtual output for an arbitrary number of scripts.
|
|
1971
|
+
*
|
|
1972
|
+
* @remarks
|
|
1973
|
+
* Scripts travel in the query string, so a wallet-derived list must be chunked
|
|
1974
|
+
* at {@link SCRIPT_QUERY_CHUNK_SIZE} or the request `414`s. Chunks run
|
|
1975
|
+
* sequentially — that pacing is the point, since this path can now run wide —
|
|
1976
|
+
* and each is paged to exhaustion, so callers cannot silently receive page one.
|
|
1977
|
+
*/
|
|
1978
|
+
declare function getAllNormalizedVtxos(provider: Pick<IndexerProvider, "getVtxos">, scripts: string[], opts?: VtxoScriptQuery): Promise<NormalizedVirtualCoin[]>;
|
|
1925
1979
|
/**
|
|
1926
1980
|
* Whether a virtual output has been consumed and can never be spent again.
|
|
1927
1981
|
*
|
|
@@ -2014,7 +2068,7 @@ declare function isExpired(vtxo: VirtualCoin): boolean;
|
|
|
2014
2068
|
|
|
2015
2069
|
/**
|
|
2016
2070
|
* Machine-readable classification of a contract's server signer relative to a
|
|
2017
|
-
* fresh {@link
|
|
2071
|
+
* fresh {@link ArkadeInfo} snapshot. Drives both the migration selection (Section
|
|
2018
2072
|
* 3) and the user-facing cutoff reporting (Section 6) without persisting any
|
|
2019
2073
|
* stale-key metadata: staleness is always derived at read time from the
|
|
2020
2074
|
* contract's `params.serverPubKey` plus the server's advertised signer set.
|
|
@@ -2038,7 +2092,7 @@ declare function isExpired(vtxo: VirtualCoin): boolean;
|
|
|
2038
2092
|
type SignerStatus = "CURRENT" | "MIGRATABLE" | "DUE_NOW" | "EXPIRED" | "UNKNOWN_SIGNER";
|
|
2039
2093
|
/**
|
|
2040
2094
|
* Result of classifying a single contract's server signer against the current
|
|
2041
|
-
* {@link
|
|
2095
|
+
* {@link ArkadeInfo} signer set.
|
|
2042
2096
|
*/
|
|
2043
2097
|
interface SignerClassification {
|
|
2044
2098
|
status: SignerStatus;
|
|
@@ -2059,7 +2113,7 @@ interface SignerClassification {
|
|
|
2059
2113
|
/**
|
|
2060
2114
|
* The server's signer set, pre-normalized to x-only hex for cheap repeated
|
|
2061
2115
|
* lookups. Built once per migration/reporting pass from a fresh
|
|
2062
|
-
* {@link
|
|
2116
|
+
* {@link ArkadeInfo} snapshot via {@link signerSetFromInfo}.
|
|
2063
2117
|
*/
|
|
2064
2118
|
interface SignerSet {
|
|
2065
2119
|
/** Active signer, x-only (32-byte) hex. */
|
|
@@ -2087,7 +2141,7 @@ declare function toXOnlySignerHex(pubkeyHex: string): string;
|
|
|
2087
2141
|
* Build the {@link SignerSet} from a server-info snapshot. Deprecated signers
|
|
2088
2142
|
* with an empty pubkey are skipped.
|
|
2089
2143
|
*/
|
|
2090
|
-
declare function signerSetFromInfo(info:
|
|
2144
|
+
declare function signerSetFromInfo(info: ArkadeInfo): SignerSet;
|
|
2091
2145
|
/**
|
|
2092
2146
|
* Classify a contract's server signer against a pre-built {@link SignerSet}.
|
|
2093
2147
|
*
|
|
@@ -2098,11 +2152,11 @@ declare function signerSetFromInfo(info: ArkInfo): SignerSet;
|
|
|
2098
2152
|
*/
|
|
2099
2153
|
declare function classifyAgainstSignerSet(contractServerPubKeyHex: string, signerSet: SignerSet, nowSeconds?: number): SignerClassification;
|
|
2100
2154
|
/**
|
|
2101
|
-
* Convenience wrapper that builds the signer set from {@link
|
|
2155
|
+
* Convenience wrapper that builds the signer set from {@link ArkadeInfo} and
|
|
2102
2156
|
* classifies a single contract signer. Prefer {@link classifyAgainstSignerSet}
|
|
2103
2157
|
* with a shared signer set when classifying many contracts in one pass.
|
|
2104
2158
|
*/
|
|
2105
|
-
declare function classifyContractSigner(contractServerPubKeyHex: string, info:
|
|
2159
|
+
declare function classifyContractSigner(contractServerPubKeyHex: string, info: ArkadeInfo, nowSeconds?: number): SignerClassification;
|
|
2106
2160
|
/**
|
|
2107
2161
|
* Whether a signer status admits cooperative migration (i.e. a `settle()`
|
|
2108
2162
|
* intent should be built for VTXOs under this signer). True for `MIGRATABLE`
|
|
@@ -2290,7 +2344,7 @@ interface MigrationVtxoRef {
|
|
|
2290
2344
|
/**
|
|
2291
2345
|
* Machine-readable status for a single deprecated signer the wallet holds
|
|
2292
2346
|
* funds under (Section 6). Derived at read time from contract params plus a
|
|
2293
|
-
* fresh {@link
|
|
2347
|
+
* fresh {@link ArkadeInfo} snapshot — never persisted.
|
|
2294
2348
|
*/
|
|
2295
2349
|
interface DeprecatedSignerReport {
|
|
2296
2350
|
/** Deprecated signer key (x-only hex). */
|
|
@@ -2769,7 +2823,7 @@ declare class VtxoManager implements AsyncDisposable, IVtxoManager {
|
|
|
2769
2823
|
getDeprecatedSignerStatus(): Promise<DeprecatedSignerReport[]>;
|
|
2770
2824
|
/**
|
|
2771
2825
|
* Core migration routine shared by the manual API and the automatic poll
|
|
2772
|
-
* pass. Fetches a fresh {@link
|
|
2826
|
+
* pass. Fetches a fresh {@link ArkadeInfo}, applies a mid-session signer
|
|
2773
2827
|
* rotation when the wallet's own snapshot signer has been deprecated,
|
|
2774
2828
|
* selects spendable VTXOs under deprecated-signer contracts (cutoff-first),
|
|
2775
2829
|
* and settles them to the active-signer Ark address.
|
|
@@ -3470,10 +3524,15 @@ declare function getRandomId(): string;
|
|
|
3470
3524
|
* belongs to another network or operator, so this wallet's operator cannot
|
|
3471
3525
|
* create the VTXO where the recipient's wallet expects it.
|
|
3472
3526
|
*/
|
|
3473
|
-
type
|
|
3527
|
+
type RecipientArkadeAddressContext = {
|
|
3474
3528
|
hrp: string;
|
|
3475
3529
|
signerSet: SignerSet;
|
|
3476
3530
|
};
|
|
3531
|
+
/**
|
|
3532
|
+
* The embedded server key may be the current signer or a deprecated signer
|
|
3533
|
+
* whose rotation cutoff has not passed.
|
|
3534
|
+
*/
|
|
3535
|
+
declare function assertRecipientArkadeAddress(encoded: string, address: ArkAddress, context: RecipientArkadeAddressContext): void;
|
|
3477
3536
|
|
|
3478
3537
|
/**
|
|
3479
3538
|
* An input for {@link IContractManager.assertSpendableNow}.
|
|
@@ -4724,8 +4783,8 @@ interface DiscoveredContract {
|
|
|
4724
4783
|
}
|
|
4725
4784
|
/**
|
|
4726
4785
|
* Read-only context the scanner injects into every `discoverAt` call.
|
|
4727
|
-
*
|
|
4728
|
-
*
|
|
4786
|
+
* A handler needing an external service client closes over it at
|
|
4787
|
+
* registration time; this context never carries one.
|
|
4729
4788
|
*/
|
|
4730
4789
|
interface DiscoveryDeps {
|
|
4731
4790
|
indexerProvider: IndexerProvider;
|
|
@@ -5289,7 +5348,7 @@ interface BaseWalletConfig {
|
|
|
5289
5348
|
*/
|
|
5290
5349
|
minBatchExpirySeconds?: bigint;
|
|
5291
5350
|
/**
|
|
5292
|
-
* Minimum accepted checkpoint exit delay decoded from `
|
|
5351
|
+
* Minimum accepted checkpoint exit delay decoded from `ArkadeInfo.checkpointTapscript`,
|
|
5293
5352
|
* as wall-clock seconds. Defaults per network — see
|
|
5294
5353
|
* `defaultCheckpointExitDelayPolicy`, which already carries the value the
|
|
5295
5354
|
* hosted signet and mutinynet Arkade Services advertise, so neither needs
|
|
@@ -6095,6 +6154,59 @@ interface IAssetManager extends IReadonlyAssetManager {
|
|
|
6095
6154
|
*/
|
|
6096
6155
|
burn(params: BurnParams): Promise<string>;
|
|
6097
6156
|
}
|
|
6157
|
+
/** Options for {@link IReadonlyWallet.getArkadeInfo}. */
|
|
6158
|
+
type GetArkadeInfoOptions = {
|
|
6159
|
+
/** Throw when the operator is unreachable instead of answering from the
|
|
6160
|
+
* persisted snapshot — for callers binding the answer into a covenant. */
|
|
6161
|
+
requireLive?: boolean;
|
|
6162
|
+
};
|
|
6163
|
+
/**
|
|
6164
|
+
* Chain reads a caller needs beyond its own wallet's VTXOs: an arbitrary
|
|
6165
|
+
* script's virtual outputs, and the transactions that spent them.
|
|
6166
|
+
*
|
|
6167
|
+
* Shaped as {@link getNormalizedVtxos} rather than as `IndexerProvider`, for
|
|
6168
|
+
* two reasons. Every VTXO leaving this seam carries its canonical facts —
|
|
6169
|
+
* the guarantee `scripts/check-provider-boundary.mjs` enforces inside the SDK
|
|
6170
|
+
* and that a plugin holding a raw provider could otherwise skip. And because
|
|
6171
|
+
* `NormalizedVirtualCoin` is assignable to `VirtualCoin`, an `ArkadeReader`
|
|
6172
|
+
* satisfies `Pick<IndexerProvider, "getVtxos" | "getVirtualTxs">` structurally,
|
|
6173
|
+
* so existing narrow seams accept one unchanged. Passing a reader to something
|
|
6174
|
+
* that normalizes again — `getNormalizedVtxos`, `Arkade.connect`'s `indexer` —
|
|
6175
|
+
* is harmless: `normalizeVtxo` is idempotent. Do not "fix" that by stripping
|
|
6176
|
+
* the normalization here; it is the whole point of the seam.
|
|
6177
|
+
*
|
|
6178
|
+
* Deliberately not the whole provider: a caller that could reach
|
|
6179
|
+
* `getVtxoChain` or `getSubscription` through the wallet would be talking to
|
|
6180
|
+
* the server behind the wallet's back, which the service-worker wallet cannot
|
|
6181
|
+
* even express.
|
|
6182
|
+
*/
|
|
6183
|
+
type ArkadeReader = Pick<IndexerProvider, "getVirtualTxs"> & {
|
|
6184
|
+
/**
|
|
6185
|
+
* Required `opts`, unlike the `IndexerProvider` method it mirrors: this
|
|
6186
|
+
* seam reads for *named* foreign scripts (or outpoints). The type stops a
|
|
6187
|
+
* bare `getVtxos()` at compile time; the runtime defence is the provider's
|
|
6188
|
+
* own "Either scripts or outpoints must be provided" throw — the message
|
|
6189
|
+
* boundary adds no validation of its own.
|
|
6190
|
+
*
|
|
6191
|
+
* One logical query — the reader chunks nothing. `scripts` travel in the
|
|
6192
|
+
* query string, so a wide list can `414`; {@link getAllNormalizedVtxos}
|
|
6193
|
+
* accepts a reader and chunks and pages to exhaustion. Whether a single
|
|
6194
|
+
* call pages internally is the provider's business: when a `page` comes
|
|
6195
|
+
* back, following it is yours.
|
|
6196
|
+
*
|
|
6197
|
+
* @see getNormalizedVtxos
|
|
6198
|
+
*/
|
|
6199
|
+
getVtxos(opts: GetVtxosOptions): Promise<NormalizedVtxoPage>;
|
|
6200
|
+
};
|
|
6201
|
+
/**
|
|
6202
|
+
* Submitting a signed Arkade transaction, and finalizing it.
|
|
6203
|
+
*
|
|
6204
|
+
* On {@link IWallet} rather than {@link IReadonlyWallet}: broadcasting is the
|
|
6205
|
+
* one thing a readonly wallet must not do. That is the same line
|
|
6206
|
+
* `IReadonlyAssetManager` draws, and the invariant behind
|
|
6207
|
+
* `ReadonlyWallet.arkProvider` being protected.
|
|
6208
|
+
*/
|
|
6209
|
+
type ArkadeBroadcaster = Pick<ArkProvider, "submitTx" | "finalizeTx">;
|
|
6098
6210
|
/**
|
|
6099
6211
|
* Core wallet interface for Bitcoin transactions with Arkade protocol support.
|
|
6100
6212
|
*
|
|
@@ -6105,6 +6217,14 @@ interface IAssetManager extends IReadonlyAssetManager {
|
|
|
6105
6217
|
* @see IReadonlyWallet
|
|
6106
6218
|
*/
|
|
6107
6219
|
interface IWallet extends IReadonlyWallet {
|
|
6220
|
+
/**
|
|
6221
|
+
* Broadcast access to this wallet's Arkade server, so a plugin needs only
|
|
6222
|
+
* the wallet — never a server URL of its own.
|
|
6223
|
+
*
|
|
6224
|
+
* @returns A submit/finalize pair bound to this wallet's server
|
|
6225
|
+
* @see ArkadeBroadcaster
|
|
6226
|
+
*/
|
|
6227
|
+
getArkadeBroadcaster(): Promise<ArkadeBroadcaster>;
|
|
6108
6228
|
/**
|
|
6109
6229
|
* Signing identity associated with the wallet.
|
|
6110
6230
|
*
|
|
@@ -6178,6 +6298,35 @@ interface IReadonlyWallet {
|
|
|
6178
6298
|
getAddress(): Promise<string>;
|
|
6179
6299
|
/** @returns Onchain boarding address used to move funds into Arkade. */
|
|
6180
6300
|
getBoardingAddress(): Promise<string>;
|
|
6301
|
+
/**
|
|
6302
|
+
* Server info for the Arkade server this wallet is connected to — network,
|
|
6303
|
+
* signer key, delays, dust, fees and limits.
|
|
6304
|
+
*
|
|
6305
|
+
* The wallet is the single place that knows which server it speaks to, so
|
|
6306
|
+
* a plugin needs only the wallet, never a server URL of its own. Live info
|
|
6307
|
+
* wins; when the server is unreachable this falls back to the snapshot
|
|
6308
|
+
* persisted at construction, so an offline wallet still answers.
|
|
6309
|
+
*
|
|
6310
|
+
* With `requireLive`, that fallback is off: the read throws when the
|
|
6311
|
+
* operator is unreachable instead of answering from cache. For callers
|
|
6312
|
+
* about to bind `signerPubkey` or a delay into a covenant — a stale
|
|
6313
|
+
* snapshot there derives an address the operator may no longer co-sign
|
|
6314
|
+
* for, so failing closed is the correct shape.
|
|
6315
|
+
*
|
|
6316
|
+
* @returns The Arkade server's info
|
|
6317
|
+
* @see ArkadeInfo
|
|
6318
|
+
*/
|
|
6319
|
+
getArkadeInfo(opts?: GetArkadeInfoOptions): Promise<ArkadeInfo>;
|
|
6320
|
+
/**
|
|
6321
|
+
* Chain reads against this wallet's Arkade server, for scripts the wallet
|
|
6322
|
+
* does not own — a plugin's covenant, say. {@link getVtxos} answers for the
|
|
6323
|
+
* wallet's own outputs and reads from repositories; this one goes to the
|
|
6324
|
+
* server.
|
|
6325
|
+
*
|
|
6326
|
+
* @returns A normalized reader bound to this wallet's server
|
|
6327
|
+
* @see ArkadeReader
|
|
6328
|
+
*/
|
|
6329
|
+
getArkadeReader(): Promise<ArkadeReader>;
|
|
6181
6330
|
/** @returns The wallet's combined onchain and offchain balance. */
|
|
6182
6331
|
getBalance(): Promise<WalletBalance>;
|
|
6183
6332
|
/**
|
|
@@ -6227,4 +6376,4 @@ interface IReadonlyWallet {
|
|
|
6227
6376
|
clear(): Promise<void>;
|
|
6228
6377
|
}
|
|
6229
6378
|
|
|
6230
|
-
export {
|
|
6379
|
+
export { TxTree as $, type ArkadeInfo as A, type ExtendedVirtualCoin as B, type ContractRepository as C, type VtxoRepositoryKey as D, type ExtendedCoin as E, type WalletState as F, type GetArkadeInfoOptions as G, type ContractFilter as H, type IWallet as I, type IntentRepository as J, type ArkIntent as K, type IntentFilter as L, type VirtualTxRepository as M, type NormalizedExtendedVirtualCoin as N, type Outpoint as O, type VirtualTx as P, type VtxoBranch as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotificationEvent as T, ChainedTxType as U, VtxoScript as V, type WalletRepository as W, type Network as X, CSVMultisigTapscript as Y, type BatchStartedEvent as Z, type TreeSigningStartedEvent as _, type Identity as a, type TreeNonces as a$, type TreeNoncesEvent as a0, type BatchFinalizationEvent as a1, type BatchFinalizedEvent as a2, type BatchFailedEvent as a3, type TreeTxEvent as a4, type TreeSignatureEvent as a5, type DescriptorProvider as a6, type IReadonlyWallet as a7, type ReadonlyIdentity as a8, type OnchainProvider as a9, type FeeOutput as aA, type ContractWatcherConfig as aB, type Asset as aC, type FeeInfo as aD, type GetVtxosOptions as aE, type PaginationOptions as aF, type CreateContractParams as aG, type GetContractsFilter as aH, type GetSpendablePathsOptions as aI, type GetAllSpendingPathsOptions as aJ, type IssuanceParams as aK, type ReissuanceParams as aL, type BurnParams as aM, type RenewVtxosOptions as aN, type NormalizedVtxoPage as aO, type PathSelection as aP, type ContractEvent as aQ, type AssetDetails as aR, type IssuanceResult as aS, type DelegateInfo as aT, type MigrationGlobalSkipReason as aU, type MigrationLegSkipReason as aV, type SignerStatus as aW, type StorageConfig as aX, type IVtxoManager as aY, type ExplorerTransaction as aZ, type ArkInfo as a_, type DelegateProvider as aa, type ReadonlyWalletConfig as ab, type ExitCaptureMode as ac, type ExitDataSource as ad, type IReadonlyAssetManager as ae, type ContractSyncState as af, type RecipientArkadeAddressContext as ag, type NetworkName as ah, ArkAddress as ai, type ContractWithVtxos as aj, selectPendingRecoveryOutpoints as ak, type Coin as al, ContractManager as am, type ContractManagerConfig as an, type SettlementConfig as ao, VtxoManager as ap, type SignerSession as aq, type SignedIntent as ar, Intent as as, type TimeHeight as at, type DescriptorSigningRequest as au, Transaction as av, type IntentFeeConfig as aw, type OffchainInput as ax, FeeAmount as ay, type OnchainInput as az, type WalletConfig as b, ContractWatcher as b$, type TreePartialSigs as b0, type PendingTx as b1, type EncodedVtxoScript as b2, type Status as b3, type ChainTx as b4, type PathContext as b5, isBatchSignable as b6, isSigningIdentity as b7, classifyContractSigner as b8, classifyAgainstSignerSet as b9, PrevTxUnavailableError as bA, assertAllowedSighashTypes as bB, isVtxoExpiringSoon as bC, assertRecipientArkadeAddress as bD, getRandomId as bE, getNetwork as bF, networkFromArkadeInfo as bG, networks as bH, defaultEmulatorPubkey as bI, resolveEmulatorPubkey as bJ, BITCOIN_EMULATOR_PUBKEY as bK, MUTINYNET_EMULATOR_PUBKEY as bL, REGTEST_EMULATOR_PUBKEY as bM, isTerminalIntentState as bN, INTENT_TERMINAL_STATES as bO, createExitChainResolver as bP, isRecoverable as bQ, isSpendable as bR, isSubdust as bS, isExpired as bT, getSequence as bU, canRecoverOnchain as bV, canSpendOffchain as bW, canSweepOnchain as bX, hasTerminalSpend as bY, isPastExpiry as bZ, isVirtualCoin as b_, signerSetFromInfo as ba, isCooperativelyMigratable as bb, toXOnlySignerHex as bc, DelegateManagerImpl as bd, DelegatorManagerImpl as be, RestDelegateProvider as bf, RestDelegatorProvider as bg, ESPLORA_URL as bh, EsploraProvider as bi, DigestMismatchError as bj, DEFAULT_VTXO_PAGE_SIZE as bk, scriptFromTapLeafScript as bl, TxType as bm, IndexerTxType as bn, ChainTxType as bo, SettlementEventType as bp, decodeTapscript as bq, MultisigTapscript as br, ConditionCSVMultisigTapscript as bs, ConditionMultisigTapscript as bt, CLTVMultisigTapscript as bu, TapTreeCoder as bv, resolvePrevTxs as bw, attachPrevArkTxs as bx, attachPrevoutTxs as by, withPrevTxs as bz, type ArkadeReader as c, collabExitResolver as c$, isDiscoverable as c0, hasCandidates as c1, type BatchSignableIdentity as c2, type SignRequest as c3, type BaseWalletConfig as c4, type NewAddressType as c5, type WalletMode as c6, type ProviderClass as c7, type VirtualStatus as c8, type TxKey as c9, type SignerSet as cA, type AssetMetadata as cB, type KnownMetadata as cC, type Nonces as cD, PartialSig as cE, type TxTreeNode as cF, type ExitChainResolver as cG, type ContractVtxo as cH, type ContractState as cI, type ContractEventCallback as cJ, type ContractBalance as cK, type ContractHandler as cL, type ExtendedContractVtxo as cM, type Discoverable as cN, type DiscoveryDeps as cO, type DiscoveredContract as cP, type CandidateDeps as cQ, type ScanResult as cR, type ScanContractsOptions as cS, type HandlerError as cT, type IDelegatorManager as cU, type DelegatorProvider as cV, type DelegateOptions as cW, type ArkIntentState as cX, boardingResolver as cY, getAllNormalizedVtxos as cZ, getNormalizedVtxos as c_, TapscriptType as ca, type PrevTxSource as cb, type RawTxSource as cc, type WithPrevTx as cd, type IntentCoin as ce, type TapLeaves as cf, type PageResponse as cg, type BatchInfo as ch, type CommitmentTx as ci, type TxHistoryRecord as cj, type Vtxo as ck, type VtxoChain as cl, type Tx as cm, type Output as cn, type TxNotification as co, type SweepTxNotification as cp, type ScheduledSession as cq, type SubscriptionHeartbeat as cr, type SubscriptionEvent as cs, type ArkTapscript as ct, type MigrateDeprecatedSignerOptions as cu, type DeprecatedSignerMigrationReport as cv, type DeprecatedSignerReport as cw, type MigrationVtxoRef as cx, type MigrationLegReport as cy, type SignerClassification as cz, type ArkadeBroadcaster as d, assetMintResolver as d0, createDefaultActivityRegistry as d1, type ActivityIntent as d2, type GroupMembership as d3, type ActivityResolver as d4, type TxTag as d5, EventSourceUnavailableError as d6, configureEventSource as d7, getConfiguredEventSource as d8, isEventSourceUnavailableError as d9, resolveEventSource as da, type EventSourceCapable as db, type EventSourceFactory as dc, type EventSourceLike as dd, type VtxoType as de, type TapscriptDeriving as df, type WalletBalance as e, type GetVtxosFilter as f, type ArkTransaction as g, ActivityRegistry as h, type Activity as i, type IContractManager as j, type GetNewAddressesOptions as k, type NewAddress as l, type IDelegateManager as m, type SettleParams as n, type SettlementEvent as o, type SendParams as p, type IAssetManager as q, RestArkProvider as r, RestIndexerProvider as s, type SubscriptionResponse as t, type ArkProvider as u, type IndexerProvider as v, type RelativeTimelock as w, type TapLeafScript as x, type VirtualCoin as y, type Contract as z };
|