Skip to content

Commit

Permalink
fix: show solana frozen account error for wallet ata
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhd committed Feb 9, 2024
1 parent 075a3ae commit 543446a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/static/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5773,7 +5773,7 @@
"title": "Account will be funded"
},
"SolanaTokenAccountFrozen": {
"title": "Account assets are frozen"
"title": "Token account assets are frozen"
},
"SolanaTokenAccounNotInitialized": {
"title": "Account not initialized"
Expand Down
3 changes: 3 additions & 0 deletions apps/ledger-live-mobile/src/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,9 @@
"SolanaAssociatedTokenAccountWillBeFunded": {
"title": "Account will be funded"
},
"SolanaTokenAccountFrozen": {
"title": "Token account assets are frozen"
},
"SolanaAddressOfEd25519": {
"title": "Address off ed25519 curve"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,17 @@ async function getTokenRecipient(
api,
));

if (!shouldCreateAsAssociatedTokenAccount) {
const associatedTokenAccount = await getMaybeTokenAccount(
recipientAssociatedTokenAccountAddress,
api,
);
if (associatedTokenAccount instanceof Error) throw recipientTokenAccount;
if (associatedTokenAccount?.state === "frozen") {
return new SolanaTokenAccountFrozen();
}
}

return {
walletAddress: recipientAddress,
shouldCreateAsAssociatedTokenAccount,
Expand Down

0 comments on commit 543446a

Please sign in to comment.