setApproveofAll method

Future<String> setApproveofAll(
  1. String owner___PrivateKey,
  2. String contract___add,
  3. String spender___Add,
  4. bool boolValue,
)

Enable or disable approval for a third party ("operator") to manage all of Owner's assets Emits the ApprovalForAll event. The contract MUST allow multiple operators per owner. token_address An address for whom to query . operatorAddress An address for whoom you want to give to give Approve Status. approvedStatus true if the operator is approved, false to revoke approval ownerPrivateKey PrivateKey Of The Token Owner . tokenId The identifier for an NFT

Implementation

Future<String> setApproveofAll(String owner___PrivateKey,
    String contract___add, String spender___Add, bool boolValue) async {
  final String privateKey = owner___PrivateKey;
  final credentials = await EthPrivateKey.fromHex(privateKey);

  final EthereumAddress contractAddr =
      EthereumAddress.fromHex(contract___add);

  final contract =
      DeployedContract(ContractAbi.fromJson(abiFile, 'XRC721'), contractAddr);
  final tokenApprove = contract.function('setApprovalForAll');
  final EthereumAddress spender = EthereumAddress.fromHex(spender___Add);
  final setApprove = await Transaction.callContract(
      contract: contract,
      function: tokenApprove,
      parameters: [spender, boolValue]);
  final setapprovel = await client.sendTransaction(credentials, setApprove,
      chainId: null, fetchChainIdFromNetworkId: true);

  return ('$setapprovel');
}