sdk

package
v0.0.0-...-cfcde66 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKeyStore

func NewKeyStore(keydir string) (*keystore.KeyStore, error)

Types

type EthConfig

type EthConfig struct {
	HttpUrl string
	KeyDir  string
	WsPath  string
}

type EthSDK

type EthSDK struct {
	HttpClient *rpc.Client
	Keystore   *keystore.KeyStore
	IpcClient  *rpc.Client
	WsClient   *rpc.Client
}

func NewEthSDK

func NewEthSDK(config EthConfig, ks *keystore.KeyStore) (*EthSDK, error)

func (*EthSDK) Deploy

func (es *EthSDK) Deploy(
	acc *accounts.Account,
	chainId *big.Int,
	nonce uint64,
	amount *big.Int,
	gasLimit uint64,
	price *big.Int,
	contractPath string,
) (string, error)

func (*EthSDK) EstimateGas

func (es *EthSDK) EstimateGas(from, to ethcom.Address, data []byte, value, gasPrice *big.Int) (uint64, error)

func (*EthSDK) EthCall

func (es *EthSDK) EthCall(
	blockNumber uint64,
	to ethcom.Address,
	data []byte,
	abi_instance abi.ABI,
	method string,
	result_struct interface{},
) (interface{}, error)

func (*EthSDK) FormSignedTransaction

func (es *EthSDK) FormSignedTransaction(
	acc *accounts.Account,
	chainId *big.Int,
	nonce uint64,
	to ethcom.Address,
	amount *big.Int,
	gasLimit uint64,
	price *big.Int,
	input []byte,
) ([]byte, error)

func (*EthSDK) GetAccounts

func (es *EthSDK) GetAccounts() []accounts.Account

func (*EthSDK) GetBalanceByHex

func (es *EthSDK) GetBalanceByHex(hex string) (*big.Int, error)

func (*EthSDK) GetBlockByNumber

func (es *EthSDK) GetBlockByNumber(blockNumber uint64) (string, error)

func (*EthSDK) GetBlockNumber

func (es *EthSDK) GetBlockNumber() (*big.Int, error)

func (*EthSDK) GetLogs

func (es *EthSDK) GetLogs(fromBlock string, toBlock string, address []ethcom.Address, topics [][]ethcom.Hash) ([]types.Log, error)

func (*EthSDK) GetNonce

func (es *EthSDK) GetNonce(address ethcom.Address) (uint64, error)

func (*EthSDK) GetTransactionByHash

func (es *EthSDK) GetTransactionByHash(data ethcom.Hash) (interface{}, error)

func (*EthSDK) GetTransactionCount

func (es *EthSDK) GetTransactionCount(account ethcom.Address) (uint64, error)

func (*EthSDK) GetTransactionReceipt

func (es *EthSDK) GetTransactionReceipt(data ethcom.Hash) (map[string]interface{}, error)

func (*EthSDK) ListenAndPreProcessEvent

func (es *EthSDK) ListenAndPreProcessEvent(abiPath string, events []string, to []ethcom.Address, handledRecv chan map[string]interface{})

func (*EthSDK) ListenWsEvent

func (es *EthSDK) ListenWsEvent(arg map[string]interface{}, result chan types.Log)

func (*EthSDK) NewAccount

func (es *EthSDK) NewAccount(pass string) (string, error)

func (*EthSDK) RetraceLog

func (es *EthSDK) RetraceLog(config common.RetraceConf, log chan types.Log)

func (*EthSDK) SendRawTransaction

func (es *EthSDK) SendRawTransaction(data []byte, isWait bool) (ethcom.Hash, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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