types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UTXO_DESTS_MAX_NUM = 16
)

Variables

View Source
var (
	ErrNoConnectionToDaemon = errors.New("no_connection_to_daemon")
	// ErrDaemonBusy           = errors.New("daemon_busy")
	// ErrGetHashes            = errors.New("get_hashes_error")
	// ErrGetBlocks            = errors.New("get_blocks_error")
	ErrWalletNotOpen       = errors.New("wallet not open")
	ErrNotFoundTxKey       = errors.New("not found tx key")
	ErrTxNotFound          = errors.New("tx not found")
	ErrNoTransInTx         = errors.New("no trans in tx")
	ErrArgsInvalid         = errors.New("args invalid")
	ErrUTXONotSupportToken = errors.New("utxo not support token")
	ErrUTXODestsOverLimit  = fmt.Errorf("utxo dests over limit, should less than %d", UTXO_DESTS_MAX_NUM)
)

Functions

This section is empty.

Types

type BalanceArgs

type BalanceArgs struct {
	AccountIndex hexutil.Uint64  `json:"index"`
	TokenID      *common.Address `json:"token"`
}

type BalanceResult

type BalanceResult struct {
	Balance *hexutil.Big    `json:"balance"`
	Address string          `json:"address"`
	TokenID *common.Address `json:"token"`
}

type BlockHeightResult

type BlockHeightResult struct {
	LocalHeight  hexutil.Uint64 `json:"local_height"`
	RemoteHeight hexutil.Uint64 `json:"remote_height"`
}

type CallArgs

type CallArgs struct {
	From         common.Address     `json:"from"`
	TokenAddress common.Address     `json:"tokenAddress"`
	To           *common.Address    `json:"to"`
	Gas          hexutil.Uint64     `json:"gas"`
	GasPrice     hexutil.Big        `json:"gasPrice"`
	Value        hexutil.Big        `json:"value"`
	Data         hexutil.Bytes      `json:"data"`
	Nonce        hexutil.Uint64     `json:"nonce"`
	UTXOKind     types.UTXOKind     `json:"utxokind"`
	Outputs      []types.OutputData `json:"outputs"`
}

CallArgs represents the arguments for a call.

type CheckTxKeyArgs

type CheckTxKeyArgs struct {
	TxHash   common.Hash  `json:"hash"`
	TxKey    lkctypes.Key `json:"key"`
	DestAddr string       `json:"dest"`
}

type CheckTxKeyResult

type CheckTxKeyResult struct {
	BlockID hexutil.Uint64 `json:"height"`
	Amount  *hexutil.Big   `json:"amount"`
}

type EthAccount

type EthAccount struct {
	Address common.Address `json:"address"`
	Balance *hexutil.Big   `json:"balance"`
	Nonce   hexutil.Uint64 `json:"nonce"`
}

type GetAccountInfoResult

type GetAccountInfoResult struct {
	EthAccount   EthAccount      `json:"eth_account"`
	UTXOAccounts []UTXOAccount   `json:"utxo_accounts"`
	TotalBalance *hexutil.Big    `json:"total_balance"`
	TokenID      *common.Address `json:"token"`
}

type NetConfig

type NetConfig struct {
	CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX    int
	CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX int
	CRYPTONOTE_PREFIX_LENGTH                   int
	CRYPTONOTE_ADDRESS_LENGTH                  int
	CRYPTONOTE_CHECKSUM_LENGTH                 int
}

func GetConfig

func GetConfig() *NetConfig

type ProofKeyArgs

type ProofKeyArgs struct {
	Hash common.Hash `json:"hash"`
	Addr string      `json:"addr"`
}

type ProofKeyRet

type ProofKeyRet struct {
	ProofKey string `json:"proof_key"`
}

type RPCErr

type RPCErr struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type RPCResponse

type RPCResponse struct {
	ID      string          `json:"id"`
	Jsonrpc string          `json:"jsonrpc"`
	Result  json.RawMessage `json:"result"`
	Error   RPCErr          `json:"error"`
}

type SendTxRet

type SendTxRet struct {
	Raw     string         `json:"raw"`
	Hash    common.Hash    `json:"hash"`
	Gas     hexutil.Uint64 `json:"gas"`
	ErrCode int            `json:"err_code"`
	ErrMsg  string         `json:"err_msg"`
}

type SendUTXOTransactionResult

type SendUTXOTransactionResult struct {
	Txs []SendTxRet `json:"tx"`
}

type SendUTXOTxArgs

type SendUTXOTxArgs struct {
	From     common.Address    `json:"from"`
	Nonce    *hexutil.Uint64   `json:"nonce"`
	SubAddrs []uint64          `json:"subaddrs"`
	Dests    []*types.UTXODest `json:"dests"`
	TokenID  *common.Address   `json:"token"`
}

func (*SendUTXOTxArgs) SetDefaults

func (s *SendUTXOTxArgs) SetDefaults()

type SignUTXORet

type SignUTXORet struct {
	Raw  string         `json:"raw"`
	Hash common.Hash    `json:"hash"`
	Gas  hexutil.Uint64 `json:"gas"`
}

type SignUTXOTransactionResult

type SignUTXOTransactionResult struct {
	Txs []SignUTXORet `json:"txs"`
}

type StatusResult

type StatusResult struct {
	RemoteHeight         hexutil.Uint64 `json:"remote_height"`
	LocalHeight          hexutil.Uint64 `json:"local_height"`
	WalletOpen           bool           `json:"wallet_open"`
	AutoRefresh          bool           `json:"auto_refresh"`
	WalletVersion        string         `json:"wallet_version"`
	ChainVersion         string         `json:"chain_version"`
	EthAddress           common.Address `json:"eth_address"`
	RefreshBlockInterval time.Duration  `json:"refresh_block_interval"`
}

type UTXOAccount

type UTXOAccount struct {
	Address string         `json:"address"`
	Index   hexutil.Uint64 `json:"index"`
	Balance *hexutil.Big   `json:"balance"`
}

type VerifyProofKey

type VerifyProofKey struct {
	Hash   common.Hash  `json:"hash"`
	Addr   string       `json:"addr"`
	Amount *hexutil.Big `json:"amount"`
}

type VerifyProofKeyArgs

type VerifyProofKeyArgs struct {
	Hash common.Hash `json:"hash"`
	Addr string      `json:"addr"`
	Key  string      `json:"key"`
}

type VerifyProofKeyRet

type VerifyProofKeyRet struct {
	Records []*VerifyProofKey `json:"records"`
}

Jump to

Keyboard shortcuts

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