Skip to content

bchainhub/flutter_wallet_validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter Wallet Validator

pub package License: CORE Flutter Platform Dart SDK Version

A comprehensive Flutter library for validating blockchain wallet addresses across multiple networks.

Features

  • 🚀 Lightweight: Minimal impact on app size
  • 🔒 Type-safe: Written in Dart with full type definitions
  • Fast: No heavy dependencies
  • 🧪 Well-tested: Production-ready test coverage
  • 🌐 Multi-network support:
    • Algorand
    • Bitcoin (Legacy, SegWit, Native SegWit)
    • Bitcoin Cash
    • Cardano
    • Core (ICAN)
    • Cosmos ecosystem (Cosmos, Osmosis, Juno, etc.)
    • NS domains on ENS standard (including subdomains and emoji support)
    • EVM-compatible chains (Ethereum, Polygon, BSC, etc.)
    • Litecoin (Legacy, SegWit, Native SegWit)
    • Polkadot
    • Ripple (XRP)
    • Solana
    • Stellar
    • Tron
  • 📦 Modern package:
    • Null safety
    • Platform independent
    • Zero configuration
    • Works on all Flutter platforms

Installation

dependencies:
  flutter_wallet_validator: ^0.1.2

Run:

flutter pub get

Usage

Basic Example

import 'package:flutter_wallet_validator/flutter_wallet_validator.dart';

void main() {
  // Validate an Ethereum address
  final result = validateWalletAddress(
    '0x4838B106FCe9647Bdf1E7877BF73cE8B0BAD5f97',
  );
  print(result);
  // NetworkInfo(
  //   network: 'evm',
  //   isValid: true,
  //   description: 'Ethereum Virtual Machine compatible address',
  //   metadata: {'isChecksumValid': true}
  // )
}

With Options

// Validate with specific networks enabled
final result = validateWalletAddress(
  'vitalik.eth',
  options: ValidationOptions(
    network: ['ns'],
    nsDomains: ['eth'],
    testnet: false,
  ),
);

Flutter Widget Example

class WalletAddressValidator extends StatelessWidget {
  final String address;

  const WalletAddressValidator({
    super.key,
    required this.address,
  });

  @override
  Widget build(BuildContext context) {
    final result = validateWalletAddress(address);

    return Card(
      child: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text('Network: ${result.network ?? 'Unknown'}'),
            Text('Valid: ${result.isValid}'),
            Text('Description: ${result.description ?? 'N/A'}'),
            if (result.metadata != null)
              Text('Metadata: ${result.metadata}'),
          ],
        ),
      ),
    );
  }
}

Platform Support

Android iOS Web macOS Windows Linux WASM

Environment

  • 🎯 Dart SDK: >=3.5.0 <4.0.0
  • 💙 Flutter: >=3.29.1
  • 📱 Platforms: All Flutter supported platforms

Security

This package helps validate the format of blockchain addresses but does not guarantee the security or ownership of the addresses. Always verify addresses through multiple sources before sending any transactions.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

Licensed under the CORE License.

About

Blockchain Wallet Addresses Validator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages