-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathfacade.ts
More file actions
30 lines (26 loc) · 1.22 KB
/
facade.ts
File metadata and controls
30 lines (26 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import type { EvoSDK } from '../sdk.js';
import * as wasm from '../wasm.js';
export class ProtocolFacade {
private sdk: EvoSDK;
constructor(sdk: EvoSDK) { this.sdk = sdk; }
async versionUpgradeState(): Promise<wasm.ProtocolVersionUpgradeState> {
const w = await this.sdk.getWasmSdkConnected();
return w.getProtocolVersionUpgradeState();
}
async versionUpgradeStateWithProof(): Promise<wasm.ProofMetadataResponseTyped<wasm.ProtocolVersionUpgradeState>> {
const w = await this.sdk.getWasmSdkConnected();
return w.getProtocolVersionUpgradeStateWithProofInfo();
}
async versionUpgradeVoteStatus(startProTxHash: wasm.ProTxHashLike | undefined, count: number):
Promise<Map<string, wasm.ProtocolVersionUpgradeVoteStatus>> {
const w = await this.sdk.getWasmSdkConnected();
return w.getProtocolVersionUpgradeVoteStatus(startProTxHash, count);
}
async versionUpgradeVoteStatusWithProof(startProTxHash: wasm.ProTxHashLike | undefined, count: number):
Promise<wasm.ProofMetadataResponseTyped<
Map<string, wasm.ProtocolVersionUpgradeVoteStatus>
>> {
const w = await this.sdk.getWasmSdkConnected();
return w.getProtocolVersionUpgradeVoteStatusWithProofInfo(startProTxHash, count);
}
}