From 37c2bc473361535f0a0be18ba08b4bd156c686bf Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 27 Feb 2020 15:46:50 +0300 Subject: [PATCH] rpc: implement (*Client).GetClaimable() This is needed to form correct Claim transaction. --- pkg/rpc/client/rpc.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/rpc/client/rpc.go b/pkg/rpc/client/rpc.go index 942fcafa7..d12a23d03 100644 --- a/pkg/rpc/client/rpc.go +++ b/pkg/rpc/client/rpc.go @@ -43,6 +43,16 @@ func (c *Client) GetAccountState(address string) (*result.AccountState, error) { return resp, nil } +// GetClaimable returns tx outputs which can be claimed. +func (c *Client) GetClaimable(address string) (*result.ClaimableInfo, error) { + params := request.NewRawParams(address) + resp := new(result.ClaimableInfo) + if err := c.performRequest("getclaimable", params, resp); err != nil { + return nil, err + } + return resp, nil +} + // GetUnspents returns UTXOs for the given NEO account. func (c *Client) GetUnspents(address string) (*result.Unspents, error) { var (