swapapi

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainConfig added in v3.1.0

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

ChainConfig rpc type

func ConvertChainConfig added in v3.1.0

func ConvertChainConfig(c *tokens.ChainConfig) *ChainConfig

ConvertChainConfig convert chain config

type MapIntResult

type MapIntResult map[int]string

MapIntResult type

func RegisterAnyCallSwap

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

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

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 ServerInfo

type ServerInfo struct {
	Identifier     string
	Version        string
	ConfigContract string
}

ServerInfo serverinfo

func GetServerInfo

func GetServerInfo() *ServerInfo

GetServerInfo get server info

type SwapInfo

type SwapInfo struct {
	SwapType      uint32             `json:"swaptype"`
	TxID          string             `json:"txid"`
	TxTo          string             `json:"txto"`
	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"`
	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

type TokenConfig added in v3.1.0

type TokenConfig struct {
	TokenID               string
	Decimals              uint8
	ContractAddress       string
	ContractVersion       uint64
	MaximumSwap           string
	MinimumSwap           string
	BigValueThreshold     string
	SwapFeeRatePerMillion uint64
	MaximumSwapFee        string
	MinimumSwapFee        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