Documentation
¶
Index ¶
- type BaseResponse
- type Client
- func (c *Client) PreSingleChainQuote(ctx context.Context, in *dexmodel.DexQuoteIn) (*dexmodel.DexQuoteOut, error)
- func (c *Client) Quote(ctx context.Context, in *dexmodel.DexQuoteIn) (*dexmodel.DexQuoteOut, error)
- func (c *Client) Status(ctx context.Context, in *dexmodel.DexCheckTxIn) (*dexmodel.DexCheckTxOut, error)
- func (c *Client) SupportedChains(ctx context.Context) ([]string, error)
- func (c *Client) SupportedCrossChains(ctx context.Context) ([]string, error)
- type CrossChainBuildTxRes
- type CrossChainQuoteRes
- type CrossResData
- type HistoryRes
- type SingleChainQuoteRes
- type SingleChainSwapRes
- type SupportedChainsRes
- type SwapResData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseResponse ¶
type BaseResponse struct {
Code json.RawMessage `json:"code"`
Msg string `json:"msg"`
}
func (*BaseResponse) IsSuccess ¶
func (r *BaseResponse) IsSuccess() bool
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) PreSingleChainQuote ¶
func (c *Client) PreSingleChainQuote(ctx context.Context, in *dexmodel.DexQuoteIn) (*dexmodel.DexQuoteOut, error)
func (*Client) Quote ¶
func (c *Client) Quote(ctx context.Context, in *dexmodel.DexQuoteIn) (*dexmodel.DexQuoteOut, error)
func (*Client) Status ¶
func (c *Client) Status(ctx context.Context, in *dexmodel.DexCheckTxIn) (*dexmodel.DexCheckTxOut, error)
func (*Client) SupportedChains ¶
type CrossChainBuildTxRes ¶
type CrossChainBuildTxRes struct {
BaseResponse
Data []struct {
FromChainIndex string `json:"fromChainIndex"`
ToChainIndex string `json:"toChainIndex"`
FromTokenAmount string `json:"fromTokenAmount"`
ToTokenAmount string `json:"toTokenAmount"`
MinimumReceived string `json:"minimumReceived"`
EstimateTime string `json:"estimateTime"`
EstimateGasFee string `json:"estimateGasFee"`
RouterBridgeName string `json:"routerBridgeName"`
Tx struct {
From string `json:"from"`
To string `json:"to"`
Data string `json:"data"`
Value string `json:"value"`
GasPrice string `json:"gasPrice"`
GasLimit string `json:"gasLimit"`
} `json:"tx"`
} `json:"data"`
}
type CrossChainQuoteRes ¶
type CrossChainQuoteRes struct {
BaseResponse
Data json.RawMessage `json:"data"`
}
type CrossResData ¶
type CrossResData struct {
FromTokenAmount string `json:"fromTokenAmount"`
Router struct {
BridgeId int `json:"bridgeId"`
BridgeName string `json:"bridgeName"`
CrossChainFee string `json:"crossChainFee"`
OtherNativeFee string `json:"otherNativeFee"`
CrossChainFeeTokenAddress string `json:"crossChainFeeTokenAddress"`
} `json:"router"`
ToTokenAmount string `json:"toTokenAmount"`
MinmumReceive string `json:"minmumReceive"`
Tx struct {
Data string `json:"data"`
From string `json:"from"`
To string `json:"to"`
Value float64 `json:"value"`
GasLimit string `json:"gasLimit"`
GasPrice string `json:"gasPrice"`
MaxPriorityFeePerGas string `json:"maxPriorityFeePerGas"`
} `json:"tx"`
}
type HistoryRes ¶
type HistoryRes struct {
BaseResponse
Data struct {
ChainIndex string `json:"chainIndex"`
DexRouter string `json:"dexRouter"`
ErrorMsg string `json:"errorMsg"`
FromAddress string `json:"fromAddress"`
GasLimit string `json:"gasLimit"`
GasPrice string `json:"gasPrice"`
GasUsed string `json:"gasUsed"`
Height string `json:"height"`
Status string `json:"status"` //success,fail,pending
ToAddress string `json:"toAddress"`
TxFee string `json:"txFee"`
TxHash string `json:"txHash"`
} `json:"data"`
}
type SingleChainQuoteRes ¶
type SingleChainQuoteRes struct {
BaseResponse
Data []struct {
ChainIndex string `json:"chainIndex"`
FromTokenAmount string `json:"fromTokenAmount"`
ToTokenAmount string `json:"toTokenAmount"`
EstimateGasFee string `json:"estimateGasFee"`
TradeFee string `json:"tradeFee"`
PriceImpact string `json:"priceImpactPercent"`
FromToken struct {
TokenSymbol string `json:"tokenSymbol"`
TokenContractAddress string `json:"tokenContractAddress"`
Decimal string `json:"decimal"`
TokenUnitPrice string `json:"tokenUnitPrice"`
} `json:"fromToken"`
ToToken struct {
TokenSymbol string `json:"tokenSymbol"`
TokenContractAddress string `json:"tokenContractAddress"`
Decimal string `json:"decimal"`
TokenUnitPrice string `json:"tokenUnitPrice"`
} `json:"toToken"`
SwapMode string `json:"swapMode"`
Router string `json:"router"`
} `json:"data"`
}
type SingleChainSwapRes ¶
type SingleChainSwapRes struct {
BaseResponse
Data json.RawMessage `json:"data"`
}
type SupportedChainsRes ¶
type SupportedChainsRes struct {
BaseResponse
Data []struct {
ChainIndex string `json:"chainIndex"`
ChainName string `json:"chainName"`
DexTokenApproveAddress string `json:"dexTokenApproveAddress"`
} `json:"data"`
}
type SwapResData ¶
type SwapResData struct {
RouterResult struct {
ChainIndex string `json:"chainIndex"`
FromTokenAmount string `json:"fromTokenAmount"`
ToTokenAmount string `json:"toTokenAmount"`
EstimateGasFee string `json:"estimateGasFee"`
TradeFee string `json:"tradeFee"`
} `json:"routerResult"`
Tx struct {
From string `json:"from"`
To string `json:"to"`
Data string `json:"data"`
Value string `json:"value"`
Gas string `json:"gas"`
GasPrice string `json:"gasPrice"`
MinReceiveAmount string `json:"minReceiveAmount"`
} `json:"tx"`
}
Click to show internal directories.
Click to hide internal directories.