setFeeGranter method

void setFeeGranter(
  1. String? granter
)

Sets the given granter as the transaction fee granter.

Implementation

void setFeeGranter(String? granter) {
  // Do not include default values as per ADR-027
  if (granter == null || granter.isEmpty) {
    return;
  }

  // Create auth info if not existing
  if (!_stdTx.hasAuthInfo()) {
    _stdTx.authInfo = AuthInfo.create();
  }

  // Create fee if not existing
  if (!_stdTx.authInfo.hasFee()) {
    _stdTx.authInfo.fee = Fee.create();
  }

  // Set the fee amount
  _stdTx.authInfo.fee.granter = granter;
}