isErc1155 function

Future<bool> isErc1155({
  1. required String contractAddress,
  2. required EvmRpcInterface rpc,
  3. required String address,
})

Implementation

Future<bool> isErc1155({
  required String contractAddress,
  required EvmRpcInterface rpc,
  required String address,
}) async {
  bool isErc1155 = false;
  try {
    await rpc.fetchERC1155BalanceOfToken(
      address: address,
      tokenID: BigInt.from(0),
      contractAddress: contractAddress,
    );
    isErc1155 = true;
  } catch (e) {
    isErc1155 = false;
  }
  return isErc1155;
}