swapapi

package
v0.0.0-...-f387b46 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRegisterSwap

func BuildRegisterSwap(chain, txid string) error

func GetP2shAddressInfo

func GetP2shAddressInfo(p2shAddress string) (*tokens.P2shAddressInfo, error)

GetP2shAddressInfo api

func GetTokenPairInfo

func GetTokenPairInfo(pairID string) (*tokens.TokenPairConfig, error)

GetTokenPairInfo api

func GetTokenPairsInfo

func GetTokenPairsInfo(pairIDs string) (map[string]*tokens.TokenPairConfig, error)

GetTokenPairsInfo api

func IsValidSwapinBindAddress

func IsValidSwapinBindAddress(address *string) bool

IsValidSwapinBindAddress api

func IsValidSwapoutBindAddress

func IsValidSwapoutBindAddress(address *string) bool

IsValidSwapoutBindAddress api

func RegisterP2shAddress

func RegisterP2shAddress(bindAddress string) (*tokens.P2shAddressInfo, error)

RegisterP2shAddress api

Types

type LatestScanInfo

type LatestScanInfo = mongodb.MgoLatestScanInfo

LatestScanInfo type alias

func GetLatestScanInfo

func GetLatestScanInfo(isSrc bool) (*LatestScanInfo, error)

GetLatestScanInfo api

type PostResult

type PostResult string

PostResult post result

var FailedPostResult PostResult = "Failed"
var SuccessPostResult PostResult = "Success"

SuccessPostResult success post result

func P2shSwapin

func P2shSwapin(txid, bindAddr *string) (*PostResult, error)

P2shSwapin api

func RegisterAddress

func RegisterAddress(address string) (*PostResult, error)

RegisterAddress register address for ETH like chain

func RegisterSwap

func RegisterSwap(chain, method, pairid, txid, swapServer string) (*PostResult, error)

RegisterSwap register Swap for ETH like chain

func RegisterSwapPending

func RegisterSwapPending(chain, txid string) (*PostResult, error)

RegisterSwapPending register Swap for ETH like chain

func RegisterSwapRouter

func RegisterSwapRouter(chain, method, chainid, txid, logIndex, swapServer string) (*PostResult, error)

RegisterSwapRouter register Swap for ETH like chain

func RetrySwapin

func RetrySwapin(txid, pairID *string) (*PostResult, error)

RetrySwapin api

func Swapin

func Swapin(txid, pairID *string) (*PostResult, error)

Swapin api

func Swapout

func Swapout(txid, pairID *string) (*PostResult, error)

Swapout api

type RegisteredAddress

type RegisteredAddress = mongodb.MgoRegisteredAddress

RegisteredAddress type alias

func GetRegisteredAddress

func GetRegisteredAddress(address string) (*RegisteredAddress, error)

GetRegisteredAddress get registered address

type ServerInfo

type ServerInfo struct {
	Identifier          string
	MustRegisterAccount bool
	SrcChain            *tokens.ChainConfig
	DestChain           *tokens.ChainConfig
	PairIDs             []string
	Version             string
}

ServerInfo server info

func GetServerInfo

func GetServerInfo() (*ServerInfo, error)

GetServerInfo api

type Swap

type Swap = mongodb.MgoSwap

Swap type alias

func GetRawSwapin

func GetRawSwapin(txid, pairID, bindAddr *string) (*Swap, error)

GetRawSwapin api

func GetRawSwapout

func GetRawSwapout(txid, pairID, bindAddr *string) (*Swap, error)

GetRawSwapout api

type SwapInfo

type SwapInfo struct {
	PairID        string     `json:"pairid"`
	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"`
	SwapTx        string     `json:"swaptx"`
	SwapHeight    uint64     `json:"swapheight"`
	SwapValue     string     `json:"swapvalue"`
	SwapType      uint32     `json:"swaptype"`
	SwapNonce     uint64     `json:"swapnonce"`
	Status        SwapStatus `json:"status"`
	StatusMsg     string     `json:"statusmsg"`
	InitTime      int64      `json:"inittime"`
	Timestamp     int64      `json:"timestamp"`
	Memo          string     `json:"memo"`
	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 GetSwapin

func GetSwapin(txid, pairID, bindAddr *string) (*SwapInfo, error)

GetSwapin api

func GetSwapinHistory

func GetSwapinHistory(address, pairID string, offset, limit int, status string) ([]*SwapInfo, error)

GetSwapinHistory api

func GetSwapout

func GetSwapout(txid, pairID, bindAddr *string) (*SwapInfo, error)

GetSwapout api

func GetSwapoutHistory

func GetSwapoutHistory(address, pairID string, offset, limit int, status string) ([]*SwapInfo, error)

GetSwapoutHistory api

type SwapNonceInfo

type SwapNonceInfo struct {
	SwapinNonces  map[string]uint64 `json:"swapinNonces"`
	SwapoutNonces map[string]uint64 `json:"swapoutNonces"`
}

SwapNonceInfo swap nonce info

func GetNonceInfo

func GetNonceInfo() (*SwapNonceInfo, error)

GetNonceInfo api

type SwapRegisterStatus

type SwapRegisterStatus struct {
	Chainid string
	Txid    string
	//Submit *submitStatus
	Register interface{}
}

func RegisterSwapStatus

func RegisterSwapStatus(txid string) (*SwapRegisterStatus, error)

RegisterSwapStatus register Swap for ETH like chain

type SwapResult

type SwapResult = mongodb.MgoSwapResult

SwapResult type alias

func GetRawSwapinResult

func GetRawSwapinResult(txid, pairID, bindAddr *string) (*SwapResult, error)

GetRawSwapinResult api

func GetRawSwapoutResult

func GetRawSwapoutResult(txid, pairID, bindAddr *string) (*SwapResult, error)

GetRawSwapoutResult api

type SwapStatistics

type SwapStatistics = mongodb.SwapStatistics

SwapStatistics type alias

func GetSwapStatistics

func GetSwapStatistics(pairID string) (*SwapStatistics, error)

GetSwapStatistics api

type SwapStatus

type SwapStatus = mongodb.SwapStatus

SwapStatus type alias

Jump to

Keyboard shortcuts

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