Documentation ¶
Overview ¶
Package raidenclient creates a generic client to access sub-clients that correspond to the various API calls that any Raiden node supports.
Example ¶
var ( err error raidenConfig = &config.Config{ Host: "http://localhost:5001", APIVersion: "v1", } raidenClient = NewClient(raidenConfig, http.DefaultClient) address common.Address ) // get our token address from the raiden node if address, err = raidenClient.Address().Get(context.TODO()); err != nil { log.Println("there was an error getting raiden token address:", err.Error()) } log.Println("raiden token address:", address.Hex())
Output:
Index ¶
- type Client
- func (client *Client) Address() *address.Client
- func (client *Client) Channels() *channels.Client
- func (client *Client) Connections() *connections.Client
- func (client *Client) Payments() *payments.Client
- func (client *Client) PendingTransfers() *pendingtransfers.Client
- func (client *Client) Tokens() *tokens.Client
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { AddressClient *address.Client TokensClient *tokens.Client ChannelsClient *channels.Client PaymentsClient *payments.Client ConnectionsClient *connections.Client PendingTransfersClient *pendingtransfers.Client }
Client provides access to API sub-clients that correspond to the various API calls that a Raiden node supports.
func NewClient ¶
NewClient will return a Raiden client that is able to access all of the API calls that are currently available on a Raiden node. This provides access to the various sub-clients that correspond to the various API calls available.
func (*Client) Address ¶
Address returns the Address sub-client to access the address being used by the Raiden node.
func (*Client) Channels ¶
Channels returns the Channels sub-client that will be able to open, close and increase the deposit of a micro-payment channel.
func (*Client) Connections ¶
func (client *Client) Connections() *connections.Client
Connections returns the Connections sub-client that will be able to list, join and leave token networks.
func (*Client) Payments ¶
Payments returns the Payments sub-client that will be able to query all of the pending payments.
func (*Client) PendingTransfers ¶
func (client *Client) PendingTransfers() *pendingtransfers.Client
PendingTransfers returns the PendingTransfers sub-client that will be able to query all pending transfers by token or a channel.