Adding new getTransactionHex api

This commit is contained in:
softsimon
2022-11-22 21:45:05 +09:00
parent 4f3296566a
commit 584f443f56
4 changed files with 16 additions and 5 deletions

View File

@@ -20,6 +20,11 @@ class ElectrsApi implements AbstractBitcoinApi {
.then((response) => response.data);
}
$getTransactionHex(txId: string): Promise<string> {
return axios.get<string>(config.ESPLORA.REST_API_URL + '/tx/' + txId + '/hex', this.axiosConfig)
.then((response) => response.data);
}
$getBlockHeightTip(): Promise<number> {
return axios.get<number>(config.ESPLORA.REST_API_URL + '/blocks/tip/height', this.axiosConfig)
.then((response) => response.data);