Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Api/NodeRPCApi

Node RPC API Reference

// Set your API Keys 👇 here
$sdk = new \Tatum\Sdk();

// MainNet API Call
$sdk->mainnet()->api()->nodeRPC();

// TestNet API Call
$sdk->testnet()->api()->nodeRPC();

Methods

Method Description
nodeJsonPostRpcDriver() Connect to the blockchain node through an RPC driver
nodeJsonRpcGetDriver() Connect to the blockchain node through an RPC driver
nodeJsonRpcPutDriver() Connect to the blockchain node through an RPC driver

nodeJsonPostRpcDriver()

Example

#️⃣ Execute command in terminal

✨ php -f nodeJsonPostRpcDriver.php

Request

POST /v3/blockchain/node/{chain}/{xApiKey}/{rpcPath}

Type signature

(new \Tatum\Sdk())->{mainnet/testnet}()->api()->nodeRPC()->nodeJsonPostRpcDriver(
    string $chain,
    object $body,
    [ string $x_api_key, ]
    [ string $node_type, ]
    [ string $testnet_type = 'ethereum-sepolia', ]
    [ string $chain_type = 'avax-c', ]
    [ string $rpc_path ]
): object

Parameters

Name Type Description Notes
$chain string Blockchain to communicate with.  
$body object    
$x_api_key string Tatum X-API-Key used for authorization. You can omit this path parameter and either use the X-Api-Key header, or the API key tied to your IP address without any header. [optional]
$node_type string Type of the node to access for Algorand. [optional]
$testnet_type string Type of Ethereum testnet. Defaults to ethereum-sepolia. [optional] [default to 'ethereum-sepolia']
$chain_type string Type of Avalanche network. Defaults to Avalanche C-Chain. [optional] [default to 'avax-c']
$rpc_path string Optional path of rpc call for non EVM nodes, e.g. Algorand or Stellar. [optional]

Return type

object

Description

Connect to the blockchain node through an RPC driver

The number of credits consumed depends on the number of methods submitted in an API call: * 50 credits per debug*_/trace* method (for EVM-based blockchains) * 50 credits per EOS Trace API methods * 5 credits per eth_call method (for EVM-based blockchains) * 2 credits per any other RPC method

Connect directly to the blockchain node provided by Tatum.

The POST method is used. The API endpoint URL acts as an HTTP-based RPC driver.

In the request body, provide valid Web3 RPC method content, for example:

` { “jsonrpc”: “2.0”, “id”: 1, “method”: “method_name”, “params”: [] } `

For the blockchains using the JSON-RPC 2.0 specification, you can submit multiple RPC methods in one API call:

` [ { “jsonrpc”: “2.0”, “id”: 1, “method”: “method_1_name”, “params”: [] }, { “jsonrpc”: “2.0”, “id”: 2, “method”: “method_2_name”, “params”: [] }, … ] `

This API is supported for the following blockchains:

Back to top


nodeJsonRpcGetDriver()

Example

#️⃣ Execute command in terminal

✨ php -f nodeJsonRpcGetDriver.php

Request

GET /v3/blockchain/node/{chain}/{xApiKey}/{rpcPath}

Type signature

(new \Tatum\Sdk())->{mainnet/testnet}()->api()->nodeRPC()->nodeJsonRpcGetDriver(
    string $chain,
    [ string $x_api_key, ]
    [ string $node_type, ]
    [ string $rpc_path ]
): object

Parameters

Name Type Description Notes
$chain string Blockchain to communicate with.  
$x_api_key string Tatum X-API-Key used for authorization. You can omit this path parameter and either use the X-Api-Key header, or the API key tied to your IP address without any header. [optional]
$node_type string Type of the node to access for Algorand. [optional]
$rpc_path string Optional path of rpc call for non EVM nodes, e.g. Algorand or Stellar. [optional]

Return type

object

Description

Connect to the blockchain node through an RPC driver

2 credits per RPC method in an API call

Connect directly to the blockchain node provided by Tatum.

The GET method is used. The API endpoint URL acts as an HTTP-based RPC driver.

This API is supported for the following blockchains:

Back to top


nodeJsonRpcPutDriver()

Example

#️⃣ Execute command in terminal

✨ php -f nodeJsonRpcPutDriver.php

Request

PUT /v3/blockchain/node/{chain}/{xApiKey}/{rpcPath}

Type signature

(new \Tatum\Sdk())->{mainnet/testnet}()->api()->nodeRPC()->nodeJsonRpcPutDriver(
    string $chain,
    object $body,
    [ string $x_api_key, ]
    [ string $node_type, ]
    [ string $rpc_path ]
): object

Parameters

Name Type Description Notes
$chain string Blockchain to communicate with.  
$body object    
$x_api_key string Tatum X-API-Key used for authorization. You can omit this path parameter and either use the X-Api-Key header, or the API key tied to your IP address without any header. [optional]
$node_type string Type of the node to access for Algorand. [optional]
$rpc_path string Optional path of rpc call for non EVM nodes, e.g. Algorand or Stellar. [optional]

Return type

object

Description

Connect to the blockchain node through an RPC driver

2 credits per RPC method in an API call

Connect directly to the blockchain node provided by Tatum.

The PUT method is used. The API endpoint URL acts as an HTTP-based RPC driver.

In the request body, provide valid Web3 RPC method content, for example:

` { “jsonrpc”: “2.0”, “id”: 1, “method”: “method_name”, “params”: [] } `

For the blockchains using the JSON-RPC 2.0 specification, you can submit multiple RPC methods in one API call:

` [ { “jsonrpc”: “2.0”, “id”: 1, “method”: “method_1_name”, “params”: [] }, { “jsonrpc”: “2.0”, “id”: 2, “method”: “method_2_name”, “params”: [] }, … ] `

This API is supported for the following blockchains:

Back to top