client

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*http.Client
	// contains filtered or unexported fields
}

func New

func New(baseURI string) *Client

func (*Client) GetAddressUTXOs

func (c *Client) GetAddressUTXOs(ctx context.Context, addr common.Address) ([]types.Position, error)

func (*Client) GetBlock

func (c *Client) GetBlock(ctx context.Context, blkNum uint64) (*types.Block, error)

func (*Client) GetTx

func (c *Client) GetTx(ctx context.Context, txPos types.Position) (*types.Tx, error)

func (*Client) GetTxProof

func (c *Client) GetTxProof(ctx context.Context, txPos types.Position) ([]byte, error)

func (*Client) PostBlock

func (c *Client) PostBlock(ctx context.Context) (uint64, error)

func (*Client) PostDeposit added in v0.3.0

func (c *Client) PostDeposit(ctx context.Context, ownerAddr common.Address, amount *big.Int) (uint64, error)

func (*Client) PostTx

func (c *Client) PostTx(ctx context.Context, tx *types.Tx) error

func (*Client) PutTxIn

func (c *Client) PutTxIn(ctx context.Context, txInPos types.Position, confSig types.Signature) error

func (*Client) PutTxOut added in v0.4.0

func (c *Client) PutTxOut(ctx context.Context, txOutPos types.Position, isExited bool) error

type ErrorResponse

type ErrorResponse struct {
	*ResponseBase
	Result *app.Error `json:"result"`
}

type GetAddressUTXOsResponse

type GetAddressUTXOsResponse struct {
	*ResponseBase
	Result struct {
		UTXOs []types.Position `json:"utxos"`
	} `json:"result"`
}

type GetBlockResponse

type GetBlockResponse struct {
	*ResponseBase
	Result struct {
		BlockStr string `json:"blk"`
	} `json:"result"`
}

type GetTxProofResponse

type GetTxProofResponse struct {
	*ResponseBase
	Result struct {
		ProofStr string `json:"proof"`
	} `json:"result"`
}

type GetTxResponse

type GetTxResponse struct {
	*ResponseBase
	Result struct {
		TxStr string `json:"tx"`
	} `json:"result"`
}

type PostBlockResponse

type PostBlockResponse struct {
	*ResponseBase
	Result struct {
		BlockNumber uint64 `json:"blknum"`
	} `json:"result"`
}

type PostDepositResponse added in v0.3.0

type PostDepositResponse struct {
	*ResponseBase
	Result struct {
		BlockNumber uint64 `json:"blknum"`
	} `json:"result"`
}

type PostTxResponse

type PostTxResponse struct {
	*ResponseBase
	Result struct{} `json:"result"`
}

type PutTxInResponse

type PutTxInResponse struct {
	*ResponseBase
	Result struct{} `json:"result"`
}

type PutTxOutResponse added in v0.4.0

type PutTxOutResponse struct {
	*ResponseBase
	Result struct{} `json:"result"`
}

type ResponseBase

type ResponseBase struct {
	State string `json:"state"`
}

Jump to

Keyboard shortcuts

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