Documentation ¶
Index ¶
- Constants
- Variables
- func AccAddressesToString(addresses []sdk.AccAddress) (result string)
- func AdjustFees(fees sdk.Coins, maxFees sdk.Coins) sdk.Coins
- func CheckCoinDenom(denom string) (err sdk.Error)
- func CheckNoOfReserveTokens(resTokens []string, fnType string) sdk.Error
- func CheckReserveTokenNames(resTokens []string, token string) sdk.Error
- func DivideDecCoinByDec(dc sdk.DecCoin, scale sdk.Dec) sdk.DecCoin
- func DivideDecCoinsByDec(dcs sdk.DecCoins, scale sdk.Dec) (scaled sdk.DecCoins)
- func ErrArgumentCannotBeEmpty(codespace sdk.CodespaceType, argument string) sdk.Error
- func ErrArgumentCannotBeNegative(codespace sdk.CodespaceType, arg string) sdk.Error
- func ErrArgumentMissingOrNonBoolean(codespace sdk.CodespaceType, arg string) sdk.Error
- func ErrArgumentMissingOrNonFloat(codespace sdk.CodespaceType, arg string) sdk.Error
- func ErrArgumentMissingOrNonInteger(codespace sdk.CodespaceType, arg string) sdk.Error
- func ErrArgumentMissingOrNonUInteger(codespace sdk.CodespaceType, arg string) sdk.Error
- func ErrArgumentMustBePositive(codespace sdk.CodespaceType, arg string) sdk.Error
- func ErrBondAlreadyExists(codespace sdk.CodespaceType, bondDid did.Did) sdk.Error
- func ErrBondDoesNotAllowSelling(codespace sdk.CodespaceType) sdk.Error
- func ErrBondDoesNotExist(codespace sdk.CodespaceType, bondDid did.Did) sdk.Error
- func ErrBondTokenCannotAlsoBeReserveToken(codespace sdk.CodespaceType) sdk.Error
- func ErrBondTokenCannotBeStakingToken(codespace sdk.CodespaceType) sdk.Error
- func ErrBondTokenDoesNotMatchBond(codespace sdk.CodespaceType) sdk.Error
- func ErrBondTokenIsTaken(codespace sdk.CodespaceType, bondToken string) sdk.Error
- func ErrCannotBurnMoreThanSupply(codespace sdk.CodespaceType) sdk.Error
- func ErrCannotMintMoreThanMaxSupply(codespace sdk.CodespaceType) sdk.Error
- func ErrDidNotEditAnything(codespace sdk.CodespaceType) sdk.Error
- func ErrDuplicateReserveToken(codespace sdk.CodespaceType) sdk.Error
- func ErrFeesCannotBeOrExceed100Percent(codespace sdk.CodespaceType) sdk.Error
- func ErrFromAndToCannotBeTheSameToken(codespace sdk.CodespaceType) sdk.Error
- func ErrFunctionNotAvailableForFunctionType(codespace sdk.CodespaceType) sdk.Error
- func ErrFunctionParameterMissingOrNonInteger(codespace sdk.CodespaceType, param string) sdk.Error
- func ErrFunctionRequiresNonZeroCurrentSupply(codespace sdk.CodespaceType) sdk.Error
- func ErrIncorrectNumberOfFunctionParameters(codespace sdk.CodespaceType, expected int) sdk.Error
- func ErrIncorrectNumberOfReserveTokens(codespace sdk.CodespaceType, expected int) sdk.Error
- func ErrInvalidCoinDenomination(codespace sdk.CodespaceType, denom string) sdk.Error
- func ErrInvalidFunctionParameter(codespace sdk.CodespaceType, parameter string) sdk.Error
- func ErrMaxPriceExceeded(codespace sdk.CodespaceType, totalPrice, maxPrice sdk.Coins) sdk.Error
- func ErrMaxSupplyDenomDoesNotMatchTokenDenom(codespace sdk.CodespaceType) sdk.Error
- func ErrOrderQuantityLimitExceeded(codespace sdk.CodespaceType) sdk.Error
- func ErrReserveDenomsMismatch(codespace sdk.CodespaceType, inputDenoms string, actualDenoms []string) sdk.Error
- func ErrSwapAmountCausesReserveDepletion(codespace sdk.CodespaceType, fromToken, toToken string) sdk.Error
- func ErrSwapAmountTooSmallToGiveAnyReturn(codespace sdk.CodespaceType, fromToken, toToken string) sdk.Error
- func ErrTokenIsNotAValidReserveToken(codespace sdk.CodespaceType, denom string) sdk.Error
- func ErrUnrecognizedFunctionType(codespace sdk.CodespaceType) sdk.Error
- func ErrValuesViolateSanityRate(codespace sdk.CodespaceType) sdk.Error
- func GetBatchKey(bondDid did.Did) []byte
- func GetBondDidsKey(token string) []byte
- func GetBondKey(bondDid did.Did) []byte
- func GetLastBatchKey(bondDid did.Did) []byte
- func GetRequiredParamsForFunctionType(fnType string) (fnParams []string, err sdk.Error)
- func MultiplyDecCoinByDec(dc sdk.DecCoin, scale sdk.Dec) sdk.DecCoin
- func MultiplyDecCoinByInt(dc sdk.DecCoin, scale sdk.Int) sdk.DecCoin
- func MultiplyDecCoinsByDec(dcs sdk.DecCoins, scale sdk.Dec) (scaled sdk.DecCoins)
- func MultiplyDecCoinsByInt(dcs sdk.DecCoins, scale sdk.Int) (scaled sdk.DecCoins)
- func RegisterCodec(cdc *codec.Codec)
- func RoundFee(f sdk.DecCoin) sdk.Coin
- func RoundReservePrice(p sdk.DecCoin) sdk.Coin
- func RoundReservePrices(ps sdk.DecCoins) (rounded sdk.Coins)
- func RoundReserveReturn(r sdk.DecCoin) sdk.Coin
- func RoundReserveReturns(rs sdk.DecCoins) (rounded sdk.Coins)
- func SquareRootDec(d sdk.Dec) sdk.Dec
- func SquareRootInt(i sdk.Int) sdk.Dec
- func StringsToString(strs []string) (result string)
- func ValidateGenesis(data GenesisState) error
- type BaseOrder
- type Batch
- type Bond
- func (bond Bond) AnyOrderQuantityLimitsExceeded(amounts sdk.Coins) bool
- func (bond Bond) CurveIntegral(supply sdk.Int) (result sdk.Dec)
- func (bond Bond) GetCurrentPricesPT(reserveBalances sdk.Coins) (sdk.DecCoins, sdk.Error)
- func (bond Bond) GetExitFee(reserveAmount sdk.DecCoin) sdk.Coin
- func (bond Bond) GetExitFees(reserveAmounts sdk.DecCoins) (fees sdk.Coins)
- func (bond Bond) GetNewReserveDecCoins(amount sdk.Dec) (coins sdk.DecCoins)
- func (bond Bond) GetPricesAtSupply(supply sdk.Int) (result sdk.DecCoins, err sdk.Error)
- func (bond Bond) GetPricesToMint(mint sdk.Int, reserveBalances sdk.Coins) (sdk.DecCoins, sdk.Error)
- func (bond Bond) GetReserveDeltaForLiquidityDelta(mintOrBurn sdk.Int, reserveBalances sdk.Coins) sdk.DecCoins
- func (bond Bond) GetReturnsForBurn(burn sdk.Int, reserveBalances sdk.Coins) sdk.DecCoins
- func (bond Bond) GetReturnsForSwap(from sdk.Coin, toToken string, reserveBalances sdk.Coins) (returns sdk.Coins, txFee sdk.Coin, err sdk.Error)
- func (bond Bond) GetTxFee(reserveAmount sdk.DecCoin) sdk.Coin
- func (bond Bond) GetTxFees(reserveAmounts sdk.DecCoins) (fees sdk.Coins)
- func (bond Bond) ReserveDenomsEqualTo(coins sdk.Coins) bool
- func (bond Bond) ReservesViolateSanityRate(newReserves sdk.Coins) bool
- type BuyOrder
- type CodeType
- type FunctionParam
- type FunctionParamRestrictions
- type FunctionParams
- type GenesisState
- type MsgBuy
- type MsgCreateBond
- type MsgEditBond
- type MsgSell
- type MsgSwap
- type QueryBonds
- type QueryBuyPrice
- type QuerySellReturn
- type QuerySwapReturn
- type SellOrder
- type SwapOrder
Constants ¶
View Source
const ( PowerFunction = "power_function" SigmoidFunction = "sigmoid_function" SwapperFunction = "swapper_function" DoNotModifyField = "[do-not-modify]" AnyNumberOfReserveTokens = -1 )
View Source
const ( EventTypeCreateBond = "create_bond" EventTypeEditBond = "edit_bond" EventTypeInitSwapper = "init_swapper" EventTypeBuy = "buy" EventTypeSell = "sell" EventTypeSwap = "swap" EventTypeOrderCancel = "order_cancel" EventTypeOrderFulfill = "order_fulfill" AttributeKeyBondDid = "bond_did" AttributeKeyToken = "token" AttributeKeyName = "name" AttributeKeyDescription = "description" AttributeKeyFunctionType = "function_type" AttributeKeyFunctionParameters = "function_parameters" AttributeKeyReserveTokens = "reserve_tokens" AttributeKeyReserveAddress = "reserve_address" AttributeKeyTxFeePercentage = "tx_fee_percentage" AttributeKeyExitFeePercentage = "exit_fee_percentage" AttributeKeyFeeAddress = "fee_address" AttributeKeyMaxSupply = "max_supply" AttributeKeyOrderQuantityLimits = "order_quantity_limits" AttributeKeySanityRate = "sanity_rate" AttributeKeySanityMarginPercentage = "sanity_margin_percentage" AttributeKeyAllowSells = "allow_sells" AttributeKeyBatchBlocks = "batch_blocks" AttributeKeyMaxPrices = "max_prices" AttributeKeySwapFromToken = "from_token" AttributeKeySwapToToken = "to_token" AttributeKeyOrderType = "order_type" AttributeKeyAddress = "address" AttributeKeyCancelReason = "cancel_reason" AttributeKeyTokensMinted = "tokens_minted" AttributeKeyTokensBurned = "tokens_burned" AttributeKeyTokensSwapped = "tokens_swapped" AttributeKeyChargedPrices = "charged_prices" AttributeKeyChargedFees = "charged_fees" AttributeKeyReturnedToAddress = "returned_to_address" AttributeKeyNewBondTokenBalance = "new_bond_token_balance" AttributeValueBuyOrder = "buy" AttributeValueSellOrder = "sell" AttributeValueSwapOrder = "swap" AttributeValueCategory = ModuleName )
View Source
const ( // ModuleName is the name of this module ModuleName = "bonds" // StoreKey is the default store key for this module StoreKey = ModuleName // BondsMintBurnAccount the root string for the bonds mint burn account address BondsMintBurnAccount = "bonds_mint_burn_account" // BatchesIntermediaryAccount the root string for the batches account address BatchesIntermediaryAccount = "batches_intermediary_account" // QuerierRoute is the querier route for this module's store. QuerierRoute = ModuleName // RouterKey is the message route for this module RouterKey = ModuleName )
View Source
const ( TypeMsgCreateBond = "create_bond" TypeMsgEditBond = "edit_bond" TypeMsgBuy = "buy" TypeMsgSell = "sell" TypeMsgSwap = "swap" )
View Source
const ( TRUE = "true" FALSE = "false" )
Variables ¶
View Source
var ( RequiredParamsForFunctionType = map[string][]string{ PowerFunction: {"m", "n", "c"}, SigmoidFunction: {"a", "b", "c"}, SwapperFunction: nil, } NoOfReserveTokensForFunctionType = map[string]int{ PowerFunction: AnyNumberOfReserveTokens, SigmoidFunction: AnyNumberOfReserveTokens, SwapperFunction: 2, } ExtraParameterRestrictions = map[string]FunctionParamRestrictions{ PowerFunction: nil, SigmoidFunction: sigmoidParameterRestrictions, SwapperFunction: nil, } )
View Source
var ( BondsKeyPrefix = []byte{0x00} // key for bonds BatchesKeyPrefix = []byte{0x01} // key for batches LastBatchesKeyPrefix = []byte{0x02} // key for last batches BondDidsKeyPrefix = []byte{0x03} // key for bond DIDs )
Bonds and batches are stored as follow:
- Bonds: 0x00<bond_did_bytes> - Batches: 0x01<bond_did_bytes> - Last batches: 0x02<bond_did_bytes> - Bond DIDs: 0x03<bond_token_bytes>
View Source
var ModuleCdc *codec.Codec
ModuleCdc is the codec for the module
Functions ¶
func AccAddressesToString ¶
func AccAddressesToString(addresses []sdk.AccAddress) (result string)
func CheckCoinDenom ¶
func CheckNoOfReserveTokens ¶
func CheckReserveTokenNames ¶
func DivideDecCoinsByDec ¶
noinspection GoNilness
func ErrArgumentCannotBeEmpty ¶
func ErrArgumentCannotBeEmpty(codespace sdk.CodespaceType, argument string) sdk.Error
func ErrArgumentCannotBeNegative ¶
func ErrArgumentCannotBeNegative(codespace sdk.CodespaceType, arg string) sdk.Error
func ErrArgumentMissingOrNonBoolean ¶
func ErrArgumentMissingOrNonBoolean(codespace sdk.CodespaceType, arg string) sdk.Error
func ErrArgumentMissingOrNonFloat ¶
func ErrArgumentMissingOrNonFloat(codespace sdk.CodespaceType, arg string) sdk.Error
func ErrArgumentMissingOrNonInteger ¶
func ErrArgumentMissingOrNonInteger(codespace sdk.CodespaceType, arg string) sdk.Error
func ErrArgumentMissingOrNonUInteger ¶
func ErrArgumentMissingOrNonUInteger(codespace sdk.CodespaceType, arg string) sdk.Error
func ErrArgumentMustBePositive ¶
func ErrArgumentMustBePositive(codespace sdk.CodespaceType, arg string) sdk.Error
func ErrBondAlreadyExists ¶
func ErrBondDoesNotAllowSelling ¶
func ErrBondDoesNotAllowSelling(codespace sdk.CodespaceType) sdk.Error
func ErrBondDoesNotExist ¶
func ErrBondTokenCannotAlsoBeReserveToken ¶
func ErrBondTokenCannotAlsoBeReserveToken(codespace sdk.CodespaceType) sdk.Error
func ErrBondTokenCannotBeStakingToken ¶
func ErrBondTokenCannotBeStakingToken(codespace sdk.CodespaceType) sdk.Error
func ErrBondTokenDoesNotMatchBond ¶
func ErrBondTokenDoesNotMatchBond(codespace sdk.CodespaceType) sdk.Error
func ErrBondTokenIsTaken ¶
func ErrBondTokenIsTaken(codespace sdk.CodespaceType, bondToken string) sdk.Error
func ErrCannotBurnMoreThanSupply ¶
func ErrCannotBurnMoreThanSupply(codespace sdk.CodespaceType) sdk.Error
func ErrCannotMintMoreThanMaxSupply ¶
func ErrCannotMintMoreThanMaxSupply(codespace sdk.CodespaceType) sdk.Error
func ErrDidNotEditAnything ¶
func ErrDidNotEditAnything(codespace sdk.CodespaceType) sdk.Error
func ErrDuplicateReserveToken ¶
func ErrDuplicateReserveToken(codespace sdk.CodespaceType) sdk.Error
func ErrFeesCannotBeOrExceed100Percent ¶
func ErrFeesCannotBeOrExceed100Percent(codespace sdk.CodespaceType) sdk.Error
func ErrFromAndToCannotBeTheSameToken ¶
func ErrFromAndToCannotBeTheSameToken(codespace sdk.CodespaceType) sdk.Error
func ErrFunctionNotAvailableForFunctionType ¶
func ErrFunctionNotAvailableForFunctionType(codespace sdk.CodespaceType) sdk.Error
func ErrFunctionParameterMissingOrNonInteger ¶
func ErrFunctionParameterMissingOrNonInteger(codespace sdk.CodespaceType, param string) sdk.Error
func ErrFunctionRequiresNonZeroCurrentSupply ¶
func ErrFunctionRequiresNonZeroCurrentSupply(codespace sdk.CodespaceType) sdk.Error
func ErrIncorrectNumberOfFunctionParameters ¶
func ErrIncorrectNumberOfFunctionParameters(codespace sdk.CodespaceType, expected int) sdk.Error
func ErrIncorrectNumberOfReserveTokens ¶
func ErrIncorrectNumberOfReserveTokens(codespace sdk.CodespaceType, expected int) sdk.Error
func ErrInvalidCoinDenomination ¶
func ErrInvalidCoinDenomination(codespace sdk.CodespaceType, denom string) sdk.Error
func ErrInvalidFunctionParameter ¶
func ErrInvalidFunctionParameter(codespace sdk.CodespaceType, parameter string) sdk.Error
func ErrMaxPriceExceeded ¶
func ErrMaxSupplyDenomDoesNotMatchTokenDenom ¶
func ErrMaxSupplyDenomDoesNotMatchTokenDenom(codespace sdk.CodespaceType) sdk.Error
func ErrOrderQuantityLimitExceeded ¶
func ErrOrderQuantityLimitExceeded(codespace sdk.CodespaceType) sdk.Error
func ErrSwapAmountCausesReserveDepletion ¶
func ErrSwapAmountCausesReserveDepletion(codespace sdk.CodespaceType, fromToken, toToken string) sdk.Error
func ErrSwapAmountTooSmallToGiveAnyReturn ¶
func ErrSwapAmountTooSmallToGiveAnyReturn(codespace sdk.CodespaceType, fromToken, toToken string) sdk.Error
func ErrTokenIsNotAValidReserveToken ¶
func ErrTokenIsNotAValidReserveToken(codespace sdk.CodespaceType, denom string) sdk.Error
func ErrUnrecognizedFunctionType ¶
func ErrUnrecognizedFunctionType(codespace sdk.CodespaceType) sdk.Error
func ErrValuesViolateSanityRate ¶
func ErrValuesViolateSanityRate(codespace sdk.CodespaceType) sdk.Error
func GetBatchKey ¶
func GetBondDidsKey ¶
func GetBondKey ¶
func GetLastBatchKey ¶
func MultiplyDecCoinsByDec ¶
noinspection GoNilness
func MultiplyDecCoinsByInt ¶
noinspection GoNilness
func RegisterCodec ¶
func RoundReservePrices ¶
noinspection GoNilness
func RoundReserveReturns ¶
noinspection GoNilness
func StringsToString ¶
Types ¶
type BaseOrder ¶
type BaseOrder struct { AccountDid did.Did `json:"sender_did" yaml:"sender_did"` Amount sdk.Coin `json:"amount" yaml:"amount"` Cancelled string `json:"cancelled" yaml:"cancelled"` CancelReason string `json:"cancel_reason" yaml:"cancel_reason"` }
func (BaseOrder) IsCancelled ¶
type Batch ¶
type Batch struct { BondDid did.Did `json:"bond_did" yaml:"bond_did"` BlocksRemaining sdk.Uint `json:"blocks_remaining" yaml:"blocks_remaining"` TotalBuyAmount sdk.Coin `json:"total_buy_amount" yaml:"total_buy_amount"` TotalSellAmount sdk.Coin `json:"total_sell_amount" yaml:"total_sell_amount"` BuyPrices sdk.DecCoins `json:"buy_prices" yaml:"buy_prices"` SellPrices sdk.DecCoins `json:"sell_prices" yaml:"sell_prices"` Buys []BuyOrder `json:"buys" yaml:"buys"` Sells []SellOrder `json:"sells" yaml:"sells"` Swaps []SwapOrder `json:"swaps" yaml:"swaps"` }
func (Batch) EqualBuysAndSells ¶
func (Batch) MoreBuysThanSells ¶
func (Batch) MoreSellsThanBuys ¶
type Bond ¶
type Bond struct { Token string `json:"token" yaml:"token"` Name string `json:"name" yaml:"name"` Description string `json:"description" yaml:"description"` CreatorDid did.Did `json:"creator_did" yaml:"creator_did"` FunctionType string `json:"function_type" yaml:"function_type"` FunctionParameters FunctionParams `json:"function_parameters" yaml:"function_parameters"` ReserveTokens []string `json:"reserve_tokens" yaml:"reserve_tokens"` ReserveAddress sdk.AccAddress `json:"reserve_address" yaml:"reserve_address"` TxFeePercentage sdk.Dec `json:"tx_fee_percentage" yaml:"tx_fee_percentage"` ExitFeePercentage sdk.Dec `json:"exit_fee_percentage" yaml:"exit_fee_percentage"` FeeAddress sdk.AccAddress `json:"fee_address" yaml:"fee_address"` MaxSupply sdk.Coin `json:"max_supply" yaml:"max_supply"` OrderQuantityLimits sdk.Coins `json:"order_quantity_limits" yaml:"order_quantity_limits"` SanityRate sdk.Dec `json:"sanity_rate" yaml:"sanity_rate"` SanityMarginPercentage sdk.Dec `json:"sanity_margin_percentage" yaml:"sanity_margin_percentage"` CurrentSupply sdk.Coin `json:"current_supply" yaml:"current_supply"` AllowSells string `json:"allow_sells" yaml:"allow_sells"` BatchBlocks sdk.Uint `json:"batch_blocks" yaml:"batch_blocks"` BondDid did.Did `json:"bond_did" yaml:"bond_did"` }
func NewBond ¶
func NewBond(token, name, description string, creatorDid did.Did, functionType string, functionParameters FunctionParams, reserveTokens []string, reserveAdddress sdk.AccAddress, txFeePercentage, exitFeePercentage sdk.Dec, feeAddress sdk.AccAddress, maxSupply sdk.Coin, orderQuantityLimits sdk.Coins, sanityRate, sanityMarginPercentage sdk.Dec, allowSells string, batchBlocks sdk.Uint, bondDid did.Did) Bond
func (Bond) AnyOrderQuantityLimitsExceeded ¶
func (Bond) GetCurrentPricesPT ¶
func (Bond) GetExitFees ¶
noinspection GoNilness
func (Bond) GetNewReserveDecCoins ¶
noinspection GoNilness
func (Bond) GetPricesAtSupply ¶
func (Bond) GetPricesToMint ¶
func (Bond) GetReserveDeltaForLiquidityDelta ¶
func (Bond) GetReturnsForBurn ¶
func (Bond) GetReturnsForSwap ¶
type CodeType ¶
Local code type
const ( DefaultCodespace sdk.CodespaceType = ModuleName // General CodeArgumentInvalid CodeType = 301 CodeArgumentMissingOrIncorrectType CodeType = 302 CodeIncorrectNumberOfValues CodeType = 303 // Bonds CodeBondDoesNotExist CodeType = 304 CodeBondAlreadyExists CodeType = 305 CodeBondDoesNotAllowSelling CodeType = 306 CodeDidNotEditAnything CodeType = 307 CodeInvalidSwapper CodeType = 308 CodeInvalidBond CodeType = 309 // Function types and function parameters CodeUnrecognizedFunctionType CodeType = 310 CodeInvalidFunctionParameter CodeType = 311 CodeFunctionNotAvailableForFunctionType CodeType = 312 CodeFunctionRequiresNonZeroCurrentSupply CodeType = 313 // Token/coin names CodeReserveTokenInvalid CodeType = 314 CodeMaxSupplyDenomInvalid CodeType = 315 CodeBondTokenInvalid CodeType = 316 CodeReserveDenomsMismatch CodeType = 317 CodeInvalidCoinDenomination CodeType = 318 // Amounts and fees CodeInvalidResultantSupply CodeType = 319 CodeMaxPriceExceeded CodeType = 320 CodeSwapAmountInvalid CodeType = 321 CodeOrderLimitExceeded CodeType = 322 CodeSanityRateViolated CodeType = 323 CodeFeeTooLarge CodeType = 324 )
type FunctionParam ¶
type FunctionParam struct { Param string `json:"param" yaml:"param"` Value sdk.Int `json:"value" yaml:"value"` }
func NewFunctionParam ¶
func NewFunctionParam(param string, value sdk.Int) FunctionParam
type FunctionParamRestrictions ¶
func GetExceptionsForFunctionType ¶
func GetExceptionsForFunctionType(fnType string) (restrictions FunctionParamRestrictions, err sdk.Error)
type FunctionParams ¶
type FunctionParams []FunctionParam
func (FunctionParams) String ¶
func (fps FunctionParams) String() (result string)
type GenesisState ¶
type GenesisState struct { Bonds []Bond `json:"bonds" yaml:"bonds"` Batches []Batch `json:"batches" yaml:"batches"` }
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
func NewGenesisState ¶
func NewGenesisState(bonds []Bond, batches []Batch) GenesisState
type MsgBuy ¶
type MsgBuy struct { BuyerDid did.Did `json:"buyer_did" yaml:"buyer_did"` Amount sdk.Coin `json:"amount" yaml:"amount"` MaxPrices sdk.Coins `json:"max_prices" yaml:"max_prices"` BondDid did.Did `json:"bond_did" yaml:"bond_did"` }
func (MsgBuy) GetSignBytes ¶
func (MsgBuy) GetSignerDid ¶
func (MsgBuy) GetSigners ¶
func (msg MsgBuy) GetSigners() []sdk.AccAddress
func (MsgBuy) ValidateBasic ¶
type MsgCreateBond ¶
type MsgCreateBond struct { BondDid did.Did `json:"bond_did" yaml:"bond_did"` Token string `json:"token" yaml:"token"` Name string `json:"name" yaml:"name"` Description string `json:"description" yaml:"description"` FunctionType string `json:"function_type" yaml:"function_type"` FunctionParameters FunctionParams `json:"function_parameters" yaml:"function_parameters"` CreatorDid did.Did `json:"creator_did" yaml:"creator_did"` ReserveTokens []string `json:"reserve_tokens" yaml:"reserve_tokens"` TxFeePercentage sdk.Dec `json:"tx_fee_percentage" yaml:"tx_fee_percentage"` ExitFeePercentage sdk.Dec `json:"exit_fee_percentage" yaml:"exit_fee_percentage"` FeeAddress sdk.AccAddress `json:"fee_address" yaml:"fee_address"` MaxSupply sdk.Coin `json:"max_supply" yaml:"max_supply"` OrderQuantityLimits sdk.Coins `json:"order_quantity_limits" yaml:"order_quantity_limits"` SanityRate sdk.Dec `json:"sanity_rate" yaml:"sanity_rate"` SanityMarginPercentage sdk.Dec `json:"sanity_margin_percentage" yaml:"sanity_margin_percentage"` AllowSells string `json:"allow_sells" yaml:"allow_sells"` BatchBlocks sdk.Uint `json:"batch_blocks" yaml:"batch_blocks"` }
func NewMsgCreateBond ¶
func NewMsgCreateBond(token, name, description string, creatorDid did.Did, functionType string, functionParameters FunctionParams, reserveTokens []string, txFeePercentage, exitFeePercentage sdk.Dec, feeAddress sdk.AccAddress, maxSupply sdk.Coin, orderQuantityLimits sdk.Coins, sanityRate, sanityMarginPercentage sdk.Dec, allowSell string, batchBlocks sdk.Uint, bondDid did.Did) MsgCreateBond
func (MsgCreateBond) GetSignBytes ¶
func (msg MsgCreateBond) GetSignBytes() []byte
func (MsgCreateBond) GetSignerDid ¶
func (msg MsgCreateBond) GetSignerDid() did.Did
func (MsgCreateBond) GetSigners ¶
func (msg MsgCreateBond) GetSigners() []sdk.AccAddress
func (MsgCreateBond) Route ¶
func (msg MsgCreateBond) Route() string
func (MsgCreateBond) Type ¶
func (msg MsgCreateBond) Type() string
func (MsgCreateBond) ValidateBasic ¶
func (msg MsgCreateBond) ValidateBasic() sdk.Error
type MsgEditBond ¶
type MsgEditBond struct { BondDid did.Did `json:"bond_did" yaml:"bond_did"` Token string `json:"token" yaml:"token"` Name string `json:"name" yaml:"name"` Description string `json:"description" yaml:"description"` OrderQuantityLimits string `json:"order_quantity_limits" yaml:"order_quantity_limits"` SanityRate string `json:"sanity_rate" yaml:"sanity_rate"` SanityMarginPercentage string `json:"sanity_margin_percentage" yaml:"sanity_margin_percentage"` EditorDid did.Did `json:"editor_did" yaml:"editor_did"` }
func NewMsgEditBond ¶
func (MsgEditBond) GetSignBytes ¶
func (msg MsgEditBond) GetSignBytes() []byte
func (MsgEditBond) GetSignerDid ¶
func (msg MsgEditBond) GetSignerDid() did.Did
func (MsgEditBond) GetSigners ¶
func (msg MsgEditBond) GetSigners() []sdk.AccAddress
func (MsgEditBond) Route ¶
func (msg MsgEditBond) Route() string
func (MsgEditBond) Type ¶
func (msg MsgEditBond) Type() string
func (MsgEditBond) ValidateBasic ¶
func (msg MsgEditBond) ValidateBasic() sdk.Error
type MsgSell ¶
type MsgSell struct { SellerDid did.Did `json:"seller_did" yaml:"seller_did"` Amount sdk.Coin `json:"amount" yaml:"amount"` BondDid did.Did `json:"bond_did" yaml:"bond_did"` }
func (MsgSell) GetSignBytes ¶
func (MsgSell) GetSignerDid ¶
func (MsgSell) GetSigners ¶
func (msg MsgSell) GetSigners() []sdk.AccAddress
func (MsgSell) ValidateBasic ¶
type MsgSwap ¶
type MsgSwap struct { SwapperDid did.Did `json:"swapper_did" yaml:"swapper_did"` BondDid did.Did `json:"bond_did" yaml:"bond_did"` From sdk.Coin `json:"from" yaml:"from"` ToToken string `json:"to_token" yaml:"to_token"` }
func NewMsgSwap ¶
func (MsgSwap) GetSignBytes ¶
func (MsgSwap) GetSignerDid ¶
func (MsgSwap) GetSigners ¶
func (msg MsgSwap) GetSigners() []sdk.AccAddress
func (MsgSwap) ValidateBasic ¶
type QueryBonds ¶
type QueryBonds []string
func (QueryBonds) String ¶
func (b QueryBonds) String() string
type QueryBuyPrice ¶
type QueryBuyPrice struct { AdjustedSupply sdk.Coin `json:"adjusted_supply" yaml:"asdjusted_supply"` Prices sdk.Coins `json:"prices" yaml:"prices"` TxFees sdk.Coins `json:"tx_fees" yaml:"tx_fees"` TotalPrices sdk.Coins `json:"total_prices" yaml:"total_prices"` TotalFees sdk.Coins `json:"total_fees" yaml:"total_fees"` }
type QuerySellReturn ¶
type QuerySellReturn struct { AdjustedSupply sdk.Coin `json:"adjusted_supply" yaml:"asdjusted_supply"` Returns sdk.Coins `json:"returns" yaml:"returns"` TxFees sdk.Coins `json:"tx_fees" yaml:"tx_fees"` ExitFees sdk.Coins `json:"exit_fees" yaml:"exit_fees"` TotalReturns sdk.Coins `json:"total_returns" yaml:"total_returns"` TotalFees sdk.Coins `json:"total_fees" yaml:"total_fees"` }
type QuerySwapReturn ¶
Click to show internal directories.
Click to hide internal directories.