base

package module
v0.2.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PubKeyPrefix     = collections.NewPrefix(0)
	PubKeyTypePrefix = collections.NewPrefix(1)
	SequencePrefix   = collections.NewPrefix(2)
)

Functions

func NewAccount

func NewAccount(name string, handlerMap *signing.HandlerMap, options ...Option) accountstd.AccountCreatorFunc

Types

type Account

type Account struct {
	PubKey     collections.Item[[]byte]
	PubKeyType collections.Item[string]

	Sequence collections.Sequence
	// contains filtered or unexported fields
}

Account implements a base account.

func (Account) Authenticate

Authenticate implements the authentication flow of an abstracted base account.

func (Account) Init

func (a Account) Init(ctx context.Context, msg *v1.MsgInit) (*v1.MsgInitResponse, error)

func (Account) QueryPubKey

func (a Account) QueryPubKey(ctx context.Context, _ *v1.QueryPubKey) (*v1.QueryPubKeyResponse, error)

func (Account) QuerySequence

func (a Account) QuerySequence(ctx context.Context, _ *v1.QuerySequence) (*v1.QuerySequenceResponse, error)

func (Account) RegisterExecuteHandlers

func (a Account) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder)

func (Account) RegisterInitHandler

func (a Account) RegisterInitHandler(builder *accountstd.InitBuilder)

func (Account) RegisterQueryHandlers

func (a Account) RegisterQueryHandlers(builder *accountstd.QueryBuilder)

func (Account) SwapPubKey

func (a Account) SwapPubKey(ctx context.Context, msg *v1.MsgSwapPubKey) (*v1.MsgSwapPubKeyResponse, error)

type Option

type Option func(a *Account)

func WithPubKey

func WithPubKey[T any, PT PubKeyG[T]]() Option

func WithPubKeyWithValidationFunc

func WithPubKeyWithValidationFunc[T any, PT PubKeyG[T]](validateFn func(PT) error) Option

func WithSecp256K1PubKey

func WithSecp256K1PubKey() Option

func (Option) IsManyPerContainerType

func (Option) IsManyPerContainerType()

type PubKey

type PubKey interface {
	transaction.Msg
	VerifySignature(msg, sig []byte) bool
}

PubKey defines a generic pubkey.

type PubKeyG

type PubKeyG[T any] interface {
	*T
	PubKey
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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