Intro

Transactions and balance

One feature that is used by many dapps is using tokens and transactions of any user. Moralis offers 2 ways to access balances and transactions

Via Convenience Functions

It's really easy to get the balance of any address on any of the supported chains, via the convenience functions.

Installing the Plugin

These functions are available by default as of Moralis server version 0.0.223. New instances should have it already, but if your instance does not yet have the "Convenience Functions" plugin it will need to be installed. See the plugin page for more info.

Supported Chains

All helper functions have a chain option to specify which blockchain to get data from. The following are the currently supported values for the chain option. Any of the "Lookup Values" will match the corresponding chain. If not specified the chain will default to Ethereum Mainnet.

Chain

Lookup Values

Ethereum Mainnet

eth, mainnet, 0x1

Ropsten (Ethereum Testnet)

testnet, ropsten, 0x3

Rinkeby (Ethereum Testnet)

rinkeby, 0x4

Goerli (Ethereum Testnet)

goerli, 0x5

Kovan (Ethereum Testnet)

kovan, 0x2a

Binance Smart Chain Mainnet

bsc, binance, binance smart chain, 0x38

Binance Smart Chain Testnet

bsc testnet, binance testnet, binance smart chain testnet, 0x61

Polygon (Matic) Mainnet

matic, polygon, 0x89

Mumbai (Matic Testnet)

mumbai, matic testnet, polygon testnet, 0x13881

Local Dev Chain (Ganache, Hardhat)

ganache, hardhat, localdevchain, local devchain ,dev, 0x539

Synchronizing to the database

You might also want to synchronize balances and transactions to your database. This is already enabled by default.