Documentation ¶
Index ¶
- Constants
- Variables
- type ConvertData
- type CreateCoinData
- type Data
- type DeclareCandidacyData
- type DelegateData
- type RawData
- type RedeemCheckData
- type Response
- type SendData
- type SetCandidateOffData
- type SetCandidateOnData
- type Transaction
- func (tx *Transaction) Gas() int64
- func (tx *Transaction) GetDecodedData() Data
- func (tx *Transaction) Hash() types.Hash
- func (tx *Transaction) Sender() (types.Address, error)
- func (tx *Transaction) Serialize() ([]byte, error)
- func (tx *Transaction) SetDecodedData(data Data)
- func (tx *Transaction) SetSignature(sig []byte)
- func (tx *Transaction) Sign(prv *ecdsa.PrivateKey) error
- func (tx *Transaction) String() string
- type UnbondData
Constants ¶
Variables ¶
View Source
var (
CommissionMultiplier = big.NewInt(10e8)
)
View Source
var (
ErrInvalidSig = errors.New("invalid transaction v, r, s values")
)
Functions ¶
This section is empty.
Types ¶
type ConvertData ¶
type ConvertData struct { FromCoinSymbol types.CoinSymbol ToCoinSymbol types.CoinSymbol Value *big.Int }
func (ConvertData) MarshalJSON ¶
func (s ConvertData) MarshalJSON() ([]byte, error)
type CreateCoinData ¶
type CreateCoinData struct { Name string Symbol types.CoinSymbol InitialAmount *big.Int InitialReserve *big.Int ConstantReserveRatio uint }
func (CreateCoinData) MarshalJSON ¶
func (s CreateCoinData) MarshalJSON() ([]byte, error)
type DeclareCandidacyData ¶
type DeclareCandidacyData struct { Address types.Address PubKey []byte Commission uint Coin types.CoinSymbol Stake *big.Int }
func (DeclareCandidacyData) MarshalJSON ¶
func (s DeclareCandidacyData) MarshalJSON() ([]byte, error)
type DelegateData ¶
type DelegateData struct { PubKey []byte Coin types.CoinSymbol Stake *big.Int }
func (DelegateData) MarshalJSON ¶
func (s DelegateData) MarshalJSON() ([]byte, error)
type RedeemCheckData ¶
func (RedeemCheckData) MarshalJSON ¶
func (s RedeemCheckData) MarshalJSON() ([]byte, error)
type Response ¶
type Response struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` Tags []common.KVPair `protobuf:"bytes,7,rep,name=tags" json:"tags,omitempty"` Fee common.KI64Pair `protobuf:"bytes,8,opt,name=fee" json:"fee"` }
type SendData ¶
func (SendData) MarshalJSON ¶
type SetCandidateOffData ¶
type SetCandidateOffData struct {
PubKey []byte
}
func (SetCandidateOffData) MarshalJSON ¶
func (s SetCandidateOffData) MarshalJSON() ([]byte, error)
type SetCandidateOnData ¶
type SetCandidateOnData struct {
PubKey []byte
}
func (SetCandidateOnData) MarshalJSON ¶
func (s SetCandidateOnData) MarshalJSON() ([]byte, error)
type Transaction ¶
type Transaction struct { Nonce uint64 GasPrice *big.Int Type byte Data RawData Payload []byte ServiceData []byte V *big.Int R *big.Int S *big.Int // contains filtered or unexported fields }
TODO: refactor, get rid of switch cases
func DecodeFromBytes ¶
func DecodeFromBytes(buf []byte) (*Transaction, error)
func (*Transaction) Gas ¶
func (tx *Transaction) Gas() int64
func (*Transaction) GetDecodedData ¶
func (tx *Transaction) GetDecodedData() Data
func (*Transaction) Hash ¶
func (tx *Transaction) Hash() types.Hash
func (*Transaction) Serialize ¶
func (tx *Transaction) Serialize() ([]byte, error)
func (*Transaction) SetDecodedData ¶
func (tx *Transaction) SetDecodedData(data Data)
func (*Transaction) SetSignature ¶
func (tx *Transaction) SetSignature(sig []byte)
func (*Transaction) Sign ¶
func (tx *Transaction) Sign(prv *ecdsa.PrivateKey) error
func (*Transaction) String ¶
func (tx *Transaction) String() string
type UnbondData ¶
type UnbondData struct { PubKey []byte Coin types.CoinSymbol Value *big.Int }
func (UnbondData) MarshalJSON ¶
func (s UnbondData) MarshalJSON() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.