ic_tools 1.0.9 copy "ic_tools: ^1.0.9" to clipboard
ic_tools: ^1.0.9 copied to clipboard

outdated

ic_tools in the dart-language.

ic_tools #


This is a package for the connection of the dart-code with the DFINITY-INTERNET-COMPUTER.

This package is for the Dart &: Flutter, on the Web &: Linux.


import 'dart:typed_data';
import 'package:ic_tools/ic_tools.dart';
import 'package:ic_tools/candid.dart';

Future<void> main() async {
    Canister ledger = Canister(Principal('ryjl3-tyaaa-aaaaa-aaaba-cai'));
    String icp_id = 'ecedd9b3595d88667b78315da6af8e0de29164ef718f96930e0459017d5d8a04';
    Record record = Record.oftheMap({ 'account': Text(icp_id) });
    Uint8List sponse_bytes = await ledger.call( calltype: 'call', method_name: 'account_balance_dfx', put_bytes: c_forwards([record]) );
    Record icpts_balance_record = c_backwards(sponse_bytes)[0] as Record;
    Nat64 e8s = icpts_balance_record['e8s'] as Nat64;
    double icp_count = e8s.value / 100000000; 
    print(icp_count);
}


runs with the sound-null-safety.


On the Linux:


On the web:

<script src="ic_tools_webfiles/unpkg_bignumber.js"></script>  
<script src="ic_tools_webfiles/cbor-web.js"></script>  
<script src="ic_tools_webfiles/rust_wasm_bls12381/rust_wasm_bls12381.js"></script>   

2
likes
0
pub points
26%
popularity

Publisher

unverified uploader

ic_tools in the dart-language.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

archive, base32, cbor, crypto, ed25519_edwards, ffi, http, js, tuple, typed_data

More

Packages that depend on ic_tools