Skip to content

Instantly share code, notes, and snippets.

@thehowl
Forked from moul/std.go
Last active November 7, 2024 17:35
Show Gist options
  • Save thehowl/1f955869c3072b1a1eb74b1a1166ac48 to your computer and use it in GitHub Desktop.
Save thehowl/1f955869c3072b1a1eb74b1a1166ac48 to your computer and use it in GitHub Desktop.
std.gno
// just reorganizing the current `std` into "categories", not yet improving the API.
// chain
type AddressList []Address
func NewAddressList() *AddressList
type RawAddress [RawAddressSize]byte
const RawAddressSize = 20
type Address string
func DerivePkgAddr(pkgPath string) Address
func EncodeBech32(prefix string, bz [20]byte) Address
func DecodeBech32(addr Address) (prefix string, bz [20]byte, ok bool)
func Emit(typ string, attrs ...string)
// chain/runtime
type Realm struct{ ... }
func CurrentRealm() Realm
func PrevRealm() Realm
func GetCallerAt(n int) Address
func GetOrigCaller() Address
func GetOrigPkgAddr() Address
func ChainID() string
func GetHeight() int64
func IsOriginCall() bool
func AssertOriginCall()
// chain/banker
type Banker interface{ ... }
func GetBanker(bt BankerType) Banker
type BankerType uint8
const BankerTypeReadonly BankerType = iota ...
type Coin struct{ ... }
func NewCoin(denom string, amount int64) Coin
type Coins []Coin
func GetOrigSend() Coins
func NewCoins(coins ...Coin) Coins
// chain/params
func SetParamBool(key string, val bool)
func SetParamBytes(key string, val []byte)
func SetParamInt64(key string, val int64)
func SetParamString(key string, val string)
func SetParamUint64(key string, val uint64)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment