tatumio / doc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ₯³ Tatum Documentation

We released the new Tatum SDK which will make your web3 development flow super fun.
Looking for old documentation? Click Here

Welcome to Tatum SDK! πŸš€

Tatum SDK is here to make your life easier when building blockchain applications! No more complicated setups, no need for previous blockchain experience. We've got you covered.

Why Tatum SDK? πŸ’‘

  1. Super fast development: Start building blockchain applications in no time.
  2. No previous blockchain experience required: Perfect for beginners and experts alike.
  3. One line of code: Perform complex tasks with minimal effort.

Key Features πŸŽ‰

  • Monitor activity on a blockchain address πŸ•΅οΈβ€β™‚οΈ
  • Perform RPC calls to various blockchains πŸ“ž
  • Read information about NFTs such as balances, transactions, or ownerships πŸ–ΌοΈ
  • Get information about a specific wallet like balances or transaction history πŸ’°

πŸ”‘ Don’t have an API key? Unlock all networks, features and monitor error logs & usage.
Create API key for FREE

Get Started 🌟

Install the Tatum SDK in your terminal to easily integrate blockchain features into your project:

{% tabs %} {% tab title="npm" %} {% code overflow="wrap" %}

npm install @tatumio/tatum

{% endcode %} {% endtab %}

{% tab title="yarn" %}

yarn add @tatumio/tatum

{% endtab %}

{% tab title="pnpm" %}

pnpm install @tatumio/tatum

{% endtab %}

{% tab title="bun" %}

bun install @tatumio/tatum

{% endtab %} {% endtabs %}

Examples πŸ“š

Here are some quick examples to show you how easy it is to use Tatum SDK:

Perform RPC calls

{% tabs %} {% tab title="TypeScript" %} {% code overflow="wrap" lineNumbers="true" %}

import { TatumSDK, Ethereum, Network } from '@tatumio/tatum'

(async () => {
    const tatum = await TatumSDK.init<Ethereum>({network: Network.ETHEREUM})
    const latestBlock = await tatum.rpc.blockNumber()
    console.log(`Latest block is ${latestBlock.result}`)
    tatum.destroy();
})()

{% endcode %} {% endtab %}

{% tab title="JavaScript" %} {% code overflow="wrap" lineNumbers="true" %}

const { TatumSDK, Network } = require('@tatumio/tatum');

(async () => {
  const tatum = await TatumSDK.init({ network: Network.ETHEREUM });
  const latestBlock = await tatum.rpc.blockNumber();
  console.log(`Latest block is ${latestBlock.result}`)
  tatum.destroy();
})();

{% endcode %} {% endtab %} {% endtabs %}

Monitor activity on a blockchain address

{% tabs %} {% tab title="TypeScript" %} {% code overflow="wrap" lineNumbers="true" %}

import { TatumSDK, Ethereum, Network } from '@tatumio/tatum'

(async () => {
    const tatum = await TatumSDK.init<Ethereum>({network: Network.ETHEREUM})
    const monitoredAddress = '0xF64E82131BE01618487Da5142fc9d289cbb60E9d'
    const subscription = await tatum.notification.subscribe.incomingNativeTx({
        address: monitoredAddress,
        url: 'https://<YOUR_WEBHOOK_URL>' // replace with your handler URL
    })
    console.log(`Now you are subscribed for all incoming ETH transactions on ${monitoredAddress}`)
})()

{% endcode %} {% endtab %}

{% tab title="JavaScript" %} {% code overflow="wrap" lineNumbers="true" %}

const { TatumSDK, Ethereum, Network } = require('@tatumio/tatum');

(async () => {
    const tatum = await TatumSDK.init<Ethereum>({network: Network.ETHEREUM});
    const monitoredAddress = '0xF64E82131BE01618487Da5142fc9d289cbb60E9d';
    const subscription = await tatum.notification.subscribe.incomingNativeTx({
        address: monitoredAddress,
        url: 'https://<YOUR_WEBHOOK_URL>' // replace with your handler URL
    });
    console.log(`Now you are subscribed for all incoming ETH transactions on ${monitoredAddress}`);
})();

{% endcode %} {% endtab %}

{% tab title="curl" %} {% code overflow="wrap" lineNumbers="true" %}

curl -i -X POST \
  https://api.tatum.io/v4/subscription?type=mainnet \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "INCOMING_NATIVE_TX",
    "attr": {
      "address": "0xF64E82131BE01618487Da5142fc9d289cbb60E9d",
      "chain": "ETH",
      "url": "https://<YOUR_WEBHOOK_URL>"
    }
  }'

{% endcode %} {% endtab %} {% endtabs %}

Ready to build fantastic blockchain applications? Check out the official documentation for more information and examples!

Happy coding! πŸŽ‰

{% hint style="info" %}

Join our Web3 Developer Community

Get support with our products, meet other developers, and collaborate.
Discord Β· Twitter Β· Github {% endhint %}

About