|
56 | 56 |
|
57 | 57 | /**
|
58 | 58 | * @typedef TxUtils
|
| 59 | + * @prop {TxRPC} rpc |
59 | 60 | * @prop {TxToVarInt} toVarInt
|
60 | 61 | * @prop {TxToVarIntSize} toVarIntSize
|
61 | 62 | * @prop {TxReverseHex} reverseHex
|
@@ -1693,14 +1694,7 @@ var DashTx = ("object" === typeof module && exports) || {};
|
1693 | 1694 | }
|
1694 | 1695 | }
|
1695 | 1696 |
|
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} */ |
1704 | 1698 | TxUtils.rpc = async function rpc(basicAuthUrl, method, ...params) {
|
1705 | 1699 | let url = new URL(basicAuthUrl);
|
1706 | 1700 | let baseUrl = `${url.protocol}//${url.host}${url.pathname}`;
|
@@ -2356,6 +2350,16 @@ if ("object" === typeof module) {
|
2356 | 2350 | * @returns {Promise<TxPublicKey>} - public key buf
|
2357 | 2351 | */
|
2358 | 2352 |
|
| 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 | + |
2359 | 2363 | /**
|
2360 | 2364 | * Caution: JS can't handle 64-bit ints
|
2361 | 2365 | * @callback TxToVarInt
|
|
0 commit comments