transferAlias method Null safety
- String alias,
- String recipient,
- int amount,
- [ResponseCallback<
MsgTransferAliasResponse> ? callback]
transferAlias
is a function that takes a String
called alias
, a String
called recipient
,
an int
called amount
, and an optional ResponseCallback<MsgTransferAliasResponse>
called
callback
and returns a Future<void>
Args:
alias (String): The alias of the account to transfer from
recipient (String): The address of the recipient.
amount (int): The amount of coins to transfer.
callback (ResponseCallback
Implementation
Future<MsgTransferAliasResponse?> transferAlias(String alias, String recipient, int amount,
[ResponseCallback<MsgTransferAliasResponse>? callback]) async {
final resp = await MotorFlutterPlatform.instance.transferAlias(MsgTransferAlias(
alias: alias,
amount: amount,
recipient: recipient,
creator: address.value,
));
if (callback != null) {
callback(resp);
}
if (resp != null) {
domain.value = alias;
}
return resp;
}