2020-06-01 05:46:03 -07:00
|
|
|
package client
|
2020-05-21 14:29:34 -07:00
|
|
|
|
2020-10-15 07:19:57 -07:00
|
|
|
import (
|
2020-11-09 08:01:43 -08:00
|
|
|
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
2020-10-15 07:19:57 -07:00
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Account defines a read-only version of the auth module's AccountI.
|
|
|
|
type Account interface {
|
|
|
|
GetAddress() sdk.AccAddress
|
2020-11-09 08:01:43 -08:00
|
|
|
GetPubKey() cryptotypes.PubKey // can return nil.
|
2020-10-15 07:19:57 -07:00
|
|
|
GetAccountNumber() uint64
|
|
|
|
GetSequence() uint64
|
|
|
|
}
|
2020-05-21 14:29:34 -07:00
|
|
|
|
|
|
|
// AccountRetriever defines the interfaces required by transactions to
|
|
|
|
// ensure an account exists and to be able to query for account fields necessary
|
|
|
|
// for signing.
|
|
|
|
type AccountRetriever interface {
|
2020-10-15 07:19:57 -07:00
|
|
|
GetAccount(clientCtx Context, addr sdk.AccAddress) (Account, error)
|
|
|
|
GetAccountWithHeight(clientCtx Context, addr sdk.AccAddress) (Account, int64, error)
|
|
|
|
EnsureExists(clientCtx Context, addr sdk.AccAddress) error
|
|
|
|
GetAccountNumberSequence(clientCtx Context, addr sdk.AccAddress) (accNum uint64, accSeq uint64, err error)
|
2020-05-21 14:29:34 -07:00
|
|
|
}
|