Skip to main content

vechain_flutter_sdk 0.0.4-dev copy "vechain_flutter_sdk: ^0.0.4-dev" to clipboard
vechain_flutter_sdk: ^0.0.4-dev copied to clipboard

A native Flutter/Dart SDK for VeChainThor. Pure Dart: wallets, transactions, fee delegation and VeBetter X-to-Earn integration.

License: MIT Dart Flutter CI Status

English | Español

vechain_flutter_sdk #

A native Flutter/Dart SDK for the VeChainThor blockchain. Pure Dart · No platform channels · MIT · pub.dev

Status: Early Development - API is not stable. Phase 1 (Foundations) in progress. See CHANGELOG.md for details.

Built to be the foundation for mobile X-to-Earn apps on VeChain: wallets, multi-clause transactions, dynamic fees (Galactica), native fee delegation (VIP-191), smart contracts, and VeBetterDAO integration, all in one native Dart package.

Roadmap (v1.0.0) #

Phase Focus Versions Status
1 Foundations (networks, keys, mnemonics, HD wallet, keystore) 0.1.x 🔄 In progress
2 Thor REST client (accounts, blocks, receipts, fees) 0.2.x ⏳ Planned
3 Transactions (clauses, intrinsic gas, legacy and dynamic fee) 0.3.x ⏳ Planned
4 Fee delegation (VIP-191, local and remote gas payer) 0.4.x ⏳ Planned
5 Contracts and tokens (ABI, ERC-20, events) 0.5.x ⏳ Planned
6 VeBetter integration (B3TR, VOT3, X2Earn rewards) 0.6.x ⏳ Planned
7 Certificates (VIP-192) and demo app 0.7.x ⏳ Planned
- Stable release 1.0.0 ⏳ Planned

Documentation & Knowledge Base #

This SDK is built on top of the VeChain Knowledge Base, a beginner-friendly guide to VeChainThor covering its consensus, dual-token model, transaction model, fee delegation, and the VeBetterDAO 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:
  vechain_flutter_sdk: ^0.0.4-dev
flutter pub get

Quick Start #

Quick Start #

import 'dart:convert';
import 'dart:typed_data';

import 'package:vechain_flutter_sdk/vechain_flutter_sdk.dart';

// The official networks are predefined const values, so they can be
// used as default parameters. The chain tag is derived from the
// genesis block ID (its last byte), so the two can never disagree.
const network = VeChainNetwork.testnet;
print(network.chainTag); // 39 (0x27)
print(network.nodeUrl); // https://testnet.vechain.org
// A custom network points to your own node. Inputs are validated and
// normalized (lowercase genesis ID, no trailing slash); invalid values
// throw VeChainNetworkException instead of producing a broken network.
final myNode = VeChainNetwork.custom(
  name: 'my-mainnet-node',
  genesisId:
      '0x00000000851caf3cfdb6e899cf5958bfb1ac3413d346d43539627e6be7ec1b4a',
  nodeUrl: 'https://my-node.example.com/',
);
print(myNode.chainTag); // 74 (0x4a)
print(myNode.nodeUrl); // https://my-node.example.com
// VeChainThor uses two 32-byte hashes: BLAKE2b-256 for transaction
// signing hashes and IDs, and Keccak-256 (legacy Keccak, as in
// Ethereum, not SHA3-256) for addresses and ABI encoding.
final data = Uint8List.fromList(utf8.encode('VeChainThor'));
final blake = VeChainHash.blake2b256(data); // Uint8List, 32 bytes
final keccak = VeChainHash.keccak256(data); // Uint8List, 32 bytes

// Hashing several parts equals hashing them joined, the same way the
// node builds a transaction ID from its signing hash and sender.
final txIdLike = VeChainHash.blake2b256Concat([blake, keccak]);
// VeChainHex converts bytes to the 0x-prefixed strings used by the
// VeChainThor APIs. Decoding is strict: a missing digit is rejected,
// never padded, because a padded value would be different bytes.
print(VeChainHex.encode(blake)); // 0x... (64 lowercase hex digits)
final bytes = VeChainHex.decode('0xCAFE'); // [202, 254]
VeChainHex.decode('0xabc'); // throws VeChainCodecException
// A key pair holds a secp256k1 private key, its public key in both
// formats, and the account address. Printing it shows only the
// address, so a key pair in a log never leaks its private key.
final keyPair = VeChainKeyPair.generate();
print(keyPair.address); // 0x... (EIP-55 checksum)
print(keyPair.publicKey.length); // 65 (uncompressed)
print(keyPair.compressedPublicKey.length); // 33

// Restoring from the private key always gives the same account.
final restored = VeChainKeyPair.fromPrivateKey(keyPair.privateKey);
print(restored.address == keyPair.address); // true
// Addresses are parsed strictly. All-lowercase and all-uppercase forms
// carry no checksum and are accepted; a mixed-case address must match
// its EIP-55 checksum, so one mistyped character is caught. Short
// addresses are rejected, never padded with zeros.
final address = VeChainAddress.parse(
  '0x769e8aa372c8309c834ea6749b88861ff73581ff',
);
print(address); // 0x769E8AA372c8309c834EA6749B88861FF73581FF
VeChainAddress.parse('0x769F8AA372c8309c834EA6749B88861FF73581FF');
// throws VeChainAddressException (checksum mismatch)

Networks #

Network Chain Tag Node URL Explorer
Mainnet 0x4a https://mainnet.vechain.org explore.vechain.org
Testnet 0x27 https://testnet.vechain.org explore-testnet.vechain.org
Solo 0xf6 http://127.0.0.1:8669 Local node

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 the MIT License.

For LATAM developers #

This SDK is being developed with native support for the region in mind:

  • Bilingual documentation (English / Spanish) from the very first module.
  • Part of Nemorix Group's SDK ecosystem for financial infrastructure in LATAM (Hedera, Avalanche, XRPL, Solana, Flare, Stronghold, VeChain).
  • Developed by Nemorix Group, Ohio, USA.

Follow us for updates: 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 VeChain and Flutter community. Thank you!

Buy Me a Coffee Sponsor Ko-fi


Built by Nemorix Group · MIT

1
likes
0
points
748
downloads

Publisher

verified publishernemorixpay.com

Weekly Downloads

A native Flutter/Dart SDK for VeChainThor. Pure Dart: wallets, transactions, fee delegation and VeBetter X-to-Earn integration.

Repository (GitHub)
View/report issues

Topics

#vechain #vet #blockchain #web3 #flutter

License

unknown (license)

Dependencies

flutter, meta, pointycastle

More

Packages that depend on vechain_flutter_sdk