add claim_renew
This commit is contained in:
parent
0cf45657c0
commit
d6e3b11026
3 changed files with 47 additions and 0 deletions
|
@ -30,6 +30,7 @@ at anytime.
|
|||
### Added
|
||||
* Added `channel_import` and `channel_export` commands
|
||||
* Added `is_mine` field to `channel_list` results
|
||||
* Added `claim_renew` command
|
||||
|
||||
### Removed
|
||||
* Removed claim related filter arguments `name`, `claim_id`, and `outpoint` from `file_list`, `file_delete`, `file_set_status`, and `file_reflect`
|
||||
|
|
|
@ -1132,6 +1132,12 @@ class Wallet(object):
|
|||
def _get_values_for_uris(self, page, page_size, *uris):
|
||||
return defer.fail(NotImplementedError())
|
||||
|
||||
def _claim_renew_all_before_expiration(self, height):
|
||||
return defer.fail(NotImplementedError())
|
||||
|
||||
def _claim_renew(self, txid, nout):
|
||||
return defer.fail(NotImplementedError())
|
||||
|
||||
def send_claim_to_address(self, claim_id, destination, amount):
|
||||
return defer.fail(NotImplementedError())
|
||||
|
||||
|
@ -1512,6 +1518,12 @@ class LBRYumWallet(Wallet):
|
|||
def get_certificates_for_signing(self):
|
||||
return self._run_cmd_as_defer_succeed('getcertificatesforsigning')
|
||||
|
||||
def _claim_renew_all_before_expiration(self, height):
|
||||
return self._run_cmd_as_defer_succeed('renewclaimsbeforeexpiration', height)
|
||||
|
||||
def _claim_renew(self, txid, nout):
|
||||
return self._run_cmd_as_defer_succeed('listunspent')
|
||||
|
||||
# TODO: get rid of this function. lbryum should take care of it
|
||||
def _save_wallet(self, val=None):
|
||||
self.wallet.storage.write()
|
||||
|
|
|
@ -1993,6 +1993,40 @@ class Daemon(AuthJSONRPCServer):
|
|||
self.analytics_manager.send_claim_action('new_support')
|
||||
defer.returnValue(result)
|
||||
|
||||
@AuthJSONRPCServer.auth_required
|
||||
@defer.inlineCallbacks
|
||||
def jsonrpc_claim_renew(self, outpoint=None, height=None):
|
||||
"""
|
||||
Renew claim(s) or support(s)
|
||||
|
||||
Usage:
|
||||
claim_renew (<outpoint> | --outpoint=<outpoint>) | (<height> | --height=<height>)
|
||||
|
||||
Return:
|
||||
(dict) Dictionary containing result of the claim/support renewals
|
||||
{
|
||||
'tx' : (str) hex encoded transaction
|
||||
'txid' : (str) txid of resulting claim
|
||||
'nout' : (int) nout of the resulting claim
|
||||
'fee' : (float) fee paid for the claim transaction
|
||||
'claim_id' : (str) claim ID of the resulting claim
|
||||
}
|
||||
"""
|
||||
|
||||
if outpoint is None and height is None:
|
||||
raise Exception("must provide an outpoint or a height")
|
||||
elif outpoint is not None:
|
||||
if len(outpoint.split(":")) == 2:
|
||||
txid, nout = outpoint.split(":")
|
||||
nout = int(nout)
|
||||
else:
|
||||
raise Exception("invalid outpoint")
|
||||
result = yield self.session.wallet.claim_renew(txid, nout)
|
||||
else:
|
||||
height = int(height)
|
||||
result = yield self.session.wallet.claim_renew_all_before_expiration(height)
|
||||
defer.returnValue(result)
|
||||
|
||||
@AuthJSONRPCServer.auth_required
|
||||
@defer.inlineCallbacks
|
||||
def jsonrpc_claim_send_to_address(self, claim_id, address, amount=None):
|
||||
|
|
Loading…
Reference in a new issue