api

package
v0.0.0-...-96daba7 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: GPL-3.0 Imports: 65 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStrToBigInt                    = errors.New("convert to big.Int failed")
	ErrPoWNotSupportedUnderCongestion = errors.New("PoW service")
)
View Source
var (
	// ErrNotSupport = errors.New("not support this method")
	IllegalNodeTime = errors.New("The node time is inaccurate, quite different from the time of latest snapshot block.")

	ErrDecryptKey = JsonRpc2Error{
		Message: walleterrors.ErrDecryptEntropy.Error(),
		Code:    -34001,
	}

	// -35001 ~ -35999 vm execution error
	ErrBalanceNotEnough = JsonRpc2Error{
		Message: util.ErrInsufficientBalance.Error(),
		Code:    -35001,
	}

	ErrQuotaNotEnough = JsonRpc2Error{
		Message: util.ErrOutOfQuota.Error(),
		Code:    -35002,
	}

	ErrVmIdCollision = JsonRpc2Error{
		Message: util.ErrIdCollision.Error(),
		Code:    -35003,
	}
	ErrVmInvaildBlockData = JsonRpc2Error{
		Message: util.ErrInvalidMethodParam.Error(),
		Code:    -35004,
	}
	ErrVmCalPoWTwice = JsonRpc2Error{
		Message: util.ErrCalcPoWTwice.Error(),
		Code:    -35005,
	}

	ErrVmMethodNotFound = JsonRpc2Error{
		Message: util.ErrAbiMethodNotFound.Error(),
		Code:    -35006,
	}

	ErrVmInvalidConfirmTime = JsonRpc2Error{
		Message: util.ErrInvalidConfirmTime.Error(),
		Code:    -35007,
	}

	ErrVmContractNotExists = JsonRpc2Error{
		Message: util.ErrContractNotExists.Error(),
		Code:    -35008,
	}

	ErrVmNoReliableStatus = JsonRpc2Error{
		Message: util.ErrNoReliableStatus.Error(),
		Code:    -35009,
	}

	ErrVmInvalidQuotaRatio = JsonRpc2Error{
		Message: util.ErrInvalidQuotaRatio.Error(),
		Code:    -35010,
	}
	ErrVmPoWNotSupported = JsonRpc2Error{
		Message: ErrPoWNotSupportedUnderCongestion.Error(),
		Code:    -35011,
	}

	// -36001 ~ -36999 verifier_account
	ErrVerifyAccountAddr = JsonRpc2Error{
		Message: verifier.ErrVerifyAccountTypeNotSure.Error(),
		Code:    -36001,
	}
	ErrVerifyHash = JsonRpc2Error{
		Message: verifier.ErrVerifyHashFailed.Error(),
		Code:    -36002,
	}
	ErrVerifySignature = JsonRpc2Error{
		Message: verifier.ErrVerifySignatureFailed.Error(),
		Code:    -36003,
	}
	ErrVerifyNonce = JsonRpc2Error{
		Message: verifier.ErrVerifyNonceFailed.Error(),
		Code:    -36004,
	}
	ErrVerifyPrevBlock = JsonRpc2Error{
		Message: verifier.ErrVerifyPrevBlockFailed.Error(),
		Code:    -36005,
	}
	ErrVerifyRPCBlockIsPending = JsonRpc2Error{
		Message: verifier.ErrVerifyRPCBlockPendingState.Error(),
		Code:    -36006,
	}

	// -37001 ~ -37999 contracts_dex
	ErrComposeOrderIdFail = JsonRpc2Error{
		Message: dex.ComposeOrderIdFailErr.Error(),
		Code:    -37001,
	}
	ErrDexInvalidOrderType = JsonRpc2Error{
		Message: dex.InvalidOrderTypeErr.Error(),
		Code:    -37002,
	}
	ErrDexInvalidOrderPrice = JsonRpc2Error{
		Message: dex.InvalidOrderPriceErr.Error(),
		Code:    -37003,
	}
	ErrDexInvalidOrderQuantity = JsonRpc2Error{
		Message: dex.InvalidOrderQuantityErr.Error(),
		Code:    -37004,
	}
	ErrDexOrderAmountTooSmall = JsonRpc2Error{
		Message: dex.OrderAmountTooSmallErr.Error(),
		Code:    -37005,
	}
	ErrDexTradeMarketExists = JsonRpc2Error{
		Message: dex.TradeMarketExistsErr.Error(),
		Code:    -37006,
	}
	ErrDexTradeMarketNotExists = JsonRpc2Error{
		Message: dex.TradeMarketNotExistsErr.Error(),
		Code:    -37007,
	}
	ErrDexTradeOrderNotExistsErr = JsonRpc2Error{
		Message: dex.OrderNotExistsErr.Error(),
		Code:    -37008,
	}
	ErrDexCancelOrderOwnerInvalid = JsonRpc2Error{
		Message: dex.CancelOrderOwnerInvalidErr.Error(),
		Code:    -37009,
	}
	ErrDexCancelOrderInvalidStatus = JsonRpc2Error{
		Message: dex.CancelOrderInvalidStatusErr.Error(),
		Code:    -37010,
	}
	ErrDexTradeMarketInvalidQuoteToken = JsonRpc2Error{
		Message: dex.TradeMarketInvalidQuoteTokenErr.Error(),
		Code:    -37011,
	}
	ErrDexTradeMarketInvalidTokenPair = JsonRpc2Error{
		Message: dex.TradeMarketInvalidTokenPairErr.Error(),
		Code:    -37012,
	}
)
View Source
var (
	NodeStatusActive   uint8 = 1
	NodeStatusInActive uint8 = 2
)
View Source
var MaxBatchQuery = 10

Functions

func CheckGetTestTokenIpFrequency

func CheckGetTestTokenIpFrequency(cache *lru.Cache, ctx context.Context) error

func Float64ToString

func Float64ToString(f float64, prec int) string

func InitConfig

func InitConfig(id uint, dexAvailable *bool)

func InitGetTestTokenLimitPolicy

func InitGetTestTokenLimitPolicy()

func InitLog

func InitLog(dir, lvl string)

func InitTestAPIParams

func InitTestAPIParams(priv, tti string)

func StringToFloat64

func StringToFloat64(s string) (float64, error)

func StringToUint64

func StringToUint64(s string) (uint64, error)

func TryMakeConcernedError

func TryMakeConcernedError(err error) (newerr error, concerned bool)

func Uint64ToString

func Uint64ToString(u uint64) string

Types

type AccountBlock

type AccountBlock struct {
	BlockType byte       `json:"blockType"`
	Height    string     `json:"height"`
	Hash      types.Hash `json:"hash"`
	PrevHash  types.Hash `json:"prevHash"`

	AccountAddress types.Address `json:"accountAddress"`
	PublicKey      []byte        `json:"publicKey"`

	Producer types.Address `json:"producer"`

	FromAddress   types.Address     `json:"fromAddress"`
	ToAddress     types.Address     `json:"toAddress"`
	FromBlockHash types.Hash        `json:"fromBlockHash"`
	TokenId       types.TokenTypeId `json:"tokenId"`
	Amount        *string           `json:"amount"`
	Fee           *string           `json:"fee"`

	Data []byte `json:"data"`

	Difficulty *string `json:"difficulty"`
	Nonce      []byte  `json:"nonce"`

	Signature []byte `json:"signature"`

	Quota         *string         `json:"quota"`
	QuotaUsed     *string         `json:"quotaUsed"`
	LogHash       *types.Hash     `json:"logHash"`
	SendBlockList []*AccountBlock `json:"sendBlockList"`

	// extra info below
	TokenInfo *RpcTokenInfo `json:"tokenInfo"`

	ConfirmedTimes *string     `json:"confirmedTimes"`
	ConfirmedHash  *types.Hash `json:"confirmedHash"`

	ReceiveBlockHeight *string     `json:"receiveBlockHeight"`
	ReceiveBlockHash   *types.Hash `json:"receiveBlockHash"`

	Timestamp int64 `json:"timestamp"`
}

func (*AccountBlock) ComputeHash

func (block *AccountBlock) ComputeHash() (*types.Hash, error)

func (*AccountBlock) RpcToLedgerBlock

func (block *AccountBlock) RpcToLedgerBlock() (*ledger.AccountBlock, error)

type AccountFundInfo

type AccountFundInfo struct {
	TokenInfo *RpcTokenInfo `json:"tokenInfo,omitempty"`
	Available string        `json:"available"`
	Locked    string        `json:"locked"`
}

type AccountInfo

type AccountInfo struct {
	Addr       types.Address `json:"address"`
	PrivateKey string        `json:"privateKey"`
}

type AgentPledgeParam

type AgentPledgeParam struct {
	PledgeAddr     types.Address `json:"pledgeAddr"`
	BeneficialAddr types.Address `json:"beneficialAddr"`
	Bid            uint8         `json:"bid"`
	StakeHeight    string        `json:"stakeHeight"`
	Amount         string        `json:"amount"`
}

type CalcPoWDifficultyParam

type CalcPoWDifficultyParam struct {
	SelfAddr types.Address `json:"selfAddr"`
	PrevHash types.Hash    `json:"prevHash"`

	BlockType byte           `json:"blockType"`
	ToAddr    *types.Address `json:"toAddr"`
	Data      []byte         `json:"data"`

	UsePledgeQuota bool `json:"usePledgeQuota"`

	Multiple uint16 `json:"multipleOnCongestion"`
}

type CalcPoWDifficultyResult

type CalcPoWDifficultyResult struct {
	QuotaRequired uint64  `json:"quota"`
	Difficulty    string  `json:"difficulty"`
	Qc            *string `json:"qc"`
	IsCongestion  bool    `json:"isCongestion"`
}

type CallContractParam

type CallContractParam struct {
	ContractAddr types.Address  `json:"contractAddr"`
	AccountAddr  *types.Address `json:"accountAddr"`
	Amount       string         `json:"amount"`
	MethodName   string         `json:"methodName"`
	Params       []string       `json:"params"`
}

type CallContractResult

type CallContractResult struct {
	ContractAddr      types.Address `json:"contractAddr"`
	AccountAddr       types.Address `json:"accountAddr"`
	AccountPrivateKey string        `json:"accountPrivateKey"`
	SendBlockHash     types.Hash    `json:"sendBlockHash"`
}

type CallOffChainMethodParam

type CallOffChainMethodParam struct {
	SelfAddr          types.Address `json:"selfAddr"`
	OffChainCode      string        `json:"offchainCode"`
	OffChainCodeBytes []byte        `json:"offchainCodeBytes"`
	Data              []byte        `json:"data"`
}

type CandidateInfo

type CandidateInfo struct {
	Name     string        `json:"name"`
	NodeAddr types.Address `json:"nodeAddr"`
	VoteNum  string        `json:"voteNum"`
}

type ConsensusGroup

type ConsensusGroup struct {
	Gid                    types.Gid               `json:"gid"`
	NodeCount              uint8                   `json:"nodeCount"`
	Interval               int64                   `json:"interval"`
	PerCount               int64                   `json:"perCount"`
	RandCount              uint8                   `json:"randCount"`
	RandRank               uint8                   `json:"randRank"`
	Repeat                 uint16                  `json:"repeat"`
	CheckLevel             uint8                   `json:"checkLevel"`
	CountingTokenId        types.TokenTypeId       `json:"countingTokenId"`
	RegisterConditionId    uint8                   `json:"registerConditionId"`
	RegisterConditionParam *RegisterConditionParam `json:"registerConditionParam"`
	VoteConditionId        uint8                   `json:"voteConditionId"`
	VoteConditionParam     *VoteConditionParam     `json:"voerConditionParam"`
	Owner                  types.Address           `json:"owner"`
	PledgeAmount           string                  `json:"pledgeAmount"`
	WithdrawHeight         string                  `json:"withdrawHeight"`
}

type ConsensusGroupApi

type ConsensusGroupApi struct {
	// contains filtered or unexported fields
}

func NewConsensusGroupApi

func NewConsensusGroupApi(vite *vite.Vite) *ConsensusGroupApi

func (*ConsensusGroupApi) GetCancelConsensusGroupData

func (c *ConsensusGroupApi) GetCancelConsensusGroupData(gid types.Gid) ([]byte, error)

func (*ConsensusGroupApi) GetConditionRegisterOfPledge

func (c *ConsensusGroupApi) GetConditionRegisterOfPledge(amount *big.Int, tokenId types.TokenTypeId, height uint64) ([]byte, error)

func (*ConsensusGroupApi) GetConditionVoteOfDefault

func (c *ConsensusGroupApi) GetConditionVoteOfDefault() ([]byte, error)

func (*ConsensusGroupApi) GetConditionVoteOfKeepToken

func (c *ConsensusGroupApi) GetConditionVoteOfKeepToken(amount *big.Int, tokenId types.TokenTypeId) ([]byte, error)

func (*ConsensusGroupApi) GetConsensusGroupById

func (c *ConsensusGroupApi) GetConsensusGroupById(gid types.Gid) (*ConsensusGroup, error)

func (*ConsensusGroupApi) GetConsensusGroupList

func (c *ConsensusGroupApi) GetConsensusGroupList() ([]*ConsensusGroup, error)

func (*ConsensusGroupApi) GetCreateConsensusGroupData

func (c *ConsensusGroupApi) GetCreateConsensusGroupData(param CreateConsensusGroupParam) ([]byte, error)

func (*ConsensusGroupApi) GetReCreateConsensusGroupData

func (c *ConsensusGroupApi) GetReCreateConsensusGroupData(gid types.Gid) ([]byte, error)

func (ConsensusGroupApi) String

func (c ConsensusGroupApi) String() string

type ConstructorParam

type ConstructorParam struct {
	Amount string   `json:"amount"`
	Params []string `json:"params"`
}

type ContractApi

type ContractApi struct {
	// contains filtered or unexported fields
}

func NewContractApi

func NewContractApi(vite *vite.Vite) *ContractApi

func (*ContractApi) CallOffChainMethod

func (c *ContractApi) CallOffChainMethod(param CallOffChainMethodParam) ([]byte, error)

func (*ContractApi) GetCallContractData

func (c *ContractApi) GetCallContractData(abiStr string, methodName string, params []string) ([]byte, error)

func (*ContractApi) GetCallOffChainData

func (c *ContractApi) GetCallOffChainData(abiStr string, offChainName string, params []string) ([]byte, error)

func (*ContractApi) GetContractInfo

func (c *ContractApi) GetContractInfo(addr types.Address) (*ContractInfo, error)

func (*ContractApi) GetContractStorage

func (c *ContractApi) GetContractStorage(addr types.Address, prefix string) (map[string]string, error)

func (*ContractApi) GetCreateContractData

func (c *ContractApi) GetCreateContractData(param CreateContractDataParam) ([]byte, error)

func (*ContractApi) GetCreateContractParams

func (c *ContractApi) GetCreateContractParams(abiStr string, params []string) ([]byte, error)

func (*ContractApi) GetCreateContractToAddress

func (c *ContractApi) GetCreateContractToAddress(selfAddr types.Address, heightStr string, prevHash types.Hash) (*types.Address, error)

func (ContractApi) String

func (c ContractApi) String() string

type ContractInfo

type ContractInfo struct {
	Code        []byte    `json:"code"`
	Gid         types.Gid `json:"gid"`
	ConfirmTime uint8     `json:"confirmTime"`
	SeedCount   uint8     `json:"seedCount"`
	QuotaRatio  uint8     `json:"quotaRatio"`
}

type CreateConsensusGroupParam

type CreateConsensusGroupParam struct {
	SelfAddr               types.Address
	Height                 uint64
	PrevHash               types.Hash
	SnapshotHash           types.Hash
	NodeCount              uint8
	Interval               int64
	PerCount               int64
	RandCount              uint8
	RandRank               uint8
	Repeat                 uint16
	CheckLevel             uint8
	CountingTokenId        types.TokenTypeId
	RegisterConditionId    uint8
	RegisterConditionParam []byte
	VoteConditionId        uint8
	VoteConditionParam     []byte
}

type CreateContractDataParam

type CreateContractDataParam struct {
	Gid         types.Gid `json:"gid"`
	ConfirmTime uint8     `json:"confirmTime"`
	SeedCount   uint8     `json:"seedCount"`
	QuotaRatio  uint8     `json:"quotaRatio"`
	HexCode     string    `json:"hexCode"`
	Params      []byte    `json:"params"`
}

type CreateContractParam

type CreateContractParam struct {
	FileName    string                      `json:"fileName"`
	Params      map[string]ConstructorParam `json:"params"`
	AccountAddr *types.Address              `json:"accountAddr"`
}

type CreateContractResult

type CreateContractResult struct {
	AccountAddr       types.Address       `json:"accountAddr"`
	AccountPrivateKey string              `json:"accountPrivateKey"`
	ContractAddr      types.Address       `json:"contractAddr"`
	SendBlockHash     types.Hash          `json:"sendBlockHash"`
	MethodList        []CallContractParam `json:"methodList"`
}

type CreateReceiveTxParms

type CreateReceiveTxParms struct {
	SelfAddr   types.Address
	FromHash   types.Hash
	PrivKeyStr string
	Difficulty *big.Int
}

type CreateTransferTxParms

type CreateTransferTxParms struct {
	EntropystoreFile *string           `json:"entropystoreFile,omitempty"`
	SelfAddr         types.Address     `json:"selfAddr"`
	ToAddr           types.Address     `json:"toAddr"`
	TokenTypeId      types.TokenTypeId `json:"tokenTypeId"`
	Passphrase       string            `json:"passphrase"`
	Amount           string            `json:"amount"`
	Data             []byte            `json:"data,omitempty"`
	Difficulty       *string           `json:"difficulty,omitempty"`
}

type CreateTxWithPrivKeyParmsTest

type CreateTxWithPrivKeyParmsTest struct {
	SelfAddr    types.Address
	ToAddr      types.Address
	TokenTypeId types.TokenTypeId
	PrivateKey  string
	Amount      string
	Data        []byte
	Difficulty  *big.Int
}

type DashboardApi

type DashboardApi struct {
	// contains filtered or unexported fields
}

func NewDashboardApi

func NewDashboardApi(v *vite.Vite) *DashboardApi

func (DashboardApi) NetId

func (api DashboardApi) NetId() uint

func (DashboardApi) OsInfo

func (api DashboardApi) OsInfo(id *string) map[string]interface{}

func (DashboardApi) ProcessInfo

func (api DashboardApi) ProcessInfo(id *string) map[string]interface{}

func (DashboardApi) RuntimeInfo

func (api DashboardApi) RuntimeInfo(id *string) map[string]interface{}

type DebugApi

type DebugApi struct {
	// contains filtered or unexported fields
}

func NewDebugApi

func NewDebugApi(v *vite.Vite) *DebugApi

func (DebugApi) ClearOnRoadUnconfirmedCache

func (api DebugApi) ClearOnRoadUnconfirmedCache(addr types.Address, hashList []*types.Hash) error

func (DebugApi) ConsensusBlockRate

func (api DebugApi) ConsensusBlockRate(gid types.Gid, startIndex, endIndex uint64) map[string]interface{}

func (DebugApi) ConsensusProducers

func (api DebugApi) ConsensusProducers(gid types.Gid, offset int64, index uint64) map[string]interface{}

func (DebugApi) Free

func (api DebugApi) Free()

func (DebugApi) GetForkInfo

func (api DebugApi) GetForkInfo() config.ForkPoints

func (DebugApi) GetOnRoadInfoUnconfirmed

func (api DebugApi) GetOnRoadInfoUnconfirmed(addr types.Address) ([]*types.Hash, error)

func (DebugApi) MachineInfo

func (api DebugApi) MachineInfo() map[string]interface{}

func (DebugApi) PoolAccount

func (api DebugApi) PoolAccount(addr types.Address) map[string]interface{}

func (DebugApi) PoolAccountBlockDetail

func (api DebugApi) PoolAccountBlockDetail(addr types.Address, hash types.Hash) map[string]interface{}

func (DebugApi) PoolAccountChainDetail

func (api DebugApi) PoolAccountChainDetail(addr types.Address, chainId string, height uint64) map[string]interface{}

func (DebugApi) PoolInfo

func (api DebugApi) PoolInfo() map[string]interface{}

func (DebugApi) PoolIrreversible

func (api DebugApi) PoolIrreversible() string

func (DebugApi) PoolSnapshot

func (api DebugApi) PoolSnapshot() map[string]interface{}

func (DebugApi) PoolSnapshotBlockDetail

func (api DebugApi) PoolSnapshotBlockDetail(hash types.Hash) map[string]interface{}

func (DebugApi) PoolSnapshotChainDetail

func (api DebugApi) PoolSnapshotChainDetail(chainId string, height uint64) map[string]interface{}

func (DebugApi) RoadInfo

func (api DebugApi) RoadInfo() map[string]interface{}

func (DebugApi) SetGetTestTokenLimitSize

func (api DebugApi) SetGetTestTokenLimitSize(size int) error

func (DebugApi) UpdateOnRoadInfo

func (api DebugApi) UpdateOnRoadInfo(addr types.Address, tkId types.TokenTypeId, number uint64, amountStr *string) error

type DeriveResult

type DeriveResult struct {
	Bip44Path  string        `json:"bip44Path"`
	Address    types.Address `json:"address"`
	PrivateKey []byte        `json:"privateKey"`
}

type DexFundApi

type DexFundApi struct {
	// contains filtered or unexported fields
}

func NewDexFundApi

func NewDexFundApi(vite *vite.Vite) *DexFundApi

func (DexFundApi) GetAccountFundInfo

func (f DexFundApi) GetAccountFundInfo(addr types.Address, tokenId *types.TokenTypeId) (map[types.TokenTypeId]*AccountFundInfo, error)

func (DexFundApi) GetAccountFundInfoByStatus

func (f DexFundApi) GetAccountFundInfoByStatus(addr types.Address, tokenId *types.TokenTypeId, status byte) (map[types.TokenTypeId]string, error)

func (DexFundApi) GetBrokerFeeSumByPeriod

func (f DexFundApi) GetBrokerFeeSumByPeriod(periodId uint64, broker types.Address) (*apidex.RpcBrokerFeeSumByPeriod, error)

func (DexFundApi) GetCurrentBrokerFeeSum

func (f DexFundApi) GetCurrentBrokerFeeSum(broker types.Address) (*apidex.RpcBrokerFeeSumByPeriod, error)

func (DexFundApi) GetCurrentDividendPools

func (f DexFundApi) GetCurrentDividendPools() (map[types.TokenTypeId]*apidex.DividendPoolInfo, error)

func (DexFundApi) GetCurrentFeeSum

func (f DexFundApi) GetCurrentFeeSum() (*apidex.RpcFeeSumByPeriod, error)

func (DexFundApi) GetFeeSumByPeriod

func (f DexFundApi) GetFeeSumByPeriod(periodId uint64) (*apidex.RpcFeeSumByPeriod, error)

func (DexFundApi) GetFundConfig

func (f DexFundApi) GetFundConfig() (map[string]string, error)

func (DexFundApi) GetInviteeCode

func (f DexFundApi) GetInviteeCode(address types.Address) (uint32, error)

func (DexFundApi) GetInviterCode

func (f DexFundApi) GetInviterCode(address types.Address) (uint32, error)

func (DexFundApi) GetMakerProxyAmount

func (f DexFundApi) GetMakerProxyAmount(periodId uint64) (string, error)

func (DexFundApi) GetMarketInfo

func (f DexFundApi) GetMarketInfo(tradeToken, quoteToken types.TokenTypeId) (*apidex.RpcMarketInfo, error)

func (DexFundApi) GetOwner

func (f DexFundApi) GetOwner() (*types.Address, error)

func (DexFundApi) GetPeriodId

func (f DexFundApi) GetPeriodId() (uint64, error)

func (DexFundApi) GetPeriodJobLastPeriodId

func (f DexFundApi) GetPeriodJobLastPeriodId(bizType uint8) (uint64, error)

func (DexFundApi) GetPledgeForVX

func (f DexFundApi) GetPledgeForVX(address types.Address) (string, error)

func (DexFundApi) GetPledgeForVip

func (f DexFundApi) GetPledgeForVip(address types.Address) (*dex.PledgeVip, error)

func (DexFundApi) GetPledgesForVx

func (f DexFundApi) GetPledgesForVx(address types.Address) (*apidex.RpcPledgesForVx, error)

func (DexFundApi) GetPledgesForVxSum

func (f DexFundApi) GetPledgesForVxSum() (*apidex.RpcPledgesForVx, error)

func (DexFundApi) GetThresholdForTradeAndMine

func (f DexFundApi) GetThresholdForTradeAndMine() (map[int]*apidex.RpcThresholdForTradeAndMine, error)

func (DexFundApi) GetTime

func (f DexFundApi) GetTime() (int64, error)

func (DexFundApi) GetTokenInfo

func (f DexFundApi) GetTokenInfo(token types.TokenTypeId) (*apidex.RpcDexTokenInfo, error)

func (DexFundApi) GetUserFees

func (f DexFundApi) GetUserFees(address types.Address) (*apidex.RpcUserFees, error)

func (DexFundApi) GetVxFunds

func (f DexFundApi) GetVxFunds(address types.Address) (*apidex.RpcVxFunds, error)

func (DexFundApi) GetVxMinePool

func (f DexFundApi) GetVxMinePool() (string, error)

func (DexFundApi) GetVxSumFunds

func (f DexFundApi) GetVxSumFunds() (*apidex.RpcVxFunds, error)

func (DexFundApi) IsPledgeVip

func (f DexFundApi) IsPledgeVip(address types.Address) (bool, error)

func (DexFundApi) IsViteXStopped

func (f DexFundApi) IsViteXStopped() (bool, error)

func (DexFundApi) String

func (f DexFundApi) String() string

func (DexFundApi) VerifyFundBalance

func (f DexFundApi) VerifyFundBalance() (*dex.FundVerifyRes, error)

type DexTradeApi

type DexTradeApi struct {
	// contains filtered or unexported fields
}

func NewDexTradeApi

func NewDexTradeApi(vite *vite.Vite) *DexTradeApi

func (DexTradeApi) GetMarketInfoById

func (f DexTradeApi) GetMarketInfoById(marketId int32) (ordersRes *apidex.RpcMarketInfo, err error)

func (DexTradeApi) GetOrderById

func (f DexTradeApi) GetOrderById(orderIdStr string) (*RpcOrder, error)

func (DexTradeApi) GetOrdersFromMarket

func (f DexTradeApi) GetOrdersFromMarket(tradeToken, quoteToken types.TokenTypeId, side bool, begin, end int) (ordersRes *OrdersRes, err error)

func (DexTradeApi) String

func (f DexTradeApi) String() string

type FindAddrResult

type FindAddrResult struct {
	EntropyStoreFile string `json:"entropyStoreFile"`
	Index            uint32 `json:"index"`
}

type GcStatus

type GcStatus struct {
	Code        uint8  `json:"code"`
	Description string `json:"description"`

	ClearedHeight uint64 `json:"clearedHeight"`
	MarkedHeight  uint64 `json:"markedHeight"`
}

type HexSignedTuple

type HexSignedTuple struct {
	Message    string `json:"message"`
	SignedData string `json:"signedData"`
	Pubkey     string `json:"pubkey"`
}

type IsMayValidKeystoreFileResponse

type IsMayValidKeystoreFileResponse struct {
	Maybe      bool
	MayAddress types.Address
}

type IssueParams

type IssueParams struct {
	TokenId    types.TokenTypeId
	Amount     string
	Beneficial types.Address
}

type JsonRpc2Error

type JsonRpc2Error struct {
	Message string
	Code    int
}

func (JsonRpc2Error) Error

func (e JsonRpc2Error) Error() string

func (JsonRpc2Error) ErrorCode

func (e JsonRpc2Error) ErrorCode() int

type LedgerApi

type LedgerApi struct {
	// contains filtered or unexported fields
}

func NewLedgerApi

func NewLedgerApi(vite *vite.Vite) *LedgerApi

func (*LedgerApi) GetAccountByAccAddr

func (l *LedgerApi) GetAccountByAccAddr(addr types.Address) (*RpcAccountInfo, error)

func (*LedgerApi) GetAllUnconfirmedBlocks

func (l *LedgerApi) GetAllUnconfirmedBlocks() []*ledger.AccountBlock

func (*LedgerApi) GetBlockByHash

func (l *LedgerApi) GetBlockByHash(blockHash types.Hash) (*AccountBlock, error)

func (*LedgerApi) GetBlockByHeight

func (l *LedgerApi) GetBlockByHeight(addr types.Address, height interface{}) (*AccountBlock, error)

func (*LedgerApi) GetBlocksByAccAddr

func (l *LedgerApi) GetBlocksByAccAddr(addr types.Address, index int, count int) ([]*AccountBlock, error)

func (*LedgerApi) GetBlocksByHash

func (l *LedgerApi) GetBlocksByHash(addr types.Address, originBlockHash *types.Hash, count uint64) ([]*AccountBlock, error)

func (*LedgerApi) GetBlocksByHashInToken

func (l *LedgerApi) GetBlocksByHashInToken(addr types.Address, originBlockHash *types.Hash, tokenTypeId types.TokenTypeId, count uint64) ([]*AccountBlock, error)

in token

func (*LedgerApi) GetBlocksByHeight

func (l *LedgerApi) GetBlocksByHeight(addr types.Address, height interface{}, count uint64) ([]*AccountBlock, error)

func (*LedgerApi) GetChainStatus

func (l *LedgerApi) GetChainStatus() []interfaces.DBStatus

func (*LedgerApi) GetChunks

func (l *LedgerApi) GetChunks(startHeight interface{}, endHeight interface{}) ([]*SnapshotChunk, error)

func (*LedgerApi) GetCompleteBlockByHash

func (l *LedgerApi) GetCompleteBlockByHash(blockHash types.Hash) (*AccountBlock, error)

func (*LedgerApi) GetLatestBlock

func (l *LedgerApi) GetLatestBlock(addr types.Address) (*AccountBlock, error)

func (*LedgerApi) GetLatestSnapshotChainHash

func (l *LedgerApi) GetLatestSnapshotChainHash() *types.Hash

func (*LedgerApi) GetRawBlockByHash

func (l *LedgerApi) GetRawBlockByHash(blockHash types.Hash) (*ledger.AccountBlock, error)

func (*LedgerApi) GetSeed

func (l *LedgerApi) GetSeed(snapshotHash types.Hash, fromHash types.Hash) (uint64, error)

func (*LedgerApi) GetSnapshotBlockByHash

func (l *LedgerApi) GetSnapshotBlockByHash(hash types.Hash) (*SnapshotBlock, error)

func (*LedgerApi) GetSnapshotBlockByHeight

func (l *LedgerApi) GetSnapshotBlockByHeight(height interface{}) (*SnapshotBlock, error)

func (*LedgerApi) GetSnapshotBlocks

func (l *LedgerApi) GetSnapshotBlocks(height interface{}, count int) ([]*SnapshotBlock, error)

func (*LedgerApi) GetSnapshotChainHeight

func (l *LedgerApi) GetSnapshotChainHeight() string

func (*LedgerApi) GetUnconfirmedBlocks

func (l *LedgerApi) GetUnconfirmedBlocks(addr types.Address) []*ledger.AccountBlock

func (*LedgerApi) GetVmLogList

func (l *LedgerApi) GetVmLogList(blockHash types.Hash) (ledger.VmLogList, error)

func (*LedgerApi) GetVmLogListByHash

func (l *LedgerApi) GetVmLogListByHash(logHash types.Hash) (ledger.VmLogList, error)

func (LedgerApi) String

func (l LedgerApi) String() string

type MintageApi

type MintageApi struct {
	// contains filtered or unexported fields
}

func NewMintageApi

func NewMintageApi(vite *vite.Vite) *MintageApi

func (*MintageApi) GetBurnData

func (m *MintageApi) GetBurnData() ([]byte, error)

func (*MintageApi) GetChangeTokenTypeData

func (m *MintageApi) GetChangeTokenTypeData(tokenId types.TokenTypeId) ([]byte, error)

func (*MintageApi) GetIssueData

func (m *MintageApi) GetIssueData(param IssueParams) ([]byte, error)

func (*MintageApi) GetMintData

func (m *MintageApi) GetMintData(param MintageParams) ([]byte, error)

func (*MintageApi) GetTokenInfoById

func (m *MintageApi) GetTokenInfoById(tokenId types.TokenTypeId) (*RpcTokenInfo, error)

func (*MintageApi) GetTokenInfoList

func (m *MintageApi) GetTokenInfoList(index int, count int) (*TokenInfoList, error)

func (*MintageApi) GetTokenInfoListByOwner

func (m *MintageApi) GetTokenInfoListByOwner(owner types.Address) ([]*RpcTokenInfo, error)

func (*MintageApi) GetTransferOwnerData

func (m *MintageApi) GetTransferOwnerData(param TransferOwnerParams) ([]byte, error)

func (MintageApi) String

func (m MintageApi) String() string

type MintageParams

type MintageParams struct {
	TokenName     string
	TokenSymbol   string
	TotalSupply   string
	Decimals      uint8
	IsReIssuable  bool
	MaxSupply     string
	OwnerBurnOnly bool
}

type NetApi

type NetApi struct {
	// contains filtered or unexported fields
}

func NewNetApi

func NewNetApi(vite *vite.Vite) *NetApi

func (*NetApi) NetInfo

func (n *NetApi) NetInfo() net.NodeInfo

func (*NetApi) Nodes

func (n *NetApi) Nodes() Nodes

func (*NetApi) Peers

func (n *NetApi) Peers() net.NodeInfo

Peers is for old api

func (*NetApi) SyncDetail

func (n *NetApi) SyncDetail() net.SyncDetail

func (*NetApi) SyncInfo

func (n *NetApi) SyncInfo() SyncInfo

type NewStoreResponse

type NewStoreResponse struct {
	Mnemonic    string        `json:"mnemonic"`
	PrimaryAddr types.Address `json:"primaryAddr"`
	Filename    string        `json:"filename"`
}

type Nodes

type Nodes struct {
	Count int
	Nodes []*vnode.Node
}

type NormalRequestRawTxParam

type NormalRequestRawTxParam struct {
	BlockType byte       `json:"blockType"` // 1
	Height    string     `json:"height"`
	Hash      types.Hash `json:"hash"`
	PrevHash  types.Hash `json:"prevHash"`

	AccountAddress types.Address `json:"accountAddress"`
	PublicKey      []byte        `json:"publicKey"`

	ToAddress types.Address     `json:"toAddress"`
	TokenId   types.TokenTypeId `json:"tokenId"`
	Amount    string            `json:"amount"`

	Data []byte `json:"data"`

	Difficulty *string `json:"difficulty"`
	Nonce      []byte  `json:"nonce"`

	Signature []byte `json:"signature"`
}

func (NormalRequestRawTxParam) LedgerAccountBlock

func (param NormalRequestRawTxParam) LedgerAccountBlock() (*ledger.AccountBlock, error)

type OnroadPagingQuery

type OnroadPagingQuery struct {
	Addr types.Address `json:"addr"`

	PageNum   uint64 `json:"pageNum"`
	PageCount uint64 `json:"pageCount"`
}

type OrdersRes

type OrdersRes struct {
	Orders []*RpcOrder `json:"orders,omitempty"`
	Size   int         `json:"size"`
}

type PeriodStats

type PeriodStats struct {
	*core.PeriodStats
	// contains filtered or unexported fields
}

type PledgeApi

type PledgeApi struct {
	// contains filtered or unexported fields
}

func NewPledgeApi

func NewPledgeApi(vite *vite.Vite) *PledgeApi

func (*PledgeApi) GetAgentCancelPledgeData

func (p *PledgeApi) GetAgentCancelPledgeData(param AgentPledgeParam) ([]byte, error)

func (*PledgeApi) GetAgentPledgeData

func (p *PledgeApi) GetAgentPledgeData(param AgentPledgeParam) ([]byte, error)

func (*PledgeApi) GetAgentPledgeInfo

func (p *PledgeApi) GetAgentPledgeInfo(params PledgeQueryParams) (*PledgeInfo, error)

func (*PledgeApi) GetCancelPledgeData

func (p *PledgeApi) GetCancelPledgeData(beneficialAddr types.Address, amount string) ([]byte, error)

func (*PledgeApi) GetPledgeAmountByUtps

func (p *PledgeApi) GetPledgeAmountByUtps(utps string) (*string, error)

func (*PledgeApi) GetPledgeBeneficialAmount

func (p *PledgeApi) GetPledgeBeneficialAmount(addr types.Address) (string, error)

func (*PledgeApi) GetPledgeData

func (p *PledgeApi) GetPledgeData(beneficialAddr types.Address) ([]byte, error)

func (*PledgeApi) GetPledgeList

func (p *PledgeApi) GetPledgeList(addr types.Address, index int, count int) (*PledgeInfoList, error)

func (*PledgeApi) GetPledgeQuota

func (p *PledgeApi) GetPledgeQuota(addr types.Address) (*QuotaAndTxNum, error)

func (*PledgeApi) GetQuotaCoefficient

func (p *PledgeApi) GetQuotaCoefficient() (*QuotaCoefficientInfo, error)

func (*PledgeApi) GetQuotaUsedList

func (p *PledgeApi) GetQuotaUsedList(addr types.Address) ([]types.QuotaInfo, error)

func (PledgeApi) String

func (p PledgeApi) String() string

type PledgeInfo

type PledgeInfo struct {
	Amount         string        `json:"amount"`
	WithdrawHeight string        `json:"withdrawHeight"`
	BeneficialAddr types.Address `json:"beneficialAddr"`
	WithdrawTime   int64         `json:"withdrawTime"`
	Agent          bool          `json:"agent"`
	AgentAddress   types.Address `json:"agentAddress"`
	Bid            uint8         `json:"bid"`
}

func NewPledgeInfo

func NewPledgeInfo(info *abi.PledgeInfo, snapshotBlock *ledger.SnapshotBlock) *PledgeInfo

type PledgeInfoList

type PledgeInfoList struct {
	TotalPledgeAmount string        `json:"totalPledgeAmount"`
	Count             int           `json:"totalCount"`
	List              []*PledgeInfo `json:"pledgeInfoList"`
}

type PledgeQueryParams

type PledgeQueryParams struct {
	PledgeAddr     types.Address `json:"pledgeAddr"`
	AgentAddr      types.Address `json:"agentAddr"`
	BeneficialAddr types.Address `json:"beneficialAddr"`
	Bid            uint8         `json:"bid"`
}

type Pow

type Pow struct {
	// contains filtered or unexported fields
}

func NewPow

func NewPow(vite *vite.Vite) *Pow

func (Pow) CancelPow

func (p Pow) CancelPow(data types.Hash) error

func (Pow) GetPowNonce

func (p Pow) GetPowNonce(difficulty string, data types.Hash) ([]byte, error)

type PrivateOnroadApi

type PrivateOnroadApi struct {
	// contains filtered or unexported fields
}

func NewPrivateOnroadApi

func NewPrivateOnroadApi(vite *vite.Vite) *PrivateOnroadApi

func (PrivateOnroadApi) GetContractAddrListByGid

func (pri PrivateOnroadApi) GetContractAddrListByGid(gid types.Gid) ([]types.Address, error)

func (PrivateOnroadApi) GetContractOnRoadFrontBlocks

func (pri PrivateOnroadApi) GetContractOnRoadFrontBlocks(addr types.Address, gid *types.Gid) ([]*AccountBlock, error)

func (PrivateOnroadApi) GetContractOnRoadTotalNum

func (pri PrivateOnroadApi) GetContractOnRoadTotalNum(addr types.Address, gid *types.Gid) (uint64, error)

func (PrivateOnroadApi) GetOnroadBlocksByAddress

func (pri PrivateOnroadApi) GetOnroadBlocksByAddress(address types.Address, index, count uint64) ([]*AccountBlock, error)

func (PrivateOnroadApi) GetOnroadBlocksInBatch

func (pri PrivateOnroadApi) GetOnroadBlocksInBatch(queryList []OnroadPagingQuery) (map[types.Address][]*AccountBlock, error)

func (PrivateOnroadApi) GetOnroadInfoByAddress

func (pri PrivateOnroadApi) GetOnroadInfoByAddress(address types.Address) (*RpcAccountInfo, error)

func (PrivateOnroadApi) GetOnroadInfoInBatch

func (pri PrivateOnroadApi) GetOnroadInfoInBatch(addrList []types.Address) ([]*RpcAccountInfo, error)

func (PrivateOnroadApi) String

func (pri PrivateOnroadApi) String() string

type PublicOnroadApi

type PublicOnroadApi struct {
	// contains filtered or unexported fields
}

func NewPublicOnroadApi

func NewPublicOnroadApi(vite *vite.Vite) *PublicOnroadApi

func (PublicOnroadApi) GetOnroadBlocksByAddress

func (pub PublicOnroadApi) GetOnroadBlocksByAddress(address types.Address, index, count uint64) ([]*AccountBlock, error)

func (PublicOnroadApi) GetOnroadInfoByAddress

func (pub PublicOnroadApi) GetOnroadInfoByAddress(address types.Address) (*RpcAccountInfo, error)

func (PublicOnroadApi) String

func (pub PublicOnroadApi) String() string

type QuotaAndTxNum

type QuotaAndTxNum struct {
	QuotaPerSnapshotBlock string `json:"quotaPerSnapshotBlock"`
	CurrentQuota          string `json:"current"`
	CurrentTxNumPerSec    string `json:"utps"`
}

type QuotaCoefficientInfo

type QuotaCoefficientInfo struct {
	Qc           *string `json:"qc"`
	GlobalQuota  string  `json:"globalQuota"`
	IsCongestion bool    `json:"isCongestion"`
}

type RegistParam

type RegistParam struct {
	Name string     `json:"name"`
	Gid  *types.Gid `json:"gid"`
}

type RegisterApi

type RegisterApi struct {
	// contains filtered or unexported fields
}

func NewRegisterApi

func NewRegisterApi(vite *vite.Vite) *RegisterApi

func (*RegisterApi) GetAvailableReward

func (r *RegisterApi) GetAvailableReward(gid types.Gid, name string) (*Reward, error)

func (*RegisterApi) GetCancelRegisterData

func (r *RegisterApi) GetCancelRegisterData(gid types.Gid, name string) ([]byte, error)

func (*RegisterApi) GetCandidateList

func (r *RegisterApi) GetCandidateList() ([]*CandidateInfo, error)

func (*RegisterApi) GetRegisterData

func (r *RegisterApi) GetRegisterData(gid types.Gid, name string, nodeAddr types.Address) ([]byte, error)

func (*RegisterApi) GetRegisterPledgeAddrList

func (r *RegisterApi) GetRegisterPledgeAddrList(paramList []*RegistParam) ([]*types.Address, error)

func (*RegisterApi) GetRegistration

func (r *RegisterApi) GetRegistration(name string, gid types.Gid) (*types.Registration, error)

func (*RegisterApi) GetRegistrationList

func (r *RegisterApi) GetRegistrationList(gid types.Gid, pledgeAddr types.Address) ([]*RegistrationInfo, error)

func (*RegisterApi) GetRewardByDay

func (r *RegisterApi) GetRewardByDay(gid types.Gid, timestamp int64) (map[string]*Reward, error)

func (*RegisterApi) GetRewardByIndex

func (r *RegisterApi) GetRewardByIndex(gid types.Gid, indexStr string) (*RewardInfo, error)

func (*RegisterApi) GetRewardData

func (r *RegisterApi) GetRewardData(gid types.Gid, name string, beneficialAddr types.Address) ([]byte, error)

func (*RegisterApi) GetUpdateRegistrationData

func (r *RegisterApi) GetUpdateRegistrationData(gid types.Gid, name string, nodeAddr types.Address) ([]byte, error)

func (RegisterApi) String

func (r RegisterApi) String() string

type RegisterConditionParam

type RegisterConditionParam struct {
	PledgeAmount string            `json:"pledgeAmount"`
	PledgeToken  types.TokenTypeId `json:"pledgeToken"`
	PledgeHeight string            `json:"pledgeHeight"`
}

type RegistrationInfo

type RegistrationInfo struct {
	Name           string        `json:"name"`
	NodeAddr       types.Address `json:"nodeAddr"`
	PledgeAddr     types.Address `json:"pledgeAddr"`
	PledgeAmount   string        `json:"pledgeAmount"`
	WithdrawHeight string        `json:"withdrawHeight"`
	WithdrawTime   int64         `json:"withdrawTime"`
	CancelTime     int64         `json:"cancelTime"`
}

type Reward

type Reward struct {
	BlockReward      string `json:"blockReward"`
	VoteReward       string `json:"voteReward"`
	TotalReward      string `json:"totalReward"`
	BlockNum         string `json:"blockNum"`
	ExpectedBlockNum string `json:"expectedBlockNum"`
	Drained          bool   `json:"drained"`
}

func ToReward

func ToReward(source *contracts.Reward) *Reward

type RewardInfo

type RewardInfo struct {
	RewardMap map[string]*Reward `json:"rewardMap"`
	StartTime int64              `json:"startTime"`
	EndTime   int64              `json:"endTime"`
}

type RpcAccountInfo

type RpcAccountInfo struct {
	AccountAddress      types.Address                              `json:"accountAddress"`
	TotalNumber         string                                     `json:"totalNumber"` // uint64
	TokenBalanceInfoMap map[types.TokenTypeId]*RpcTokenBalanceInfo `json:"tokenBalanceInfoMap,omitempty"`
}

type RpcOrder

type RpcOrder struct {
	Id                 string `json:"Id"`
	Address            string `json:"Address"`
	MarketId           int32  `json:"MarketId"`
	Side               bool   `json:"Side"`
	Type               int32  `json:"Type"`
	Price              string `json:"Price"`
	TakerFeeRate       int32  `json:"TakerFeeRate"`
	MakerFeeRate       int32  `json:"MakerFeeRate"`
	TakerBrokerFeeRate int32  `json:"TakerBrokerFeeRate"`
	MakerBrokerFeeRate int32  `json:"MakerBrokerFeeRate"`
	Quantity           string `json:"Quantity"`
	Amount             string `json:"Amount"`
	LockedBuyFee       string `json:"LockedBuyFee,omitempty"`
	Status             int32  `json:"Status"`
	CancelReason       int32  `json:"CancelReason,omitempty"`
	ExecutedQuantity   string `json:"ExecutedQuantity,omitempty"`
	ExecutedAmount     string `json:"ExecutedAmount,omitempty"`
	ExecutedBaseFee    string `json:"ExecutedBaseFee,omitempty"`
	ExecutedBrokerFee  string `json:"ExecutedBrokerFee,omitempty"`
	RefundToken        string `json:"RefundToken,omitempty"`
	RefundQuantity     string `json:"RefundQuantity,omitempty"`
	Timestamp          int64  `json:"Timestamp"`
}

func OrderToRpc

func OrderToRpc(order *dex.Order) *RpcOrder

func OrdersToRpc

func OrdersToRpc(orders []*dex.Order) []*RpcOrder

type RpcTokenBalanceInfo

type RpcTokenBalanceInfo struct {
	TokenInfo   *RpcTokenInfo `json:"tokenInfo,omitempty"`
	TotalAmount string        `json:"totalAmount"`      // big int
	Number      *string       `json:"number,omitempty"` // uint64
}

type RpcTokenInfo

type RpcTokenInfo struct {
	TokenName     string            `json:"tokenName"`
	TokenSymbol   string            `json:"tokenSymbol"`
	TotalSupply   *string           `json:"totalSupply,omitempty"` // *big.Int
	Decimals      uint8             `json:"decimals"`
	Owner         types.Address     `json:"owner"`
	TokenId       types.TokenTypeId `json:"tokenId"`
	MaxSupply     *string           `json:"maxSupply"` // *big.Int
	OwnerBurnOnly bool              `json:"ownerBurnOnly"`
	IsReIssuable  bool              `json:"isReIssuable"`
	Index         uint16            `json:"index"`
}

func RawTokenInfoToRpc

func RawTokenInfoToRpc(tinfo *types.TokenInfo, tti types.TokenTypeId) *RpcTokenInfo

type SendTxWithPrivateKeyParam

type SendTxWithPrivateKeyParam struct {
	SelfAddr     *types.Address    `json:"selfAddr"`
	ToAddr       *types.Address    `json:"toAddr"`
	TokenTypeId  types.TokenTypeId `json:"tokenTypeId"`
	PrivateKey   *string           `json:"privateKey"` //hex16
	Amount       *string           `json:"amount"`
	Data         []byte            `json:"data"` //base64
	Difficulty   *string           `json:"difficulty,omitempty"`
	PreBlockHash *types.Hash       `json:"preBlockHash,omitempty"`
	BlockType    byte              `json:"blockType"`
}

type SnapshotBlock

type SnapshotBlock struct {
	Producer types.Address `json:"producer"`
	*ledger.SnapshotBlock
	Timestamp int64 `json:"timestamp"`
}

type SnapshotChunk

type SnapshotChunk struct {
	AccountBlocks []*ledger.AccountBlock
	SnapshotBlock *SnapshotBlock
}

type StatsApi

type StatsApi struct {
	// contains filtered or unexported fields
}

func NewStatsApi

func NewStatsApi(vite *vite.Vite) *StatsApi

func (StatsApi) GetDaySBPStats

func (c StatsApi) GetDaySBPStats(startIdx uint64, endIdx uint64) ([]map[string]interface{}, error)

func (StatsApi) GetHourSBPStats

func (c StatsApi) GetHourSBPStats(startIdx uint64, endIdx uint64) ([]map[string]interface{}, error)

func (StatsApi) GetPeriodSBPStats

func (c StatsApi) GetPeriodSBPStats(startIdx uint64, endIdx uint64) ([]*PeriodStats, error)

func (StatsApi) Index2Time

func (c StatsApi) Index2Time(i uint64, level int) map[string]time.Time

func (StatsApi) String

func (c StatsApi) String() string

func (StatsApi) Time2Index

func (c StatsApi) Time2Index(t *time.Time, level int) uint64

type SyncInfo

type SyncInfo struct {
	From    string `json:"from"`
	To      string `json:"to"`
	Current string `json:"current"`
	State   uint   `json:"state"`
	Status  string `json:"status"`
}

type TestApi

type TestApi struct {
	// contains filtered or unexported fields
}

func NewTestApi

func NewTestApi(walletApi *WalletApi) *TestApi

func (TestApi) Bazinga

func (t TestApi) Bazinga(ctx context.Context) error

func (TestApi) CreateTxWithPrivKey

func (t TestApi) CreateTxWithPrivKey(params CreateTxWithPrivKeyParmsTest) error

func (TestApi) GetTestToken

func (t TestApi) GetTestToken(ctx context.Context, ToAddr types.Address) (string, error)

func (TestApi) ReceiveOnroadTx

func (t TestApi) ReceiveOnroadTx(params CreateReceiveTxParms) error

type TokenInfoList

type TokenInfoList struct {
	Count int             `json:"totalCount"`
	List  []*RpcTokenInfo `json:"tokenInfoList"`
}

type TransferOwnerParams

type TransferOwnerParams struct {
	TokenId  types.TokenTypeId
	NewOwner types.Address
}

type Tx

type Tx struct {
	// contains filtered or unexported fields
}

func NewTxApi

func NewTxApi(vite *vite.Vite) *Tx

func (Tx) CalcPoWDifficulty

func (t Tx) CalcPoWDifficulty(param CalcPoWDifficultyParam) (result *CalcPoWDifficultyResult, err error)

func (Tx) SendRawTx

func (t Tx) SendRawTx(block *AccountBlock) error

func (Tx) SendTxWithPrivateKey

func (t Tx) SendTxWithPrivateKey(param SendTxWithPrivateKeyParam) (*AccountBlock, error)

type TxParam

type TxParam interface {
	LedgerAccountBlock() (*ledger.AccountBlock, error)
}

type TypesApi

type TypesApi struct {
}

func (TypesApi) IsValidHexAddress

func (TypesApi) IsValidHexAddress(addr string) bool

func (TypesApi) IsValidHexTokenTypeId

func (TypesApi) IsValidHexTokenTypeId(tti string) bool

func (TypesApi) String

func (TypesApi) String() string

type VmDebugApi

type VmDebugApi struct {
	// contains filtered or unexported fields
}

func NewVmDebugApi

func NewVmDebugApi(vite *vite.Vite) *VmDebugApi

func (*VmDebugApi) CallContract

func (v *VmDebugApi) CallContract(param CallContractParam) (*CallContractResult, error)

func (*VmDebugApi) ClearData

func (v *VmDebugApi) ClearData() error

func (*VmDebugApi) CreateContract

func (v *VmDebugApi) CreateContract(param CreateContractParam) ([]*CreateContractResult, error)

func (*VmDebugApi) GetContractList

func (v *VmDebugApi) GetContractList() (map[types.Address][]CallContractParam, error)

func (*VmDebugApi) GetContractStorage

func (v *VmDebugApi) GetContractStorage(addr types.Address) (map[string]string, error)

func (*VmDebugApi) Init

func (v *VmDebugApi) Init() (*AccountInfo, error)

func (*VmDebugApi) NewAccount

func (v *VmDebugApi) NewAccount() (*AccountInfo, error)

func (VmDebugApi) String

func (v VmDebugApi) String() string

type VoteApi

type VoteApi struct {
	// contains filtered or unexported fields
}

func NewVoteApi

func NewVoteApi(vite *vite.Vite) *VoteApi

func (*VoteApi) GetCancelVoteData

func (v *VoteApi) GetCancelVoteData(gid types.Gid) ([]byte, error)

func (*VoteApi) GetVoteData

func (v *VoteApi) GetVoteData(gid types.Gid, name string) ([]byte, error)

func (*VoteApi) GetVoteDetails

func (v *VoteApi) GetVoteDetails(index *uint64) ([]*consensus.VoteDetails, error)

func (*VoteApi) GetVoteInfo

func (v *VoteApi) GetVoteInfo(gid types.Gid, addr types.Address) (*VoteInfo, error)

func (VoteApi) String

func (v VoteApi) String() string

type VoteConditionParam

type VoteConditionParam struct {
}

type VoteInfo

type VoteInfo struct {
	Name       string `json:"nodeName"`
	NodeStatus uint8  `json:"nodeStatus"`
	Balance    string `json:"balance"`
}

type WalletApi

type WalletApi struct {
	// contains filtered or unexported fields
}

func NewWalletApi

func NewWalletApi(vite *vite.Vite) *WalletApi

func (WalletApi) AddEntropyStore

func (m WalletApi) AddEntropyStore(filename string) error

func (WalletApi) CreateTxWithPassphrase

func (m WalletApi) CreateTxWithPassphrase(params CreateTransferTxParms) (*types.Hash, error)

func (WalletApi) DeriveByFullPath

func (m WalletApi) DeriveByFullPath(entropyStore string, fullpath string) (*DeriveResult, error)

func (WalletApi) DeriveByIndex

func (m WalletApi) DeriveByIndex(entropyStore string, index uint32) (*DeriveResult, error)

func (WalletApi) ExtractMnemonic

func (m WalletApi) ExtractMnemonic(entropyStore string, passphrase string) (string, error)

func (WalletApi) FindAddr

func (m WalletApi) FindAddr(entropyStore string, addr types.Address) (findResult *FindAddrResult, e error)

func (WalletApi) FindAddrWithPassphrase

func (m WalletApi) FindAddrWithPassphrase(entropyStore string, passphrase string, addr types.Address) (findResult *FindAddrResult, e error)

func (WalletApi) GetDataDir

func (m WalletApi) GetDataDir() string

func (WalletApi) GetPrivateKey

func (m WalletApi) GetPrivateKey(entropyStore string, passphrase string) (*string, error)

func (WalletApi) GlobalCheckAddrUnlocked

func (m WalletApi) GlobalCheckAddrUnlocked(addr types.Address) bool

func (WalletApi) GlobalFindAddr

func (m WalletApi) GlobalFindAddr(addr types.Address) (findResult *FindAddrResult, e error)

func (WalletApi) GlobalFindAddrWithPassphrase

func (m WalletApi) GlobalFindAddrWithPassphrase(addr types.Address, passphrase string) (findResult *FindAddrResult, e error)

func (WalletApi) IsAddrUnlocked

func (m WalletApi) IsAddrUnlocked(entropyStore string, addr types.Address) bool

func (WalletApi) IsMayValidKeystoreFile

func (m WalletApi) IsMayValidKeystoreFile(path string) IsMayValidKeystoreFileResponse

func (WalletApi) IsUnlocked

func (m WalletApi) IsUnlocked(entropyStore string) bool

func (WalletApi) ListAllEntropyFiles

func (m WalletApi) ListAllEntropyFiles() []string

func (WalletApi) ListEntropyFilesInStandardDir

func (m WalletApi) ListEntropyFilesInStandardDir() ([]string, error)

func (WalletApi) ListEntropyStoreAddresses

func (m WalletApi) ListEntropyStoreAddresses(entropyStore string, from, to uint32) ([]types.Address, error)

func (WalletApi) Lock

func (m WalletApi) Lock(entropyStore string) error

func (WalletApi) NewMnemonicAndEntropyStore

func (m WalletApi) NewMnemonicAndEntropyStore(passphrase string) (*NewStoreResponse, error)

func (WalletApi) RecoverEntropyStoreFromMnemonic

func (m WalletApi) RecoverEntropyStoreFromMnemonic(mnemonic string, newPassphrase string) (*NewStoreResponse, error)

func (WalletApi) RefreshCache

func (m WalletApi) RefreshCache()

func (WalletApi) SignData

func (m WalletApi) SignData(addr types.Address, hexMsg string) (*HexSignedTuple, error)

func (WalletApi) SignDataWithPassphrase

func (m WalletApi) SignDataWithPassphrase(addr types.Address, hexMsg string, passphrase string) (*HexSignedTuple, error)

func (WalletApi) String

func (m WalletApi) String() string

func (WalletApi) Unlock

func (m WalletApi) Unlock(entropyStore string, passphrase string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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