|
@@ -1,5 +1,6 @@
|
|
package defi
|
|
package defi
|
|
|
|
|
|
|
|
+//res
|
|
type NetWorkRes struct {
|
|
type NetWorkRes struct {
|
|
Success bool `json:"success" dc:"是否成功"`
|
|
Success bool `json:"success" dc:"是否成功"`
|
|
Data []string `json:"data"`
|
|
Data []string `json:"data"`
|
|
@@ -15,6 +16,42 @@ type MultiplePriceRes struct {
|
|
Prices map[string]Price `json:"prices"`
|
|
Prices map[string]Price `json:"prices"`
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+type PriceHistoricalRes struct {
|
|
|
|
+ Success bool `json:"success" dc:"是否成功"`
|
|
|
|
+ Data HistoricalItems `json:"data"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type PriceHistoricalUnixRes struct {
|
|
|
|
+ Success bool `json:"success" dc:"是否成功"`
|
|
|
|
+ Data HistoricalItems `json:"data"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type TradeTokenRes struct {
|
|
|
|
+ Success bool `json:"success" dc:"是否成功"`
|
|
|
|
+ Data TradeTokenItems `json:"data"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type TradePairRes struct {
|
|
|
|
+ Success bool `json:"success" dc:"是否成功"`
|
|
|
|
+ Data TradePairItems `json:"data"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// items
|
|
|
|
+type HistoricalItems struct {
|
|
|
|
+ Historical []Historical `json:"historicalItems"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type TradeTokenItems struct {
|
|
|
|
+ Items []TradeTokenTransaction `json:"items" dc:"交易项"`
|
|
|
|
+ HasNext bool `json:"hasNext" dc:"是否有更多"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type TradePairItems struct {
|
|
|
|
+ Items []TradePairTransaction `json:"items" dc:"交易项"`
|
|
|
|
+ HasNext bool `json:"hasNext" dc:"是否有更多"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// struct
|
|
type Price struct {
|
|
type Price struct {
|
|
Success bool `json:"success" dc:"是否成功"`
|
|
Success bool `json:"success" dc:"是否成功"`
|
|
Value float64 `json:"value"`
|
|
Value float64 `json:"value"`
|
|
@@ -23,3 +60,81 @@ type Price struct {
|
|
PriceChange24h float64 `json:"priceChange24h"`
|
|
PriceChange24h float64 `json:"priceChange24h"`
|
|
PriceInNative uint32 `json:"priceInNative"`
|
|
PriceInNative uint32 `json:"priceInNative"`
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+type Historical struct {
|
|
|
|
+ UnixTime uint32 `json:"unixTime"`
|
|
|
|
+ Value float64 `json:"value"`
|
|
|
|
+ Address string `json:"address"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type HistoricalUnix struct {
|
|
|
|
+ UpdateUnixTime uint32 `json:"updateUnixTime"`
|
|
|
|
+ Value float64 `json:"value"`
|
|
|
|
+ PriceChange24h string `json:"priceChange24h"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type TradeTokenTransaction struct {
|
|
|
|
+ Quote Amount `json:"quote" dc:"报价"`
|
|
|
|
+ Base Amount `json:"base" dc:"基础"`
|
|
|
|
+ BasePrice *float64 `json:"basePrice" dc:"基础价格"`
|
|
|
|
+ QuotePrice *float64 `json:"quotePrice" dc:"报价价格"`
|
|
|
|
+ TxHash string `json:"txHash" dc:"交易哈希"`
|
|
|
|
+ Source string `json:"source" dc:"来源"`
|
|
|
|
+ BlockUnixTime uint64 `json:"blockUnixTime" dc:"区块时间"`
|
|
|
|
+ TxType string `json:"txType" dc:"交易类型"`
|
|
|
|
+ Owner string `json:"owner" dc:"所有者"`
|
|
|
|
+ Side string `json:"side" dc:"买/卖方向"`
|
|
|
|
+ Alias *string `json:"alias" dc:"别名"`
|
|
|
|
+ PricePair float64 `json:"pricePair" dc:"价格对"`
|
|
|
|
+ From Amount `json:"from" dc:"从"`
|
|
|
|
+ To Amount `json:"to" dc:"到"`
|
|
|
|
+ TokenPrice *float64 `json:"tokenPrice" dc:"代币价格"`
|
|
|
|
+ PoolId string `json:"poolId" dc:"池ID"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type Amount struct {
|
|
|
|
+ Symbol string `json:"symbol" dc:"代币符号"`
|
|
|
|
+ Decimals uint8 `json:"decimals" dc:"小数位数"`
|
|
|
|
+ Address string `json:"address" dc:"代币地址"`
|
|
|
|
+ Amount uint64 `json:"amount" dc:"数量"`
|
|
|
|
+ UiAmount float64 `json:"uiAmount" dc:"可视化数量"`
|
|
|
|
+ Price *float64 `json:"price" dc:"价格"`
|
|
|
|
+ NearestPrice *float64 `json:"nearestPrice" dc:"最接近的价格"`
|
|
|
|
+ ChangeAmount int64 `json:"changeAmount" dc:"变化的数量"`
|
|
|
|
+ UiChangeAmount float64 `json:"uiChangeAmount" dc:"变化的可视化数量"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type TradePairTransaction struct {
|
|
|
|
+ TxHash string `json:"txHash" dc:"交易哈希"`
|
|
|
|
+ Source string `json:"source" dc:"数据来源"`
|
|
|
|
+ BlockUnixTime int64 `json:"blockUnixTime" dc:"区块时间"`
|
|
|
|
+ Address string `json:"address" dc:"地址"`
|
|
|
|
+ Owner string `json:"owner" dc:"拥有者"`
|
|
|
|
+ From struct {
|
|
|
|
+ Symbol string `json:"symbol" dc:"代币符号"`
|
|
|
|
+ Decimals int `json:"decimals" dc:"小数位数"`
|
|
|
|
+ Address string `json:"address" dc:"代币地址"`
|
|
|
|
+ Amount int64 `json:"amount" dc:"数量"`
|
|
|
|
+ Type string `json:"type" dc:"交易类型"`
|
|
|
|
+ TypeSwap string `json:"typeSwap" dc:"交换类型"`
|
|
|
|
+ UiAmount float64 `json:"uiAmount" dc:"用户可读数量"`
|
|
|
|
+ Price *float64 `json:"price" dc:"价格"`
|
|
|
|
+ NearestPrice float64 `json:"nearestPrice" dc:"最近价格"`
|
|
|
|
+ ChangeAmount int64 `json:"changeAmount" dc:"变化数量"`
|
|
|
|
+ UiChangeAmount float64 `json:"uiChangeAmount" dc:"变化的用户可读数量"`
|
|
|
|
+ } `json:"from"`
|
|
|
|
+ To struct {
|
|
|
|
+ Symbol string `json:"symbol" dc:"代币符号"`
|
|
|
|
+ Decimals int `json:"decimals" dc:"小数位数"`
|
|
|
|
+ Address string `json:"address" dc:"代币地址"`
|
|
|
|
+ Amount int64 `json:"amount" dc:"数量"`
|
|
|
|
+ Type string `json:"type" dc:"交易类型"`
|
|
|
|
+ TypeSwap string `json:"typeSwap" dc:"交换类型"`
|
|
|
|
+ FeeInfo *string `json:"feeInfo" dc:"费用信息"`
|
|
|
|
+ UiAmount float64 `json:"uiAmount" dc:"用户可读数量"`
|
|
|
|
+ Price *float64 `json:"price" dc:"价格"`
|
|
|
|
+ NearestPrice float64 `json:"nearestPrice" dc:"最近价格"`
|
|
|
|
+ ChangeAmount int64 `json:"changeAmount" dc:"变化数量"`
|
|
|
|
+ UiChangeAmount float64 `json:"uiChangeAmount" dc:"变化的用户可读数量"`
|
|
|
|
+ } `json:"to"`
|
|
|
|
+}
|