keeper

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

evm_helpers.go EVM-specific helper functions used in inbound transaction verification.

svm_helpers.go SVM-specific helper functions used in inbound transaction verification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidSVMSender

func IsValidSVMSender(accountKeys []string, expectedHex string) (string, error)

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the module MsgServer interface.

func NormalizeEVMAddress

func NormalizeEVMAddress(addr string) string

NormalizeEVMAddress returns a lowercase hex address without 0x prefix

func ParseEVMFundsAddedEventLogs

func ParseEVMFundsAddedEventLogs(
	logs []interface{},
	expectedTopic string,
) ([]utxverifiertypes.EVMFundsAddedEventData, error)

@notice Parses EVM logs to extract amount, decimals and payloadHash from the `FundsAdded` event. @dev This function scans logs for a specific event topic and decodes the `amountInUSD`, `payloadHash` fields. @param logs The array of raw EVM logs from the transaction receipt. @param expectedTopic The hash of the `FundsAdded` event signature (topic[0]) to match. @return amount The extracted amount in USD as a big.Int. @return decimals The number of decimals used for the USD amount. @return error An error if the event was not found or decoding failed.

Emits: event FundsAdded(

address indexed user,
bytes32 indexed payloadHash,
AmountInUSD AmountInUSD

);

func ParseSVMFundsAddedEventLog

func ParseSVMFundsAddedEventLog(
	logMessages []string,
	expectedDiscriminator []byte,
) ([]utxverifiertypes.SVMFundsAddedEventData, error)

ParseSVMFundsAddedLog parses Solana log messages to extract the FundsAddedEvent @param logMessages Program logs from the transaction @param expectedDiscriminator First 8 bytes of event identifier @return event data or error if not found or corrupted

Types

type Keeper

type Keeper struct {

	// state management
	Params             collections.Item[types.Params]
	VerifiedInboundTxs collections.Map[string, types.VerifiedTxMetadata]
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeService storetypes.KVStoreService,
	logger log.Logger,
	authority string,
	uregistryKeeper types.UregistryKeeper,
) Keeper

NewKeeper creates a new Keeper instance

func (*Keeper) ExportGenesis

func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState

ExportGenesis exports the module's state to a genesis state.

func (Keeper) GetURegistryKeeper

func (k Keeper) GetURegistryKeeper() types.UregistryKeeper

func (Keeper) GetVerifiedInboundTxMetadata

func (k Keeper) GetVerifiedInboundTxMetadata(ctx context.Context, chain, txHash string) (*types.VerifiedTxMetadata, bool, error)

func (*Keeper) InitGenesis

func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error

InitGenesis initializes the module's state from a genesis state.

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

func (Keeper) SchemaBuilder

func (k Keeper) SchemaBuilder() *collections.SchemaBuilder

func (Keeper) StoreVerifiedInboundTx

func (k Keeper) StoreVerifiedInboundTx(ctx context.Context, chain, txHash string, verifiedTxMetadata types.VerifiedTxMetadata) error

func (Keeper) VerifyAndGetPayloadHash

func (k Keeper) VerifyAndGetPayloadHash(ctx sdk.Context, ownerKey, txHash, chain string) ([]string, error)

VerifyAndGetLockedFunds verifies if the user has interacted with the gateway on the source chain and send the locked funds amount.

func (Keeper) VerifyEVMInboundTx

func (k Keeper) VerifyEVMInboundTx(
	ctx context.Context,
	ownerKey, txHash string,
	chainConfig uregistrytypes.ChainConfig,
) (*utxverifiertypes.VerifiedTxMetadata, error)

func (Keeper) VerifySVMInboundTx

func (k Keeper) VerifySVMInboundTx(
	ctx context.Context,
	ownerKey, txHash string,
	chainConfig uregistrytypes.ChainConfig,
) (*utxverifiertypes.VerifiedTxMetadata, error)

type Querier

type Querier struct {
	Keeper
}

func NewQuerier

func NewQuerier(keeper Keeper) Querier

func (Querier) Params

func (Querier) VerifiedTxHash

VerifiedTxHash returns the verified metadata (if any) for a given txHash on a chain.

Jump to

Keyboard shortcuts

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