metaprotocols

package
v0.0.0-...-610a1d1 Latest Latest
Warning

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

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

README

x/metaprotocols module

The x/metaprotocols module adds support for encoding and decoding additional fields attached to transactions.

extension_options and non_critical_extension_options are optional fields that can be used to attach data to valid transactions. The fields are validated by the blockchain, but they are not used in any way. The fields pass validation if they are provided as empty lists ([ ]) or they use a list of ExtensionData types.

The application does not use the attached data but it does ensure that the correct type is provided and that it can be successfully unmarshalled. The attached data will be part of a block.

Here is an example of a correctly formed non_critical_extension_options field:

{
  "@type": "/gaia.metaprotocols.ExtensionData", // must be this exact string
  "protocol_id": "some-protocol",
  "protocol_version": "1",
  "data": "<base64 encoded bytes>"
}

Here is an example of a correctly populated non_critical_extension_options on a bank.MsgSend transaction:

{
  "body": {
    "messages": [
      {
        "@type": "/cosmos.bank.v1beta1.MsgSend",
        "from_address": "cosmos1ehpqg9sj09037uhe56sqktk30asn47asthyr22",
        "to_address": "cosmos1ehpqg9sj09037uhe56sqktk30asn47asthyr22",
        "amount": [
          {
            "denom": "uatom",
            "amount": "100"
          }
        ]
      }
    ],
    "memo": "memo_smaller_than_512_bytes",
    "timeout_height": "0",
    "extension_options": [],
    "non_critical_extension_options": [
      {
        "@type": "/gaia.metaprotocols.ExtensionData",
        "protocol_id": "some-protocol",
        "protocol_version": "1",
        "data": "<base64 encoded bytes>"
      }
    ]
  },
  "auth_info": {
    "signer_infos": [],
    "fee": {
      "amount": [],
      "gas_limit": "200000",
      "payer": "",
      "granter": ""
    },
    "tip": null
  },
  "signatures": []
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppModule

type AppModule struct {
	AppModuleBasic
}

func NewAppModule

func NewAppModule() *AppModule

func (AppModule) BeginBlock

func (a AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)

func (AppModule) ConsensusVersion

func (AppModule) ConsensusVersion() uint64

func (AppModule) EndBlock

func (AppModule) ExportGenesis

func (a AppModule) ExportGenesis(_ sdk.Context, cdc codec.JSONCodec) json.RawMessage

func (AppModule) InitGenesis

func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate

func (AppModule) RegisterInvariants

func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

func (AppModule) RegisterServices

func (a AppModule) RegisterServices(_ module.Configurator)

type AppModuleBasic

type AppModuleBasic struct{}

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis(_ codec.JSONCodec) json.RawMessage

DefaultGenesis is an empty object

func (AppModuleBasic) GetQueryCmd

func (a AppModuleBasic) GetQueryCmd() *cobra.Command

func (AppModuleBasic) GetTxCmd

func (a AppModuleBasic) GetTxCmd() *cobra.Command

func (AppModuleBasic) Name

func (a AppModuleBasic) Name() string

func (AppModuleBasic) RegisterGRPCGatewayRoutes

func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)

func (AppModuleBasic) RegisterInterfaces

func (a AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)

func (AppModuleBasic) RegisterLegacyAminoCodec

func (a AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino)

func (AppModuleBasic) RegisterRESTRoutes

func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router)

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(_ codec.JSONCodec, config client.TxEncodingConfig, _ json.RawMessage) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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