std

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Package = amino.RegisterPackage(amino.NewPackage(
	"github.com/gnolang/gno/gnovm/stdlibs/std",
	"tm",
	amino.GetCallersDirname(),
).
	WithDependencies(
		abci.Package,
	).
	WithTypes(
		GnoEventAttribute{},
		GnoEvent{},
	))

Functions

func AssertOriginCall

func AssertOriginCall(m *gno.Machine)

func ChainDomain

func ChainDomain(m *gno.Machine) string

func ChainHeight

func ChainHeight(m *gno.Machine) int64

func ChainID

func ChainID(m *gno.Machine) string

func CompactCoins

func CompactCoins(denoms []string, amounts []int64) std.Coins

func ExpandCoins

func ExpandCoins(c std.Coins) (denoms []string, amounts []int64)

func X_assertCallerIsRealm

func X_assertCallerIsRealm(m *gno.Machine)

func X_bankerGetCoins

func X_bankerGetCoins(m *gno.Machine, bt uint8, addr string) (denoms []string, amounts []int64)

func X_bankerIssueCoin

func X_bankerIssueCoin(m *gno.Machine, bt uint8, addr string, denom string, amount int64)

func X_bankerRemoveCoin

func X_bankerRemoveCoin(m *gno.Machine, bt uint8, addr string, denom string, amount int64)

func X_bankerSendCoins

func X_bankerSendCoins(m *gno.Machine, bt uint8, fromS, toS string, denoms []string, amounts []int64)

func X_bankerTotalCoin

func X_bankerTotalCoin(m *gno.Machine, bt uint8, denom string) int64

func X_callerAt

func X_callerAt(m *gno.Machine, n int) string

func X_emit

func X_emit(m *gno.Machine, typ string, attrs []string)

func X_getRealm

func X_getRealm(m *gno.Machine, height int) (address, pkgPath string)

func X_originCaller

func X_originCaller(m *gno.Machine) string

func X_originPkgAddr

func X_originPkgAddr(m *gno.Machine) string

func X_originSend

func X_originSend(m *gno.Machine) (denoms []string, amounts []int64)

func X_setParamBool

func X_setParamBool(m *gno.Machine, key string, val bool)

func X_setParamBytes

func X_setParamBytes(m *gno.Machine, key string, val []byte)

func X_setParamInt64

func X_setParamInt64(m *gno.Machine, key string, val int64)

func X_setParamString

func X_setParamString(m *gno.Machine, key, val string)

func X_setParamUint64

func X_setParamUint64(m *gno.Machine, key string, val uint64)

Types

type BankerInterface

type BankerInterface interface {
	GetCoins(addr crypto.Bech32Address) (dst std.Coins)
	SendCoins(from, to crypto.Bech32Address, amt std.Coins)
	TotalCoin(denom string) int64
	IssueCoin(addr crypto.Bech32Address, denom string, amount int64)
	RemoveCoin(addr crypto.Bech32Address, denom string, amount int64)
}

BankerInterface is the interface through which Gno is capable of accessing the blockchain's banker.

The name is what it is to avoid a collision with Gno's Banker, when transpiling.

type ExecContext

type ExecContext struct {
	ChainID         string
	ChainDomain     string
	Height          int64
	Timestamp       int64 // seconds
	TimestampNano   int64 // nanoseconds, only used for testing.
	OriginCaller    crypto.Bech32Address
	OriginPkgAddr   crypto.Bech32Address
	OriginSend      std.Coins
	OriginSendSpent *std.Coins // mutable
	Banker          BankerInterface
	Params          ParamsInterface
	EventLogger     *sdk.EventLogger
}

func GetContext

func GetContext(m *gno.Machine) ExecContext

GetContext returns the context from the Gno machine.

func (ExecContext) GetExecContext

func (e ExecContext) GetExecContext() ExecContext

GetContext returns the execution context. This is used to allow extending the exec context using interfaces, for instance when testing.

type ExecContexter

type ExecContexter interface {
	GetExecContext() ExecContext
}

ExecContexter is a type capable of returning the parent ExecContext. When using these standard libraries, m.Context should always implement this interface. This can be obtained by embedding ExecContext.

type GnoEvent

type GnoEvent struct {
	Type       string              `json:"type"`
	Attributes []GnoEventAttribute `json:"attrs"`
	PkgPath    string              `json:"pkg_path"`
	Func       string              `json:"func"`
}

func (GnoEvent) AssertABCIEvent

func (e GnoEvent) AssertABCIEvent()

type GnoEventAttribute

type GnoEventAttribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type ParamsInterface

type ParamsInterface interface {
	SetString(key, val string)
	SetBool(key string, val bool)
	SetInt64(key string, val int64)
	SetUint64(key string, val uint64)
	SetBytes(key string, val []byte)
}

ParamsInterface is the interface through which Gno is capable of accessing the blockchain's params.

The name is what it is to avoid a collision with Gno's Params, when transpiling.

Jump to

Keyboard shortcuts

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