api

package
v0.0.0-...-32f009b Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func New

func New(client UpStream) *API

Create new api with given client

func (*API) RenderModal

func (a *API) RenderModal(uiID, layout string, dAppIDKey ed25519.PublicKey) error

func (*API) Respond

func (a *API) Respond(id string, resp *pb.Response, passedErr error, timeOut time.Duration) error

send a response for a received api request

func (*API) SendEthereumTransaction

func (a *API) SendEthereumTransaction(value, to, data string) (string, error)

type DAppApi

type DAppApi struct {
	// contains filtered or unexported fields
}

func (*DAppApi) RenderModal

func (a *DAppApi) RenderModal(uiID, layout string, dAppPubKey ed25519.PublicKey) error

request to show a modal

func (*DAppApi) SendEthereumTransaction

func (a *DAppApi) SendEthereumTransaction(value, to, data string) (string, error)

send an ethereum transaction to api

type Response

type Response struct {
	Msg    *pb.Response
	Error  error
	Closer chan error
}

This represent an api response It's important to close the response as soon as possible If the response is not closed by sending an error / nil to the Closer The response will time out for the client as it doesn't receive a response

type UpStream

type UpStream interface {
	Send(data string)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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