cosmos

package
v1.137.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCoinDecimals = 8

	EnvSignerName     = "SIGNER_NAME"
	EnvSignerPassword = "SIGNER_PASSWD"
	EnvChainHome      = "CHAIN_HOME_FOLDER"
)

Variables

View Source
var (
	KeyringServiceName           = sdk.KeyringServiceName
	NewRoute                     = sdk.NewRoute
	NewKVStoreKeys               = sdk.NewKVStoreKeys
	NewUint                      = sdk.NewUint
	ParseUint                    = sdk.ParseUint
	NewInt                       = sdk.NewInt
	NewDec                       = sdk.NewDec
	ZeroInt                      = sdk.ZeroInt
	ZeroUint                     = sdk.ZeroUint
	ZeroDec                      = sdk.ZeroDec
	OneUint                      = sdk.OneUint
	NewCoin                      = sdk.NewCoin
	NewCoins                     = sdk.NewCoins
	ParseCoins                   = sdk.ParseCoinsNormalized
	NewDecWithPrec               = sdk.NewDecWithPrec
	NewDecFromBigInt             = sdk.NewDecFromBigInt
	NewIntFromBigInt             = sdk.NewIntFromBigInt
	NewUintFromBigInt            = sdk.NewUintFromBigInt
	AccAddressFromBech32         = sdk.AccAddressFromBech32
	VerifyAddressFormat          = sdk.VerifyAddressFormat
	GetFromBech32                = sdk.GetFromBech32
	NewAttribute                 = sdk.NewAttribute
	NewDecFromStr                = sdk.NewDecFromStr
	GetConfig                    = sdk.GetConfig
	NewEvent                     = sdk.NewEvent
	RegisterCodec                = sdk.RegisterLegacyAminoCodec
	NewEventManager              = sdk.NewEventManager
	EventTypeMessage             = sdk.EventTypeMessage
	AttributeKeyModule           = sdk.AttributeKeyModule
	KVStorePrefixIterator        = sdk.KVStorePrefixIterator
	KVStoreReversePrefixIterator = sdk.KVStoreReversePrefixIterator
	NewKVStoreKey                = sdk.NewKVStoreKey
	NewTransientStoreKey         = sdk.NewTransientStoreKey
	StoreTypeTransient           = sdk.StoreTypeTransient
	StoreTypeIAVL                = sdk.StoreTypeIAVL
	NewContext                   = sdk.NewContext
	NewUintFromString            = sdk.NewUintFromString

	GetPubKeyFromBech32     = legacybech32.UnmarshalPubKey // nolint SA1019 deprecated
	Bech32ifyPubKey         = legacybech32.MarshalPubKey   // nolint SA1019 deprecated
	Bech32PubKeyTypeConsPub = legacybech32.ConsPK
	Bech32PubKeyTypeAccPub  = legacybech32.AccPK
	Wrapf                   = se.Wrapf
	MustSortJSON            = sdk.MustSortJSON
	CodeUnauthorized        = uint32(4)
	CodeInsufficientFunds   = uint32(5)
)

Functions

func ErrInvalidAddress

func ErrInvalidAddress(addr string) error

func ErrInvalidCoins

func ErrInvalidCoins(msg string) error

func ErrUnauthorized

func ErrUnauthorized(msg string) error

func ErrUnknownRequest

func ErrUnknownRequest(msg string) error

func SignerCreds

func SignerCreds() (string, string)

Types

type AccAddress

type AccAddress = sdk.AccAddress

type Account

type Account = authtypes.AccountI

type Attribute

type Attribute = sdk.Attribute

type Coin

type Coin = sdk.Coin

type Coins

type Coins = sdk.Coins

type Context

type Context = sdk.Context

type Dec

type Dec = sdk.Dec

type Event

type Event = sdk.Event

type Events

type Events = sdk.Events

type Handler

type Handler = sdk.Handler

type Int

type Int = sdk.Int

type Iterator

type Iterator = sdk.Iterator

type KeybaseStore

type KeybaseStore struct {
	Keybase      ckeys.Keyring
	SignerName   string
	SignerPasswd string
}

KeybaseStore to store keys

func GetKeybase

func GetKeybase(thorchainHome string) (KeybaseStore, error)

GetKeybase will create an instance of Keybase

type Msg

type Msg = sdk.Msg

type Querier

type Querier = sdk.Querier

type Result

type Result = sdk.Result

type Route

type Route = sdk.Route

type StoreKey

type StoreKey = sdk.StoreKey

type TxResponse

type TxResponse = sdk.TxResponse

type Uint

type Uint = sdk.Uint

func MinUint

func MinUint(u1, u2 Uint) Uint

MinUint returns the minimum of two Uints.

func RoundToDecimal

func RoundToDecimal(amt Uint, dec int64) Uint

RoundToDecimal round the given amt to the desire decimals

func SafeUintFromInt64

func SafeUintFromInt64(i int64) Uint

SafeUintFromInt64 create a new Uint from an int64. It is expected that the int64 is positive - if not, we log an error and return zero to prevent overflow errors.

func Sum

func Sum(u []Uint) Uint

Sum returns the sum of all the Uints in the slice.

Jump to

Keyboard shortcuts

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