getToken method

String getToken(
  1. String tokenAddress
)

Resolves the token address to a more human-readable form if applicable.

If the token address corresponds to a native token, this method returns a predefined string ('FUSE' in this case). Otherwise, it returns the token address as-is. This is useful for APIs that require token identifiers in a specific format.

Implementation

String getToken(String tokenAddress) {
  if (ContractsUtils.isNativeToken(tokenAddress)) {
    return 'FUSE';
  } else {
    return tokenAddress;
  }
}