/// <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="address"></param> /// <param name="permissions"></param> /// <param name="entity"></param> /// <param name="nativeAmount"></param> /// <param name="comment"></param> /// <param name="commentTo"></param> /// <param name="startBlock"></param> /// <param name="endBlock"></param> /// <returns></returns> public Task <JsonRpcResponse <string> > GrantAsync(string address, Enums.BlockChainPermission permissions, string entity = null, decimal nativeAmount = 0M, string comment = null, string commentTo = null, int startBlock = 0, int endBlock = 0) { List <string> addresses = new List <string>() { address }; return(GrantAsync(addresses, permissions, entity, nativeAmount, comment, commentTo, startBlock, endBlock)); }
/// <summary> /// This works like revoke, but with control over the from-address used to revoke the permissions. It is useful if the node has multiple addresses with administrator permissions. /// </summary> /// <param name="fromAddress"></param> /// <param name="toAddresses"></param> /// <param name="permissions"></param> /// <param name="entity"></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> RevokeFrom(string fromAddress, IEnumerable <string> toAddresses, Enums.BlockChainPermission permissions, string entity = null, decimal nativeAmount = 0M, string comment = null, string commentTo = null, int startBlock = 0, int endBlock = 0) { var stringifiedAddresses = Util.Utility.StringifyValues(toAddresses); var permissionsAsString = this.FormatPermissionsString(permissions, entity); return(_Client.Execute <string>("revokefrom", 0, fromAddress, stringifiedAddresses, permissionsAsString)); }