toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return switch (this) {
    ERC20Entity ethBasedToken => {
        'name': ethBasedToken.name,
        'symbol': ethBasedToken.symbol,
        'decimals': ethBasedToken.decimals,
        'chainID': ethBasedToken.chainID,
        'contractAddress': ethBasedToken.contractAddress,
        'allowDeletion': ethBasedToken.allowDeletion,
      },
    EvmCoinEntity evmEntity => {
        'name': evmEntity.name,
        'symbol': evmEntity.symbol,
        'decimals': evmEntity.decimals,
        'chainID': evmEntity.chainID,
      },
    CoinEntity tokenEntity => {
        'name': tokenEntity.name,
        'symbol': tokenEntity.symbol,
        'decimals': tokenEntity.decimals,
      },
  };
}