コード例 #1
0
ファイル: RPCClient.Wallet.cs プロジェクト: sanbir/NBitcoin
        /// <summary>
        /// Returns the total amount received by the specified address in transactions with the
        /// specified number of confirmations. It does not count coinbase transactions.
        /// </summary>
        /// <param name="confirmations">
        /// The minimum number of confirmations an externally-generated transaction must have before
        /// it is counted towards the balance. Transactions generated by this node are counted immediately.
        /// Typically, externally-generated transactions are payments to this wallet and transactions
        /// generated by this node are payments to other wallets. Use 0 to count unconfirmed transactions.
        /// Default is 1.
        /// </param>
        /// <returns>The number of bitcoins received by the address, excluding coinbase transactions. May be 0.</returns>
        public Money GetReceivedByAddress(BitcoinAddress address, int confirmations)
        {
            var response = SendCommand(RPCOperations.getreceivedbyaddress, address.ToWif(), confirmations);

            return(Money.Coins(response.Result.Value <decimal>()));
        }