swapapi

package
v3.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllMultichainTokens added in v3.6.0

func GetAllMultichainTokens(tokenID string) map[string]string

GetAllMultichainTokens impl

func GetOracleInfo added in v3.4.0

func GetOracleInfo() map[string]*OracleInfo

GetOracleInfo get oracle info

func GetStatusInfo added in v3.4.0

func GetStatusInfo(status string) (map[string]interface{}, error)

GetStatusInfo api

func ReportOracleInfo added in v3.4.0

func ReportOracleInfo(oracle string, info *OracleInfo) error

ReportOracleInfo report oracle info

Types

type ChainConfig added in v3.1.0

type ChainConfig struct {
	ChainID        string
	BlockChain     string
	RouterContract string
	Confirmations  uint64
	InitialHeight  uint64
}

ChainConfig rpc type

func ConvertChainConfig added in v3.1.0

func ConvertChainConfig(c *tokens.ChainConfig) *ChainConfig

ConvertChainConfig convert chain config

type FeeConfig added in v3.6.0

type FeeConfig struct {
	SwapFeeRatePerMillion uint64
	MaximumSwapFee        string
	MinimumSwapFee        string
}

FeeConfig rpc type

func ConvertFeeConfig added in v3.6.0

func ConvertFeeConfig(c *tokens.FeeConfig) *FeeConfig

ConvertFeeConfig convert fee config

type MapIntResult

type MapIntResult map[int]string

MapIntResult type

func RegisterRouterSwap

func RegisterRouterSwap(fromChainID, txid, logIndexStr string) (*MapIntResult, error)

RegisterRouterSwap register router swap if logIndex is 0 then check all logs, otherwise only check the specified log

type OracleInfo added in v3.4.0

type OracleInfo struct {
	Heartbeat          string
	HeartbeatTimestamp int64
}

OracleInfo oracle info

type ServerInfo

type ServerInfo struct {
	Identifier     string
	Version        string
	ExtraConfig    *params.ExtraConfig `json:",omitempty"`
	AllChainIDs    []*big.Int
	PausedChainIDs []*big.Int `json:",omitempty"`
}

ServerInfo serverinfo

func GetServerInfo

func GetServerInfo() *ServerInfo

GetServerInfo get server info

type SwapConfig added in v3.2.0

type SwapConfig struct {
	MaximumSwap       string
	MinimumSwap       string
	BigValueThreshold string
}

SwapConfig rpc type

func ConvertSwapConfig added in v3.2.0

func ConvertSwapConfig(c *tokens.SwapConfig) *SwapConfig

ConvertSwapConfig convert swap config

type SwapInfo

type SwapInfo struct {
	SwapType      uint32             `json:"swaptype"`
	TxID          string             `json:"txid"`
	TxTo          string             `json:"txto,omitempty"`
	TxHeight      uint64             `json:"txheight"`
	From          string             `json:"from"`
	To            string             `json:"to"`
	Bind          string             `json:"bind"`
	Value         string             `json:"value"`
	LogIndex      int                `json:"logIndex,omitempty"`
	FromChainID   string             `json:"fromChainID"`
	ToChainID     string             `json:"toChainID"`
	SwapInfo      mongodb.SwapInfo   `json:"swapinfo"`
	SwapTx        string             `json:"swaptx"`
	SwapHeight    uint64             `json:"swapheight"`
	SwapValue     string             `json:"swapvalue"`
	SwapNonce     uint64             `json:"swapnonce"`
	Status        mongodb.SwapStatus `json:"status"`
	StatusMsg     string             `json:"statusmsg"`
	InitTime      int64              `json:"inittime"`
	Timestamp     int64              `json:"timestamp"`
	Memo          string             `json:"memo,omitempty"`
	ReplaceCount  int                `json:"replaceCount,omitempty"`
	Confirmations uint64             `json:"confirmations"`
}

SwapInfo swap info

func ConvertMgoSwapResultToSwapInfo

func ConvertMgoSwapResultToSwapInfo(mr *mongodb.MgoSwapResult) *SwapInfo

ConvertMgoSwapResultToSwapInfo convert

func ConvertMgoSwapResultsToSwapInfos

func ConvertMgoSwapResultsToSwapInfos(mrSlice []*mongodb.MgoSwapResult) []*SwapInfo

ConvertMgoSwapResultsToSwapInfos convert

func ConvertMgoSwapToSwapInfo

func ConvertMgoSwapToSwapInfo(ms *mongodb.MgoSwap) *SwapInfo

ConvertMgoSwapToSwapInfo convert

func ConvertMgoSwapsToSwapInfos

func ConvertMgoSwapsToSwapInfos(msSlice []*mongodb.MgoSwap) []*SwapInfo

ConvertMgoSwapsToSwapInfos convert

func GetRouterSwap

func GetRouterSwap(fromChainID, txid, logindexStr string) (*SwapInfo, error)

GetRouterSwap impl

func GetRouterSwapHistory

func GetRouterSwapHistory(fromChainID, address string, offset, limit int, status string) ([]*SwapInfo, error)

GetRouterSwapHistory impl

func GetRouterSwaps added in v3.6.1

func GetRouterSwaps(fromChainID, txid string) ([]*SwapInfo, error)

GetRouterSwaps impl

type TokenConfig added in v3.1.0

type TokenConfig struct {
	TokenID         string
	Decimals        uint8
	ContractAddress string
	ContractVersion uint64
	RouterContract  string
	Underlying      string
}

TokenConfig rpc type

func ConvertTokenConfig added in v3.1.0

func ConvertTokenConfig(c *tokens.TokenConfig) *TokenConfig

ConvertTokenConfig convert token config

Jump to

Keyboard shortcuts

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