Introduction

Welcome to HolyNode - SaaS Service Document

HolyNode is a transaction fee optimization service for the TRC-20 network, offering 50-75% savings on fees compared to holding regular TRX. HolyNode ensures fast and secure transactions by allocating resources for only one hour after a fee request. Execution costs depend on contract complexity and network congestion. Simplify TRC-20 fee management with HolyNode and reduce transaction costs efficiently!

HolyNode guarantees 50-75% savings on transaction fees for the TRC-20 network, compared to holding regular TRX in your address—regardless of the implementation method.

Quick Start

Get an API key

After login into your account on https://panel.holynode.com form the side menu create a new merchant.

At the end of steps of creating a new merchant it will gives you an API ket to call HolyNode Restful API endpoints.

You should pass the API key as x-api-key header for all requests.

    
   curl -X POST "https://api.holynode.com/fee/estimate" \
     -H "Content-Type: application/json" \
     -H "x-api-key: YOUR_API_KEY_HERE" \
     -d '{
          "fromAddress": "TSrcAddressExample123",
          "toAddress": "TDestAddressExample456",
          "contractAddress": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
          "amount": 1
        }'
                                                
                                                

Structure

To cover your smart contract transfer fee from address A to address B, you have multiple options.

1. Single API Call - Pay with Your Panel Balance (EASY)

In this method, you only need to increase your account balance in the HolyNode panel. Once funded, you can cover the fees for your transactions with a single API call. HolyNode will automatically deduct the required amount from your balance and fully cover the transaction fee, eliminating concerns about bandwidth, energy, or whether the address is activated on the Tron network.

You must call the Single API Call method right before sending your assets. The source address (address A) will receive the required fee instantly, and you can proceed with your transfer.

⚠️ In all methods, you must transfer your smart contract from address A immediately after requesting fee coverage. The allocated resources from HolyNode will only be available for ONE HOUR!

2. Double API Call - Pay with a Spender Address (EXPERT)

In this method, you don't need to pre-fund your HolyNode account. Instead, you can pay for each transaction individually and cover the fees using TRX.

First, call the HolyNode fee estimation endpoint to determine the required TRX amount for the transaction. Then, in the second API call, send your parameters along with a signed transaction from your spender address (which can be address A or any other address holding TRX) to cover the necessary transaction fees. You should not broadcast this signed transaction, HolyNode will handle broadcasting after validation.

This method is also secure, as there is no need to share private keys, manually broadcast transactions, or transfer TRX before validation.

The process involves calling the Fee Estimate API, signing a TRX transfer transaction with the spender address, and then calling the Fee Cover API with the feeCoverTransaction parameter.

📢Use the HolyNode address TC16R6y7UNDXUDf2DiQc36kTtBQXP21nFy on the Tron network as the recipient for the estimated fee in TRX.

⚠️ In all methods, you must transfer your smart contract from address A immediately after requesting fee coverage. The allocated resources from HolyNode will only be available for ONE HOUR!

Fee covering

To estimate your transaction cost fee (in TRX), you need to send your transaction parameters to HolyNode for calculation. Execution costs vary based on contract complexity, and network congestion can affect transaction speed.

    Request:
  • Send a request to [POST] https://api.holynode.com/fee/cover with following request body:
  • Here we have and example to sending 1 USDT from an address to another address
    {  
        "fromAddress": Required
            The source address holding 1 USDT to send
    
        "toAddress": Required
            The recipient address to receive 1 USDT
    
        "contractAddress": Required
            The contract address for the token you want to transfer. For example, for USDT, it is 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t' 
    
        "contractAmount": 1000000
            The amount to transfer based on token decimal precision
            For example, USDT has 6 decimals, so to send 1 USDT, you must pass 1000000
            If you do not know your contract decimal and how to change the amount to contract amount
            you can pass is like:
        OR    
        "amount": 1
            This is an alternative to 'contractAmount'. If provided, HolyNode will automatically convert it based 
            on the token's decimals. 
            For example, passing 1 for USDT set this parameter to 1
    
        "feeCoverTransaction": Optional
        If you have already increased your account balance on HolyNode and want to cover the fee with a single API call, 
        leave this field as null. Otherwise, send your signed transaction data from your spender address here.
        See more: 🔏 Sign Fee Cover Transaction
        
                                                                    
    }
    Example:
    
        curl -X POST "https://api.holynode.com/fee/cover" \
        -H "Content-Type: application/json" \
        -H "x-api-key: YOUR_API_KEY_HERE" \
        -d '{
            "fromAddress": "TYHGuyBJH59ej1NCqhNpQf3UsaAn24FQPk" 
            "toAddress": "TFjh8dEYgDYY91DojVnEQT6dL1dLSJ3pXk"
            "contractAddress": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"   
            "contractAmount": 1000000  
            }'
    
  • Response:
  • The response of the above request:

How to estimate transaction cost?

To estimate your transaction cost (in TRX), you need to send your transaction parameters to HolyNode for calculation. Execution costs vary based on contract complexity, and network congestion can affect transaction speed.

    Request:
  • Send a request to [POST] https://api.holynode.com/fee/estimate with following request body:
  • Here we have and example to sending 1 USDT from an address to another address
    {  
        "fromAddress": 
            The source address holding 1 USDT to send
    
        "toAddress": 
            The recipient address to receive 1 USDT
    
        "contractAddress": 
            The contract address for the token you want to transfer. For example, for USDT, it is 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t' 
    
        "contractAmount": 1000000
            The amount to transfer based on token decimal precision
            For example, USDT has 6 decimals, so to send 1 USDT, you must pass 1000000
            If you do not know your contract decimal and how to change the amount to contract amount
            you can pass is like:
        OR    
        "amount": 1
            This is an alternative to 'contractAmount'. If provided, HolyNode will automatically convert it based 
            on the token's decimals. 
            For example, passing 1 for USDT set this paramter to 1
                                                                    
    }
    Example:
    
        curl -X POST "https://api.holynode.com/fee/estimate" \
        -H "Content-Type: application/json" \
        -H "x-api-key: YOUR_API_KEY_HERE" \
        -d '{
            "fromAddress": "TYHGuyBJH59ej1NCqhNpQf3UsaAn24FQPk" 
            "toAddress": "TFjh8dEYgDYY91DojVnEQT6dL1dLSJ3pXk"
            "contractAddress": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"   
            "contractAmount": 1000000  
            }'
    
  • Response:
  • The response of the above request:

How to sing fee cover transactions? (Optional)

If you are using the 'Double API Call - Pay with a Spender Address (EXPERT)' method, here are some sample codes to help you sign a fee cover transaction and pass the result as feeCoverTransaction.

  • Here is a simple guide to create a singed transaction with your spender address.

    You must get the estimated TRX from the Fee Estimate API before proceeding. The Fee Estimate API should be called right before signing the fee cover transaction, and its information is valid for only a few minutes. You need to recall the endpoint to update the estimated TRX if needed.

  • In Node.js:
  • 
        const { TronWeb } = require('tronweb');
        const tronWeb = new TronWeb({
            fullHost: 'https://api.trongrid.io',
            headers: { 'TRON-PRO-API-KEY': 'TRON_GRID_API_KEY' },
        });
        async function getSignedTransaction(estimatedTrx, spenderPrivateKey) {
            const holyNodeAddress = 'TC16R6y7UNDXUDf2DiQc36kTtBQXP21nFy';
            const dataSendTrx = await tronWeb.transactionBuilder.sendTrx(holyNodeAddress, estimatedTrx, requestAddress);
            const signedTx = await tronWeb.trx.sign(dataSendTrx, spenderPrivateKey);
            return JSON.stringify(signedTx);
        }
    
    
  • In Python:
  • 
        from tronpy import Tron
        from tronpy.exceptions import TransactionError
    
        def get_signed_transaction(estimated_trx, spender_private_key):
            # Initialize Tron client
            client = Tron()
    
            # Set up the HolyNode address and the sender's address
            holy_node_address = 'TC16R6y7UNDXUDf2DiQc36kTtBQXP21nFy'
            spender_address = 'your_spender_address_here'  # Replace with actual spender address
    
            try:
                # Create transaction to send TRX
                txn = client.trx.transfer(spender_address, holy_node_address, estimated_trx)
    
                # Sign the transaction using the spender's private key
                signed_tx = txn.sign(spender_private_key)
    
                # Return the signed transaction
                return signed_tx
    
            except TransactionError as e:
                print(f"Error creating transaction: {e}")
                return None