interact method
Implementation
Future<String> interact({
required ContractFunctionWithValues function,
required Uint8List seed,
required String sender,
EvmFeeInformation? feeInfo,
BigInt? value,
List<AccessListItem>? accessList,
}) async {
final functionData = function.buildDataField();
if (value != null) {
assert(
function.stateMutability == StateMutability.payable,
'Function is not payable and cannot accept a value',
);
} else {
assert(
function.stateMutability == StateMutability.nonpayable,
'Function is payable and requires a value to be sent',
);
}
return await rpc.buildAndBroadcastTransaction(
sender: sender,
recipient: contractAddress,
seed: seed,
feeInfo: feeInfo,
data: functionData,
value: value ?? BigInt.zero,
accessList: accessList,
);
}