Skip to content

Commit

Permalink
resolve trycatch error in sendTx function
Browse files Browse the repository at this point in the history
  • Loading branch information
raviycoder committed Jul 26, 2024
1 parent 71ff660 commit 23e99b2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ <h4 class="app-name__title">Binance Smart Chain</h4>
<div class="grid gap-0-5">
<h4>Did you forget your Binance Address?</h4>
<p>
If you have your BSC/BTC/FLO Private Key, enter it here and recover your
Binance Address.
If you have your BSC/BTC/FLO Private Key, enter it here and recover
your Binance Address.
</p>
</div>
<sm-form>
Expand Down Expand Up @@ -1603,7 +1603,9 @@ <h4>Receiver</h4>
getRef("sender_balance_container").classList.add("hidden");
} catch (e) {
console.error(e.message);
showTransactionResult("failed", {description:e.message});
showTransactionResult("failed", {
description: `Insufficient ${asset.toUpperCase()} balance`,
});
const regex = /\(error=({.*?}),/;
const match = e.message.match(regex);
if (match && match[1]) {
Expand Down Expand Up @@ -1829,9 +1831,9 @@ <h5>Bitcoin Private Key</h5>
let bscPrivateKey = getRef("retrieve_btc_addr_field").value.trim();
getRef("recovered_btc_addr_wrapper").classList.remove("hidden");
getRef("recovered_btc_addr").value =
bscPrivateKey.startsWith("R") ||
bscPrivateKey.startsWith("L") ||
bscPrivateKey.startsWith("K")
bscPrivateKey.startsWith("R") ||
bscPrivateKey.startsWith("L") ||
bscPrivateKey.startsWith("K")
? floEthereum.ethAddressFromPrivateKey(
coinjs.wif2privkey(bscPrivateKey).privkey
)
Expand Down

0 comments on commit 23e99b2

Please sign in to comment.