http-client: seperate address and addresses methods
This commit is contained in:
parent
e6120039fc
commit
7cf63990d9
@ -318,7 +318,18 @@ HTTPClient.prototype.getInfo = function getInfo() {
|
|||||||
* @returns {Promise} - Returns {@link Coin}[].
|
* @returns {Promise} - Returns {@link Coin}[].
|
||||||
*/
|
*/
|
||||||
|
|
||||||
HTTPClient.prototype.getCoinsByAddress = function getCoinsByAddress(addresses) {
|
HTTPClient.prototype.getCoinsByAddress = function getCoinsByAddress(address) {
|
||||||
|
return this._get(`/coin/address/${address}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get coins that pertain to addresses from the mempool or chain database.
|
||||||
|
* Takes into account spent coins in the mempool.
|
||||||
|
* @param {String[]} addresses
|
||||||
|
* @returns {Promise} - Returns {@link Coin}[].
|
||||||
|
*/
|
||||||
|
|
||||||
|
HTTPClient.prototype.getCoinsByAddresses = function getCoinsByAddresses(addresses) {
|
||||||
return this._post('/coin/address', { addresses });
|
return this._post('/coin/address', { addresses });
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -341,7 +352,18 @@ HTTPClient.prototype.getCoin = function getCoin(hash, index) {
|
|||||||
* @returns {Promise} - Returns {@link TX}[].
|
* @returns {Promise} - Returns {@link TX}[].
|
||||||
*/
|
*/
|
||||||
|
|
||||||
HTTPClient.prototype.getTXByAddress = function getTXByAddress(addresses) {
|
HTTPClient.prototype.getTXByAddress = function getTXByAddress(address) {
|
||||||
|
return this._get(`/tx/address/${address}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve transactions pertaining to
|
||||||
|
* addresses from the mempool or chain database.
|
||||||
|
* @param {String[]} addresses
|
||||||
|
* @returns {Promise} - Returns {@link TX}[].
|
||||||
|
*/
|
||||||
|
|
||||||
|
HTTPClient.prototype.getTXByAddresses = function getTXByAddresses(addresses) {
|
||||||
return this._post('/tx/address', { addresses });
|
return this._post('/tx/address', { addresses });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user