MsgCreateVestingAccount.fromJson constructor

MsgCreateVestingAccount.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory MsgCreateVestingAccount.fromJson(Map<String, dynamic> json) {
  return MsgCreateVestingAccount(
    fromAddress: json.valueAsString<String?>(
      'from_address',
      acceptCamelCase: true,
    ),
    toAddress: json.valueAsString<String?>(
      'to_address',
      acceptCamelCase: true,
    ),
    amount:
        (json.valueEnsureAsList<dynamic>('amount', acceptCamelCase: true))
            .map(
              (e) => JsonParser.valueTo<
                cosmos_base_v1beta1_coin.Coin,
                Map<String, dynamic>
              >(
                value: e,
                parse: (v) => cosmos_base_v1beta1_coin.Coin.fromJson(v),
              ),
            )
            .toList(),
    startTime: json.valueAsBigInt<BigInt?>(
      'start_time',
      acceptCamelCase: true,
    ),
    endTime: json.valueAsBigInt<BigInt?>('end_time', acceptCamelCase: true),
  );
}