api

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2019 License: GPL-3.0 Imports: 58 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	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,
	}

	// -36001 ~ -36999 verifier_account
	ErrVerifyAccountAddr = JsonRpc2Error{
		Message: verifier.ErrVerifyAccountAddrFailed.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,
	}
	ErrVerifySnapshotOfReferredBlock = JsonRpc2Error{
		Message: verifier.ErrVerifySnapshotOfReferredBlockFailed.Error(),
		Code:    -36005,
	}
	ErrVerifyPrevBlock = JsonRpc2Error{
		Message: verifier.ErrVerifyPrevBlockFailed.Error(),
		Code:    -36006,
	}
	ErrVerifyRPCBlockIsPending = JsonRpc2Error{
		Message: verifier.ErrVerifyRPCBlockPendingState.Error(),
		Code:    -36007,
	}
)
View Source
var (
	NodeStatusActive   uint8 = 1
	NodeStatusInActive uint8 = 2
)
View Source
var (
	ErrStrToBigInt = errors.New("convert to big.Int failed")
)

Functions

func CheckGetTestTokenIpFrequency

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

func InitConfig added in v1.3.0

func InitConfig(id uint)

func InitGetTestTokenLimitPolicy

func InitGetTestTokenLimitPolicy()

func InitLog

func InitLog(dir, lvl string)

func InitTestAPIParams

func InitTestAPIParams(priv, tti string)

func StringToUint64 added in v1.3.2

func StringToUint64(s string) (uint64, error)

func TryMakeConcernedError

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

Types

type AccountBlock

type AccountBlock struct {
	*ledger.AccountBlock

	FromAddress types.Address `json:"fromAddress"`

	Height string  `json:"height"`
	Quota  *string `json:"quota"`

	Amount     *string `json:"amount"`
	Fee        *string `json:"fee"`
	Difficulty *string `json:"difficulty"`

	Timestamp int64 `json:"timestamp"`

	ConfirmedTimes *string       `json:"confirmedTimes"`
	TokenInfo      *RpcTokenInfo `json:"tokenInfo"`

	ReceiveBlockHeights []string `json:"receiveBlockHeights"`
}

func (*AccountBlock) LedgerAccountBlock

func (ab *AccountBlock) LedgerAccountBlock() (*ledger.AccountBlock, error)

type AccountInfo added in v1.2.0

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

type CalcPoWDifficultyParam added in v1.3.0

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

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

	UsePledgeQuota bool `json:"usePledgeQuota"`
}

type CallContractParam added in v1.2.0

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 added in v1.2.0

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

type CallOffChainMethodParam added in v1.3.0

type CallOffChainMethodParam struct {
	SelfAddr     types.Address
	MethodName   string
	OffChainCode []byte
	Data         []byte
}

type CandidateInfo

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

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) 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 added in v1.2.0

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 added in v1.3.0

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

func (*ContractApi) GetCallContractData added in v1.2.0

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

func (*ContractApi) GetCallOffChainData added in v1.3.0

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

func (*ContractApi) GetCreateContractData added in v1.2.0

func (c *ContractApi) GetCreateContractData(gid types.Gid, hexCode string, abiStr string, params []string) ([]byte, error)

func (*ContractApi) GetCreateContractToAddress

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

func (ContractApi) String

func (c ContractApi) String() string

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
	CountingTokenId        types.TokenTypeId
	RegisterConditionId    uint8
	RegisterConditionParam []byte
	VoteConditionId        uint8
	VoteConditionParam     []byte
}

type CreateContractParam added in v1.2.0

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

type CreateContractResult added in v1.2.0

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 added in v1.3.0

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) ConsensusBlockRate

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

func (DebugApi) ConsensusPlanAndActual

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

func (DebugApi) ConsensusProducers

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

func (DebugApi) ConsensusVoteDetails

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

func (DebugApi) Free

func (api DebugApi) Free()

func (DebugApi) GetForkInfo added in v1.2.0

func (api DebugApi) GetForkInfo() config.ForkPoints

func (DebugApi) MachineInfo

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

func (DebugApi) P2pNodes

func (api DebugApi) P2pNodes() []string

func (DebugApi) PoolAccount

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

func (DebugApi) PoolAccountBlockDetail added in v1.3.2

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) map[string]interface{}

func (DebugApi) PoolInfo

func (api DebugApi) PoolInfo(addr *types.Address) string

func (DebugApi) PoolSnapshot

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

func (DebugApi) PoolSnapshotBlockDetail added in v1.3.2

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

func (DebugApi) PoolSnapshotChainDetail

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

func (DebugApi) SetGetTestTokenLimitSize

func (api DebugApi) SetGetTestTokenLimitSize(size int) error

type DeriveResult

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

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 added in v1.3.0

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 KafkaProducerInfo

type KafkaProducerInfo struct {
	ProducerId uint8    `json:"producerId"`
	BrokerList []string `json:"brokerList"`
	Topic      string   `json:"topic"`
	HasSend    uint64   `json:"hasSend"`
	Status     string   `json:"status"`
}

type KafkaSendInfo

type KafkaSendInfo struct {
	Producers    []*KafkaProducerInfo `json:"producers"`
	RunProducers []*KafkaProducerInfo `json:"runProducers"`
	TotalEvent   uint64               `json:"totalEvent"`
}

type LedgerApi

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

func NewLedgerApi

func NewLedgerApi(vite *vite.Vite) *LedgerApi

func (*LedgerApi) AccountType added in v1.3.0

func (l *LedgerApi) AccountType(addr types.Address) (uint64, error)

func (*LedgerApi) GetAccountByAccAddr

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

func (*LedgerApi) GetBlockByHash

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

func (*LedgerApi) GetBlockByHeight added in v1.1.2

func (l *LedgerApi) GetBlockByHeight(addr types.Address, heightStr string) (*AccountBlock, error)

func (*LedgerApi) GetBlockMeta

func (l *LedgerApi) GetBlockMeta(hash *types.Hash) (*ledger.AccountBlockMeta, 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 added in v1.2.0

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

func (*LedgerApi) GetBlocksByHeight added in v1.1.2

func (l *LedgerApi) GetBlocksByHeight(addr types.Address, height uint64, count uint64, forward bool) ([]*AccountBlock, error)

func (*LedgerApi) GetFittestSnapshotHash

func (l *LedgerApi) GetFittestSnapshotHash(accAddr *types.Address, sendBlockHash *types.Hash) (*types.Hash, error)

func (*LedgerApi) GetGcStatus

func (l *LedgerApi) GetGcStatus() *GcStatus

func (*LedgerApi) GetLatestBlock

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

func (*LedgerApi) GetLatestSnapshotChainHash

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

func (*LedgerApi) GetNeedSnapshotContent

func (l *LedgerApi) GetNeedSnapshotContent() map[types.Address]*ledger.HashHeight

func (*LedgerApi) GetSenderInfo

func (l *LedgerApi) GetSenderInfo() (*KafkaSendInfo, error)

func (*LedgerApi) GetSnapshotBlockByHash

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

func (*LedgerApi) GetSnapshotBlockByHeight

func (l *LedgerApi) GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error)

func (*LedgerApi) GetSnapshotChainHeight

func (l *LedgerApi) GetSnapshotChainHeight() string

func (*LedgerApi) GetStatistics

func (l *LedgerApi) GetStatistics() (*Statistics, error)

func (*LedgerApi) GetTokenMintage

func (l *LedgerApi) GetTokenMintage(tti types.TokenTypeId) (*RpcTokenInfo, error)

func (*LedgerApi) GetVmLogList

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

func (*LedgerApi) GetVmLogListByHash added in v1.1.2

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

func (*LedgerApi) SetSenderHasSend

func (l *LedgerApi) SetSenderHasSend(producerId uint8, hasSend uint64)

func (*LedgerApi) StopSender

func (l *LedgerApi) StopSender(producerId uint8)

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 added in v1.3.0

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

func (*MintageApi) GetChangeTokenTypeData added in v1.3.0

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

func (*MintageApi) GetIssueData added in v1.3.0

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

func (*MintageApi) GetMintData added in v1.3.0

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

func (*MintageApi) GetMintageCancelPledgeData

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

func (*MintageApi) GetMintageData

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

func (*MintageApi) GetTokenInfoById added in v1.3.0

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

func (*MintageApi) GetTokenInfoList added in v1.3.0

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

func (*MintageApi) GetTokenInfoListByOwner added in v1.3.0

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

func (*MintageApi) GetTransferOwnerData added in v1.3.0

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

func (*MintageApi) NewTokenId added in v1.3.0

func (m *MintageApi) NewTokenId(param NewTokenIdParams) (*types.TokenTypeId, error)

func (MintageApi) String

func (m MintageApi) String() string

type MintageParams

type MintageParams struct {
	SelfAddr      types.Address
	Height        string
	PrevHash      types.Hash
	SnapshotHash  types.Hash
	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) NodeInfo added in v1.3.0

func (n *NetApi) NodeInfo() p2p.NodeInfo

func (*NetApi) Nodes added in v1.2.0

func (n *NetApi) Nodes() []string

func (*NetApi) Peers

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

func (*NetApi) PeersCount

func (n *NetApi) PeersCount() uint

func (*NetApi) SyncDetail added in v1.3.0

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 NewTokenIdParams added in v1.3.0

type NewTokenIdParams struct {
	SelfAddr     types.Address
	Height       string
	PrevHash     types.Hash
	SnapshotHash types.Hash
}

type PledgeApi

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

func NewPledgeApi

func NewPledgeApi(vite *vite.Vite) *PledgeApi

func (*PledgeApi) GetCancelPledgeData

func (p *PledgeApi) GetCancelPledgeData(beneficialAddr types.Address, amount string) ([]byte, 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) 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"`
}

type PledgeInfoList

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

type Pow

type Pow struct {
}

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) GetAccountOnroadInfo

func (o PrivateOnroadApi) GetAccountOnroadInfo(address types.Address) (*RpcAccountInfo, error)

func (PrivateOnroadApi) GetContractAddrListByGid added in v1.3.0

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

func (PrivateOnroadApi) GetOnroadBlocksByAddress

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

func (PrivateOnroadApi) ListWorkingAutoReceiveWorker

func (o PrivateOnroadApi) ListWorkingAutoReceiveWorker() []types.Address

func (PrivateOnroadApi) StartAutoReceive

func (o PrivateOnroadApi) StartAutoReceive(entropystore string, addr types.Address, filter map[string]string, powDifficulty *string) error

func (PrivateOnroadApi) StopAutoReceive

func (o PrivateOnroadApi) StopAutoReceive(addr types.Address) error

func (PrivateOnroadApi) String

func (o PrivateOnroadApi) String() string

type PublicOnroadApi

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

func NewPublicOnroadApi

func NewPublicOnroadApi(vite *vite.Vite) *PublicOnroadApi

func (PublicOnroadApi) GetAccountOnroadInfo

func (o PublicOnroadApi) GetAccountOnroadInfo(address types.Address) (*RpcAccountInfo, error)

func (PublicOnroadApi) GetOnroadBlocksByAddress

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

func (PublicOnroadApi) String

func (o PublicOnroadApi) String() string

type QuotaAndTxNum

type QuotaAndTxNum struct {
	Quota string `json:"quota"`
	TxNum string `json:"txNum"`
}

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) GetCancelRegisterData

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

func (*RegisterApi) GetCandidateList

func (r *RegisterApi) GetCandidateList(gid types.Gid) ([]*CandidateInfo, error)

func (*RegisterApi) GetRegisterData

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

func (*RegisterApi) GetRegisterPledgeAddr deprecated

func (r *RegisterApi) GetRegisterPledgeAddr(name string, gid *types.Gid) (*types.Address, error)

Deprecated: Use GetRegistration instead

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) 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 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"`
	CancelHeight   string        `json:"cancelHeight"`
}

type RpcAccountInfo

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

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"`
	PledgeAmount   *string           `json:"pledgeAmount,omitempty"` // *big.Int
	WithdrawHeight string            `json:"withdrawHeight"`         // uint64
	PledgeAddr     types.Address     `json:"pledgeAddr"`
	TokenId        types.TokenTypeId `json:"tokenId"`
	MaxSupply      *string           `json:"maxSupply"` // *big.Int
	OwnerBurnOnly  bool              `json:"ownerBurnOnly"`
	IsReIssuable   bool              `json:"isReIssuable"`
}

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 Statistics

type Statistics struct {
	SnapshotBlockCount uint64 `json:"snapshotBlockCount"`
	AccountBlockCount  uint64 `json:"accountBlockCount"`
}

type SyncInfo

type SyncInfo struct {
	From     string `json:"from"`
	To       string `json:"to"`
	Received string `json:"received"`
	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 added in v1.3.0

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

type TransferOwnerParams added in v1.3.0

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 added in v1.3.0

func (t Tx) CalcPoWDifficulty(param CalcPoWDifficultyParam) (difficulty string, err error)

func (Tx) SendRawTx

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

func (Tx) SendTxWithPrivateKey

func (t Tx) SendTxWithPrivateKey(param SendTxWithPrivateKeyParam) (*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 added in v1.2.0

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

func NewVmDebugApi added in v1.2.0

func NewVmDebugApi(vite *vite.Vite) *VmDebugApi

func (*VmDebugApi) CallContract added in v1.2.0

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

func (*VmDebugApi) ClearData added in v1.2.0

func (v *VmDebugApi) ClearData() error

func (*VmDebugApi) CreateContract added in v1.2.0

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

func (*VmDebugApi) GetContractList added in v1.2.0

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

func (*VmDebugApi) GetContractStorage added in v1.2.0

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

func (*VmDebugApi) Init added in v1.2.0

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

func (*VmDebugApi) NewAccount added in v1.2.0

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

func (VmDebugApi) String added in v1.2.0

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) GetVoteInfo

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

func (VoteApi) String

func (v VoteApi) String() string

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) 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) 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