> For the complete documentation index, see [llms.txt](https://docs.usemeta.fi/react-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.usemeta.fi/react-sdk/sdk-reference/registertoken.md).

# RegisterToken

{% hint style="info" %}
This function does not trigger any UI elements
{% endhint %}

## Description

Function to register any asset that is not supported by default. The token will then be supported throughout the wallet - eg. it will be shown on balances page if the user has a non-zero balance of the token.

## Details

{% hint style="info" %}
Only ERC20 tokens following the [OpenZeppelin standard](https://docs.openzeppelin.com/contracts/4.x/erc20) are supported for now
{% endhint %}

### Signature

`RegisterToken(name, symbol, chain, image, contractAddress, decimal)`

### Arguments

<table><thead><tr><th width="248">Parameter</th><th width="156">Type</th><th>Definition</th></tr></thead><tbody><tr><td><code>name</code></td><td>String</td><td>Name of the currency, eg. "USD Coin"</td></tr><tr><td><code>symbol</code></td><td>String</td><td>Symbol for the currency, eg. "USDC"</td></tr><tr><td><code>chain</code></td><td>String</td><td>Chain on which the contract is deployed. eg. for USDC on ETH, pass in <code>chains.eth</code></td></tr><tr><td><code>image</code></td><td>String</td><td>Link to png image of the token. Max size is 50KB</td></tr><tr><td><code>contractAddress</code></td><td>String</td><td>Contract address of the ERC20 token, eg. for USDC on ETH, it is 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48</td></tr><tr><td><code>decimal</code></td><td>Number</td><td>Number of decimal places of precision for the asset. eg. 18 for ETH</td></tr></tbody></table>

### Return Value

Instance of the new Asset

## Example

First, create an instance of the token by calling `RegisterToken`:

{% code title="custom-tokens.js" lineNumbers="true" %}

```jsx
import { RegisterToken, chains } from '@metafi/metafi-react-package';

export const WETH = RegisterToken(
    'Goerli Wrapped Ethereum', 
    'WETH', 
    chains.goerli,
    'https://d2qdyxy3mxzsfv.cloudfront.net/images/logo/ethereum.png',  
    '0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6',
    18, 
)

```

{% endcode %}

Then, pass in the custom token(s) you have created while initializing the MetafiProvider:

{% code title="App.js" lineNumbers="true" %}

```jsx
import { MetafiProvider, chains } from '@metafi/metafi-react-package';
import { WETH } from './constants/custom-token.js';

function App() {
    return (
    <MetafiProvider
        apiKey={"YOUR_API_KEY"}
        secretKey={"YOUR_SECRET_KEY"}
        supportedChains={[chains.eth, chains.goerli]}
        customTokens={[WETH]}
        options={}
    >
        <YourComponents>
        ...
        </YourComponents>
    </MetafiProvider>
    );
};
```

{% endcode %}

And voila! Your token will now be accessible throughout the wallet.
