getRoyaltyParams method

Future<({BigInt denominator, InternalAddress? destination, bool init, BigInt numerator})> getRoyaltyParams()

Returns the royalty parameters of the NFT from the contract as a record, wrapped in a Future:

Future<({
  bool init,
  BigInt numerator,
  BigInt denominator,
  InternalAddress? destination,
})>

Throws 'ContractProvider field was not initialized' if provider is null

Implementation

Future<
    ({
      bool init,
      BigInt numerator,
      BigInt denominator,
      InternalAddress? destination,
    })> getRoyaltyParams() async {
  if (provider == null) {
    throw 'ContractProvider field was not initialized';
  }
  final res = await provider!.get('royalty_params', []);
  var init = res.stack.readBool();
  var numerator = res.stack.readBigInt();
  var denominator = res.stack.readBigInt();
  var destination = res.stack.readAddressOrNull();

  return (
    init: init,
    numerator: numerator,
    denominator: denominator,
    destination: destination,
  );
}