web3_universal_core 0.1.1 copy "web3_universal_core: ^0.1.1" to clipboard
web3_universal_core: ^0.1.1 copied to clipboard

Core utilities for Web3 Universal SDK - address handling, BigInt tools, and RLP encoding.

example/main.dart

import 'dart:typed_data';
import 'package:web3_universal_core/web3_universal_core.dart';

void main() {
  print('--- Web3 Universal Core Example ---');

  // 1. Hex Utilities
  final bytes = Uint8List.fromList([71, 111, 111, 103, 108, 101]);
  final hex = HexUtils.encode(bytes);
  print('Hex encoded: 0x$hex');

  // 2. Ethereum Address Handling
  const addrStr = '0x1234567890123456789012345678901234567890';
  final address = EthereumAddress.fromHex(addrStr);
  print('Checksum address: ${address.hex}');

  // 3. Unit Conversions (Wei/Gwei/Ether)
  final amountInWei = BigInt.from(10).pow(17); // 0.1 ETH
  final ether = EthUnit.formatEther(amountInWei);
  print('Amount: $ether ETH');

  // 4. RLP Encoding
  final rlpEncoded = RLP.encode(['hello', 100]);
  print('RLP Encoded: ${HexUtils.encode(rlpEncoded)}');
}
0
likes
160
points
84
downloads

Publisher

unverified uploader

Weekly Downloads

Core utilities for Web3 Universal SDK - address handling, BigInt tools, and RLP encoding.

Homepage
Repository (GitHub)
View/report issues

Topics

#web3 #ethereum #multisig #blockchain

Documentation

API reference

License

MIT (license)

More

Packages that depend on web3_universal_core