Documentation ¶
Index ¶
- func ChangeAdmin(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, ...) error
- func ConvertProtoToJSONMarshal(protoResponseType codec.ProtoMarshaler, bz []byte, cdc codec.Codec) ([]byte, error)
- func ConvertSdkCoinToWasmCoin(coin sdk.Coin) wasmvmtypes.Coin
- func ConvertSdkCoinsToWasmCoins(coins []sdk.Coin) wasmvmtypes.Coins
- func CustomMessageDecorator(gammKeeper *gammkeeper.Keeper, bank *bankkeeper.BaseKeeper, ...) func(wasmkeeper.Messenger) wasmkeeper.Messenger
- func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessage) ([]byte, error)
- func GetFullDenom(contract string, subDenom string) (string, error)
- func GetWhitelistedQuery(queryPath string) (codec.ProtoMarshaler, error)
- func PerformBurn(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, ...) error
- func PerformCreateDenom(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk.Context, ...) error
- func PerformMint(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk.Context, ...) error
- func PerformSwap(keeper *gammkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, ...) (*bindings.SwapAmount, error)
- func RegisterCustomPlugins(gammKeeper *gammkeeper.Keeper, bank *bankkeeper.BaseKeeper, twap *twap.Keeper, ...) []wasmkeeper.Option
- func RegisterStargateQueries(queryRouter baseapp.GRPCQueryRouter, codec codec.Codec) []wasmkeeper.Option
- func StargateQuerier(queryRouter baseapp.GRPCQueryRouter, cdc codec.Codec) func(ctx sdk.Context, request *wasmvmtypes.StargateQuery) ([]byte, error)
- type CustomMessenger
- type QueryPlugin
- func (qp QueryPlugin) ArithmeticTwap(ctx sdk.Context, arithmeticTwap *bindings.ArithmeticTwap) (*sdk.Dec, error)
- func (qp QueryPlugin) ArithmeticTwapToNow(ctx sdk.Context, arithmeticTwap *bindings.ArithmeticTwapToNow) (*sdk.Dec, error)
- func (qp QueryPlugin) EstimateSwap(ctx sdk.Context, estimateSwap *bindings.EstimateSwap) (*bindings.SwapAmount, error)
- func (qp QueryPlugin) GetDenomAdmin(ctx sdk.Context, denom string) (*bindings.DenomAdminResponse, error)
- func (qp QueryPlugin) GetPoolState(ctx sdk.Context, poolID uint64) (*bindings.PoolAssets, error)
- func (qp QueryPlugin) GetSpotPrice(ctx sdk.Context, spotPrice *bindings.SpotPrice) (*sdk.Dec, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeAdmin ¶
func ChangeAdmin(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, changeAdmin *bindings.ChangeAdmin) error
ChangeAdmin is used with changeAdmin to validate changeAdmin messages and to dispatch.
func ConvertProtoToJSONMarshal ¶
func ConvertProtoToJSONMarshal(protoResponseType codec.ProtoMarshaler, bz []byte, cdc codec.Codec) ([]byte, error)
ConvertProtoToJsonMarshal unmarshals the given bytes into a proto message and then marshals it to json. This is done so that clients calling stargate queries do not need to define their own proto unmarshalers, being able to use response directly by json marshalling, which is supported in cosmwasm.
func ConvertSdkCoinToWasmCoin ¶
func ConvertSdkCoinToWasmCoin(coin sdk.Coin) wasmvmtypes.Coin
ConvertSdkCoinToWasmCoin converts a sdk type coin to a wasm vm type coin
func ConvertSdkCoinsToWasmCoins ¶
func ConvertSdkCoinsToWasmCoins(coins []sdk.Coin) wasmvmtypes.Coins
ConvertSdkCoinsToWasmCoins converts sdk type coins to wasm vm type coins
func CustomMessageDecorator ¶
func CustomMessageDecorator(gammKeeper *gammkeeper.Keeper, bank *bankkeeper.BaseKeeper, tokenFactory *tokenfactorykeeper.Keeper) func(wasmkeeper.Messenger) wasmkeeper.Messenger
CustomMessageDecorator returns decorator for custom CosmWasm bindings messages
func CustomQuerier ¶
func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessage) ([]byte, error)
CustomQuerier dispatches custom CosmWasm bindings queries.
func GetFullDenom ¶
GetFullDenom is a function, not method, so the message_plugin can use it
func GetWhitelistedQuery ¶
func GetWhitelistedQuery(queryPath string) (codec.ProtoMarshaler, error)
GetWhitelistedQuery returns the whitelisted query at the provided path. If the query does not exist, or it was setup wrong by the chain, this returns an error.
func PerformBurn ¶
func PerformBurn(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, burn *bindings.BurnTokens) error
PerformBurn performs token burning after validating tokenBurn message.
func PerformCreateDenom ¶
func PerformCreateDenom(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, createDenom *bindings.CreateDenom) error
PerformCreateDenom is used with createDenom to create a token denom; validates the msgCreateDenom.
func PerformMint ¶
func PerformMint(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, mint *bindings.MintTokens) error
PerformMint used with mintTokens to validate the mint message and mint through token factory.
func PerformSwap ¶
func PerformSwap(keeper *gammkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, swap *bindings.SwapMsg) (*bindings.SwapAmount, error)
PerformSwap can be used both for the real swap, and the EstimateSwap query
func RegisterCustomPlugins ¶
func RegisterCustomPlugins( gammKeeper *gammkeeper.Keeper, bank *bankkeeper.BaseKeeper, twap *twap.Keeper, tokenFactory *tokenfactorykeeper.Keeper, ) []wasmkeeper.Option
func RegisterStargateQueries ¶
func RegisterStargateQueries(queryRouter baseapp.GRPCQueryRouter, codec codec.Codec) []wasmkeeper.Option
func StargateQuerier ¶
func StargateQuerier(queryRouter baseapp.GRPCQueryRouter, cdc codec.Codec) func(ctx sdk.Context, request *wasmvmtypes.StargateQuery) ([]byte, error)
StargateQuerier dispatches whitelisted stargate queries
Types ¶
type CustomMessenger ¶
type CustomMessenger struct {
// contains filtered or unexported fields
}
func (*CustomMessenger) DispatchMsg ¶
func (m *CustomMessenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) ([]sdk.Event, [][]byte, error)
DispatchMsg executes on the contractMsg.
type QueryPlugin ¶
type QueryPlugin struct {
// contains filtered or unexported fields
}
func NewQueryPlugin ¶
func NewQueryPlugin(gk *gammkeeper.Keeper, tk *twapkeeper.Keeper, tfk *tokenfactorykeeper.Keeper) *QueryPlugin
NewQueryPlugin returns a reference to a new QueryPlugin.
func (QueryPlugin) ArithmeticTwap ¶
func (qp QueryPlugin) ArithmeticTwap(ctx sdk.Context, arithmeticTwap *bindings.ArithmeticTwap) (*sdk.Dec, error)
func (QueryPlugin) ArithmeticTwapToNow ¶
func (qp QueryPlugin) ArithmeticTwapToNow(ctx sdk.Context, arithmeticTwap *bindings.ArithmeticTwapToNow) (*sdk.Dec, error)
func (QueryPlugin) EstimateSwap ¶
func (qp QueryPlugin) EstimateSwap(ctx sdk.Context, estimateSwap *bindings.EstimateSwap) (*bindings.SwapAmount, error)
EstimateSwap validates each denom (in / out) and performs a swap.
func (QueryPlugin) GetDenomAdmin ¶
func (qp QueryPlugin) GetDenomAdmin(ctx sdk.Context, denom string) (*bindings.DenomAdminResponse, error)
GetDenomAdmin is a query to get denom admin.
func (QueryPlugin) GetPoolState ¶
func (qp QueryPlugin) GetPoolState(ctx sdk.Context, poolID uint64) (*bindings.PoolAssets, error)
GetPoolState is a query to get pool liquidity and amount of each denoms' pool shares.
func (QueryPlugin) GetSpotPrice ¶
func (qp QueryPlugin) GetSpotPrice(ctx sdk.Context, spotPrice *bindings.SpotPrice) (*sdk.Dec, error)
GetSpotPrice is a query to get spot price of denoms.