func WinningTickets(params json.RawMessage) (block *chainhash.Hash, height int32, winners []*chainhash.Hash, err error) {
	ticketObj := make(map[string]*hash)
	hash := new(hash)
	err = unmarshalArray(params, hash, &height, &ticketObj)
	if err != nil {
		return
	}
	winners = make([]*chainhash.Hash, 0, len(ticketObj))
	for _, h := range ticketObj {
		winners = append(winners, h.Hash)
	}
	return hash.Hash, height, winners, nil
}
WinningTickets extracts the parameters from a winningtickets JSON-RPC
notification.
package dcrd
import (
	"encoding/json"
	"decred.org/dcrwallet/v2/errors"
	"github.com/decred/dcrd/chaincfg/chainhash"
	"github.com/decred/dcrd/wire"
)
func unmarshalArray(j json.RawMessage, params ...interface{}) error {
	err := json.Unmarshal(j, &params)
	if err != nil {
		return errors.E(errors.Encoding, err)
	}
	return nil
}