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

Cosmos blockchain extension for Web3 Universal SDK - Protobuf, IBC, and Staking support.

example/main.dart

import 'package:web3_universal_cosmos/web3_universal_cosmos.dart';

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

  // 1. Cosmos Address Generation
  const addressStr = 'cosmos1qypqxpqxpqxpqxpqxpqxpqxpqxpqxpqxpq';
  final address = CosmosAddress.fromString(addressStr);
  print('Parsed Address: ${address.address}');

  // 2. Client Interaction (Mock URL example)
  final client = CosmosClient('https://rest.cosmos.directory/cosmoshub');
  print('Cosmos client initialized: $client');

  // 3. Message Building
  final sendMsg = MsgSend(
    fromAddress: addressStr,
    toAddress: 'cosmos1...',
    amount: [
      Coin(denom: 'uatom', amount: '1000000'), // 1 ATOM
    ],
  );
  print(
      'Created MsgSend for ${sendMsg.amount[0].amount} ${sendMsg.amount[0].denom}');
}
0
likes
140
points
11
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Cosmos blockchain extension for Web3 Universal SDK - Protobuf, IBC, and Staking support.

Homepage
Repository (GitHub)
View/report issues

Topics

#web3 #cosmos #ibc #blockchain

License

MIT (license)

Dependencies

fixnum, http, protobuf, web3_universal_core, web3_universal_crypto

More

Packages that depend on web3_universal_cosmos