xpla

package
v0.0.0-...-5cadadf Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAINNET_CHAIN_PREFIX = "dimension"
	TESTNET_CHAIN_PREFIX = "cube"

	ADDR_PREFIX = "xpla1"
	IBC_PREFIX  = "ibc/"

	LATEST_HEIGHT_INDICATOR = 0

	BLOCK_SECOND = 5

	IBC_DEFAULT_TOKEN_DECIMALS = 6
)

Variables

This section is empty.

Functions

func IsCw20

func IsCw20(addr string) bool

func IsIbcToken

func IsIbcToken(addr string) bool

func IsMainnet

func IsMainnet(chainId string) bool

func IsMainnetOrTestnet

func IsMainnetOrTestnet(chainId string) bool

func IsTestnet

func IsTestnet(chainId string) bool

Types

type Client

type Client interface {
	VerifiedCw20s() (*TokensRes, error)
	VerifiedIbcs() (*IbcsRes, error)
}

func NewClient

func NewClient() Client

type GrpcClient

type GrpcClient interface {
	SyncedHeight() (uint64, error)
	QueryContract(addr string, query []byte, height uint64) ([]byte, error)
	QueryIbcDenomTrace(hash string) (*ibc_types.DenomTrace, error)
}

func NewGrpcClient

func NewGrpcClient(target string) (GrpcClient, error)

type IbcRes

type IbcRes struct {
	Denom     *string `json:"denom,omitempty"`
	Path      *string `json:"path,omitempty"`
	BaseDenom *string `json:"base_denom,omitempty"`
	Symbol    *string `json:"symbol,omitempty"`
	Name      *string `json:"name,omitempty"`
	Icon      *string `json:"icon,omitempty"`
	Decimals  *uint8  `json:"decimals,omitempty"`
}

type IbcResMap

type IbcResMap map[string]IbcRes

type IbcsRes

type IbcsRes struct {
	Mainnet IbcResMap `json:"mainnet"`
	Testnet IbcResMap `json:"testnet"`
}

type TokenRes

type TokenRes struct {
	Protocol *string `json:"protocol,omitempty"`
	Symbol   *string `json:"symbol,omitempty"`
	Name     *string `json:"name,omitempty"`
	Token    *string `json:"token,omitempty"`
	Icon     *string `json:"icon,omitempty"`
	Decimals *uint8  `json:"decimals,omitempty"`
}

type TokenResMap

type TokenResMap map[string]TokenRes

type TokensRes

type TokensRes struct {
	Mainnet TokenResMap `json:"mainnet"`
	Testnet TokenResMap `json:"testnet"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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