Skip to content

Commit

Permalink
Confirm wallet transfers before logging success
Browse files Browse the repository at this point in the history
  • Loading branch information
acheroncrypto committed Feb 1, 2024
1 parent d6e96a9 commit 7b6cfa0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/src/components/Wallet/Send.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,12 @@ const SendExpanded = () => {
lamports: PgCommon.solToLamports(parseFloat(amount)),
});
const tx = new Transaction().add(ix);
const txHash = await PgCommon.transition(PgTx.send(tx));
const txHash = await PgTx.send(tx);
PgTx.notify(txHash);

const txResult = await PgCommon.transition(PgTx.confirm(txHash));
if (txResult?.err) throw txResult.err;

msg = PgTerminal.success("Success.");

// Reset inputs
Expand Down

0 comments on commit 7b6cfa0

Please sign in to comment.