client

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2017-2018 OneLedger

Cover over the arguments of client requests

Index

Constants

View Source
const (

	// Broadcast a tx and wait for being commit to block
	BroadcastCommit = "commit"

	// Broadcast a tx and wait for CheckTx response
	// Recommend for smart contract
	BroadcastSync = "sync"

	// Broadcast a tax and return immediately
	BroadcastAsync = "async"

	RPC_ADDRESS = "127.0.0.1:6019"
)

Variables

View Source
var (
	ErrEmptyQuery    = errors.New("empty query path")
	ErrEmptyResponse = errors.New("empty response")
)
View Source
var ErrEmptyTransaction = errors.New("empty transaction")

Functions

This section is empty.

Types

type ApplyValidatorArguments

type ApplyValidatorArguments struct {
	Id     string
	Amount float64
	Purge  bool
}

type Context

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

func NewContext

func NewContext(rpcAddress, sdkAddress string) (cliCtx Context, err error)

func NewLocalContext

func NewLocalContext(node *node.Node) (cliCtx Context)

Generators

func (Context) Block

func (ctx Context) Block(height int64) (res *ctypes.ResultBlock)

func (Context) BroadcastTxAsync

func (ctx Context) BroadcastTxAsync(packet []byte) (res *ctypes.ResultBroadcastTx, err error)

func (Context) BroadcastTxCommit

func (ctx Context) BroadcastTxCommit(packet []byte) (res *ctypes.ResultBroadcastTxCommit, err error)

func (Context) BroadcastTxSync

func (ctx Context) BroadcastTxSync(packet []byte) (res *ctypes.ResultBroadcastTx, err error)

func (Context) Query

func (ctx Context) Query(serviceMethod string, args interface{}, response interface{}) error

Send a very specific query to return parse response.value

func (Context) Search

func (ctx Context) Search(query string, prove bool, page, perPage int) (res *ctypes.ResultTxSearch)

func (Context) Tx

func (ctx Context) Tx(hash []byte, prove bool) (res *ctypes.ResultTx)

type ExSendArguments

type ExSendArguments struct {
	SenderId        string
	ReceiverId      string
	SenderAddress   string
	ReceiverAddress string
	Currency        string
	Amount          float64

	Gas int64
	Fee float64

	Chain string
	ExGas string
	ExFee string
}

type SendArguments

type SendArguments struct {
	Party        []byte
	CounterParty []byte
	Amount       action.Amount
	Fee          action.Amount
	Gas          int64
	CurrencyStr  string
	AmountStr    string
	FeeStr       string
}

type SwapArguments

type SwapArguments struct {
	Party        string
	CounterParty string
	Amount       float64
	Currency     string
	Exchange     float64
	Excurrency   string
	Nonce        int64

	Fee float64
	Gas int64
}

Jump to

Keyboard shortcuts

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