@arkade-os/sdk 0.4.67 → 0.5.0-rc.0
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 +40 -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-Za-e_zMk.d.ts → asyncStorageTaskQueue-BCzN3Y45.d.ts} +2 -2
- package/dist/{asyncStorageTaskQueue-LTpeXYaD.d.cts → asyncStorageTaskQueue-CdF_ELX8.d.cts} +2 -2
- package/dist/{chunk-MJUTO3PY.cjs → chunk-5MJHZHG7.cjs} +771 -477
- package/dist/chunk-5MJHZHG7.cjs.map +1 -0
- package/dist/{chunk-2JV4VQ7C.cjs → chunk-6AFUNKK7.cjs} +33 -7
- package/dist/chunk-6AFUNKK7.cjs.map +1 -0
- package/dist/{chunk-AEWJU6NZ.js → chunk-6F2Q32KA.js} +352 -59
- package/dist/chunk-6F2Q32KA.js.map +1 -0
- package/dist/{chunk-EALWOVHK.js → chunk-ABJPM4JF.js} +4 -4
- package/dist/{chunk-EALWOVHK.js.map → chunk-ABJPM4JF.js.map} +1 -1
- package/dist/{chunk-CO3KKSWM.cjs → chunk-CZ32XADN.cjs} +17 -17
- package/dist/{chunk-CO3KKSWM.cjs.map → chunk-CZ32XADN.cjs.map} +1 -1
- package/dist/{chunk-X3VEMUVV.js → chunk-FVTJJQNM.js} +3 -3
- package/dist/{chunk-X3VEMUVV.js.map → chunk-FVTJJQNM.js.map} +1 -1
- package/dist/{chunk-OIZ2V2VD.cjs → chunk-HL7EC2Z5.cjs} +121 -170
- package/dist/chunk-HL7EC2Z5.cjs.map +1 -0
- package/dist/{chunk-MZFUZUTQ.js → chunk-JYP7YXT2.js} +4 -4
- package/dist/{chunk-MZFUZUTQ.js.map → chunk-JYP7YXT2.js.map} +1 -1
- package/dist/{chunk-6TAQF6EV.js → chunk-KTU44AEH.js} +75 -124
- package/dist/chunk-KTU44AEH.js.map +1 -0
- package/dist/{chunk-YDRZDZPP.cjs → chunk-PB5KJI4U.cjs} +10 -10
- package/dist/{chunk-YDRZDZPP.cjs.map → chunk-PB5KJI4U.cjs.map} +1 -1
- package/dist/{chunk-3WIWNE4P.js → chunk-PPG6W34P.js} +30 -8
- package/dist/chunk-PPG6W34P.js.map +1 -0
- package/dist/{chunk-R2YAMONM.cjs → chunk-RXWKCEZP.cjs} +17 -17
- package/dist/{chunk-R2YAMONM.cjs.map → chunk-RXWKCEZP.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-Bz2e2zXY.d.cts → delegate-DLIOBQ5x.d.cts} +1 -1
- package/dist/{delegate-cdmzb2f9.d.ts → delegate-Dyn5L80J.d.ts} +1 -1
- package/dist/{hdWalletCapable-BSjuUYOO.d.cts → hdWalletCapable-D9tooZ6F.d.ts} +102 -27
- package/dist/{hdWalletCapable-Hi12xjCJ.d.ts → hdWalletCapable-Dt3MUiGE.d.cts} +102 -27
- package/dist/{index-BiACuWaf.d.ts → index-D3hmsuKs.d.cts} +100 -123
- package/dist/{index-D2GjZxBr.d.cts → index-D9tXd-tN.d.ts} +100 -123
- package/dist/{index-DU5o_hz7.d.ts → index-Udm5V2xW.d.cts} +184 -19
- package/dist/{index-DU5o_hz7.d.cts → index-Udm5V2xW.d.ts} +184 -19
- package/dist/index.cjs +309 -289
- package/dist/index.d.cts +125 -29
- package/dist/index.d.ts +125 -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-BZJMLQ6g.d.cts → taskRunner-DxZciNaa.d.cts} +2 -2
- package/dist/{taskRunner-DATaRQus.d.ts → taskRunner-ZdS16Ypm.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-2JV4VQ7C.cjs.map +0 -1
- package/dist/chunk-3WIWNE4P.js.map +0 -1
- package/dist/chunk-6TAQF6EV.js.map +0 -1
- package/dist/chunk-AEWJU6NZ.js.map +0 -1
- package/dist/chunk-MJUTO3PY.cjs.map +0 -1
- package/dist/chunk-OIZ2V2VD.cjs.map +0 -1
|
@@ -13,6 +13,12 @@ declare class Transaction extends Transaction$1 {
|
|
|
13
13
|
static fromPSBT(psbt_: Bytes, opts?: TxOpts): Transaction;
|
|
14
14
|
static fromRaw(raw: Bytes, opts?: TxOpts): Transaction;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Reject a PSBT that declares a sighash type outside `allowedSighashTypes` on
|
|
18
|
+
* any input, before it reaches a signer. An input carrying no explicit type is
|
|
19
|
+
* left alone: the signer treats a taproot input as {@link SigHash.DEFAULT}.
|
|
20
|
+
*/
|
|
21
|
+
declare function assertAllowedSighashTypes(tx: Transaction$1, allowedSighashTypes?: number[]): void;
|
|
16
22
|
|
|
17
23
|
/**
|
|
18
24
|
* MuSig2 nonce pair containing public and secret values.
|
|
@@ -906,7 +912,20 @@ interface DeprecatedSigner {
|
|
|
906
912
|
pubkey: string;
|
|
907
913
|
}
|
|
908
914
|
type ServiceStatus = Record<string, string>;
|
|
909
|
-
|
|
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 {
|
|
910
929
|
boardingExitDelay: bigint;
|
|
911
930
|
checkpointTapscript: string;
|
|
912
931
|
deprecatedSigners: DeprecatedSigner[];
|
|
@@ -962,6 +981,8 @@ interface ArkInfo {
|
|
|
962
981
|
vtxoMaxAmount: bigint;
|
|
963
982
|
vtxoMinAmount: bigint;
|
|
964
983
|
}
|
|
984
|
+
/** @deprecated alias for @see ArkadeInfo */
|
|
985
|
+
type ArkInfo = ArkadeInfo;
|
|
965
986
|
/** Signed intent payload sent to the Arkade server. */
|
|
966
987
|
interface SignedIntent<T extends Intent.Message> {
|
|
967
988
|
/** Base64-encoded signed proof transaction. */
|
|
@@ -1009,7 +1030,7 @@ interface TxNotificationEvent {
|
|
|
1009
1030
|
}
|
|
1010
1031
|
interface ArkProvider {
|
|
1011
1032
|
/** Fetch Arkade server configuration and fee settings. */
|
|
1012
|
-
getInfo(): Promise<
|
|
1033
|
+
getInfo(): Promise<ArkadeInfo>;
|
|
1013
1034
|
/** Submit a signed Arkade transaction and its checkpoint transactions. */
|
|
1014
1035
|
submitTx(signedArkTx: string, checkpointTxs: string[]): Promise<{
|
|
1015
1036
|
arkTxid: string;
|
|
@@ -1053,8 +1074,9 @@ declare class RestArkProvider implements ArkProvider {
|
|
|
1053
1074
|
protected readonly eventSource?: EventSourceFactory;
|
|
1054
1075
|
constructor(serverUrl?: string, options?: EventSourceCapable);
|
|
1055
1076
|
/**
|
|
1056
|
-
* Last server-info digest seen from {@link getInfo}. Sent as `X-Digest`
|
|
1057
|
-
* 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}.
|
|
1058
1080
|
*/
|
|
1059
1081
|
private _digest;
|
|
1060
1082
|
private _hasServerInfo;
|
|
@@ -1065,7 +1087,7 @@ declare class RestArkProvider implements ArkProvider {
|
|
|
1065
1087
|
* `DIGEST_MISMATCH` refresh or when {@link getInfo} observes a changed digest.
|
|
1066
1088
|
* Returns an unsubscribe function.
|
|
1067
1089
|
*/
|
|
1068
|
-
onServerInfoChanged(listener: (info:
|
|
1090
|
+
onServerInfoChanged(listener: (info: ArkadeInfo) => void): () => void;
|
|
1069
1091
|
private emitServerInfoChanged;
|
|
1070
1092
|
/**
|
|
1071
1093
|
* `fetch` wrapper for arkd requests that participates in server-info digest
|
|
@@ -1078,7 +1100,7 @@ declare class RestArkProvider implements ArkProvider {
|
|
|
1078
1100
|
* routes through here: it is the refresh path and must not be digest-gated.
|
|
1079
1101
|
*/
|
|
1080
1102
|
private authedFetch;
|
|
1081
|
-
getInfo(): Promise<
|
|
1103
|
+
getInfo(): Promise<ArkadeInfo>;
|
|
1082
1104
|
submitTx(signedArkTx: string, checkpointTxs: string[]): Promise<{
|
|
1083
1105
|
arkTxid: string;
|
|
1084
1106
|
finalArkTx: string;
|
|
@@ -1599,6 +1621,21 @@ interface Network {
|
|
|
1599
1621
|
name?: NetworkName;
|
|
1600
1622
|
}
|
|
1601
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;
|
|
1602
1639
|
declare const networks: {
|
|
1603
1640
|
bitcoin: Network;
|
|
1604
1641
|
testnet: Network;
|
|
@@ -1864,6 +1901,29 @@ type NormalizedVirtualCoin = Omit<VirtualCoin, "isSwept" | "isPreconfirmed" | "i
|
|
|
1864
1901
|
commitmentTxIds: string[];
|
|
1865
1902
|
};
|
|
1866
1903
|
type NormalizedExtendedVirtualCoin = ExtendedVirtualCoin & NormalizedVirtualCoin;
|
|
1904
|
+
/** What a normalized VTXO read answers with. @see getNormalizedVtxos */
|
|
1905
|
+
type NormalizedVtxoPage = {
|
|
1906
|
+
vtxos: NormalizedVirtualCoin[];
|
|
1907
|
+
page?: PageResponse;
|
|
1908
|
+
};
|
|
1909
|
+
/**
|
|
1910
|
+
* The only sanctioned way for SDK logic to read VTXOs from an `IndexerProvider`: a drop-in for
|
|
1911
|
+
* `provider.getVtxos()` that normalizes whatever came back. A cheap pass-through for the built-in
|
|
1912
|
+
* providers, which already populate the facts.
|
|
1913
|
+
*/
|
|
1914
|
+
declare function getNormalizedVtxos(provider: Pick<IndexerProvider, "getVtxos">, opts?: GetVtxosOptions): Promise<NormalizedVtxoPage>;
|
|
1915
|
+
/** Everything a script query can filter on, minus the cursor this reader owns. */
|
|
1916
|
+
type VtxoScriptQuery = Omit<GetVtxosOptions, "scripts" | "outpoints" | "pageIndex">;
|
|
1917
|
+
/**
|
|
1918
|
+
* Read every virtual output for an arbitrary number of scripts.
|
|
1919
|
+
*
|
|
1920
|
+
* @remarks
|
|
1921
|
+
* Scripts travel in the query string, so a wallet-derived list must be chunked
|
|
1922
|
+
* at {@link SCRIPT_QUERY_CHUNK_SIZE} or the request `414`s. Chunks run
|
|
1923
|
+
* sequentially — that pacing is the point, since this path can now run wide —
|
|
1924
|
+
* and each is paged to exhaustion, so callers cannot silently receive page one.
|
|
1925
|
+
*/
|
|
1926
|
+
declare function getAllNormalizedVtxos(provider: Pick<IndexerProvider, "getVtxos">, scripts: string[], opts?: VtxoScriptQuery): Promise<NormalizedVirtualCoin[]>;
|
|
1867
1927
|
/**
|
|
1868
1928
|
* Whether a virtual output has been consumed and can never be spent again.
|
|
1869
1929
|
*
|
|
@@ -1956,7 +2016,7 @@ declare function isExpired(vtxo: VirtualCoin): boolean;
|
|
|
1956
2016
|
|
|
1957
2017
|
/**
|
|
1958
2018
|
* Machine-readable classification of a contract's server signer relative to a
|
|
1959
|
-
* fresh {@link
|
|
2019
|
+
* fresh {@link ArkadeInfo} snapshot. Drives both the migration selection (Section
|
|
1960
2020
|
* 3) and the user-facing cutoff reporting (Section 6) without persisting any
|
|
1961
2021
|
* stale-key metadata: staleness is always derived at read time from the
|
|
1962
2022
|
* contract's `params.serverPubKey` plus the server's advertised signer set.
|
|
@@ -1980,7 +2040,7 @@ declare function isExpired(vtxo: VirtualCoin): boolean;
|
|
|
1980
2040
|
type SignerStatus = "CURRENT" | "MIGRATABLE" | "DUE_NOW" | "EXPIRED" | "UNKNOWN_SIGNER";
|
|
1981
2041
|
/**
|
|
1982
2042
|
* Result of classifying a single contract's server signer against the current
|
|
1983
|
-
* {@link
|
|
2043
|
+
* {@link ArkadeInfo} signer set.
|
|
1984
2044
|
*/
|
|
1985
2045
|
interface SignerClassification {
|
|
1986
2046
|
status: SignerStatus;
|
|
@@ -2001,7 +2061,7 @@ interface SignerClassification {
|
|
|
2001
2061
|
/**
|
|
2002
2062
|
* The server's signer set, pre-normalized to x-only hex for cheap repeated
|
|
2003
2063
|
* lookups. Built once per migration/reporting pass from a fresh
|
|
2004
|
-
* {@link
|
|
2064
|
+
* {@link ArkadeInfo} snapshot via {@link signerSetFromInfo}.
|
|
2005
2065
|
*/
|
|
2006
2066
|
interface SignerSet {
|
|
2007
2067
|
/** Active signer, x-only (32-byte) hex. */
|
|
@@ -2029,7 +2089,7 @@ declare function toXOnlySignerHex(pubkeyHex: string): string;
|
|
|
2029
2089
|
* Build the {@link SignerSet} from a server-info snapshot. Deprecated signers
|
|
2030
2090
|
* with an empty pubkey are skipped.
|
|
2031
2091
|
*/
|
|
2032
|
-
declare function signerSetFromInfo(info:
|
|
2092
|
+
declare function signerSetFromInfo(info: ArkadeInfo): SignerSet;
|
|
2033
2093
|
/**
|
|
2034
2094
|
* Classify a contract's server signer against a pre-built {@link SignerSet}.
|
|
2035
2095
|
*
|
|
@@ -2040,11 +2100,11 @@ declare function signerSetFromInfo(info: ArkInfo): SignerSet;
|
|
|
2040
2100
|
*/
|
|
2041
2101
|
declare function classifyAgainstSignerSet(contractServerPubKeyHex: string, signerSet: SignerSet, nowSeconds?: number): SignerClassification;
|
|
2042
2102
|
/**
|
|
2043
|
-
* Convenience wrapper that builds the signer set from {@link
|
|
2103
|
+
* Convenience wrapper that builds the signer set from {@link ArkadeInfo} and
|
|
2044
2104
|
* classifies a single contract signer. Prefer {@link classifyAgainstSignerSet}
|
|
2045
2105
|
* with a shared signer set when classifying many contracts in one pass.
|
|
2046
2106
|
*/
|
|
2047
|
-
declare function classifyContractSigner(contractServerPubKeyHex: string, info:
|
|
2107
|
+
declare function classifyContractSigner(contractServerPubKeyHex: string, info: ArkadeInfo, nowSeconds?: number): SignerClassification;
|
|
2048
2108
|
/**
|
|
2049
2109
|
* Whether a signer status admits cooperative migration (i.e. a `settle()`
|
|
2050
2110
|
* intent should be built for VTXOs under this signer). True for `MIGRATABLE`
|
|
@@ -2189,6 +2249,9 @@ interface SettlementConfig {
|
|
|
2189
2249
|
/**
|
|
2190
2250
|
* Check if a virtual output is expiring soon based on threshold
|
|
2191
2251
|
*
|
|
2252
|
+
* Always `false` for an unilaterally exited output: "expiring soon" is a renewal
|
|
2253
|
+
* signal, and no batch can renew an output that already lives onchain.
|
|
2254
|
+
*
|
|
2192
2255
|
* @param vtxo - The virtual output to check
|
|
2193
2256
|
* @param thresholdMs - Threshold in milliseconds from now
|
|
2194
2257
|
* @returns true if virtual output expires within threshold, false otherwise
|
|
@@ -2229,7 +2292,7 @@ interface MigrationVtxoRef {
|
|
|
2229
2292
|
/**
|
|
2230
2293
|
* Machine-readable status for a single deprecated signer the wallet holds
|
|
2231
2294
|
* funds under (Section 6). Derived at read time from contract params plus a
|
|
2232
|
-
* fresh {@link
|
|
2295
|
+
* fresh {@link ArkadeInfo} snapshot — never persisted.
|
|
2233
2296
|
*/
|
|
2234
2297
|
interface DeprecatedSignerReport {
|
|
2235
2298
|
/** Deprecated signer key (x-only hex). */
|
|
@@ -2708,7 +2771,7 @@ declare class VtxoManager implements AsyncDisposable, IVtxoManager {
|
|
|
2708
2771
|
getDeprecatedSignerStatus(): Promise<DeprecatedSignerReport[]>;
|
|
2709
2772
|
/**
|
|
2710
2773
|
* Core migration routine shared by the manual API and the automatic poll
|
|
2711
|
-
* pass. Fetches a fresh {@link
|
|
2774
|
+
* pass. Fetches a fresh {@link ArkadeInfo}, applies a mid-session signer
|
|
2712
2775
|
* rotation when the wallet's own snapshot signer has been deprecated,
|
|
2713
2776
|
* selects spendable VTXOs under deprecated-signer contracts (cutoff-first),
|
|
2714
2777
|
* and settles them to the active-signer Ark address.
|
|
@@ -3409,10 +3472,15 @@ declare function getRandomId(): string;
|
|
|
3409
3472
|
* belongs to another network or operator, so this wallet's operator cannot
|
|
3410
3473
|
* create the VTXO where the recipient's wallet expects it.
|
|
3411
3474
|
*/
|
|
3412
|
-
type
|
|
3475
|
+
type RecipientArkadeAddressContext = {
|
|
3413
3476
|
hrp: string;
|
|
3414
3477
|
signerSet: SignerSet;
|
|
3415
3478
|
};
|
|
3479
|
+
/**
|
|
3480
|
+
* The embedded server key may be the current signer or a deprecated signer
|
|
3481
|
+
* whose rotation cutoff has not passed.
|
|
3482
|
+
*/
|
|
3483
|
+
declare function assertRecipientArkadeAddress(encoded: string, address: ArkAddress, context: RecipientArkadeAddressContext): void;
|
|
3416
3484
|
|
|
3417
3485
|
/**
|
|
3418
3486
|
* An input for {@link IContractManager.assertSpendableNow}.
|
|
@@ -4663,8 +4731,8 @@ interface DiscoveredContract {
|
|
|
4663
4731
|
}
|
|
4664
4732
|
/**
|
|
4665
4733
|
* Read-only context the scanner injects into every `discoverAt` call.
|
|
4666
|
-
*
|
|
4667
|
-
*
|
|
4734
|
+
* A handler needing an external service client closes over it at
|
|
4735
|
+
* registration time; this context never carries one.
|
|
4668
4736
|
*/
|
|
4669
4737
|
interface DiscoveryDeps {
|
|
4670
4738
|
indexerProvider: IndexerProvider;
|
|
@@ -5228,7 +5296,7 @@ interface BaseWalletConfig {
|
|
|
5228
5296
|
*/
|
|
5229
5297
|
minBatchExpirySeconds?: bigint;
|
|
5230
5298
|
/**
|
|
5231
|
-
* Minimum accepted checkpoint exit delay decoded from `
|
|
5299
|
+
* Minimum accepted checkpoint exit delay decoded from `ArkadeInfo.checkpointTapscript`,
|
|
5232
5300
|
* as wall-clock seconds. Defaults per network — see
|
|
5233
5301
|
* `defaultCheckpointExitDelayPolicy`, which already carries the value the
|
|
5234
5302
|
* hosted signet and mutinynet Arkade Services advertise, so neither needs
|
|
@@ -5501,6 +5569,13 @@ interface WalletBalance {
|
|
|
5501
5569
|
/**
|
|
5502
5570
|
* Total balance across offchain, recoverable, pending-recovery, unrolled,
|
|
5503
5571
|
* and boarding funds.
|
|
5572
|
+
*
|
|
5573
|
+
* One known main-thread-only wedge: while a spend is in flight — `send`,
|
|
5574
|
+
* `sendBitcoin` or `settle` — its VTXO inputs are withheld from every bucket,
|
|
5575
|
+
* including this one. Boarding inputs are not: only virtual coins enter the
|
|
5576
|
+
* set. That state lives on the `Wallet` instance driving the spend, so a
|
|
5577
|
+
* service-worker client reading the same repository still counts them until
|
|
5578
|
+
* the spend settles. Both sides converge when it does.
|
|
5504
5579
|
*/
|
|
5505
5580
|
total: number;
|
|
5506
5581
|
/** Asset balance entries (`assetId` & `amount`) the wallet owns. */
|
|
@@ -6027,6 +6102,59 @@ interface IAssetManager extends IReadonlyAssetManager {
|
|
|
6027
6102
|
*/
|
|
6028
6103
|
burn(params: BurnParams): Promise<string>;
|
|
6029
6104
|
}
|
|
6105
|
+
/** Options for {@link IReadonlyWallet.getArkadeInfo}. */
|
|
6106
|
+
type GetArkadeInfoOptions = {
|
|
6107
|
+
/** Throw when the operator is unreachable instead of answering from the
|
|
6108
|
+
* persisted snapshot — for callers binding the answer into a covenant. */
|
|
6109
|
+
requireLive?: boolean;
|
|
6110
|
+
};
|
|
6111
|
+
/**
|
|
6112
|
+
* Chain reads a caller needs beyond its own wallet's VTXOs: an arbitrary
|
|
6113
|
+
* script's virtual outputs, and the transactions that spent them.
|
|
6114
|
+
*
|
|
6115
|
+
* Shaped as {@link getNormalizedVtxos} rather than as `IndexerProvider`, for
|
|
6116
|
+
* two reasons. Every VTXO leaving this seam carries its canonical facts —
|
|
6117
|
+
* the guarantee `scripts/check-provider-boundary.mjs` enforces inside the SDK
|
|
6118
|
+
* and that a plugin holding a raw provider could otherwise skip. And because
|
|
6119
|
+
* `NormalizedVirtualCoin` is assignable to `VirtualCoin`, an `ArkadeReader`
|
|
6120
|
+
* satisfies `Pick<IndexerProvider, "getVtxos" | "getVirtualTxs">` structurally,
|
|
6121
|
+
* so existing narrow seams accept one unchanged. Passing a reader to something
|
|
6122
|
+
* that normalizes again — `getNormalizedVtxos`, `Arkade.connect`'s `indexer` —
|
|
6123
|
+
* is harmless: `normalizeVtxo` is idempotent. Do not "fix" that by stripping
|
|
6124
|
+
* the normalization here; it is the whole point of the seam.
|
|
6125
|
+
*
|
|
6126
|
+
* Deliberately not the whole provider: a caller that could reach
|
|
6127
|
+
* `getVtxoChain` or `getSubscription` through the wallet would be talking to
|
|
6128
|
+
* the server behind the wallet's back, which the service-worker wallet cannot
|
|
6129
|
+
* even express.
|
|
6130
|
+
*/
|
|
6131
|
+
type ArkadeReader = Pick<IndexerProvider, "getVirtualTxs"> & {
|
|
6132
|
+
/**
|
|
6133
|
+
* Required `opts`, unlike the `IndexerProvider` method it mirrors: this
|
|
6134
|
+
* seam reads for *named* foreign scripts (or outpoints). The type stops a
|
|
6135
|
+
* bare `getVtxos()` at compile time; the runtime defence is the provider's
|
|
6136
|
+
* own "Either scripts or outpoints must be provided" throw — the message
|
|
6137
|
+
* boundary adds no validation of its own.
|
|
6138
|
+
*
|
|
6139
|
+
* One logical query — the reader chunks nothing. `scripts` travel in the
|
|
6140
|
+
* query string, so a wide list can `414`; {@link getAllNormalizedVtxos}
|
|
6141
|
+
* accepts a reader and chunks and pages to exhaustion. Whether a single
|
|
6142
|
+
* call pages internally is the provider's business: when a `page` comes
|
|
6143
|
+
* back, following it is yours.
|
|
6144
|
+
*
|
|
6145
|
+
* @see getNormalizedVtxos
|
|
6146
|
+
*/
|
|
6147
|
+
getVtxos(opts: GetVtxosOptions): Promise<NormalizedVtxoPage>;
|
|
6148
|
+
};
|
|
6149
|
+
/**
|
|
6150
|
+
* Submitting a signed Arkade transaction, and finalizing it.
|
|
6151
|
+
*
|
|
6152
|
+
* On {@link IWallet} rather than {@link IReadonlyWallet}: broadcasting is the
|
|
6153
|
+
* one thing a readonly wallet must not do. That is the same line
|
|
6154
|
+
* `IReadonlyAssetManager` draws, and the invariant behind
|
|
6155
|
+
* `ReadonlyWallet.arkProvider` being protected.
|
|
6156
|
+
*/
|
|
6157
|
+
type ArkadeBroadcaster = Pick<ArkProvider, "submitTx" | "finalizeTx">;
|
|
6030
6158
|
/**
|
|
6031
6159
|
* Core wallet interface for Bitcoin transactions with Arkade protocol support.
|
|
6032
6160
|
*
|
|
@@ -6037,6 +6165,14 @@ interface IAssetManager extends IReadonlyAssetManager {
|
|
|
6037
6165
|
* @see IReadonlyWallet
|
|
6038
6166
|
*/
|
|
6039
6167
|
interface IWallet extends IReadonlyWallet {
|
|
6168
|
+
/**
|
|
6169
|
+
* Broadcast access to this wallet's Arkade server, so a plugin needs only
|
|
6170
|
+
* the wallet — never a server URL of its own.
|
|
6171
|
+
*
|
|
6172
|
+
* @returns A submit/finalize pair bound to this wallet's server
|
|
6173
|
+
* @see ArkadeBroadcaster
|
|
6174
|
+
*/
|
|
6175
|
+
getArkadeBroadcaster(): Promise<ArkadeBroadcaster>;
|
|
6040
6176
|
/**
|
|
6041
6177
|
* Signing identity associated with the wallet.
|
|
6042
6178
|
*
|
|
@@ -6110,6 +6246,35 @@ interface IReadonlyWallet {
|
|
|
6110
6246
|
getAddress(): Promise<string>;
|
|
6111
6247
|
/** @returns Onchain boarding address used to move funds into Arkade. */
|
|
6112
6248
|
getBoardingAddress(): Promise<string>;
|
|
6249
|
+
/**
|
|
6250
|
+
* Server info for the Arkade server this wallet is connected to — network,
|
|
6251
|
+
* signer key, delays, dust, fees and limits.
|
|
6252
|
+
*
|
|
6253
|
+
* The wallet is the single place that knows which server it speaks to, so
|
|
6254
|
+
* a plugin needs only the wallet, never a server URL of its own. Live info
|
|
6255
|
+
* wins; when the server is unreachable this falls back to the snapshot
|
|
6256
|
+
* persisted at construction, so an offline wallet still answers.
|
|
6257
|
+
*
|
|
6258
|
+
* With `requireLive`, that fallback is off: the read throws when the
|
|
6259
|
+
* operator is unreachable instead of answering from cache. For callers
|
|
6260
|
+
* about to bind `signerPubkey` or a delay into a covenant — a stale
|
|
6261
|
+
* snapshot there derives an address the operator may no longer co-sign
|
|
6262
|
+
* for, so failing closed is the correct shape.
|
|
6263
|
+
*
|
|
6264
|
+
* @returns The Arkade server's info
|
|
6265
|
+
* @see ArkadeInfo
|
|
6266
|
+
*/
|
|
6267
|
+
getArkadeInfo(opts?: GetArkadeInfoOptions): Promise<ArkadeInfo>;
|
|
6268
|
+
/**
|
|
6269
|
+
* Chain reads against this wallet's Arkade server, for scripts the wallet
|
|
6270
|
+
* does not own — a plugin's covenant, say. {@link getVtxos} answers for the
|
|
6271
|
+
* wallet's own outputs and reads from repositories; this one goes to the
|
|
6272
|
+
* server.
|
|
6273
|
+
*
|
|
6274
|
+
* @returns A normalized reader bound to this wallet's server
|
|
6275
|
+
* @see ArkadeReader
|
|
6276
|
+
*/
|
|
6277
|
+
getArkadeReader(): Promise<ArkadeReader>;
|
|
6113
6278
|
/** @returns The wallet's combined onchain and offchain balance. */
|
|
6114
6279
|
getBalance(): Promise<WalletBalance>;
|
|
6115
6280
|
/**
|
|
@@ -6159,4 +6324,4 @@ interface IReadonlyWallet {
|
|
|
6159
6324
|
clear(): Promise<void>;
|
|
6160
6325
|
}
|
|
6161
6326
|
|
|
6162
|
-
export {
|
|
6327
|
+
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, type PrevTxSource 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, type ActivityIntent as b6, type ActivityResolver as b7, type ArkIntentState as b8, type ArkTapscript as b9, type DiscoveredContract as bA, type DiscoveryDeps as bB, ESPLORA_URL as bC, EsploraProvider as bD, type EventSourceCapable as bE, type EventSourceFactory as bF, type EventSourceLike as bG, EventSourceUnavailableError as bH, type ExitChainResolver as bI, type ExtendedContractVtxo as bJ, type GroupMembership as bK, type HandlerError as bL, type IDelegatorManager as bM, INTENT_TERMINAL_STATES as bN, IndexerTxType as bO, type IntentCoin as bP, type KnownMetadata as bQ, MUTINYNET_EMULATOR_PUBKEY as bR, type MigrateDeprecatedSignerOptions as bS, type MigrationLegReport as bT, type MigrationVtxoRef as bU, MultisigTapscript as bV, type NewAddressType as bW, type Nonces as bX, type Output as bY, type PageResponse as bZ, PartialSig as b_, type AssetMetadata as ba, BITCOIN_EMULATOR_PUBKEY as bb, type BaseWalletConfig as bc, type BatchInfo as bd, type BatchSignableIdentity as be, CLTVMultisigTapscript as bf, type CandidateDeps as bg, ChainTxType as bh, type CommitmentTx as bi, ConditionCSVMultisigTapscript as bj, ConditionMultisigTapscript as bk, type ContractBalance as bl, type ContractEventCallback as bm, type ContractHandler as bn, type ContractState as bo, type ContractVtxo as bp, ContractWatcher as bq, DEFAULT_VTXO_PAGE_SIZE as br, DelegateManagerImpl as bs, type DelegateOptions as bt, DelegatorManagerImpl as bu, type DelegatorProvider as bv, type DeprecatedSignerMigrationReport as bw, type DeprecatedSignerReport as bx, DigestMismatchError as by, type Discoverable as bz, type ArkadeReader as c, isRecoverable as c$, PrevTxUnavailableError as c0, type ProviderClass as c1, REGTEST_EMULATOR_PUBKEY as c2, type RawTxSource as c3, RestDelegateProvider as c4, RestDelegatorProvider as c5, type ScanContractsOptions as c6, type ScanResult as c7, type ScheduledSession as c8, SettlementEventType as c9, attachPrevoutTxs as cA, boardingResolver as cB, canRecoverOnchain as cC, canSpendOffchain as cD, canSweepOnchain as cE, classifyAgainstSignerSet as cF, classifyContractSigner as cG, collabExitResolver as cH, configureEventSource as cI, createDefaultActivityRegistry as cJ, createExitChainResolver as cK, decodeTapscript as cL, defaultEmulatorPubkey as cM, getAllNormalizedVtxos as cN, getConfiguredEventSource as cO, getNetwork as cP, getNormalizedVtxos as cQ, getRandomId as cR, getSequence as cS, hasCandidates as cT, hasTerminalSpend as cU, isBatchSignable as cV, isCooperativelyMigratable as cW, isDiscoverable as cX, isEventSourceUnavailableError as cY, isExpired as cZ, isPastExpiry as c_, type SignRequest as ca, type SignerClassification as cb, type SignerSet as cc, type SubscriptionEvent as cd, type SubscriptionHeartbeat as ce, type SweepTxNotification as cf, type TapLeaves as cg, TapTreeCoder as ch, TapscriptType as ci, type Tx as cj, type TxHistoryRecord as ck, type TxKey as cl, type TxNotification as cm, type TxTag as cn, type TxTreeNode as co, TxType as cp, type VirtualStatus as cq, type Vtxo as cr, type VtxoChain as cs, type VtxoType as ct, type WalletMode as cu, type WithPrevTx as cv, assertAllowedSighashTypes as cw, assertRecipientArkadeAddress as cx, assetMintResolver as cy, attachPrevArkTxs as cz, type ArkadeBroadcaster as d, isSigningIdentity as d0, isSpendable as d1, isSubdust as d2, isTerminalIntentState as d3, isVirtualCoin as d4, isVtxoExpiringSoon as d5, networkFromArkadeInfo as d6, networks as d7, resolveEmulatorPubkey as d8, resolveEventSource as d9, resolvePrevTxs as da, scriptFromTapLeafScript as db, signerSetFromInfo as dc, toXOnlySignerHex as dd, withPrevTxs 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 };
|