Catch all estimate fee errors.

This commit is contained in:
muzam1l
2023-03-17 19:01:32 +05:30
parent e27a71d713
commit 5d8d142bc4

View File

@@ -24,6 +24,9 @@ const estimateFee = async (
const { signedTransaction } = sign(copyTx, keypair)
const res = await xrplSend({ command: 'fee', tx_blob: signedTransaction })
if (res.error) {
throw new Error(`[${res.error}] ${res.error_exception}`);
}
if (res && res.drops) {
return res.drops
}