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

retracted

Tools for communicating with the world-computer.

ic_tools #

Pub Version #

This is a package that connects dart-code with the world-computer.

For the Dart & Flutter, on the Web & Linux.

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

main() async {
    
    Caller caller = Caller(keys: await Ed25519Keys.new_keys());
    print(caller.principal);
    
    Canister icp_ledger = Canister(Principal.text('ryjl3-tyaaa-aaaaa-aaaba-cai'));

    Uint8List sponse_bytes = await icp_ledger.call(
        calltype: CallType.query,
        method_name: 'icrc1_balance_of',
        put_bytes: c_forwards_one(
            Record.of_the_map({
                'owner': caller.principal,
                'subaccount': Option(value: null, value_type: Blob.type_mode())
            })
        )
    );
    BigInt e8s = (c_backwards_one(sponse_bytes) as Nat).value; 
    Tokens icp_tokens = Tokens(quantums: e8s, decimal_places: 8);
    print(icp_tokens);    

}

On A Linux:

On The Web:

<script src="ic_tools_webfiles/rust_wasm_bls12381/rust_wasm_bls12381.js"></script>   
2
likes
0
points
137
downloads

Publisher

unverified uploader

Weekly Downloads

Tools for communicating with the world-computer.

Repository (GitHub)
View/report issues

Topics

#cryptography #blockchain #world-computer #internet-computer #agent

License

unknown (license)

Dependencies

archive, base32, collection, convert, crypto, cryptography, ffi, hex, http, ieee754, js, meta, tuple, typed_data

More

Packages that depend on ic_tools