Documentation ¶
Index ¶
- Constants
- type BaseToken
- func (bt *BaseToken) CheckLimitsAndPrice(method string, amount *big.Int, currency string) (*big.Int, error)
- func (bt *BaseToken) EmissionAdd(amount *big.Int) error
- func (bt *BaseToken) EmissionSub(amount *big.Int) error
- func (bt *BaseToken) FeeAddressSetter() *types.Address
- func (bt *BaseToken) FeeSetter() *types.Address
- func (bt *BaseToken) GetID() string
- func (bt *BaseToken) GetRateAndLimits(dealType string, currency string) (*proto.TokenRate, bool, error)
- func (bt *BaseToken) Issuer() *types.Address
- func (bt *BaseToken) QueryAllowedBalanceOf(address *types.Address, token string) (*big.Int, error)
- func (bt *BaseToken) QueryBalanceOf(address *types.Address) (*big.Int, error)
- func (bt *BaseToken) QueryDocumentsList() ([]core.Doc, error)
- func (bt *BaseToken) QueryMetadata() (*Metadata, error)
- func (bt *BaseToken) QueryPredictFee(amount *big.Int) (*Predict, error)
- func (bt *BaseToken) TxAddDocs(sender *types.Sender, rawDocs string) error
- func (bt *BaseToken) TxAllowedIndustrialBalanceTransfer(sender *types.Sender, to *types.Address, rawAssets string, _ string) error
- func (bt *BaseToken) TxBuyBack(sender *types.Sender, amount *big.Int, currency string) error
- func (bt *BaseToken) TxBuyToken(sender *types.Sender, amount *big.Int, currency string) error
- func (bt *BaseToken) TxDeleteDoc(sender *types.Sender, docID string) error
- func (bt *BaseToken) TxDeleteRate(sender *types.Sender, dealType string, currency string) error
- func (bt *BaseToken) TxSetFee(sender *types.Sender, currency string, fee *big.Int, floor *big.Int, ...) error
- func (bt *BaseToken) TxSetFeeAddress(sender *types.Sender, address *types.Address) error
- func (bt *BaseToken) TxSetLimits(sender *types.Sender, dealType string, currency string, min *big.Int, ...) error
- func (bt *BaseToken) TxSetRate(sender *types.Sender, dealType string, currency string, rate *big.Int) error
- func (bt *BaseToken) TxTransfer(sender *types.Sender, to *types.Address, amount *big.Int, _ string) error
- type Fee
- type Metadata
- type MetadataRate
- type Predict
- type Tokener
- type VT
Constants ¶
const ( // FeeSetterArgPos is the position of the fee setter in the init args FeeSetterArgPos = 1 // FeeAddressSetterArgPos is the position of the fee address setter in the init args FeeAddressSetterArgPos = 2 )
const (
// RateDecimal is the number of decimal places in the rate
RateDecimal = 8
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseToken ¶
type BaseToken struct { core.BaseContract Name string Symbol string Decimals uint UnderlyingAsset string // contains filtered or unexported fields }
BaseToken is the base token
func (*BaseToken) CheckLimitsAndPrice ¶
func (bt *BaseToken) CheckLimitsAndPrice(method string, amount *big.Int, currency string) (*big.Int, error)
CheckLimitsAndPrice checks limits and price
func (*BaseToken) EmissionAdd ¶
EmissionAdd adds emission
func (*BaseToken) EmissionSub ¶
EmissionSub subtracts emission
func (*BaseToken) FeeAddressSetter ¶
FeeAddressSetter returns the fee address setter of the token
func (*BaseToken) GetRateAndLimits ¶
func (bt *BaseToken) GetRateAndLimits(dealType string, currency string) (*proto.TokenRate, bool, error)
GetRateAndLimits returns rate and limits for the deal type and currency
func (*BaseToken) QueryAllowedBalanceOf ¶
QueryAllowedBalanceOf returns allowed balance
func (*BaseToken) QueryBalanceOf ¶
QueryBalanceOf returns balance
func (*BaseToken) QueryDocumentsList ¶
QueryDocumentsList - returns list of emission documents
func (*BaseToken) QueryMetadata ¶
QueryMetadata returns Metadata
func (*BaseToken) QueryPredictFee ¶
QueryPredictFee returns the predicted fee
func (*BaseToken) TxAllowedIndustrialBalanceTransfer ¶
func (bt *BaseToken) TxAllowedIndustrialBalanceTransfer(sender *types.Sender, to *types.Address, rawAssets string, _ string) error
TxAllowedIndustrialBalanceTransfer transfers tokens from one account to another
func (*BaseToken) TxBuyToken ¶
TxBuyToken buys tokens for an asset
func (*BaseToken) TxDeleteDoc ¶
TxDeleteDoc - deletes doc from state
func (*BaseToken) TxDeleteRate ¶
TxDeleteRate - deletes rate from state
func (*BaseToken) TxSetFee ¶
func (bt *BaseToken) TxSetFee(sender *types.Sender, currency string, fee *big.Int, floor *big.Int, cap *big.Int) error
TxSetFee sets the fee
func (*BaseToken) TxSetFeeAddress ¶
TxSetFeeAddress sets the fee address
func (*BaseToken) TxSetLimits ¶
func (bt *BaseToken) TxSetLimits(sender *types.Sender, dealType string, currency string, min *big.Int, max *big.Int) error
TxSetLimits sets limits for a deal type and an asset
type Fee ¶
type Fee struct { Address string `json:"address"` Currency string `json:"currency"` Fee *big.Int `json:"fee"` Floor *big.Int `json:"floor"` Cap *big.Int `json:"cap"` }
Fee is a struct for fee
type Metadata ¶
type Metadata struct { Name string `json:"name"` Symbol string `json:"symbol"` Decimals uint `json:"decimals"` UnderlyingAsset string `json:"underlying_asset"` //nolint:tagliatelle Issuer string `json:"issuer"` Methods []string `json:"methods"` TotalEmission *big.Int `json:"total_emission"` //nolint:tagliatelle Fee *Fee `json:"fee"` Rates []*MetadataRate `json:"rates"` }
Metadata is a struct for metadata
type MetadataRate ¶
type MetadataRate struct { DealType string `json:"deal_type"` //nolint:tagliatelle Currency string `json:"currency"` Rate *big.Int `json:"rate"` Min *big.Int `json:"min"` Max *big.Int `json:"max"` }
MetadataRate is a struct for rate
type Predict ¶
type Predict struct { // Currency is the currency of the fee Currency string `json:"currency"` // Fee is the predicted fee Fee *big.Int `json:"fee"` }
Predict is a struct for fee prediction