cosmostxm

package
v2.5.1-clf-20230912 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyWrapper

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

KeyWrapper uses a KeystoreAdapter to implement the cosmos-sdk PrivKey interface for a specific key.

func NewKeyWrapper

func NewKeyWrapper(adapter *KeystoreAdapter, account string) *KeyWrapper

func (*KeyWrapper) Bytes

func (a *KeyWrapper) Bytes() []byte

func (*KeyWrapper) Equals

func (a *KeyWrapper) Equals(other cryptotypes.LedgerPrivKey) bool

func (*KeyWrapper) ProtoMessage

func (a *KeyWrapper) ProtoMessage()

func (*KeyWrapper) PubKey

func (a *KeyWrapper) PubKey() cryptotypes.PubKey

func (*KeyWrapper) Reset

func (a *KeyWrapper) Reset()

func (*KeyWrapper) Sign

func (a *KeyWrapper) Sign(msg []byte) ([]byte, error)

func (*KeyWrapper) String

func (a *KeyWrapper) String() string

func (*KeyWrapper) Type

func (a *KeyWrapper) Type() string

type KeystoreAdapter added in v2.6.0

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

An adapter for a Cosmos loop.Keystore to translate public keys into bech32-prefixed account addresses.

func NewKeystoreAdapter added in v2.6.0

func NewKeystoreAdapter(keystore loop.Keystore, accountPrefix string) *KeystoreAdapter

func (*KeystoreAdapter) PubKey added in v2.6.0

func (ka *KeystoreAdapter) PubKey(address string) (cryptotypes.PubKey, error)

Returns the cosmos PubKey associated with the prefixed address.

func (*KeystoreAdapter) Sign added in v2.6.0

func (ka *KeystoreAdapter) Sign(ctx context.Context, id string, hash []byte) ([]byte, error)

type ORM

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

ORM manages the data model for cosmos tx management.

func NewORM

func NewORM(chainID string, db *sqlx.DB, lggr logger.Logger, cfg pg.QConfig) *ORM

NewORM creates an ORM scoped to chainID.

func (*ORM) GetMsgs

func (o *ORM) GetMsgs(ids ...int64) (adapters.Msgs, error)

GetMsgs returns any messages matching ids.

func (*ORM) GetMsgsState

func (o *ORM) GetMsgsState(state db.State, limit int64, qopts ...pg.QOpt) (adapters.Msgs, error)

GetMsgsState returns the oldest messages with a given state up to limit.

func (*ORM) InsertMsg

func (o *ORM) InsertMsg(contractID, typeURL string, msg []byte, qopts ...pg.QOpt) (int64, error)

InsertMsg inserts a cosmos msg, assumed to be a serialized cosmos ExecuteContractMsg.

func (*ORM) UpdateMsgs

func (o *ORM) UpdateMsgs(ids []int64, state db.State, txHash *string, qopts ...pg.QOpt) error

UpdateMsgs updates msgs with the given ids. Note state transitions are validated at the db level.

func (*ORM) UpdateMsgsContract

func (o *ORM) UpdateMsgsContract(contractID string, from, to db.State, qopts ...pg.QOpt) error

UpdateMsgsContract updates messages for the given contract.

type Txm

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

Txm manages transactions for the cosmos blockchain.

func NewTxm

NewTxm creates a txm. Uses simulation so should only be used to send txes to trusted contracts i.e. OCR.

func (*Txm) Close

func (txm *Txm) Close() error

Close close service

func (*Txm) Enqueue

func (txm *Txm) Enqueue(contractID string, msg sdk.Msg) (int64, error)

Enqueue enqueue a msg destined for the cosmos chain.

func (*Txm) GasPrice

func (txm *Txm) GasPrice() (sdk.DecCoin, error)

GasPrice returns the gas price from the estimator in the configured fee token.

func (*Txm) GetMsgs

func (txm *Txm) GetMsgs(ids ...int64) (adapters.Msgs, error)

GetMsgs returns any messages matching ids.

func (*Txm) HealthReport

func (txm *Txm) HealthReport() map[string]error

func (*Txm) Healthy

func (txm *Txm) Healthy() error

Healthy service is healthy

func (*Txm) Name

func (txm *Txm) Name() string

func (*Txm) Ready

func (txm *Txm) Ready() error

Ready service is ready

func (*Txm) Start

func (txm *Txm) Start(context.Context) error

Start subscribes to pg notifications about cosmos msg inserts and processes them.

Jump to

Keyboard shortcuts

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