Welcome to Tatum SDK - TypeScript/JavaScript Library for Simplifying Blockchain Development.
Documentation
Report bug
A powerful, feature-rich TypeScript/JavaScript library that streamlines the development of blockchain applications.
🔍 Designed For Developers If you're looking to integrate blockchain functionalities into your projects, Tatum SDK is for you.
We simplify the integration process by offering:
- A user-friendly interface 🤝
- Consistent interaction with a broad range of blockchains, including Ethereum 🔷, Polygon 🟣, Bitcoin ₿, and many more.
For more details, visit our documentation and examples.
With Tatum SDK, you can:
Interact seamlessly with various blockchains through native RPC calls. Say goodbye to the hassle of juggling separate RPC clients for each blockchain.
Documentation |
---|
EVM Blockchains |
Ethereum RPC documentation |
Polygon RPC documentation |
Flare RPC documentation |
Haqq RPC documentation |
Optimism RPC documentation |
UTXO Blockchains |
Bitcoin RPC documentation |
Litecoin RPC documentation |
Dogecoin RPC documentation |
Solana Blockchains |
Solana RPC documentation |
XPR Blockchains |
XPR RPC documentation |
Tron Blockchains |
Tron RPC documentation |
Effortlessly monitor wallet activities. Set up real-time notifications for events like:
Documentation |
---|
Start monitoring of the address |
Stop monitoring of the address |
Get all sent notifications |
Get all existing monitoring subscriptions |
Through a single interface, obtain crucial wallet details such as balances, transaction history, and other pertinent information.
Documentation |
---|
Get all assets the wallet holds |
Get all transactions on the wallet |
Dive into a comprehensive suite of actions related to non-fungible tokens (NFTs).
Explore the world of fungible tokens, manage their properties, and track your assets seamlessly.
Documentation |
---|
Get all fungible tokens the wallet holds |
Show fungible token history of a wallet |
Get metadata of a fungible token |
Create a fungible token |
Stay updated with real-time fee insights and ensure smooth transactions without overpaying.
Documentation |
---|
Fetch real-time fee data |
Integrate, transact, and manage assets using a secure and user-friendly wallet provider interface.
Access the latest crypto exchange rates and supported currency information to stay ahead in the market.
Documentation |
---|
Get current exchange rate of the crypto asset |
Get current rates for multiple crypto assets at once |
Supported Crypto Currencies |
Supported Fiats |
This guide will lead you step by step, from basic setup and installation to harnessing the immense capabilities of our library. For a detailed walkthrough, check out the Getting Started page.
Experience powerful insights into your application's usage with the Tatum Dashboard. It provides real-time analytics, user engagement metrics, and an intuitive interface, seamlessly integrating with TatumSDK for optimal app monitoring.
Our library is on a continuous journey of growth. We regularly add new features and extend support for more blockchains. It's the go-to choice for developers aiming to craft robust, scalable, and efficient blockchain apps without the overwhelming intricacies of diverse blockchain protocols.
Before diving into TatumSDK, ensure that you have the following prerequisites installed:
- Node.js: Ensure you have the latest LTS version installed.
- npm: npm is bundled with Node.js, so installing Node.js should automatically install npm.
To install TatumSDK, simply run the following command in your terminal or command prompt:
Install using npm
npm install @tatumio/tatum
Install using yarn
yarn add @tatumio/tatum
Install using pnpm
pnpm install @tatumio/tatum
Here's a brief overview of how to utilize TatumSDK for RPC calls and subscribing to notifications.
Start by importing the TatumSDK library and initializing Ethereum client as follows:
import { TatumSDK, Network, Ethereum } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Ethereum>({ network: Network.ETHEREUM })
// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
To make RPC calls, use the available methods to interact with Ethereum blockchain. For example, to fetch the balance of a specific Ethereum address:
import { TatumSDK, Network, Ethereum } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Ethereum>({ network: Network.ETHEREUM })
const { result } = await tatum.rpc.getBalance('0x742d35Cc6634C0532925a3b844Bc454e4438f44e')
console.log(`Balance: ${data}`)
// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
For more details, check out the RPC documentation.
To subscribe to notifications for events related to a specified Ethereum address, choose a type of event you want to be notified about.
We are going to use addressEvent
as an example, which sends you notification about any transfer on the address - native ones, ERC20 tokens or NFTs. To subscribe to this event, use the following code:
import { TatumSDK, Network, Ethereum } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Ethereum>({ network: Network.ETHEREUM })
const response = await tatum.notification.subscribe.addressEvent({
url: 'https://<YOUR_WEBHOOK_URL>',
address: '0x690B9A9E9aa1C9dB991C7721a92d351Db4FaC990',
})
console.log(response)
// 🎉 Now your address is subscribed for any events!
// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
For more details, check out the Notifications documentation.
Using TatumSDK, obtain the NFT balance of an address by calling the getNFTBalance method within the NFT submodule and passing the target address as an argument. This streamlined process efficiently retrieves the total number of NFTs owned by the specified address. To achieve this, use the following code:
import { TatumSDK, Network, Ethereum, NftAddressBalance } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Ethereum>({ network: Network.ETHEREUM })
const balances: NftAddressBalance[] = await tatum.nft.getBalance({
addresses: ['0x53e8577c4347c365e4e0da5b57a589cb6f2ab849'],
})
console.log(balances)
// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
For more details, check out the NFTs documentation.
Using TatumSDK, it's possible to connect your browser application to MetaMask and perform transactions using it. To achieve this, use the following code:
import { TatumSDK, Network, Ethereum } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Ethereum>({ network: Network.ETHEREUM })
const account: string = await tatum.walletProvider.metaMask.connect()
const txId: string = await tatum.walletProvider.metaMask.transferNative(
'0x53e8577C4347C365E4e0DA5B57A589cB6f2AB848',
'1',
)
console.log(txId)
// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
For more details, check out the Wallet Provider documentation.
Using TatumSDK, obtain current fiat/crypto exchange rates To achieve this, use the following code:
import { TatumSDK, Network, Ethereum } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Ethereum>({ network: Network.ETHEREUM })
const res = await tatum.rates.getCurrentRate('BTC', 'EUR')
console.log(res.data)
// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
For more details, check out the Exchange Rates documentation.
Using TatumSDK, you can obtain recommended fee/gas price for a blockchain.
import { TatumSDK, Network, Ethereum } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Ethereum>({
network: Network.ETHEREUM_SEPOLIA,
verbose: true,
retryDelay: 1000,
retryCount: 2,
version: ApiVersion.V1,
})
const result = await tatum.fee.getCurrentFee()
console.log(result.data)
// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
For more details, check out the Fee Estimation documentation.
Using TatumSDK, obtain all fungible token balances of an address by calling the getBalance method within the token
submodule and passing the target address as an argument. This streamlined process efficiently retrieves all balances for fungible tokens that specified address holds. To achieve this, use the following code:
import { TatumSDK, Network, Ethereum } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Ethereum>({ network: Network.ETHEREUM_SEPOLIA })
const { data: balances } = await tatum.token.getBalance({
addresses: ['0x2cbaf358c0af93096bd820ce57c26f0b7c6ec7ab'],
})
console.log(balances)
// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
For more details, check out the Fungible Tokens documentation.
Using TatumSDK, you can obtain transaction history of the wallet.
import { TatumSDK, Network, Ethereum } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Ethereum>({ network: Network.ETHEREUM_SEPOLIA })
const { data: txs } = await tatum.address.getTransactions({
address: '0x514d547c8ac8ccbec29b5144810454bd7d3625ca',
});
console.log(txs);
// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
For more details, check out the Wallet address operations documentation.
- Documentation and Guides to get started with Tatum SDK
- Documentation section for more details.
Older versions of the Tatum SDK has been moved to long living branches Tatum SDK V1
and Tatum SDK V2
.
Contributions to the Tatum SDK are welcome. Please ensure that you have tested your changes with a local client and have added unit test coverage for your code.
Changes will be included with the nearest release (but please point out if you deem changes worthy dedicated release).
Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.