domain

package
v22.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDenomPrecisions

func GetDenomPrecisions(ctx context.Context) (map[string]int, error)

GetDenomPrecisions implements domain.TokensUsecase.

Types

type AssetList

type AssetList struct {
	ChainName string `json:"chain_name"`
	Assets    []struct {
		Description string `json:"description"`
		DenomUnits  []struct {
			Denom    string `json:"denom"`
			Exponent int    `json:"exponent"`
		} `json:"denom_units"`
		Base     string        `json:"base"`
		Name     string        `json:"name"`
		Display  string        `json:"display"`
		Symbol   string        `json:"symbol"`
		Traces   []interface{} `json:"traces"`
		LogoURIs struct {
			PNG string `json:"png"`
			SVG string `json:"svg"`
		} `json:"logo_URIs"`
		CoingeckoID string   `json:"coingecko_id"`
		Keywords    []string `json:"keywords"`
	} `json:"assets"`
}

Struct to represent the JSON structure

type AssetListGetter

type AssetListGetter interface {
	GetDenomPrecisions(ctx context.Context) (map[string]int, error)
}

func NewAssetListGetter

func NewAssetListGetter() AssetListGetter

type AssetListGetterImpl

type AssetListGetterImpl struct{}

func (*AssetListGetterImpl) GetDenomPrecisions

func (*AssetListGetterImpl) GetDenomPrecisions(ctx context.Context) (map[string]int, error)

GetDenomPrecisions implements AssetListGetter.

type AtomicIngester

type AtomicIngester interface {
	// ProcessBlock processes the block by writing data into a transaction.
	// Returns error if fails to process.
	// It does not flush data to sink. The caller must call Exec on the transaction
	ProcessBlock(ctx sdk.Context, tx repository.Tx) error
}

AtomicIngester is an interface that defines the methods for the atomic ingester. It processes a block by writing data into a transaction. The caller must call Exec on the transaction to flush data to sink.

type BankKeeper

type BankKeeper interface {
	GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}

BankKeeper is an interface for getting bank balances.

type ConcentratedKeeper

type ConcentratedKeeper interface {
	PoolKeeper
	GetTickLiquidityForFullRange(ctx sdk.Context, poolId uint64) ([]queryproto.LiquidityDepthWithRange, int64, error)
}

ConcentratedKeeper is an interface for the concentrated keeper.

type CosmWasmPoolKeeper

type CosmWasmPoolKeeper interface {
	GetPoolsWithWasmKeeper(ctx sdk.Context) ([]poolmanagertypes.PoolI, error)
}

CosmWasmPoolKeeper is an interface for getting CosmWasm pools from a keeper.

type PoolKeeper

type PoolKeeper interface {
	GetPools(ctx sdk.Context) ([]poolmanagertypes.PoolI, error)
}

PoolKeeper is an interface for getting pools from a keeper.

type PoolManagerKeeper

type PoolManagerKeeper interface {
	RouteCalculateSpotPrice(
		ctx sdk.Context,
		poolId uint64,
		quoteAssetDenom string,
		baseAssetDenom string,
	) (price osmomath.BigDec, err error)

	SwapExactAmountIn(
		ctx sdk.Context,
		sender sdk.AccAddress,
		poolId uint64,
		tokenIn sdk.Coin,
		tokenOutDenom string,
		tokenOutMinAmount osmomath.Int,
	) (tokenOutAmount osmomath.Int, err error)

	RouteGetPoolDenoms(
		ctx sdk.Context,
		poolId uint64,
	) (denoms []string, err error)

	GetTradingPairTakerFee(ctx sdk.Context, denom0, denom1 string) (osmomath.Dec, error)

	MultihopEstimateInGivenExactAmountOut(
		ctx sdk.Context,
		route []poolmanagertypes.SwapAmountOutRoute,
		tokenOut sdk.Coin,
	) (tokenInAmount osmomath.Int, err error)
}

PoolManagerKeeper is an interface for the pool manager keeper.

type ProtorevKeeper

type ProtorevKeeper interface {
	GetPoolForDenomPair(ctx sdk.Context, baseDenom, denomToMatch string) (uint64, error)
}

ProtorevKeeper is an interface for getting the pool for a denom pair.

type SQSIngestKeepers

type SQSIngestKeepers struct {
	GammKeeper         PoolKeeper
	CosmWasmPoolKeeper CosmWasmPoolKeeper
	BankKeeper         BankKeeper
	ProtorevKeeper     ProtorevKeeper
	PoolManagerKeeper  PoolManagerKeeper
	ConcentratedKeeper ConcentratedKeeper
}

Chain keepers required for sqs ingest.

type Token

type Token struct {
	// ChainDenom is the denom used in the chain state.
	ChainDenom string `json:"chain_denom"`
	// HumanDenom is the human readable denom.
	HumanDenom string `json:"human_denom"`
	// Precision is the precision of the token.
	Precision int `json:"precision"`
}

Token represents the token's domain model

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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