client

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 {
	Address      []byte
	Name         string
	Amount       string
	Purge        bool
	TmPubKeyType string
	TmPubKey     []byte
}

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