Documentation
¶
Index ¶
- Constants
- Variables
- func ChainIdWithEIP155(chainId string) string
- func EIP155ChainID(chainId string) *big.Int
- func ExternalAddrToAccAddr(chainName, addr string) sdk.AccAddress
- func ExternalAddrToHexAddr(chainName, addr string) common.Address
- func ExternalAddrToStr(chainName string, bz []byte) string
- func GetDefMinGasPrices() sdk.Coin
- func GetDefaultNodeHome() string
- func GetSupportChains() []string
- func IsSupportChain(chainName string) bool
- func NewDefaultMetadata() banktypes.Metadata
- func NewMetadata(name, symbol string, decimals uint32) banktypes.Metadata
- func OnRecvAmountCovert(wrapDenom, amountStr string) (string, error)
- func OnRecvDenomNeedWrap(chainId, sourcePort, sourceChannel, denom string) (needWrap bool, wrapDenom, packetDenom string)
- func ParseAddress(addr string) (accAddr sdk.AccAddress, isEvmAddr bool, err error)
- func RegisterExternalAddress(chainName string, validate ExternalAddress)
- func SendPacketDenomNeedWrap(chainId, channel, denom string) (bool, string)
- func SendPacketDenomWrapKey(sourceChannel, denonm string) string
- func SetConfig(isCosmosCoinType bool)
- func SwapAmount(amount sdkmath.Int) sdkmath.Int
- func SwapCoin(coin sdk.Coin) sdk.Coin
- func SwapCoins(coins sdk.Coins) sdk.Coins
- func SwapDecAmount(amount sdkmath.LegacyDec) sdkmath.LegacyDec
- func SwapDecCoins(decCoins sdk.DecCoins) sdk.DecCoins
- func ValidateExternalAddr(chainName, addr string) error
- func ValidateModuleName(moduleName string) error
- func VerifyAddressFormat(bz []byte) error
- type ExternalAddress
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 ¶
View Source
var ( MainnetOnRecvWrap = map[string]string{ MainnetPundixUnWrapDenom: PundixWrapDenom, LegacyFXDenom: DefaultDenom, } MainnetSendPacketWrap = map[string]string{ SendPacketDenomWrapKey(PundixChannel, PundixWrapDenom): MainnetPundixUnWrapDenom, } )
View Source
var ( TestnetOnRecvWrap = map[string]string{ TestnetPundixUnWrapDenom: PundixWrapDenom, LegacyFXDenom: DefaultDenom, } TestnetSendPacketWrap = map[string]string{ SendPacketDenomWrapKey(PundixChannel, PundixWrapDenom): TestnetPundixUnWrapDenom, } )
Functions ¶
func ChainIdWithEIP155 ¶
func EIP155ChainID ¶
func ExternalAddrToAccAddr ¶
func ExternalAddrToAccAddr(chainName, addr string) sdk.AccAddress
func ExternalAddrToHexAddr ¶
func ExternalAddrToStr ¶
func GetDefMinGasPrices ¶
func GetDefaultNodeHome ¶
func GetDefaultNodeHome() string
func GetSupportChains ¶
func GetSupportChains() []string
func IsSupportChain ¶
func NewDefaultMetadata ¶
func OnRecvAmountCovert ¶
func OnRecvDenomNeedWrap ¶
func ParseAddress ¶
func ParseAddress(addr string) (accAddr sdk.AccAddress, isEvmAddr bool, err error)
func RegisterExternalAddress ¶
func RegisterExternalAddress(chainName string, validate ExternalAddress)
func SendPacketDenomNeedWrap ¶
func SendPacketDenomWrapKey ¶
func ValidateExternalAddr ¶
func ValidateModuleName ¶
ValidateModuleName is the default validation function for crosschain moduleName.
func VerifyAddressFormat ¶
VerifyAddressFormat verifies whether the address is compatible with Ethereum
Types ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.