wasmbinding

package
v4.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 50 Imported by: 0

README

This package allows for custom queries and custom messages sends from contract.

What is supported

  • Queries:
    • InterchainQueryResult - Get the result of a registered interchain query by query_id
    • InterchainAccountAddress - Get the interchain account address by owner_id and connection_id
    • RegisteredInterchainQueries - all set of registered interchain queries.
    • RegisteredInterchainQuery - registered interchain query with specified query_id
  • Messages:
    • RegisterInterchainAccount - register an interchain account
    • SubmitTx - submit a transaction for execution on a remote chain
    • RegisterInterchainQuery - register an interchain query
    • UpdateInterchainQuery - update an interchain query
    • RemoveInterchainQuery - remove an interchain query

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptedStargateQueries

func AcceptedStargateQueries() wasmkeeper.AcceptedQueries

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 CustomMessageDecorator

func CustomMessageDecorator(
	ictx *ictxkeeper.Keeper,
	icq *icqkeeper.Keeper,
	transferKeeper transferwrapperkeeper.KeeperTransferWrapper,
	adminKeeper *adminmodulekeeper.Keeper,
	bankKeeper *bankkeeper.BaseKeeper,
	tokenFactoryKeeper *tokenfactorykeeper.Keeper,
	cronKeeper *cronkeeper.Keeper,
	contractmanagerKeeper *contractmanagerkeeper.Keeper,
	dexKeeper *dexkeeper.Keeper,
) func(messenger wasmkeeper.Messenger) wasmkeeper.Messenger

func CustomQuerier

func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessage) ([]byte, error)

CustomQuerier returns a function that is an implementation of custom querier mechanism for specific messages

func GetFullDenom

func GetFullDenom(contract, subDenom string) (string, error)

GetFullDenom is a function, not method, so the message_plugin can use it

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, ctx sdk.Context, contractAddr sdk.AccAddress, createDenom *bindings.CreateDenom) error

PerformCreateDenom is used with createDenom to create a token denom; validates the msgCreateDenom.

func PerformForceTransfer

func PerformForceTransfer(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, forceTransfer *bindings.ForceTransfer) error

PerformForceTransfer is used with forceTransfer to force a tokenfactory token transfer; validates the msgForceTransfer.

func PerformMint

func PerformMint(f *tokenfactorykeeper.Keeper, _ *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 PerformSetBeforeSendHook

func PerformSetBeforeSendHook(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, set *bindings.SetBeforeSendHook) error

func PerformSetDenomMetadata

func PerformSetDenomMetadata(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, setDenomMetadata *bindings.SetDenomMetadata) error

PerformSetDenomMetadata is used with setDenomMetadata to set a metadata for a tokenfactory denom; validates the msgSetDenomMetadata.

func RegisterCustomPlugins

func RegisterCustomPlugins(
	ictxKeeper *interchaintransactionsmodulekeeper.Keeper,
	icqKeeper *interchainqueriesmodulekeeper.Keeper,
	transfer transfer.KeeperTransferWrapper,
	adminKeeper *adminmodulekeeper.Keeper,
	feeBurnerKeeper *feeburnerkeeper.Keeper,
	feeRefunderKeeper *feerefunderkeeper.Keeper,
	bank *bankkeeper.BaseKeeper,
	tfk *tokenfactorykeeper.Keeper,
	cronKeeper *cronkeeper.Keeper,
	contractmanagerKeeper *contractmanagerkeeper.Keeper,
	dexKeeper *dexkeeper.Keeper,
	oracleKeeper *oraclekeeper.Keeper,
	markemapKeeper *marketmapkeeper.Keeper,
) []wasmkeeper.Option

RegisterCustomPlugins returns wasmkeeper.Option that we can use to connect handlers for implemented custom queries and messages to the App

Types

type CustomMessenger

type CustomMessenger struct {
	Keeper        ictxkeeper.Keeper
	Wrapped       wasmkeeper.Messenger
	Ictxmsgserver ictxtypes.MsgServer
	Icqmsgserver  icqtypes.MsgServer

	Adminserver           admintypes.MsgServer
	Bank                  *bankkeeper.BaseKeeper
	TokenFactory          *tokenfactorykeeper.Keeper
	CronKeeper            *cronkeeper.Keeper
	AdminKeeper           *adminmodulekeeper.Keeper
	ContractmanagerKeeper *contractmanagerkeeper.Keeper
	DexMsgServer          dextypes.MsgServer
	// 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, [][]*types.Any, error)

type QueryPlugin

type QueryPlugin struct {
	// contains filtered or unexported fields
}

func NewQueryPlugin

func NewQueryPlugin(icaControllerKeeper *icacontrollerkeeper.Keeper, icqKeeper *icqkeeper.Keeper, feeBurnerKeeper *feeburnerkeeper.Keeper, feeRefunderKeeper *feerefunderkeeper.Keeper, tfk *tokenfactorykeeper.Keeper, contractmanagerKeeper *contractmanagerkeeper.Keeper, dexKeeper *dexkeeper.Keeper, oracleKeeper *oraclekeeper.Keeper, marketmapKeeper *marketmapkeeper.Keeper) *QueryPlugin

NewQueryPlugin returns a reference to a new QueryPlugin.

func (*QueryPlugin) DexQuery

func (qp *QueryPlugin) DexQuery(ctx sdk.Context, query bindings.DexQuery) (data []byte, err error)

func (QueryPlugin) GetBeforeSendHook

func (qp QueryPlugin) GetBeforeSendHook(ctx sdk.Context, denom string) (*bindings.BeforeSendHookResponse, error)

GetBeforeSendHook is a query to get denom before send hook.

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) GetFailures

func (qp *QueryPlugin) GetFailures(ctx sdk.Context, address string, pagination *sdkquery.PageRequest) (*bindings.FailuresResponse, error)

func (*QueryPlugin) GetInterchainQueryResult

func (qp *QueryPlugin) GetInterchainQueryResult(ctx sdk.Context, queryID uint64) (*bindings.QueryRegisteredQueryResultResponse, error)

func (*QueryPlugin) GetMinIbcFee

func (*QueryPlugin) GetRegisteredInterchainQueries

func (qp *QueryPlugin) GetRegisteredInterchainQueries(ctx sdk.Context, query *bindings.QueryRegisteredQueriesRequest) (*bindings.QueryRegisteredQueriesResponse, error)

func (*QueryPlugin) GetRegisteredInterchainQuery

func (*QueryPlugin) MarketMapQuery

func (qp *QueryPlugin) MarketMapQuery(ctx sdk.Context, query bindings.MarketMapQuery) ([]byte, error)

func (*QueryPlugin) OracleQuery

func (qp *QueryPlugin) OracleQuery(ctx sdk.Context, query bindings.OracleQuery) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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