Skip to content

Commit

Permalink
Check if recipient account exists
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyar committed Apr 15, 2021
1 parent 3a97188 commit a79c633
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ exports.login = async function (options) {
// Browser not opened, as will open automatically for opened port
} else {
newUrl.searchParams.set('success_url', `http://${tempUrl.hostname}:${tempUrl.port}`);
openUrl(newUrl);
openUrl(newUrl);
}
} else if (isWin) {
// redirect automatically on windows, but do not use the browser callback
Expand Down Expand Up @@ -211,6 +211,8 @@ exports.sendMoney = async function (options) {
console.log(`Sending ${options.amount} NEAR to ${options.receiver} from ${options.sender}`);
const near = await connect(options);
const account = await near.account(options.sender);
const receiver = await near.account(options.receiver);
await receiver.state();
const result = await account.sendMoney(options.receiver, utils.format.parseNearAmount(options.amount));
inspectResponse.prettyPrintResponse(result, options);
};
Expand Down

0 comments on commit a79c633

Please sign in to comment.