wasm

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

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

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encoder

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

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

func Querier

func Querier(keeper keeper.Keeper) provwasm.Querier

Querier returns a smart contract querier for the attribute module.

Types

type AddAttributeParams

type AddAttributeParams struct {
	// The address of the account to add the attribute to.
	Address string `json:"address"`
	// The attribute name.
	Name string `json:"name"`
	// The attribute value.
	Value []byte `json:"value"`
	// The attribute value type.
	ValueType string `json:"value_type"`
}

AddAttributeParams are params for encoding a MsgAddAttribute

func (*AddAttributeParams) Encode

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

Encode creates a MsgAddAttribute. The contract must be the owner of the name of the attribute being added.

type Attribute

type Attribute struct {
	// The attribute name.
	Name string `json:"name"`
	// The attribute value.
	Value []byte `json:"value"`
	// The attribute value type.
	Type string `json:"type"`
}

Attribute is a typed key-value pair attached to a cosmos account.

type AttributeMsgParams

type AttributeMsgParams struct {
	// A request to encode a MsgAddAttribute
	Add *AddAttributeParams `json:"add_attribute"`
	// A request to encode a MsgDeleteAttribute
	Del *DeleteAttributeParams `json:"delete_attribute"`
}

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

type AttributeQueryParams

type AttributeQueryParams struct {
	// Get account attributes by name.
	Get *GetAttributesParams `json:"get_attributes,omitempty"`
	// Get all account attributes.
	GetAll *GetAllAttributesParams `json:"get_all_attributes,omitempty"`
}

AttributeQueryParams represents the request type for the attribute module sent by a smart contracts. Only one field should be set.

type AttributeResponse

type AttributeResponse struct {
	// The account account address in Bech32 formt
	Address string `json:"address"`
	// The attributes queried for the account.
	Attributes []Attribute `json:"attributes,omitempty"`
}

AttributeResponse returns attributes attached to a cosmos account.

type DeleteAttributeParams

type DeleteAttributeParams struct {
	// The address of the account to delete the attribute from.
	Address string `json:"address"`
	// The attribute name.
	Name string `json:"name"`
}

DeleteAttributeParams are params for encoding a MsgDeleteAttribute

func (*DeleteAttributeParams) Encode

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

Encode creates a MsgDeleteAttribute. The contract must be the owner of the name of the attribute being deleted.

type GetAllAttributesParams

type GetAllAttributesParams struct {
	// The account to query
	Address string `json:"address"`
}

GetAllAttributesParams are params for querying account attributes by address.

func (*GetAllAttributesParams) Run

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

Run queries for account attributes by address.

type GetAttributesParams

type GetAttributesParams struct {
	// The account address
	Address string `json:"address"`
	// The name of the attributes to query
	Name string `json:"name"`
}

GetAttributesParams are params for querying an account attributes by address and name.

func (*GetAttributesParams) Run

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

Run queries for account attributes by address and name.

Jump to

Keyboard shortcuts

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