client

package
v2.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbiClient

type AbiClient interface {
	CallOffChain(methodName string, params ...interface{}) ([]interface{}, error)
}

func GetAbiCli

func GetAbiCli(cli RpcClient, abiCode string, offchainCode string, addr types.Address) (AbiClient, error)

type Client

type Client interface {
	DexClient
	BuildNormalRequestBlock(params RequestTxParams, prev *ledger.HashHeight) (block *api.AccountBlock, err error)
	BuildRequestCreateContractBlock(params RequestCreateContractParams, prev *ledger.HashHeight) (block *api.AccountBlock, err error)
	BuildResponseBlock(params ResponseTxParams, prev *ledger.HashHeight) (block *api.AccountBlock, err error)
	GetBalance(addr types.Address, tokenId types.TokenTypeId) (*big.Int, *big.Int, error)
	GetBalanceAll(addr types.Address) (*api.RpcAccountInfo, *api.RpcAccountInfo, error)
	SignData(wallet *entropystore.Manager, block *api.AccountBlock) error
	SignDataWithPriKey(key *derivation.Key, block *api.AccountBlock) error
}

func NewClient

func NewClient(rpc RpcClient) (Client, error)

type DexClient

type DexClient interface {
	BuildRequestNewOrderBlock(param *dex.ParamPlaceOrder, selfAddr types.Address, prev *ledger.HashHeight) (block *api.AccountBlock, err error)
	BuildRequestCancelOrderBlock(param *dex.ParamDexCancelOrder, selfAddr types.Address, prev *ledger.HashHeight) (block *api.AccountBlock, err error)
}

type RequestCreateContractParams

type RequestCreateContractParams struct {
	SelfAddr types.Address
	// contains filtered or unexported fields
}

type RequestTxParams

type RequestTxParams struct {
	ToAddr   types.Address
	SelfAddr types.Address
	Amount   *big.Int
	TokenId  types.TokenTypeId
	Data     []byte
}

type ResponseTxParams

type ResponseTxParams struct {
	SelfAddr    types.Address
	RequestHash types.Hash
}

type RpcClient

func NewRpcClient

func NewRpcClient(rawurl string) (RpcClient, error)

type SignFunc

type SignFunc func(addr types.Address, data []byte) (signedData, pubkey []byte, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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