Added CreateNewAccount, RenameAccount

This commit is contained in:
Javed Khan 2014-11-10 22:40:31 +05:30
parent a02ba2b4b1
commit 132207cb3f

View file

@ -960,6 +960,17 @@ func (c *Client) CreateMultisig(requiredSigs int, addresses []btcutil.Address) (
return c.CreateMultisigAsync(requiredSigs, addresses).Receive() return c.CreateMultisigAsync(requiredSigs, addresses).Receive()
} }
// CreateNewAccount creates a new wallet account.
func (c *Client) CreateNewAccount(account string) error {
id := c.NextID()
cmd := btcws.NewCreateNewAccountCmd(id, account)
_, err := c.sendCmdAndWait(cmd)
if err != nil {
return err
}
return nil
}
// FutureGetNewAddressResult is a future promise to deliver the result of a // FutureGetNewAddressResult is a future promise to deliver the result of a
// GetNewAddressAsync RPC invocation (or an applicable error). // GetNewAddressAsync RPC invocation (or an applicable error).
type FutureGetNewAddressResult chan *response type FutureGetNewAddressResult chan *response
@ -1326,6 +1337,17 @@ func (c *Client) MoveComment(fromAccount, toAccount string, amount btcutil.Amoun
comment).Receive() comment).Receive()
} }
// RenameAccount renames a wallet account.
func (c *Client) RenameAccount(oldaccount, newaccount string) error {
id := c.NextID()
cmd := btcws.NewRenameAccountCmd(id, oldaccount, newaccount)
_, err := c.sendCmdAndWait(cmd)
if err != nil {
return err
}
return nil
}
// FutureValidateAddressResult is a future promise to deliver the result of a // FutureValidateAddressResult is a future promise to deliver the result of a
// ValidateAddressAsync RPC invocation (or an applicable error). // ValidateAddressAsync RPC invocation (or an applicable error).
type FutureValidateAddressResult chan *response type FutureValidateAddressResult chan *response