diff --git a/src/RPC/Wallet.ts b/src/RPC/Wallet.ts index a32690a..9ec60e0 100644 --- a/src/RPC/Wallet.ts +++ b/src/RPC/Wallet.ts @@ -3,6 +3,7 @@ import { BackupWallet } from '../contracts/backupWallet'; import { BalanceDetail } from '../contracts/balanceDetail'; import { CheckWallet } from '../contracts/checkwallet'; import { Output, RawTransaction } from '../contracts/rawTransaction'; +import { Receivement } from '../contracts/receivement'; import { Script } from '../contracts/script'; import { DetailedRawTransaction, Transaction } from '../contracts/transaction'; import { WalletInfo } from '../contracts/walletInfo'; @@ -433,4 +434,28 @@ export class Wallet extends RPCBase { public async listAddressGroupings(): Promise<[string, number][][]> { return this.call('listaddressgroupings'); } + + /** @todo: listreceivedbyaccount */ + + /** + * List balances by receiving address. + * + * @param {number} [minConf=1] - The minimum number of confirmations before payments are included. + * @param {boolean} [includeEmpty=false] - Whether to include addresses that haven't received any payments. + * @param {boolean} [includeWatchOnly=false] - Whether to include watchonly addresses (see 'importaddress'). + * @returns {Promise} + * @memberof Wallet + */ + public listReceivedByAddress( + minConf = 1, + includeEmpty = false, + includeWatchOnly = false, + ): Promise { + return this.call( + 'listreceivedbyaddress', + minConf, + includeEmpty, + includeWatchOnly, + ); + } } diff --git a/src/contracts/receivement.ts b/src/contracts/receivement.ts index dd2083c..16a2747 100644 --- a/src/contracts/receivement.ts +++ b/src/contracts/receivement.ts @@ -1,41 +1,41 @@ -export interface IReceivement { +import { Address, TX } from '../types'; + +export interface Receivement { /** * Only returned if imported addresses were involved in transaction * * @type {boolean} - * @memberof IReceivement + * @memberof Receivement */ - involvesWatchonly: boolean; + involvesWatchonly: boolean; /** * The receiving address * - * @type {string} - * @memberof IReceivement + * @type {Address} + * @memberof Receivement */ - address: string; + address: Address; /** * The account of the receiving address. The default account is "". * * @deprecated * @type {string} - * @memberof IReceivement + * @memberof Receivement */ account: string; /** * The total amount in GRC received by the address * * @type {number} - * @memberof IReceivement + * @memberof Receivement */ amount: number; /** * The number of confirmations of the most recent transaction included * * @type {number} - * @memberof IReceivement + * @memberof Receivement */ confirmations: number; - // eslint-disable-next-line camelcase - tx_count: number; - txids: any; + txids: TX[]; }