forked from LBRYCommunity/lbry-sdk
Merge pull request #686 from lbryio/claim-send-to-address
add claim_send_to_address
This commit is contained in:
commit
bea6e2913f
3 changed files with 26 additions and 1 deletions
|
@ -9,7 +9,7 @@ at anytime.
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
### Added
|
### Added
|
||||||
*
|
* Add `claim_send_to_address`
|
||||||
*
|
*
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -1102,6 +1102,9 @@ class Wallet(object):
|
||||||
def _get_values_for_uris(self, page, page_size, *uris):
|
def _get_values_for_uris(self, page, page_size, *uris):
|
||||||
return defer.fail(NotImplementedError())
|
return defer.fail(NotImplementedError())
|
||||||
|
|
||||||
|
def send_claim_to_address(self, claim_id, destination, amount):
|
||||||
|
return defer.fail(NotImplementedError())
|
||||||
|
|
||||||
def _start(self):
|
def _start(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1428,6 +1431,9 @@ class LBRYumWallet(Wallet):
|
||||||
def list_addresses(self):
|
def list_addresses(self):
|
||||||
return self._run_cmd_as_defer_succeed('listaddresses')
|
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):
|
def _save_wallet(self, val=None):
|
||||||
self.wallet.storage.write()
|
self.wallet.storage.write()
|
||||||
return defer.succeed(val)
|
return defer.succeed(val)
|
||||||
|
|
|
@ -1901,6 +1901,25 @@ class Daemon(AuthJSONRPCServer):
|
||||||
self.analytics_manager.send_claim_action('new_support')
|
self.analytics_manager.send_claim_action('new_support')
|
||||||
defer.returnValue(result)
|
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
|
# TODO: claim_list_mine should be merged into claim_list, but idk how to authenticate it -Grin
|
||||||
@AuthJSONRPCServer.auth_required
|
@AuthJSONRPCServer.auth_required
|
||||||
def jsonrpc_claim_list_mine(self):
|
def jsonrpc_claim_list_mine(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue