okx

package
v1.8.95 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Buy       []interface{} `json:"buy"`
	Recommend Recommend     `json:"recommend"`
	Sell      []SellItem    `json:"sell"`
}

type DataResponse

type DataResponse struct {
	Code         int    `json:"code"`
	Data         Data   `json:"data"`
	DetailMsg    string `json:"detailMsg"`
	ErrorCode    string `json:"error_code"`
	ErrorMessage string `json:"error_message"`
	Msg          string `json:"msg"`
	RequestID    string `json:"requestId"`
}

type Exchange

type Exchange struct {
	Currency string
	ShopName string
	Price    string
}

type OKX

type OKX struct {
	Client *http.Client
}

func NewOkxExchangeService

func NewOkxExchangeService() *OKX

func (*OKX) GetTop10Exchanges

func (o *OKX) GetTop10Exchanges(baseCurrency, quoteCurrency string, okxPayMethod PayMethod) ([]*Exchange, error)

GetTop10Exchanges 获取前10交易商家的 C2C 汇率 可指定不同的货币和支付方式

func (*OKX) GetUsdtCnyExchangeList

func (o *OKX) GetUsdtCnyExchangeList(okxPayMethod PayMethod) ([]*Exchange, error)

GetUsdtCnyExchangeList 获取usdt到cny的前10个实时汇率结果列表

func (*OKX) GetUsdtCnyRateOnly

func (o *OKX) GetUsdtCnyRateOnly(okxPayMethod PayMethod) decimal.Decimal

GetUsdtCnyRateOnly 获取实时人民币到USDT的汇率

type PayMethod

type PayMethod string
const (
	PayMethodWxPay  PayMethod = "wxPay"
	PayMethodAlipay PayMethod = "alipay"
	PayMethodBank   PayMethod = "bank"
	PayMethodAll    PayMethod = "all"
)

type Recommend

type Recommend struct {
	RecommendedAd interface{} `json:"recommendedAd"`
	UserGroup     int         `json:"userGroup"`
}

type SellItem

type SellItem struct {
	AlreadyTraded             bool        `json:"alreadyTraded"`
	AvailableAmount           string      `json:"availableAmount"`
	BaseCurrency              string      `json:"baseCurrency"`
	Black                     bool        `json:"black"`
	CancelledOrderQuantity    int         `json:"cancelledOrderQuantity"`
	CompletedOrderQuantity    int         `json:"completedOrderQuantity"`
	CompletedRate             string      `json:"completedRate"`
	CreatorType               string      `json:"creatorType"`
	GuideUpgradeKyc           bool        `json:"guideUpgradeKyc"`
	ID                        string      `json:"id"`
	Intention                 bool        `json:"intention"`
	IsInstitution             int         `json:"isInstitution"`
	MaxCompletedOrderQuantity int         `json:"maxCompletedOrderQuantity"`
	MaxUserCreatedDate        int         `json:"maxUserCreatedDate"`
	MerchantID                string      `json:"merchantId"`
	MinCompletedOrderQuantity int         `json:"minCompletedOrderQuantity"`
	MinCompletionRate         string      `json:"minCompletionRate"`
	MinKycLevel               int         `json:"minKycLevel"`
	MinSellOrders             int         `json:"minSellOrders"`
	Mine                      bool        `json:"mine"`
	NickName                  string      `json:"nickName"`
	PaymentMethods            []string    `json:"paymentMethods"`
	PaymentTimeoutMinutes     int         `json:"paymentTimeoutMinutes"`
	PosReviewPercentage       string      `json:"posReviewPercentage"`
	Price                     string      `json:"price"`
	PublicUserID              string      `json:"publicUserId"`
	QuoteCurrency             string      `json:"quoteCurrency"`
	QuoteMaxAmountPerOrder    string      `json:"quoteMaxAmountPerOrder"`
	QuoteMinAmountPerOrder    string      `json:"quoteMinAmountPerOrder"`
	QuoteScale                int         `json:"quoteScale"`
	QuoteSymbol               string      `json:"quoteSymbol"`
	ReceivingAds              bool        `json:"receivingAds"`
	SafetyLimit               bool        `json:"safetyLimit"`
	Side                      string      `json:"side"`
	UserActiveStatusVo        interface{} `json:"userActiveStatusVo"`
	UserType                  string      `json:"userType"`
	VerificationType          int         `json:"verificationType"`
	WhitelistedCountries      []string    `json:"whitelistedCountries"`
}

Jump to

Keyboard shortcuts

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