Skip to content

Commit db4559d

Browse files
committed
fix(types): add missing TxRPC type
1 parent ee98a2b commit db4559d

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

dashtx.js

+12-8
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656

5757
/**
5858
* @typedef TxUtils
59+
* @prop {TxRPC} rpc
5960
* @prop {TxToVarInt} toVarInt
6061
* @prop {TxToVarIntSize} toVarIntSize
6162
* @prop {TxReverseHex} reverseHex
@@ -1693,14 +1694,7 @@ var DashTx = ("object" === typeof module && exports) || {};
16931694
}
16941695
}
16951696

1696-
/**
1697-
* @param {String} basicAuthUrl - ex: https://api:[email protected]/
1698-
* http://user:pass@localhost:19998/
1699-
* @param {String} method - the rpc, such as 'getblockchaininfo',
1700-
* 'getaddressdeltas', or 'help'
1701-
* @param {...any} params - the arguments for the specific rpc
1702-
* ex: rpc(url, 'help', 'getaddressdeltas')
1703-
*/
1697+
/** @type {TxRPC} */
17041698
TxUtils.rpc = async function rpc(basicAuthUrl, method, ...params) {
17051699
let url = new URL(basicAuthUrl);
17061700
let baseUrl = `${url.protocol}//${url.host}${url.pathname}`;
@@ -2356,6 +2350,16 @@ if ("object" === typeof module) {
23562350
* @returns {Promise<TxPublicKey>} - public key buf
23572351
*/
23582352

2353+
/**
2354+
* @callback TxRPC
2355+
* @param {String} basicAuthUrl - ex: https://api:[email protected]/
2356+
* http://user:pass@localhost:19998/
2357+
* @param {String} method - the rpc, such as 'getblockchaininfo',
2358+
* 'getaddressdeltas', or 'help'
2359+
* @param {...any} params - the arguments for the specific rpc
2360+
* ex: rpc(url, 'help', 'getaddressdeltas')
2361+
*/
2362+
23592363
/**
23602364
* Caution: JS can't handle 64-bit ints
23612365
* @callback TxToVarInt

0 commit comments

Comments
 (0)