@otoplo/wallet-common 0.6.0 → 0.7.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/dist/index.d.ts +53 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +142 -48
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/services/rostrum.ts +322 -274
- package/src/services/wallet.ts +762 -683
- package/src/types/rostrum.types.ts +11 -0
|
@@ -7,6 +7,17 @@ export interface RostrumParams {
|
|
|
7
7
|
label: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Whether the wallet can use a server, from `RostrumService.checkInstance()`:
|
|
12
|
+
* - `online`: reachable and usable, with the round-trip time of a request in milliseconds.
|
|
13
|
+
* - `offline`: couldn't connect, or it didn't answer.
|
|
14
|
+
* - `wrong_network`: it serves another network (e.g. testnet while the wallet is on mainnet).
|
|
15
|
+
* - `unsupported`: it doesn't index scripts (`script_index`), which the wallet needs.
|
|
16
|
+
*/
|
|
17
|
+
export type RostrumInstanceCheck =
|
|
18
|
+
| { status: 'online'; latency: number }
|
|
19
|
+
| { status: 'offline' | 'wrong_network' | 'unsupported' };
|
|
20
|
+
|
|
10
21
|
export interface ServerFeatures {
|
|
11
22
|
genesis_hash: string;
|
|
12
23
|
server_version: string;
|