Build Web3 applications faster than ever.
Zac Barron
Product Lead at Binance
David Spitzer-Dulagan
CTO at Limewire
Hitoshi Harada
Co-founder & CPO at Alpaca
Whatever you're building, it's easiest to do it with the Tatum SDK. You get a unified abstraction layer to access all blockchains in one SDK.
• Compare fees
• Estimate costs
• Display fees instantly
• Easy-to-use Webhooks
• Transaction alerts
• Smart contract events
• Convert crypto-to-fiat
• Track portfolios
• Enable crypto payments
• Manage keys
• Get balances
• Handle transactions
• Mint and deploy
• Manage transactions
• Burn and transfer
• Integrate into your Dapp
• Transfer assets
• Manage signatures
Tatum SDK is a unified developer tooling for building applications using 90+ blockchains. It's the go-to open source SDK for Web3.
With the Tatum SDK you'll reduce the length of your code by at least 90% helping you launch your dApp faster.
// Fetch NFT balance.
const Web3 = require('web3');
const web3 = new Web3('https://rpc.provider/Your_Access_key');
const walletAddress = 'YOUR_WALLET_ADDRESS';
const abiDecoder = require('abi-decoder');
async function getNFTsForWallet() {
try {
const latestBlockNumber = await web3.eth.getBlockNumber();
for (let i = 0; i <= latestBlockNumber; i++) {
const block = await web3.eth.getBlock(i, true);
if (block && block.transactions) {
for (const tx of block.transactions) {
const receipt = await web3.eth.getTransactionReceipt(tx.hash);
if (receipt && receipt.logs) {
abiDecoder.addABI(yourNFTContractABI); // Replace with the ABI of the NFT contract
for (const log of receipt.logs) {
const decodedLogs = abiDecoder.decodeLogs([log]);
for (const decodedLog of decodedLogs) {
if (decodedLog && decodedLog.name === 'Transfer') {
const from = decodedLog.events[1].value;
const to = decodedLog.events[2].value;
if (to.toLowerCase() === walletAddress.toLowerCase()) {
console.log('Received NFT:', decodedLog);
}
}
}
}
}
}
}
}
} catch (error) {
console.error('Error:', error);
}
}
getNFTsForWallet();
// Fetch NFT balance using Tatum SDK.
import { TatumSDK, Network } from '@tatumio/tatum';
const tatum = await TatumSDK.init({ network: Network.ETHEREUM });
const balance = await tatum.nft.getBalance({addresses: [‘your address’]});