assets

package
v10.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

README

x/assets

Abstract

x/assets is a Cosmos SDK module that allows the tracking of different assets and their respective on-chain and off-chain denominations.

Contents

Concepts

Asset

An asset is a representation of an off-chain token on-chain. It is composed of an off-chain ticker and an on-chain denomination. Assets are non-unique, which means that there can be multiple Asset objects for the same off-chain ticker. This is to support tokens that have the same off-chain ticker but different on-chain denominations (e.g. in the case of assets bridged using different IBC channels).

State

Assets

The assets module stores the assets in state with the prefix of 0x11. The list of stored assets can be updated through the on-chain governance or using the authority address.

  • Asset: 0x11 | Denom -> ProtocolBuffer(asset)
https://github.com/milkyway-labs/milkyway/blob/v8.1.0/proto/milkyway/assets/v1/models.proto#L9-L21
TickerIndex

The assets module stores the mapping of off-chain tickers to on-chain denominations in state with the prefix of 0x12. This is used to quickly look up the on-chain denomination of an off-chain ticker.

  • TickerIndex: 0x12 | Ticker | Denom -> []byte{}

Events

Handlers
MsgRegisterAsset
Type Attribute Key Attribute Value
register_asset denom {denom}
register_asset ticker {ticker}
register_asset exponent {exponent}
MsgDeregisterAsset
Type Attribute Key Attribute Value
deregister_asset denom {denom}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

AppModule implements the AppModule interface for the module.

func NewAppModule

func NewAppModule(cdc codec.Codec, keeper *keeper.Keeper) AppModule

func (AppModule) AutoCLIOptions

func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions

AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.

func (AppModule) ConsensusVersion

func (AppModule) ConsensusVersion() uint64

ConsensusVersion implements ConsensusVersion.

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage

ExportGenesis returns the module's exported genesis state as raw JSON bytes.

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage)

InitGenesis performs the module's genesis initialization It returns no validator updates.

func (AppModule) IsAppModule

func (am AppModule) IsAppModule()

func (AppModule) IsOnePerModuleType

func (am AppModule) IsOnePerModuleType()

func (AppModule) Name

func (am AppModule) Name() string

Name returns the module's name.

func (AppModule) RegisterServices

func (am AppModule) RegisterServices(cfg module.Configurator)

RegisterServices registers a GRPC query service to respond to the module-specific GRPC queries.

type AppModuleBasic

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

AppModuleBasic implements the AppModuleBasic interface for the module.

func NewAppModuleBasic

func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic

func (AppModuleBasic) DefaultGenesis

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

DefaultGenesis returns the module's default genesis state.

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name returns the module's name.

func (AppModuleBasic) RegisterGRPCGatewayRoutes

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

RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module.

func (AppModuleBasic) RegisterInterfaces

func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry)

RegisterInterfaces registers the module's interface types

func (AppModuleBasic) RegisterLegacyAminoCodec

func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

func (AppModuleBasic) ValidateGenesis

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

ValidateGenesis performs genesis state validation for the module.

Directories

Path Synopsis
Package types is a reverse proxy.
Package types is a reverse proxy.

Jump to

Keyboard shortcuts

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