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 Jan 16, 2024
1 parent 4e501d5 commit 28e6323
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 @@ -5762,7 +5762,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 28e6323

Please sign in to comment.