Skip to content

Commit 9887fd6

Browse files
committed
fix(spl): use sol's address validation for tokens, too
1 parent 553c2a8 commit 9887fd6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/pages/send_view/sol_token_send_view.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,22 +322,18 @@ class _SolTokenSendViewState extends ConsumerState<SolTokenSendView> {
322322
return null;
323323
}
324324
if (address.isNotEmpty) {
325-
// TODO: Implement Solana address validation.
326-
// For now, perform basic length check (44 chars is typical for Solana addresses).
327-
if (address.length < 32 || address.length > 44) {
325+
if (!Solana(CryptoCurrencyNetwork.main).validateAddress(address)) {
328326
return "Invalid address";
329327
}
330328
}
331329
return null;
332330
}
333331

334332
void _updatePreviewButtonState(String? address, Amount? amount) {
335-
// TODO: Implement Solana address validation.
336333
final isValidAddress =
337334
address != null &&
338335
address.isNotEmpty &&
339-
address.length >= 32 &&
340-
address.length <= 44;
336+
Solana(CryptoCurrencyNetwork.main).validateAddress(address);
341337
ref.read(previewTokenTxButtonStateProvider.state).state =
342338
(isValidAddress && amount != null && amount > Amount.zero);
343339
}

0 commit comments

Comments
 (0)