wasmbinding

package
v2.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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(market *marketkeeper.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 PerformSwap

func PerformSwap(f *marketkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, contractMsg *bindings.Swap) (*markettypes.MsgSwapResponse, error)

PerformSwap performs market swap

func PerformSwapSend

func PerformSwapSend(f *marketkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, contractMsg *bindings.SwapSend) (*markettypes.MsgSwapSendResponse, error)

PerformSwapSend performs market swap

func RegisterCustomPlugins

func RegisterCustomPlugins(
	marketKeeper *marketkeeper.Keeper,
	oracleKeeper *oraclekeeper.Keeper,
	treasuryKeeper *treasurykeeper.Keeper,
) []wasmkeeper.Option

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(tmk *marketkeeper.Keeper, tok *oraclekeeper.Keeper, ttk *treasurykeeper.Keeper) *QueryPlugin

NewQueryPlugin returns a reference to a new QueryPlugin.

type TaxCapQueryResponse

type TaxCapQueryResponse struct {
	// uint64 string, eg "1000000"
	Cap string `json:"cap"`
}

TaxCapQueryResponse - tax cap query response for wasm module

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL