diff --git a/wallet.go b/wallet.go index 01ec19af..916e9100 100644 --- a/wallet.go +++ b/wallet.go @@ -960,6 +960,17 @@ func (c *Client) CreateMultisig(requiredSigs int, addresses []btcutil.Address) ( 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 // GetNewAddressAsync RPC invocation (or an applicable error). type FutureGetNewAddressResult chan *response @@ -1326,6 +1337,17 @@ func (c *Client) MoveComment(fromAccount, toAccount string, amount btcutil.Amoun 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 // ValidateAddressAsync RPC invocation (or an applicable error). type FutureValidateAddressResult chan *response