cosmos-sdk: github.com/cosmos/cosmos-sdk/x/auth/types Index | Files

package types

import "github.com/cosmos/cosmos-sdk/x/auth/types"

Index

Package Files

account.go account_retriever.go amino_signing.go auth.pb.go client_tx.go codec.go expected_keepers.go genesis.go genesis.pb.go keys.go params.go permissions.go querier.go query.pb.go stdsignmsg.go stdtx.go

Constants

const (
    // module name
    ModuleName = "auth"

    // StoreKey is string representation of the store key for auth
    StoreKey = "acc"

    // FeeCollectorName the root string for the fee collector account address
    FeeCollectorName = "fee_collector"

    // QuerierRoute is the querier route for auth
    QuerierRoute = ModuleName
)
const (
    DefaultMaxMemoCharacters      uint64 = 256
    DefaultTxSigLimit             uint64 = 7
    DefaultTxSizeCostPerByte      uint64 = 10
    DefaultSigVerifyCostED25519   uint64 = 590
    DefaultSigVerifyCostSecp256k1 uint64 = 1000
)

Default parameter values

const (
    Minter  = "minter"
    Burner  = "burner"
    Staking = "staking"
)

permissions

const (
    QueryAccount = "account"
    QueryParams  = "params"
)

query endpoints supported by the auth Querier

const MaxGasWanted = uint64((1 << 63) - 1)

MaxGasWanted defines the max gas allowed.

Variables

var (
    ErrInvalidLengthAuth        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowAuth          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupAuth = fmt.Errorf("proto: unexpected end of group")
)
var (
    ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
var (
    // AddressStoreKeyPrefix prefix for account-by-address store
    AddressStoreKeyPrefix = []byte{0x01}

    // param key for global account number
    GlobalAccountNumberKey = []byte("globalAccountNumber")
)
var (
    KeyMaxMemoCharacters      = []byte("MaxMemoCharacters")
    KeyTxSigLimit             = []byte("TxSigLimit")
    KeyTxSizeCostPerByte      = []byte("TxSizeCostPerByte")
    KeySigVerifyCostED25519   = []byte("SigVerifyCostED25519")
    KeySigVerifyCostSecp256k1 = []byte("SigVerifyCostSecp256k1")
)

Parameter keys

var (
    ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
var (
    ModuleCdc = codec.NewHybridCodec(amino, types.NewInterfaceRegistry())
)

func AddressStoreKey Uses

func AddressStoreKey(addr sdk.AccAddress) []byte

AddressStoreKey turn an address to key used to get it from the account store

func CountSubKeys Uses

func CountSubKeys(pub crypto.PubKey) int

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

func DefaultJSONTxDecoder Uses

func DefaultJSONTxDecoder(cdc *codec.Codec) sdk.TxDecoder

func DefaultTxDecoder Uses

func DefaultTxDecoder(cdc *codec.Codec) sdk.TxDecoder

DefaultTxDecoder logic for standard transaction decoding

func DefaultTxEncoder Uses

func DefaultTxEncoder(cdc *codec.Codec) sdk.TxEncoder

DefaultTxEncoder logic for standard transaction encoding

func MultiSignatureDataToAminoMultisignature Uses

func MultiSignatureDataToAminoMultisignature(cdc *codec.Codec, mSig *signing.MultiSignatureData) (multisig.AminoMultisignature, error)

MultiSignatureDataToAminoMultisignature converts a MultiSignatureData to an AminoMultisignature. Only SIGN_MODE_LEGACY_AMINO_JSON is supported.

func NewModuleAddress Uses

func NewModuleAddress(name string) sdk.AccAddress

NewModuleAddress creates an AccAddress from the hash of the module's name

func NewStdTxSignModeHandler Uses

func NewStdTxSignModeHandler() signing.SignModeHandler

func PackAccounts Uses

func PackAccounts(accounts GenesisAccounts) ([]*types.Any, error)

PackAccounts converts GenesisAccounts to Any slice

func ParamKeyTable Uses

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable for auth module

func RegisterCodec Uses

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers the account interfaces and concrete types on the provided Amino codec.

func RegisterInterfaces Uses

func RegisterInterfaces(registry types.InterfaceRegistry)

RegisterInterface associates protoName with AccountI interface and creates a registry of it's concrete implementations

func RegisterKeyTypeCodec Uses

func RegisterKeyTypeCodec(o interface{}, name string)

RegisterKeyTypeCodec registers an external concrete type defined in another module for the internal ModuleCdc.

func RegisterQueryServer Uses

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func SignatureDataToAminoSignature Uses

func SignatureDataToAminoSignature(cdc *codec.Codec, data signing.SignatureData) ([]byte, error)

SignatureDataToAminoSignature converts a SignatureData to amino-encoded signature bytes. Only SIGN_MODE_LEGACY_AMINO_JSON is supported.

func StdSignBytes Uses

func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee, msgs []sdk.Msg, memo string) []byte

StdSignBytes returns the bytes to sign for a transaction.

func StdSignatureToSignatureV2 Uses

func StdSignatureToSignatureV2(cdc *codec.Codec, sig StdSignature) (signing.SignatureV2, error)

StdSignatureToSignatureV2 converts a StdSignature to a SignatureV2

func ValidateGenAccounts Uses

func ValidateGenAccounts(accounts GenesisAccounts) error

ValidateGenAccounts validates an array of GenesisAccounts and checks for duplicates

func ValidateGenesis Uses

func ValidateGenesis(data GenesisState) error

ValidateGenesis performs basic validation of auth genesis data returning an error for any failed validation criteria.

type AccountI Uses

type AccountI interface {
    GetAddress() sdk.AccAddress
    SetAddress(sdk.AccAddress) 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

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

AccountI 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 AccountI.

func ProtoBaseAccount Uses

func ProtoBaseAccount() AccountI

ProtoBaseAccount - a prototype function for BaseAccount

type AccountRetriever Uses

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

AccountRetriever defines the properties of a type that can be used to retrieve accounts.

func NewAccountRetriever Uses

func NewAccountRetriever(codec codec.JSONMarshaler) AccountRetriever

NewAccountRetriever initialises a new AccountRetriever instance.

func (AccountRetriever) EnsureExists Uses

func (ar AccountRetriever) EnsureExists(querier client.NodeQuerier, addr sdk.AccAddress) error

EnsureExists returns an error if no account exists for the given address else nil.

func (AccountRetriever) GetAccount Uses

func (ar AccountRetriever) GetAccount(querier client.NodeQuerier, addr sdk.AccAddress) (AccountI, error)

GetAccount queries for an account given an address and a block height. An error is returned if the query or decoding fails.

func (AccountRetriever) GetAccountNumberSequence Uses

func (ar AccountRetriever) GetAccountNumberSequence(nodeQuerier client.NodeQuerier, addr sdk.AccAddress) (uint64, uint64, error)

GetAccountNumberSequence returns sequence and account number for the given address. It returns an error if the account couldn't be retrieved from the state.

func (AccountRetriever) GetAccountWithHeight Uses

func (ar AccountRetriever) GetAccountWithHeight(querier client.NodeQuerier, addr sdk.AccAddress) (AccountI, int64, error)

GetAccountWithHeight queries for an account given an address. Returns the height of the query with the account. An error is returned if the query or decoding fails.

type BankKeeper Uses

type BankKeeper interface {
    SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
}

BankKeeper defines the contract needed for supply related APIs (noalias)

type BaseAccount Uses

type BaseAccount struct {
    Address       github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty"`
    PubKey        []byte                                        `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"public_key,omitempty" yaml:"public_key"`
    AccountNumber uint64                                        `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty" yaml:"account_number"`
    Sequence      uint64                                        `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"`
}

BaseAccount defines a base account type. It contains all the necessary fields for basic account functionality. Any custom account type should extend this type for additional functionality (e.g. vesting).

func NewBaseAccount Uses

func NewBaseAccount(address sdk.AccAddress, pubKey crypto.PubKey, accountNumber, sequence uint64) *BaseAccount

NewBaseAccount creates a new BaseAccount object

func NewBaseAccountWithAddress Uses

func NewBaseAccountWithAddress(addr sdk.AccAddress) *BaseAccount

NewBaseAccountWithAddress - returns a new base account with a given address

func (*BaseAccount) Descriptor Uses

func (*BaseAccount) Descriptor() ([]byte, []int)

func (BaseAccount) GetAccountNumber Uses

func (acc BaseAccount) GetAccountNumber() uint64

GetAccountNumber - Implements AccountI

func (BaseAccount) GetAddress Uses

func (acc BaseAccount) GetAddress() sdk.AccAddress

GetAddress - Implements sdk.AccountI.

func (BaseAccount) GetPubKey Uses

func (acc BaseAccount) GetPubKey() (pk crypto.PubKey)

GetPubKey - Implements sdk.AccountI.

func (BaseAccount) GetSequence Uses

func (acc BaseAccount) GetSequence() uint64

GetSequence - Implements sdk.AccountI.

func (*BaseAccount) Marshal Uses

func (m *BaseAccount) Marshal() (dAtA []byte, err error)

func (*BaseAccount) MarshalTo Uses

func (m *BaseAccount) MarshalTo(dAtA []byte) (int, error)

func (*BaseAccount) MarshalToSizedBuffer Uses

func (m *BaseAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (BaseAccount) MarshalYAML Uses

func (acc BaseAccount) MarshalYAML() (interface{}, error)

MarshalYAML returns the YAML representation of an account.

func (*BaseAccount) ProtoMessage Uses

func (*BaseAccount) ProtoMessage()

func (*BaseAccount) Reset Uses

func (m *BaseAccount) Reset()

func (*BaseAccount) SetAccountNumber Uses

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

SetAccountNumber - Implements AccountI

func (*BaseAccount) SetAddress Uses

func (acc *BaseAccount) SetAddress(addr sdk.AccAddress) error

SetAddress - Implements sdk.AccountI.

func (*BaseAccount) SetPubKey Uses

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

SetPubKey - Implements sdk.AccountI.

func (*BaseAccount) SetSequence Uses

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

SetSequence - Implements sdk.AccountI.

func (*BaseAccount) Size Uses

func (m *BaseAccount) Size() (n int)

func (BaseAccount) String Uses

func (acc BaseAccount) String() string

func (*BaseAccount) Unmarshal Uses

func (m *BaseAccount) Unmarshal(dAtA []byte) error

func (BaseAccount) Validate Uses

func (acc BaseAccount) Validate() error

Validate checks for errors on the account fields

func (*BaseAccount) XXX_DiscardUnknown Uses

func (m *BaseAccount) XXX_DiscardUnknown()

func (*BaseAccount) XXX_Marshal Uses

func (m *BaseAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BaseAccount) XXX_Merge Uses

func (m *BaseAccount) XXX_Merge(src proto.Message)

func (*BaseAccount) XXX_Size Uses

func (m *BaseAccount) XXX_Size() int

func (*BaseAccount) XXX_Unmarshal Uses

func (m *BaseAccount) XXX_Unmarshal(b []byte) error

type GenesisAccount Uses

type GenesisAccount interface {
    AccountI

    Validate() error
}

GenesisAccount defines a genesis account that embeds an AccountI with validation capabilities.

type GenesisAccountIterator Uses

type GenesisAccountIterator struct{}

GenesisAccountIterator implements genesis account iteration.

func (GenesisAccountIterator) IterateGenesisAccounts Uses

func (GenesisAccountIterator) IterateGenesisAccounts(
    cdc codec.Marshaler, appGenesis map[string]json.RawMessage, cb func(AccountI) (stop bool),
)

IterateGenesisAccounts iterates over all the genesis accounts found in appGenesis and invokes a callback on each genesis account. If any call returns true, iteration stops.

type GenesisAccounts Uses

type GenesisAccounts []GenesisAccount

GenesisAccounts defines a slice of GenesisAccount objects

func SanitizeGenesisAccounts Uses

func SanitizeGenesisAccounts(genAccs GenesisAccounts) GenesisAccounts

SanitizeGenesisAccounts sorts accounts and coin sets.

func UnpackAccounts Uses

func UnpackAccounts(accountsAny []*types.Any) (GenesisAccounts, error)

UnpackAccounts converts Any slice to GenesisAccounts

func (GenesisAccounts) Contains Uses

func (ga GenesisAccounts) Contains(addr sdk.Address) bool

Contains returns true if the given address exists in a slice of GenesisAccount objects.

type GenesisState Uses

type GenesisState struct {
    Params   Params       `protobuf:"bytes,1,opt,name=params,proto3,casttype=Params" json:"params"`
    Accounts []*types.Any `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty"`
}

GenesisState - all auth state that must be provided at genesis

func DefaultGenesisState Uses

func DefaultGenesisState() GenesisState

DefaultGenesisState - Return a default genesis state

func GetGenesisStateFromAppState Uses

func GetGenesisStateFromAppState(cdc codec.Marshaler, appState map[string]json.RawMessage) GenesisState

GetGenesisStateFromAppState returns x/auth GenesisState given raw application genesis state.

func NewGenesisState Uses

func NewGenesisState(params Params, accounts GenesisAccounts) GenesisState

NewGenesisState - Create a new genesis state

func (*GenesisState) Descriptor Uses

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetAccounts Uses

func (m *GenesisState) GetAccounts() []*types.Any

func (*GenesisState) GetParams Uses

func (m *GenesisState) GetParams() Params

func (*GenesisState) Marshal Uses

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo Uses

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer Uses

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage Uses

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset Uses

func (m *GenesisState) Reset()

func (*GenesisState) Size Uses

func (m *GenesisState) Size() (n int)

func (*GenesisState) String Uses

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal Uses

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) UnpackInterfaces Uses

func (g GenesisState) UnpackInterfaces(unpacker types.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (*GenesisState) XXX_DiscardUnknown Uses

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal Uses

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge Uses

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size Uses

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal Uses

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type ModuleAccount Uses

type ModuleAccount struct {
    *BaseAccount `protobuf:"bytes,1,opt,name=base_account,json=baseAccount,proto3,embedded=base_account" json:"base_account,omitempty" yaml:"base_account"`
    Name         string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
    Permissions  []string `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty"`
}

ModuleAccount defines an account for modules that holds coins on a pool

func NewEmptyModuleAccount Uses

func NewEmptyModuleAccount(name string, permissions ...string) *ModuleAccount

NewEmptyModuleAccount creates a empty ModuleAccount from a string

func NewModuleAccount Uses

func NewModuleAccount(ba *BaseAccount, name string, permissions ...string) *ModuleAccount

NewModuleAccount creates a new ModuleAccount instance

func (*ModuleAccount) Descriptor Uses

func (*ModuleAccount) Descriptor() ([]byte, []int)

func (ModuleAccount) GetName Uses

func (ma ModuleAccount) GetName() string

GetName returns the the name of the holder's module

func (ModuleAccount) GetPermissions Uses

func (ma ModuleAccount) GetPermissions() []string

GetPermissions returns permissions granted to the module account

func (ModuleAccount) HasPermission Uses

func (ma ModuleAccount) HasPermission(permission string) bool

HasPermission returns whether or not the module account has permission.

func (*ModuleAccount) Marshal Uses

func (m *ModuleAccount) Marshal() (dAtA []byte, err error)

func (ModuleAccount) MarshalJSON Uses

func (ma ModuleAccount) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of a ModuleAccount.

func (*ModuleAccount) MarshalTo Uses

func (m *ModuleAccount) MarshalTo(dAtA []byte) (int, error)

func (*ModuleAccount) MarshalToSizedBuffer Uses

func (m *ModuleAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (ModuleAccount) MarshalYAML Uses

func (ma ModuleAccount) MarshalYAML() (interface{}, error)

MarshalYAML returns the YAML representation of a ModuleAccount.

func (*ModuleAccount) ProtoMessage Uses

func (*ModuleAccount) ProtoMessage()

func (*ModuleAccount) Reset Uses

func (m *ModuleAccount) Reset()

func (ModuleAccount) SetPubKey Uses

func (ma ModuleAccount) SetPubKey(pubKey crypto.PubKey) error

SetPubKey - Implements AccountI

func (ModuleAccount) SetSequence Uses

func (ma ModuleAccount) SetSequence(seq uint64) error

SetSequence - Implements AccountI

func (*ModuleAccount) Size Uses

func (m *ModuleAccount) Size() (n int)

func (ModuleAccount) String Uses

func (ma ModuleAccount) String() string

func (*ModuleAccount) Unmarshal Uses

func (m *ModuleAccount) Unmarshal(dAtA []byte) error

func (*ModuleAccount) UnmarshalJSON Uses

func (ma *ModuleAccount) UnmarshalJSON(bz []byte) error

UnmarshalJSON unmarshals raw JSON bytes into a ModuleAccount.

func (ModuleAccount) Validate Uses

func (ma ModuleAccount) Validate() error

Validate checks for errors on the account fields

func (*ModuleAccount) XXX_DiscardUnknown Uses

func (m *ModuleAccount) XXX_DiscardUnknown()

func (*ModuleAccount) XXX_Marshal Uses

func (m *ModuleAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ModuleAccount) XXX_Merge Uses

func (m *ModuleAccount) XXX_Merge(src proto.Message)

func (*ModuleAccount) XXX_Size Uses

func (m *ModuleAccount) XXX_Size() int

func (*ModuleAccount) XXX_Unmarshal Uses

func (m *ModuleAccount) XXX_Unmarshal(b []byte) error

type ModuleAccountI Uses

type ModuleAccountI interface {
    AccountI

    GetName() string
    GetPermissions() []string
    HasPermission(string) bool
}

ModuleAccountI defines an account interface for modules that hold tokens in an escrow.

type Params Uses

type Params struct {
    MaxMemoCharacters      uint64 `protobuf:"varint,1,opt,name=max_memo_characters,json=maxMemoCharacters,proto3" json:"max_memo_characters,omitempty" yaml:"max_memo_characters"`
    TxSigLimit             uint64 `protobuf:"varint,2,opt,name=tx_sig_limit,json=txSigLimit,proto3" json:"tx_sig_limit,omitempty" yaml:"tx_sig_limit"`
    TxSizeCostPerByte      uint64 `protobuf:"varint,3,opt,name=tx_size_cost_per_byte,json=txSizeCostPerByte,proto3" json:"tx_size_cost_per_byte,omitempty" yaml:"tx_size_cost_per_byte"`
    SigVerifyCostED25519   uint64 `protobuf:"varint,4,opt,name=sig_verify_cost_ed25519,json=sigVerifyCostEd25519,proto3" json:"sig_verify_cost_ed25519,omitempty" yaml:"sig_verify_cost_ed25519"`
    SigVerifyCostSecp256k1 uint64 `protobuf:"varint,5,opt,name=sig_verify_cost_secp256k1,json=sigVerifyCostSecp256k1,proto3" json:"sig_verify_cost_secp256k1,omitempty" yaml:"sig_verify_cost_secp256k1"`
}

Params defines the parameters for the auth module.

func DefaultParams Uses

func DefaultParams() Params

DefaultParams returns a default set of parameters.

func NewParams Uses

func NewParams(
    maxMemoCharacters, txSigLimit, txSizeCostPerByte, sigVerifyCostED25519, sigVerifyCostSecp256k1 uint64,
) Params

NewParams creates a new Params object

func (*Params) Descriptor Uses

func (*Params) Descriptor() ([]byte, []int)

func (*Params) Equal Uses

func (this *Params) Equal(that interface{}) bool

func (*Params) GetMaxMemoCharacters Uses

func (m *Params) GetMaxMemoCharacters() uint64

func (*Params) GetSigVerifyCostED25519 Uses

func (m *Params) GetSigVerifyCostED25519() uint64

func (*Params) GetSigVerifyCostSecp256k1 Uses

func (m *Params) GetSigVerifyCostSecp256k1() uint64

func (*Params) GetTxSigLimit Uses

func (m *Params) GetTxSigLimit() uint64

func (*Params) GetTxSizeCostPerByte Uses

func (m *Params) GetTxSizeCostPerByte() uint64

func (*Params) Marshal Uses

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo Uses

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer Uses

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs Uses

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs implements the ParamSet interface and returns all the key/value pairs pairs of auth module's parameters. nolint

func (*Params) ProtoMessage Uses

func (*Params) ProtoMessage()

func (*Params) Reset Uses

func (m *Params) Reset()

func (*Params) Size Uses

func (m *Params) Size() (n int)

func (Params) String Uses

func (p Params) String() string

String implements the stringer interface.

func (*Params) Unmarshal Uses

func (m *Params) Unmarshal(dAtA []byte) error

func (Params) Validate Uses

func (p Params) Validate() error

Validate checks that the parameters have valid values.

func (*Params) XXX_DiscardUnknown Uses

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal Uses

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge Uses

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size Uses

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal Uses

func (m *Params) XXX_Unmarshal(b []byte) error

type PermissionsForAddress Uses

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

PermissionsForAddress defines all the registered permissions for an address

func NewPermissionsForAddress Uses

func NewPermissionsForAddress(name string, permissions []string) PermissionsForAddress

NewPermissionsForAddress creates a new PermissionsForAddress object

func (PermissionsForAddress) GetAddress Uses

func (pa PermissionsForAddress) GetAddress() sdk.AccAddress

GetAddress returns the address of the PermissionsForAddress object

func (PermissionsForAddress) GetPermissions Uses

func (pa PermissionsForAddress) GetPermissions() []string

GetPermissions returns the permissions granted to the address

func (PermissionsForAddress) HasPermission Uses

func (pa PermissionsForAddress) HasPermission(permission string) bool

HasPermission returns whether the PermissionsForAddress contains permission.

type QueryAccountRequest Uses

type QueryAccountRequest struct {
    Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty"`
}

QueryAccountRequest is request type for the Query/Account RPC method

func (*QueryAccountRequest) Descriptor Uses

func (*QueryAccountRequest) Descriptor() ([]byte, []int)

func (*QueryAccountRequest) GetAddress Uses

func (m *QueryAccountRequest) GetAddress() github_com_cosmos_cosmos_sdk_types.AccAddress

func (*QueryAccountRequest) Marshal Uses

func (m *QueryAccountRequest) Marshal() (dAtA []byte, err error)

func (*QueryAccountRequest) MarshalTo Uses

func (m *QueryAccountRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryAccountRequest) MarshalToSizedBuffer Uses

func (m *QueryAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAccountRequest) ProtoMessage Uses

func (*QueryAccountRequest) ProtoMessage()

func (*QueryAccountRequest) Reset Uses

func (m *QueryAccountRequest) Reset()

func (*QueryAccountRequest) Size Uses

func (m *QueryAccountRequest) Size() (n int)

func (*QueryAccountRequest) String Uses

func (m *QueryAccountRequest) String() string

func (*QueryAccountRequest) Unmarshal Uses

func (m *QueryAccountRequest) Unmarshal(dAtA []byte) error

func (*QueryAccountRequest) XXX_DiscardUnknown Uses

func (m *QueryAccountRequest) XXX_DiscardUnknown()

func (*QueryAccountRequest) XXX_Marshal Uses

func (m *QueryAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAccountRequest) XXX_Merge Uses

func (m *QueryAccountRequest) XXX_Merge(src proto.Message)

func (*QueryAccountRequest) XXX_Size Uses

func (m *QueryAccountRequest) XXX_Size() int

func (*QueryAccountRequest) XXX_Unmarshal Uses

func (m *QueryAccountRequest) XXX_Unmarshal(b []byte) error

type QueryAccountResponse Uses

type QueryAccountResponse struct {
    Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
}

QueryAccountResponse is response type for the Query/Account RPC method

func (*QueryAccountResponse) Descriptor Uses

func (*QueryAccountResponse) Descriptor() ([]byte, []int)

func (*QueryAccountResponse) GetAccount Uses

func (m *QueryAccountResponse) GetAccount() *types.Any

func (*QueryAccountResponse) Marshal Uses

func (m *QueryAccountResponse) Marshal() (dAtA []byte, err error)

func (*QueryAccountResponse) MarshalTo Uses

func (m *QueryAccountResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryAccountResponse) MarshalToSizedBuffer Uses

func (m *QueryAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAccountResponse) ProtoMessage Uses

func (*QueryAccountResponse) ProtoMessage()

func (*QueryAccountResponse) Reset Uses

func (m *QueryAccountResponse) Reset()

func (*QueryAccountResponse) Size Uses

func (m *QueryAccountResponse) Size() (n int)

func (*QueryAccountResponse) String Uses

func (m *QueryAccountResponse) String() string

func (*QueryAccountResponse) Unmarshal Uses

func (m *QueryAccountResponse) Unmarshal(dAtA []byte) error

func (*QueryAccountResponse) XXX_DiscardUnknown Uses

func (m *QueryAccountResponse) XXX_DiscardUnknown()

func (*QueryAccountResponse) XXX_Marshal Uses

func (m *QueryAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAccountResponse) XXX_Merge Uses

func (m *QueryAccountResponse) XXX_Merge(src proto.Message)

func (*QueryAccountResponse) XXX_Size Uses

func (m *QueryAccountResponse) XXX_Size() int

func (*QueryAccountResponse) XXX_Unmarshal Uses

func (m *QueryAccountResponse) XXX_Unmarshal(b []byte) error

type QueryClient Uses

type QueryClient interface {
    // Account returns account details based on address
    Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error)
    // Params queries all parameters
    Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient Uses

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryParamsRequest Uses

type QueryParamsRequest struct {
}

QueryParamsRequest is request type for the Query/Params RPC method

func (*QueryParamsRequest) Descriptor Uses

func (*QueryParamsRequest) Descriptor() ([]byte, []int)

func (*QueryParamsRequest) Marshal Uses

func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)

func (*QueryParamsRequest) MarshalTo Uses

func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsRequest) MarshalToSizedBuffer Uses

func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsRequest) ProtoMessage Uses

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset Uses

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size Uses

func (m *QueryParamsRequest) Size() (n int)

func (*QueryParamsRequest) String Uses

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal Uses

func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error

func (*QueryParamsRequest) XXX_DiscardUnknown Uses

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal Uses

func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsRequest) XXX_Merge Uses

func (m *QueryParamsRequest) XXX_Merge(src proto.Message)

func (*QueryParamsRequest) XXX_Size Uses

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal Uses

func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error

type QueryParamsResponse Uses

type QueryParamsResponse struct {
    Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryParamsResponse is response type for the Query/Params RPC method

func (*QueryParamsResponse) Descriptor Uses

func (*QueryParamsResponse) Descriptor() ([]byte, []int)

func (*QueryParamsResponse) GetParams Uses

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal Uses

func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)

func (*QueryParamsResponse) MarshalTo Uses

func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsResponse) MarshalToSizedBuffer Uses

func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsResponse) ProtoMessage Uses

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset Uses

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size Uses

func (m *QueryParamsResponse) Size() (n int)

func (*QueryParamsResponse) String Uses

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal Uses

func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error

func (*QueryParamsResponse) XXX_DiscardUnknown Uses

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal Uses

func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsResponse) XXX_Merge Uses

func (m *QueryParamsResponse) XXX_Merge(src proto.Message)

func (*QueryParamsResponse) XXX_Size Uses

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal Uses

func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error

type QueryServer Uses

type QueryServer interface {
    // Account returns account details based on address
    Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error)
    // Params queries all parameters
    Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
}

QueryServer is the server API for Query service.

type StdFee Uses

type StdFee struct {
    Amount sdk.Coins `json:"amount" yaml:"amount"`
    Gas    uint64    `json:"gas" yaml:"gas"`
}

Deprecated: StdFee 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 NewStdFee Uses

func NewStdFee(gas uint64, amount sdk.Coins) StdFee

Deprecated: NewStdFee returns a new instance of StdFee

func (StdFee) Bytes Uses

func (fee StdFee) Bytes() []byte

Bytes returns the encoded bytes of a StdFee.

func (StdFee) GasPrices Uses

func (fee StdFee) GasPrices() sdk.DecCoins

GasPrices returns the gas prices for a StdFee.

NOTE: The gas prices returned are not the true gas prices that were originally part of the submitted transaction because the fee is computed as fee = ceil(gasWanted * gasPrices).

func (StdFee) GetAmount Uses

func (fee StdFee) GetAmount() sdk.Coins

GetAmount returns the fee's amount.

func (StdFee) GetGas Uses

func (fee StdFee) GetGas() uint64

GetGas returns the fee's (wanted) gas.

type StdSignDoc Uses

type StdSignDoc struct {
    AccountNumber uint64            `json:"account_number" yaml:"account_number"`
    Sequence      uint64            `json:"sequence" yaml:"sequence"`
    TimeoutHeight uint64            `json:"timeout_height,omitempty" yaml:"timeout_height"`
    ChainID       string            `json:"chain_id" yaml:"chain_id"`
    Memo          string            `json:"memo" yaml:"memo"`
    Fee           json.RawMessage   `json:"fee" yaml:"fee"`
    Msgs          []json.RawMessage `json:"msgs" yaml:"msgs"`
}

StdSignDoc is replay-prevention structure. It includes the result of msg.GetSignBytes(), as well as the ChainID (prevent cross chain replay) and the Sequence numbers for each signature (prevent inchain replay and enforce tx ordering per account).

type StdSignMsg Uses

type StdSignMsg struct {
    ChainID       string    `json:"chain_id" yaml:"chain_id"`
    AccountNumber uint64    `json:"account_number" yaml:"account_number"`
    Sequence      uint64    `json:"sequence" yaml:"sequence"`
    TimeoutHeight uint64    `json:"timeout_height" yaml:"timeout_height"`
    Fee           StdFee    `json:"fee" yaml:"fee"`
    Msgs          []sdk.Msg `json:"msgs" yaml:"msgs"`
    Memo          string    `json:"memo" yaml:"memo"`
}

StdSignMsg is a convenience structure for passing along a Msg with the other requirements for a StdSignDoc before it is signed. For use in the CLI.

func (StdSignMsg) Bytes Uses

func (msg StdSignMsg) Bytes() []byte

get message bytes

func (StdSignMsg) UnpackInterfaces Uses

func (msg StdSignMsg) UnpackInterfaces(unpacker types.AnyUnpacker) error

type StdSignature Uses

type StdSignature struct {
    crypto.PubKey `json:"pub_key" yaml:"pub_key"` // optional
    Signature     []byte                          `json:"signature" yaml:"signature"`
}

Deprecated: StdSignature represents a sig

func NewStdSignature Uses

func NewStdSignature(pk crypto.PubKey, sig []byte) StdSignature

Deprecated

func SignatureV2ToStdSignature Uses

func SignatureV2ToStdSignature(cdc *codec.Codec, sig signing.SignatureV2) (StdSignature, error)

SignatureV2ToStdSignature converts a SignatureV2 to a StdSignature

func (StdSignature) GetPubKey Uses

func (ss StdSignature) GetPubKey() crypto.PubKey

GetPubKey returns the public key of a signature as a crypto.PubKey using the Amino codec.

func (StdSignature) GetSignature Uses

func (ss StdSignature) GetSignature() []byte

GetSignature returns the raw signature bytes.

func (StdSignature) MarshalYAML Uses

func (ss StdSignature) MarshalYAML() (interface{}, error)

MarshalYAML returns the YAML representation of the signature.

type StdTx Uses

type StdTx struct {
    Msgs          []sdk.Msg      `json:"msg" yaml:"msg"`
    Fee           StdFee         `json:"fee" yaml:"fee"`
    Signatures    []StdSignature `json:"signatures" yaml:"signatures"`
    Memo          string         `json:"memo" yaml:"memo"`
    TimeoutHeight uint64         `json:"timeout_height" yaml:"timeout_height"`
}

StdTx is the legacy transaction format for wrapping a Msg with Fee and Signatures. It only works with Amino, please prefer the new protobuf Tx in types/tx. NOTE: the first signature is the fee payer (Signatures must not be nil).

func NewStdTx Uses

func NewStdTx(msgs []sdk.Msg, fee StdFee, sigs []StdSignature, memo string) StdTx

Deprecated

func (StdTx) FeePayer Uses

func (tx StdTx) FeePayer() sdk.AccAddress

FeePayer returns the address that is responsible for paying fee StdTx returns the first signer as the fee payer If no signers for tx, return empty address

func (StdTx) GetFee Uses

func (tx StdTx) GetFee() sdk.Coins

GetFee returns the FeeAmount in StdFee

func (StdTx) GetGas Uses

func (tx StdTx) GetGas() uint64

GetGas returns the Gas in StdFee

func (StdTx) GetMemo Uses

func (tx StdTx) GetMemo() string

GetMemo returns the memo

func (StdTx) GetMsgs Uses

func (tx StdTx) GetMsgs() []sdk.Msg

GetMsgs returns the all the transaction's messages.

func (StdTx) GetPubKeys Uses

func (tx StdTx) GetPubKeys() []crypto.PubKey

GetPubkeys returns the pubkeys of signers if the pubkey is included in the signature If pubkey is not included in the signature, then nil is in the slice instead

func (StdTx) GetSignatures Uses

func (tx StdTx) GetSignatures() [][]byte

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 (StdTx) GetSignaturesV2 Uses

func (tx StdTx) GetSignaturesV2() ([]signing.SignatureV2, error)

GetSignaturesV2 implements SigVerifiableTx.GetSignaturesV2

func (StdTx) GetSigners Uses

func (tx StdTx) GetSigners() []sdk.AccAddress

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 (StdTx) GetTimeoutHeight Uses

func (tx StdTx) GetTimeoutHeight() uint64

GetTimeoutHeight returns the transaction's timeout height (if set).

func (StdTx) UnpackInterfaces Uses

func (tx StdTx) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

func (StdTx) ValidateBasic Uses

func (tx StdTx) ValidateBasic() error

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

type StdTxBuilder Uses

type StdTxBuilder struct {
    StdTx
    // contains filtered or unexported fields
}

StdTxBuilder wraps StdTx to implement to the context.TxBuilder interface. Note that this type just exists for backwards compatibility with amino StdTx and will not work for protobuf transactions.

func (*StdTxBuilder) GetTx Uses

func (s *StdTxBuilder) GetTx() authsigning.Tx

GetTx implements TxBuilder.GetTx

func (*StdTxBuilder) SetFeeAmount Uses

func (s *StdTxBuilder) SetFeeAmount(amount sdk.Coins)

func (*StdTxBuilder) SetGasLimit Uses

func (s *StdTxBuilder) SetGasLimit(limit uint64)

func (*StdTxBuilder) SetMemo Uses

func (s *StdTxBuilder) SetMemo(memo string)

SetMemo implements TxBuilder.SetMemo

func (*StdTxBuilder) SetMsgs Uses

func (s *StdTxBuilder) SetMsgs(msgs ...sdk.Msg) error

SetMsgs implements TxBuilder.SetMsgs

func (*StdTxBuilder) SetSignatures Uses

func (s *StdTxBuilder) SetSignatures(signatures ...signing.SignatureV2) error

SetSignatures implements TxBuilder.SetSignatures.

func (*StdTxBuilder) SetSignerInfo Uses

func (s *StdTxBuilder) SetSignerInfo(_ crypto.PubKey, _ *txtypes.ModeInfo) error

SetSignerInfo implements TxBuilder.SetSignerInfo.

func (*StdTxBuilder) SetTimeoutHeight Uses

func (s *StdTxBuilder) SetTimeoutHeight(height uint64)

SetTimeoutHeight sets the transaction's height timeout.

type StdTxConfig Uses

type StdTxConfig struct {
    Cdc *codec.Codec
}

StdTxConfig is a context.TxConfig for StdTx

func (StdTxConfig) MarshalSignatureJSON Uses

func (s StdTxConfig) MarshalSignatureJSON(sigs []signing.SignatureV2) ([]byte, error)

func (StdTxConfig) NewTxBuilder Uses

func (s StdTxConfig) NewTxBuilder() client.TxBuilder

NewTxBuilder implements TxConfig.NewTxBuilder

func (StdTxConfig) SignModeHandler Uses

func (s StdTxConfig) SignModeHandler() authsigning.SignModeHandler

func (StdTxConfig) TxDecoder Uses

func (s StdTxConfig) TxDecoder() sdk.TxDecoder

func (StdTxConfig) TxEncoder Uses

func (s StdTxConfig) TxEncoder() sdk.TxEncoder

MarshalTx implements TxConfig.MarshalTx

func (StdTxConfig) TxJSONDecoder Uses

func (s StdTxConfig) TxJSONDecoder() sdk.TxDecoder

func (StdTxConfig) TxJSONEncoder Uses

func (s StdTxConfig) TxJSONEncoder() sdk.TxEncoder

func (StdTxConfig) UnmarshalSignatureJSON Uses

func (s StdTxConfig) UnmarshalSignatureJSON(bz []byte) ([]signing.SignatureV2, error)

func (StdTxConfig) WrapTxBuilder Uses

func (s StdTxConfig) WrapTxBuilder(newTx sdk.Tx) (client.TxBuilder, error)

WrapTxBuilder returns a StdTxBuilder from provided transaction

type UnimplementedQueryServer Uses

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Account Uses

func (*UnimplementedQueryServer) Account(ctx context.Context, req *QueryAccountRequest) (*QueryAccountResponse, error)

func (*UnimplementedQueryServer) Params Uses

func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error)

Package types imports 31 packages (graph) and is imported by 60 packages. Updated 2020-08-08. Refresh now. Tools for package owners.