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 ¶
- func Encoder(contract sdk.AccAddress, msg json.RawMessage, _ string) ([]sdk.Msg, error)
- func Querier(keeper keeper.Keeper) provwasm.Querier
- type AddAttributeParams
- type Attribute
- type AttributeMsgParams
- type AttributeQueryParams
- type AttributeResponse
- type DeleteAttributeParams
- type DeleteDistinctAttributeParams
- type GetAllAttributesParams
- type GetAttributesParams
- type UpdateAttributeParams
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 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. INFO: 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"` // A request to encode a MsgDeleteAttribute DelDistinct *DeleteDistinctAttributeParams `json:"delete_distinct_attribute"` // A request to encode a MsgUpdateAttribute Update *UpdateAttributeParams `json:"update_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. INFO: The contract must be the owner of the name of the attribute being deleted.
type DeleteDistinctAttributeParams ¶ added in v1.11.0
type DeleteDistinctAttributeParams struct { // The address of the account to delete the attribute from. Address string `json:"address"` // The attribute name. Name string `json:"name"` // The attribute value. Value []byte `json:"value"` }
DeleteDistinctAttributeParams are params for encoding a MsgDeleteDistinctAttribute
func (*DeleteDistinctAttributeParams) Encode ¶ added in v1.11.0
func (params *DeleteDistinctAttributeParams) Encode(contract sdk.AccAddress) ([]sdk.Msg, error)
Encode creates a MsgDeleteDistinctAttribute. INFO: 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.
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.
type UpdateAttributeParams ¶ added in v1.11.0
type UpdateAttributeParams struct { // The address of the account on the attribute Address string `json:"address"` // The attribute name. Name string `json:"name"` // The original attribute value. OriginalValue []byte `json:"original_value"` // The original attribute value type. OriginalValueType string `json:"original_value_type"` // The new attribute value. UpdateValue []byte `json:"update_value"` // The new attribute value type. UpdateValueType string `json:"update_value_type"` }
UpdateAttributeParams are params for encoding a MsgUpdateAttributeRequest
func (*UpdateAttributeParams) Encode ¶ added in v1.11.0
func (params *UpdateAttributeParams) Encode(contract sdk.AccAddress) ([]sdk.Msg, error)
Encode creates a MsgUpdateAttribute. INFO: The contract must be the owner of the name of the attribute being updated.