Skip to content

Commit

Permalink
fix: from account existance
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed May 2, 2024
1 parent e56bd10 commit 4959d95
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,14 @@ const validateFields = async () => {
if (isAddress.value) {
const to = props.network.displayAddress(addressTo.value);
const from = props.network.displayAddress(addressFrom.value);
const accountDetailFrom = await accountAssets.value[0].getAccountDetails(
from,
props.network
);
if (accountDetailFrom.error) {
errorMsg.value = "Not enough balance"; // account doesnt exist
return;
}
if (!props.network.isAddress(to)) {
const accountDetail = await accountAssets.value[0].getAccountDetails(
to,
Expand All @@ -208,7 +215,6 @@ const validateFields = async () => {
return;
}
}
if (to == from) {
fieldsValidation.value.addressTo = false;
errorMsg.value = '"To" address cannot be the same as "From" address';
Expand Down Expand Up @@ -255,6 +261,7 @@ const validateFields = async () => {
if (transactionResult.result.status !== "success") {
fieldsValidation.value.amount = false;
console.log(transactionResult.result.error);
errorMsg.value =
(transactionResult.result.error as any).message ||
"An error occurred";
Expand Down

1 comment on commit 4959d95

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.