client

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: GPL-3.0 Imports: 16 Imported by: 4

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
	SignDataWithEd25519Key(key ed25519.PrivateKey, 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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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