types

package
v8.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name          = "fxcore"
	AddressPrefix = "fx"
	EnvPrefix     = "FX"

	DefaultDenom  = "apundiai"
	DefaultSymbol = "PUNDIAI"
	DenomUnit     = 18

	LegacyFXDenom = "FX"
	FXDenom       = "fx"

	AddrLen = 20

	DefaultGasPrice = 5 * 1e9
)
View Source
const (
	PundixWrapDenom = "pundix"
	PundixChannel   = "channel-0"
)
View Source
const (
	MainnetChainId = "fxcore"

	MainnetGenesisHash   = "3d6cb5ebc05d42371581cd2f7bc23590e5623c3377424a89b1db982e1938fbad"
	MainnetBlockHeightV2 = 5_713_000
	MainnetBlockHeightV3 = 8_756_000
	MainnetBlockHeightV4 = 10_477_500
	MainnetBlockHeightV5 = 11_601_700
	MainnetBlockHeightV6 = 13_598_000
	MainnetBlockHeightV7 = 16_838_000
	MainnetBlockHeightV8 = 19_616_000
)

mainnet

View Source
const (
	TestnetChainId = "dhobyghaut"

	TestnetGenesisHash     = "ec2bf940c025434d1fd17e2338a60b8803900310dc71f71ea55c185b24ddba23"
	TestnetBlockHeightV2   = 3_418_880
	TestnetBlockHeightV3   = 6_578_000
	TestnetBlockHeightV4   = 8_088_000
	TestnetBlockHeightV41  = 8_376_000 // v4.1
	TestnetBlockHeightV42  = 8_481_000 // v4.2
	TestnetBlockHeightV5   = 9_773_000
	TestnetBlockHeightV6   = 11_701_000
	TestnetBlockHeightV7   = 12_961_500
	TestnetBlockHeightV71  = 14_369_500 // v7.1
	TestnetBlockHeightV72  = 14_389_000 // v7.2
	TestnetBlockHeightV73  = 14_551_500 // v7.3
	TestnetBlockHeightV74  = 15_614_000 // v7.4
	TestnetBlockHeightV75  = 15_660_500 // v7.5
	TestnetBlockHeightV8   = 18_005_000 // v8
	TestnetBlockHeightV81  = 18_019_000 // v8.1
	TestnetBlockHeightV82  = 18_332_000 // v8.2
	TestnetBlockHeightV83  = 18_382_000 // v8.3
	TestnetBlockHeightV84  = 18_583_700 // v8.4
	TestnetBlockHeightV841 = 18_722_000 // v8.4.1
	TestnetBlockHeightV85  = 18_783_000 // v8.5
)

testnet

View Source
const (
	MainnetPundixUnWrapDenom = "eth0x0FD10b9899882a6f2fcb5c371E17e70FdEe00C38"
)
View Source
const (
	TestnetPundixUnWrapDenom = "eth0xd9EEd31F5731DfC3Ca18f09B487e200F50a6343B"
)

Variables

Functions

func ChainIdWithEIP155

func ChainIdWithEIP155(chainId string) string

func EIP155ChainID

func EIP155ChainID(chainId string) *big.Int

func ExternalAddrToAccAddr

func ExternalAddrToAccAddr(chainName, addr string) sdk.AccAddress

func ExternalAddrToHexAddr

func ExternalAddrToHexAddr(chainName, addr string) common.Address

func ExternalAddrToStr

func ExternalAddrToStr(chainName string, bz []byte) string

func GetDefMinGasPrices

func GetDefMinGasPrices() sdk.Coin

func GetDefaultNodeHome

func GetDefaultNodeHome() string

func GetSupportChains

func GetSupportChains() []string

func IsSupportChain

func IsSupportChain(chainName string) bool

func NewDefaultMetadata

func NewDefaultMetadata() banktypes.Metadata

func NewMetadata

func NewMetadata(name, symbol string, decimals uint32) banktypes.Metadata

func OnRecvAmountCovert

func OnRecvAmountCovert(wrapDenom, amountStr string) (string, error)

func OnRecvDenomNeedWrap

func OnRecvDenomNeedWrap(chainId, sourcePort, sourceChannel, denom string) (needWrap bool, wrapDenom, packetDenom string)

func ParseAddress

func ParseAddress(addr string) (accAddr sdk.AccAddress, isEvmAddr bool, err error)

func RegisterExternalAddress

func RegisterExternalAddress(chainName string, validate ExternalAddress)

func SendPacketDenomNeedWrap

func SendPacketDenomNeedWrap(chainId, channel, denom string) (bool, string)

func SendPacketDenomWrapKey

func SendPacketDenomWrapKey(sourceChannel, denonm string) string

func SetConfig

func SetConfig(isCosmosCoinType bool)

func SwapAmount

func SwapAmount(amount sdkmath.Int) sdkmath.Int

func SwapCoin

func SwapCoin(coin sdk.Coin) sdk.Coin

func SwapCoins

func SwapCoins(coins sdk.Coins) sdk.Coins

func SwapDecAmount

func SwapDecAmount(amount sdkmath.LegacyDec) sdkmath.LegacyDec

func SwapDecCoins

func SwapDecCoins(decCoins sdk.DecCoins) sdk.DecCoins

func ValidateExternalAddr

func ValidateExternalAddr(chainName, addr string) error

func ValidateModuleName

func ValidateModuleName(moduleName string) error

ValidateModuleName is the default validation function for crosschain moduleName.

func VerifyAddressFormat

func VerifyAddressFormat(bz []byte) error

VerifyAddressFormat verifies whether the address is compatible with Ethereum

Types

type ExternalAddress

type ExternalAddress interface {
	ValidateExternalAddr(addr string) error
	ExternalAddrToAccAddr(addr string) sdk.AccAddress
	ExternalAddrToHexAddr(addr string) common.Address
	ExternalAddrToStr(bz []byte) string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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