forked from LBRYCommunity/lbry-sdk
add claim_send_to_address
This commit is contained in:
parent
c393822c2b
commit
c56ac12913
3 changed files with 26 additions and 1 deletions
|
@ -9,7 +9,7 @@ at anytime.
|
|||
|
||||
## [Unreleased]
|
||||
### Added
|
||||
*
|
||||
* Add `claim_send_to_address`
|
||||
*
|
||||
|
||||
### Changed
|
||||
|
|
|
@ -1102,6 +1102,9 @@ class Wallet(object):
|
|||
def _get_values_for_uris(self, page, page_size, *uris):
|
||||
return defer.fail(NotImplementedError())
|
||||
|
||||
def send_claim_to_address(self, claim_id, destination, amount):
|
||||
return defer.fail(NotImplementedError())
|
||||
|
||||
def _start(self):
|
||||
pass
|
||||
|
||||
|
@ -1428,6 +1431,9 @@ class LBRYumWallet(Wallet):
|
|||
def list_addresses(self):
|
||||
return self._run_cmd_as_defer_succeed('listaddresses')
|
||||
|
||||
def send_claim_to_address(self, claim_id, destination, amount):
|
||||
return self._run_cmd_as_defer_succeed('sendclaimtoaddress', claim_id, destination, amount)
|
||||
|
||||
def _save_wallet(self, val=None):
|
||||
self.wallet.storage.write()
|
||||
return defer.succeed(val)
|
||||
|
|
|
@ -1901,6 +1901,25 @@ class Daemon(AuthJSONRPCServer):
|
|||
self.analytics_manager.send_claim_action('new_support')
|
||||
defer.returnValue(result)
|
||||
|
||||
@AuthJSONRPCServer.auth_required
|
||||
@defer.inlineCallbacks
|
||||
def jsonrpc_claim_send_to_address(self, claim_id, address, amount=None):
|
||||
"""
|
||||
Send a name claim to an address
|
||||
|
||||
Usage:
|
||||
claim_send_to_address (<claim_id> | --claim_id=<claim_id>)
|
||||
(<address> | --address=<address>)
|
||||
[<amount> | --amount=<amount>]
|
||||
|
||||
Options:
|
||||
<amount> : Amount of credits to claim name for, defaults to the current amount
|
||||
on the claim
|
||||
"""
|
||||
result = yield self.session.wallet.send_claim_to_address(claim_id, address, amount)
|
||||
response = yield self._render_response(result)
|
||||
defer.returnValue(response)
|
||||
|
||||
# TODO: claim_list_mine should be merged into claim_list, but idk how to authenticate it -Grin
|
||||
@AuthJSONRPCServer.auth_required
|
||||
def jsonrpc_claim_list_mine(self):
|
||||
|
|
Loading…
Reference in a new issue