schema

package
v0.0.0-...-cd62ce9 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT, GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// oracle chainType
	OracleEthChainType     = "ethereum"
	OracleMoonChainType    = "moon"
	OracleCfxChainType     = "conflux"
	OracleBscChainType     = "bsc"
	OraclePlatonChainType  = "platon"
	OracleArweaveChainType = "arweave"
	OracleEverpayChainType = "everpay"

	// ever chainType
	ChainTypeArweave    = "arweave"
	ChainTypeCrossArEth = "arweave,ethereum" // cross arweave, Only used AR token
	ChainTypeMoonbeam   = "moonbeam"
	ChainTypeMoonbase   = "moonbase"
	ChainTypeEth        = "ethereum"
	ChainTypeCfx        = "conflux"
	ChainTypeBsc        = "bsc"
	ChainTypePlaton     = "platon"
	ChainTypeEverpay    = "everpay"
)
View Source
const (
	TxVersionV1             = "v1"
	TxActionTransfer        = "transfer"
	TxActionMint            = "mint"
	TxActionBurn            = "burn"
	TxActionTransferOwner   = "transferOwner"
	TxActionAddWhiteList    = "addWhiteList"
	TxActionRemoveWhiteList = "removeWhiteList"
	TxActionPauseWhiteList  = "pauseWhiteList"
	TxActionAddBlackList    = "addBlackList"
	TxActionRemoveBlackList = "removeBlackList"
	TxActionPauseBlackList  = "pauseBlackList"
	TxActionPause           = "pause"
	ArAddress               = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	EvmAddress              = "0x0000000000000000000000000000000000000000"
	EthAddress              = EvmAddress
	MoonAddress             = EvmAddress // moonbeam native token GLMR
	CfxAddress              = EvmAddress
	BscAddress              = EvmAddress
	PlatonAddress           = EvmAddress
	TNS101Type              = 101 // token type
	TNS102Type              = 102
	ZeroAddress             = "0x0000000000000000000000000000000000000000"
)

Variables

View Source
var EvmChainMetaMap = map[string]evmChainMeta{
	OracleEthChainType:    {Symbol: "ETH"},
	OracleMoonChainType:   {Symbol: "GLMR"},
	OracleCfxChainType:    {Symbol: "CFX"},
	OracleBscChainType:    {Symbol: "BNB"},
	OraclePlatonChainType: {Symbol: "LAT"},
}

Functions

func GetEverToNativeChainType

func GetEverToNativeChainType(everChainType string) (string, error)

func IsEvmChain

func IsEvmChain(chainType string) bool

Types

type HeightLocker

type HeightLocker struct {
	Address     string
	BeginHeight int64
	EndHeight   int64
}

type Locker

type Locker struct {
	ChainType string
	ChainId   string
	List      []HeightLocker
}

func (Locker) CurLockerAddr

func (c Locker) CurLockerAddr() string

func (Locker) GetLockerAddrFromHeight

func (c Locker) GetLockerAddrFromHeight(height int64) (addr string)

type Lockers

type Lockers map[string]Locker // key: oracle chainType

func (Lockers) GetLocker

func (a Lockers) GetLocker(chainType string) (Locker, error)

type TargetChain

type TargetChain struct {
	ChainId   string  `json:"targetChainId"`
	ChainType string  `json:"targetChainType"` // e.g: "avalanche" "arweave" "ethereum","moon"
	Decimals  int     `json:"targetDecimals"`  // e.g: 18
	TokenID   string  `json:"targetTokenId"`   // target chain token address
	Locker    *Locker `json:"-"`
	// for oracle verify
	Rpc   string `json:"-"` // chain node url
	PstGw string `json:"-"` // pst token verify gateway
}

type Transaction

type Transaction struct {
	Action          string
	From            string // notice: Case Sensitive !!!
	To              string // notice: Case Sensitive !!!
	Amount          *big.Int
	Fee             *big.Int
	FeeRecipient    string // notice: Case Sensitive !!!
	Data            string
	TargetChainType string
}

Jump to

Keyboard shortcuts

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