vechain_flutter_sdk 0.0.2-dev
vechain_flutter_sdk: ^0.0.2-dev copied to clipboard
A native Flutter/Dart SDK for VeChainThor. Pure Dart: wallets, transactions, fee delegation and VeBetter X-to-Earn integration.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Versioning by phase: each phase is built in small -dev sub-versions
and closes with a consolidation release. Phase 1 runs from 0.0.1-dev
and closes at 0.1.0-dev; Phase 2 starts at 0.1.1-dev and closes at
0.2.0-dev, and so on.
0.0.2-dev #
Phase 1 in progress: network configuration, the identity every transaction depends on.
Added #
VeChainNetwork: an immutable network definition withname,genesisId,nodeUrl, a derivedchainTag, and anodeUrigetter- Official networks as
constvalues, usable as default parameters:VeChainNetwork.mainnet(chain tag0x4a),VeChainNetwork.testnet(0x27) andVeChainNetwork.solo(0xf6) VeChainNetwork.customfor private or local nodes, with validation: non-empty name, a genesis ID of0xplus 64 hex characters, and an absolutehttp/httpsnode URL with a host- Input normalization in
VeChainNetwork.custom: surrounding whitespace is trimmed, the genesis ID is lowercased, and trailing slashes are removed from the node URL - Value equality (
==andhashCode) and a readabletoStringthat shows the chain tag in hex VeChainNetworkException, thrown for any invalid network definition- 27 unit tests covering the official constants, custom networks, normalization, equality, and every validation error
- Example:
example/phase1/network_example.dart
Design Decisions #
- The chain tag is derived from the last byte of the genesis ID instead of being stored, so a network with an inconsistent chain tag cannot be built
nodeUrlis aStringrather than aUri, becauseUricannot beconst; official networks need to beconstto work as default parameter values- The solo node uses
http://127.0.0.1:8669instead oflocalhost, following the official SDK, which does so to avoid IPv6 resolution issues - The EVM chain ID (
0x186a9on mainnet,0x186aaon testnet) is intentionally left out: native VeChain transactions use the chain tag, and the EVM chain ID will be added with the contracts phase
0.0.1-dev #
Added #
- Project scaffolding: package structure, MIT license, lint rules
(
very_good_analysis), CI workflow, andpre_commitscripts for macOS/Linux (.sh) and Windows (.ps1) - Test layout: unit tests in
test/src/mirroringlib/src/, and integration tests against the VeChain testnet intest/integration/