std

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxSessionsPerAccount   = 16
	MaxAllowPathsPerSession = 8
	MaxSessionDuration      = 30 * 24 * 60 * 60 // 30 days in seconds
)

Variables

View Source
var (
	ErrTxsLoadingAborted = errors.New("transaction loading aborted")
)
View Source
var Package = amino.RegisterPackage(amino.NewPackage(
	"github.com/gnolang/gno/tm2/pkg/std",
	"std",
	amino.GetCallersDirname(),
).WithDependencies().WithTypes(

	&BaseAccount{}, "BaseAccount",
	&BaseSessionAccount{}, "BaseSessionAccount",

	&Coin{}, "Coin",

	&GasPrice{}, "GasPrice",

	Tx{}, "Tx",
	Fee{}, "Fee",
	Signature{}, "Signature",

	MemFile{}, "MemFile",
	MemPackage{}, "MemPackage",

	InternalError{}, "InternalError",
	TxDecodeError{}, "TxDecodeError",
	InvalidSequenceError{}, "InvalidSequenceError",
	UnauthorizedError{}, "UnauthorizedError",
	InsufficientFundsError{}, "InsufficientFundsError",
	UnknownRequestError{}, "UnknownRequestError",
	InvalidAddressError{}, "InvalidAddressError",
	UnknownAddressError{}, "UnknownAddressError",
	InvalidPubKeyError{}, "InvalidPubKeyError",
	InsufficientCoinsError{}, "InsufficientCoinsError",
	InvalidCoinsError{}, "InvalidCoinsError",
	InvalidGasWantedError{}, "InvalidGasWantedError",
	OutOfGasError{}, "OutOfGasError",
	MemoTooLargeError{}, "MemoTooLargeError",
	InsufficientFeeError{}, "InsufficientFeeError",
	TooManySignaturesError{}, "TooManySignaturesError",
	NoSignaturesError{}, "NoSignaturesError",
	GasOverflowError{}, "GasOverflowError",
	RestrictedTransferError{}, "RestrictedTransferError",
	SessionExpiredError{}, "SessionExpiredError",
	SessionNotFoundError{}, "SessionNotFoundError",
	SessionLimitError{}, "SessionLimitError",
	SessionNotAllowedError{}, "SessionNotAllowedError",
))

Functions

func CountSubKeys

func CountSubKeys(pub crypto.PubKey) int

CountSubKeys counts the total number of keys for a multi-sig public key.

func ErrGasOverflow

func ErrGasOverflow(msg string) error

func ErrInsufficientCoins

func ErrInsufficientCoins(msg string) error

func ErrInsufficientFee

func ErrInsufficientFee(msg string) error

func ErrInsufficientFunds

func ErrInsufficientFunds(msg string) error

func ErrInternal

func ErrInternal(msg string) error

func ErrInvalidAddress

func ErrInvalidAddress(msg string) error

func ErrInvalidCoins

func ErrInvalidCoins(msg string) error

func ErrInvalidGasWanted

func ErrInvalidGasWanted(msg string) error

func ErrInvalidPubKey

func ErrInvalidPubKey(msg string) error

func ErrInvalidSequence

func ErrInvalidSequence(msg string) error

func ErrMemoTooLarge

func ErrMemoTooLarge(msg string) error

func ErrNoSignatures

func ErrNoSignatures(msg string) error

func ErrOutOfGas

func ErrOutOfGas(msg string) error

func ErrSessionExpired

func ErrSessionExpired(msg string) error

func ErrSessionLimit

func ErrSessionLimit(msg string) error

func ErrSessionNotAllowed

func ErrSessionNotAllowed(msg string) error

func ErrSessionNotFound

func ErrSessionNotFound(msg string) error

func ErrTooManySignatures

func ErrTooManySignatures(msg string) error

func ErrTxDecode

func ErrTxDecode(msg string) error

func ErrUnauthorized

func ErrUnauthorized(msg string) error

func ErrUnknownAddress

func ErrUnknownAddress(msg string) error

func ErrUnknownRequest

func ErrUnknownRequest(msg string) error

func GetSignaturePayload

func GetSignaturePayload(s SignDoc) ([]byte, error)

GetSignaturePayload returns the sign payload for the SignDoc. The signature payload is generated by marshalling the SignDoc into Amino JSON, and then sorting the Amino JSON. Ultimately, the formula for signing is sign(sortJSON(aminoJSON(SignDoc)))

func MustSortJSON

func MustSortJSON(toSortJSON []byte) []byte

MustSortJSON is like sortJSON but panic if an error occurs, e.g., if the passed JSON isn't valid.

func SplitFilepath

func SplitFilepath(fpath string) (dir string, filename string)

Splits a path into the dir and filename.

func ValidateDenom

func ValidateDenom(denom string) error

Types

type Account

type Account interface {
	GetAddress() crypto.Address
	SetAddress(crypto.Address) error // errors if already set.

	GetPubKey() crypto.PubKey // can return nil.
	SetPubKey(crypto.PubKey) error

	GetAccountNumber() uint64
	SetAccountNumber(uint64) error

	GetSequence() uint64
	SetSequence(uint64) error

	GetCoins() Coins
	SetCoins(Coins) error

	// Ensure that account implements stringer
	String() string
}

Account is an interface used to store coins at a given address within state. It presumes a notion of sequence numbers for replay protection, a notion of account numbers for replay protection for previously pruned accounts, and a pubkey for authentication purposes.

Many complex conditions can be used in the concrete struct which implements Account.

func ProtoBaseAccount

func ProtoBaseAccount() Account

ProtoBaseAccount - a prototype function for BaseAccount

func ProtoBaseSessionAccount

func ProtoBaseSessionAccount() Account

ProtoBaseSessionAccount - a prototype function for BaseSessionAccount

type AccountUnrestricter

type AccountUnrestricter interface {
	IsTokenLockWhitelisted() bool
	SetTokenLockWhitelisted(bool)
}

type BaseAccount

type BaseAccount struct {
	Address       crypto.Address `json:"address" yaml:"address"`
	Coins         Coins          `json:"coins" yaml:"coins"`
	PubKey        crypto.PubKey  `json:"public_key" yaml:"public_key"`
	AccountNumber uint64         `json:"account_number" yaml:"account_number"`
	Sequence      uint64         `json:"sequence" yaml:"sequence"`
}

BaseAccount - a base account structure. This can be extended by embedding within in your *Account structure.

func NewBaseAccount

func NewBaseAccount(address crypto.Address, coins Coins,
	pubKey crypto.PubKey, accountNumber uint64, sequence uint64,
) *BaseAccount

NewBaseAccount creates a new BaseAccount object

func NewBaseAccountWithAddress

func NewBaseAccountWithAddress(addr crypto.Address) BaseAccount

NewBaseAccountWithAddress - returns a new base account with a given address

func (*BaseAccount) GetAccountNumber

func (acc *BaseAccount) GetAccountNumber() uint64

GetAccountNumber - Implements Account

func (BaseAccount) GetAddress

func (acc BaseAccount) GetAddress() crypto.Address

GetAddress - Implements Account.

func (*BaseAccount) GetCoins

func (acc *BaseAccount) GetCoins() Coins

GetCoins - Implements Account.

func (BaseAccount) GetPubKey

func (acc BaseAccount) GetPubKey() crypto.PubKey

GetPubKey - Implements Account.

func (*BaseAccount) GetSequence

func (acc *BaseAccount) GetSequence() uint64

GetSequence - Implements Account.

func (BaseAccount) MarshalBinary2

func (goo BaseAccount) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (*BaseAccount) SetAccountNumber

func (acc *BaseAccount) SetAccountNumber(accNumber uint64) error

SetAccountNumber - Implements Account

func (*BaseAccount) SetAddress

func (acc *BaseAccount) SetAddress(addr crypto.Address) error

SetAddress - Implements Account.

func (*BaseAccount) SetCoins

func (acc *BaseAccount) SetCoins(coins Coins) error

SetCoins - Implements Account.

func (*BaseAccount) SetPubKey

func (acc *BaseAccount) SetPubKey(pubKey crypto.PubKey) error

SetPubKey - Implements Account.

func (*BaseAccount) SetSequence

func (acc *BaseAccount) SetSequence(seq uint64) error

SetSequence - Implements Account.

func (BaseAccount) SizeBinary2

func (goo BaseAccount) SizeBinary2(cdc *amino.Codec) (int, error)

func (BaseAccount) String

func (acc BaseAccount) String() string

String implements fmt.Stringer

func (*BaseAccount) UnmarshalBinary2

func (goo *BaseAccount) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type BaseSessionAccount

type BaseSessionAccount struct {
	BaseAccount
	MasterAddress crypto.Address `json:"master_address" yaml:"master_address"`
	ExpiresAt     int64          `json:"expires_at" yaml:"expires_at"`                         // unix ts; 0 = no expiry
	SpendLimit    Coins          `json:"spend_limit,omitempty" yaml:"spend_limit,omitempty"`   // nil/empty = no spending allowed (fail-closed, NOT unrestricted)
	SpendPeriod   int64          `json:"spend_period,omitempty" yaml:"spend_period,omitempty"` // seconds; 0 = lifetime cap (no reset)
	SpendUsed     Coins          `json:"spend_used,omitempty" yaml:"spend_used,omitempty"`     // nil/empty = 0 spent
	SpendReset    int64          `json:"spend_reset,omitempty" yaml:"spend_reset,omitempty"`   // unix ts; start of current period
}

BaseSessionAccount is a delegated signing account linked to a master. It is keyed under the master account in the store.

Session accounts do not hold coins — fees are always deducted from the master account. GetCoins always returns nil and SetCoins rejects non-empty coins to prevent accidental trapping of funds.

SpendLimit controls how many coins the session can transfer per period (via MsgCall.Send, MsgSend, gas fees, etc.). If SpendLimit is empty, the session cannot spend any coins at all — this is useful for sessions where another signer pays gas, or for calling functions that don't require coin transfers. SpendLimit must include the gas fee denom (e.g., ugnot) or the session won't be able to pay gas fees — spending is checked per-denom, and a missing denom means zero allowance.

Zero-value semantics (important — each field has a special meaning when zero):

  • ExpiresAt == 0: no expiry; session is valid until revoked.
  • SpendPeriod == 0: SpendLimit is a lifetime cap (no periodic reset).
  • SpendLimit nil/empty: no spending allowed (including gas); useful only when another signer pays gas. NOT "unrestricted" — fails closed.
  • SpendUsed nil/empty: zero spent (Coins treats nil the same as empty).
  • SpendReset == 0: initial state (no period has elapsed yet). Set to BlockTime at session creation by the handler.

func (BaseSessionAccount) GetCoins

func (acc BaseSessionAccount) GetCoins() Coins

GetCoins always returns nil — session accounts do not hold coins.

func (BaseSessionAccount) GetExpiresAt

func (acc BaseSessionAccount) GetExpiresAt() int64

GetExpiresAt - Implements DelegatedAccount.

func (BaseSessionAccount) GetMasterAddress

func (acc BaseSessionAccount) GetMasterAddress() crypto.Address

GetMasterAddress - Implements DelegatedAccount.

func (BaseSessionAccount) GetSpendLimit

func (acc BaseSessionAccount) GetSpendLimit() Coins

GetSpendLimit - Implements DelegatedAccount.

func (BaseSessionAccount) GetSpendPeriod

func (acc BaseSessionAccount) GetSpendPeriod() int64

GetSpendPeriod - Implements DelegatedAccount.

func (BaseSessionAccount) GetSpendReset

func (acc BaseSessionAccount) GetSpendReset() int64

GetSpendReset - Implements DelegatedAccount.

func (BaseSessionAccount) GetSpendUsed

func (acc BaseSessionAccount) GetSpendUsed() Coins

GetSpendUsed - Implements DelegatedAccount.

func (BaseSessionAccount) MarshalBinary2

func (goo BaseSessionAccount) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (*BaseSessionAccount) SetCoins

func (acc *BaseSessionAccount) SetCoins(coins Coins) error

SetCoins rejects non-empty coins. Session accounts should never hold coins; fees are deducted from the master account.

func (*BaseSessionAccount) SetExpiresAt

func (acc *BaseSessionAccount) SetExpiresAt(t int64) error

SetExpiresAt - Implements DelegatedAccount.

func (*BaseSessionAccount) SetMasterAddress

func (acc *BaseSessionAccount) SetMasterAddress(addr crypto.Address) error

SetMasterAddress - Implements DelegatedAccount.

func (*BaseSessionAccount) SetSpendLimit

func (acc *BaseSessionAccount) SetSpendLimit(coins Coins) error

SetSpendLimit - Implements DelegatedAccount.

func (*BaseSessionAccount) SetSpendPeriod

func (acc *BaseSessionAccount) SetSpendPeriod(period int64) error

SetSpendPeriod - Implements DelegatedAccount.

func (*BaseSessionAccount) SetSpendReset

func (acc *BaseSessionAccount) SetSpendReset(t int64) error

SetSpendReset - Implements DelegatedAccount.

func (*BaseSessionAccount) SetSpendUsed

func (acc *BaseSessionAccount) SetSpendUsed(coins Coins) error

SetSpendUsed - Implements DelegatedAccount.

func (BaseSessionAccount) SizeBinary2

func (goo BaseSessionAccount) SizeBinary2(cdc *amino.Codec) (int, error)

func (BaseSessionAccount) String

func (acc BaseSessionAccount) String() string

String implements fmt.Stringer

func (*BaseSessionAccount) UnmarshalBinary2

func (goo *BaseSessionAccount) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type Coin

type Coin struct {
	Denom  string `json:"denom"`
	Amount int64  `json:"amount"`
}

Coin hold some amount of one currency. A negative amount is invalid.

func MustParseCoin

func MustParseCoin(coinStr string) Coin

func NewCoin

func NewCoin(denom string, amount int64) Coin

NewCoin returns a new coin with a denomination and amount. It will panic if the amount is negative. To construct a negative (invalid) amount, use an operation.

func NewCoinSafe

func NewCoinSafe(denom string, amount int64) (Coin, error)

NewCoinSafe returns a new coin with a denomination and amount. It will return an error if the amount is negative. To construct a negative (invalid) amount, use an operation.

func ParseCoin

func ParseCoin(coinStr string) (coin Coin, err error)

ParseCoin parses a cli input for one coin type, returning errors if invalid. This returns an error on an empty string as well.

func (Coin) Add

func (coin Coin) Add(coinB Coin) Coin

Adds amounts of two coins with same denom. If the coins differ in denom then it panics. An overflow or underflow panics. An invalid result panics.

func (Coin) AddUnsafe

func (coin Coin) AddUnsafe(coinB Coin) Coin

func (Coin) IsEqual

func (coin Coin) IsEqual(other Coin) bool

IsEqual returns true if the two sets of Coins have the same value

func (Coin) IsGTE

func (coin Coin) IsGTE(other Coin) bool

IsGTE returns true if they are the same type and the receiver is an equal or greater value

func (Coin) IsLT

func (coin Coin) IsLT(other Coin) bool

IsLT returns true if they are the same type and the receiver is a smaller value

func (Coin) IsNegative

func (coin Coin) IsNegative() bool

IsNegative returns true if the coin amount is negative and false otherwise.

func (Coin) IsPositive

func (coin Coin) IsPositive() bool

IsPositive returns true if coin amount is positive.

func (Coin) IsValid

func (coin Coin) IsValid() bool

IsValid returns true if the Coin has a non-negative amount and the denom is valid.

func (Coin) IsZero

func (coin Coin) IsZero() bool

IsZero returns if this represents no money

func (Coin) MarshalAmino

func (coin Coin) MarshalAmino() (string, error)

func (Coin) MarshalBinary2

func (goo Coin) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (Coin) SizeBinary2

func (goo Coin) SizeBinary2(cdc *amino.Codec) (int, error)

func (Coin) String

func (coin Coin) String() string

String provides a human-readable representation of a coin

func (Coin) Sub

func (coin Coin) Sub(coinB Coin) Coin

Subtracts amounts of two coins with same denom. If the coins differ in denom then it panics. An overflow or underflow panics. An invalid result panics.

func (Coin) SubUnsafe

func (coin Coin) SubUnsafe(coinB Coin) Coin

func (*Coin) UnmarshalAmino

func (coin *Coin) UnmarshalAmino(coinstr string) (err error)

func (*Coin) UnmarshalBinary2

func (goo *Coin) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type Coins

type Coins []Coin

Coins is a set of Coin, one per currency

func MustParseCoins

func MustParseCoins(coinsStr string) Coins

func NewCoins

func NewCoins(coins ...Coin) Coins

NewCoins constructs a new coin set.

func ParseCoins

func ParseCoins(coinsStr string) (Coins, error)

ParseCoins will parse out a list of coins separated by commas. If nothing is provided, it returns nil Coins. Returned coins are sorted.

func (Coins) Add

func (coins Coins) Add(coinsB Coins) Coins

Add adds two sets of coins.

e.g. {2A} + {A, 2B} = {3A, 2B} {2A} + {0B} = {2A}

NOTE: Add operates under the invariant that coins are sorted by denominations. Panics on invalid result.

func (Coins) AddUnsafe

func (coins Coins) AddUnsafe(coinsB Coins) Coins

AddUnsafe will perform addition of two coins sets. If both coin sets are empty, then an empty set is returned. If only a single set is empty, the other set is returned. Otherwise, the coins are compared in order of their denomination and addition only occurs when the denominations match, otherwise the coin is simply added to the sum assuming it's not zero.

func (Coins) AmountOf

func (coins Coins) AmountOf(denom string) int64

Returns the amount of a denom from coins, which may be negative.

func (Coins) ContainOneOfDenom

func (coins Coins) ContainOneOfDenom(denoms map[string]struct{}) bool

ContainOneOfDenom check if a Coins instance contains a denom in the provided denomos

func (Coins) DenomsSubsetOf

func (coins Coins) DenomsSubsetOf(coinsB Coins) bool

DenomsSubsetOf returns true if receiver's denom set is subset of coinsB's denoms.

func (Coins) Empty

func (coins Coins) Empty() bool

Empty returns true if there are no coins and false otherwise.

func (Coins) IsAllGT

func (coins Coins) IsAllGT(coinsB Coins) bool

IsAllGT returns true if for every denom in coinsB, the denom is present at a greater amount in coins.

func (Coins) IsAllGTE

func (coins Coins) IsAllGTE(coinsB Coins) bool

IsAllGTE returns false if for any denom in coinsB, the denom is present at a smaller amount in coins; else returns true.

func (Coins) IsAllLT

func (coins Coins) IsAllLT(coinsB Coins) bool

IsAllLT returns True iff for every denom in coins, the denom is present at a smaller amount in coinsB.

func (Coins) IsAllLTE

func (coins Coins) IsAllLTE(coinsB Coins) bool

IsAllLTE returns true iff for every denom in coins, the denom is present at a smaller or equal amount in coinsB.

func (Coins) IsAllPositive

func (coins Coins) IsAllPositive() bool

IsAllPositive returns true if there is at least one coin and all currencies have a positive value. NOTE: besides this function, which is zero sensitive, all other functions don't need to be called "IsAll*" -- TODO: rename back coins.IsAll* to coins.Is*?

func (Coins) IsAnyGT

func (coins Coins) IsAnyGT(coinsB Coins) bool

IsAnyGT returns true iff for any denom in coins, the denom is present at a greater amount in coinsB.

e.g. {2A, 3B}.IsAnyGT{A} = true {2A, 3B}.IsAnyGT{5C} = false {}.IsAnyGT{5C} = false {2A, 3B}.IsAnyGT{} = false

func (Coins) IsAnyGTE

func (coins Coins) IsAnyGTE(coinsB Coins) bool

IsAnyGTE returns true iff coins contains at least one denom that is present at a greater or equal amount in coinsB; it returns false otherwise.

NOTE: IsAnyGTE operates under the invariant that both coin sets are sorted by denominations and there exists no zero coins.

func (Coins) IsAnyNegative

func (coins Coins) IsAnyNegative() bool

IsAnyNegative returns true if there is at least one coin whose amount is negative; returns false otherwise. It returns false if the coin set is empty too.

TODO: Remove once unsigned integers are used.

func (Coins) IsEqual

func (coins Coins) IsEqual(coinsB Coins) bool

IsEqual returns true if the two sets of Coins have the same value

func (Coins) IsValid

func (coins Coins) IsValid() bool

IsValid asserts the Coins are sorted, have positive amount, and Denom does not contain upper case characters.

func (Coins) IsZero

func (coins Coins) IsZero() bool

IsZero returns true if there are no coins or all coins are zero.

func (Coins) Len

func (coins Coins) Len() int

func (Coins) Less

func (coins Coins) Less(i, j int) bool

func (Coins) MarshalAmino

func (coins Coins) MarshalAmino() (string, error)

func (Coins) Sort

func (coins Coins) Sort() Coins

Sort is a helper function to sort the set of coins inplace

func (Coins) String

func (coins Coins) String() string

func (Coins) Sub

func (coins Coins) Sub(coinsB Coins) Coins

Sub subtracts a set of coins from another.

e.g. {2A, 3B} - {A} = {A, 3B} {2A} - {0B} = {2A} {A, B} - {A} = {B}

Panics on invalid result.

func (Coins) SubUnsafe

func (coins Coins) SubUnsafe(coinsB Coins) Coins

SubUnsafe performs the same arithmetic as Sub but returns a boolean if any negative coin amount was returned.

func (Coins) Swap

func (coins Coins) Swap(i, j int)

func (*Coins) UnmarshalAmino

func (coins *Coins) UnmarshalAmino(coinsstr string) (err error)

type DelegatedAccount

type DelegatedAccount interface {
	Account
	GetMasterAddress() crypto.Address
	SetMasterAddress(crypto.Address) error
	GetExpiresAt() int64
	SetExpiresAt(int64) error
	GetSpendLimit() Coins
	SetSpendLimit(Coins) error
	GetSpendPeriod() int64
	SetSpendPeriod(int64) error
	GetSpendUsed() Coins
	SetSpendUsed(Coins) error
	GetSpendReset() int64
	SetSpendReset(int64) error
}

DelegatedAccount is implemented by session accounts that delegate fee payment and identity to a master account.

type Fee

type Fee struct {
	GasWanted int64 `json:"gas_wanted" yaml:"gas_wanted"`
	GasFee    Coin  `json:"gas_fee" yaml:"gas_fee"`
}

Fee includes the amount of coins paid in fees and the maximum gas to be used by the transaction. The ratio yields an effective "gasprice", which must be above some miminum to be accepted into the mempool.

func NewFee

func NewFee(gasWanted int64, gasFee Coin) Fee

NewFee returns a new instance of Fee

func (Fee) Bytes

func (fee Fee) Bytes() []byte

Bytes for signing later

func (Fee) MarshalBinary2

func (goo Fee) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (Fee) SizeBinary2

func (goo Fee) SizeBinary2(cdc *amino.Codec) (int, error)

func (*Fee) UnmarshalBinary2

func (goo *Fee) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GasOverflowError

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

func (GasOverflowError) AssertABCIError

func (GasOverflowError) AssertABCIError()

func (GasOverflowError) Error

func (e GasOverflowError) Error() string

func (GasOverflowError) MarshalBinary2

func (goo GasOverflowError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GasOverflowError) SizeBinary2

func (goo GasOverflowError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GasOverflowError) UnmarshalBinary2

func (goo *GasOverflowError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GasPrice

type GasPrice struct {
	Gas   int64 `json:"gas"`
	Price Coin  `json:"price"`
}

minimum gas price is Price/Gas per gas unit.

func ParseGasPrice

func ParseGasPrice(gasprice string) (GasPrice, error)

func ParseGasPrices

func ParseGasPrices(gasprices string) (res []GasPrice, err error)

func (GasPrice) IsGTE

func (gp GasPrice) IsGTE(gpB GasPrice) (bool, error)

IsGTE compares the GasPrice with another gas price B. If the coin denom matches AND the fee per gas is greater than or equal to gas price B, return true; otherwise, return false.

func (GasPrice) MarshalBinary2

func (goo GasPrice) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GasPrice) SizeBinary2

func (goo GasPrice) SizeBinary2(cdc *amino.Codec) (int, error)

func (GasPrice) String

func (gp GasPrice) String() string

func (*GasPrice) UnmarshalBinary2

func (goo *GasPrice) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type InsufficientCoinsError

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

func (InsufficientCoinsError) AssertABCIError

func (InsufficientCoinsError) AssertABCIError()

func (InsufficientCoinsError) Error

func (e InsufficientCoinsError) Error() string

func (InsufficientCoinsError) MarshalBinary2

func (goo InsufficientCoinsError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (InsufficientCoinsError) SizeBinary2

func (goo InsufficientCoinsError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*InsufficientCoinsError) UnmarshalBinary2

func (goo *InsufficientCoinsError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type InsufficientFeeError

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

func (InsufficientFeeError) AssertABCIError

func (InsufficientFeeError) AssertABCIError()

func (InsufficientFeeError) Error

func (e InsufficientFeeError) Error() string

func (InsufficientFeeError) MarshalBinary2

func (goo InsufficientFeeError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (InsufficientFeeError) SizeBinary2

func (goo InsufficientFeeError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*InsufficientFeeError) UnmarshalBinary2

func (goo *InsufficientFeeError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type InsufficientFundsError

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

func (InsufficientFundsError) AssertABCIError

func (InsufficientFundsError) AssertABCIError()

func (InsufficientFundsError) Error

func (e InsufficientFundsError) Error() string

func (InsufficientFundsError) MarshalBinary2

func (goo InsufficientFundsError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (InsufficientFundsError) SizeBinary2

func (goo InsufficientFundsError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*InsufficientFundsError) UnmarshalBinary2

func (goo *InsufficientFundsError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type InternalError

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

declare all std errors. NOTE: these are meant to be used in conjunction with pkgs/errors.

func (InternalError) AssertABCIError

func (InternalError) AssertABCIError()

func (InternalError) Error

func (e InternalError) Error() string

func (InternalError) MarshalBinary2

func (goo InternalError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (InternalError) SizeBinary2

func (goo InternalError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*InternalError) UnmarshalBinary2

func (goo *InternalError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type InvalidAddressError

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

func (InvalidAddressError) AssertABCIError

func (InvalidAddressError) AssertABCIError()

func (InvalidAddressError) Error

func (e InvalidAddressError) Error() string

func (InvalidAddressError) MarshalBinary2

func (goo InvalidAddressError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (InvalidAddressError) SizeBinary2

func (goo InvalidAddressError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*InvalidAddressError) UnmarshalBinary2

func (goo *InvalidAddressError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type InvalidCoinsError

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

func (InvalidCoinsError) AssertABCIError

func (InvalidCoinsError) AssertABCIError()

func (InvalidCoinsError) Error

func (e InvalidCoinsError) Error() string

func (InvalidCoinsError) MarshalBinary2

func (goo InvalidCoinsError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (InvalidCoinsError) SizeBinary2

func (goo InvalidCoinsError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*InvalidCoinsError) UnmarshalBinary2

func (goo *InvalidCoinsError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type InvalidGasWantedError

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

func (InvalidGasWantedError) AssertABCIError

func (InvalidGasWantedError) AssertABCIError()

func (InvalidGasWantedError) Error

func (e InvalidGasWantedError) Error() string

func (InvalidGasWantedError) MarshalBinary2

func (goo InvalidGasWantedError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (InvalidGasWantedError) SizeBinary2

func (goo InvalidGasWantedError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*InvalidGasWantedError) UnmarshalBinary2

func (goo *InvalidGasWantedError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type InvalidPubKeyError

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

func (InvalidPubKeyError) AssertABCIError

func (InvalidPubKeyError) AssertABCIError()

func (InvalidPubKeyError) Error

func (e InvalidPubKeyError) Error() string

func (InvalidPubKeyError) MarshalBinary2

func (goo InvalidPubKeyError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (InvalidPubKeyError) SizeBinary2

func (goo InvalidPubKeyError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*InvalidPubKeyError) UnmarshalBinary2

func (goo *InvalidPubKeyError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type InvalidSequenceError

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

func (InvalidSequenceError) AssertABCIError

func (InvalidSequenceError) AssertABCIError()

func (InvalidSequenceError) Error

func (e InvalidSequenceError) Error() string

func (InvalidSequenceError) MarshalBinary2

func (goo InvalidSequenceError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (InvalidSequenceError) SizeBinary2

func (goo InvalidSequenceError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*InvalidSequenceError) UnmarshalBinary2

func (goo *InvalidSequenceError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type KI64Pair

type KI64Pair struct {
	Key   []byte
	Value int64
}

KI64Pair is a key-value struct for int64 value.

type KI64Pairs

type KI64Pairs []KI64Pair

KI64Pairs is a slice of KI64Pair.

func (KI64Pairs) Len

func (kvs KI64Pairs) Len() int

Len returns the length of kvs.

func (KI64Pairs) Less

func (kvs KI64Pairs) Less(i, j int) bool

Less reports whether kvs[i] should be ordered before kvs[j].

func (KI64Pairs) Sort

func (kvs KI64Pairs) Sort()

Sort sorts a kvs in ascending order.

func (KI64Pairs) Swap

func (kvs KI64Pairs) Swap(i, j int)

Swap swaps the elements with indexes, i and j.

type KVPair

type KVPair struct {
	Key   []byte
	Value []byte
}

KVPair is a key-value struct for []byte value.

type KVPairs

type KVPairs []KVPair

KVPairs is a slice of KVPair.

func (KVPairs) Len

func (kvs KVPairs) Len() int

Len returns the length of kvs.

func (KVPairs) Less

func (kvs KVPairs) Less(i, j int) bool

Less reports whether kvs[i] should be ordered before kvs[j].

func (KVPairs) Sort

func (kvs KVPairs) Sort()

Sort sorts a kvs in ascending order.

func (KVPairs) Swap

func (kvs KVPairs) Swap(i, j int)

Swap swaps the elements with indexes, i and j.

type MemFile

type MemFile struct {
	Name string `json:"name" yaml:"name"`
	Body string `json:"body" yaml:"body"`
}

A MemFile is the simplest representation of a "file".

File Name must contain a single dot and extension. File Name may be ALLCAPS.xxx or lowercase.xxx; extensions lowercase. e.g. OK: README.md, readme.md, readme.txt, READ.me e.g. NOT OK: Readme.md, readme.MD, README, .readme File Body can be any string.

NOTE: It doesn't have owners or timestamps. Keep this as is for portability. Not even date created, ownership, or other attributes. Just a name, and a body. This keeps things portable, easy to hash (otherwise need to manage e.g. the encoding and portability of timestamps).

func (*MemFile) Copy

func (mfile *MemFile) Copy() *MemFile

Creates a new copy.

func (MemFile) MarshalBinary2

func (goo MemFile) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (*MemFile) Print

func (mfile *MemFile) Print() error

Print file to stdout.

func (MemFile) SizeBinary2

func (goo MemFile) SizeBinary2(cdc *amino.Codec) (int, error)

func (*MemFile) UnmarshalBinary2

func (goo *MemFile) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

func (*MemFile) ValidateBasic

func (mfile *MemFile) ValidateBasic() error

type MemPackage

type MemPackage struct {
	Name  string     `json:"name" yaml:"name"`           // package name as declared by `package`
	Path  string     `json:"path" yaml:"path"`           // import path
	Files []*MemFile `json:"files" yaml:"files"`         // plain file system files.
	Type  any        `json:"type,omitempty" yaml:"type"` // (user defined) package type.
	Info  any        `json:"info,omitempty" yaml:"info"` // (user defined) extra information.
}

MemPackage represents the information and files of a package which will be stored in memory. It will generally be initialized by package gnolang's ReadMemPackage. Note: a package does not support subfolders.

NOTE: in the future, a MemPackage may represent updates/additional-files for an existing package.

func (*MemPackage) AddFile

func (mpkg *MemPackage) AddFile(mfile *MemFile)

Adds a file to the package without validation.

func (*MemPackage) DeleteFile

func (mpkg *MemPackage) DeleteFile(name string) *MemFile

Removes an existing file and returns it or nil.

func (*MemPackage) FileNames

func (mpkg *MemPackage) FileNames() (fnames []string)

Return a list of all file names.

func (*MemPackage) GetFile

func (mpkg *MemPackage) GetFile(name string) *MemFile

Return the named file or none if it doesn't exist.

func (*MemPackage) IsEmpty

func (mpkg *MemPackage) IsEmpty() bool

Returns true if it has no files.

func (*MemPackage) IsEmptyOf

func (mpkg *MemPackage) IsEmptyOf(xtn string) bool

Returns true if it has no files ending in `xtn`. xtn should start with a dot to check extensions, but need not start with one, e.g. to test for _test.gno.

func (*MemPackage) IsZero

func (mpkg *MemPackage) IsZero() bool

Returns true if zero.

func (MemPackage) MarshalBinary2

func (goo MemPackage) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (*MemPackage) NewFile

func (mpkg *MemPackage) NewFile(name string, body string) (mfile *MemFile)

Creates a new MemFile and adds without validation.

func (*MemPackage) Print

func (mpkg *MemPackage) Print() error

Print all files to stdout.

func (*MemPackage) SetFile

func (mpkg *MemPackage) SetFile(name string, body string) *MemFile

Writes to existing file or creates a new one.

func (MemPackage) SizeBinary2

func (goo MemPackage) SizeBinary2(cdc *amino.Codec) (int, error)

func (*MemPackage) Sort

func (mpkg *MemPackage) Sort()

Sort files; a MemPackage with unordered files is in valid.

func (*MemPackage) Uniq

func (mpkg *MemPackage) Uniq() error

Returns an error if lowercase(file.Name) are not unique.

func (*MemPackage) UnmarshalBinary2

func (goo *MemPackage) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

func (*MemPackage) ValidateBasic

func (mpkg *MemPackage) ValidateBasic() error

Package Name must be lower_case, can have digits & underscores. Package Path must be "a.valid.url/path" or a "simple/path". An empty MemPackager is invalid.

func (*MemPackage) WriteTo

func (mpkg *MemPackage) WriteTo(dir string) error

Write all files into dir.

type MemoTooLargeError

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

func (MemoTooLargeError) AssertABCIError

func (MemoTooLargeError) AssertABCIError()

func (MemoTooLargeError) Error

func (e MemoTooLargeError) Error() string

func (MemoTooLargeError) MarshalBinary2

func (goo MemoTooLargeError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (MemoTooLargeError) SizeBinary2

func (goo MemoTooLargeError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*MemoTooLargeError) UnmarshalBinary2

func (goo *MemoTooLargeError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type Msg

type Msg interface {
	// Return the message type.
	// Must be alphanumeric or empty.
	Route() string

	// Returns a human-readable string for the message, intended for utilization
	// within tags
	Type() string

	// ValidateBasic does a simple validation check that
	// doesn't require access to any other information.
	ValidateBasic() error

	// Get the canonical byte representation of the Msg.
	GetSignBytes() []byte

	// Signers returns the addrs of signers that must sign.
	// CONTRACT: All signatures must be present to be valid.
	// CONTRACT: Returns addrs in some deterministic order.
	GetSigners() []crypto.Address
}

Transactions messages must fulfill the Msg.

type NoSignaturesError

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

func (NoSignaturesError) AssertABCIError

func (NoSignaturesError) AssertABCIError()

func (NoSignaturesError) Error

func (e NoSignaturesError) Error() string

func (NoSignaturesError) MarshalBinary2

func (goo NoSignaturesError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (NoSignaturesError) SizeBinary2

func (goo NoSignaturesError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*NoSignaturesError) UnmarshalBinary2

func (goo *NoSignaturesError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type OutOfGasError

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

func (OutOfGasError) AssertABCIError

func (OutOfGasError) AssertABCIError()

func (OutOfGasError) Error

func (e OutOfGasError) Error() string

func (OutOfGasError) MarshalBinary2

func (goo OutOfGasError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (OutOfGasError) SizeBinary2

func (goo OutOfGasError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*OutOfGasError) UnmarshalBinary2

func (goo *OutOfGasError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type RestrictedTransferError

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

func (RestrictedTransferError) AssertABCIError

func (RestrictedTransferError) AssertABCIError()

func (RestrictedTransferError) Error

func (e RestrictedTransferError) Error() string

func (RestrictedTransferError) MarshalBinary2

func (goo RestrictedTransferError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (RestrictedTransferError) SizeBinary2

func (goo RestrictedTransferError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*RestrictedTransferError) UnmarshalBinary2

func (goo *RestrictedTransferError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type SessionAccountsContextKey

type SessionAccountsContextKey struct{}

SessionAccountsContextKey is the context key used by the auth ante handler to propagate the set of session accounts it resolved during Phase 1 into downstream handler execution (bank keeper hooks, VM keeper, gno runtime).

The value stored under this key has the exact type:

map[crypto.Address]DelegatedAccount

Each entry maps a signer address (the master account address returned by msg.GetSigners(), NOT the session pubkey address) to the DelegatedAccount that was loaded for it via the Signature.SessionAddr field (when non-zero — zero SessionAddr means master-signed).

Contract for readers:

  • A nil value or absent key means "not a session tx" — treat as master.
  • A zero-length map means "no session signers in this tx" — equivalent to nil for all practical purposes.
  • Presence of (signerAddr, da) in the map means the ante has already verified the session exists, is unexpired, and the tx signer is authorized as that session; downstream code can rely on these invariants without re-checking.
  • The DelegatedAccount values are SHARED POINTERS — mutations to da.SpendUsed propagate across all readers within the same tx. Callers of auth.DeductSessionSpend / CheckAndDeductSessionSpend rely on this for cumulative spend tracking.

Contract for writers: only the auth ante should populate this key. It is set in Phase 4 of the ante (after signature verification succeeds) and read by any keeper hook that needs to attribute coin movement or other authority to a session rather than a master account.

type SessionExpiredError

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

func (SessionExpiredError) AssertABCIError

func (SessionExpiredError) AssertABCIError()

func (SessionExpiredError) Error

func (e SessionExpiredError) Error() string

func (SessionExpiredError) MarshalBinary2

func (goo SessionExpiredError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (SessionExpiredError) SizeBinary2

func (goo SessionExpiredError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*SessionExpiredError) UnmarshalBinary2

func (goo *SessionExpiredError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type SessionLimitError

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

func (SessionLimitError) AssertABCIError

func (SessionLimitError) AssertABCIError()

func (SessionLimitError) Error

func (e SessionLimitError) Error() string

func (SessionLimitError) MarshalBinary2

func (goo SessionLimitError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (SessionLimitError) SizeBinary2

func (goo SessionLimitError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*SessionLimitError) UnmarshalBinary2

func (goo *SessionLimitError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type SessionNotAllowedError

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

func (SessionNotAllowedError) AssertABCIError

func (SessionNotAllowedError) AssertABCIError()

func (SessionNotAllowedError) Error

func (e SessionNotAllowedError) Error() string

func (SessionNotAllowedError) MarshalBinary2

func (goo SessionNotAllowedError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (SessionNotAllowedError) SizeBinary2

func (goo SessionNotAllowedError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*SessionNotAllowedError) UnmarshalBinary2

func (goo *SessionNotAllowedError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type SessionNotFoundError

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

func (SessionNotFoundError) AssertABCIError

func (SessionNotFoundError) AssertABCIError()

func (SessionNotFoundError) Error

func (e SessionNotFoundError) Error() string

func (SessionNotFoundError) MarshalBinary2

func (goo SessionNotFoundError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (SessionNotFoundError) SizeBinary2

func (goo SessionNotFoundError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*SessionNotFoundError) UnmarshalBinary2

func (goo *SessionNotFoundError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type SignDoc

type SignDoc struct {
	ChainID       string `json:"chain_id" yaml:"chain_id"`
	AccountNumber uint64 `json:"account_number" yaml:"account_number"`
	Sequence      uint64 `json:"sequence" yaml:"sequence"`
	Fee           Fee    `json:"fee" yaml:"fee"`
	Msgs          []Msg  `json:"msgs" yaml:"msgs"`
	Memo          string `json:"memo" yaml:"memo"`
}

SignDoc is the standard object for transactions. AccountNumber is a replay-prevention field for the whole account (eg. nonce) to prevent the replay of txs after an account has been deleted (due to zero balance). Sequence is a replay-prevention field for each transaction given a nonce

type Signature

type Signature struct {
	PubKey    crypto.PubKey `json:"pub_key" yaml:"pub_key"` // optional
	Signature []byte        `json:"signature" yaml:"signature"`
	// SessionAddr identifies a session account for delegated signing.
	// Zero-value means a master-key signature. When non-zero, the AnteHandler
	// loads the session account at /a/<signer>/s/<SessionAddr> for verification.
	// Amino binary and JSON both skip the field when the address is zero
	// ([20]byte{}), so master-signed txs pay no wire-size overhead.
	SessionAddr crypto.Address `json:"session_addr,omitempty" yaml:"session_addr,omitempty"`
}

Signature represents a wrapped signature of a transaction

func (Signature) MarshalBinary2

func (goo Signature) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (Signature) SizeBinary2

func (goo Signature) SizeBinary2(cdc *amino.Codec) (int, error)

func (*Signature) UnmarshalBinary2

func (goo *Signature) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type SpendEstimator

type SpendEstimator interface {
	SpendForSigner(signer crypto.Address) Coins
}

SpendEstimator is an optional interface a Msg can implement to declare the coin outflow it expects to cause for a given signer. The auth ante's session pre-check aggregates these estimates across all msgs in a tx and rejects session-signed txs whose gas fee plus declared outflow would exceed the session's remaining SpendLimit — before gas is charged.

Returning zero or nil means "this msg does not declare outflow for that signer." Msgs that don't implement this interface are skipped in the pre-check; the bank.Keeper.SendCoins session hook still catches the actual outflow at execution time. So implementing SpendEstimator is a gas-efficiency optimization, not a correctness requirement.

type TooManySignaturesError

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

func (TooManySignaturesError) AssertABCIError

func (TooManySignaturesError) AssertABCIError()

func (TooManySignaturesError) Error

func (e TooManySignaturesError) Error() string

func (TooManySignaturesError) MarshalBinary2

func (goo TooManySignaturesError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (TooManySignaturesError) SizeBinary2

func (goo TooManySignaturesError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*TooManySignaturesError) UnmarshalBinary2

func (goo *TooManySignaturesError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type Tx

type Tx struct {
	Msgs       []Msg       `json:"msg" yaml:"msg"`
	Fee        Fee         `json:"fee" yaml:"fee"`
	Signatures []Signature `json:"signatures" yaml:"signatures"`
	Memo       string      `json:"memo" yaml:"memo"`
}

Tx is a standard way to wrap a Msg with Fee and Signatures. NOTE: the first signature is the fee payer (Signatures must not be nil).

func NewTx

func NewTx(msgs []Msg, fee Fee, sigs []Signature, memo string) Tx

func ParseTxs

func ParseTxs(ctx context.Context, reader io.Reader) ([]Tx, error)

func (Tx) GetMemo

func (tx Tx) GetMemo() string

GetMemo returns the memo

func (Tx) GetMsgs

func (tx Tx) GetMsgs() []Msg

GetMsgs returns the all the transaction's messages.

func (Tx) GetSignBytes

func (tx Tx) GetSignBytes(chainID string, accountNumber uint64, sequence uint64) ([]byte, error)

func (Tx) GetSignatures

func (tx Tx) GetSignatures() []Signature

GetSignatures returns the signature of signers who signed the Msg. GetSignatures returns the signature of signers who signed the Msg. CONTRACT: Length returned is same as length of pubkeys returned from MsgKeySigners, and the order matches. CONTRACT: If the signature is missing (ie the Msg is invalid), then the corresponding signature is .Empty().

func (Tx) GetSigners

func (tx Tx) GetSigners() []crypto.Address

GetSigners returns the addresses that must sign the transaction. Addresses are returned in a deterministic order. They are accumulated from the GetSigners method for each Msg in the order they appear in tx.GetMsgs(). Duplicate addresses will be omitted.

func (Tx) MarshalBinary2

func (goo Tx) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (Tx) SizeBinary2

func (goo Tx) SizeBinary2(cdc *amino.Codec) (int, error)

func (*Tx) UnmarshalBinary2

func (goo *Tx) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

func (Tx) ValidateBasic

func (tx Tx) ValidateBasic() error

ValidateBasic does a simple and lightweight validation check that doesn't require access to any other information.

type TxDecodeError

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

func (TxDecodeError) AssertABCIError

func (TxDecodeError) AssertABCIError()

func (TxDecodeError) Error

func (e TxDecodeError) Error() string

func (TxDecodeError) MarshalBinary2

func (goo TxDecodeError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (TxDecodeError) SizeBinary2

func (goo TxDecodeError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*TxDecodeError) UnmarshalBinary2

func (goo *TxDecodeError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type UnauthorizedError

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

func (UnauthorizedError) AssertABCIError

func (UnauthorizedError) AssertABCIError()

func (UnauthorizedError) Error

func (e UnauthorizedError) Error() string

func (UnauthorizedError) MarshalBinary2

func (goo UnauthorizedError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (UnauthorizedError) SizeBinary2

func (goo UnauthorizedError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*UnauthorizedError) UnmarshalBinary2

func (goo *UnauthorizedError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type UnknownAddressError

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

func (UnknownAddressError) AssertABCIError

func (UnknownAddressError) AssertABCIError()

func (UnknownAddressError) Error

func (e UnknownAddressError) Error() string

func (UnknownAddressError) MarshalBinary2

func (goo UnknownAddressError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (UnknownAddressError) SizeBinary2

func (goo UnknownAddressError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*UnknownAddressError) UnmarshalBinary2

func (goo *UnknownAddressError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type UnknownRequestError

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

func (UnknownRequestError) AssertABCIError

func (UnknownRequestError) AssertABCIError()

func (UnknownRequestError) Error

func (e UnknownRequestError) Error() string

func (UnknownRequestError) MarshalBinary2

func (goo UnknownRequestError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (UnknownRequestError) SizeBinary2

func (goo UnknownRequestError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*UnknownRequestError) UnmarshalBinary2

func (goo *UnknownRequestError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

Jump to

Keyboard shortcuts

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