This repository has been archived on 2024-04-07. You can view files and clone it, but cannot push or open issues or pull requests.
go-monero/pkg/rpc/wallet/client.go
Ciro S. Costa 096ad758c2 source formatting
no behavior changes

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 06:51:24 -04:00

32 lines
661 B
Go

package wallet
import "context"
// Requester is responsible for making HTTP requests to `monero-wallet-rpc`
// JSONRPC endpoints.
//
type Requester interface {
// JSONRPC is used for callind methods under `/json_rpc` that follow
// monero's `v2` response and error encapsulation.
//
JSONRPC(
ctx context.Context, method string, params, result interface{},
) error
}
// Client provides access to the daemon's JSONRPC methods and regular
// endpoints.
//
type Client struct {
Requester
}
// NewClient instantiates a new client for interacting with monero's daemon
// api.
//
func NewClient(c Requester) *Client {
return &Client{
Requester: c,
}
}