callContractWithPlainConsoleOutput()
Use this method if you want to execute a function written in a smart contract and obtain the plain console output.
Method Signature
Future<dynamic> callContractWithPlainConsoleOutput(String blockchain, String from, String project, String request);Parameters
Name
Type
Description
blockchain
String
Blockchain address in hex
from
String
User's wallet address in hex
project
String
Smart Contract's address in hex
request
String
Requested function in string format (include the parenthesis and the semicolumn e.g. CRC_Contract.__GetContractName();).
Example
import 'package:circular_api/circular_api.dart';
void main() {
final circular = CircularAPI();
final blockchain = "0x8a20baa40c45dc5055aeb26197c203e576ef389d9acb171bd62da11dc5ad72b2";
final address = "0x248ea24763f3aeb2590114257b0b95ebc8fc40e287574aa25379bb24c6d661ec";
final contractAddress = "0x77796a30a3f0744ca73975547a24f939a1b93e121b3b7f50663c92d38d437d86"
final request = "CRC_Contract.__GetContractName();";
final wallet = await circular.callContract(blockchain, address, contractAddress, request);
}Result
ContractNameWrong function call. Remember to pass the request in Hex format as shown in the body section or to verify that the smart contract address is the right one.
{
"Result": 117,
"Response": "4552524f523a57726f6e672046756e6374696f6e2043616c6c3a200a",
"Node": "7bb5bd50729d6857942701d5673ea70ca1625f883230d8543970a452d1abe1c4"
}Last updated