Search
⌃K
Links

Get all fungible tokens the wallet holds

This function helps you to fetch all the fungible tokens a wallet holds, all you have to do is pass the address to the function parameter and chain while initialising the sdk.

Overview

The "Get all fungible tokens the wallet holds" function is designed to retrieve information about all the fungible tokens stored in a specific wallet. By providing the wallet address as a parameter and initialising the software development kit (SDK) with the appropriate blockchain, this function enables users to fetch data regarding the fungible tokens associated with that particular wallet.

How to get fungible tokens on a wallet in the Ethereum network

Use the TatumSDK (@tatumio/tatum) to get a balance of the wallet.
Typescript
Javascript
curl
1
// yarn add @tatumio/tatum
2
import { TatumSDK, Network, Ethereum, ResponseDto, FungibleTokenBalance } from '@tatumio/tatum'
3
​
4
const tatum = await TatumSDK.init<Ethereum>({ network: Network.ETHEREUM })
5
​
6
const balance: ResponseDto<FungibleTokenBalance[]> = await tatum.token.getBalance({
7
addresses: ['0x78E851C35326c9296485E9720D85CB3Bd153b428'], // replace with your address
8
})
9
​
10
console.log(balance.data)
1
// Install with: npm install @tatumio/tatum
2
const { TatumSDK, Network } = require("@tatumio/tatum");
3
​
4
(async () => {
5
try {
6
const tatum = await TatumSDK.init({ network: Network.ETHEREUM });
7
const balance = await tatum.token.getBalance({ addresses: ['0x78E851C35326c9296485E9720D85CB3Bd153b428'], // replace with your address
8
});
9
console.log(balance.data);
10
} catch (error) {
11
console.error("Error fetching balances of fungible tokens:", error);
12
}
13
})();
1
curl --location --request GET 'https://api.tatum.io/v4/data/balances?chain=ethereum&addresses=0x78E851C35326c9296485E9720D85CB3Bd153b428&tokenTypes=fungible'
Expected Response
[
{
chain: 'ethereum-mainnet',
tokenAddress: '0xd110bb8a24b100c37af7310416e685af807c1f10',
type: 'fungible',
lastUpdatedBlockNumber: 8167878,
address: '0x78e851c35326c9296485e9720d85cb3bd153b428',
balance: '0.0006'
},
{
chain: 'ethereum-mainnet',
tokenAddress: '0x1fcdce58959f536621d76f5b7ffb955baa5a672f',
type: 'fungible',
lastUpdatedBlockNumber: 8348276,
address: '0x78e851c35326c9296485e9720d85cb3bd153b428',
balance: '1'
},
{
chain: 'ethereum-mainnet',
tokenAddress: '0x558ec3152e2eb2174905cd19aea4e34a23de9ad6',
type: 'fungible',
lastUpdatedBlockNumber: 12136720,
address: '0x78e851c35326c9296485e9720d85cb3bd153b428',
balance: '201.752'
}
]

Request interface

1
interface AddressBalanceDetails {
2
/**
3
* List of addresses to check.
4
*/
5
addresses: string[]
6
/**
7
* Optional page size. If not specified, the default page size is used, which is 10.
8
*/
9
pageSize?: number
10
/**
11
* Optional page number. If not specified, the first page is returned.
12
*/
13
page?: number
14
}

Response interface

1
interface ResponseDto<T> {
2
/**
3
* Actual payload of the response
4
*/
5
data: T
6
/**
7
* Status of the response
8
*/
9
status: Status
10
/**
11
* In case of ERROR status, this field contains the error message and detailed description
12
*/
13
error?: ErrorWithMessage
14
}
15
​
16
interface FungibleTokenBalance {
17
/**
18
* Blockchain network
19
*/
20
chain: string
21
/**
22
* Token contract address
23
*/
24
tokenAddress: string
25
/**
26
* Token type, default 'fungible' (ERC-20).
27
*/
28
type: 'fungible'
29
​
30
/**
31
* Block number of the last balance update.
32
*/
33
lastUpdatedBlockNumber: number
34
​
35
/**
36
* Address
37
*/
38
address: string
39
​
40
/**
41
* Balance of the address.
42
*/
43
balance: string
44
}

Supported blockchain networks

Network
Support
Ethereum / Ethereum Sepolia / Ethereum Goerli BNB Smart Chain / BNB Smart Chain Testnet Celo / Celo Alfajores Polygon / Polygon Mumbai
Multiple addresses per 1 invocation
​
© Tatum Technology, LLC