getAllLBPairs method

Future<(int, String, bool, bool)> getAllLBPairs(
  1. TokenName token1,
  2. TokenName token2
)

getAllLBPairs returns pairs information

Implementation

Future<(int, String, bool, bool)> getAllLBPairs(TokenName token1, TokenName token2) async {
  final params = Args();
  params.addString(getTokenAddress(token1, grpc.isBuildnet));
  params.addString(getTokenAddress(token2, grpc.isBuildnet));

  const targetFunction = "getAllLBPairs";
  const smartContracAddress = BuildnetConstants.factoryAddress;
  final response = await grpc.scReadOnlyCall(
      maximumGas: CommonConstants.minimumFee,
      smartContracAddress: smartContracAddress,
      functionName: targetFunction,
      functionParameters: params.serialise());
  await grpc.close();

  final responseArg = Args(initialData: response);
  final binStep = responseArg.nextU32();
  final lBPair = responseArg.nextString();
  final createdByOwner = responseArg.nextBool();
  final isBlacklisted = responseArg.nextBool();
  return (binStep, lBPair, createdByOwner, isBlacklisted);
}