Explorer page with latest blocks. WIP

This commit is contained in:
Simon Lindh
2019-11-06 15:35:02 +08:00
parent 7344c518d3
commit 02d67e8406
22 changed files with 225 additions and 20 deletions

View File

@@ -94,6 +94,28 @@ class EsploraApi implements AbstractBitcoinApi {
}
});
}
getBlocks(): Promise<string> {
return new Promise(async (resolve, reject) => {
try {
const response: AxiosResponse = await this.client.get('/blocks');
resolve(response.data);
} catch (error) {
reject(error);
}
});
}
getBlocksFromHeight(height: number): Promise<string> {
return new Promise(async (resolve, reject) => {
try {
const response: AxiosResponse = await this.client.get('/blocks/' + height);
resolve(response.data);
} catch (error) {
reject(error);
}
});
}
}
export default EsploraApi;