Documentation
¶
Index ¶
- Constants
- func VerifyTx(tx *types.Transaction) error
- type AssetEquityBatchRsp
- type AssetEquityBatchRspMarshaling
- type CandidateInfo
- type CandidateListRes
- type Node
- type PrivateAccountAPI
- type PublicAccountAPI
- func (a *PublicAccountAPI) GetAccount(LemoAddress string) (*types.AccountData, error)
- func (a *PublicAccountAPI) GetAllRewardValue() ([]*coreParams.Reward, error)
- func (a *PublicAccountAPI) GetAsset(assetCode common.Hash) (*types.Asset, error)
- func (a *PublicAccountAPI) GetAssetEquity(LemoAddress string, index, limit int) (*AssetEquityBatchRsp, error)
- func (a *PublicAccountAPI) GetAssetEquityByAssetCode(LemoAddress string, assetCode common.Hash, index, limit int) (*AssetEquityBatchRsp, error)
- func (a *PublicAccountAPI) GetAssetEquityByAssetId(LemoAddress string, assetId common.Hash) (*types.AssetEquity, error)
- func (a *PublicAccountAPI) GetBalance(LemoAddress string) (string, error)
- func (a *PublicAccountAPI) GetMetaData(assetId common.Hash) (*database.MateData, error)
- type PublicChainAPI
- func (c *PublicChainAPI) ChainID() uint16
- func (c *PublicChainAPI) CurrentBlock(withBody bool) *types.Block
- func (c *PublicChainAPI) GasPriceAdvice() *big.Int
- func (c *PublicChainAPI) Genesis() *types.Block
- func (c *PublicChainAPI) GetBlockByHash(hash string, withBody bool) *types.Block
- func (c *PublicChainAPI) GetBlockByHeight(height uint32, withBody bool) *types.Block
- func (c *PublicChainAPI) GetCandidateList(index, size int) (*CandidateListRes, error)
- func (c *PublicChainAPI) GetCandidateTop30() []*CandidateInfo
- func (c *PublicChainAPI) GetDeputyNodeList() []string
- func (c *PublicChainAPI) GetServerVersion() string
- type PublicTxAPI
- func (t *PublicTxAPI) CreateAsset(prv string, category, decimals uint32, isReplenishable, isDivisible bool) (common.Hash, error)
- func (t *PublicTxAPI) GetTxByHash(hash string) (*store.VTransactionDetail, error)
- func (t *PublicTxAPI) GetTxListByAddress(lemoAddress string, index int, size int) (*TxListRes, error)
- func (t *PublicTxAPI) GetTxListByTimestamp(lemoAddress string, beginTime int64, endTime int64, index int, size int) (*TxListRes, error)
- func (t *PublicTxAPI) IssueAsset(prv string, receiver common.Address, assetCode common.Hash, amount *big.Int, ...) (common.Hash, error)
- func (t *PublicTxAPI) ModifyAsset(prv string, assetCode common.Hash) (common.Hash, error)
- func (t *PublicTxAPI) ReplenishAsset(prv string, receiver common.Address, assetCode, assetId common.Hash, ...) (common.Hash, error)
- func (t *PublicTxAPI) SendReimbursedGasTx(senderPrivate, gasPayerPrivate string, to, gasPayer common.Address, ...) (common.Hash, error)
- func (t *PublicTxAPI) SendTx(tx *types.Transaction) (common.Hash, error)
- func (t *PublicTxAPI) TradingAsset(prv string, to common.Address, assetCode, assetId common.Hash, amount *big.Int, ...) (common.Hash, error)
- type TxListRes
Constants ¶
const ( MaxTxToNameLength = 100 MaxTxMessageLength = 1024 )
Variables ¶
This section is empty.
Functions ¶
func VerifyTx ¶
func VerifyTx(tx *types.Transaction) error
VerifyTx transaction parameter verification
Types ¶
type AssetEquityBatchRsp ¶
type AssetEquityBatchRsp struct {
Equities []*types.AssetEquity `json:"equities" gencodec:"required"`
Total uint32 `json:"total" gencodec:"required"`
}
type CandidateInfo ¶
type CandidateInfo struct {
CandidateAddress string `json:"address" gencodec:"required"`
Votes string `json:"votes" gencodec:"required"`
Profile map[string]string `json:"profile" gencodec:"required"`
}
func (CandidateInfo) MarshalJSON ¶
func (c CandidateInfo) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*CandidateInfo) UnmarshalJSON ¶
func (c *CandidateInfo) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type CandidateListRes ¶
type CandidateListRes struct {
CandidateList []*CandidateInfo `json:"candidateList" gencodec:"required"`
Total uint32 `json:"total" gencodec:"required"`
}
func (CandidateListRes) MarshalJSON ¶
func (c CandidateListRes) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*CandidateListRes) UnmarshalJSON ¶
func (c *CandidateListRes) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type PrivateAccountAPI ¶
type PrivateAccountAPI struct {
// contains filtered or unexported fields
}
Private
func NewPrivateAccountAPI ¶
func NewPrivateAccountAPI(node *Node) *PrivateAccountAPI
NewPrivateAccountAPI
func (*PrivateAccountAPI) NewKeyPair ¶
func (a *PrivateAccountAPI) NewKeyPair() (*crypto.AccountKey, error)
NewAccount get lemo address api
type PublicAccountAPI ¶
type PublicAccountAPI struct {
// contains filtered or unexported fields
}
PublicAccountAPI API for access to account information
func NewPublicAccountAPI ¶
func NewPublicAccountAPI(node *Node) *PublicAccountAPI
NewPublicAccountAPI
func (*PublicAccountAPI) GetAccount ¶
func (a *PublicAccountAPI) GetAccount(LemoAddress string) (*types.AccountData, error)
GetAccount return the struct of the &AccountData{}
func (*PublicAccountAPI) GetAllRewardValue ¶
func (a *PublicAccountAPI) GetAllRewardValue() ([]*coreParams.Reward, error)
GetAllRewardValue get the value for each bonus
func (*PublicAccountAPI) GetAssetEquity ¶
func (a *PublicAccountAPI) GetAssetEquity(LemoAddress string, index, limit int) (*AssetEquityBatchRsp, error)
func (*PublicAccountAPI) GetAssetEquityByAssetCode ¶
func (a *PublicAccountAPI) GetAssetEquityByAssetCode(LemoAddress string, assetCode common.Hash, index, limit int) (*AssetEquityBatchRsp, error)
func (*PublicAccountAPI) GetAssetEquityByAssetId ¶
func (a *PublicAccountAPI) GetAssetEquityByAssetId(LemoAddress string, assetId common.Hash) (*types.AssetEquity, error)
GetAssetEquity returns asset equity
func (*PublicAccountAPI) GetBalance ¶
func (a *PublicAccountAPI) GetBalance(LemoAddress string) (string, error)
GetBalance get balance in mo
func (*PublicAccountAPI) GetMetaData ¶
type PublicChainAPI ¶
type PublicChainAPI struct {
// contains filtered or unexported fields
}
ChainAPI
func NewPublicChainAPI ¶
func NewPublicChainAPI(node *Node) *PublicChainAPI
NewChainAPI API for access to chain information
func (*PublicChainAPI) CurrentBlock ¶
func (c *PublicChainAPI) CurrentBlock(withBody bool) *types.Block
CurrentBlock get the current latest block
func (*PublicChainAPI) GasPriceAdvice ¶
func (c *PublicChainAPI) GasPriceAdvice() *big.Int
GasPriceAdvice get suggest gas price
func (*PublicChainAPI) Genesis ¶
func (c *PublicChainAPI) Genesis() *types.Block
Genesis get the creation block
func (*PublicChainAPI) GetBlockByHash ¶
func (c *PublicChainAPI) GetBlockByHash(hash string, withBody bool) *types.Block
GetBlockByHash get block information by hash
func (*PublicChainAPI) GetBlockByHeight ¶
func (c *PublicChainAPI) GetBlockByHeight(height uint32, withBody bool) *types.Block
GetBlockByNumber get block information by height
func (*PublicChainAPI) GetCandidateList ¶
func (c *PublicChainAPI) GetCandidateList(index, size int) (*CandidateListRes, error)
// GetCandidateNodeList get all candidate node list information and return total candidate node
func (*PublicChainAPI) GetCandidateTop30 ¶
func (c *PublicChainAPI) GetCandidateTop30() []*CandidateInfo
GetCandidateTop30 get top 30 candidate node
func (*PublicChainAPI) GetDeputyNodeList ¶
func (c *PublicChainAPI) GetDeputyNodeList() []string
GetDeputyNodeList get deputy nodes who are in charge
func (*PublicChainAPI) GetServerVersion ¶
func (c *PublicChainAPI) GetServerVersion() string
GetServerVersion
type PublicTxAPI ¶
type PublicTxAPI struct {
// contains filtered or unexported fields
}
TXAPI
func NewPublicTxAPI ¶
func NewPublicTxAPI(node *Node) *PublicTxAPI
NewTxAPI API for send a transaction
func (*PublicTxAPI) CreateAsset ¶
func (t *PublicTxAPI) CreateAsset(prv string, category, decimals uint32, isReplenishable, isDivisible bool) (common.Hash, error)
CreateAsset 创建资产
func (*PublicTxAPI) GetTxByHash ¶
func (t *PublicTxAPI) GetTxByHash(hash string) (*store.VTransactionDetail, error)
// GetTxByHash pull the specified transaction through a transaction hash
func (*PublicTxAPI) GetTxListByAddress ¶
func (t *PublicTxAPI) GetTxListByAddress(lemoAddress string, index int, size int) (*TxListRes, error)
// GetTxListByAddress pull the list of transactions
func (*PublicTxAPI) GetTxListByTimestamp ¶
func (*PublicTxAPI) IssueAsset ¶
func (t *PublicTxAPI) IssueAsset(prv string, receiver common.Address, assetCode common.Hash, amount *big.Int, metaData string) (common.Hash, error)
发行资产
func (*PublicTxAPI) ModifyAsset ¶
ModifyAsset 修改资产信息
func (*PublicTxAPI) ReplenishAsset ¶
func (t *PublicTxAPI) ReplenishAsset(prv string, receiver common.Address, assetCode, assetId common.Hash, amount *big.Int) (common.Hash, error)
增发资产
func (*PublicTxAPI) SendReimbursedGasTx ¶
func (t *PublicTxAPI) SendReimbursedGasTx(senderPrivate, gasPayerPrivate string, to, gasPayer common.Address, amount int64, data []byte, txType uint16, toName, message string) (common.Hash, error)
SendReimbursedGasTx gas代付交易 todo 测试使用
func (*PublicTxAPI) SendTx ¶
func (t *PublicTxAPI) SendTx(tx *types.Transaction) (common.Hash, error)
Send send a transaction
type TxListRes ¶
type TxListRes struct {
VTransactions []*store.VTransaction `json:"txList" gencodec:"required"`
Total uint32 `json:"total" gencodec:"required"`
}