Documentation ¶
Index ¶
- Constants
- func AuthMnemonic(seedPhr string) (string, string, error)
- func GetAddressPrivateKey(privateKey string) (string, error)
- func GetBaseCoin() string
- func GetVAddressPubKey(pubkey string) string
- func NewMnemonic() string
- type AddrssResponse
- type BlockEvResponse
- type BlockEventsResponse
- type BlockResponse
- type BlockValidatorsResponse
- type CandidateInfo
- type CoinInfoResponse
- type CoinSymbol
- type ErrorStruct
- type ErrorTxResult
- type EstimateResponse
- type EventValueData
- type ResultNetwork
- type SDK
- func (c *SDK) DebugLog(status string, msg string, body interface{})
- func (c *SDK) EstimateCoinBuy(coinBuy string, coinSell string, valueBuy int64) (EstimateResponse, error)
- func (c *SDK) EstimateCoinSell(coinSell string, coinBuy string, valueSell int64) (EstimateResponse, error)
- func (c *SDK) EstimateTxCommission(tx string) (float32, error)
- func (c *SDK) GetAddress(usrAddr string) (map[string]float32, uint32, error)
- func (c *SDK) GetBlock(id int) (BlockResponse, error)
- func (c *SDK) GetCandidate(candidateHash string) (CandidateInfo, error)
- func (c *SDK) GetCandidates() ([]CandidateInfo, error)
- func (c *SDK) GetCoinInfo(coinSmbl string) (CoinInfoResponse, error)
- func (c *SDK) GetEvents(id int) (BlockEvResponse, error)
- func (c *SDK) GetMinGas() (int64, error)
- func (c *SDK) GetStatus() (ResultNetwork, error)
- func (c *SDK) GetTransaction(hash string) (TransResponse, error)
- func (c *SDK) GetValidators() ([]result_valid, error)
- func (c *SDK) GetValidatorsBlock(blockN int) ([]result_valid, error)
- func (c *SDK) SetTransaction(strRlpEnc string) (string, error)
- func (c *SDK) TxBuyCoin(t *TxBuyCoinData) (string, error)
- func (c *SDK) TxBuyCoinRLP(t *TxBuyCoinData) (string, error)
- func (c *SDK) TxCreateCheck(t *TxCreateCkeckData) (string, error)
- func (c *SDK) TxCreateCoin(t *TxCreateCoinData) (string, error)
- func (c *SDK) TxCreateCoinRLP(t *TxCreateCoinData) (string, error)
- func (c *SDK) TxDeclareCandidacy(t *TxDeclareCandidacyData) (string, error)
- func (c *SDK) TxDeclareCandidacyRLP(t *TxDeclareCandidacyData) (string, error)
- func (c *SDK) TxDelegate(t *TxDelegateData) (string, error)
- func (c *SDK) TxDelegateRLP(t *TxDelegateData) (string, error)
- func (c *SDK) TxEditCandidate(t *TxEditCandidateData) (string, error)
- func (c *SDK) TxEditCandidateRLP(t *TxEditCandidateData) (string, error)
- func (c *SDK) TxMultiSendCoin(t *TxMultiSendCoinData) (string, error)
- func (c *SDK) TxMultiSendCoinRLP(t *TxMultiSendCoinData) (string, error)
- func (c *SDK) TxRedeemCheck(t *TxRedeemCheckData) (string, error)
- func (c *SDK) TxRedeemCheckRLP(t *TxRedeemCheckData) (string, error)
- func (c *SDK) TxSellAllCoin(t *TxSellAllCoinData) (string, error)
- func (c *SDK) TxSellAllCoinRLP(t *TxSellAllCoinData) (string, error)
- func (c *SDK) TxSellCoin(t *TxSellCoinData) (string, error)
- func (c *SDK) TxSellCoinRLP(t *TxSellCoinData) (string, error)
- func (c *SDK) TxSendCoin(t *TxSendCoinData) (string, error)
- func (c *SDK) TxSendCoinRLP(t *TxSendCoinData) (string, error)
- func (c *SDK) TxSetCandidate(t *TxSetCandidateData) (string, error)
- func (c *SDK) TxSetCandidateRLP(t *TxSetCandidateData) (string, error)
- func (c *SDK) TxUnbond(t *TxUnbondData) (string, error)
- func (c *SDK) TxUnbondRLP(t *TxUnbondData) (string, error)
- type SendOneData
- type TransData
- type TransResponse
- type TransSendResponse
- type TxBuyCoinData
- type TxCreateCkeckData
- type TxCreateCoinData
- type TxDeclareCandidacyData
- type TxDelegateData
- type TxEditCandidateData
- type TxMultiSendCoinData
- type TxOneSendCoinData
- type TxRedeemCheckData
- type TxSellAllCoinData
- type TxSellCoinData
- type TxSendCoinData
- type TxSetCandidateData
- type TxUnbondData
Constants ¶
const ( TX_SendData int = iota + 1 //1 TX_SellCoinData //2 TX_SellAllCoinData //3 TX_BuyCoinData //4 TX_CreateCoinData //5 TX_DeclareCandidacyData //6 TX_DelegateDate //7 TX_UnbondData //8 TX_RedeemCheckData //9 TX_SetCandidateOnData //10 TX_SetCandidateOffData //11 TX_CreateMultisigData //12 TX_MultisendData //13 TX_EditCandidateData //14 )
const (
CoinSymbolLength = 10
)
Variables ¶
This section is empty.
Functions ¶
func AuthMnemonic ¶
Авторизация по Seed-фразе
func GetAddressPrivateKey ¶
Получение адреса по приватному ключу
func GetVAddressPubKey ¶
Получение адреса валидатора по открытому ключу
Types ¶
type AddrssResponse ¶
type AddrssResponse struct { Balance map[string]string `json:"balance" bson:"balance" gorm:"balance" db:"balance"` TransactionCountTx string `json:"transaction_count" bson:"-" gorm:"-" db:"-"` }
func (AddrssResponse) MarshalEasyJSON ¶
func (v AddrssResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AddrssResponse) MarshalJSON ¶
func (v AddrssResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AddrssResponse) UnmarshalEasyJSON ¶
func (v *AddrssResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AddrssResponse) UnmarshalJSON ¶
func (v *AddrssResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type BlockEvResponse ¶
type BlockEvResponse struct {
Events []BlockEventsResponse `json:"events" bson:"events" gorm:"events" db:"events"`
}
func (BlockEvResponse) MarshalEasyJSON ¶
func (v BlockEvResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (BlockEvResponse) MarshalJSON ¶
func (v BlockEvResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*BlockEvResponse) UnmarshalEasyJSON ¶
func (v *BlockEvResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BlockEvResponse) UnmarshalJSON ¶
func (v *BlockEvResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type BlockEventsResponse ¶
type BlockEventsResponse struct { Type string `json:"type" bson:"type" gorm:"type" db:"type"` Value EventValueData `json:"value" bson:"value" gorm:"value" db:"value"` }
func (BlockEventsResponse) MarshalEasyJSON ¶
func (v BlockEventsResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (BlockEventsResponse) MarshalJSON ¶
func (v BlockEventsResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*BlockEventsResponse) UnmarshalEasyJSON ¶
func (v *BlockEventsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BlockEventsResponse) UnmarshalJSON ¶
func (v *BlockEventsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type BlockResponse ¶
type BlockResponse struct { Hash string `json:"hash" bson:"hash" gorm:"hash" db:"hash"` HeightTx string `json:"height" bson:"-" gorm:"-" db:"-"` Height int `json:"height_i32" bson:"height_i32" gorm:"height_i32" db:"height_i32"` Time time.Time `json:"time" bson:"time" gorm:"time" db:"time"` NumTxsTx string `json:"num_txs" bson:"-" gorm:"-" db:"-"` NumTxs int `json:"num_txs_i32" bson:"num_txs_i32" gorm:"num_txs_i32" db:"num_txs_i32"` TotalTxsTx string `json:"total_txs" bson:"-" gorm:"-" db:"-"` TotalTxs int `json:"total_txs_i32" bson:"total_txs_i32" gorm:"total_txs_i32" db:"total_txs_i32"` Transactions []TransResponse `json:"transactions" bson:"transactions" gorm:"transactions" db:"transactions"` BlockRewardTx string `json:"block_reward" bson:"-" gorm:"-" db:"-"` BlockReward float32 `json:"block_reward_f32" bson:"block_reward_f32" gorm:"block_reward_f32" db:"block_reward_f32"` SizeTx string `json:"size" bson:"-" gorm:"-" db:"-"` Size int `json:"size_i32" bson:"size_i32" gorm:"size_i32" db:"size_i32"` Validators []BlockValidatorsResponse `json:"validators" bson:"validators" gorm:"validators" db:"validators"` Proposer string `json:"proposer" bson:"proposer" gorm:"proposer" db:"proposer"` // PubKey пропозер блока }
func (BlockResponse) MarshalEasyJSON ¶
func (v BlockResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (BlockResponse) MarshalJSON ¶
func (v BlockResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*BlockResponse) UnmarshalEasyJSON ¶
func (v *BlockResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BlockResponse) UnmarshalJSON ¶
func (v *BlockResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type BlockValidatorsResponse ¶
type BlockValidatorsResponse struct { PubKey string `json:"pub_key" bson:"pub_key" gorm:"pub_key" db:"pub_key"` Signed bool `json:"signed,bool" bson:"signed" gorm:"signed" db:"signed"` // подписал-true, или пропустил false }
func (BlockValidatorsResponse) MarshalEasyJSON ¶
func (v BlockValidatorsResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (BlockValidatorsResponse) MarshalJSON ¶
func (v BlockValidatorsResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*BlockValidatorsResponse) UnmarshalEasyJSON ¶
func (v *BlockValidatorsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BlockValidatorsResponse) UnmarshalJSON ¶
func (v *BlockValidatorsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CandidateInfo ¶
type CandidateInfo struct { RewardAddress string `json:"reward_address" bson:"reward_address" gorm:"reward_address" db:"reward_address"` // Адрес кошелька "Mx..." вознаграждения OwnerAddress string `json:"owner_address" bson:"owner_address" gorm:"owner_address" db:"owner_address"` // Адрес кошелька "Mx..." основной TotalStakeTx string `json:"total_stake" bson:"-" gorm:"-" db:"-"` TotalStake float32 `json:"total_stake_f32" bson:"total_stake_f32" gorm:"total_stake_f32" db:"total_stake_f32"` PubKey string `json:"pub_key" bson:"pub_key" gorm:"pub_key" db:"pub_key"` CommissionTx string `json:"commission" bson:"-" gorm:"-" db:"-"` CreatedAtBlockTx string `json:"created_at_block" bson:"-" gorm:"-" db:"-"` Commission int `json:"commission_i32" bson:"commission_i32" gorm:"commission_i32" db:"commission_i32"` CreatedAtBlock int `json:"created_at_block_i32" bson:"created_at_block_i32" gorm:"created_at_block_i32" db:"created_at_block_i32"` StatusInt int `json:"status" bson:"status" gorm:"status" db:"status"` // числовое значение статуса: 1 - Offline, 2 - Online Stakes []stakes_info `json:"stakes" bson:"stakes" gorm:"stakes" db:"stakes"` // Только у: Candidate(по PubKey) }
структура кандидата/валидатора (экспортная)
func (CandidateInfo) MarshalEasyJSON ¶
func (v CandidateInfo) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CandidateInfo) MarshalJSON ¶
func (v CandidateInfo) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CandidateInfo) UnmarshalEasyJSON ¶
func (v *CandidateInfo) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CandidateInfo) UnmarshalJSON ¶
func (v *CandidateInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CoinInfoResponse ¶
type CoinInfoResponse struct { Name string `json:"name" bson:"name" gorm:"name" db:"name"` Symbol string `json:"symbol" bson:"symbol" gorm:"symbol" db:"symbol"` VolumeTx string `json:"volume" bson:"-" gorm:"-" db:"-"` Volume float32 `json:"volume_f32" bson:"volume_f32" gorm:"volume_f32" db:"volume_f32"` CRRTx string `json:"crr" bson:"-" gorm:"-" db:"-"` CRR int `json:"crr_i32" bson:"crr_i32" gorm:"crr_i32" db:"crr_i32"` ReserveBalanceTx string `json:"reserve_balance" bson:"-" gorm:"-" db:"-"` ReserveBalance float32 `json:"reserve_balance_f32" bson:"reserve_balance_f32" gorm:"reserve_balance_f32" db:"reserve_balance_f32"` }
func (CoinInfoResponse) MarshalEasyJSON ¶
func (v CoinInfoResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CoinInfoResponse) MarshalJSON ¶
func (v CoinInfoResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CoinInfoResponse) UnmarshalEasyJSON ¶
func (v *CoinInfoResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CoinInfoResponse) UnmarshalJSON ¶
func (v *CoinInfoResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CoinSymbol ¶
type CoinSymbol [CoinSymbolLength]byte
type ErrorStruct ¶
type ErrorStruct struct { Code int `json:"code"` Message string `json:"message"` Data string `json:"data"` TxResult ErrorTxResult `json:"tx_result"` }
func (ErrorStruct) MarshalEasyJSON ¶
func (v ErrorStruct) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ErrorStruct) MarshalJSON ¶
func (v ErrorStruct) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ErrorStruct) UnmarshalEasyJSON ¶
func (v *ErrorStruct) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ErrorStruct) UnmarshalJSON ¶
func (v *ErrorStruct) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ErrorTxResult ¶
func (ErrorTxResult) MarshalEasyJSON ¶
func (v ErrorTxResult) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ErrorTxResult) MarshalJSON ¶
func (v ErrorTxResult) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ErrorTxResult) UnmarshalEasyJSON ¶
func (v *ErrorTxResult) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ErrorTxResult) UnmarshalJSON ¶
func (v *ErrorTxResult) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type EstimateResponse ¶
type EstimateResponse struct { WillPay float32 `json:"will_pay" bson:"will_pay" gorm:"will_pay" db:"will_pay"` WillGet float32 `json:"will_get" bson:"will_get" gorm:"will_get" db:"will_get"` Commission float32 `json:"commission" bson:"commission" gorm:"commission" db:"commission"` }
для запроса о стоимости монет
func (EstimateResponse) MarshalEasyJSON ¶
func (v EstimateResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (EstimateResponse) MarshalJSON ¶
func (v EstimateResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*EstimateResponse) UnmarshalEasyJSON ¶
func (v *EstimateResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*EstimateResponse) UnmarshalJSON ¶
func (v *EstimateResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type EventValueData ¶
type EventValueData struct { Role string `json:"role" bson:"role" gorm:"role" db:"role"` //DAO,Developers,Validator,Delegator Address string `json:"address" bson:"address" gorm:"address" db:"address"` AmountTx string `json:"amount" bson:"-" gorm:"-" db:"-"` Amount float32 `json:"amount_f32" bson:"amount_f32" gorm:"amount_f32" db:"amount_f32"` Coin string `json:"coin" bson:"coin" gorm:"coin" db:"coin"` ValidatorPubKey string `json:"validator_pub_key" bson:"validator_pub_key" gorm:"validator_pub_key" db:"validator_pub_key"` }
func (EventValueData) MarshalEasyJSON ¶
func (v EventValueData) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (EventValueData) MarshalJSON ¶
func (v EventValueData) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*EventValueData) UnmarshalEasyJSON ¶
func (v *EventValueData) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*EventValueData) UnmarshalJSON ¶
func (v *EventValueData) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ResultNetwork ¶
type ResultNetwork struct { Version string `json:"version" bson:"version" gorm:"version" db:"version"` LatestBlockHash string `json:"latest_block_hash" bson:"-" gorm:"-" db:"-"` LatestAppHash string `json:"latest_app_hash" bson:"-" gorm:"-" db:"-"` LatestBlockHeightTx string `json:"latest_block_height" bson:"-" gorm:"-" db:"-"` LatestBlockHeight int `json:"latest_block_height_i32" bson:"latest_block_height_i32" gorm:"latest_block_height_i32" db:"latest_block_height_i32"` LatestBlockTime time.Time `json:"latest_block_time" bson:"-" gorm:"-" db:"-"` }
func (ResultNetwork) MarshalEasyJSON ¶
func (v ResultNetwork) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ResultNetwork) MarshalJSON ¶
func (v ResultNetwork) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ResultNetwork) UnmarshalEasyJSON ¶
func (v *ResultNetwork) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ResultNetwork) UnmarshalJSON ¶
func (v *ResultNetwork) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SDK ¶
type SDK struct { MnAddress string // адрес мастер ноды с открытым портом API AccAddress string // адрес кошелька/аккаунта "Mx..." AccPrivateKey string // приватный ключ кошелька/аккаунта Debug bool // Режим дебага ChainMainnet bool // Main=true, Test=false }
func (*SDK) EstimateCoinBuy ¶
func (c *SDK) EstimateCoinBuy(coinBuy string, coinSell string, valueBuy int64) (EstimateResponse, error)
Стоимость покупки value монет
func (*SDK) EstimateCoinSell ¶
func (c *SDK) EstimateCoinSell(coinSell string, coinBuy string, valueSell int64) (EstimateResponse, error)
Стоимость продажи value монет
func (*SDK) EstimateTxCommission ¶
Возвращает оценку сколько комиссия
func (*SDK) GetAddress ¶
узнаем баланс и количество транзакций
func (*SDK) GetBlock ¶
func (c *SDK) GetBlock(id int) (BlockResponse, error)
получаем содержимое блока по его ID
func (*SDK) GetCandidate ¶
func (c *SDK) GetCandidate(candidateHash string) (CandidateInfo, error)
func (*SDK) GetCandidates ¶
func (c *SDK) GetCandidates() ([]CandidateInfo, error)
Возвращает список нод валидаторов и кандидатов
func (*SDK) GetCoinInfo ¶
func (c *SDK) GetCoinInfo(coinSmbl string) (CoinInfoResponse, error)
получение доп.данных о монете: volume, reserve_balance
func (*SDK) GetEvents ¶
func (c *SDK) GetEvents(id int) (BlockEvResponse, error)
получаем содержимое событий блока по его ID
func (*SDK) GetStatus ¶
func (c *SDK) GetStatus() (ResultNetwork, error)
получение сколько всего блоков в сети
func (*SDK) GetTransaction ¶
func (c *SDK) GetTransaction(hash string) (TransResponse, error)
получаем содержимое транзакции по её хэшу
func (*SDK) GetValidators ¶
Возвращает список валидаторов
func (*SDK) GetValidatorsBlock ¶
Возвращает список валидаторов по номеру блока (у мастерноды должен быть включен keep_state_history)
func (*SDK) SetTransaction ¶
Исполнение транзакции закодированной RLP
func (*SDK) TxBuyCoin ¶
func (c *SDK) TxBuyCoin(t *TxBuyCoinData) (string, error)
Транзакция - Купить монету
func (*SDK) TxBuyCoinRLP ¶
func (c *SDK) TxBuyCoinRLP(t *TxBuyCoinData) (string, error)
func (*SDK) TxCreateCheck ¶
func (c *SDK) TxCreateCheck(t *TxCreateCkeckData) (string, error)
НЕ!Транзакция - Создание чека
func (*SDK) TxCreateCoin ¶
func (c *SDK) TxCreateCoin(t *TxCreateCoinData) (string, error)
Транзакция - Создание монеты
func (*SDK) TxCreateCoinRLP ¶
func (c *SDK) TxCreateCoinRLP(t *TxCreateCoinData) (string, error)
func (*SDK) TxDeclareCandidacy ¶
func (c *SDK) TxDeclareCandidacy(t *TxDeclareCandidacyData) (string, error)
Транзакция - Декларирования мастерноды в кандидаты
func (*SDK) TxDeclareCandidacyRLP ¶
func (c *SDK) TxDeclareCandidacyRLP(t *TxDeclareCandidacyData) (string, error)
func (*SDK) TxDelegate ¶
func (c *SDK) TxDelegate(t *TxDelegateData) (string, error)
Транзакция - Делегирование
func (*SDK) TxDelegateRLP ¶
func (c *SDK) TxDelegateRLP(t *TxDelegateData) (string, error)
func (*SDK) TxEditCandidate ¶
func (c *SDK) TxEditCandidate(t *TxEditCandidateData) (string, error)
Транзакция - Декларирования мастерноды в кандидаты
func (*SDK) TxEditCandidateRLP ¶
func (c *SDK) TxEditCandidateRLP(t *TxEditCandidateData) (string, error)
func (*SDK) TxMultiSendCoin ¶
func (c *SDK) TxMultiSendCoin(t *TxMultiSendCoinData) (string, error)
Транзакция - Передача монет нескольким адресатам
func (*SDK) TxMultiSendCoinRLP ¶
func (c *SDK) TxMultiSendCoinRLP(t *TxMultiSendCoinData) (string, error)
func (*SDK) TxRedeemCheck ¶
func (c *SDK) TxRedeemCheck(t *TxRedeemCheckData) (string, error)
Транзакция - Погашение чека (обналичивание)
func (*SDK) TxRedeemCheckRLP ¶
func (c *SDK) TxRedeemCheckRLP(t *TxRedeemCheckData) (string, error)
func (*SDK) TxSellAllCoin ¶
func (c *SDK) TxSellAllCoin(t *TxSellAllCoinData) (string, error)
Транзакция - Продажи всех монет
func (*SDK) TxSellAllCoinRLP ¶
func (c *SDK) TxSellAllCoinRLP(t *TxSellAllCoinData) (string, error)
func (*SDK) TxSellCoin ¶
func (c *SDK) TxSellCoin(t *TxSellCoinData) (string, error)
Транзакция - Продажи монет
func (*SDK) TxSellCoinRLP ¶
func (c *SDK) TxSellCoinRLP(t *TxSellCoinData) (string, error)
func (*SDK) TxSendCoin ¶
func (c *SDK) TxSendCoin(t *TxSendCoinData) (string, error)
Транзакция - Передача монет
func (*SDK) TxSendCoinRLP ¶
func (c *SDK) TxSendCoinRLP(t *TxSendCoinData) (string, error)
func (*SDK) TxSetCandidate ¶
func (c *SDK) TxSetCandidate(t *TxSetCandidateData) (string, error)
Транзакция - Вкл./выкл мастерноду в валидаторы
func (*SDK) TxSetCandidateRLP ¶
func (c *SDK) TxSetCandidateRLP(t *TxSetCandidateData) (string, error)
func (*SDK) TxUnbond ¶
func (c *SDK) TxUnbond(t *TxUnbondData) (string, error)
Транзакция - Отозвать монеты из делегированных в валидатора
func (*SDK) TxUnbondRLP ¶
func (c *SDK) TxUnbondRLP(t *TxUnbondData) (string, error)
type SendOneData ¶
type SendOneData struct { To string `json:"to"` Coin string `json:"coin"` Value string `json:"value"` }
Не заносится в БД
func (SendOneData) MarshalEasyJSON ¶
func (v SendOneData) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SendOneData) MarshalJSON ¶
func (v SendOneData) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SendOneData) UnmarshalEasyJSON ¶
func (v *SendOneData) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SendOneData) UnmarshalJSON ¶
func (v *SendOneData) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TransData ¶
type TransData struct { //=== type1 - TYPE_SEND To string `json:"to"` //Coin string `json:"coin"` //Value string `json:"value"` //=== type2 - TYPE_SELL_COIN ValueToSell string `json:"value_to_sell"` //CoinToSell string `json:"coin_to_sell"` //CoinToBuy string `json:"coin_to_buy"` //=== type3 - TYPE_SELL_ALL_COIN //CoinToSell string `json:"coin_to_sell"` //CoinToBuy string `json:"coin_to_buy"` //=== type4 - TYPE_BUY_COIN CoinToBuy string `json:"coin_to_buy"` ValueToBuy string `json:"value_to_buy"` CoinToSell string `json:"coin_to_sell"` //=== type5 - TYPE_CREATE_COIN Name string `json:"name"` // название монеты CoinSymbol string `json:"symbol"` // символ монеты InitialAmount string `json:"initial_amount"` // Amount of coins to issue. Issued coins will be available to sender account. InitialReserve string `json:"initial_reserve"` // Initial reserve in base coin. ConstantReserveRatio string `json:"constant_reserve_ratio"` // should be from 10 to 100 (в %). //=== type6 - TYPE_DECLARE_CANDIDACY Address string `json:"address"` Commission int `json:"commission,string"` //Stake string `json:"stake"` //PubKey string `json:"pub_key"` //Coin string `json:"coin"` //=== type7 - TYPE_DELEGATE Stake string `json:"stake"` // УДАЛИТЬ: с 0.15.* стало Value string `json:"value"` //PubKey string `json:"pub_key"` //Coin string `json:"coin"` //=== type8 - TYPE_UNBOUND PubKey string `json:"pub_key"` Coin string `json:"coin"` Value string `json:"value"` //=== type9 - TYPE_REDEEM_CHECK RawCheck string `json:"raw_check"` Proof string `json:"proof"` //=== type10 - TYPE_SET_CANDIDATE_ONLINE //=== type11 - TYPE_SET_CANDIDATE_OFFLINE //=== type13 - TYPE_MULTISEND List []SendOneData `json:"list"` //=== type14 - RewardAddress string `json:"reward_address"` OwnerAddress string `json:"owner_address"` }
Не заносится в БД
func (TransData) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (TransData) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*TransData) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransData) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type TransResponse ¶
type TransResponse struct { Hash string `json:"hash" bson:"hash" gorm:"hash" db:"hash"` RawTx string `json:"raw_tx" bson:"raw_tx" gorm:"raw_tx" db:"raw_tx"` HeightTx string `json:"height" bson:"-" gorm:"-" db:"-"` //(!) В блоке у транзакции нет HEIGHT блока Height int `json:"height_i32" bson:"height_i32" gorm:"height_i32" db:"height_i32"` Index int `json:"index" bson:"index" gorm:"index" db:"index_i32"` From string `json:"from" bson:"from" gorm:"from" db:"from"` NonceTx string `json:"nonce" bson:"-" gorm:"-" db:"-"` Nonce int `json:"nonce_i32" bson:"nonce_i32" gorm:"nonce_i32" db:"nonce_i32"` GasPriceTx int `json:"gas_price" bson:"-" gorm:"-" db:"-"` // TODO: с версии 0.19 стало числом, переписать gas_price_i32! GasPrice int `json:"gas_price_i32" bson:"gas_price_i32" gorm:"gas_price_i32" db:"gas_price_i32"` GasCoin string `json:"gas_coin" bson:"gas_coin" gorm:"gas_coin" db:"gas_coin"` GasUsedTx string `json:"gas" bson:"-" gorm:"-" db:"-"` GasUsed int `json:"gas_used_i32" bson:"gas_used_i32" gorm:"gas_used_i32" db:"gas_used_i32"` Type int `json:"type" bson:"type" gorm:"type" db:"type"` DataTx TransData `json:"data" bson:"-" gorm:"-" db:"-"` Data interface{} `json:"-" bson:"data" gorm:"data" db:"data"` Payload string `json:"payload" bson:"payload" gorm:"payload" db:"payload"` Tags tagKeyValue2 `json:"tags" bson:"tags" gorm:"tags" db:"tags"` // TODO: нет необходимости в нём, пока из Покупки/Продажи результат обмена tx.return не вынесут на уровень выше Code int `json:"code" bson:"code" gorm:"code" db:"code"` // если не 0, то ОШИБКА, читаем лог(Log) Log string `json:"log" bson:"log" gorm:"log" db:"log"` ServiceData []byte `json:"service_data" bson:"service_data" gorm:"service_data" db:"service_data"` //TODO: ? }
func (TransResponse) MarshalEasyJSON ¶
func (v TransResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TransResponse) MarshalJSON ¶
func (v TransResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TransResponse) UnmarshalEasyJSON ¶
func (v *TransResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransResponse) UnmarshalJSON ¶
func (v *TransResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TransSendResponse ¶
type TransSendResponse struct { Code int `json:"code" bson:"code" gorm:"code" db:"code"` Log string `json:"log" bson:"log" gorm:"log" db:"log"` Data string `json:"data" bson:"data" gorm:"data" db:"data"` Hash string `json:"hash" bson:"hash" gorm:"hash" db:"hash"` }
func (TransSendResponse) MarshalEasyJSON ¶
func (v TransSendResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TransSendResponse) MarshalJSON ¶
func (v TransSendResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TransSendResponse) UnmarshalEasyJSON ¶
func (v *TransSendResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransSendResponse) UnmarshalJSON ¶
func (v *TransSendResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TxBuyCoinData ¶
type TxBuyCoinData struct { CoinToSell string CoinToBuy string ValueToBuy float32 // Other Payload string // Gas GasCoin string GasPrice int64 }
Структура данных для Покупки монет
type TxCreateCkeckData ¶
Структура данных для Создания монеты
type TxCreateCoinData ¶
type TxCreateCoinData struct { Name string Symbol string InitialAmount int64 InitialReserve int64 ConstantReserveRatio uint // Other Payload string // Gas GasCoin string GasPrice int64 }
Структура данных для Создания монеты
type TxDeclareCandidacyData ¶
type TxDeclareCandidacyData struct { PubKey string // брать или с http://locallhost:3000 или с файла в conf/ Commission uint Coin string Stake int64 // Other Payload string // Gas GasCoin string GasPrice int64 }
Структура данных для Декларирования мастерноды в кандидаты
type TxDelegateData ¶
type TxDelegateData struct { PubKey string Coin string Stake float32 // Other Payload string // Gas GasCoin string GasPrice int64 }
Структура данных для Делегирования
type TxEditCandidateData ¶
type TxEditCandidateData struct { PubKey string RewardAddress string OwnerAddress string // Other Payload string // Gas GasCoin string GasPrice int64 }
Структура данных для Статус кандидата вкл/выкл
type TxMultiSendCoinData ¶
type TxMultiSendCoinData struct { List []TxOneSendCoinData // Other Payload string // Gas GasCoin string GasPrice int64 }
Структура данных для Передачи монет нескольком адресатам
type TxOneSendCoinData ¶
type TxRedeemCheckData ¶
type TxSellAllCoinData ¶
type TxSellAllCoinData struct { CoinToSell string CoinToBuy string // Other Payload string // Gas GasCoin string GasPrice int64 }
Структура данных для Продажи всех монет
type TxSellCoinData ¶
type TxSellCoinData struct { CoinToSell string CoinToBuy string ValueToSell float32 // Other Payload string // Gas GasCoin string GasPrice int64 }
Структура данных для Продажи монет
type TxSendCoinData ¶
type TxSendCoinData struct { Coin string ToAddress string Value float32 // Other Payload string // Gas GasCoin string GasPrice int64 }
Структура данных для Передачи монет
Source Files ¶
- apiEstimateCoin.go
- apiEstimateCoin_easyjson.go
- apiGetAddress.go
- apiGetAddress_easyjson.go
- apiGetBlock.go
- apiGetBlock_easyjson.go
- apiGetCandidate.go
- apiGetCandidate_easyjson.go
- apiGetCandidates.go
- apiGetCandidates_easyjson.go
- apiGetCoinInfo.go
- apiGetCoinInfo_easyjson.go
- apiGetEvents.go
- apiGetEvents_easyjson.go
- apiGetMinGas.go
- apiGetMinGas_easyjson.go
- apiGetStatus.go
- apiGetStatus_easyjson.go
- apiGetTransaction.go
- apiGetTransaction_easyjson.go
- apiGetValidators.go
- apiGetValidators_easyjson.go
- apiSetTransaction.go
- apiSetTransaction_easyjson.go
- main.go
- structs.go
- toolsFunc.go
- toolsFuncCheck.go
- txBuyCoin.go
- txCreateCoin.go
- txDeclareCandidacy.go
- txDelegate.go
- txEditCandidate.go
- txMultiSendCoin.go
- txRedeemCheck.go
- txSellAllCoin.go
- txSellCoin.go
- txSendCoin.go
- txSetCandidate.go
- txUnbond.go