/// <summary> /// Returns a list of all the asset balances for address in this node’s wallet, with at least minconf confirmations. Use includeLocked to include unspent outputs which have been locked, e.g. by a call to preparelockunspent. /// </summary> /// <param name="address"></param> /// <param name="confirmations"></param> /// <param name="includeLocked"></param> /// <returns></returns> public JsonRpcResponse <List <AssetBalanceResponse> > GetAddressBalances(string address, int confirmations = 1, bool includeLocked = false) { return(_Client.Execute <List <AssetBalanceResponse> >("getaddressbalances", 0, address, confirmations, includeLocked)); }
/// <summary> /// Sends one or more assets to address, returning the txid. In Bitcoin Core, the amount field is the quantity of the bitcoin currency. For MultiChain, an {"asset":qty, ...} object can be used for amount, in which each asset is an asset name, ref or issuance txid, and each qty is the quantity of that asset to send (see native assets). Use "" as the asset inside this object to specify a quantity of the native blockchain currency. See also sendasset for sending a single asset and sendfrom to control the address whose funds are used. /// </summary> /// <param name="address"></param> /// <param name="amount"></param> /// <param name="comment"></param> /// <param name="commentTo"></param> /// <returns></returns> public JsonRpcResponse <string> Send(string address, decimal amount, string comment = null, string commentTo = null) { return(_Client.Execute <string>("send", 0, address, amount, comment ?? string.Empty, commentTo ?? string.Empty)); }
/// <summary> /// Returns information about the block with hash (retrievable from getblockhash) or at the given height in the active chain. Set verbose to 0 or false for the block in raw hexadecimal form. Set to 1 or true for a block summary including the miner address and a list of txids. Set to 2 to 3 to include more information about each transaction and its raw hexadecimal. Set to 4 to include a full description of each transaction, formatted like the output of decoderawtransaction. /// </summary> /// <param name="height"></param> /// <returns></returns> public JsonRpcResponse <BlockResponse> GetBlock(int height) { return(_Client.Execute <BlockResponse>("getblock", 0, height.ToString(), false)); }
/// <summary> /// Returns a list of values of this blockchain’s parameters, which are fixed by the chain’s genesis block and the same for all nodes. /// </summary> /// <returns></returns> public JsonRpcResponse <Dictionary <string, object> > GetBlockChainParams() { return(_Client.Execute <Dictionary <string, object> >("getblockchainparams", 0)); }
/// <summary> /// Grants permissions to addresses, a comma-separated list of addresses. For global permissions, set permissions to one of connect, send, receive, create, issue, mine, activate, admin, or a comma-separated list thereof. For per-asset or per-stream permissions, use the form entity.issue or entity.write,admin where entity is an asset or stream name, ref or creation txid. If the chain uses a native currency, you can send some to each recipient using the native-amount parameter. Returns the txid of the transaction granting the permissions. For more information, see permissions management. /// </summary> /// <param name="addresses"></param> /// <param name="permissions"></param> /// <param name="nativeAmount"></param> /// <param name="comment"></param> /// <param name="commentTo"></param> /// <param name="startBlock"></param> /// <param name="endBlock"></param> /// <returns></returns> public JsonRpcResponse <string> Grant(IEnumerable <string> addresses, string permissions, decimal nativeAmount = 0M, string comment = null, string commentTo = null, int startBlock = 0, int endBlock = 0) { var stringifiedAddresses = Util.Utility.StringifyValues(addresses); return(_Client.Execute <string>("grant", 0, stringifiedAddresses, permissions)); }