/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { CancelablePromise } from '../core/CancelablePromise'; import { request as __request } from '../core/request'; export class NodeRpcService { /** * 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)
* * 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:

* * * @param chain Blockchain to communicate with. * @param requestBody * @param xApiKey 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. * @param nodeType Type of the node to access for Algorand. * @param testnetType Type of Ethereum testnet. Defaults to ethereum-sepolia. * @param rpcPath Optional path of rpc call for non EVM nodes, e.g. Algorand or Stellar. * @returns any OK * @throws ApiError */ public static nodeJsonPostRpcDriver( chain: 'ADA' | 'ARB' | 'AURORA' | 'ALGO' | 'BCH' | 'BSC' | 'BTC' | 'CELO' | 'CRO' | 'DOGE' | 'EGLD' | 'EOS' | 'ETH' | 'FTM' | 'GNO' | 'KCS' | 'KSM' | 'KLAY' | 'LISK' | 'LTC' | 'NEAR' | 'OASIS' | 'OPTIMISM' | 'DOT' | 'PALM' | 'MATIC' | 'ONE' | 'RSK' | 'SOL' | 'TEZOS' | 'ZCASH' | 'TRON' | 'VET' | 'XDC' | 'XLM' | 'NEO', requestBody: any, xApiKey?: string, nodeType?: 'ALGOD' | 'INDEXER', testnetType: 'ethereum-sepolia' | 'ethereum-goerli' = 'ethereum-sepolia', rpcPath?: string, ): CancelablePromise { return __request({ method: 'POST', path: `/v3/blockchain/node/${chain}/${xApiKey}/${rpcPath}`, query: { 'nodeType': nodeType, 'testnetType': testnetType, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 500: `Internal server error`, }, }); } /** * 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:

* * * @param chain Blockchain to communicate with. * @param requestBody * @param xApiKey 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. * @param nodeType Type of the node to access for Algorand. * @param rpcPath Optional path of rpc call for non EVM nodes, e.g. Algorand or Stellar. * @returns any OK * @throws ApiError */ public static nodeJsonRpcPutDriver( chain: 'ALGO' | 'EGLD' | 'XLM', requestBody: any, xApiKey?: string, nodeType?: 'ALGOD' | 'INDEXER', rpcPath?: string, ): CancelablePromise { return __request({ method: 'PUT', path: `/v3/blockchain/node/${chain}/${xApiKey}/${rpcPath}`, query: { 'nodeType': nodeType, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 500: `Internal server error`, }, }); } /** * 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:

* * * @param chain Blockchain to communicate with. * @param xApiKey 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. * @param nodeType Type of the node to access for Algorand. * @param rpcPath Optional path of rpc call for non EVM nodes, e.g. Algorand or Stellar. * @returns any OK * @throws ApiError */ public static nodeJsonRpcGetDriver( chain: 'ALGO' | 'EGLD' | 'LISK' | 'XLM' | 'TEZOS' | 'TRON', xApiKey?: string, nodeType?: 'ALGOD' | 'INDEXER', rpcPath?: string, ): CancelablePromise { return __request({ method: 'GET', path: `/v3/blockchain/node/${chain}/${xApiKey}/${rpcPath}`, query: { 'nodeType': nodeType, }, errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 500: `Internal server error`, }, }); } }