Documentation
¶
Overview ¶
The wallet package implements interaction with a dcrwallet via gRPC.
Index ¶
- type Config
- type Wallet
- func (w *Wallet) CreateEscrow(ctx context.Context, con *contract.Contract) error
- func (w *Wallet) CreateOffer(ctx context.Context, con *contract.Contract, hashes [][]byte) error
- func (w *Wallet) CreateRedeem(ctx context.Context, con *contract.Contract) error
- func (w *Wallet) CurrentBlockHeight(ctx context.Context) (uint32, error)
- func (w *Wallet) GetExtAddress(ctx context.Context) (string, string, error)
- func (w *Wallet) GetIntAddress(ctx context.Context) (string, string, error)
- func (w *Wallet) ImportEscrowScript(ctx context.Context, con *contract.Contract) error
- func (w *Wallet) OfferRedeemer(ctx context.Context, con *contract.Contract) (bool, [][]byte, error)
- func (w *Wallet) PublishEscrow(ctx context.Context, con *contract.Contract) error
- func (w *Wallet) PublishRedeem(ctx context.Context, con *contract.Contract, peerSig []byte) error
- func (w *Wallet) PublishRefund(ctx context.Context, con *contract.Contract) error
- func (w *Wallet) PublishSolution(ctx context.Context, con *contract.Contract, secrets [][]byte) error
- func (w *Wallet) SelectAccount(ctx context.Context, name string) error
- func (w *Wallet) SignHashes(ctx context.Context, con *contract.Contract, txHashes [][]byte) ([][]byte, []byte, error)
- func (w *Wallet) ValidateOffer(ctx context.Context, con *contract.Contract, escrowHash []byte) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
Wallet represents an interface to an established RPC connection with dcrwallet software and supports tumbler with wallet and blockchain services.
func New ¶
New creates a new wallet object associated with the connection conn under chainParams. It also makes sure wallet is running and configured for the correct network.
func (*Wallet) CreateEscrow ¶
CreateEscrow constructs and signs a pay to script hash transaction that transfers funds from the tumbler to the client locked until the specified locktime. It also creates an associated refund transaction.
func (*Wallet) CreateOffer ¶
CreateOffer creates an escrow transaction that releases funds when hash preimages are published.
func (*Wallet) CreateRedeem ¶
CreateRedeem creates a transaction redeeming escrowed funds.
func (*Wallet) CurrentBlockHeight ¶
func (*Wallet) GetExtAddress ¶
func (*Wallet) GetIntAddress ¶
func (*Wallet) ImportEscrowScript ¶
func (*Wallet) OfferRedeemer ¶
OfferRedeemer looks up the transaction spending the escrow and obtains hash preimages used to redeem the contract.
func (*Wallet) PublishEscrow ¶
PublishEscrow publishes the escrow transaction.
func (*Wallet) PublishRedeem ¶
PublishRedeem publishes the redeeming transaction.
func (*Wallet) PublishRefund ¶
PublishRefund publishes the refund transaction.
func (*Wallet) PublishSolution ¶
func (w *Wallet) PublishSolution(ctx context.Context, con *contract.Contract, secrets [][]byte) error
PublishSolution builds a fulfilling transaction that reveals preimages for hashes contained in the offer tx and thus redeems funds escrowed by they payer. It publishes both offer and fulfilling transactions.
func (*Wallet) SelectAccount ¶
SelectAccount looks up an account by the provided name and selects it for future wallet operations.