@arkade-os/sdk 0.4.68 → 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 +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-DaZlVTbM.d.ts → asyncStorageTaskQueue-BCzN3Y45.d.ts} +1 -1
- package/dist/{asyncStorageTaskQueue-B2CcXIHU.d.cts → asyncStorageTaskQueue-CdF_ELX8.d.cts} +1 -1
- package/dist/{chunk-WCJVKFAP.cjs → chunk-5MJHZHG7.cjs} +726 -468
- package/dist/chunk-5MJHZHG7.cjs.map +1 -0
- package/dist/{chunk-EJOFL5WH.cjs → chunk-6AFUNKK7.cjs} +19 -7
- package/dist/chunk-6AFUNKK7.cjs.map +1 -0
- package/dist/{chunk-VBHXBI7F.js → chunk-6F2Q32KA.js} +298 -41
- package/dist/chunk-6F2Q32KA.js.map +1 -0
- package/dist/{chunk-GQ4NMQGR.js → chunk-ABJPM4JF.js} +4 -4
- package/dist/{chunk-GQ4NMQGR.js.map → chunk-ABJPM4JF.js.map} +1 -1
- package/dist/{chunk-PJR63FTK.cjs → chunk-CZ32XADN.cjs} +17 -17
- package/dist/{chunk-PJR63FTK.cjs.map → chunk-CZ32XADN.cjs.map} +1 -1
- package/dist/{chunk-33Q2RFET.js → chunk-FVTJJQNM.js} +3 -3
- package/dist/{chunk-33Q2RFET.js.map → chunk-FVTJJQNM.js.map} +1 -1
- package/dist/{chunk-6YUACVX4.cjs → chunk-HL7EC2Z5.cjs} +52 -53
- package/dist/chunk-HL7EC2Z5.cjs.map +1 -0
- package/dist/{chunk-G4I6PU5H.js → chunk-JYP7YXT2.js} +4 -4
- package/dist/{chunk-G4I6PU5H.js.map → chunk-JYP7YXT2.js.map} +1 -1
- package/dist/{chunk-45FKMOJH.js → chunk-KTU44AEH.js} +6 -7
- package/dist/chunk-KTU44AEH.js.map +1 -0
- package/dist/{chunk-4KCVS4ZN.cjs → chunk-PB5KJI4U.cjs} +10 -10
- package/dist/{chunk-4KCVS4ZN.cjs.map → chunk-PB5KJI4U.cjs.map} +1 -1
- package/dist/{chunk-4CMXV5SF.js → chunk-PPG6W34P.js} +18 -8
- package/dist/chunk-PPG6W34P.js.map +1 -0
- package/dist/{chunk-JGMSZIE4.cjs → chunk-RXWKCEZP.cjs} +17 -17
- package/dist/{chunk-JGMSZIE4.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-Bffc5f54.d.cts → delegate-DLIOBQ5x.d.cts} +1 -1
- package/dist/{delegate-AomVWxO_.d.ts → delegate-Dyn5L80J.d.ts} +1 -1
- package/dist/{hdWalletCapable-B5nRs3RH.d.cts → hdWalletCapable-D9tooZ6F.d.ts} +102 -27
- package/dist/{hdWalletCapable-DZdIVa23.d.ts → hdWalletCapable-Dt3MUiGE.d.cts} +102 -27
- package/dist/{index-jouvy8FD.d.ts → index-D3hmsuKs.d.cts} +6 -6
- package/dist/{index-nfyQM33h.d.cts → index-D9tXd-tN.d.ts} +6 -6
- package/dist/{index-C7RZCfoY.d.cts → index-Udm5V2xW.d.cts} +168 -19
- package/dist/{index-C7RZCfoY.d.ts → index-Udm5V2xW.d.ts} +168 -19
- package/dist/index.cjs +306 -290
- 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-D2vnpPBT.d.cts → taskRunner-DxZciNaa.d.cts} +1 -1
- package/dist/{taskRunner-DuwK9t8O.d.ts → taskRunner-ZdS16Ypm.d.ts} +1 -1
- 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-45FKMOJH.js.map +0 -1
- package/dist/chunk-4CMXV5SF.js.map +0 -1
- package/dist/chunk-6YUACVX4.cjs.map +0 -1
- package/dist/chunk-EJOFL5WH.cjs.map +0 -1
- package/dist/chunk-VBHXBI7F.js.map +0 -1
- package/dist/chunk-WCJVKFAP.cjs.map +0 -1
|
@@ -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;
|
|
@@ -1870,6 +1901,29 @@ type NormalizedVirtualCoin = Omit<VirtualCoin, "isSwept" | "isPreconfirmed" | "i
|
|
|
1870
1901
|
commitmentTxIds: string[];
|
|
1871
1902
|
};
|
|
1872
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[]>;
|
|
1873
1927
|
/**
|
|
1874
1928
|
* Whether a virtual output has been consumed and can never be spent again.
|
|
1875
1929
|
*
|
|
@@ -1962,7 +2016,7 @@ declare function isExpired(vtxo: VirtualCoin): boolean;
|
|
|
1962
2016
|
|
|
1963
2017
|
/**
|
|
1964
2018
|
* Machine-readable classification of a contract's server signer relative to a
|
|
1965
|
-
* fresh {@link
|
|
2019
|
+
* fresh {@link ArkadeInfo} snapshot. Drives both the migration selection (Section
|
|
1966
2020
|
* 3) and the user-facing cutoff reporting (Section 6) without persisting any
|
|
1967
2021
|
* stale-key metadata: staleness is always derived at read time from the
|
|
1968
2022
|
* contract's `params.serverPubKey` plus the server's advertised signer set.
|
|
@@ -1986,7 +2040,7 @@ declare function isExpired(vtxo: VirtualCoin): boolean;
|
|
|
1986
2040
|
type SignerStatus = "CURRENT" | "MIGRATABLE" | "DUE_NOW" | "EXPIRED" | "UNKNOWN_SIGNER";
|
|
1987
2041
|
/**
|
|
1988
2042
|
* Result of classifying a single contract's server signer against the current
|
|
1989
|
-
* {@link
|
|
2043
|
+
* {@link ArkadeInfo} signer set.
|
|
1990
2044
|
*/
|
|
1991
2045
|
interface SignerClassification {
|
|
1992
2046
|
status: SignerStatus;
|
|
@@ -2007,7 +2061,7 @@ interface SignerClassification {
|
|
|
2007
2061
|
/**
|
|
2008
2062
|
* The server's signer set, pre-normalized to x-only hex for cheap repeated
|
|
2009
2063
|
* lookups. Built once per migration/reporting pass from a fresh
|
|
2010
|
-
* {@link
|
|
2064
|
+
* {@link ArkadeInfo} snapshot via {@link signerSetFromInfo}.
|
|
2011
2065
|
*/
|
|
2012
2066
|
interface SignerSet {
|
|
2013
2067
|
/** Active signer, x-only (32-byte) hex. */
|
|
@@ -2035,7 +2089,7 @@ declare function toXOnlySignerHex(pubkeyHex: string): string;
|
|
|
2035
2089
|
* Build the {@link SignerSet} from a server-info snapshot. Deprecated signers
|
|
2036
2090
|
* with an empty pubkey are skipped.
|
|
2037
2091
|
*/
|
|
2038
|
-
declare function signerSetFromInfo(info:
|
|
2092
|
+
declare function signerSetFromInfo(info: ArkadeInfo): SignerSet;
|
|
2039
2093
|
/**
|
|
2040
2094
|
* Classify a contract's server signer against a pre-built {@link SignerSet}.
|
|
2041
2095
|
*
|
|
@@ -2046,11 +2100,11 @@ declare function signerSetFromInfo(info: ArkInfo): SignerSet;
|
|
|
2046
2100
|
*/
|
|
2047
2101
|
declare function classifyAgainstSignerSet(contractServerPubKeyHex: string, signerSet: SignerSet, nowSeconds?: number): SignerClassification;
|
|
2048
2102
|
/**
|
|
2049
|
-
* Convenience wrapper that builds the signer set from {@link
|
|
2103
|
+
* Convenience wrapper that builds the signer set from {@link ArkadeInfo} and
|
|
2050
2104
|
* classifies a single contract signer. Prefer {@link classifyAgainstSignerSet}
|
|
2051
2105
|
* with a shared signer set when classifying many contracts in one pass.
|
|
2052
2106
|
*/
|
|
2053
|
-
declare function classifyContractSigner(contractServerPubKeyHex: string, info:
|
|
2107
|
+
declare function classifyContractSigner(contractServerPubKeyHex: string, info: ArkadeInfo, nowSeconds?: number): SignerClassification;
|
|
2054
2108
|
/**
|
|
2055
2109
|
* Whether a signer status admits cooperative migration (i.e. a `settle()`
|
|
2056
2110
|
* intent should be built for VTXOs under this signer). True for `MIGRATABLE`
|
|
@@ -2238,7 +2292,7 @@ interface MigrationVtxoRef {
|
|
|
2238
2292
|
/**
|
|
2239
2293
|
* Machine-readable status for a single deprecated signer the wallet holds
|
|
2240
2294
|
* funds under (Section 6). Derived at read time from contract params plus a
|
|
2241
|
-
* fresh {@link
|
|
2295
|
+
* fresh {@link ArkadeInfo} snapshot — never persisted.
|
|
2242
2296
|
*/
|
|
2243
2297
|
interface DeprecatedSignerReport {
|
|
2244
2298
|
/** Deprecated signer key (x-only hex). */
|
|
@@ -2717,7 +2771,7 @@ declare class VtxoManager implements AsyncDisposable, IVtxoManager {
|
|
|
2717
2771
|
getDeprecatedSignerStatus(): Promise<DeprecatedSignerReport[]>;
|
|
2718
2772
|
/**
|
|
2719
2773
|
* Core migration routine shared by the manual API and the automatic poll
|
|
2720
|
-
* pass. Fetches a fresh {@link
|
|
2774
|
+
* pass. Fetches a fresh {@link ArkadeInfo}, applies a mid-session signer
|
|
2721
2775
|
* rotation when the wallet's own snapshot signer has been deprecated,
|
|
2722
2776
|
* selects spendable VTXOs under deprecated-signer contracts (cutoff-first),
|
|
2723
2777
|
* and settles them to the active-signer Ark address.
|
|
@@ -3418,10 +3472,15 @@ declare function getRandomId(): string;
|
|
|
3418
3472
|
* belongs to another network or operator, so this wallet's operator cannot
|
|
3419
3473
|
* create the VTXO where the recipient's wallet expects it.
|
|
3420
3474
|
*/
|
|
3421
|
-
type
|
|
3475
|
+
type RecipientArkadeAddressContext = {
|
|
3422
3476
|
hrp: string;
|
|
3423
3477
|
signerSet: SignerSet;
|
|
3424
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;
|
|
3425
3484
|
|
|
3426
3485
|
/**
|
|
3427
3486
|
* An input for {@link IContractManager.assertSpendableNow}.
|
|
@@ -4672,8 +4731,8 @@ interface DiscoveredContract {
|
|
|
4672
4731
|
}
|
|
4673
4732
|
/**
|
|
4674
4733
|
* Read-only context the scanner injects into every `discoverAt` call.
|
|
4675
|
-
*
|
|
4676
|
-
*
|
|
4734
|
+
* A handler needing an external service client closes over it at
|
|
4735
|
+
* registration time; this context never carries one.
|
|
4677
4736
|
*/
|
|
4678
4737
|
interface DiscoveryDeps {
|
|
4679
4738
|
indexerProvider: IndexerProvider;
|
|
@@ -5237,7 +5296,7 @@ interface BaseWalletConfig {
|
|
|
5237
5296
|
*/
|
|
5238
5297
|
minBatchExpirySeconds?: bigint;
|
|
5239
5298
|
/**
|
|
5240
|
-
* Minimum accepted checkpoint exit delay decoded from `
|
|
5299
|
+
* Minimum accepted checkpoint exit delay decoded from `ArkadeInfo.checkpointTapscript`,
|
|
5241
5300
|
* as wall-clock seconds. Defaults per network — see
|
|
5242
5301
|
* `defaultCheckpointExitDelayPolicy`, which already carries the value the
|
|
5243
5302
|
* hosted signet and mutinynet Arkade Services advertise, so neither needs
|
|
@@ -6043,6 +6102,59 @@ interface IAssetManager extends IReadonlyAssetManager {
|
|
|
6043
6102
|
*/
|
|
6044
6103
|
burn(params: BurnParams): Promise<string>;
|
|
6045
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">;
|
|
6046
6158
|
/**
|
|
6047
6159
|
* Core wallet interface for Bitcoin transactions with Arkade protocol support.
|
|
6048
6160
|
*
|
|
@@ -6053,6 +6165,14 @@ interface IAssetManager extends IReadonlyAssetManager {
|
|
|
6053
6165
|
* @see IReadonlyWallet
|
|
6054
6166
|
*/
|
|
6055
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>;
|
|
6056
6176
|
/**
|
|
6057
6177
|
* Signing identity associated with the wallet.
|
|
6058
6178
|
*
|
|
@@ -6126,6 +6246,35 @@ interface IReadonlyWallet {
|
|
|
6126
6246
|
getAddress(): Promise<string>;
|
|
6127
6247
|
/** @returns Onchain boarding address used to move funds into Arkade. */
|
|
6128
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>;
|
|
6129
6278
|
/** @returns The wallet's combined onchain and offchain balance. */
|
|
6130
6279
|
getBalance(): Promise<WalletBalance>;
|
|
6131
6280
|
/**
|
|
@@ -6175,4 +6324,4 @@ interface IReadonlyWallet {
|
|
|
6175
6324
|
clear(): Promise<void>;
|
|
6176
6325
|
}
|
|
6177
6326
|
|
|
6178
|
-
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 };
|