Narnia's Psychedelic Mushrooms

    TypeScript icon, indicating that this package has built-in type declarations

    1.16.17 • Public • Published

    Tatum API client

    Tatum API client allows browsers and Node.js clients to interact with Tatum API. It includes the following core components.

    • wallet - cryptographic functions like generation of wallets, private keys or addresses.
    • kms - set of API calls to communicate with Tatum KMS.
    • blockchain - set of API calls to communicate with different blockchains via Tatum API.
    • ledger - set of API calls to communicate with Tatum Private Ledger via Tatum API.
    • transaction - set of functions to generate and sign blockchain transactions locally.
    • offchain - set of functions to generate and sign Tatum off-chain transactions locally.

    You can find more detailed documentation and examples in Tatum API documentation Documentation pages or read the documentation for the client.



    1. Install module:

      npm install @tatumio/tatum


    1. Install module:

      npm install @tatumio/tatum

    Node.JS & Browser support

    Library is written in TypeScript with ES2017 as the target JS version. Library should work in all modern browsers with ES2017 support and Node.JS current LTS.


    All new code changes should be covered with unit tests. You can run the tests with the following command:

    $ npm run test

    Configuration and setup

    Provide Tatum API key to process.env.TATUM_API_KEY variable. You can use dotenv or any other way. There are modules and functions, that do not have to communicate with Tatum API, like wallet generation or signing of transactions locally. In those cases, there is no need to provide TATUM_API_KEY parameter.


    There are some cases when requests fail to complete successfully. For instance, when you exceed request rate limitations. To configure behavior when requests fails we provide env variables process.env.TATUM_RETRY_DELAY and process.env.TATUM_RETRIES.

    Variable process.env.TATUM_RETRY_DELAY specifies the number in milliseconds how long wait before the failed request is resent again. Default value is 1000 milliseconds.


    Variable process.env.TATUM_RETRIES specifies the maximum number of how many times failed request is resent again. Default value is 5.


    In the library, there are functions for estimating the Ethereum transaction fee. For the estimation of the transaction fee, we are using If you have your API key from you can use it via env variable process.env.TATUM_GAS_STATION_API_KEY.


    If you want to work with TRON locally, you need to enter API Key for Trongrid. process.env.TRON_PRO_API_KEY=${YOUR_TRON_PRO_API_KEY}


    // In Node.js
    const Tatum = require('@tatumio/tatum');
    const btcWallet = Tatum.generateWallet(Tatum.Currency.BTC, true);
        mnemonic: ... ,
        xpub: ... 

    Usage with TypeScript

    We support types within the repo itself. Please open an issue here if you find any wrong types.

    You can use @tatumio/tatum as follows:

    import {generateWallet, Currency} from '@tatumio/tatum';
    const btcWallet = generateWallet(Currency.BTC, true);

    If you are using the types in a commonjs module, like in a Node app, you just have to enable esModuleInterop and allowSyntheticDefaultImports in your tsconfig for typesystem compatibility:

    "compilerOptions": {
        "allowSyntheticDefaultImports": true,
        "esModuleInterop": true,


    Contributions to the Tatum API client are welcome. Please ensure that you have tested the changes with a local client and have added unit test coverage for your code.


    npm i @tatumio/[email protected]





    Unpacked Size

    2.62 MB

    Total Files


    Last publish


    • sramkos
    • hathoriel