async call(method, params) {
          let response = {
            data: {},
            status: 0,
            statusText: "",
            headers: {},
            config: {},
          };
          let success = false;
          /* eslint-disable no-await-in-loop */
          while (!success) {
            try {
              const data = {
                id: Math.round(Math.random() * 1000),
                jsonrpc: "2.0",
                method,
                params,
              };
              const url = this.rpcNodes[this.currentNodeId];
              // TODO: search conditional to enable fetch for Browser
              /* const response = await fetch(url, {
                  method: "POST",
                  body: JSON.stringify(data),
                });
                const json = await response.json();
                if (json.error && json.error.message) throw new Error(json.error.message);
                return json.result; */
              response = await axios_1.default.post(url, data, {
                validateStatus: (s) => s < 400,
              });
              success = true;
            } catch (e) {
              const currentNode = this.rpcNodes[this.currentNodeId];
              this.currentNodeId =
                (this.currentNodeId + 1) % this.rpcNodes.length;
              const newNode = this.rpcNodes[this.currentNodeId];
              const abort = this.onError(e, currentNode, newNode);
              if (abort) throw e;
            }
          }
          if (response.data.error)
            throw new Error(
              JSON.stringify({
                error: response.data.error,
                request: { method, params },
              })
            );
          return response.data.result;
        }
/**
         * Function to make jsonrpc requests to the RPC node
         * @param method - jsonrpc method
         * @param params - jsonrpc params
         * @returns Result of jsonrpc response
         */
Function to make jsonrpc requests to the RPC node
@param method - jsonrpc method
@param params - jsonrpc params
@returns Result of jsonrpc response
Function to make jsonrpc requests to the RPC node @param method - jsonrpc method @param params - jsonrpc params @returns Result of jsonrpc response
async call(method, params) {
          let response = {
            data: {},
            status: 0,
            statusText: "",
            headers: {},
            config: {},
          };
          let success = false;
          while (!success) {
            try {
              const data = {
                id: Math.round(Math.random() * 1000),
                jsonrpc: "2.0",
                method,
                params,
              };
              const url = this.rpcNodes[this.currentNodeId];
              response = await axios_1.default.post(url, data, {
                validateStatus: (s) => s < 400,
              });
              success = true;
            } catch (e) {
              const currentNode = this.rpcNodes[this.currentNodeId];
              this.currentNodeId =
                (this.currentNodeId + 1) % this.rpcNodes.length;
              const newNode = this.rpcNodes[this.currentNodeId];
              const abort = this.onError(e, currentNode, newNode);
              if (abort) throw e;
            }
          }
          if (response.data.error)
            throw new Error(
              JSON.stringify({
                error: response.data.error,
                request: { method, params },
              })
            );
          return response.data.result;
        }
async call ( method , params ) { let response = { data : { } , status : 0 , statusText : "" , headers : { } , config : { } , } ; let success = false ; while ( ! success ) { try { const data = { id : Math . round ( Math . random ( ) * 1000 ) , jsonrpc : "2.0" , method , params , } ; const url = this . rpcNodes [ this . currentNodeId ] ; response = await axios_1 . default . post ( url , data , { validateStatus : ( s ) => s < 400 , } ) ; success = true ; } catch ( e ) { const currentNode = this . rpcNodes [ this . currentNodeId ] ; this . currentNodeId = ( this . currentNodeId + 1 ) % this . rpcNodes . length ; const newNode = this . rpcNodes [ this . currentNodeId ] ; const abort = this . onError ( e , currentNode , newNode ) ; if ( abort ) throw e ; } } if ( response . data . error ) throw new Error ( JSON . stringify ( { error : response . data . error , request : { method , params } , } ) ) ; return response . data . result ; }
Function to make jsonrpc requests to the RPC node
 @param method - jsonrpc method
 @param params - jsonrpc params
 @returns Result of jsonrpc response
Function to make jsonrpc requests to the RPC node @param method - jsonrpc method @param params - jsonrpc params @returns Result of jsonrpc response
/* eslint-disable no-await-in-loop */ // TODO: search conditional to enable fetch for Browser /* const response = await fetch(url, {
                  method: "POST",
                  body: JSON.stringify(data),
                });
                const json = await response.json();
                if (json.error && json.error.message) throw new Error(json.error.message);
                return json.result; */