Skip to content

Commit

Permalink
docs: improve JSDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Oct 24, 2024
1 parent 10f88c1 commit 6a5f378
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/dapi/lib/externalApis/tenderdash/requestTenderRpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ const RPCError = require('../../rpcServer/RPCError');

/**
* @param {jaysonClient} rpcClient
* @return {requestTenderRpc}
* @return {requestTenderRpc} A function to make RPC requests to Tenderdash.
*/
function requestTenderRpcFactory(rpcClient) {
/**
* @function
* @typedef requestTenderRpc
* @param {string} uri
* @param {Object} [params]
* @param {Object} [params={}]
* @return {Promise<Object>}
*/
return async function requestTenderRpc(uri, params = {}) {
async function requestTenderRpc(uri, params = {}) {
let response;
try {
response = await rpcClient.request(uri, params);
Expand Down Expand Up @@ -44,7 +45,9 @@ function requestTenderRpcFactory(rpcClient) {
}

return result;
};
}

return requestTenderRpc;
}

module.exports = requestTenderRpcFactory;

0 comments on commit 6a5f378

Please sign in to comment.