TokenDetails.erc20 constructor
Constructs a new ERC20 token instance.
Parameters:
symbol
– The symbol of the ERC20 token.name
– The name of the ERC20 token.decimals
– The number of decimals for the ERC20 token.address
– The address of the ERC20 token.amount
– The amount of the ERC20 token.
Implementation
@Implements<IToken>()
@FreezedUnionValue('ERC-20')
const factory TokenDetails.erc20({
required String symbol,
@JsonKey(
fromJson: nameFromJson,
)
required String name,
@Default(0)
@JsonKey(
fromJson: decimalsFromJson,
)
int decimals,
@JsonKey(
name: 'contractAddress',
fromJson: addressFromJson,
)
required String address,
@JsonKey(
name: 'balance',
)
required BigInt amount,
}) = ERC20;