common

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BigInt0        = big.NewInt(0)
	BigInt1        = big.NewInt(1)
	BigInt10       = big.NewInt(10)
	BigFloat0      = big.NewFloat(0)
	BigFloatBase18 = big.NewFloat(1e18)
	BigFloatBase9  = big.NewFloat(1e9)
)

Constants

View Source
var MainnetConfig = ConfigType{
	XOracleAPI:                 "https://api.xoracle.io/",
	EndpointAPIPrice:           "prices/xoracle",
	EndpointAPINodePrice:       "",
	EndpointAPITokenIndexPrice: "",
	EndpointAPIPricefeed:       "",
	EndpointAPITokenIndexInfo:  "prices/tokenIndexInfo",
	EndpointAPINodeInfo:        "prices/nodeInfo",
}

Config

View Source
var TOKEN_DECIMALS = 8
View Source
var TOKEN_INDEX = TokenIndex{
	BTC:   0,
	ETH:   1,
	BNB:   2,
	USDT:  3,
	BUSD:  4,
	USDC:  5,
	DAI:   6,
	XRP:   10,
	DOGE:  11,
	TRX:   12,
	ADA:   20,
	MATIC: 21,
	SOL:   22,
	DOT:   23,
	AVAX:  24,
	FTM:   25,
	NEAR:  26,
	ATOM:  27,
	OP:    28,
	ARB:   29,
}
View Source
var TestnetConfig = ConfigType{
	XOracleAPI:                 "https://api-testnet.xoracle.io/",
	EndpointAPIPrice:           "prices/xoracle",
	EndpointAPINodePrice:       "",
	EndpointAPITokenIndexPrice: "",
	EndpointAPIPricefeed:       "",
	EndpointAPITokenIndexInfo:  "prices/tokenIndexInfo",
	EndpointAPINodeInfo:        "prices/nodeInfo",
}

Functions

func AppendUrlWithSlash

func AppendUrlWithSlash(url string) string

func ConvertPriceDecimals

func ConvertPriceDecimals(price *big.Int, decimals int) *big.Int

func ParseAddressFormat

func ParseAddressFormat(address string) string

func ParseEther

func ParseEther(wei *big.Int) *big.Float

Types

type ConfigType

type ConfigType struct {
	XOracleAPI                 string
	EndpointAPIPrice           string
	EndpointAPINodePrice       string
	EndpointAPITokenIndexPrice string
	EndpointAPIPricefeed       string
	EndpointAPITokenIndexInfo  string
	EndpointAPINodeInfo        string
}

type Network added in v0.1.10

type Network struct {
	MAINNET NetworkType
	TESTNET NetworkType
}

type NetworkType added in v0.1.10

type NetworkType int
const (
	MAINNET NetworkType = iota
	TESTNET
)

type NodeInfo

type NodeInfo struct {
	NodeAddress geth_common.Address
	NodeName    string
}

type TokenIndex

type TokenIndex struct {
	BTC   int
	ETH   int
	BNB   int
	USDT  int
	BUSD  int
	USDC  int
	DAI   int
	XRP   int
	DOGE  int
	TRX   int
	ADA   int
	MATIC int
	SOL   int
	DOT   int
	AVAX  int
	FTM   int
	NEAR  int
	ATOM  int
	OP    int
	ARB   int
}

type TokenIndexInfo

type TokenIndexInfo struct {
	TokenIndex  int
	TokenName   string
	TokenSymbol string
}

type TokenIndexPrice

type TokenIndexPrice struct {
	TokenIndex int
	Price      *big.Int
}

Jump to

Keyboard shortcuts

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