sdkutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 19 Imported by: 32

Documentation

Index

Constants

View Source
const (
	DenomAkt  = "akt"  // 1akt
	DenomMakt = "makt" // 10^-3akt
	DenomUakt = "uakt" // 10^-6akt

	DenomAct  = "act"  // 1act
	DenomMact = "mact" // 10^-3act
	DenomUact = "uact" // 10^-6act

	DenomUSD  = "usd"  // 1act
	DenomMusd = "musd" // 10^-3act
	DenomUusd = "uusd" // 10^-6act

	BondDenom = DenomUakt

	DenomMExponent = 3
	DenomUExponent = 6

	Bech32PrefixAccAddr = "akash"
	Bech32PrefixAccPub  = "akashpub"

	Bech32PrefixValAddr = "akashvaloper"
	Bech32PrefixValPub  = "akashvaloperpub"

	Bech32PrefixConsAddr = "akashvalcons"
	Bech32PrefixConsPub  = "akashvalconspub"
)
View Source
const (

	// EventTypeMessage defines the Akash message string
	EventTypeMessage = akashEventMessageV1
)

Variables

View Source
var (
	// ErrNotFound is the error with message "Not found"
	ErrNotFound = errors.New("not found")
	// ErrUnknownType is the error with message "Unknown type"
	ErrUnknownType = errors.New("unknown type")
	// ErrUnknownModule is the error with message "Unknown module"
	ErrUnknownModule = errors.New("unknown module")
	// ErrUnknownAction is the error with message "Unknown action"
	ErrUnknownAction = errors.New("unknown action")
	// ErrParsingBlockID indicates one of the uint parsers failed to convert a value.
	ErrParsingBlockID = errors.New("error parsing block id values")
	// ErrInvalidParseBlockIDInput indicates the splitting of block path failed.
	ErrInvalidParseBlockIDInput = errors.New("error parsing block id input string")
)

Functions

func BuildCustomSigners

func BuildCustomSigners() []signing.CustomGetSigner

func GetAccAddress

func GetAccAddress(attrs []sdk.Attribute, key string) (sdk.AccAddress, error)

GetAccAddress take sdk attributes, key and returns account address. Returns error incase of failure.

func GetString

func GetString(attrs []sdk.Attribute, key string) (string, error)

GetString take sdk attributes, key and returns key value. Returns error incase of failure.

func GetUint64

func GetUint64(attrs []sdk.Attribute, key string) (uint64, error)

GetUint64 take sdk attributes, key and returns uint64 value. Returns error incase of failure.

func MustAccAddressFromBech32

func MustAccAddressFromBech32(address string) sdk.AccAddress

MustAccAddressFromBech32 creates an AccAddress from a Bech32 string. It panics if there is an error.

func NewSigningOptions

func NewSigningOptions() signing.Options

func RegisterCustomSignerField added in v0.2.0

func RegisterCustomSignerField(msg proto.Message, field string, signer string)

Types

type BaseModuleEvent

type BaseModuleEvent struct {
	Module string `json:"module"`
	Action string `json:"action"`
}

type CodecOptions

type CodecOptions struct {
	AccAddressPrefix string
	ValAddressPrefix string
	Options          signing.Options
}

func NewCodecOptions

func NewCodecOptions() *CodecOptions

func (CodecOptions) NewCodec

func (o CodecOptions) NewCodec() *codec.ProtoCodec

NewCodec returns a new codec with the given options.

func (CodecOptions) NewInterfaceRegistry

func (o CodecOptions) NewInterfaceRegistry() codectypes.InterfaceRegistry

NewInterfaceRegistry returns a new InterfaceRegistry with the given options.

type EncodingConfig

type EncodingConfig struct {
	InterfaceRegistry types.InterfaceRegistry
	Codec             codec.Codec
	TxConfig          client.TxConfig
	SigningOptions    signing.Options
	Amino             *codec.LegacyAmino
}

EncodingConfig specifies the concrete encoding types to use for a given app. This is provided for compatibility between protobuf and amino implementations.

func MakeEncodingConfig

func MakeEncodingConfig(modules ...module.AppModuleBasic) EncodingConfig

MakeEncodingConfig creates an EncodingConfig for a proto based test configuration.

type Event

type Event struct {
	Type       string
	Module     string
	Action     string
	Attributes []sdk.Attribute
}

Event stores type, module, action and attributes list of sdk

func ParseEvent

func ParseEvent(sev sdk.StringEvent) (Event, error)

ParseEvent parses string to event

type ModuleEvent

type ModuleEvent interface {
	ToSDKEvent() sdk.Event
}

Jump to

Keyboard shortcuts

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