avalanche_flutter_sdk 0.0.3-dev
avalanche_flutter_sdk: ^0.0.3-dev copied to clipboard
The first native Flutter/Dart SDK for the Avalanche network. Pure Dart, no platform channels. Covers C-Chain EVM, Data API (Glacier), P-Chain staking, and X-Chain native assets.
avalanche_flutter_sdk #
The first native Flutter/Dart SDK for the Avalanche network.
Pure Dart · No platform channels · Apache 2.0 · pub.dev
⚠️ Status: Early Development - API is not stable.
Current phase: M1 - Architecture + Crypto/Wallet.
Planned Features (v1.0.0) #
| Feature | Status |
|---|---|
| AvalancheClient + NetworkConfig (Mainnet / Fuji) | ✅ Done |
| secp256k1 PrivateKey / PublicKey | ✅ Done |
| CB58 encoding / decoding | ✅ Done |
| BIP-39 mnemonics (EN + ES) | ✅ Done |
| HD key derivation (BIP-44) | 🔄 M1 |
| EVM + X/P-Chain address derivation | 🔄 M1 |
| C-Chain EVM (EIP-1559, ERC-20/721/1155) | ⏳ M2 |
| Data API / Glacier (REST + WebSocket) | ⏳ M3 |
| P-Chain staking | ⏳ M4 |
| X-Chain native assets | ⏳ M4 |
SDK Documentation & Knowledge Base #
This SDK is built on top of the Avalanche Knowledge Base, an in-depth guide to the Avalanche network covering consensus, architecture, multi-chain design, and the development ecosystem. Recommended reading before diving into the SDK internals.
Every implementation decision behind this SDK - library choices, encoding standards, verification against official specs - is documented in docs-sdk/.
Installation #
# pubspec.yaml
dependencies:
avalanche_flutter_sdk: ^0.0.3-dev
flutter pub get
Quick Start #
Network Configuration #
import 'package:avalanche_flutter_sdk/avalanche_flutter_sdk.dart';
// Fuji Testnet
final client = AvalancheClient(network: NetworkConfig.fuji);
print(client.network.cChainRpcUrl);
// -> https://api.avax-test.network/ext/bc/C/rpc
// Mainnet
final client = AvalancheClient(network: NetworkConfig.mainnet);
print(client.network.networkId); // -> 1
Key Generation (secp256k1) #
// Generate a new private key
final privateKey = PrivateKey.generate();
// Derive the public key
final publicKey = privateKey.publicKey;
// Export / import via hex
final hex = privateKey.toHex(); // 64 hex chars (32 bytes)
final imported = PrivateKey.fromHex(hex); // round-trips correctly
// Private keys are always redacted in logs - key material is never exposed
print(privateKey); // PrivateKey[REDACTED]
print(publicKey); // PublicKey(0x02b33c...)
Public Key Encodings #
final publicKey = PrivateKey.generate().publicKey;
// Compressed (33 bytes) - required for X-Chain / P-Chain address derivation
// sha256(compressed) -> ripemd160 -> address
final compressed = publicKey.toCompressed();
// Raw uncompressed (64 bytes, no 0x04 prefix) - required for C-Chain
// EVM address derivation: keccak256(raw) -> last 20 bytes -> 0x... address
final raw = publicKey.toRawUncompressed();
CB58 Encoding / Decoding #
// Encode raw bytes to CB58 (used for PrivateKey export, NodeID, etc.)
final bytes = Uint8List.fromList([1, 2, 3, 4, 5]);
final encoded = CB58.encode(bytes); // e.g. "3HCXF4n..."
final decoded = CB58.decode(encoded); // back to original bytes
// PrivateKey in Avalanche export format: "PrivateKey-<cb58>"
final privateKey = PrivateKey.generate();
final exportString = 'PrivateKey-${CB58.encode(privateKey.toBytes())}';
BIP-39 Mnemonics (English + Spanish) #
// Generate a 12-word English mnemonic (default)
final mnemonic = Mnemonic.generate();
print(mnemonic.phrase);
// -> "abandon ability able about above absent absorb..."
// Generate a 24-word Spanish mnemonic
final mnemonicEs = Mnemonic.generate(
strength: MnemonicStrength.words24,
wordlist: WordlistEs.instance,
);
print(mnemonicEs.phrase);
// -> "ábaco abdomen abeja abierto abogado..."
// Import from existing phrase (validates checksum automatically)
final imported = Mnemonic.fromPhrase(
'abandon abandon abandon abandon abandon abandon '
'abandon abandon abandon abandon abandon about',
);
// Reconstruct original entropy
final entropy = imported.toEntropy();
// Mnemonics are always redacted in logs
print(mnemonic); // Mnemonic[REDACTED]
// Use .phrase explicitly when display is intentional
print(mnemonic.phrase); // the actual phrase
Networks #
| Network | Chain ID | C-Chain RPC |
|---|---|---|
| Mainnet | 1 | https://api.avax.network/ext/bc/C/rpc |
| Fuji Testnet | 5 | https://api.avax-test.network/ext/bc/C/rpc |
Contributing #
The SDK is not ready for external contributions yet. Follow this repository for updates; contributions will be welcome starting with v1.0.0.
See CONTRIBUTING.md for future guidelines.
License #
Licensed under Apache 2.0.
Para desarrolladores en LATAM #
Este SDK esta siendo desarrollado con soporte nativo para la region:
- Mnemonics BIP-39 en español ✅ disponible desde v0.0.3-dev
- Caso de uso principal: remesas Estados Unidos hacia Latinoamerica
- Desarrollado por Nemorix Group, Ohio, USA
Siguenos para actualizaciones: sdks@nemorixpay.com
Support This Project #
If this SDK is useful to you or your team, consider supporting its development. Every contribution helps cover infrastructure, documentation, and the time invested in building and maintaining this open source tool for the Avalanche and Flutter community. Thank you!
Built by Nemorix Group · Apache 2.0