wasm

package
v1.19.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package wasm supports smart contract integration with the provenance name module.

Package wasm supports smart contract integration with the name module.

Package wasm supports smart contract integration with the provenance name module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encoder

func Encoder(contract sdk.AccAddress, msg json.RawMessage, _ string) ([]sdk.Msg, error)

Encoder returns a smart contract message encoder for the name module.

func Querier

func Querier(keeper keeper.Keeper) provwasm.Querier

Querier returns a smart contract querier for the name module.

Types

type BindNameParams

type BindNameParams struct {
	// The combined name and root name (eg in x.y.z : name = x, root_name = y.z)
	Name string `json:"name"`
	// The address to bind
	Address string `json:"address"`
	// Whether to restrict binding child names to the owner
	Restrict bool `json:"restrict"`
}

BindNameParams are params for encoding a MsgBindName.

func (*BindNameParams) Encode

func (params *BindNameParams) Encode(contract sdk.AccAddress) ([]sdk.Msg, error)

Encode creates a MsgBindNameRequest. The parent address is required to be the signer. But, in x/wasm the contract address must be the signer. This means that contract instances should have a parent name they own, or the parent name must be unrestricted.

type DeleteNameParams

type DeleteNameParams struct {
	// The name to unbind from the contract address.
	Name string `json:"name"`
}

DeleteNameParams are params for encoding a MsgDeleteNameRequest.

func (*DeleteNameParams) Encode

func (params *DeleteNameParams) Encode(contract sdk.AccAddress) ([]sdk.Msg, error)

Encode creates a MsgDeleteNameRequest.

type LookupQueryParams

type LookupQueryParams struct {
	// Find all names bound to this address.
	Address string `json:"address"`
}

LookupQueryParams are the inpust for a lookup query.

func (*LookupQueryParams) Run

func (params *LookupQueryParams) Run(ctx sdk.Context, keeper keeper.Keeper) ([]byte, error)

Run looks up all names bound to a given address.

type ModifyNameParams added in v1.14.0

type ModifyNameParams struct {
	// The existing name to modify
	Authority string `json:"authority"`
	// The existing name to modify
	Name string `json:"name"`
	// The address to bind
	Address string `json:"address"`
	// Whether to restrict binding child names to the owner
	Restrict bool `json:"restrict"`
}

DeleteNameParams are params for encoding a MsgModifyNameRequest.

func (*ModifyNameParams) Encode added in v1.14.0

func (params *ModifyNameParams) Encode(_ sdk.AccAddress) ([]sdk.Msg, error)

Encode creates a MsgModifyNameRequest.

type NameMsgParams

type NameMsgParams struct {
	// Encode a MsgBindName
	Bind *BindNameParams `json:"bind_name,omitempty"`
	// Encode a MsgUnBindName
	Delete *DeleteNameParams `json:"delete_name,omitempty"`
	// Encode a MsgModifyName
	Modify *ModifyNameParams `json:"modify_name,omitempty"`
}

NameMsgParams are params for encoding []sdk.Msg types from the name module. Only one field should be set.

type NameQueryParams

type NameQueryParams struct {
	// Resolve the address bound to the given name.
	Resolve *ResolveQueryParams `json:"resolve,omitempty"`
	// Lookup all names an address is bound to.
	Lookup *LookupQueryParams `json:"lookup,omitempty"`
}

NameQueryParams represents the request type for the name module sent by a smart contracts. Only one query field should be set.

type QueryResName

type QueryResName struct {
	Name       string `json:"name"`
	Address    string `json:"address"`
	Restricted bool   `json:"restricted"`
}

QueryResName contains the address from a name query.

type QueryResNames

type QueryResNames struct {
	Records []QueryResName `json:"records,omitempty"`
}

QueryResNames contains a sequence of name records.

type ResolveQueryParams

type ResolveQueryParams struct {
	// The name we want to resolve the address for.
	Name string `json:"name"`
}

ResolveQueryParams are the inputs for a resolve name query.

func (*ResolveQueryParams) Run

func (params *ResolveQueryParams) Run(ctx sdk.Context, keeper keeper.Keeper) ([]byte, error)

Run resolves the address for a name.

Jump to

Keyboard shortcuts

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