Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeError(data interface{}) string
- func RecoverPlain(sighash types.Hash, R, S, Vb *big.Int) (types.Address, error)
- type BuyCoinData
- type CandidateTx
- type Coin
- type CreateCoinData
- type CreateMultisigData
- type Data
- type DeclareCandidacyData
- func (data DeclareCandidacyData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
- func (data DeclareCandidacyData) Gas() int64
- func (data DeclareCandidacyData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, ...) Response
- func (data DeclareCandidacyData) String() string
- type Decoder
- type DelegateData
- type EditCandidateData
- func (data EditCandidateData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
- func (data EditCandidateData) Gas() int64
- func (data EditCandidateData) GetPubKey() types.Pubkey
- func (data EditCandidateData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, ...) Response
- func (data EditCandidateData) String() string
- type EditCandidatePublicKeyData
- func (data EditCandidatePublicKeyData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
- func (data EditCandidatePublicKeyData) Gas() int64
- func (data EditCandidatePublicKeyData) GetPubKey() types.Pubkey
- func (data EditCandidatePublicKeyData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, ...) Response
- func (data EditCandidatePublicKeyData) String() string
- type EditCoinOwnerData
- type EditMultisigData
- type MultisendData
- type MultisendDataItem
- type PriceVoteData
- type RawData
- type RecreateCoinData
- type RedeemCheckData
- type Response
- type SellAllCoinData
- type SellCoinData
- type SendData
- type SetCandidateOffData
- func (data SetCandidateOffData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
- func (data SetCandidateOffData) Gas() int64
- func (data SetCandidateOffData) GetPubKey() types.Pubkey
- func (data SetCandidateOffData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, ...) Response
- func (data SetCandidateOffData) String() string
- type SetCandidateOnData
- func (data SetCandidateOnData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
- func (data SetCandidateOnData) Gas() int64
- func (data SetCandidateOnData) GetPubKey() types.Pubkey
- func (data SetCandidateOnData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, ...) Response
- func (data SetCandidateOnData) String() string
- type SetHaltBlockData
- func (data SetHaltBlockData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
- func (data SetHaltBlockData) Gas() int64
- func (data SetHaltBlockData) GetPubKey() types.Pubkey
- func (data SetHaltBlockData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, ...) Response
- func (data SetHaltBlockData) String() string
- type SigType
- type Signature
- type SignatureMulti
- type TotalSpends
- type Transaction
- 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
- type UnbondData
Constants ¶
View Source
const ( TypeSend TxType = 0x01 TypeSellCoin TxType = 0x02 TypeSellAllCoin TxType = 0x03 TypeBuyCoin TxType = 0x04 TypeCreateCoin TxType = 0x05 TypeDeclareCandidacy TxType = 0x06 TypeDelegate TxType = 0x07 TypeUnbond TxType = 0x08 TypeRedeemCheck TxType = 0x09 TypeSetCandidateOnline TxType = 0x0A TypeSetCandidateOffline TxType = 0x0B TypeCreateMultisig TxType = 0x0C TypeMultisend TxType = 0x0D TypeEditCandidate TxType = 0x0E TypeSetHaltBlock TxType = 0x0F TypeRecreateCoin TxType = 0x10 TypeEditCoinOwner TxType = 0x11 TypeEditMultisig TxType = 0x12 TypePriceVote TxType = 0x13 TypeEditCandidatePublicKey TxType = 0x14 SigTypeSingle SigType = 0x01 SigTypeMulti SigType = 0x02 )
Variables ¶
View Source
var (
CommissionMultiplier = big.NewInt(10e14)
)
View Source
var (
ErrInvalidSig = errors.New("invalid transaction v, r, s values")
)
View Source
var TxDecoder = Decoder{ // contains filtered or unexported fields }
Functions ¶
func EncodeError ¶ added in v1.1.0
func EncodeError(data interface{}) string
EncodeError encodes error to json
Types ¶
type BuyCoinData ¶ added in v0.0.6
type BuyCoinData struct { CoinToBuy types.CoinID ValueToBuy *big.Int CoinToSell types.CoinID MaximumValueToSell *big.Int }
func (BuyCoinData) BasicCheck ¶ added in v0.8.0
func (data BuyCoinData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (BuyCoinData) Gas ¶ added in v0.0.6
func (data BuyCoinData) Gas() int64
func (BuyCoinData) Run ¶ added in v0.0.6
func (data BuyCoinData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (BuyCoinData) String ¶ added in v0.0.6
func (data BuyCoinData) String() string
type CandidateTx ¶ added in v0.14.0
type CreateCoinData ¶
type CreateCoinData struct { Name string Symbol types.CoinSymbol InitialAmount *big.Int InitialReserve *big.Int ConstantReserveRatio uint32 MaxSupply *big.Int }
func (CreateCoinData) BasicCheck ¶ added in v0.8.0
func (data CreateCoinData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (CreateCoinData) Gas ¶ added in v0.0.6
func (data CreateCoinData) Gas() int64
func (CreateCoinData) Run ¶ added in v0.0.6
func (data CreateCoinData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (CreateCoinData) String ¶ added in v0.0.6
func (data CreateCoinData) String() string
type CreateMultisigData ¶ added in v0.5.0
func (CreateMultisigData) BasicCheck ¶ added in v0.8.0
func (data CreateMultisigData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (CreateMultisigData) Gas ¶ added in v0.5.0
func (data CreateMultisigData) Gas() int64
func (CreateMultisigData) Run ¶ added in v0.5.0
func (data CreateMultisigData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (CreateMultisigData) String ¶ added in v0.5.0
func (data CreateMultisigData) String() string
type DeclareCandidacyData ¶
type DeclareCandidacyData struct { Address types.Address PubKey types.Pubkey Commission uint32 Coin types.CoinID Stake *big.Int }
func (DeclareCandidacyData) BasicCheck ¶ added in v0.8.0
func (data DeclareCandidacyData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (DeclareCandidacyData) Gas ¶ added in v0.0.6
func (data DeclareCandidacyData) Gas() int64
func (DeclareCandidacyData) Run ¶ added in v0.0.6
func (data DeclareCandidacyData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (DeclareCandidacyData) String ¶ added in v0.0.6
func (data DeclareCandidacyData) String() string
type Decoder ¶ added in v0.9.0
type Decoder struct {
// contains filtered or unexported fields
}
func (*Decoder) DecodeFromBytes ¶ added in v0.9.0
func (decoder *Decoder) DecodeFromBytes(buf []byte) (*Transaction, error)
func (*Decoder) DecodeFromBytesWithoutSig ¶ added in v1.1.0
func (decoder *Decoder) DecodeFromBytesWithoutSig(buf []byte) (*Transaction, error)
func (*Decoder) RegisterType ¶ added in v0.9.0
type DelegateData ¶
func (DelegateData) BasicCheck ¶ added in v0.8.0
func (data DelegateData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (DelegateData) Gas ¶ added in v0.0.6
func (data DelegateData) Gas() int64
func (DelegateData) Run ¶ added in v0.0.6
func (data DelegateData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (DelegateData) String ¶ added in v0.0.6
func (data DelegateData) String() string
type EditCandidateData ¶ added in v0.10.0
type EditCandidateData struct { PubKey types.Pubkey RewardAddress types.Address OwnerAddress types.Address ControlAddress types.Address }
func (EditCandidateData) BasicCheck ¶ added in v0.10.0
func (data EditCandidateData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (EditCandidateData) Gas ¶ added in v0.10.0
func (data EditCandidateData) Gas() int64
func (EditCandidateData) GetPubKey ¶ added in v0.14.0
func (data EditCandidateData) GetPubKey() types.Pubkey
func (EditCandidateData) Run ¶ added in v0.10.0
func (data EditCandidateData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (EditCandidateData) String ¶ added in v0.10.0
func (data EditCandidateData) String() string
type EditCandidatePublicKeyData ¶ added in v1.2.0
func (EditCandidatePublicKeyData) BasicCheck ¶ added in v1.2.0
func (data EditCandidatePublicKeyData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (EditCandidatePublicKeyData) Gas ¶ added in v1.2.0
func (data EditCandidatePublicKeyData) Gas() int64
func (EditCandidatePublicKeyData) GetPubKey ¶ added in v1.2.0
func (data EditCandidatePublicKeyData) GetPubKey() types.Pubkey
func (EditCandidatePublicKeyData) Run ¶ added in v1.2.0
func (data EditCandidatePublicKeyData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (EditCandidatePublicKeyData) String ¶ added in v1.2.0
func (data EditCandidatePublicKeyData) String() string
type EditCoinOwnerData ¶ added in v1.2.0
type EditCoinOwnerData struct { Symbol types.CoinSymbol NewOwner types.Address }
func (EditCoinOwnerData) BasicCheck ¶ added in v1.2.0
func (data EditCoinOwnerData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (EditCoinOwnerData) Gas ¶ added in v1.2.0
func (data EditCoinOwnerData) Gas() int64
func (EditCoinOwnerData) Run ¶ added in v1.2.0
func (data EditCoinOwnerData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (EditCoinOwnerData) String ¶ added in v1.2.0
func (data EditCoinOwnerData) String() string
type EditMultisigData ¶ added in v1.2.0
func (EditMultisigData) BasicCheck ¶ added in v1.2.0
func (data EditMultisigData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (EditMultisigData) Gas ¶ added in v1.2.0
func (data EditMultisigData) Gas() int64
func (EditMultisigData) Run ¶ added in v1.2.0
func (data EditMultisigData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (EditMultisigData) String ¶ added in v1.2.0
func (data EditMultisigData) String() string
type MultisendData ¶ added in v0.7.0
type MultisendData struct {
List []MultisendDataItem `json:"list"`
}
func (MultisendData) BasicCheck ¶ added in v0.8.0
func (data MultisendData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (MultisendData) Gas ¶ added in v0.7.0
func (data MultisendData) Gas() int64
func (MultisendData) Run ¶ added in v0.7.0
func (data MultisendData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (MultisendData) String ¶ added in v0.7.0
func (data MultisendData) String() string
type MultisendDataItem ¶ added in v0.7.0
func (MultisendDataItem) MarshalJSON ¶ added in v1.1.0
func (item MultisendDataItem) MarshalJSON() ([]byte, error)
type PriceVoteData ¶ added in v1.2.0
type PriceVoteData struct {
Price uint
}
func (PriceVoteData) BasicCheck ¶ added in v1.2.0
func (data PriceVoteData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (PriceVoteData) Gas ¶ added in v1.2.0
func (data PriceVoteData) Gas() int64
func (PriceVoteData) Run ¶ added in v1.2.0
func (data PriceVoteData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (PriceVoteData) String ¶ added in v1.2.0
func (data PriceVoteData) String() string
type RecreateCoinData ¶ added in v1.2.0
type RecreateCoinData struct { Name string Symbol types.CoinSymbol InitialAmount *big.Int InitialReserve *big.Int ConstantReserveRatio uint32 MaxSupply *big.Int }
func (RecreateCoinData) BasicCheck ¶ added in v1.2.0
func (data RecreateCoinData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (RecreateCoinData) Gas ¶ added in v1.2.0
func (data RecreateCoinData) Gas() int64
func (RecreateCoinData) Run ¶ added in v1.2.0
func (data RecreateCoinData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (RecreateCoinData) String ¶ added in v1.2.0
func (data RecreateCoinData) String() string
type RedeemCheckData ¶
func (RedeemCheckData) BasicCheck ¶ added in v0.8.0
func (data RedeemCheckData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (RedeemCheckData) Gas ¶ added in v0.0.6
func (data RedeemCheckData) Gas() int64
func (RedeemCheckData) Run ¶ added in v0.0.6
func (data RedeemCheckData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (RedeemCheckData) String ¶ added in v0.0.6
func (data RedeemCheckData) String() string
type Response ¶
type Response struct { Code uint32 `json:"code,omitempty"` Data []byte `json:"data,omitempty"` Log string `json:"log,omitempty"` Info string `json:"-"` GasWanted int64 `json:"gas_wanted,omitempty"` GasUsed int64 `json:"gas_used,omitempty"` Tags []kv.Pair `json:"tags,omitempty"` GasPrice uint32 `json:"gas_price"` }
Response represents standard response from tx delivery/check
func CheckForCoinSupplyOverflow ¶ added in v0.8.0
func CheckReserveUnderflow ¶ added in v1.1.0
type SellAllCoinData ¶ added in v0.1.2
type SellAllCoinData struct { CoinToSell types.CoinID CoinToBuy types.CoinID MinimumValueToBuy *big.Int }
func (SellAllCoinData) BasicCheck ¶ added in v0.8.0
func (data SellAllCoinData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (SellAllCoinData) Gas ¶ added in v0.1.2
func (data SellAllCoinData) Gas() int64
func (SellAllCoinData) Run ¶ added in v0.1.2
func (data SellAllCoinData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
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.CoinID ValueToSell *big.Int CoinToBuy types.CoinID MinimumValueToBuy *big.Int }
func (SellCoinData) BasicCheck ¶ added in v0.8.0
func (data SellCoinData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (SellCoinData) Gas ¶ added in v0.0.6
func (data SellCoinData) Gas() int64
func (SellCoinData) Run ¶ added in v0.0.6
func (data SellCoinData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (SellCoinData) String ¶ added in v0.0.6
func (data SellCoinData) String() string
type SendData ¶
func (SendData) BasicCheck ¶ added in v0.8.0
func (data SendData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
type SetCandidateOffData ¶
func (SetCandidateOffData) BasicCheck ¶ added in v0.8.0
func (data SetCandidateOffData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (SetCandidateOffData) Gas ¶ added in v0.0.6
func (data SetCandidateOffData) Gas() int64
func (SetCandidateOffData) GetPubKey ¶ added in v0.14.0
func (data SetCandidateOffData) GetPubKey() types.Pubkey
func (SetCandidateOffData) Run ¶ added in v0.0.6
func (data SetCandidateOffData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (SetCandidateOffData) String ¶ added in v0.0.6
func (data SetCandidateOffData) String() string
type SetCandidateOnData ¶
func (SetCandidateOnData) BasicCheck ¶ added in v0.8.0
func (data SetCandidateOnData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (SetCandidateOnData) Gas ¶ added in v0.0.6
func (data SetCandidateOnData) Gas() int64
func (SetCandidateOnData) GetPubKey ¶ added in v0.14.0
func (data SetCandidateOnData) GetPubKey() types.Pubkey
func (SetCandidateOnData) Run ¶ added in v0.0.6
func (data SetCandidateOnData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (SetCandidateOnData) String ¶ added in v0.0.6
func (data SetCandidateOnData) String() string
type SetHaltBlockData ¶ added in v1.2.0
func (SetHaltBlockData) BasicCheck ¶ added in v1.2.0
func (data SetHaltBlockData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (SetHaltBlockData) Gas ¶ added in v1.2.0
func (data SetHaltBlockData) Gas() int64
func (SetHaltBlockData) GetPubKey ¶ added in v1.2.0
func (data SetHaltBlockData) GetPubKey() types.Pubkey
func (SetHaltBlockData) Run ¶ added in v1.2.0
func (data SetHaltBlockData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (SetHaltBlockData) String ¶ added in v1.2.0
func (data SetHaltBlockData) String() string
type SignatureMulti ¶ added in v0.5.0
type TotalSpends ¶ added in v0.8.0
type TotalSpends []totalSpend
type Transaction ¶
type Transaction struct { Nonce uint64 ChainID types.ChainID GasPrice uint32 GasCoin types.CoinID Type TxType Data RawData Payload []byte ServiceData []byte SignatureType SigType SignatureData []byte // contains filtered or unexported fields }
func DecodeSig ¶ added in v1.1.0
func DecodeSig(tx *Transaction) (*Transaction, error)
func (*Transaction) CommissionInBaseCoin ¶ added in v0.8.0
func (tx *Transaction) CommissionInBaseCoin() *big.Int
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 TxType ¶ added in v0.9.0
type TxType byte
TxType of transaction is determined by a single byte.
type UnbondData ¶
func (UnbondData) BasicCheck ¶ added in v0.8.0
func (data UnbondData) BasicCheck(tx *Transaction, context *state.CheckState) *Response
func (UnbondData) Gas ¶ added in v0.0.6
func (data UnbondData) Gas() int64
func (UnbondData) Run ¶ added in v0.0.6
func (data UnbondData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64) Response
func (UnbondData) String ¶ added in v0.0.6
func (data UnbondData) String() string
Source Files ¶
- buy_coin.go
- create_coin.go
- create_multisig.go
- declare_candidacy.go
- decoder.go
- delegate.go
- edit_candidate.go
- edit_candidate_public_key.go
- edit_coin_owner.go
- edit_multisig.go
- executor.go
- multisend.go
- price_vote.go
- recreate_coin.go
- redeem_check.go
- sell_all_coin.go
- sell_coin.go
- send.go
- set_halt_block.go
- switch_candidate_status.go
- transaction.go
- unbond.go
Click to show internal directories.
Click to hide internal directories.