func (c *Client) ValidateAddress(ctx context.Context, address stdaddr.Address) (*types.ValidateAddressWalletResult, error) {
	res := new(types.ValidateAddressWalletResult)
	err := c.Call(ctx, "validateaddress", res, address.String())
	return res, err
}
ValidateAddress returns information about the given Decred address.
package dcrwallet
import (
	"context"
	"encoding/hex"
	"encoding/json"
	"strings"
	"decred.org/dcrwallet/v2/rpc/jsonrpc/types"
	"github.com/decred/dcrd/chaincfg/chainhash"
	"github.com/decred/dcrd/dcrutil/v4"
	"github.com/decred/dcrd/hdkeychain/v3"
	dcrdtypes "github.com/decred/dcrd/rpc/jsonrpc/types/v3"
	"github.com/decred/dcrd/txscript/v4/stdaddr"
	"github.com/decred/dcrd/wire"
)
func (c *Client) GetTransaction(ctx context.Context, txHash *chainhash.Hash) (*types.GetTransactionResult, error) {
	res := new(types.GetTransactionResult)
	err := c.Call(ctx, "gettransaction", res, txHash.String())
	return res, err
}
func (c *Client) ListTransactions(ctx context.Context, account string) ([]types.ListTransactionsResult, error) {
	var res []types.ListTransactionsResult
	err := c.Call(ctx, "listtransactions", &res, account)
	return res, err
}
func (c *Client) ListTransactionsCount(ctx context.Context, account string, count int) ([]types.ListTransactionsResult, error) {
	var res []types.ListTransactionsResult
	err := c.Call(ctx, "listtransactions", &res, account, count)
	return res, err
}
func (c *Client) ListTransactionsCountFrom(ctx context.Context, account string, count, from int) ([]types.ListTransactionsResult, error) {
	var res []types.ListTransactionsResult
	err := c.Call(ctx, "listtransactions", &res, account, count, from)
	return res, err
}
func (c *Client) ListUnspent(ctx context.Context) ([]types.ListUnspentResult, error) {
	var res []types.ListUnspentResult
	err := c.Call(ctx, "listunspent", &res)
	return res, err
}
func (c *Client) ListUnspentMin(ctx context.Context, minConf int) ([]types.ListUnspentResult, error) {
	var res []types.ListUnspentResult
	err := c.Call(ctx, "listunspent", &res, minConf)
	return res, err
}
func (c *Client) ListUnspentMinMax(ctx context.Context, minConf, maxConf int) ([]types.ListUnspentResult, error) {
	var res []types.ListUnspentResult
	err := c.Call(ctx, "listunspent", &res, minConf, maxConf)
	return res, err
}
func (c *Client) ListUnspentMinMaxAddresses(ctx context.Context, minConf, maxConf int, addrs []stdaddr.Address) ([]types.ListUnspentResult, error) {
	var res []types.ListUnspentResult
	err := c.Call(ctx, "listunspent", &res, minConf, maxConf, marshalAddresses(addrs))
	return res, err
}
func (c *Client) ListSinceBlock(ctx context.Context, blockHash *chainhash.Hash) (*types.ListSinceBlockResult, error) {
	var blockHashString *string
	if blockHash != nil {
		blockHashString = new(string)
		*blockHashString = blockHash.String()
	}
	res := new(types.ListSinceBlockResult)
	err := c.Call(ctx, "listsinceblock", res, blockHashString)
	return res, err
}
func (c *Client) ListSinceBlockMinConf(ctx context.Context, blockHash *chainhash.Hash, minConfirms int) (*types.ListSinceBlockResult, error) {
	var blockHashString *string
	if blockHash != nil {
		blockHashString = new(string)
		*blockHashString = blockHash.String()
	}
	res := new(types.ListSinceBlockResult)
	err := c.Call(ctx, "listsinceblock", res, blockHashString, minConfirms)
	return res, err
}
func (c *Client) LockUnspent(ctx context.Context, unlock bool, ops []*wire.OutPoint) error {
	outputs := make([]dcrdtypes.TransactionInput, len(ops))
	for i, op := range ops {
		outputs[i] = dcrdtypes.TransactionInput{
			Txid: op.Hash.String(),
			Vout: op.Index,
			Tree: op.Tree,
		}
	}
	return c.Call(ctx, "lockunspent", nil, unlock, outputs)
}
func (c *Client) ListLockUnspent(ctx context.Context) ([]*wire.OutPoint, error) {
	var ops []*wire.OutPoint
	err := c.Call(ctx, "listlockunspent", unmarshalOutpoints(&ops))
	return ops, err
}
func (c *Client) SendToAddress(ctx context.Context, address stdaddr.Address, amount dcrutil.Amount) (*chainhash.Hash, error) {
	var res *chainhash.Hash
	err := c.Call(ctx, "sendtoaddress", unmarshalHash(&res), address.String(), amount.ToCoin())
	return res, err
}
func (c *Client) SendFrom(ctx context.Context, fromAccount string, toAddress stdaddr.Address, amount dcrutil.Amount) (*chainhash.Hash, error) {
	var res *chainhash.Hash
	err := c.Call(ctx, "sendfrom", unmarshalHash(&res), fromAccount, toAddress.String(),
		amount.ToCoin())
	return res, err
}
func (c *Client) SendFromMinConf(ctx context.Context, fromAccount string, toAddress stdaddr.Address, amount dcrutil.Amount, minConfirms int) (*chainhash.Hash, error) {
	var res *chainhash.Hash
	err := c.Call(ctx, "sendfrom", unmarshalHash(&res), fromAccount, toAddress.String(),
		amount.ToCoin(), minConfirms)
	return res, err
}
func (c *Client) SendMany(ctx context.Context, fromAccount string, amounts map[stdaddr.Address]dcrutil.Amount) (*chainhash.Hash, error) {
	amountsObject := make(map[string]float64)
	for addr, amount := range amounts {
		amountsObject[addr.String()] = amount.ToCoin()
	}
	var res *chainhash.Hash
	err := c.Call(ctx, "sendmany", unmarshalHash(&res), fromAccount, amountsObject)
	return res, err
}
func (c *Client) SendManyMinConf(ctx context.Context, fromAccount string, amounts map[stdaddr.Address]dcrutil.Amount, minConfirms int) (*chainhash.Hash, error) {
	amountsObject := make(map[string]float64)
	for addr, amount := range amounts {
		amountsObject[addr.String()] = amount.ToCoin()
	}
	var res *chainhash.Hash
	err := c.Call(ctx, "sendmany", unmarshalHash(&res), fromAccount, amountsObject, minConfirms)
	return res, err
}
func (c *Client) PurchaseTicket(ctx context.Context, fromAccount string,
	spendLimit dcrutil.Amount, minConf *int, ticketAddress stdaddr.Address,
	numTickets *int, poolAddress stdaddr.Address, poolFees *dcrutil.Amount,
	expiry *int, ticketChange *bool, ticketFee *dcrutil.Amount) ([]*chainhash.Hash, error) {
	params := make([]interface{}, 2, 10)
	params[0] = fromAccount
	params[1] = spendLimit.ToCoin()
	var skipped int
	addParam := func(nonNil bool, value func() interface{}) {
		if nonNil {
			for i := 0; i < skipped; i++ {
				params = append(params, nil)
			}
			skipped = 0
			params = append(params, value())
		} else {
			skipped++
		}
	}
	addParam(minConf != nil, func() interface{} { return *minConf })
	addParam(ticketAddress != nil, func() interface{} { return ticketAddress.String() })
	addParam(numTickets != nil, func() interface{} { return *numTickets })
	addParam(poolAddress != nil, func() interface{} { return poolAddress.String() })
	addParam(poolFees != nil, func() interface{} { return poolFees.ToCoin() })
	addParam(expiry != nil, func() interface{} { return *expiry })
	addParam(ticketChange != nil, func() interface{} { return *ticketChange })
	addParam(ticketFee != nil, func() interface{} { return ticketFee.ToCoin() })
	var res []*chainhash.Hash
	err := c.Call(ctx, "purchaseticket", unmarshalHashes(&res), params...)
	return res, err
}
func (c *Client) AddMultisigAddress(ctx context.Context, requiredSigs int, addresses []stdaddr.Address, account string) (stdaddr.Address, error) {
	var res stdaddr.Address
	err := c.Call(ctx, "addmultisigaddress", unmarshalAddress(&res, c.net), requiredSigs,
		marshalAddresses(addresses), account)
	return res, err
}
func (c *Client) CreateMultisig(ctx context.Context, requiredSigs int, addresses []stdaddr.Address) (*types.CreateMultiSigResult, error) {
	res := new(types.CreateMultiSigResult)
	err := c.Call(ctx, "createmultisig", res, requiredSigs, marshalAddresses(addresses))
	return res, err
}
func (c *Client) CreateNewAccount(ctx context.Context, account string) error {
	return c.Call(ctx, "createnewaccount", nil, account)
}
type GapPolicy string
const (
	GapPolicyError  GapPolicy = "error"
	GapPolicyIgnore GapPolicy = "ignore"
	GapPolicyWrap   GapPolicy = "wrap"
)
func (c *Client) GetNewAddress(ctx context.Context, account string) (stdaddr.Address, error) {
	var addr stdaddr.Address
	err := c.Call(ctx, "getnewaddress", unmarshalAddress(&addr, c.net), account)
	return addr, err
}
func (c *Client) GetNewAddressGapPolicy(ctx context.Context, account string, gapPolicy GapPolicy) (stdaddr.Address, error) {
	var addr stdaddr.Address
	err := c.Call(ctx, "getnewaddress", unmarshalAddress(&addr, c.net), account, string(gapPolicy))
	return addr, err
}
func (c *Client) GetRawChangeAddress(ctx context.Context, account string, net stdaddr.AddressParams) (stdaddr.Address, error) {
	var addr stdaddr.Address
	err := c.Call(ctx, "getrawchangeaddress", unmarshalAddress(&addr, c.net), account)
	return addr, err
}
func (c *Client) GetAccountAddress(ctx context.Context, account string) (stdaddr.Address, error) {
	var addr stdaddr.Address
	err := c.Call(ctx, "getaccountaddress", unmarshalAddress(&addr, c.net), account)
	return addr, err
}
func (c *Client) GetAccount(ctx context.Context, address stdaddr.Address) (string, error) {
	var res string
	err := c.Call(ctx, "getaccount", &res, address.String())
	return res, err
}
func (c *Client) GetAddressesByAccount(ctx context.Context, account string) ([]stdaddr.Address, error) {
	var addrs []stdaddr.Address
	err := c.Call(ctx, "getaddressesbyaccount", unmarshalAddresses(&addrs, c.net), account)
	return addrs, err
}
func (c *Client) RenameAccount(ctx context.Context, oldAccount, newAccount string) error {
	return c.Call(ctx, "renameaccount", nil, oldAccount, newAccount)
}