Documentation ¶
Index ¶
- Constants
- Variables
- func RecoverPlain(sighash types.Hash, R, S, Vb *big.Int) (types.Address, error)
- type BuyCoinData
- type CreateCoinData
- type CreateMultisigData
- type Data
- type DeclareCandidacyData
- type DelegateData
- type RawData
- type RedeemCheckData
- type Response
- type SellAllCoinData
- type SellCoinData
- type SendData
- type SetCandidateOffData
- type SetCandidateOnData
- type Signature
- type SignatureMulti
- 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) SetMultisigAddress(address types.Address)
- func (tx *Transaction) SetSignature(sig []byte)
- func (tx *Transaction) Sign(prv *ecdsa.PrivateKey) error
- func (tx *Transaction) String() string
- type UnbondData
Constants ¶
View Source
const ( TypeSend byte = 0x01 TypeSellCoin byte = 0x02 TypeSellAllCoin byte = 0x03 TypeBuyCoin byte = 0x04 TypeCreateCoin byte = 0x05 TypeDeclareCandidacy byte = 0x06 TypeDelegate byte = 0x07 TypeUnbond byte = 0x08 TypeRedeemCheck byte = 0x09 TypeSetCandidateOnline byte = 0x0A TypeSetCandidateOffline byte = 0x0B TypeCreateMultisig byte = 0x0C SigTypeSingle byte = 0x01 SigTypeMulti byte = 0x02 )
Variables ¶
View Source
var (
CommissionMultiplier = big.NewInt(10e14)
)
View Source
var (
ErrInvalidSig = errors.New("invalid transaction v, r, s values")
)
Functions ¶
Types ¶
type BuyCoinData ¶ added in v0.0.6
type BuyCoinData struct { CoinToBuy types.CoinSymbol ValueToBuy *big.Int CoinToSell types.CoinSymbol }
func (BuyCoinData) Gas ¶ added in v0.0.6
func (data BuyCoinData) Gas() int64
func (BuyCoinData) MarshalJSON ¶ added in v0.0.6
func (data BuyCoinData) MarshalJSON() ([]byte, error)
func (BuyCoinData) String ¶ added in v0.0.6
func (data BuyCoinData) String() string
type CreateCoinData ¶
type CreateCoinData struct { Name string Symbol types.CoinSymbol InitialAmount *big.Int InitialReserve *big.Int ConstantReserveRatio uint }
func (CreateCoinData) Gas ¶ added in v0.0.6
func (data CreateCoinData) Gas() int64
func (CreateCoinData) MarshalJSON ¶
func (data CreateCoinData) MarshalJSON() ([]byte, error)
func (CreateCoinData) String ¶ added in v0.0.6
func (data CreateCoinData) String() string
type CreateMultisigData ¶ added in v0.5.0
func (CreateMultisigData) Gas ¶ added in v0.5.0
func (data CreateMultisigData) Gas() int64
func (CreateMultisigData) MarshalJSON ¶ added in v0.5.0
func (data CreateMultisigData) MarshalJSON() ([]byte, error)
func (CreateMultisigData) String ¶ added in v0.5.0
func (data CreateMultisigData) String() string
type DeclareCandidacyData ¶
type DeclareCandidacyData struct { Address types.Address PubKey []byte Commission uint Coin types.CoinSymbol Stake *big.Int }
func (DeclareCandidacyData) Gas ¶ added in v0.0.6
func (data DeclareCandidacyData) Gas() int64
func (DeclareCandidacyData) MarshalJSON ¶
func (data DeclareCandidacyData) MarshalJSON() ([]byte, error)
func (DeclareCandidacyData) String ¶ added in v0.0.6
func (data DeclareCandidacyData) String() string
type DelegateData ¶
type DelegateData struct { PubKey []byte Coin types.CoinSymbol Stake *big.Int }
func (DelegateData) Gas ¶ added in v0.0.6
func (data DelegateData) Gas() int64
func (DelegateData) MarshalJSON ¶
func (data DelegateData) MarshalJSON() ([]byte, error)
func (DelegateData) String ¶ added in v0.0.6
func (data DelegateData) String() string
type RedeemCheckData ¶
func (RedeemCheckData) Gas ¶ added in v0.0.6
func (data RedeemCheckData) Gas() int64
func (RedeemCheckData) MarshalJSON ¶
func (data RedeemCheckData) MarshalJSON() ([]byte, error)
func (RedeemCheckData) String ¶ added in v0.0.6
func (data RedeemCheckData) String() string
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"` }
type SellAllCoinData ¶ added in v0.1.2
type SellAllCoinData struct { CoinToSell types.CoinSymbol CoinToBuy types.CoinSymbol }
func (SellAllCoinData) Gas ¶ added in v0.1.2
func (data SellAllCoinData) Gas() int64
func (SellAllCoinData) MarshalJSON ¶ added in v0.1.2
func (data SellAllCoinData) MarshalJSON() ([]byte, error)
func (SellAllCoinData) String ¶ added in v0.1.2
func (data SellAllCoinData) String() string
type SellCoinData ¶ added in v0.0.6
type SellCoinData struct { CoinToSell types.CoinSymbol ValueToSell *big.Int CoinToBuy types.CoinSymbol }
func (SellCoinData) Gas ¶ added in v0.0.6
func (data SellCoinData) Gas() int64
func (SellCoinData) MarshalJSON ¶ added in v0.0.6
func (data SellCoinData) MarshalJSON() ([]byte, error)
func (SellCoinData) String ¶ added in v0.0.6
func (data SellCoinData) String() string
type SetCandidateOffData ¶
type SetCandidateOffData struct {
PubKey []byte
}
func (SetCandidateOffData) Gas ¶ added in v0.0.6
func (data SetCandidateOffData) Gas() int64
func (SetCandidateOffData) MarshalJSON ¶
func (data SetCandidateOffData) MarshalJSON() ([]byte, error)
func (SetCandidateOffData) String ¶ added in v0.0.6
func (data SetCandidateOffData) String() string
type SetCandidateOnData ¶
type SetCandidateOnData struct {
PubKey []byte
}
func (SetCandidateOnData) Gas ¶ added in v0.0.6
func (data SetCandidateOnData) Gas() int64
func (SetCandidateOnData) MarshalJSON ¶
func (data SetCandidateOnData) MarshalJSON() ([]byte, error)
func (SetCandidateOnData) String ¶ added in v0.0.6
func (data SetCandidateOnData) String() string
type SignatureMulti ¶ added in v0.5.0
type Transaction ¶
type Transaction struct { Nonce uint64 GasPrice *big.Int GasCoin types.CoinSymbol Type byte Data RawData Payload []byte ServiceData []byte SignatureType byte SignatureData []byte // contains filtered or unexported fields }
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) SetMultisigAddress ¶ added in v0.5.0
func (tx *Transaction) SetMultisigAddress(address types.Address)
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) Gas ¶ added in v0.0.6
func (data UnbondData) Gas() int64
func (UnbondData) MarshalJSON ¶
func (data UnbondData) MarshalJSON() ([]byte, error)
func (UnbondData) String ¶ added in v0.0.6
func (data UnbondData) String() string
Click to show internal directories.
Click to hide internal directories.