Asset

Description

The asset object defines currencies in a format supported by the Metafi SDK.

Structure

Field Name
Type
Description

name

String

Name of the asset, eg. "Ethereum"

symbol

String

Symbol of the asset, eg. "ETH"

chain

chain (class)

Chain on which the asset resides

decimal

Number

Number of decimal places of precision for the asset. eg. 18 for ETH

isNative

boolean

Whether the asset is the native currency for the chain

image

String

Image of the currency symbol

contractAddress

String

Contract address if the currency is an ERC20 token

assetKey

String

Key for the chain in the assets object that is accessible from our SDK. The format is chainKey_symbol in lowercase. For eg. "goerli_eth"

Supported Assets

By default, we support the following assets:

eth_eth

eth_usdc

goerli_eth

goerli_usdc

Usage

import { assets } from '@metafi/metafi-react-package';

function displaySupportedChains() {
    return (
        <>
            {
                Object.keys(assets).forEach((assetKey) => {
                    return <p> chains[chainKey].name </p>
                });
            }
        </>
    );
};

Last updated