Versions in this module Expand all Collapse all v1 v1.0.5 Jan 22, 2020 Changes in this version + const SigTypeMulti + const SigTypeSingle + const TypeBuyCoin + const TypeCreateCoin + const TypeCreateMultisig + const TypeDeclareCandidacy + const TypeDelegate + const TypeEditCandidate + const TypeMultisend + const TypeRedeemCheck + const TypeSellAllCoin + const TypeSellCoin + const TypeSend + const TypeSetCandidateOffline + const TypeSetCandidateOnline + const TypeUnbond + var CommissionMultiplier = big.NewInt(10e14) + var ErrInvalidSig = errors.New("invalid transaction v, r, s values") + var MaxCoinSupply = big.NewInt(0).Exp(big.NewInt(10), big.NewInt(15 + 18), nil) + var TxDecoder = Decoder + func CheckForCoinSupplyOverflow(current *big.Int, delta *big.Int) error + func RecoverPlain(sighash types.Hash, R, S, Vb *big.Int) (types.Address, error) + type BuyCoinData struct + CoinToBuy types.CoinSymbol + CoinToSell types.CoinSymbol + MaximumValueToSell *big.Int + ValueToBuy *big.Int + func (data BuyCoinData) BasicCheck(tx *Transaction, context *state.StateDB) *Response + func (data BuyCoinData) Gas() int64 + func (data BuyCoinData) Run(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + func (data BuyCoinData) String() string + func (data BuyCoinData) TotalSpend(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response) + type CandidateTx interface + GetPubKey func() types.Pubkey + type Conversion struct + FromAmount *big.Int + FromCoin types.CoinSymbol + FromReserve *big.Int + ToAmount *big.Int + ToCoin types.CoinSymbol + ToReserve *big.Int + type CreateCoinData struct + ConstantReserveRatio uint + InitialAmount *big.Int + InitialReserve *big.Int + Name string + Symbol types.CoinSymbol + func (data CreateCoinData) BasicCheck(tx *Transaction, context *state.StateDB) *Response + func (data CreateCoinData) Gas() int64 + func (data CreateCoinData) Run(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + func (data CreateCoinData) String() string + func (data CreateCoinData) TotalSpend(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response) + type CreateMultisigData struct + Addresses []types.Address + Threshold uint + Weights []uint + func (data CreateMultisigData) BasicCheck(tx *Transaction, context *state.StateDB) *Response + func (data CreateMultisigData) Gas() int64 + func (data CreateMultisigData) Run(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + func (data CreateMultisigData) String() string + func (data CreateMultisigData) TotalSpend(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response) + type Data interface + BasicCheck func(tx *Transaction, context *state.StateDB) *Response + Gas func() int64 + Run func(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + String func() string + TotalSpend func(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response) + type DeclareCandidacyData struct + Address types.Address + Coin types.CoinSymbol + Commission uint + PubKey types.Pubkey + Stake *big.Int + func (data DeclareCandidacyData) BasicCheck(tx *Transaction, context *state.StateDB) *Response + func (data DeclareCandidacyData) Gas() int64 + func (data DeclareCandidacyData) Run(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + func (data DeclareCandidacyData) String() string + func (data DeclareCandidacyData) TotalSpend(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response) + type Decoder struct + func (decoder *Decoder) DecodeFromBytes(buf []byte) (*Transaction, error) + func (decoder *Decoder) RegisterType(t TxType, d Data) + type DelegateData struct + Coin types.CoinSymbol + PubKey types.Pubkey + Value *big.Int + func (data DelegateData) BasicCheck(tx *Transaction, context *state.StateDB) *Response + func (data DelegateData) Gas() int64 + func (data DelegateData) Run(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + func (data DelegateData) String() string + func (data DelegateData) TotalSpend(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response) + type EditCandidateData struct + OwnerAddress types.Address + PubKey types.Pubkey + RewardAddress types.Address + func (data EditCandidateData) BasicCheck(tx *Transaction, context *state.StateDB) *Response + func (data EditCandidateData) Gas() int64 + func (data EditCandidateData) GetPubKey() types.Pubkey + func (data EditCandidateData) Run(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + func (data EditCandidateData) String() string + func (data EditCandidateData) TotalSpend(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response) + type MultisendData struct + List []MultisendDataItem + func (data MultisendData) BasicCheck(tx *Transaction, context *state.StateDB) *Response + func (data MultisendData) Gas() int64 + func (data MultisendData) Run(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + func (data MultisendData) String() string + func (data MultisendData) TotalSpend(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response) + type MultisendDataItem struct + Coin types.CoinSymbol + To types.Address + Value *big.Int + type RawData []byte + type RedeemCheckData struct + Proof [65]byte + RawCheck []byte + func (data RedeemCheckData) BasicCheck(tx *Transaction, context *state.StateDB) *Response + func (data RedeemCheckData) CommissionInBaseCoin(tx *Transaction) *big.Int + func (data RedeemCheckData) Gas() int64 + func (data RedeemCheckData) Run(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + func (data RedeemCheckData) String() string + func (data RedeemCheckData) TotalSpend(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response) + type Response struct + Code uint32 + Data []byte + GasPrice uint32 + GasUsed int64 + GasWanted int64 + Info string + Log string + Tags []common.KVPair + func RunTx(context *state.StateDB, isCheck bool, rawTx []byte, rewardPool *big.Int, ...) Response + type SellAllCoinData struct + CoinToBuy types.CoinSymbol + CoinToSell types.CoinSymbol + MinimumValueToBuy *big.Int + func (data SellAllCoinData) BasicCheck(tx *Transaction, context *state.StateDB) *Response + func (data SellAllCoinData) Gas() int64 + func (data SellAllCoinData) Run(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + func (data SellAllCoinData) String() string + func (data SellAllCoinData) TotalSpend(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response) + type SellCoinData struct + CoinToBuy types.CoinSymbol + CoinToSell types.CoinSymbol + MinimumValueToBuy *big.Int + ValueToSell *big.Int + func (data SellCoinData) BasicCheck(tx *Transaction, context *state.StateDB) *Response + func (data SellCoinData) Gas() int64 + func (data SellCoinData) Run(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + func (data SellCoinData) String() string + func (data SellCoinData) TotalSpend(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response) + type SendData struct + Coin types.CoinSymbol + To types.Address + Value *big.Int + func (data SendData) BasicCheck(tx *Transaction, context *state.StateDB) *Response + func (data SendData) Gas() int64 + func (data SendData) Run(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + func (data SendData) String() string + func (data SendData) TotalSpend(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response) + type SetCandidateOffData struct + PubKey types.Pubkey + func (data SetCandidateOffData) BasicCheck(tx *Transaction, context *state.StateDB) *Response + func (data SetCandidateOffData) Gas() int64 + func (data SetCandidateOffData) GetPubKey() types.Pubkey + func (data SetCandidateOffData) Run(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + func (data SetCandidateOffData) String() string + func (data SetCandidateOffData) TotalSpend(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response) + type SetCandidateOnData struct + PubKey types.Pubkey + func (data SetCandidateOnData) BasicCheck(tx *Transaction, context *state.StateDB) *Response + func (data SetCandidateOnData) Gas() int64 + func (data SetCandidateOnData) GetPubKey() types.Pubkey + func (data SetCandidateOnData) Run(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + func (data SetCandidateOnData) String() string + func (data SetCandidateOnData) TotalSpend(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response) + type SigType byte + type Signature struct + R *big.Int + S *big.Int + V *big.Int + type SignatureMulti struct + Multisig types.Address + Signatures []Signature + type TotalSpend struct + Coin types.CoinSymbol + Value *big.Int + type TotalSpends []TotalSpend + func (tss *TotalSpends) Add(coin types.CoinSymbol, value *big.Int) + type Transaction struct + ChainID types.ChainID + Data RawData + GasCoin types.CoinSymbol + GasPrice uint32 + Nonce uint64 + Payload []byte + ServiceData []byte + SignatureData []byte + SignatureType SigType + Type TxType + func (tx *Transaction) CommissionInBaseCoin() *big.Int + 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) SetMultisigAddress(address types.Address) + func (tx *Transaction) SetSignature(sig []byte) + func (tx *Transaction) Sign(prv *ecdsa.PrivateKey) error + func (tx *Transaction) String() string + type TxType byte + type UnbondData struct + Coin types.CoinSymbol + PubKey types.Pubkey + Value *big.Int + func (data UnbondData) BasicCheck(tx *Transaction, context *state.StateDB) *Response + func (data UnbondData) Gas() int64 + func (data UnbondData) Run(tx *Transaction, context *state.StateDB, isCheck bool, rewardPool *big.Int, ...) Response + func (data UnbondData) String() string + func (data UnbondData) TotalSpend(tx *Transaction, context *state.StateDB) (TotalSpends, []Conversion, *big.Int, *Response)