Versions in this module Expand all Collapse all v1 v1.2.5 Jul 14, 2021 Changes in this version + const API_V2_CONTRACT_CALL + const API_V2_CONTRACT_QUERY_ACCOUNT + const API_V2_CONTRACT_QUERY_LOGS + const API_V2_QUERY_ACCOUNT + const CodeType_BadArgument + const CodeType_BadNonce + const CodeType_BadSignature + const CodeType_ContractExecuteErr + const CodeType_ContractExecuteFailed + const CodeType_Deadline + const CodeType_EncodingError + const CodeType_ExecuteTx + const CodeType_Gas + const CodeType_InsufficientFunds + const CodeType_InternalError + const CodeType_OK + const CodeType_ReceiverNotExist + const CodeType_SenderNotExist + const CodeType_UnsupportedTx + const PubKeyLength + const TxGas + const TxTagLength + var ErrDeadline = errors.New("tx deadline") + var ErrGas = errors.New("gas too low") + var ErrInsufficientBalance = errors.New("insufficient balance") + var ErrInsufficientPermissions = errors.New("insufficient permissions") + var ErrInvalidGasLimit = errors.New("invalid gasLimit") + var ErrInvalidGasPrice = errors.New("invalid gasPrice") + var ErrInvalidOperations = errors.New("too little/much operations") + var ErrInvalidSignature = errors.New("signature verify failed") + var ErrNotFoundReceiver = errors.New("receiver not exist") + var ErrNotFoundSender = errors.New("sender not exist") + var ErrUnknownTxType = errors.New("unknown tx type") + var ErrUnsupportedTx = errors.New("unsupported tx") + var TxTagAppBatch = TxTag + var TxTagAppEvm = TxTag + var TxTagAppEvmMultisig = TxTag + var TxTagEthereumTx = TxTag + var ZERO_ADDRESS = ethcmn.Address + var ZERO_HASH = ethcmn.Hash + var ZERO_PUBLICKEY = PublicKey + func DecodeTx(raw []byte) (TxTag, HashTx, error) + func PubkeyToAddress(pub PublicKey) ethcmn.Address + func RLPHash(x interface{}) (h ethcmn.Hash) + func SaveLastBlock(db ethdb.Database, appHash ethcmn.Hash, header *AppHeader) + func ValidAddress(s string) bool + func ValidPublicKey(s string) bool + type Address struct + func (a Address) MarshalText() ([]byte, error) + type AppBlock struct + Height int64 + StateRoot ethcmn.Hash + func NewAppBlock(height int64, root ethcmn.Hash) *AppBlock + func (b *AppBlock) FromBytes(bz []byte) + func (b *AppBlock) FromDB(db ethdb.Database, height int64) (*AppBlock, error) + func (b *AppBlock) ToBytes() []byte + func (b *AppBlock) ToDB(db ethdb.Database) error + type AppHeader struct + BlockHash ethcmn.Hash + ClosedAt time.Time + Height *big.Int + MinerFee *big.Int + PrevHash ethcmn.Hash + StateRoot ethcmn.Hash + TxCount uint64 + Validator ethcmn.Address + func (h *AppHeader) Copy() *AppHeader + func (h *AppHeader) Hash() []byte + func (h *AppHeader) String() string + type BeanAccount struct + Address string + Balance string + Nonce uint64 + type BeanContract struct + Address string + Balance string + Code string + Nonce uint64 + Suicided bool + type BeanEvmCallResult = struct + Code uint32 + GasUsed uint64 + Msg string + Ret string + type DPosQuery struct + Address ethcmn.Address + Height uint64 + func (q *DPosQuery) FromBytes(bz []byte) error + func (q *DPosQuery) GetQuery(bz []byte) error + func (q *DPosQuery) ToBytes() []byte + type HashTx interface + Hash func() ethcmn.Hash + type LastBlockInfo struct + AppHash ethcmn.Hash + Height int64 + PrevHash ethcmn.Hash + StateRoot ethcmn.Hash + func LoadLastBlock(db ethdb.Database) (lastBlock LastBlockInfo) + func (block *LastBlockInfo) FromBytes(bz []byte) + func (block *LastBlockInfo) ToBytes() []byte + type MultisigEvmTx struct + Deadline uint64 + From ethcmn.Address + GasLimit uint64 + GasPrice *big.Int + Load []byte + Memo []byte + Nonce uint64 + Signature Signature + To ethcmn.Address + Value *big.Int + func NewMultisigEvmTx(k int, pks []PublicKey) *MultisigEvmTx + func (tx *MultisigEvmTx) AddSign(signature string) error + func (tx *MultisigEvmTx) Cost() *big.Int + func (tx *MultisigEvmTx) FromBytes(bs []byte) error + func (tx *MultisigEvmTx) Hash() ethcmn.Hash + func (tx *MultisigEvmTx) SigHash() ethcmn.Hash + func (tx *MultisigEvmTx) Sign(privkey string) error + func (tx *MultisigEvmTx) ToBytes() []byte + func (tx *MultisigEvmTx) Verify() bool + func (tx MultisigEvmTx) Signer() []ethcmn.Address + type Multisignature struct + BitArray *bitarray.CompactBitArray + Sigs [][]byte + func NewMultisig(n int) *Multisignature + func (mSig *Multisignature) AddSignature(sig []byte, index int) + func (mSig *Multisignature) AddSignatureFromPubKey(sig []byte, pubkey PublicKey, keys []PublicKey) error + func (mSig *Multisignature) Marshal() []byte + func (mSig *Multisignature) UnMarshal(bz []byte) error + type PubKeyMultisigThreshold struct + K uint + PubKeys []PublicKey + func NewPubKeyMultisigThreshold(k int, pubkeys []PublicKey) PubKeyMultisigThreshold + func (pk PubKeyMultisigThreshold) Address() ethcmn.Address + func (pk PubKeyMultisigThreshold) Bytes() []byte + func (pk PubKeyMultisigThreshold) Hash() (sum ethcmn.Hash) + func (pk PubKeyMultisigThreshold) VerifyBytes(msg []byte, marshalledSig []byte) bool + type PublicKey [PubKeyLength]byte + func BytesToPubkey(b []byte) (PublicKey, error) + func HexToPubkey(s string) (PublicKey, error) + func (pk *PublicKey) SetBytes(b []byte) + func (pk *PublicKey) UnmarshalJSON(input []byte) error + func (pk *PublicKey) UnmarshalText(input []byte) error + func (pk PublicKey) Big() *big.Int + func (pk PublicKey) Bytes() []byte + func (pk PublicKey) Copy() PublicKey + func (pk PublicKey) Equals(pk1 PublicKey) bool + func (pk PublicKey) Format(s fmt.State, c rune) + func (pk PublicKey) Hex() string + func (pk PublicKey) IsAddress() bool + func (pk PublicKey) MarshalText() ([]byte, error) + func (pk PublicKey) String() string + func (pk PublicKey) ToAddress() Address + func (pk PublicKey) VerifyBytes(msg, signature []byte) bool + type QueryBase struct + Begin uint64 + Cursor uint64 + End uint64 + Limit uint64 + Order string + type Result struct + Code uint32 + Data []byte + Log string + func NewError(code uint32, log string) Result + func NewResultOK(data []byte, log string) Result + func (res *Result) FromJSON(j string) *Result + func (res Result) AppendLog(log string) Result + func (res Result) Error() string + func (res Result) IsErr() bool + func (res Result) IsOK() bool + func (res Result) PrependLog(log string) Result + func (res Result) SetData(data []byte) Result + func (res Result) SetLog(log string) Result + func (res Result) String() string + func (res Result) ToJSON() string + type Signature struct + MultiSig *Multisignature + PubKey PubKeyMultisigThreshold + type TxBatch struct + CreatedAt uint64 + GasLimit uint64 + GasPrice *big.Int + Memo []byte + Nonce uint64 + Ops []TxOp + Sender PublicKey + Signature []byte + func NewTxBatch() *TxBatch + func (tx *TxBatch) Cost() *big.Int + func (tx *TxBatch) FromBytes(bs []byte) error + func (tx *TxBatch) GasWanted() int64 + func (tx *TxBatch) Hash() ethcmn.Hash + func (tx *TxBatch) SigHash() ethcmn.Hash + func (tx *TxBatch) Sign(privkey string) ([]byte, error) + func (tx *TxBatch) ToBytes() []byte + func (tx *TxBatch) Verify() bool + type TxEvm struct + Body TxEvmCommon + CreatedAt uint64 + GasLimit uint64 + GasPrice *big.Int + Nonce uint64 + Sender PublicKey + Signature []byte + func NewTxEvm() *TxEvm + func (tx *TxEvm) Cost() *big.Int + func (tx *TxEvm) FromBytes(bs []byte) error + func (tx *TxEvm) Hash() ethcmn.Hash + func (tx *TxEvm) SigHash() ethcmn.Hash + func (tx *TxEvm) Sign(privkey string) ([]byte, error) + func (tx *TxEvm) ToBytes() []byte + func (tx *TxEvm) Verify() bool + type TxEvmCommon struct + Load []byte + Memo []byte + To PublicKey + Value *big.Int + type TxOp struct + To PublicKey + Value *big.Int + type TxResult struct + Hash common.Hash + Ret []byte + Reversed []byte + func NewTxResult(ret []byte, hash common.Hash) *TxResult + func (tx *TxResult) FromBytes(bs []byte) error + func (tx TxResult) Copy() *TxResult + func (tx TxResult) ToBytes() []byte + type TxTag [TxTagLength]byte + func NewTxTag(tag []byte) TxTag + func (t TxTag) Bytes() []byte