Documentation ¶
Index ¶
- Constants
- Variables
- type DistribRequest
- type ExtConfig
- func (*ExtConfig) Descriptor() ([]byte, []int)deprecated
- func (x *ExtConfig) GetDecimals() uint32
- func (x *ExtConfig) GetDeliveryForm() string
- func (x *ExtConfig) GetFeeAddressSetter() *proto.Wallet
- func (x *ExtConfig) GetFeeSetter() *proto.Wallet
- func (x *ExtConfig) GetIssuer() *proto.Wallet
- func (x *ExtConfig) GetName() string
- func (x *ExtConfig) GetPaymentTerms() string
- func (x *ExtConfig) GetPrice() string
- func (x *ExtConfig) GetTokensForUnit() string
- func (x *ExtConfig) GetUnderlyingAsset() string
- func (x *ExtConfig) GetUnitOfMeasure() string
- func (*ExtConfig) ProtoMessage()
- func (x *ExtConfig) ProtoReflect() protoreflect.Message
- func (x *ExtConfig) Reset()
- func (x *ExtConfig) String() string
- func (m *ExtConfig) Validate() error
- func (m *ExtConfig) ValidateAll() error
- type ExtConfigMultiError
- type ExtConfigValidationError
- type Group
- type ITInterface
- type IndustrialToken
- func (it *IndustrialToken) ApplyExtConfig(cfgBytes []byte) error
- func (it *IndustrialToken) ChangeGroupMetadata(groupName string, maturityDate time.Time, note string) error
- func (it *IndustrialToken) CheckLimitsAndPrice(method string, amount *big.Int, currency string) (*big.Int, error)
- func (it *IndustrialToken) FeeAddressSetter() *types.Address
- func (it *IndustrialToken) FeeSetter() *types.Address
- func (it *IndustrialToken) GetID() string
- func (it *IndustrialToken) GetRateAndLimits(dealType string, currency string) (*proto.TokenRate, bool, error)
- func (it *IndustrialToken) Initialize(groups []Group) error
- func (it *IndustrialToken) Issuer() *types.Address
- func (it *IndustrialToken) QueryAllowedBalanceOf(address *types.Address, token string) (*big.Int, error)
- func (it *IndustrialToken) QueryDistribRequestsList() ([]DistribRequest, error)
- func (it *IndustrialToken) QueryDocumentsList() ([]core.Doc, error)
- func (it *IndustrialToken) QueryIndustrialBalanceOf(address *types.Address) (map[string]string, error)
- func (it *IndustrialToken) QueryMCRequestsList() ([]MaturityChangeRequest, error)
- func (it *IndustrialToken) QueryMetadata() (Metadata, error)
- func (it *IndustrialToken) QueryPredictFee(amount *big.Int) (Predict, error)
- func (it *IndustrialToken) QueryRedeemRequestsList() ([]RedeemRequest, error)
- func (it *IndustrialToken) TxAcceptDistribRequest(sender *types.Sender, requestID, _ string) error
- func (it *IndustrialToken) TxAcceptMCRequest(sender *types.Sender, requestID, _ string) error
- func (it *IndustrialToken) TxAcceptRedeemRequest(sender *types.Sender, requestID string, amount *big.Int, _ string) error
- func (it *IndustrialToken) TxAddDocs(sender *types.Sender, rawDocs string) error
- func (it *IndustrialToken) TxChangeGroupNote(sender *types.Sender, groupName, note string) error
- func (it *IndustrialToken) TxCreateDistribRequest(sender *types.Sender, args, ref string) error
- func (it *IndustrialToken) TxCreateMCRequest(sender *types.Sender, groupName, maturityDateString, ref string) error
- func (it *IndustrialToken) TxCreateRedeemRequest(sender *types.Sender, groupName string, amount *big.Int, ref string) error
- func (it *IndustrialToken) TxDeleteDoc(sender *types.Sender, docID string) error
- func (it *IndustrialToken) TxDenyDistribRequest(sender *types.Sender, requestID string) error
- func (it *IndustrialToken) TxDenyMCRequest(sender *types.Sender, requestID string) error
- func (it *IndustrialToken) TxDenyRedeemRequest(sender *types.Sender, requestID string) error
- func (it *IndustrialToken) TxIndustrialBuyBack(sender *types.Sender, group string, amount *big.Int, currency string) error
- func (it *IndustrialToken) TxSetFee(sender *types.Sender, currency string, fee *big.Int, floor *big.Int, ...) error
- func (it *IndustrialToken) TxSetFeeAddress(sender *types.Sender, address *types.Address) error
- func (it *IndustrialToken) TxSetLimits(sender *types.Sender, dealType string, currency string, min *big.Int, ...) error
- func (it *IndustrialToken) TxSetRate(sender *types.Sender, dealType string, currency string, rate *big.Int) error
- func (it *IndustrialToken) TxTransferIndustrial(sender *types.Sender, to *types.Address, group string, amount *big.Int, ...) error
- func (it *IndustrialToken) TxWithRights(sender *types.Sender) error
- func (it *IndustrialToken) ValidateExtConfig(cfgBytes []byte) error
- type MaturityChangeRequest
- type Metadata
- type MetadataGroup
- type Predict
- type RedeemRequest
Constants ¶
const (
RateDecimal = 8
)
Decimals const
Variables ¶
var File_ext_config_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type DistribRequest ¶
type DistribRequest struct { TransactionID string `json:"transactionId"` UserAddress *types.Address `json:"userAddress"` GroupsAmounts map[string]*big.Int `json:"groupsAmounts"` Ref string `json:"ref"` }
DistribRequest base struct
type ExtConfig ¶
type ExtConfig struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Decimals uint32 `protobuf:"varint,2,opt,name=decimals,proto3" json:"decimals,omitempty"` UnderlyingAsset string `protobuf:"bytes,3,opt,name=underlying_asset,json=underlyingAsset,proto3" json:"underlying_asset,omitempty"` DeliveryForm string `protobuf:"bytes,4,opt,name=delivery_form,json=deliveryForm,proto3" json:"delivery_form,omitempty"` UnitOfMeasure string `protobuf:"bytes,5,opt,name=unit_of_measure,json=unitOfMeasure,proto3" json:"unit_of_measure,omitempty"` TokensForUnit string `protobuf:"bytes,6,opt,name=tokens_for_unit,json=tokensForUnit,proto3" json:"tokens_for_unit,omitempty"` PaymentTerms string `protobuf:"bytes,7,opt,name=payment_terms,json=paymentTerms,proto3" json:"payment_terms,omitempty"` Price string `protobuf:"bytes,8,opt,name=price,proto3" json:"price,omitempty"` Issuer *proto.Wallet `protobuf:"bytes,9,opt,name=issuer,proto3" json:"issuer,omitempty"` FeeSetter *proto.Wallet `protobuf:"bytes,10,opt,name=fee_setter,json=feeSetter,proto3" json:"fee_setter,omitempty"` FeeAddressSetter *proto.Wallet `protobuf:"bytes,11,opt,name=fee_address_setter,json=feeAddressSetter,proto3" json:"fee_address_setter,omitempty"` // contains filtered or unexported fields }
func (*ExtConfig) Descriptor
deprecated
func (*ExtConfig) GetDecimals ¶
func (*ExtConfig) GetDeliveryForm ¶
func (*ExtConfig) GetFeeAddressSetter ¶
func (*ExtConfig) GetFeeSetter ¶
func (*ExtConfig) GetPaymentTerms ¶
func (*ExtConfig) GetTokensForUnit ¶
func (*ExtConfig) GetUnderlyingAsset ¶
func (*ExtConfig) GetUnitOfMeasure ¶
func (*ExtConfig) ProtoMessage ¶
func (*ExtConfig) ProtoMessage()
func (*ExtConfig) ProtoReflect ¶
func (x *ExtConfig) ProtoReflect() protoreflect.Message
func (*ExtConfig) Validate ¶
Validate checks the field values on ExtConfig with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*ExtConfig) ValidateAll ¶
ValidateAll checks the field values on ExtConfig with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ExtConfigMultiError, or nil if none found.
type ExtConfigMultiError ¶
type ExtConfigMultiError []error
ExtConfigMultiError is an error wrapping multiple validation errors returned by ExtConfig.ValidateAll() if the designated constraints aren't met.
func (ExtConfigMultiError) AllErrors ¶
func (m ExtConfigMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ExtConfigMultiError) Error ¶
func (m ExtConfigMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ExtConfigValidationError ¶
type ExtConfigValidationError struct {
// contains filtered or unexported fields
}
ExtConfigValidationError is the validation error returned by ExtConfig.Validate if the designated constraints aren't met.
func (ExtConfigValidationError) Cause ¶
func (e ExtConfigValidationError) Cause() error
Cause function returns cause value.
func (ExtConfigValidationError) Error ¶
func (e ExtConfigValidationError) Error() string
Error satisfies the builtin error interface
func (ExtConfigValidationError) ErrorName ¶
func (e ExtConfigValidationError) ErrorName() string
ErrorName returns error name.
func (ExtConfigValidationError) Field ¶
func (e ExtConfigValidationError) Field() string
Field function returns field value.
func (ExtConfigValidationError) Key ¶
func (e ExtConfigValidationError) Key() bool
Key function returns key value.
func (ExtConfigValidationError) Reason ¶
func (e ExtConfigValidationError) Reason() string
Reason function returns reason value.
type ITInterface ¶
type ITInterface interface { core.BaseContractInterface GetRateAndLimits(string, string) (*proto.TokenRate, bool, error) }
ITInterface - base method for an industrial token prototype
type IndustrialToken ¶
type IndustrialToken struct { core.BaseContract // contains filtered or unexported fields }
IndustrialToken base struct
func (*IndustrialToken) ApplyExtConfig ¶
func (it *IndustrialToken) ApplyExtConfig(cfgBytes []byte) error
func (*IndustrialToken) ChangeGroupMetadata ¶
func (it *IndustrialToken) ChangeGroupMetadata(groupName string, maturityDate time.Time, note string) error
ChangeGroupMetadata changes metadata for a group of token
func (*IndustrialToken) CheckLimitsAndPrice ¶
func (it *IndustrialToken) CheckLimitsAndPrice( method string, amount *big.Int, currency string, ) (*big.Int, error)
CheckLimitsAndPrice - checks limits and prices
func (*IndustrialToken) FeeAddressSetter ¶
func (it *IndustrialToken) FeeAddressSetter() *types.Address
func (*IndustrialToken) FeeSetter ¶
func (it *IndustrialToken) FeeSetter() *types.Address
func (*IndustrialToken) GetRateAndLimits ¶
func (it *IndustrialToken) GetRateAndLimits(dealType string, currency string) (*proto.TokenRate, bool, error)
GetRateAndLimits returns token rate and limits from metadata
func (*IndustrialToken) Initialize ¶
func (it *IndustrialToken) Initialize(groups []Group) error
Initialize - token initialization
func (*IndustrialToken) Issuer ¶
func (it *IndustrialToken) Issuer() *types.Address
func (*IndustrialToken) QueryAllowedBalanceOf ¶
func (it *IndustrialToken) QueryAllowedBalanceOf(address *types.Address, token string) (*big.Int, error)
QueryAllowedBalanceOf - returns allowed balance of the token for user address
func (*IndustrialToken) QueryDistribRequestsList ¶
func (it *IndustrialToken) QueryDistribRequestsList() ([]DistribRequest, error)
QueryDistribRequestsList returns list of distribution requests
func (*IndustrialToken) QueryDocumentsList ¶
func (it *IndustrialToken) QueryDocumentsList() ([]core.Doc, error)
QueryDocumentsList - returns list of emission documents
func (*IndustrialToken) QueryIndustrialBalanceOf ¶
func (it *IndustrialToken) QueryIndustrialBalanceOf(address *types.Address) (map[string]string, error)
QueryIndustrialBalanceOf - returns balance of the token for user address WARNING: DO NOT USE CODE LIKE THIS IN REAL TOKENS AS `map[string]string` IS NOT ORDERED AND WILL CAUSE ENDORSEMENT MISMATCH ON PEERS. THIS IS FOR TESTING PURPOSES ONLY. NOTE: THIS APPROACH IS USED DUE TO LEGACY CODE IN THE FOUNDATION LIBRARY. IMPLEMENTING A PROPER SOLUTION WOULD REQUIRE SIGNIFICANT CHANGES.
func (*IndustrialToken) QueryMCRequestsList ¶
func (it *IndustrialToken) QueryMCRequestsList() ([]MaturityChangeRequest, error)
QueryMCRequestsList returns list of maturity dates change requests
func (*IndustrialToken) QueryMetadata ¶
func (it *IndustrialToken) QueryMetadata() (Metadata, error)
QueryMetadata returns token Metadata
func (*IndustrialToken) QueryPredictFee ¶
func (it *IndustrialToken) QueryPredictFee(amount *big.Int) (Predict, error)
QueryPredictFee calculates fee
func (*IndustrialToken) QueryRedeemRequestsList ¶
func (it *IndustrialToken) QueryRedeemRequestsList() ([]RedeemRequest, error)
QueryRedeemRequestsList returns list of redemption requests
func (*IndustrialToken) TxAcceptDistribRequest ¶
func (it *IndustrialToken) TxAcceptDistribRequest(sender *types.Sender, requestID, _ string) error
TxAcceptDistribRequest - accepts request for tokens distribution
func (*IndustrialToken) TxAcceptMCRequest ¶
func (it *IndustrialToken) TxAcceptMCRequest(sender *types.Sender, requestID, _ string) error
TxAcceptMCRequest - accepts request for tokens maturity date change
func (*IndustrialToken) TxAcceptRedeemRequest ¶
func (it *IndustrialToken) TxAcceptRedeemRequest(sender *types.Sender, requestID string, amount *big.Int, _ string) error
TxAcceptRedeemRequest - accepts request for tokens redemption
func (*IndustrialToken) TxAddDocs ¶
func (it *IndustrialToken) TxAddDocs(sender *types.Sender, rawDocs string) error
TxAddDocs - adds docs to a token
func (*IndustrialToken) TxChangeGroupNote ¶
func (it *IndustrialToken) TxChangeGroupNote(sender *types.Sender, groupName, note string) error
TxChangeGroupNote changes token group note
func (*IndustrialToken) TxCreateDistribRequest ¶
func (it *IndustrialToken) TxCreateDistribRequest(sender *types.Sender, args, ref string) error
TxCreateDistribRequest creates distribution request
func (*IndustrialToken) TxCreateMCRequest ¶
func (it *IndustrialToken) TxCreateMCRequest(sender *types.Sender, groupName, maturityDateString, ref string) error
TxCreateMCRequest creates maturity date change request
func (*IndustrialToken) TxCreateRedeemRequest ¶
func (it *IndustrialToken) TxCreateRedeemRequest(sender *types.Sender, groupName string, amount *big.Int, ref string) error
TxCreateRedeemRequest creates redeem request
func (*IndustrialToken) TxDeleteDoc ¶
func (it *IndustrialToken) TxDeleteDoc(sender *types.Sender, docID string) error
TxDeleteDoc - deletes doc from state
func (*IndustrialToken) TxDenyDistribRequest ¶
func (it *IndustrialToken) TxDenyDistribRequest(sender *types.Sender, requestID string) error
TxDenyDistribRequest - denys request for tokens distribution
func (*IndustrialToken) TxDenyMCRequest ¶
func (it *IndustrialToken) TxDenyMCRequest(sender *types.Sender, requestID string) error
TxDenyMCRequest - denys request for tokens maturity date change
func (*IndustrialToken) TxDenyRedeemRequest ¶
func (it *IndustrialToken) TxDenyRedeemRequest(sender *types.Sender, requestID string) error
TxDenyRedeemRequest - denys request for tokens redemption
func (*IndustrialToken) TxIndustrialBuyBack ¶
func (it *IndustrialToken) TxIndustrialBuyBack( sender *types.Sender, group string, amount *big.Int, currency string, ) error
TxIndustrialBuyBack - method for token buyback
func (*IndustrialToken) TxSetFee ¶
func (it *IndustrialToken) TxSetFee(sender *types.Sender, currency string, fee *big.Int, floor *big.Int, cap *big.Int) error
TxSetFee sets fee values to config
func (*IndustrialToken) TxSetFeeAddress ¶
TxSetFeeAddress sets fee address
func (*IndustrialToken) TxSetLimits ¶
func (it *IndustrialToken) 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
func (*IndustrialToken) TxSetRate ¶
func (it *IndustrialToken) TxSetRate(sender *types.Sender, dealType string, currency string, rate *big.Int) error
TxSetRate sets token rate to an asset for a type of deal
func (*IndustrialToken) TxTransferIndustrial ¶
func (it *IndustrialToken) TxTransferIndustrial(sender *types.Sender, to *types.Address, group string, amount *big.Int, _ string) error
TxTransferIndustrial transfers token to user address
func (*IndustrialToken) TxWithRights ¶ added in v0.0.3
func (it *IndustrialToken) TxWithRights(sender *types.Sender) error
func (*IndustrialToken) ValidateExtConfig ¶
func (it *IndustrialToken) ValidateExtConfig(cfgBytes []byte) error
type MaturityChangeRequest ¶
type MaturityChangeRequest struct { TransactionID string `json:"transactionId"` UserAddress *types.Address `json:"userAddress"` GroupName string `json:"groupName"` MaturityDate time.Time `json:"maturityDate"` Ref string `json:"ref"` }
MaturityChangeRequest base struct
type Metadata ¶
type Metadata struct { Name string `json:"name"` Symbol string `json:"symbol"` Decimals uint `json:"decimals"` UnderlyingAsset string `json:"underlying_asset"` Issuer string `json:"issuer"` DeliveryForm string `json:"deliveryForm"` UnitOfMeasure string `json:"unitOfMeasure"` TokensForUnit string `json:"tokensForUnit"` PaymentTerms string `json:"paymentTerms"` Price string `json:"price"` Methods []string `json:"methods"` Groups []MetadataGroup `json:"groups"` Fee fee `json:"fee"` Rates []metadataRate `json:"rates"` }