QueryTraceBlockRequest.fromJson constructor

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

Implementation

factory QueryTraceBlockRequest.fromJson(Map<String, dynamic> json) {
  return QueryTraceBlockRequest(
    txs:
        (json.valueEnsureAsList<dynamic>('txs', acceptCamelCase: true))
            .map(
              (e) => JsonParser.valueTo<
                ethermint_evm_v1_tx.MsgEthereumTx,
                Map<String, dynamic>
              >(
                value: e,
                parse: (v) => ethermint_evm_v1_tx.MsgEthereumTx.fromJson(v),
              ),
            )
            .toList(),
    traceConfig: json
        .valueTo<ethermint_evm_v1_evm.TraceConfig?, Map<String, dynamic>>(
          key: 'trace_config',
          parse: (v) => ethermint_evm_v1_evm.TraceConfig.fromJson(v),
          acceptCamelCase: true,
        ),
    blockNumber: json.valueAsBigInt<BigInt?>(
      'block_number',
      acceptCamelCase: true,
    ),
    blockHash: json.valueAsString<String?>(
      'block_hash',
      acceptCamelCase: true,
    ),
    blockTime: json.valueTo<google_protobuf_timestamp.Timestamp?, String>(
      key: 'block_time',
      parse: (v) => google_protobuf_timestamp.Timestamp.fromRfc3339(v),
      acceptCamelCase: true,
    ),
    proposerAddress: json.valueAsBytes<List<int>?>(
      'proposer_address',
      acceptCamelCase: true,
      encoding: StringEncoding.base64,
    ),
    chainId: json.valueAsBigInt<BigInt?>('chain_id', acceptCamelCase: true),
    blockMaxGas: json.valueAsBigInt<BigInt?>(
      'block_max_gas',
      acceptCamelCase: true,
    ),
  );
}