address

package
v0.0.0-...-0854145 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Address common.Address `json:"address"`
}

Address is a wrapper arroung the ethereum 20-byte address.

type Client

type Client struct {
	Getter
}

Client is a address client that allows access to the get address HTTP calls to a Raiden node.

func NewClient

func NewClient(config *config.Config, httpClient *http.Client) *Client

NewClient creates a new address client that provides access to a Raiden node ethereum address that is being used.

type Getter

type Getter interface {
	Get(ctx context.Context) (common.Address, error)
}

Getter is a generic interface to list the Ethereum address associated to the Raiden node. It allows for a context to be passed to allow for request timeouts and/or deadlines on the response.

Example
var (
	addressClient *Client
	config        = &config.Config{
		Host:       "http://localhost:5001",
		APIVersion: "v1",
	}
	address common.Address
	err     error
)

addressClient = NewClient(config, http.DefaultClient)

if address, err = addressClient.Get(context.Background()); err != nil {
	panic(fmt.Sprintf("unable to get ethereum address from raiden node: %s", err.Error()))
}

fmt.Println("raiden address:", address.String())
Output:

func NewGetter

func NewGetter(config *config.Config, httpClient *http.Client) Getter

NewGetter will return a default address lister for a configured Raiden node.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL