Added OB getBlockNumber method

This commit is contained in:
Aleksandr Kraiz
2022-05-10 22:26:46 +04:00
parent b820b5b75f
commit af9168e3aa

View File

@@ -82,6 +82,8 @@ class OrionBlockchain {
this.getTargetAtomicSwapHistory = this.getTargetAtomicSwapHistory.bind(this);
this.checkPoolInformation = this.checkPoolInformation.bind(this);
this.checkIfHashUsed = this.checkIfHashUsed.bind(this);
this.getQueueLength = this.getQueueLength.bind(this);
this.getBlockNumber = this.getBlockNumber.bind(this);
}
get orionBlockchainWsUrl() {
@@ -190,6 +192,10 @@ class OrionBlockchain {
);
}
getBlockNumber() {
return fetchWithValidation(`https://${this.apiUrl}/api/blocknumber`, z.number().int());
}
getQueueLength() {
return fetchWithValidation(`https://${this.apiUrl}/api/queueLength`, z.number().int());
}