Documentation
¶
Index ¶
- Constants
- Variables
- func CountSubKeys(pub crypto.PubKey) int
- func ErrGasOverflow(msg string) error
- func ErrInsufficientCoins(msg string) error
- func ErrInsufficientFee(msg string) error
- func ErrInsufficientFunds(msg string) error
- func ErrInternal(msg string) error
- func ErrInvalidAddress(msg string) error
- func ErrInvalidCoins(msg string) error
- func ErrInvalidGasWanted(msg string) error
- func ErrInvalidPubKey(msg string) error
- func ErrInvalidSequence(msg string) error
- func ErrMemoTooLarge(msg string) error
- func ErrNoSignatures(msg string) error
- func ErrOutOfGas(msg string) error
- func ErrSessionExpired(msg string) error
- func ErrSessionLimit(msg string) error
- func ErrSessionNotAllowed(msg string) error
- func ErrSessionNotFound(msg string) error
- func ErrTooManySignatures(msg string) error
- func ErrTxDecode(msg string) error
- func ErrUnauthorized(msg string) error
- func ErrUnknownAddress(msg string) error
- func ErrUnknownRequest(msg string) error
- func GetSignaturePayload(s SignDoc) ([]byte, error)
- func MustSortJSON(toSortJSON []byte) []byte
- func SplitFilepath(fpath string) (dir string, filename string)
- func ValidateDenom(denom string) error
- type Account
- type AccountUnrestricter
- type BaseAccount
- func (acc *BaseAccount) GetAccountNumber() uint64
- func (acc BaseAccount) GetAddress() crypto.Address
- func (acc *BaseAccount) GetCoins() Coins
- func (acc BaseAccount) GetPubKey() crypto.PubKey
- func (acc *BaseAccount) GetSequence() uint64
- func (goo BaseAccount) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (acc *BaseAccount) SetAccountNumber(accNumber uint64) error
- func (acc *BaseAccount) SetAddress(addr crypto.Address) error
- func (acc *BaseAccount) SetCoins(coins Coins) error
- func (acc *BaseAccount) SetPubKey(pubKey crypto.PubKey) error
- func (acc *BaseAccount) SetSequence(seq uint64) error
- func (goo BaseAccount) SizeBinary2(cdc *amino.Codec) (int, error)
- func (acc BaseAccount) String() string
- func (goo *BaseAccount) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type BaseSessionAccount
- func (acc BaseSessionAccount) GetCoins() Coins
- func (acc BaseSessionAccount) GetExpiresAt() int64
- func (acc BaseSessionAccount) GetMasterAddress() crypto.Address
- func (acc BaseSessionAccount) GetSpendLimit() Coins
- func (acc BaseSessionAccount) GetSpendPeriod() int64
- func (acc BaseSessionAccount) GetSpendReset() int64
- func (acc BaseSessionAccount) GetSpendUsed() Coins
- func (goo BaseSessionAccount) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (acc *BaseSessionAccount) SetCoins(coins Coins) error
- func (acc *BaseSessionAccount) SetExpiresAt(t int64) error
- func (acc *BaseSessionAccount) SetMasterAddress(addr crypto.Address) error
- func (acc *BaseSessionAccount) SetSpendLimit(coins Coins) error
- func (acc *BaseSessionAccount) SetSpendPeriod(period int64) error
- func (acc *BaseSessionAccount) SetSpendReset(t int64) error
- func (acc *BaseSessionAccount) SetSpendUsed(coins Coins) error
- func (goo BaseSessionAccount) SizeBinary2(cdc *amino.Codec) (int, error)
- func (acc BaseSessionAccount) String() string
- func (goo *BaseSessionAccount) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type Coin
- func (coin Coin) Add(coinB Coin) Coin
- func (coin Coin) AddUnsafe(coinB Coin) Coin
- func (coin Coin) IsEqual(other Coin) bool
- func (coin Coin) IsGTE(other Coin) bool
- func (coin Coin) IsLT(other Coin) bool
- func (coin Coin) IsNegative() bool
- func (coin Coin) IsPositive() bool
- func (coin Coin) IsValid() bool
- func (coin Coin) IsZero() bool
- func (coin Coin) MarshalAmino() (string, error)
- func (goo Coin) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo Coin) SizeBinary2(cdc *amino.Codec) (int, error)
- func (coin Coin) String() string
- func (coin Coin) Sub(coinB Coin) Coin
- func (coin Coin) SubUnsafe(coinB Coin) Coin
- func (coin *Coin) UnmarshalAmino(coinstr string) (err error)
- func (goo *Coin) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type Coins
- func (coins Coins) Add(coinsB Coins) Coins
- func (coins Coins) AddUnsafe(coinsB Coins) Coins
- func (coins Coins) AmountOf(denom string) int64
- func (coins Coins) ContainOneOfDenom(denoms map[string]struct{}) bool
- func (coins Coins) DenomsSubsetOf(coinsB Coins) bool
- func (coins Coins) Empty() bool
- func (coins Coins) IsAllGT(coinsB Coins) bool
- func (coins Coins) IsAllGTE(coinsB Coins) bool
- func (coins Coins) IsAllLT(coinsB Coins) bool
- func (coins Coins) IsAllLTE(coinsB Coins) bool
- func (coins Coins) IsAllPositive() bool
- func (coins Coins) IsAnyGT(coinsB Coins) bool
- func (coins Coins) IsAnyGTE(coinsB Coins) bool
- func (coins Coins) IsAnyNegative() bool
- func (coins Coins) IsEqual(coinsB Coins) bool
- func (coins Coins) IsValid() bool
- func (coins Coins) IsZero() bool
- func (coins Coins) Len() int
- func (coins Coins) Less(i, j int) bool
- func (coins Coins) MarshalAmino() (string, error)
- func (coins Coins) Sort() Coins
- func (coins Coins) String() string
- func (coins Coins) Sub(coinsB Coins) Coins
- func (coins Coins) SubUnsafe(coinsB Coins) Coins
- func (coins Coins) Swap(i, j int)
- func (coins *Coins) UnmarshalAmino(coinsstr string) (err error)
- type DelegatedAccount
- type Fee
- type GasOverflowError
- func (GasOverflowError) AssertABCIError()
- func (e GasOverflowError) Error() string
- func (goo GasOverflowError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo GasOverflowError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *GasOverflowError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type GasPrice
- func (gp GasPrice) IsGTE(gpB GasPrice) (bool, error)
- func (goo GasPrice) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo GasPrice) SizeBinary2(cdc *amino.Codec) (int, error)
- func (gp GasPrice) String() string
- func (goo *GasPrice) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type InsufficientCoinsError
- func (InsufficientCoinsError) AssertABCIError()
- func (e InsufficientCoinsError) Error() string
- func (goo InsufficientCoinsError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo InsufficientCoinsError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *InsufficientCoinsError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type InsufficientFeeError
- func (InsufficientFeeError) AssertABCIError()
- func (e InsufficientFeeError) Error() string
- func (goo InsufficientFeeError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo InsufficientFeeError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *InsufficientFeeError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type InsufficientFundsError
- func (InsufficientFundsError) AssertABCIError()
- func (e InsufficientFundsError) Error() string
- func (goo InsufficientFundsError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo InsufficientFundsError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *InsufficientFundsError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type InternalError
- func (InternalError) AssertABCIError()
- func (e InternalError) Error() string
- func (goo InternalError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo InternalError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *InternalError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type InvalidAddressError
- func (InvalidAddressError) AssertABCIError()
- func (e InvalidAddressError) Error() string
- func (goo InvalidAddressError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo InvalidAddressError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *InvalidAddressError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type InvalidCoinsError
- func (InvalidCoinsError) AssertABCIError()
- func (e InvalidCoinsError) Error() string
- func (goo InvalidCoinsError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo InvalidCoinsError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *InvalidCoinsError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type InvalidGasWantedError
- func (InvalidGasWantedError) AssertABCIError()
- func (e InvalidGasWantedError) Error() string
- func (goo InvalidGasWantedError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo InvalidGasWantedError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *InvalidGasWantedError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type InvalidPubKeyError
- func (InvalidPubKeyError) AssertABCIError()
- func (e InvalidPubKeyError) Error() string
- func (goo InvalidPubKeyError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo InvalidPubKeyError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *InvalidPubKeyError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type InvalidSequenceError
- func (InvalidSequenceError) AssertABCIError()
- func (e InvalidSequenceError) Error() string
- func (goo InvalidSequenceError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo InvalidSequenceError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *InvalidSequenceError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type KI64Pair
- type KI64Pairs
- type KVPair
- type KVPairs
- type MemFile
- func (mfile *MemFile) Copy() *MemFile
- func (goo MemFile) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (mfile *MemFile) Print() error
- func (goo MemFile) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *MemFile) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- func (mfile *MemFile) ValidateBasic() error
- type MemPackage
- func (mpkg *MemPackage) AddFile(mfile *MemFile)
- func (mpkg *MemPackage) DeleteFile(name string) *MemFile
- func (mpkg *MemPackage) FileNames() (fnames []string)
- func (mpkg *MemPackage) GetFile(name string) *MemFile
- func (mpkg *MemPackage) IsEmpty() bool
- func (mpkg *MemPackage) IsEmptyOf(xtn string) bool
- func (mpkg *MemPackage) IsZero() bool
- func (goo MemPackage) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (mpkg *MemPackage) NewFile(name string, body string) (mfile *MemFile)
- func (mpkg *MemPackage) Print() error
- func (mpkg *MemPackage) SetFile(name string, body string) *MemFile
- func (goo MemPackage) SizeBinary2(cdc *amino.Codec) (int, error)
- func (mpkg *MemPackage) Sort()
- func (mpkg *MemPackage) Uniq() error
- func (goo *MemPackage) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- func (mpkg *MemPackage) ValidateBasic() error
- func (mpkg *MemPackage) WriteTo(dir string) error
- type MemoTooLargeError
- func (MemoTooLargeError) AssertABCIError()
- func (e MemoTooLargeError) Error() string
- func (goo MemoTooLargeError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo MemoTooLargeError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *MemoTooLargeError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type Msg
- type NoSignaturesError
- func (NoSignaturesError) AssertABCIError()
- func (e NoSignaturesError) Error() string
- func (goo NoSignaturesError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo NoSignaturesError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *NoSignaturesError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type OutOfGasError
- func (OutOfGasError) AssertABCIError()
- func (e OutOfGasError) Error() string
- func (goo OutOfGasError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo OutOfGasError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *OutOfGasError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type RestrictedTransferError
- func (RestrictedTransferError) AssertABCIError()
- func (e RestrictedTransferError) Error() string
- func (goo RestrictedTransferError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo RestrictedTransferError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *RestrictedTransferError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type SessionAccountsContextKey
- type SessionExpiredError
- func (SessionExpiredError) AssertABCIError()
- func (e SessionExpiredError) Error() string
- func (goo SessionExpiredError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo SessionExpiredError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *SessionExpiredError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type SessionLimitError
- func (SessionLimitError) AssertABCIError()
- func (e SessionLimitError) Error() string
- func (goo SessionLimitError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo SessionLimitError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *SessionLimitError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type SessionNotAllowedError
- func (SessionNotAllowedError) AssertABCIError()
- func (e SessionNotAllowedError) Error() string
- func (goo SessionNotAllowedError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo SessionNotAllowedError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *SessionNotAllowedError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type SessionNotFoundError
- func (SessionNotFoundError) AssertABCIError()
- func (e SessionNotFoundError) Error() string
- func (goo SessionNotFoundError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo SessionNotFoundError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *SessionNotFoundError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type SignDoc
- type Signature
- type SpendEstimator
- type TooManySignaturesError
- func (TooManySignaturesError) AssertABCIError()
- func (e TooManySignaturesError) Error() string
- func (goo TooManySignaturesError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo TooManySignaturesError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *TooManySignaturesError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type Tx
- func (tx Tx) GetMemo() string
- func (tx Tx) GetMsgs() []Msg
- func (tx Tx) GetSignBytes(chainID string, accountNumber uint64, sequence uint64) ([]byte, error)
- func (tx Tx) GetSignatures() []Signature
- func (tx Tx) GetSigners() []crypto.Address
- func (goo Tx) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo Tx) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *Tx) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- func (tx Tx) ValidateBasic() error
- type TxDecodeError
- func (TxDecodeError) AssertABCIError()
- func (e TxDecodeError) Error() string
- func (goo TxDecodeError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo TxDecodeError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *TxDecodeError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type UnauthorizedError
- func (UnauthorizedError) AssertABCIError()
- func (e UnauthorizedError) Error() string
- func (goo UnauthorizedError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo UnauthorizedError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *UnauthorizedError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type UnknownAddressError
- func (UnknownAddressError) AssertABCIError()
- func (e UnknownAddressError) Error() string
- func (goo UnknownAddressError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo UnknownAddressError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *UnknownAddressError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type UnknownRequestError
- func (UnknownRequestError) AssertABCIError()
- func (e UnknownRequestError) Error() string
- func (goo UnknownRequestError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo UnknownRequestError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *UnknownRequestError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
Constants ¶
const ( MaxSessionsPerAccount = 16 MaxAllowPathsPerSession = 8 MaxSessionDuration = 30 * 24 * 60 * 60 // 30 days in seconds )
Variables ¶
var (
ErrTxsLoadingAborted = errors.New("transaction loading aborted")
)
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 ¶
CountSubKeys counts the total number of keys for a multi-sig public key.
func ErrGasOverflow ¶
func ErrInsufficientCoins ¶
func ErrInsufficientFee ¶
func ErrInsufficientFunds ¶
func ErrInternal ¶
func ErrInvalidAddress ¶
func ErrInvalidCoins ¶
func ErrInvalidGasWanted ¶
func ErrInvalidPubKey ¶
func ErrInvalidSequence ¶
func ErrMemoTooLarge ¶
func ErrNoSignatures ¶
func ErrOutOfGas ¶
func ErrSessionExpired ¶
func ErrSessionLimit ¶
func ErrSessionNotAllowed ¶
func ErrSessionNotFound ¶
func ErrTooManySignatures ¶
func ErrTxDecode ¶
func ErrUnauthorized ¶
func ErrUnknownAddress ¶
func ErrUnknownRequest ¶
func GetSignaturePayload ¶
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 ¶
MustSortJSON is like sortJSON but panic if an error occurs, e.g., if the passed JSON isn't valid.
func SplitFilepath ¶
Splits a path into the dir and filename.
func ValidateDenom ¶
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 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 (*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) UnmarshalBinary2 ¶
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 (*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 ¶
type Coin ¶
Coin hold some amount of one currency. A negative amount is invalid.
func MustParseCoin ¶
func NewCoin ¶
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 ¶
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 ¶
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 ¶
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) IsGTE ¶
IsGTE returns true if they are the same type and the receiver is an equal or greater value
func (Coin) IsNegative ¶
IsNegative returns true if the coin amount is negative and false otherwise.
func (Coin) IsPositive ¶
IsPositive returns true if coin amount is positive.
func (Coin) IsValid ¶
IsValid returns true if the Coin has a non-negative amount and the denom is valid.
func (Coin) MarshalAmino ¶
func (Coin) MarshalBinary2 ¶
func (Coin) Sub ¶
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) UnmarshalAmino ¶
type Coins ¶
type Coins []Coin
Coins is a set of Coin, one per currency
func MustParseCoins ¶
func ParseCoins ¶
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 ¶
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 ¶
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) ContainOneOfDenom ¶
ContainOneOfDenom check if a Coins instance contains a denom in the provided denomos
func (Coins) DenomsSubsetOf ¶
DenomsSubsetOf returns true if receiver's denom set is subset of coinsB's denoms.
func (Coins) IsAllGT ¶
IsAllGT returns true if for every denom in coinsB, the denom is present at a greater amount in coins.
func (Coins) IsAllGTE ¶
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 ¶
IsAllLT returns True iff for every denom in coins, the denom is present at a smaller amount in coinsB.
func (Coins) IsAllLTE ¶
IsAllLTE returns true iff for every denom in coins, the denom is present at a smaller or equal amount in coinsB.
func (Coins) IsAllPositive ¶
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 ¶
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 ¶
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 ¶
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) IsValid ¶
IsValid asserts the Coins are sorted, have positive amount, and Denom does not contain upper case characters.
func (Coins) MarshalAmino ¶
func (Coins) Sub ¶
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 ¶
SubUnsafe performs the same arithmetic as Sub but returns a boolean if any negative coin amount was returned.
func (*Coins) UnmarshalAmino ¶
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 (Fee) MarshalBinary2 ¶
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 (GasOverflowError) SizeBinary2 ¶
func (goo GasOverflowError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*GasOverflowError) UnmarshalBinary2 ¶
type GasPrice ¶
minimum gas price is Price/Gas per gas unit.
func ParseGasPrice ¶
func ParseGasPrices ¶
func (GasPrice) IsGTE ¶
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 ¶
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 (InsufficientCoinsError) SizeBinary2 ¶
func (goo InsufficientCoinsError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*InsufficientCoinsError) UnmarshalBinary2 ¶
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 (InsufficientFeeError) SizeBinary2 ¶
func (goo InsufficientFeeError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*InsufficientFeeError) UnmarshalBinary2 ¶
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 (InsufficientFundsError) SizeBinary2 ¶
func (goo InsufficientFundsError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*InsufficientFundsError) UnmarshalBinary2 ¶
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 (InternalError) SizeBinary2 ¶
func (goo InternalError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*InternalError) UnmarshalBinary2 ¶
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 (InvalidAddressError) SizeBinary2 ¶
func (goo InvalidAddressError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*InvalidAddressError) UnmarshalBinary2 ¶
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 (InvalidCoinsError) SizeBinary2 ¶
func (goo InvalidCoinsError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*InvalidCoinsError) UnmarshalBinary2 ¶
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 (InvalidGasWantedError) SizeBinary2 ¶
func (goo InvalidGasWantedError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*InvalidGasWantedError) UnmarshalBinary2 ¶
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 (InvalidPubKeyError) SizeBinary2 ¶
func (goo InvalidPubKeyError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*InvalidPubKeyError) UnmarshalBinary2 ¶
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 (InvalidSequenceError) SizeBinary2 ¶
func (goo InvalidSequenceError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*InvalidSequenceError) UnmarshalBinary2 ¶
type KI64Pairs ¶
type KI64Pairs []KI64Pair
KI64Pairs is a slice of KI64Pair.
type KVPairs ¶
type KVPairs []KVPair
KVPairs is a slice of KVPair.
type MemFile ¶
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) MarshalBinary2 ¶
func (*MemFile) UnmarshalBinary2 ¶
func (*MemFile) ValidateBasic ¶
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) MarshalBinary2 ¶
func (*MemPackage) NewFile ¶
func (mpkg *MemPackage) NewFile(name string, body string) (mfile *MemFile)
Creates a new MemFile and adds without validation.
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 (*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 (MemoTooLargeError) SizeBinary2 ¶
func (goo MemoTooLargeError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*MemoTooLargeError) UnmarshalBinary2 ¶
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 (NoSignaturesError) SizeBinary2 ¶
func (goo NoSignaturesError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*NoSignaturesError) UnmarshalBinary2 ¶
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 (OutOfGasError) SizeBinary2 ¶
func (goo OutOfGasError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*OutOfGasError) UnmarshalBinary2 ¶
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 (RestrictedTransferError) SizeBinary2 ¶
func (goo RestrictedTransferError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*RestrictedTransferError) UnmarshalBinary2 ¶
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 (SessionExpiredError) SizeBinary2 ¶
func (goo SessionExpiredError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*SessionExpiredError) UnmarshalBinary2 ¶
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 (SessionLimitError) SizeBinary2 ¶
func (goo SessionLimitError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*SessionLimitError) UnmarshalBinary2 ¶
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 (SessionNotAllowedError) SizeBinary2 ¶
func (goo SessionNotAllowedError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*SessionNotAllowedError) UnmarshalBinary2 ¶
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 (SessionNotFoundError) SizeBinary2 ¶
func (goo SessionNotFoundError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*SessionNotFoundError) UnmarshalBinary2 ¶
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 ¶
type SpendEstimator ¶
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 (TooManySignaturesError) SizeBinary2 ¶
func (goo TooManySignaturesError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*TooManySignaturesError) UnmarshalBinary2 ¶
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 (Tx) GetSignBytes ¶
func (Tx) GetSignatures ¶
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 ¶
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 (*Tx) UnmarshalBinary2 ¶
func (Tx) ValidateBasic ¶
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 (TxDecodeError) SizeBinary2 ¶
func (goo TxDecodeError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*TxDecodeError) UnmarshalBinary2 ¶
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 (UnauthorizedError) SizeBinary2 ¶
func (goo UnauthorizedError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*UnauthorizedError) UnmarshalBinary2 ¶
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 (UnknownAddressError) SizeBinary2 ¶
func (goo UnknownAddressError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*UnknownAddressError) UnmarshalBinary2 ¶
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 (UnknownRequestError) SizeBinary2 ¶
func (goo UnknownRequestError) SizeBinary2(cdc *amino.Codec) (int, error)