Documentation
¶
Index ¶
- type Builder
- type BuyCoinData
- type ChainID
- type Check
- type CheckAddress
- type CheckData
- type CheckInterface
- type Coin
- type CreateCoinData
- func (d *CreateCoinData) SetConstantReserveRatio(ratio uint) *CreateCoinData
- func (d *CreateCoinData) SetInitialAmount(value *big.Int) *CreateCoinData
- func (d *CreateCoinData) SetInitialReserve(value *big.Int) *CreateCoinData
- func (d *CreateCoinData) SetMaxSupply(maxSupply *big.Int) *CreateCoinData
- func (d *CreateCoinData) SetName(name string) *CreateCoinData
- func (d *CreateCoinData) SetSymbol(symbol string) *CreateCoinData
- type CreateMultisigData
- func (d *CreateMultisigData) AddSigData(address string, weight uint) (*CreateMultisigData, error)
- func (d *CreateMultisigData) AddressBytes() [20]byte
- func (d *CreateMultisigData) AddressString() string
- func (d *CreateMultisigData) MustAddSigData(address string, weight uint) *CreateMultisigData
- func (d *CreateMultisigData) SetThreshold(threshold uint) *CreateMultisigData
- type DataInterface
- type DeclareCandidacyData
- func (d *DeclareCandidacyData) MustSetAddress(address string) *DeclareCandidacyData
- func (d *DeclareCandidacyData) MustSetPubKey(key string) *DeclareCandidacyData
- func (d *DeclareCandidacyData) SetAddress(address string) (*DeclareCandidacyData, error)
- func (d *DeclareCandidacyData) SetCoin(symbol string) *DeclareCandidacyData
- func (d *DeclareCandidacyData) SetCommission(value uint) *DeclareCandidacyData
- func (d *DeclareCandidacyData) SetPubKey(key string) (*DeclareCandidacyData, error)
- func (d *DeclareCandidacyData) SetStake(value *big.Int) *DeclareCandidacyData
- type DeepLink
- type DelegateData
- type EditCandidateData
- func (d *EditCandidateData) MustSetOwnerAddress(address string) *EditCandidateData
- func (d *EditCandidateData) MustSetPubKey(key string) *EditCandidateData
- func (d *EditCandidateData) MustSetRewardAddress(address string) *EditCandidateData
- func (d *EditCandidateData) SetOwnerAddress(address string) (*EditCandidateData, error)
- func (d *EditCandidateData) SetPubKey(key string) (*EditCandidateData, error)
- func (d *EditCandidateData) SetRewardAddress(address string) (*EditCandidateData, error)
- type EncodeInterface
- type Interface
- type MultisendData
- type MultisendDataItem
- type RedeemCheckData
- type SellAllCoinData
- type SellCoinData
- type SendData
- type SetCandidateOffData
- type SetCandidateOnData
- type Signature
- type SignatureMulti
- type SignatureType
- type Signed
- type SignedTransaction
- type Transaction
- type Type
- type UnbondData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
ChainID ChainID
}
func NewBuilder ¶
func (*Builder) NewTransaction ¶
func (b *Builder) NewTransaction(data DataInterface) (Interface, error)
type BuyCoinData ¶
type BuyCoinData struct {
CoinToBuy Coin
ValueToBuy *big.Int
CoinToSell Coin
MaximumValueToSell *big.Int
}
Transaction for buy a coin paying another coin (owned by sender). CoinToBuy - Symbol of a coin to get. ValueToBuy - Amount of CoinToBuy to get. CoinToSell - Symbol of a coin to give. MaximumValueToSell - Maximum value of coins to sell.
func NewBuyCoinData ¶
func NewBuyCoinData() *BuyCoinData
func (*BuyCoinData) SetCoinToBuy ¶
func (d *BuyCoinData) SetCoinToBuy(symbol string) *BuyCoinData
func (*BuyCoinData) SetCoinToSell ¶
func (d *BuyCoinData) SetCoinToSell(symbol string) *BuyCoinData
func (*BuyCoinData) SetMaximumValueToSell ¶
func (d *BuyCoinData) SetMaximumValueToSell(value *big.Int) *BuyCoinData
func (*BuyCoinData) SetValueToBuy ¶
func (d *BuyCoinData) SetValueToBuy(value *big.Int) *BuyCoinData
type Check ¶
type Check struct {
*CheckData
// contains filtered or unexported fields
}
func (*Check) SetPassphrase ¶
func (check *Check) SetPassphrase(passphrase string) CheckInterface
Set secret phrase which you will pass to receiver of the check
type CheckAddress ¶
type CheckAddress struct {
// contains filtered or unexported fields
}
func NewCheckAddress ¶
func NewCheckAddress(address string, passphrase string) (*CheckAddress, error)
type CheckData ¶
type CheckData struct {
Nonce []byte
ChainID ChainID
DueBlock uint64
Coin Coin
Value *big.Int
GasCoin Coin
Lock *big.Int
V *big.Int
R *big.Int
S *big.Int
}
Issue a check that will later be redeemed by the person of your choice.
func DecodeCheck ¶
Prepare check string and convert to data
type CheckInterface ¶
type CheckInterface interface {
SetPassphrase(passphrase string) CheckInterface
Sign(prKey string) (Signed, error)
}
func NewCheck ¶
func NewCheck(nonce uint64, chainID ChainID, dueBlock uint64, coin string, value *big.Int, gasCoin string) CheckInterface
Create Check Nonce - unique "id" of the check. Coin Symbol - symbol of coin. Value - amount of coins. Due Block - defines last block height in which the check can be used.
type CreateCoinData ¶
type CreateCoinData struct {
Name string
Symbol Coin
InitialAmount *big.Int
InitialReserve *big.Int
ConstantReserveRatio uint
MaxSupply *big.Int
}
Transaction for creating new coin in a system. Name - Name of a coin. Arbitrary string up to 64 letters length. Symbol - Symbol of a coin. Must be unique, alphabetic, uppercase, 3 to 10 symbols length. InitialAmount - Amount of coins to issue. Issued coins will be available to sender account. InitialReserve - Initial reserve in BIP's. ConstantReserveRatio - CRR, uint, should be from 10 to 100.
func NewCreateCoinData ¶
func NewCreateCoinData() *CreateCoinData
func (*CreateCoinData) SetConstantReserveRatio ¶
func (d *CreateCoinData) SetConstantReserveRatio(ratio uint) *CreateCoinData
func (*CreateCoinData) SetInitialAmount ¶
func (d *CreateCoinData) SetInitialAmount(value *big.Int) *CreateCoinData
func (*CreateCoinData) SetInitialReserve ¶
func (d *CreateCoinData) SetInitialReserve(value *big.Int) *CreateCoinData
func (*CreateCoinData) SetMaxSupply ¶
func (d *CreateCoinData) SetMaxSupply(maxSupply *big.Int) *CreateCoinData
func (*CreateCoinData) SetName ¶
func (d *CreateCoinData) SetName(name string) *CreateCoinData
func (*CreateCoinData) SetSymbol ¶
func (d *CreateCoinData) SetSymbol(symbol string) *CreateCoinData
type CreateMultisigData ¶
func NewCreateMultisigData ¶
func NewCreateMultisigData() *CreateMultisigData
func (*CreateMultisigData) AddSigData ¶
func (d *CreateMultisigData) AddSigData(address string, weight uint) (*CreateMultisigData, error)
func (*CreateMultisigData) AddressBytes ¶
func (d *CreateMultisigData) AddressBytes() [20]byte
func (*CreateMultisigData) AddressString ¶
func (d *CreateMultisigData) AddressString() string
func (*CreateMultisigData) MustAddSigData ¶
func (d *CreateMultisigData) MustAddSigData(address string, weight uint) *CreateMultisigData
func (*CreateMultisigData) SetThreshold ¶
func (d *CreateMultisigData) SetThreshold(threshold uint) *CreateMultisigData
type DataInterface ¶
type DataInterface interface {
// contains filtered or unexported methods
}
type DeclareCandidacyData ¶
type DeclareCandidacyData struct {
Address [20]byte
PubKey []byte
Commission uint
Coin Coin
Stake *big.Int
}
Transaction for declaring new validator candidacy. Address - Address of candidate in Minter Network. This address would be able to control candidate. Also all rewards will be sent to this address. PubKey - Public key of a validator. Commission - Commission (from 0 to 100) from rewards which delegators will pay to validator. Coin - Symbol of coin to stake. Stake - Amount of coins to stake.
func NewDeclareCandidacyData ¶
func NewDeclareCandidacyData() *DeclareCandidacyData
func (*DeclareCandidacyData) MustSetAddress ¶
func (d *DeclareCandidacyData) MustSetAddress(address string) *DeclareCandidacyData
func (*DeclareCandidacyData) MustSetPubKey ¶
func (d *DeclareCandidacyData) MustSetPubKey(key string) *DeclareCandidacyData
func (*DeclareCandidacyData) SetAddress ¶
func (d *DeclareCandidacyData) SetAddress(address string) (*DeclareCandidacyData, error)
func (*DeclareCandidacyData) SetCoin ¶
func (d *DeclareCandidacyData) SetCoin(symbol string) *DeclareCandidacyData
func (*DeclareCandidacyData) SetCommission ¶
func (d *DeclareCandidacyData) SetCommission(value uint) *DeclareCandidacyData
func (*DeclareCandidacyData) SetPubKey ¶
func (d *DeclareCandidacyData) SetPubKey(key string) (*DeclareCandidacyData, error)
func (*DeclareCandidacyData) SetStake ¶
func (d *DeclareCandidacyData) SetStake(value *big.Int) *DeclareCandidacyData
type DeepLink ¶
type DeepLink struct {
Type Type
Data []byte
Payload []byte
Nonce *uint // optional
GasPrice *uint // optional
GasCoin *Coin // optional
}
func NewDeepLink ¶
func NewDeepLink(data DataInterface) (*DeepLink, error)
func (*DeepLink) SetGasCoin ¶
func (*DeepLink) SetPayload ¶
type DelegateData ¶
Transaction for delegating funds to validator. PubKey - Public key of a validator. Coin - Symbol of coin to stake. Value - Amount of coins to stake.
func NewDelegateData ¶
func NewDelegateData() *DelegateData
func (*DelegateData) MustSetPubKey ¶
func (d *DelegateData) MustSetPubKey(key string) *DelegateData
func (*DelegateData) SetCoin ¶
func (d *DelegateData) SetCoin(symbol string) *DelegateData
func (*DelegateData) SetPubKey ¶
func (d *DelegateData) SetPubKey(key string) (*DelegateData, error)
func (*DelegateData) SetValue ¶
func (d *DelegateData) SetValue(value *big.Int) *DelegateData
type EditCandidateData ¶
Transaction for editing existing candidate.
func NewEditCandidateData ¶
func NewEditCandidateData() *EditCandidateData
func (*EditCandidateData) MustSetOwnerAddress ¶
func (d *EditCandidateData) MustSetOwnerAddress(address string) *EditCandidateData
func (*EditCandidateData) MustSetPubKey ¶
func (d *EditCandidateData) MustSetPubKey(key string) *EditCandidateData
func (*EditCandidateData) MustSetRewardAddress ¶
func (d *EditCandidateData) MustSetRewardAddress(address string) *EditCandidateData
func (*EditCandidateData) SetOwnerAddress ¶
func (d *EditCandidateData) SetOwnerAddress(address string) (*EditCandidateData, error)
func (*EditCandidateData) SetPubKey ¶
func (d *EditCandidateData) SetPubKey(key string) (*EditCandidateData, error)
func (*EditCandidateData) SetRewardAddress ¶
func (d *EditCandidateData) SetRewardAddress(address string) (*EditCandidateData, error)
type EncodeInterface ¶
type Interface ¶
type Interface interface {
EncodeInterface
SetSignatureType(signatureType SignatureType) Interface
SetMultiSignatureType() Interface
SetNonce(nonce uint64) Interface
SetGasCoin(name string) Interface
SetGasPrice(price uint8) Interface
SetPayload(payload []byte) Interface
SetServiceData(serviceData []byte) Interface
Sign(prKey string, multisigPrKeys ...string) (SignedTransaction, error)
// contains filtered or unexported methods
}
type MultisendData ¶
type MultisendData struct {
List []MultisendDataItem
}
Transaction for sending coins to multiple addresses.
func NewMultisendData ¶
func NewMultisendData() *MultisendData
func (*MultisendData) AddItem ¶
func (d *MultisendData) AddItem(item MultisendDataItem) *MultisendData
type MultisendDataItem ¶
type MultisendDataItem SendData
func NewMultisendDataItem ¶
func NewMultisendDataItem() *MultisendDataItem
func (*MultisendDataItem) MustSetTo ¶
func (d *MultisendDataItem) MustSetTo(address string) *MultisendDataItem
func (*MultisendDataItem) SetCoin ¶
func (d *MultisendDataItem) SetCoin(symbol string) *MultisendDataItem
func (*MultisendDataItem) SetTo ¶
func (d *MultisendDataItem) SetTo(address string) (*MultisendDataItem, error)
func (*MultisendDataItem) SetValue ¶
func (d *MultisendDataItem) SetValue(value *big.Int) *MultisendDataItem
type RedeemCheckData ¶
Transaction for redeeming a check. RawCheck - Raw check received from sender. Proof - Proof of owning a check. Note that maximum GasPrice is limited to 1 to prevent fraud, because GasPrice is set by redeem tx sender but commission is charded from check issuer.
func NewRedeemCheckData ¶
func NewRedeemCheckData() *RedeemCheckData
func (*RedeemCheckData) MustSetProof ¶
func (d *RedeemCheckData) MustSetProof(proof string) *RedeemCheckData
func (*RedeemCheckData) MustSetRawCheck ¶
func (d *RedeemCheckData) MustSetRawCheck(raw string) *RedeemCheckData
func (*RedeemCheckData) SetProof ¶
func (d *RedeemCheckData) SetProof(proof string) (*RedeemCheckData, error)
func (*RedeemCheckData) SetRawCheck ¶
func (d *RedeemCheckData) SetRawCheck(raw string) (*RedeemCheckData, error)
type SellAllCoinData ¶
Transaction for selling one coin (owned by sender) in favour of another coin in a system. CoinToSell - Symbol of a coin to give. ValueToSell - Amount of CoinToSell to give. CoinToBuy - Symbol of a coin to get. MinimumValueToBuy - Minimum value of coins to get.
func NewSellAllCoinData ¶
func NewSellAllCoinData() *SellAllCoinData
func (*SellAllCoinData) SetCoinToBuy ¶
func (d *SellAllCoinData) SetCoinToBuy(symbol string) *SellAllCoinData
func (*SellAllCoinData) SetCoinToSell ¶
func (d *SellAllCoinData) SetCoinToSell(symbol string) *SellAllCoinData
func (*SellAllCoinData) SetMinimumValueToBuy ¶
func (d *SellAllCoinData) SetMinimumValueToBuy(value *big.Int) *SellAllCoinData
type SellCoinData ¶
type SellCoinData struct {
CoinToSell Coin
ValueToSell *big.Int
CoinToBuy Coin
MinimumValueToBuy *big.Int
}
Transaction for selling one coin (owned by sender) in favour of another coin in a system. CoinToSell - Symbol of a coin to give. ValueToSell - Amount of CoinToSell to give. CoinToBuy - Symbol of a coin to get. MinimumValueToBuy - Minimum value of coins to get.
func NewSellCoinData ¶
func NewSellCoinData() *SellCoinData
func (*SellCoinData) SetCoinToBuy ¶
func (d *SellCoinData) SetCoinToBuy(symbol string) *SellCoinData
func (*SellCoinData) SetCoinToSell ¶
func (d *SellCoinData) SetCoinToSell(symbol string) *SellCoinData
func (*SellCoinData) SetMinimumValueToBuy ¶
func (d *SellCoinData) SetMinimumValueToBuy(value *big.Int) *SellCoinData
func (*SellCoinData) SetValueToSell ¶
func (d *SellCoinData) SetValueToSell(value *big.Int) *SellCoinData
type SendData ¶
Transaction for sending arbitrary coin. Coin - Symbol of a coin. To - Recipient address in Minter Network. Value - Amount of Coin to send.
func NewSendData ¶
func NewSendData() *SendData
type SetCandidateOffData ¶
type SetCandidateOffData struct {
PubKey []byte
}
Transaction for turning candidate off. This transaction should be sent from address which is set in the "Declare candidacy transaction". PubKey - Public key of a validator.
func NewSetCandidateOffData ¶
func NewSetCandidateOffData() *SetCandidateOffData
func (*SetCandidateOffData) MustSetPubKey ¶
func (d *SetCandidateOffData) MustSetPubKey(key string) *SetCandidateOffData
func (*SetCandidateOffData) SetPubKey ¶
func (d *SetCandidateOffData) SetPubKey(key string) (*SetCandidateOffData, error)
type SetCandidateOnData ¶
type SetCandidateOnData struct {
PubKey []byte
}
Transaction for turning candidate on. This transaction should be sent from address which is set in the "Declare candidacy transaction". PubKey - Public key of a validator.
func NewSetCandidateOnData ¶
func NewSetCandidateOnData() *SetCandidateOnData
func (*SetCandidateOnData) MustSetPubKey ¶
func (d *SetCandidateOnData) MustSetPubKey(key string) *SetCandidateOnData
func (*SetCandidateOnData) SetPubKey ¶
func (d *SetCandidateOnData) SetPubKey(key string) (*SetCandidateOnData, error)
type SignatureMulti ¶
type SignatureType ¶
type SignatureType byte
const ( SignatureTypeSingle SignatureType SignatureTypeMulti )
type SignedTransaction ¶
type SignedTransaction interface {
EncodeInterface
GetTransaction() *Transaction
Fee() *big.Int
Hash() (string, error)
Data() DataInterface
Signature() (signatureInterface, error)
AddSignature(signatures ...[]byte) (SignedTransaction, error)
SignatureData() []byte
SimpleSignatureData() ([]byte, error)
SenderAddress() (string, error)
Sign(prKey string, multisigPrKeys ...string) (SignedTransaction, error)
}
type Transaction ¶
type Transaction struct {
Nonce uint64
ChainID ChainID
GasPrice uint8
GasCoin Coin
Type Type
Data []byte
Payload []byte
ServiceData []byte
SignatureType SignatureType
SignatureData []byte
}
func (*Transaction) Encode ¶
func (tx *Transaction) Encode() (string, error)
type UnbondData ¶
Transaction for unbonding funds from validator's stake. PubKey - Public key of a validator. Coin - Symbol of coin to stake. Value - Amount of coins to stake.
func NewUnbondData ¶
func NewUnbondData() *UnbondData
func (*UnbondData) MustSetPubKey ¶
func (d *UnbondData) MustSetPubKey(key string) *UnbondData
func (*UnbondData) SetCoin ¶
func (d *UnbondData) SetCoin(symbol string) *UnbondData
func (*UnbondData) SetPubKey ¶
func (d *UnbondData) SetPubKey(key string) (*UnbondData, error)
func (*UnbondData) SetValue ¶
func (d *UnbondData) SetValue(value *big.Int) *UnbondData