Documentation ¶
Index ¶
- Variables
- func AppendUrlWithSlash(url string) string
- func ConvertPriceDecimals(price *big.Int, decimals int) *big.Int
- func ParseAddressFormat(address string) string
- func ParseEther(wei *big.Int) *big.Float
- type ConfigType
- type Network
- type NetworkType
- type NodeInfo
- type TokenIndex
- type TokenIndexInfo
- type TokenIndexPrice
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 MainnetAllowTokenIndex = map[int]bool{ TOKEN_INDEX.BTC: true, TOKEN_INDEX.ETH: true, TOKEN_INDEX.BNB: true, TOKEN_INDEX.USDT: true, TOKEN_INDEX.BUSD: true, TOKEN_INDEX.USDC: true, TOKEN_INDEX.DAI: true, TOKEN_INDEX.XRP: true, TOKEN_INDEX.DOGE: true, TOKEN_INDEX.TRX: true, TOKEN_INDEX.ADA: true, TOKEN_INDEX.MATIC: true, TOKEN_INDEX.SOL: true, TOKEN_INDEX.DOT: true, TOKEN_INDEX.AVAX: true, TOKEN_INDEX.FTM: true, TOKEN_INDEX.NEAR: true, TOKEN_INDEX.ATOM: true, TOKEN_INDEX.OP: true, TOKEN_INDEX.ARB: true, }
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 TestnetAllowTokenIndex = map[int]bool{ TOKEN_INDEX.BTC: true, TOKEN_INDEX.ETH: true, TOKEN_INDEX.BNB: true, TOKEN_INDEX.USDT: true, TOKEN_INDEX.BUSD: true, TOKEN_INDEX.USDC: true, TOKEN_INDEX.DAI: true, TOKEN_INDEX.XRP: true, TOKEN_INDEX.DOGE: true, TOKEN_INDEX.TRX: true, TOKEN_INDEX.ADA: true, TOKEN_INDEX.MATIC: true, TOKEN_INDEX.SOL: true, TOKEN_INDEX.DOT: true, TOKEN_INDEX.AVAX: true, TOKEN_INDEX.FTM: true, TOKEN_INDEX.NEAR: true, TOKEN_INDEX.ATOM: true, TOKEN_INDEX.OP: true, TOKEN_INDEX.ARB: true, }
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 ParseAddressFormat ¶
Types ¶
type ConfigType ¶
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 TokenIndexInfo ¶
type TokenIndexPrice ¶
Click to show internal directories.
Click to hide internal directories.