You can create the instance of a Contract, which provides various methods like getBalance listEntrypoint and others discussed below.

import 'package:tezster_dart/tezster_dart.dart';

var contract = Contract(
        rpcServer: "<https://mainnet.api.tez.ie>",// The rpc Node
        address: "KT1DLif2x9BtK6pUq9ZfFVVyW5wN2kau9rkW");// address of contract on the network

Get balance of the contract

you can call the getBalance method on the instance of contract object which returns Future<String>. you can also pass the optional name parameters in the method block and chain in this method.

var contract = Contract(
        rpcServer: "<https://mainnet.api.tez.ie>",
        address: "KT1DLif2x9BtK6pUq9ZfFVVyW5wN2kau9rkW");
        String getBalance= await contract.getBalance();

List all the entry point of a contract

We provide a method listEntrypoints which can be used to get all the entry points in a contract this method returns the Future<List<String>>.

Note : In case of single entry point contract the name of the entry point is default.

var contract = Contract(
        rpcServer: "<https://mainnet.api.tez.ie>",
        address: "KT1DLif2x9BtK6pUq9ZfFVVyW5wN2kau9rkW");
        var entrypoint=await contract.listEntrypoints();

Get Contract Storage

You can get the contract storage by creating the instance of Contract object and calling getStorage method on it. In most cases you won’t need this, for production level apps we usually use blockchain indexers to get contract storage. This method returns a Future<Map>.

 var contract = TezsterDart.getContract(
        "<https://mainnet.api.tez.ie>", "KT1DLif2x9BtK6pUq9ZfFVVyW5wN2kau9rkW");
    Map storage = await contract.getStorage();

Invoking a contract

We provide a method to call entry point on a deployed Contract. You can use callEntrypoint by creating a signer first with the TezsterDart.createSigner function. You can pass the parameter in either Michelson, Micheline and Michelson Lambda format. You can see the below examples.