kucoin

package module
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 23 Imported by: 0

README

Go SDK for KuCoin API

The detailed document https://docs.kucoin.com, in order to receive the latest API change notifications, please Watch this repository.

Latest Version GoDoc Build Status Go Report Card Sourcegraph

Install

go get github.com/Kucoin/kucoin-go-sdk

Usage

Choose environment
Environment BaseUri
Production https://api.kucoin.com(DEFAULT) https://api.kucoin.cc
Sandbox https://openapi-sandbox.kucoin.com
Create ApiService
Note

To reinforce the security of the API, KuCoin upgraded the API key to version 2.0, the validation logic has also been changed. It is recommended to create(https://www.kucoin.com/account/api) and update your API key to version 2.0. The API key of version 1.0 will be still valid until May 1, 2021.

// API key version 2.0
s :=  kucoin.NewApiService( 
	// kucoin.ApiBaseURIOption("https://api.kucoin.com"), 
	kucoin.ApiKeyOption("key"),
	kucoin.ApiSecretOption("secret"),
	kucoin.ApiPassPhraseOption("passphrase"),
	kucoin.ApiKeyVersionOption(ApiKeyVersionV2)
)

// API key version 1.0
s := kucoin.NewApiService( 
	// kucoin.ApiBaseURIOption("https://api.kucoin.com"), 
	kucoin.ApiKeyOption("key"),
	kucoin.ApiSecretOption("secret"),
	kucoin.ApiPassPhraseOption("passphrase"), 
)
// Or add these options into the environmental variable
// Bash: 
// export API_BASE_URI=https://api.kucoin.com
// export API_KEY=key
// export API_SECRET=secret
// export API_PASSPHRASE=passphrase
// export API_KEY_VERSION=2
// s := NewApiServiceFromEnv()
Debug mode & logging
// Require package github.com/sirupsen/logrus
// Debug mode will record the logs of API and WebSocket to files.
// Default values: LogLevel=logrus.DebugLevel, LogDirectory="/tmp"
kucoin.DebugMode = true
// Or export API_DEBUG_MODE=1

// Logging in your code
// kucoin.SetLoggerDirectory("/tmp")
// logrus.SetLevel(logrus.DebugLevel)
logrus.Debugln("I'm a debug message")
Examples

See the test case for more examples.

Example of API without authentication
rsp, err := s.ServerTime()
if err != nil {
    log.Printf("Error: %s", err.Error())
    // Handle error
    return
}

var ts int64
if err := rsp.ReadData(&ts); err != nil {
    // Handle error
    return
}
log.Printf("The server time: %d", ts)
Example of API with authentication
// Without pagination
rsp, err := s.Accounts("", "")
if err != nil {
    // Handle error
    return
}

as := kucoin.AccountsModel{}
if err := rsp.ReadData(&as); err != nil {
    // Handle error
    return
}

for _, a := range as {
    log.Printf("Available balance: %s %s => %s", a.Type, a.Currency, a.Available)
}
// Handle pagination
rsp, err := s.Orders(map[string]string{}, &kucoin.PaginationParam{CurrentPage: 1, PageSize: 10})
if err != nil {
    // Handle error
    return
}

os := kucoin.OrdersModel{}
pa, err := rsp.ReadPaginationData(&os)
if err != nil {
    // Handle error
    return
}
log.Printf("Total num: %d, total page: %d", pa.TotalNum, pa.TotalPage)
for _, o := range os {
    log.Printf("Order: %s, %s, %s", o.Id, o.Type, o.Price)
}
Example of WebSocket feed

Require package gorilla/websocket

go get github.com/gorilla/websocket github.com/pkg/errors
rsp, err := s.WebSocketPublicToken()
if err != nil {
    // Handle error
    return
}

tk := &kucoin.WebSocketTokenModel{}
if err := rsp.ReadData(tk); err != nil {
    // Handle error
    return
}

c := s.NewWebSocketClient(tk)

mc, ec, err := c.Connect()
if err != nil {
    // Handle error
    return
}

ch1 := kucoin.NewSubscribeMessage("/market/ticker:KCS-BTC", false)
ch2 := kucoin.NewSubscribeMessage("/market/ticker:ETH-BTC", false)
uch := kucoin.NewUnsubscribeMessage("/market/ticker:ETH-BTC", false)

if err := c.Subscribe(ch1, ch2); err != nil {
    // Handle error
    return
}

var i = 0
for {
    select {
    case err := <-ec:
        c.Stop() // Stop subscribing the WebSocket feed
        log.Printf("Error: %s", err.Error())
        // Handle error
        return
    case msg := <-mc:
        // log.Printf("Received: %s", kucoin.ToJsonString(m))
        t := &kucoin.TickerLevel1Model{}
        if err := msg.ReadData(t); err != nil {
            log.Printf("Failure to read: %s", err.Error())
            return
        }
        log.Printf("Ticker: %s, %s, %s, %s", msg.Topic, t.Sequence, t.Price, t.Size)
        i++
        if i == 5 {
            log.Println("Unsubscribe ETH-BTC")
            if err = c.Unsubscribe(uch); err != nil {
                log.Printf("Error: %s", err.Error())
                // Handle error
                return
            }
        }
        if i == 10 {
            log.Println("Subscribe ETH-BTC")
            if err = c.Subscribe(ch2); err != nil {
                log.Printf("Error: %s", err.Error())
                // Handle error
                return
            }
        }
        if i == 15 {
            log.Println("Exit subscription")
            c.Stop() // Stop subscribing the WebSocket feed
            return
        }
    }
}
API list
Trade Fee
API Authentication Description
ApiService.BaseFee() YES https://docs.kucoin.com/#basic-user-fee
ApiService.ActualFee() YES https://docs.kucoin.com/#actual-fee-rate-of-the-trading-pair
Stop Order
API Authentication Description
ApiService.CreateStopOrder() YES https://docs.kucoin.com/#place-a-new-order-2
ApiService.CancelStopOrder() YES https://docs.kucoin.com/#cancel-an-order-2
ApiService.CancelStopOrderBy() YES https://docs.kucoin.com/#cancel-orders
ApiService.StopOrder() YES https://docs.kucoin.com/#get-single-order-info
ApiService.StopOrders() YES https://docs.kucoin.com/#list-stop-orders
ApiService.StopOrderByClient() YES https://docs.kucoin.com/#get-single-order-by-clientoid
ApiService.CancelStopOrderByClient() YES https://docs.kucoin.com/#cancel-single-order-by-clientoid-2
Account
API Authentication Description
ApiService.CreateAccount() YES https://docs.kucoin.com/#create-an-account
ApiService.Accounts() YES https://docs.kucoin.com/#list-accounts
ApiService.Account() YES https://docs.kucoin.com/#get-an-account
ApiService.SubAccountUsers() YES https://docs.kucoin.com/#get-user-info-of-all-sub-accounts
ApiService.SubAccounts() YES https://docs.kucoin.com/#get-the-aggregated-balance-of-all-sub-accounts-of-the-current-user
ApiService.SubAccount() YES https://docs.kucoin.com/#get-account-balance-of-a-sub-account
ApiService.AccountLedgers() YES DEPRECATED https://docs.kucoin.com/#get-account-ledgers-deprecated
ApiService.AccountHolds() YES https://docs.kucoin.com/#get-holds
ApiService.InnerTransfer() YES DEPRECATED https://docs.kucoin.com/#inner-transfer
ApiService.InnerTransferV2() YES https://docs.kucoin.com/#inner-transfer
ApiService.SubTransfer() YES DEPRECATED
ApiService.SubTransferV2() YES https://docs.kucoin.com/#transfer-between-master-user-and-sub-user
ApiService.AccountLedgersV2() YES https://docs.kucoin.com/#get-account-ledgers
Deposit
API Authentication Description
ApiService.CreateDepositAddress() YES https://docs.kucoin.com/#create-deposit-address
ApiService.DepositAddresses() YES https://docs.kucoin.com/#get-deposit-address
ApiService.V1Deposits() YES https://docs.kucoin.com/#get-v1-historical-deposits-list
ApiService.Deposits() YES https://docs.kucoin.com/#get-deposit-list
Fill
API Authentication Description
ApiService.Fills() YES https://docs.kucoin.com/#list-fills
ApiService.RecentFills() YES https://docs.kucoin.com/#recent-fills
Order
API Authentication Description
ApiService.CreateOrder() YES https://docs.kucoin.com/#place-a-new-order
ApiService.CreateMultiOrder() YES https://docs.kucoin.com/#place-bulk-orders
ApiService.CancelOrder() YES https://docs.kucoin.com/#cancel-an-order
ApiService.CancelOrders() YES https://docs.kucoin.com/#cancel-all-orders
ApiService.V1Orders() YES https://docs.kucoin.com/#get-v1-historical-orders-list
ApiService.Orders() YES https://docs.kucoin.com/#list-orders
ApiService.Order() YES https://docs.kucoin.com/#get-an-order
ApiService.RecentOrders() YES https://docs.kucoin.com/#recent-orders
ApiService.CreateMarginOrder() YES https://docs.kucoin.com/#place-a-margin-order
ApiService.CancelOrderByClient() YES https://docs.kucoin.com/#cancel-single-order-by-clientoid
ApiService.OrderByClient() YES https://docs.kucoin.com/#get-single-active-order-by-clientoid
WebSocket Feed
API Authentication Description
ApiService.WebSocketPublicToken() NO https://docs.kucoin.com/#apply-connect-token
ApiService.WebSocketPrivateToken() YES https://docs.kucoin.com/#apply-connect-token
ApiService.NewWebSocketClient() - https://docs.kucoin.com/#websocket-feed
Withdrawal
API Authentication Description
ApiService.WithdrawalQuotas() YES https://docs.kucoin.com/#get-withdrawal-quotas
ApiService.V1Withdrawals() YES https://docs.kucoin.com/#get-v1-historical-withdrawals-list
ApiService.Withdrawals() YES https://docs.kucoin.com/#get-withdrawals-list
ApiService.ApplyWithdrawal() YES https://docs.kucoin.com/#apply-withdraw
ApiService.CancelWithdrawal() YES https://docs.kucoin.com/#cancel-withdrawal
Currency
API Authentication Description
ApiService.Currencies() NO https://docs.kucoin.com/#get-currencies
ApiService.Currency() NO https://docs.kucoin.com/#get-currency-detail
ApiService.Prices() NO https://docs.kucoin.com/#get-fiat-price
Symbol
API Authentication Description
ApiService.Symbols() NO https://docs.kucoin.com/#get-symbols-list
ApiService.TickerLevel1() NO https://docs.kucoin.com/#get-ticker
ApiService.Tickers() NO https://docs.kucoin.com/#get-all-tickers
ApiService.AggregatedPartOrderBook() NO https://docs.kucoin.com/#get-part-order-book-aggregated
ApiService.AggregatedFullOrderBook() NO https://docs.kucoin.com/#get-full-order-book-aggregated
ApiService.AtomicFullOrderBook() NO https://docs.kucoin.com/#get-full-order-book-atomic
ApiService.TradeHistories() NO https://docs.kucoin.com/#get-trade-histories
ApiService.KLines() NO https://docs.kucoin.com/#get-klines
ApiService.Stats24hr() NO https://docs.kucoin.com/#get-24hr-stats
ApiService.Markets() NO https://docs.kucoin.com/#get-market-list
Time
API Authentication Description
ApiService.ServerTime() NO https://docs.kucoin.com/#server-time
Service Status
API Authentication Description
ApiService.ServiceStatus() NO https://docs.kucoin.com/#service-status

Run tests

# Add your API configuration items into the environmental variable first
export API_BASE_URI=https://api.kucoin.com
export API_KEY=key
export API_SECRET=secret
export API_PASSPHRASE=passphrase
export API_KEY_VERSION=2

# Run tests
go test -v

License

MIT

Documentation

Overview

Package kucoin provides two kinds of APIs: `RESTful API` and `WebSocket feed`. The official document: https://docs.kucoin.com

Index

Constants

View Source
const (
	WelcomeMessage     = "welcome"
	PingMessage        = "ping"
	PongMessage        = "pong"
	SubscribeMessage   = "subscribe"
	AckMessage         = "ack"
	UnsubscribeMessage = "unsubscribe"
	ErrorMessage       = "error"
	Message            = "message"
	Notice             = "notice"
	Command            = "command"
)

All message types of WebSocket.

View Source
const ApiKeyVersionV1 = "1"

ApiKeyVersionV1 is v1 api key version

View Source
const ApiKeyVersionV2 = "2"

ApiKeyVersionV2 is v2 api key version

View Source
const (
	ApiSuccess = "200000"
)

The predefined API codes

View Source
const ProductionApiBaseURI = "https://api.kucoin.com"

ProductionApiBaseURI is api base uri for production.

Variables

View Source
var (
	// Version is SDK version.
	Version = "1.2.10"
	// DebugMode will record the logs of API and WebSocket to files in the directory "kucoin.LogDirectory" according to the minimum log level "kucoin.LogLevel".
	DebugMode = os.Getenv("API_DEBUG_MODE") == "1"
)

Functions

func IntToString

func IntToString(i int64) string

IntToString converts int64 to string.

func SetLoggerDirectory added in v1.2.13

func SetLoggerDirectory(directory string)

SetLoggerDirectory sets the directory for logrus output.

func ToJsonString

func ToJsonString(v interface{}) string

ToJsonString converts any value to JSON string.

Types

type AccountHoldModel

type AccountHoldModel struct {
	Currency   string `json:"currency"`
	HoldAmount string `json:"holdAmount"`
	BizType    string `json:"bizType"`
	OrderId    string `json:"orderId"`
	CreatedAt  int64  `json:"createdAt"`
	UpdatedAt  int64  `json:"updatedAt"`
}

An AccountHoldModel represents the holds on an account for any active orders or pending withdraw requests. As an order is filled, the hold amount is updated. If an order is canceled, any remaining hold is removed. For a withdraw, once it is completed, the hold is removed.

type AccountHoldsModel

type AccountHoldsModel []*AccountHoldModel

An AccountHoldsModel is the set of *AccountHoldModel.

type AccountLedgerModel added in v1.0.3

type AccountLedgerModel struct {
	ID          string          `json:"id"`
	Currency    string          `json:"currency"`
	Amount      string          `json:"amount"`
	Fee         string          `json:"fee"`
	Balance     string          `json:"balance"`
	AccountType string          `json:"accountType"`
	BizType     string          `json:"bizType"`
	Direction   string          `json:"direction"`
	CreatedAt   int64           `json:"createdAt"`
	Context     json.RawMessage `json:"context"`
}

An AccountLedgerModel represents account activity either increases or decreases your account balance.

type AccountLedgersModel added in v1.0.3

type AccountLedgersModel []*AccountLedgerModel

An AccountLedgersModel the set of *AccountLedgerModel.

type AccountModel

type AccountModel struct {
	Id        string `json:"id"`
	Currency  string `json:"currency"`
	Type      string `json:"type"`
	Balance   string `json:"balance"`
	Available string `json:"available"`
	Holds     string `json:"holds"`
}

An AccountModel represents an account.

type AccountsModel

type AccountsModel []*AccountModel

An AccountsModel is the set of *AccountModel.

type AccountsTransferableModel added in v1.2.13

type AccountsTransferableModel struct {
	Currency     string `json:"currency"`
	Balance      string `json:"balance"`
	Available    string `json:"available"`
	Holds        string `json:"holds"`
	Transferable string `json:"transferable"`
}

AccountsTransferableModel RESPONSES of AccountsTransferable

type ApiResponse

type ApiResponse struct {
	Code    string          `json:"code"`
	RawData json.RawMessage `json:"data"` // delay parsing
	Message string          `json:"msg"`
	// contains filtered or unexported fields
}

An ApiResponse represents a API response wrapped Response.

func (*ApiResponse) ApiSuccessful

func (ar *ApiResponse) ApiSuccessful() bool

ApiSuccessful judges the success of API.

func (*ApiResponse) HttpSuccessful

func (ar *ApiResponse) HttpSuccessful() bool

HttpSuccessful judges the success of http.

func (*ApiResponse) ReadData

func (ar *ApiResponse) ReadData(v interface{}) error

ReadData read the api response `data` as JSON into v.

func (*ApiResponse) ReadPaginationData

func (ar *ApiResponse) ReadPaginationData(v interface{}) (*PaginationModel, error)

ReadPaginationData read the data `items` as JSON into v, and returns *PaginationModel.

type ApiService

type ApiService struct {
	// contains filtered or unexported fields
}

An ApiService provides a HTTP client and a signer to make a HTTP request with the signature to KuCoin API.

func NewApiService

func NewApiService(opts ...ApiServiceOption) *ApiService

NewApiService creates a instance of ApiService by passing ApiServiceOptions, then you can call methods.

func NewApiServiceFromEnv

func NewApiServiceFromEnv() *ApiService

NewApiServiceFromEnv creates a instance of ApiService by environmental variables such as `API_BASE_URI` `API_KEY` `API_SECRET` `API_PASSPHRASE`, then you can call the methods of ApiService.

func (*ApiService) Account

func (as *ApiService) Account(accountId string) (*ApiResponse, error)

Account returns an account when you know the accountId.

func (*ApiService) AccountHolds

func (as *ApiService) AccountHolds(accountId string, pagination *PaginationParam) (*ApiResponse, error)

AccountHolds returns a list of currency hold. Holds are placed on an account for any active orders or pending withdraw requests. As an order is filled, the hold amount is updated. If an order is canceled, any remaining hold is removed. For a withdraw, once it is completed, the hold is removed.

func (*ApiService) AccountLedgers added in v1.0.3

func (as *ApiService) AccountLedgers(accountId string, startAt, endAt int64, options map[string]string, pagination *PaginationParam) (*ApiResponse, error)

AccountLedgers returns a list of ledgers. Deprecated: This interface was discontinued on Nov 05, 2020. Please use AccountLedgersV2. Account activity either increases or decreases your account balance. Items are paginated and sorted latest first. Deprecated

func (*ApiService) AccountLedgersV2 added in v1.2.13

func (as *ApiService) AccountLedgersV2(params map[string]string, pagination *PaginationParam) (*ApiResponse, error)

AccountLedgersV2 returns a list of ledgers. Recommended for use on Nov 05, 2020. Account activity either increases or decreases your account balance. Items are paginated and sorted latest first.

func (*ApiService) Accounts

func (as *ApiService) Accounts(currency, typo string) (*ApiResponse, error)

Accounts returns a list of accounts. See the Deposits section for documentation on how to deposit funds to begin trading.

func (*ApiService) AccountsTransferable added in v1.2.13

func (as *ApiService) AccountsTransferable(currency, typo string) (*ApiResponse, error)

AccountsTransferable returns the transferable balance of a specified account.

func (*ApiService) ActualFee added in v1.2.13

func (as *ApiService) ActualFee(symbols string) (*ApiResponse, error)

ActualFee returns the actual fee rate of the trading pair. You can inquire about fee rates of 10 trading pairs each time at most.

func (*ApiService) AggregatedFullOrderBook

func (as *ApiService) AggregatedFullOrderBook(symbol string) (*ApiResponse, error)

AggregatedFullOrderBook returns a list of open orders(aggregated) for a symbol. Deprecated: Use AggregatedFullOrderBookV3/WebSocket instead.

func (*ApiService) AggregatedFullOrderBookV3 added in v1.2.13

func (as *ApiService) AggregatedFullOrderBookV3(symbol string) (*ApiResponse, error)

AggregatedFullOrderBookV3 returns a list of open orders(aggregated) for a symbol.

func (*ApiService) AggregatedPartOrderBook added in v1.0.3

func (as *ApiService) AggregatedPartOrderBook(symbol string, depth int64) (*ApiResponse, error)

AggregatedPartOrderBook returns a list of open orders(aggregated) for a symbol.

func (*ApiService) ApplyWithdrawal

func (as *ApiService) ApplyWithdrawal(currency, address, amount string, options map[string]string) (*ApiResponse, error)

ApplyWithdrawal applies a withdrawal.

func (*ApiService) AtomicFullOrderBook

func (as *ApiService) AtomicFullOrderBook(symbol string) (*ApiResponse, error)

AtomicFullOrderBook returns a list of open orders for a symbol. Level-3 order book includes all bids and asks (non-aggregated, each item in Level-3 means a single order).

func (*ApiService) AtomicFullOrderBookV2 added in v1.2.13

func (as *ApiService) AtomicFullOrderBookV2(symbol string) (*ApiResponse, error)

AtomicFullOrderBookV2 returns a list of open orders for a symbol. Level-3 order book includes all bids and asks (non-aggregated, each item in Level-3 means a single order).

func (*ApiService) BaseFee added in v1.2.13

func (as *ApiService) BaseFee() (*ApiResponse, error)

BaseFee returns the basic fee rate of users.

func (*ApiService) BorrowOrder added in v1.2.13

func (as *ApiService) BorrowOrder(orderId string) (*ApiResponse, error)

BorrowOrder returns a specific borrow order

func (*ApiService) BorrowOutstandingRecords added in v1.2.13

func (as *ApiService) BorrowOutstandingRecords(currency string, pagination *PaginationParam) (*ApiResponse, error)

BorrowOutstandingRecords returns borrow outstanding records

func (*ApiService) BorrowRepaidRecords added in v1.2.13

func (as *ApiService) BorrowRepaidRecords(currency string, pagination *PaginationParam) (*ApiResponse, error)

BorrowRepaidRecords returns repaid borrow records

func (*ApiService) Call

func (as *ApiService) Call(request *Request) (*ApiResponse, error)

Call calls the API by passing *Request and returns *ApiResponse.

func (*ApiService) CancelLendOrder added in v1.2.13

func (as *ApiService) CancelLendOrder(orderId string) (*ApiResponse, error)

CancelLendOrder cancel a lend order

func (*ApiService) CancelOrder

func (as *ApiService) CancelOrder(orderId string) (*ApiResponse, error)

CancelOrder cancels a previously placed order.

func (*ApiService) CancelOrderByClient added in v1.2.13

func (as *ApiService) CancelOrderByClient(clientOid string) (*ApiResponse, error)

CancelOrderByClient cancels a previously placed order by client ID.

func (*ApiService) CancelOrders

func (as *ApiService) CancelOrders(p map[string]string) (*ApiResponse, error)

CancelOrders cancels all orders of the symbol. With best effort, cancel all open orders. The response is a list of ids of the canceled orders.

func (*ApiService) CancelStopOrder added in v1.2.13

func (as *ApiService) CancelStopOrder(orderId string) (*ApiResponse, error)

CancelStopOrder cancels a previously placed stop-order.

func (*ApiService) CancelStopOrderBy added in v1.2.13

func (as *ApiService) CancelStopOrderBy(params map[string]string) (*ApiResponse, error)

CancelStopOrderBy returns a list your current orders.

func (*ApiService) CancelStopOrderByClient added in v1.2.13

func (as *ApiService) CancelStopOrderByClient(clientOid string, p map[string]string) (*ApiResponse, error)

CancelStopOrderByClient cancels a previously placed stop-order by client ID.

func (*ApiService) CancelWithdrawal

func (as *ApiService) CancelWithdrawal(withdrawalId string) (*ApiResponse, error)

CancelWithdrawal cancels a withdrawal by withdrawalId.

func (*ApiService) CreateAccount

func (as *ApiService) CreateAccount(typo, currency string) (*ApiResponse, error)

CreateAccount creates an account according to type(main|trade) and currency Parameter #1 typo is type of account.

func (*ApiService) CreateBorrowOrder added in v1.2.13

func (as *ApiService) CreateBorrowOrder(params map[string]string) (*ApiResponse, error)

CreateBorrowOrder returns the result of create a borrow order

func (*ApiService) CreateDepositAddress

func (as *ApiService) CreateDepositAddress(currency, chain string) (*ApiResponse, error)

CreateDepositAddress creates a deposit address.

func (*ApiService) CreateLendOrder added in v1.2.13

func (as *ApiService) CreateLendOrder(params map[string]string) (*ApiResponse, error)

CreateLendOrder returns the result of create a lend order

func (*ApiService) CreateMarginOrder added in v1.2.13

func (as *ApiService) CreateMarginOrder(o *CreateOrderModel) (*ApiResponse, error)

CreateMarginOrder places a new margin order.

func (*ApiService) CreateMultiOrder added in v1.2.13

func (as *ApiService) CreateMultiOrder(symbol string, orders []*CreateOrderModel) (*ApiResponse, error)

CreateMultiOrder places bulk orders.

func (*ApiService) CreateOrder

func (as *ApiService) CreateOrder(o *CreateOrderModel) (*ApiResponse, error)

CreateOrder places a new order.

func (*ApiService) CreateStopOrder added in v1.2.13

func (as *ApiService) CreateStopOrder(o *CreateOrderModel) (*ApiResponse, error)

CreateStopOrder places a new stop-order.

func (*ApiService) Currencies

func (as *ApiService) Currencies() (*ApiResponse, error)

Currencies returns a list of known currencies.

func (*ApiService) Currency

func (as *ApiService) Currency(currency string, chain string) (*ApiResponse, error)

Currency returns the details of the currency. Deprecated: Use CurrencyV2 instead.

func (*ApiService) CurrencyV2 added in v1.2.13

func (as *ApiService) CurrencyV2(currency string, chain string) (*ApiResponse, error)

CurrencyV2 returns the details of the currency.

func (*ApiService) CurrentMarkPrice added in v1.2.13

func (as *ApiService) CurrentMarkPrice(symbol string) (*ApiResponse, error)

CurrentMarkPrice returns current mark price of the input symbol

func (*ApiService) DepositAddresses

func (as *ApiService) DepositAddresses(currency, chain string) (*ApiResponse, error)

DepositAddresses returns the deposit address of currency for deposit. If return data is empty, you may need create a deposit address first.

func (*ApiService) DepositAddressesV2 added in v1.2.13

func (as *ApiService) DepositAddressesV2(currency string) (*ApiResponse, error)

DepositAddressesV2 Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to create a deposit address first.

func (*ApiService) Deposits

func (as *ApiService) Deposits(params map[string]string, pagination *PaginationParam) (*ApiResponse, error)

Deposits returns a list of deposit.

func (*ApiService) Fills

func (as *ApiService) Fills(params map[string]string, pagination *PaginationParam) (*ApiResponse, error)

Fills returns a list of recent fills.

func (*ApiService) InnerTransferV2 added in v1.2.13

func (as *ApiService) InnerTransferV2(clientOid, currency, from, to, amount string) (*ApiResponse, error)

InnerTransferV2 makes a currency transfer internally. Recommended for use on June 5, 2019. The inner transfer interface is used for transferring assets between the accounts of a user and is free of charges. For example, a user could transfer assets from their main account to their trading account on the platform.

func (*ApiService) KLines added in v1.0.5

func (as *ApiService) KLines(symbol, typo string, startAt, endAt int64) (*ApiResponse, error)

KLines returns the k lines for a symbol. Data are returned in grouped buckets based on requested type. Parameter #2 typo is the type of candlestick patterns.

func (*ApiService) LendActiveOrders added in v1.2.13

func (as *ApiService) LendActiveOrders(currency string, pagination *PaginationParam) (*ApiResponse, error)

LendActiveOrders returns the active lend orders

func (*ApiService) LendAssets added in v1.2.13

func (as *ApiService) LendAssets(currency string) (*ApiResponse, error)

LendAssets returns account lend assets

func (*ApiService) LendDoneOrders added in v1.2.13

func (as *ApiService) LendDoneOrders(currency string, pagination *PaginationParam) (*ApiResponse, error)

LendDoneOrders returns the history lend orders

func (*ApiService) LendTradeSettledRecords added in v1.2.13

func (as *ApiService) LendTradeSettledRecords(currency string, pagination *PaginationParam) (*ApiResponse, error)

LendTradeSettledRecords returns settled lend records

func (*ApiService) LendTradeUnsettledRecords added in v1.2.13

func (as *ApiService) LendTradeUnsettledRecords(currency string, pagination *PaginationParam) (*ApiResponse, error)

LendTradeUnsettledRecords returns unsettled lend records

func (*ApiService) MarginAccount added in v1.2.13

func (as *ApiService) MarginAccount() (*ApiResponse, error)

MarginAccount returns a margin account information

func (*ApiService) MarginConfig added in v1.2.13

func (as *ApiService) MarginConfig() (*ApiResponse, error)

MarginConfig returns a margin configuration

func (*ApiService) MarginMarkets added in v1.2.13

func (as *ApiService) MarginMarkets(params map[string]string) (*ApiResponse, error)

MarginMarkets returns lending market data

func (*ApiService) MarginRiskLimit added in v1.2.13

func (as *ApiService) MarginRiskLimit(marginModel string) (*ApiResponse, error)

func (*ApiService) MarginTradeLast added in v1.2.13

func (as *ApiService) MarginTradeLast(currency string) (*ApiResponse, error)

MarginTradeLast returns latest lending market trade datas

func (*ApiService) Markets

func (as *ApiService) Markets() (*ApiResponse, error)

Markets returns the transaction currencies for the entire trading market.

func (*ApiService) NewWebSocketClient

func (as *ApiService) NewWebSocketClient(token *WebSocketTokenModel) *WebSocketClient

NewWebSocketClient creates an instance of WebSocketClient.

func (*ApiService) NewWebSocketClientOpts added in v1.2.13

func (as *ApiService) NewWebSocketClientOpts(opts WebSocketClientOpts) *WebSocketClient

NewWebSocketClientOpts creates an instance of WebSocketClient with the parsed options.

func (*ApiService) Order

func (as *ApiService) Order(orderId string) (*ApiResponse, error)

Order returns a single order by order id.

func (*ApiService) OrderByClient added in v1.2.13

func (as *ApiService) OrderByClient(clientOid string) (*ApiResponse, error)

OrderByClient returns a single order by client id.

func (*ApiService) Orders

func (as *ApiService) Orders(params map[string]string, pagination *PaginationParam) (*ApiResponse, error)

Orders returns a list your current orders.

func (*ApiService) Prices added in v1.0.4

func (as *ApiService) Prices(base, currencies string) (*ApiResponse, error)

Prices returns the fiat prices for currency.

func (*ApiService) RecentFills added in v1.0.1

func (as *ApiService) RecentFills() (*ApiResponse, error)

RecentFills returns the recent fills of the latest transactions within 24 hours.

func (*ApiService) RecentOrders added in v1.0.1

func (as *ApiService) RecentOrders() (*ApiResponse, error)

RecentOrders returns the recent orders of the latest transactions within 24 hours.

func (*ApiService) RepayAll added in v1.2.13

func (as *ApiService) RepayAll(params map[string]string) (*ApiResponse, error)

RepayAll repay borrow orders of one currency

func (*ApiService) RepaySingle added in v1.2.13

func (as *ApiService) RepaySingle(params map[string]string) (*ApiResponse, error)

RepaySingle repay a single borrow order

func (*ApiService) ServerTime

func (as *ApiService) ServerTime() (*ApiResponse, error)

ServerTime returns the API server time.

func (*ApiService) ServiceStatus added in v1.2.13

func (as *ApiService) ServiceStatus() (*ApiResponse, error)

ServiceStatus returns the service status.

func (*ApiService) Stats24hr

func (as *ApiService) Stats24hr(symbol string) (*ApiResponse, error)

Stats24hr returns 24 hr stats for the symbol. volume is in base currency units. open, high, low are in quote currency units.

func (*ApiService) StopOrder added in v1.2.13

func (as *ApiService) StopOrder(orderId string) (*ApiResponse, error)

StopOrder returns a single order by stop-order id.

func (*ApiService) StopOrderByClient added in v1.2.13

func (as *ApiService) StopOrderByClient(clientOid string, p map[string]string) (*ApiResponse, error)

StopOrderByClient returns a single stop-order by client id.

func (*ApiService) StopOrders added in v1.2.13

func (as *ApiService) StopOrders(params map[string]string, pagination *PaginationParam) (*ApiResponse, error)

StopOrders returns a list your current orders.

func (*ApiService) SubAccount added in v1.2.13

func (as *ApiService) SubAccount(subUserId string) (*ApiResponse, error)

SubAccount returns the detail of a sub-account.

func (*ApiService) SubAccountUsers added in v1.2.13

func (as *ApiService) SubAccountUsers() (*ApiResponse, error)

SubAccountUsers returns a list of sub-account user.

func (*ApiService) SubAccounts added in v1.2.13

func (as *ApiService) SubAccounts() (*ApiResponse, error)

SubAccounts returns the aggregated balance of all sub-accounts of the current user.

func (*ApiService) SubTransfer added in v1.2.13

func (as *ApiService) SubTransfer(params map[string]string) (*ApiResponse, error)

SubTransfer transfers between master account and sub-account. Deprecated: This interface was discontinued on Oct 28, 2020. Please use SubTransferV2.

func (*ApiService) SubTransferV2 added in v1.2.13

func (as *ApiService) SubTransferV2(params map[string]string) (*ApiResponse, error)

SubTransferV2 transfers between master account and sub-account. Recommended for use on Oct 28, 2020.

func (*ApiService) Symbols

func (as *ApiService) Symbols(market string) (*ApiResponse, error)

Symbols returns a list of available currency pairs for trading.

func (*ApiService) TickerLevel1 added in v1.0.3

func (as *ApiService) TickerLevel1(symbol string) (*ApiResponse, error)

TickerLevel1 returns the ticker include only the inside (i.e. best) bid and ask data, last price and last trade size.

func (*ApiService) Tickers added in v1.0.3

func (as *ApiService) Tickers() (*ApiResponse, error)

Tickers returns all tickers as TickersResponseModel for all trading pairs in the market (including 24h volume).

func (*ApiService) ToggleAutoLend added in v1.2.13

func (as *ApiService) ToggleAutoLend(params map[string]string) (*ApiResponse, error)

ToggleAutoLend set auto lend rules

func (*ApiService) TradeHistories

func (as *ApiService) TradeHistories(symbol string) (*ApiResponse, error)

TradeHistories returns a list the latest trades for a symbol.

func (*ApiService) V1Deposits added in v1.2.13

func (as *ApiService) V1Deposits(params map[string]string, pagination *PaginationParam) (*ApiResponse, error)

V1Deposits returns a list of v1 historical deposits.

func (*ApiService) V1Orders added in v1.2.13

func (as *ApiService) V1Orders(params map[string]string, pagination *PaginationParam) (*ApiResponse, error)

V1Orders returns a list of v1 historical orders.

func (*ApiService) V1Withdrawals added in v1.2.13

func (as *ApiService) V1Withdrawals(params map[string]string, pagination *PaginationParam) (*ApiResponse, error)

V1Withdrawals returns a list of v1 historical withdrawals.

func (*ApiService) WebSocketPrivateToken

func (as *ApiService) WebSocketPrivateToken() (*ApiResponse, error)

WebSocketPrivateToken returns the token for private channel.

func (*ApiService) WebSocketPublicToken

func (as *ApiService) WebSocketPublicToken() (*ApiResponse, error)

WebSocketPublicToken returns the token for public channel.

func (*ApiService) WithdrawalQuotas

func (as *ApiService) WithdrawalQuotas(currency, chain string) (*ApiResponse, error)

WithdrawalQuotas returns the quotas of withdrawal.

func (*ApiService) Withdrawals

func (as *ApiService) Withdrawals(params map[string]string, pagination *PaginationParam) (*ApiResponse, error)

Withdrawals returns a list of withdrawals.

type ApiServiceOption

type ApiServiceOption func(service *ApiService)

An ApiServiceOption is a option parameter to create the instance of ApiService.

func ApiBaseURIOption

func ApiBaseURIOption(uri string) ApiServiceOption

ApiBaseURIOption creates a instance of ApiServiceOption about apiBaseURI.

func ApiKeyOption

func ApiKeyOption(key string) ApiServiceOption

ApiKeyOption creates a instance of ApiServiceOption about apiKey.

func ApiKeyVersionOption added in v1.2.13

func ApiKeyVersionOption(apiKeyVersion string) ApiServiceOption

ApiKeyVersionOption creates a instance of ApiServiceOption about apiKeyVersion.

func ApiPassPhraseOption

func ApiPassPhraseOption(passPhrase string) ApiServiceOption

ApiPassPhraseOption creates a instance of ApiServiceOption about apiPassPhrase.

func ApiRequesterOption added in v1.2.13

func ApiRequesterOption(requester Requester) ApiServiceOption

ApiRequesterOption creates a instance of ApiServiceOption about requester.

func ApiSecretOption

func ApiSecretOption(secret string) ApiServiceOption

ApiSecretOption creates a instance of ApiServiceOption about apiSecret.

func ApiSkipVerifyTlsOption

func ApiSkipVerifyTlsOption(skipVerifyTls bool) ApiServiceOption

ApiSkipVerifyTlsOption creates a instance of ApiServiceOption about apiSkipVerifyTls.

type ApplyWithdrawalResultModel

type ApplyWithdrawalResultModel struct {
	WithdrawalId string `json:"withdrawalId"`
}

ApplyWithdrawalResultModel represents the result of ApplyWithdrawal().

type BaseFeeModel added in v1.2.13

type BaseFeeModel struct {
	TakerFeeRate string `json:"takerFeeRate"`
	MakerFeeRate string `json:"makerFeeRate"`
}

BaseFeeModel RESPONSES of BaseFee endpoint

type BasicRequester

type BasicRequester struct {
	Transport http.RoundTripper
}

A BasicRequester represents a basic implement of Requester by http.Client.

func (*BasicRequester) Request

func (br *BasicRequester) Request(request *Request, timeout time.Duration) (*Response, error)

Request makes a http request.

type BorrowOrderModel added in v1.2.13

type BorrowOrderModel struct {
	OrderId   string      `json:"orderId"`
	Currency  string      `json:"currency"`
	Size      json.Number `json:"size"`
	Filled    json.Number `json:"filled"`
	Status    string      `json:"status"`
	MatchList []struct {
		Currency     string      `json:"currency"`
		DailyIntRate json.Number `json:"dailyIntRate"`
		Size         json.Number `json:"size"`
		Term         json.Number `json:"term"`
		Timestamp    json.Number `json:"timestamp"`
		TradeId      string      `json:"tradeId"`
	} `json:"matchList"`
}

BorrowOrderModel represents a borrow order

type BorrowOutstandingRecordModel added in v1.2.13

type BorrowOutstandingRecordModel struct {
	Currency        string      `json:"currency"`
	TradeId         string      `json:"tradeId"`
	Liability       json.Number `json:"liability"`
	Principal       json.Number `json:"principal"`
	AccruedInterest json.Number `json:"accruedInterest"`
	CreatedAt       json.Number `json:"createdAt"`
	MaturityTime    json.Number `json:"maturityTime"`
	Term            json.Number `json:"term"`
	RepaidSize      json.Number `json:"repaidSize"`
	DailyIntRate    json.Number `json:"dailyIntRate"`
}

BorrowOutstandingRecordModel represents borrow outstanding record

type BorrowOutstandingRecordsModel added in v1.2.13

type BorrowOutstandingRecordsModel []*BorrowOutstandingRecordModel

BorrowOutstandingRecordsModel is a list of *BorrowOutstandingRecordModel

type BorrowRepaidRecordModel added in v1.2.13

type BorrowRepaidRecordModel struct {
	Currency     string      `json:"currency"`
	DailyIntRate json.Number `json:"dailyIntRate"`
	Interest     json.Number `json:"interest"`
	Principal    json.Number `json:"principal"`
	RepaidSize   json.Number `json:"repaidSize"`
	RepayTime    json.Number `json:"repayTime"`
	Term         json.Number `json:"term"`
	TradeId      string      `json:"tradeId"`
}

BorrowRepaidRecordModel represents a repaid borrow record

type BorrowRepaidRecordsModel added in v1.2.13

type BorrowRepaidRecordsModel []*BorrowRepaidRecordModel

BorrowRepaidRecordsModel is a list of *BorrowRepaidRecordModel

type CancelOrderByClientResultModel added in v1.2.13

type CancelOrderByClientResultModel struct {
	CancelledOrderId string `json:"cancelledOrderId"`
	ClientOid        string `json:"clientOid"`
}

A CancelOrderByClientResultModel represents the result of CancelOrderByClient().

type CancelOrderResultModel

type CancelOrderResultModel struct {
	CancelledOrderIds []string `json:"cancelledOrderIds"`
}

A CancelOrderResultModel represents the result of CancelOrder().

type CancelStopOrderByClientModel added in v1.2.13

type CancelStopOrderByClientModel struct {
	CancelledOrderId string `json:"cancelledOrderId"`
	ClientOid        string `json:"clientOid"`
}

CancelStopOrderByClientModel returns Model of CancelStopOrderByClient API

type CancelWithdrawalResultModel

type CancelWithdrawalResultModel struct {
	CancelledWithdrawIds []string `json:"cancelledWithdrawIds"`
}

CancelWithdrawalResultModel represents the result of CancelWithdrawal().

type ChainsModel added in v1.2.13

type ChainsModel struct {
	ChainName         string `json:"chainName"`
	WithdrawalMinSize string `json:"withdrawalMinSize"`
	WithdrawalMinFee  string `json:"withdrawalMinFee"`
	IsWithdrawEnabled bool   `json:"isWithdrawEnabled"`
	IsDepositEnabled  bool   `json:"isDepositEnabled"`
	Confirms          int64  `json:"confirms"`
	ContractAddress   string `json:"contractAddress"`
}

ChainsModel Chains Model

type CreateAccountModel added in v1.2.13

type CreateAccountModel struct {
	Id string `json:"id"`
}

CreateAccountModel represents The account id returned from creating an account

type CreateBorrowOrderResultModel added in v1.2.13

type CreateBorrowOrderResultModel struct {
	OrderId  string `json:"orderId"`
	Currency string `json:"currency"`
}

CreateBorrowOrderResultModel represents the result of create a borrow order

type CreateLendOrderResultModel added in v1.2.13

type CreateLendOrderResultModel struct {
	OrderId string `json:"orderId"`
}

CreateLendOrderResultModel the result of create a lend order

type CreateMultiOrderResultModel added in v1.2.13

type CreateMultiOrderResultModel struct {
	Data OrdersModel `json:"data"`
}

A CreateMultiOrderResultModel represents the result of CreateMultiOrder().

type CreateOrderModel added in v1.2.13

type CreateOrderModel struct {
	// BASE PARAMETERS
	ClientOid string `json:"clientOid"`
	Side      string `json:"side"`
	Symbol    string `json:"symbol,omitempty"`
	Type      string `json:"type,omitempty"`
	Remark    string `json:"remark,omitempty"`
	Stop      string `json:"stop,omitempty"`
	StopPrice string `json:"stopPrice,omitempty"`
	STP       string `json:"stp,omitempty"`
	TradeType string `json:"tradeType,omitempty"`

	// LIMIT ORDER PARAMETERS
	Price       string `json:"price,omitempty"`
	Size        string `json:"size,omitempty"`
	TimeInForce string `json:"timeInForce,omitempty"`
	CancelAfter int64  `json:"cancelAfter,omitempty"`
	PostOnly    bool   `json:"postOnly,omitempty"`
	Hidden      bool   `json:"hidden,omitempty"`
	IceBerg     bool   `json:"iceberg,omitempty"`
	VisibleSize string `json:"visibleSize,omitempty"`

	// MARKET ORDER PARAMETERS
	// Size  string `json:"size"`
	Funds string `json:"funds,omitempty"`

	// MARGIN ORDER PARAMETERS
	MarginMode string `json:"marginMode,omitempty"`
	AutoBorrow bool   `json:"autoBorrow,omitempty"`
}

A CreateOrderModel is the input parameter of CreateOrder().

type CreateOrderResultModel

type CreateOrderResultModel struct {
	OrderId string `json:"orderId"`
}

A CreateOrderResultModel represents the result of CreateOrder().

type CurrenciesModel

type CurrenciesModel []*CurrencyModel

A CurrenciesModel is the set of *CurrencyModel.

type CurrencyModel

type CurrencyModel struct {
	Name              string `json:"name"`
	Currency          string `json:"currency"`
	FullName          string `json:"fullName"`
	Precision         uint8  `json:"precision"`
	Confirms          int64  `json:"confirms"`
	ContractAddress   string `json:"contractAddress"`
	WithdrawalMinSize string `json:"withdrawalMinSize"`
	WithdrawalMinFee  string `json:"withdrawalMinFee"`
	IsWithdrawEnabled bool   `json:"isWithdrawEnabled"`
	IsDepositEnabled  bool   `json:"isDepositEnabled"`
	IsMarginEnabled   bool   `json:"isMarginEnabled"`
	IsDebitEnabled    bool   `json:"isDebitEnabled"`
}

A CurrencyModel represents a model of known currency.

type CurrencyV2Model added in v1.2.13

type CurrencyV2Model struct {
	Name            string         `json:"name"`
	Currency        string         `json:"currency"`
	FullName        string         `json:"fullName"`
	Precision       uint8          `json:"precision"`
	Confirms        int64          `json:"confirms"`
	ContractAddress string         `json:"contractAddress"`
	IsMarginEnabled bool           `json:"isMarginEnabled"`
	IsDebitEnabled  bool           `json:"isDebitEnabled"`
	Chains          []*ChainsModel `json:"chains"`
}

CurrencyV2Model CurrencyV2 Model

type DepositAddressModel

type DepositAddressModel struct {
	Address string `json:"address"`
	Memo    string `json:"memo"`
	Chain   string `json:"chain"`
}

A DepositAddressModel represents a deposit address of currency for deposit.

type DepositAddressesModel

type DepositAddressesModel DepositAddressModel

A DepositAddressesModel is the set of *DepositAddressModel.

type DepositAddressesV2Model added in v1.2.13

type DepositAddressesV2Model []*depositAddressV2Model

type DepositModel

type DepositModel struct {
	Address    string `json:"address"`
	Memo       string `json:"memo"`
	Amount     string `json:"amount"`
	Fee        string `json:"fee"`
	Currency   string `json:"currency"`
	IsInner    bool   `json:"isInner"`
	WalletTxId string `json:"walletTxId"`
	Status     string `json:"status"`
	Remark     string `json:"remark"`
	CreatedAt  int64  `json:"createdAt"`
	UpdatedAt  int64  `json:"updatedAt"`
}

A DepositModel represents a deposit record.

type DepositsModel

type DepositsModel []*DepositModel

A DepositsModel is the set of *DepositModel.

type FillModel

type FillModel struct {
	Symbol         string `json:"symbol"`
	TradeId        string `json:"tradeId"`
	OrderId        string `json:"orderId"`
	CounterOrderId string `json:"counterOrderId"`
	Side           string `json:"side"`
	Liquidity      string `json:"liquidity"`
	ForceTaker     bool   `json:"forceTaker"`
	Price          string `json:"price"`
	Size           string `json:"size"`
	Funds          string `json:"funds"`
	Fee            string `json:"fee"`
	FeeRate        string `json:"feeRate"`
	FeeCurrency    string `json:"feeCurrency"`
	Stop           string `json:"stop"`
	Type           string `json:"type"`
	CreatedAt      int64  `json:"createdAt"`
	TradeType      string `json:"tradeType"`
}

A FillModel represents the structure of fill.

type FillsModel

type FillsModel []*FillModel

A FillsModel is the set of *FillModel.

type FullOrderBookModel

type FullOrderBookModel struct {
	Sequence string     `json:"sequence"`
	Time     int64      `json:"time"`
	Bids     [][]string `json:"bids"`
	Asks     [][]string `json:"asks"`
}

A FullOrderBookModel represents a list of open orders for a symbol, with full depth.

type FullOrderBookV2Model added in v1.2.13

type FullOrderBookV2Model struct {
	Sequence int64           `json:"sequence"`
	Time     int64           `json:"time"`
	Bids     [][]interface{} `json:"bids"`
	Asks     [][]interface{} `json:"asks"`
}

A FullOrderBookV2Model represents a list of open orders for a symbol, with full depth.

type InnerTransferResultModel added in v1.2.13

type InnerTransferResultModel struct {
	OrderId string `json:"orderId"`
}

An InnerTransferResultModel represents the result of a inner-transfer operation.

type KLineModel added in v1.0.5

type KLineModel []string

KLineModel represents the k lines for a symbol. Rates are returned in grouped buckets based on requested type.

type KLinesModel added in v1.0.5

type KLinesModel []*KLineModel

A KLinesModel is the set of *KLineModel.

type KcSigner

type KcSigner struct {
	Sha256Signer
	// contains filtered or unexported fields
}

KcSigner is the implement of Signer for KuCoin.

func NewKcSigner

func NewKcSigner(key, secret, passPhrase string) *KcSigner

NewKcSigner creates a instance of KcSigner.

func NewKcSignerV2 added in v1.2.13

func NewKcSignerV2(key, secret, passPhrase string) *KcSigner

NewKcSignerV2 creates a instance of KcSigner.

func (*KcSigner) Headers

func (ks *KcSigner) Headers(plain string) map[string]string

Headers returns a map of signature header.

func (*KcSigner) Sign

func (ks *KcSigner) Sign(plain []byte) []byte

Sign makes a signature by sha256 with `apiKey` `apiSecret` `apiPassPhrase`.

type LendActiveOrderModel added in v1.2.13

type LendActiveOrderModel struct {
	LendOrderBaseModel
}

LendActiveOrderModel represents a active lend order

type LendActiveOrdersModel added in v1.2.13

type LendActiveOrdersModel []*LendActiveOrderModel

LendActiveOrdersModel is a list of *LendActiveOrderModel

type LendAssetModel added in v1.2.13

type LendAssetModel struct {
	Currency        string      `json:"currency"`
	Outstanding     json.Number `json:"outstanding"`
	FilledSize      json.Number `json:"filledSize"`
	AccruedInterest json.Number `json:"accruedInterest"`
	RealizedProfit  json.Number `json:"realizedProfit"`
	IsAutoLend      bool        `json:"isAutoLend"`
}

LendAssetModel represents account lend asset

type LendAssetsModel added in v1.2.13

type LendAssetsModel []*LendAssetModel

LendAssetsModel is a list of *LendAssetModel

type LendDoneOrderModel added in v1.2.13

type LendDoneOrderModel struct {
	LendOrderBaseModel
	Status string `json:"status"`
}

LendDoneOrderModel represents a history lend order

type LendDoneOrdersModel added in v1.2.13

type LendDoneOrdersModel []*LendDoneOrderModel

LendDoneOrdersModel is a list of *LendDoneOrderModel

type LendOrderBaseModel added in v1.2.13

type LendOrderBaseModel struct {
	OrderId      string      `json:"orderId"`
	Currency     string      `json:"currency"`
	Size         json.Number `json:"size"`
	FilledSize   json.Number `json:"filledSize"`
	DailyIntRate json.Number `json:"dailyIntRate"`
	Term         json.Number `json:"term"`
	CreatedAt    json.Number `json:"createdAt"`
}

LendOrderBaseModel represents Base model of lend order

type LendTradeSettledRecordModel added in v1.2.13

type LendTradeSettledRecordModel struct {
	TradeId      string      `json:"tradeId"`
	Currency     string      `json:"currency"`
	Size         json.Number `json:"size"`
	Interest     json.Number `json:"interest"`
	Repaid       json.Number `json:"repaid"`
	DailyIntRate json.Number `json:"dailyIntRate"`
	Term         json.Number `json:"term"`
	SettledAt    json.Number `json:"settledAt"`
	Note         string      `json:"note"`
}

LendTradeSettledRecordModel represents a settled lend record

type LendTradeSettledRecordsModel added in v1.2.13

type LendTradeSettledRecordsModel []*LendTradeSettledRecordModel

LendTradeSettledRecordsModel is a list of *LendTradeSettledRecordModel

type LendTradeUnsettledRecordModel added in v1.2.13

type LendTradeUnsettledRecordModel struct {
	TradeId         string      `json:"tradeId"`
	Currency        string      `json:"currency"`
	Size            json.Number `json:"size"`
	AccruedInterest json.Number `json:"accruedInterest"`
	Repaid          json.Number `json:"repaid"`
	DailyIntRate    json.Number `json:"dailyIntRate"`
	Term            json.Number `json:"term"`
	MaturityTime    json.Number `json:"maturityTime"`
}

LendTradeUnsettledRecordModel represents a unsettled lend record

type LendTradeUnsettledRecordsModel added in v1.2.13

type LendTradeUnsettledRecordsModel []*LendTradeUnsettledRecordModel

LendTradeUnsettledRecordsModel is a list of *LendTradeUnsettledRecordModel

type MarginAccountModel added in v1.2.13

type MarginAccountModel struct {
	Accounts []struct {
		AvailableBalance json.Number `json:"availableBalance"`
		Currency         string      `json:"currency"`
		HoldBalance      json.Number `json:"holdBalance"`
		Liability        json.Number `json:"liability"`
		MaxBorrowSize    json.Number `json:"maxBorrowSize"`
		TotalBalance     json.Number `json:"totalBalance"`
	} `json:"accounts"`
	DebtRatio json.Number `json:"debtRatio"`
}

MarginAccountModel represents a margin account information

type MarginConfigModel added in v1.2.13

type MarginConfigModel struct {
	CurrencyList     []string    `json:"currencyList"`
	WarningDebtRatio json.Number `json:"warningDebtRatio"`
	LiqDebtRatio     json.Number `json:"liqDebtRatio"`
	MaxLeverage      json.Number `json:"maxLeverage"`
}

MarginConfigModel represents a margin configuration

type MarginMarketModel added in v1.2.13

type MarginMarketModel struct {
	DailyIntRate json.Number `json:"dailyIntRate"`
	Term         json.Number `json:"term"`
	Size         json.Number `json:"size"`
}

MarginMarketModel represents lending market data

type MarginMarketsModel added in v1.2.13

type MarginMarketsModel []*MarginMarketModel

MarginMarketsModel is a list of *MarginMarketModel

type MarginRiskLimitItemModel added in v1.2.13

type MarginRiskLimitItemModel struct {
	Currency        string      `json:"currency"`
	BorrowMaxAmount string      `json:"borrowMaxAmount"`
	BuyMaxAmount    string      `json:"buyMaxAmount"`
	Precision       json.Number `json:"precision"`
}

MarginRiskLimitItemModel is item of *MarginRiskLimitModel

type MarginRiskLimitModel added in v1.2.13

type MarginRiskLimitModel []*MarginRiskLimitItemModel

MarginRiskLimitModel is a list of *MarginRiskLimitModel

type MarginTradeModel added in v1.2.13

type MarginTradeModel struct {
	TradeId      string      `json:"tradeId"`
	Currency     string      `json:"currency"`
	Size         json.Number `json:"size"`
	DailyIntRate json.Number `json:"dailyIntRate"`
	Term         json.Number `json:"term"`
	Timestamp    json.Number `json:"timestamp"`
}

MarginTradeModel represents lending market trade data

type MarginTradesModel added in v1.2.13

type MarginTradesModel []*MarginTradeModel

MarginTradesModel is a list of *MarginTradeModel

type MarkPriceModel added in v1.2.13

type MarkPriceModel struct {
	Symbol      string      `json:"symbol"`
	Granularity json.Number `json:"granularity"`
	TimePoint   json.Number `json:"timePoint"`
	Value       json.Number `json:"value"`
}

MarkPriceModel represents mark price of a symbol

type MarketsModel added in v1.2.13

type MarketsModel []string

MarketsModel returns Model of Markets API.

type OrderModel

type OrderModel struct {
	Id            string `json:"id"`
	Symbol        string `json:"symbol"`
	OpType        string `json:"opType"`
	Type          string `json:"type"`
	Side          string `json:"side"`
	Price         string `json:"price"`
	Size          string `json:"size"`
	Funds         string `json:"funds"`
	DealFunds     string `json:"dealFunds"`
	DealSize      string `json:"dealSize"`
	Fee           string `json:"fee"`
	FeeCurrency   string `json:"feeCurrency"`
	Stp           string `json:"stp"`
	Stop          string `json:"stop"`
	StopTriggered bool   `json:"stopTriggered"`
	StopPrice     string `json:"stopPrice"`
	TimeInForce   string `json:"timeInForce"`
	PostOnly      bool   `json:"postOnly"`
	Hidden        bool   `json:"hidden"`
	IceBerg       bool   `json:"iceberg"`
	VisibleSize   string `json:"visibleSize"`
	CancelAfter   int64  `json:"cancelAfter"`
	Channel       string `json:"channel"`
	ClientOid     string `json:"clientOid"`
	Remark        string `json:"remark"`
	Tags          string `json:"tags"`
	IsActive      bool   `json:"isActive"`
	CancelExist   bool   `json:"cancelExist"`
	CreatedAt     int64  `json:"createdAt"`
	TradeType     string `json:"tradeType"`
}

An OrderModel represents an order.

type OrdersModel

type OrdersModel []*OrderModel

A OrdersModel is the set of *OrderModel.

type PaginationModel

type PaginationModel struct {
	CurrentPage int64           `json:"currentPage"`
	PageSize    int64           `json:"pageSize"`
	TotalNum    int64           `json:"totalNum"`
	TotalPage   int64           `json:"totalPage"`
	RawItems    json.RawMessage `json:"items"` // delay parsing
}

A PaginationModel represents the pagination in a response.

func (*PaginationModel) ReadItems

func (p *PaginationModel) ReadItems(v interface{}) error

ReadItems read the `items` into v.

type PaginationParam

type PaginationParam struct {
	CurrentPage int64
	PageSize    int64
}

A PaginationParam represents the pagination parameters `currentPage` `pageSize` in a request .

func (*PaginationParam) ReadParam

func (p *PaginationParam) ReadParam(params map[string]string)

ReadParam read pagination parameters into params.

type PartOrderBookModel

type PartOrderBookModel struct {
	Sequence string     `json:"sequence"`
	Time     int64      `json:"time"`
	Bids     [][]string `json:"bids"`
	Asks     [][]string `json:"asks"`
}

A PartOrderBookModel represents a list of open orders for a symbol, a part of Order Book within 100 depth for each side(ask or bid).

type PricesModel added in v1.2.13

type PricesModel map[string]string

type Request

type Request struct {
	BaseURI       string
	Method        string
	Path          string
	Query         url.Values
	Body          []byte
	Header        http.Header
	Timeout       time.Duration
	SkipVerifyTls bool
	// contains filtered or unexported fields
}

A Request represents a HTTP request.

func NewRequest

func NewRequest(method, path string, params interface{}) *Request

NewRequest creates a instance of Request.

func (*Request) FullURL

func (r *Request) FullURL() string

FullURL returns the full url.

func (*Request) HttpRequest

func (r *Request) HttpRequest() (*http.Request, error)

HttpRequest creates a instance of *http.Request.

func (*Request) RequestURI

func (r *Request) RequestURI() string

RequestURI returns the request uri.

type Requester

type Requester interface {
	Request(request *Request, timeout time.Duration) (*Response, error)
}

Requester contains Request() method, can launch a http request.

type Response

type Response struct {
	*http.Response
	// contains filtered or unexported fields
}

A Response represents a HTTP response.

func NewResponse added in v1.2.13

func NewResponse(
	request *Request,
	response *http.Response,
	body []byte,
) *Response

NewResponse Creates a new Response

func (*Response) ReadBody

func (r *Response) ReadBody() ([]byte, error)

ReadBody read the response data, then return it.

func (*Response) ReadJsonBody

func (r *Response) ReadJsonBody(v interface{}) error

ReadJsonBody read the response data as JSON into v.

type ServerTimeModel added in v1.2.13

type ServerTimeModel int64

type ServiceStatusModel added in v1.2.13

type ServiceStatusModel struct {
	Status string `json:"status"`
	Msg    string `json:"msg"`
}

A ServiceStatusModel represents the structure of service status.

type Sha256Signer

type Sha256Signer struct {
	// contains filtered or unexported fields
}

Sha256Signer is the sha256 Signer.

func (*Sha256Signer) Sign

func (ss *Sha256Signer) Sign(plain []byte) []byte

Sign makes a signature by sha256.

type Signer

type Signer interface {
	Sign(plain []byte) []byte
}

Signer interface contains Sign() method.

type Stats24hrModel

type Stats24hrModel struct {
	Time             int64  `json:"time"`
	Symbol           string `json:"symbol"`
	Buy              string `json:"buy"`
	Sell             string `json:"sell"`
	ChangeRate       string `json:"changeRate"`
	ChangePrice      string `json:"changePrice"`
	High             string `json:"high"`
	Low              string `json:"low"`
	Vol              string `json:"vol"`
	VolValue         string `json:"volValue"`
	Last             string `json:"last"`
	AveragePrice     string `json:"averagePrice"`
	TakerFeeRate     string `json:"takerFeeRate"`
	MakerFeeRate     string `json:"makerFeeRate"`
	TakerCoefficient string `json:"takerCoefficient"`
	MakerCoefficient string `json:"makerCoefficient"`
}

A Stats24hrModel represents 24 hr stats for the symbol. Volume is in base currency units. Open, high, low are in quote currency units.

type StopOrderListModel added in v1.2.13

type StopOrderListModel []*StopOrderModel

StopOrderListModel StopOrderByClient model

type StopOrderModel added in v1.2.13

type StopOrderModel struct {
	Id              string `json:"id"`
	Symbol          string `json:"symbol"`
	UserId          string `json:"userId"`
	Status          string `json:"status"`
	Type            string `json:"type"`
	Side            string `json:"side"`
	Price           string `json:"price"`
	Size            string `json:"size"`
	Funds           string `json:"funds"`
	Stp             string `json:"stp"`
	TimeInForce     string `json:"timeInForce"`
	CancelAfter     int64  `json:"cancelAfter"`
	PostOnly        bool   `json:"postOnly"`
	Hidden          bool   `json:"hidden"`
	IceBerg         bool   `json:"iceberg"`
	VisibleSize     string `json:"visibleSize"`
	Channel         string `json:"channel"`
	ClientOid       string `json:"clientOid"`
	Remark          string `json:"remark"`
	Tags            string `json:"tags"`
	OrderTime       int64  `json:"orderTime"`
	DomainId        string `json:"domainId"`
	TradeSource     string `json:"tradeSource"`
	TradeType       string `json:"tradeType"`
	FeeCurrency     string `json:"feeCurrency"`
	TakerFeeRate    string `json:"takerFeeRate"`
	MakerFeeRate    string `json:"makerFeeRate"`
	CreatedAt       int64  `json:"createdAt"`
	Stop            string `json:"stop"`
	StopTriggerTime string `json:"stopTriggerTime"`
	StopPrice       string `json:"stopPrice"`
}

StopOrderModel RESPONSES of StopOrder

type SubAccountModel added in v1.2.13

type SubAccountModel struct {
	SubUserId    string `json:"subUserId"`
	SubName      string `json:"subName"`
	MainAccounts []struct {
		Currency          string `json:"currency"`
		Balance           string `json:"balance"`
		Available         string `json:"available"`
		Holds             string `json:"holds"`
		BaseCurrency      string `json:"baseCurrency"`
		BaseCurrencyPrice string `json:"baseCurrencyPrice"`
		BaseAmount        string `json:"baseAmount"`
	} `json:"mainAccounts"`
	TradeAccounts []struct {
		Currency          string `json:"currency"`
		Balance           string `json:"balance"`
		Available         string `json:"available"`
		Holds             string `json:"holds"`
		BaseCurrency      string `json:"baseCurrency"`
		BaseCurrencyPrice string `json:"baseCurrencyPrice"`
		BaseAmount        string `json:"baseAmount"`
	} `json:"tradeAccounts"`
	MarginAccounts []struct {
		Currency          string `json:"currency"`
		Balance           string `json:"balance"`
		Available         string `json:"available"`
		Holds             string `json:"holds"`
		BaseCurrency      string `json:"baseCurrency"`
		BaseCurrencyPrice string `json:"baseCurrencyPrice"`
		BaseAmount        string `json:"baseAmount"`
	} `json:"marginAccounts"`
}

A SubAccountModel represents the balance of a sub-account user.

type SubAccountUserModel added in v1.2.13

type SubAccountUserModel struct {
	UserId  string `json:"userId"`
	SubName string `json:"subName"`
	Remarks string `json:"remarks"`
	Type    int    `json:"type"`
}

A SubAccountUserModel represents a sub-account user.

type SubAccountUsersModel added in v1.2.13

type SubAccountUsersModel []*SubAccountUserModel

A SubAccountUsersModel is the set of *SubAccountUserModel.

type SubAccountsModel added in v1.2.13

type SubAccountsModel []*SubAccountModel

A SubAccountsModel is the set of *SubAccountModel.

type SubTransferResultModel added in v1.2.13

type SubTransferResultModel InnerTransferResultModel

A SubTransferResultModel represents the result of a sub-transfer operation.

type SymbolModel

type SymbolModel struct {
	Symbol          string `json:"symbol"`
	Name            string `json:"name"`
	BaseCurrency    string `json:"baseCurrency"`
	QuoteCurrency   string `json:"quoteCurrency"`
	Market          string `json:"market"`
	BaseMinSize     string `json:"baseMinSize"`
	QuoteMinSize    string `json:"quoteMinSize"`
	BaseMaxSize     string `json:"baseMaxSize"`
	QuoteMaxSize    string `json:"quoteMaxSize"`
	BaseIncrement   string `json:"baseIncrement"`
	QuoteIncrement  string `json:"quoteIncrement"`
	PriceIncrement  string `json:"priceIncrement"`
	FeeCurrency     string `json:"feeCurrency"`
	EnableTrading   bool   `json:"enableTrading"`
	IsMarginEnabled bool   `json:"isMarginEnabled"`
	PriceLimitRate  string `json:"priceLimitRate"`
}

A SymbolModel represents an available currency pairs for trading.

type SymbolsModel

type SymbolsModel []*SymbolModel

A SymbolsModel is the set of *SymbolModel.

type TickerLevel1Model added in v1.0.3

type TickerLevel1Model struct {
	Sequence    string `json:"sequence"`
	Price       string `json:"price"`
	Size        string `json:"size"`
	BestBid     string `json:"bestBid"`
	BestBidSize string `json:"bestBidSize"`
	BestAsk     string `json:"bestAsk"`
	BestAskSize string `json:"bestAskSize"`
	Time        int64  `json:"time"`
}

A TickerLevel1Model represents ticker include only the inside (i.e. best) bid and ask data, last price and last trade size.

type TickerModel

type TickerModel struct {
	Symbol           string `json:"symbol"`
	SymbolName       string `json:"symbolName"`
	Buy              string `json:"buy"`
	Sell             string `json:"sell"`
	ChangeRate       string `json:"changeRate"`
	ChangePrice      string `json:"changePrice"`
	High             string `json:"high"`
	Low              string `json:"low"`
	Vol              string `json:"vol"`
	VolValue         string `json:"volValue"`
	Last             string `json:"last"`
	AveragePrice     string `json:"averagePrice"`
	TakerFeeRate     string `json:"takerFeeRate"`
	MakerFeeRate     string `json:"makerFeeRate"`
	TakerCoefficient string `json:"takerCoefficient"`
	MakerCoefficient string `json:"makerCoefficient"`
}

A TickerModel represents a market ticker for all trading pairs in the market (including 24h volume).

type TickersModel added in v1.0.3

type TickersModel []*TickerModel

A TickersModel is the set of *MarketTickerModel.

type TickersResponseModel added in v1.0.3

type TickersResponseModel struct {
	Time    int64        `json:"time"`
	Tickers TickersModel `json:"ticker"`
}

TickersResponseModel represents the response model of MarketTickers().

type TradeFeesResultModel added in v1.2.13

type TradeFeesResultModel []struct {
	Symbol       string `json:"symbol"`
	TakerFeeRate string `json:"takerFeeRate"`
	MakerFeeRate string `json:"makerFeeRate"`
}

type TradeHistoriesModel

type TradeHistoriesModel []*TradeHistoryModel

A TradeHistoriesModel is the set of *TradeHistoryModel.

type TradeHistoryModel

type TradeHistoryModel struct {
	Sequence string `json:"sequence"`
	Price    string `json:"price"`
	Size     string `json:"size"`
	Side     string `json:"side"`
	Time     int64  `json:"time"`
}

A TradeHistoryModel represents a the latest trades for a symbol.

type V1DepositModel added in v1.2.13

type V1DepositModel struct {
	Amount     string `json:"amount"`
	Currency   string `json:"currency"`
	IsInner    bool   `json:"isInner"`
	WalletTxId string `json:"walletTxId"`
	Status     string `json:"status"`
	CreateAt   int64  `json:"createAt"`
}

A V1DepositModel represents a v1 deposit record.

type V1DepositsModel added in v1.2.13

type V1DepositsModel []*V1DepositModel

A V1DepositsModel is the set of *V1DepositModel.

type V1OrderModel added in v1.2.13

type V1OrderModel struct {
	Symbol    string `json:"symbol"`
	DealPrice string `json:"dealPrice"`
	DealValue string `json:"dealValue"`
	Amount    string `json:"amount"`
	Fee       string `json:"fee"`
	Side      string `json:"side"`
	CreatedAt int64  `json:"createdAt"`
}

A V1OrderModel represents a v1 order.

type V1OrdersModel added in v1.2.13

type V1OrdersModel []*V1OrderModel

A V1OrdersModel is the set of *V1OrderModel.

type V1WithdrawalModel added in v1.2.13

type V1WithdrawalModel struct {
	Address    string `json:"address"`
	Amount     string `json:"amount"`
	Currency   string `json:"currency"`
	IsInner    bool   `json:"isInner"`
	WalletTxId string `json:"walletTxId"`
	Status     string `json:"status"`
	CreateAt   int64  `json:"createAt"`
}

A V1WithdrawalModel represents a v1 historical withdrawal.

type V1WithdrawalsModel added in v1.2.13

type V1WithdrawalsModel []*V1WithdrawalModel

A V1WithdrawalsModel is the set of *V1WithdrawalModel.

type WebSocketClient

type WebSocketClient struct {
	// contains filtered or unexported fields
}

A WebSocketClient represents a connection to WebSocket server.

func (*WebSocketClient) Connect

func (wc *WebSocketClient) Connect() (<-chan *WebSocketDownstreamMessage, <-chan error, error)

Connect connects the WebSocket server.

func (*WebSocketClient) Stop

func (wc *WebSocketClient) Stop()

Stop stops subscribing the specified channel, all goroutines quit.

func (*WebSocketClient) Subscribe

func (wc *WebSocketClient) Subscribe(channels ...*WebSocketSubscribeMessage) error

Subscribe subscribes the specified channel.

func (*WebSocketClient) Unsubscribe added in v1.0.6

func (wc *WebSocketClient) Unsubscribe(channels ...*WebSocketUnsubscribeMessage) error

Unsubscribe unsubscribes the specified channel.

type WebSocketClientOpts added in v1.2.13

type WebSocketClientOpts struct {
	Token         *WebSocketTokenModel
	TLSSkipVerify bool
	Timeout       time.Duration
}

WebSocketClientOpts defines the options for the client during the websocket connection.

type WebSocketDownstreamMessage

type WebSocketDownstreamMessage struct {
	*WebSocketMessage
	Sn      string          `json:"sn"`
	Topic   string          `json:"topic"`
	Subject string          `json:"subject"`
	RawData json.RawMessage `json:"data"`
}

A WebSocketDownstreamMessage represents a message from the WebSocket server to client.

func (*WebSocketDownstreamMessage) ReadData

func (m *WebSocketDownstreamMessage) ReadData(v interface{}) error

ReadData read the data in channel.

type WebSocketMessage

type WebSocketMessage struct {
	Id   string `json:"id"`
	Type string `json:"type"`
}

A WebSocketMessage represents a message between the WebSocket client and server.

func NewPingMessage

func NewPingMessage() *WebSocketMessage

NewPingMessage creates a ping message instance.

type WebSocketServerModel

type WebSocketServerModel struct {
	PingInterval int64  `json:"pingInterval"`
	Endpoint     string `json:"endpoint"`
	Protocol     string `json:"protocol"`
	Encrypt      bool   `json:"encrypt"`
	PingTimeout  int64  `json:"pingTimeout"`
}

A WebSocketServerModel contains some servers for WebSocket feed.

type WebSocketServersModel

type WebSocketServersModel []*WebSocketServerModel

A WebSocketServersModel is the set of *WebSocketServerModel.

func (WebSocketServersModel) RandomServer

func (s WebSocketServersModel) RandomServer() (*WebSocketServerModel, error)

RandomServer returns a server randomly.

type WebSocketSubscribeMessage

type WebSocketSubscribeMessage struct {
	*WebSocketMessage
	Topic          string `json:"topic"`
	PrivateChannel bool   `json:"privateChannel"`
	Response       bool   `json:"response"`
}

A WebSocketSubscribeMessage represents a message to subscribe the public/private channel.

func NewSubscribeMessage

func NewSubscribeMessage(topic string, privateChannel bool) *WebSocketSubscribeMessage

NewSubscribeMessage creates a subscribe message instance.

type WebSocketTokenModel

type WebSocketTokenModel struct {
	Token             string                `json:"token"`
	Servers           WebSocketServersModel `json:"instanceServers"`
	AcceptUserMessage bool                  `json:"accept_user_message"`
}

A WebSocketTokenModel contains a token and some servers for WebSocket feed.

type WebSocketUnsubscribeMessage added in v1.0.6

type WebSocketUnsubscribeMessage WebSocketSubscribeMessage

A WebSocketUnsubscribeMessage represents a message to unsubscribe the public/private channel.

func NewUnsubscribeMessage

func NewUnsubscribeMessage(topic string, privateChannel bool) *WebSocketUnsubscribeMessage

NewUnsubscribeMessage creates a unsubscribe message instance.

type WithdrawalModel

type WithdrawalModel struct {
	Id         string `json:"id"`
	Address    string `json:"address"`
	Memo       string `json:"memo"`
	Currency   string `json:"currency"`
	Amount     string `json:"amount"`
	Fee        string `json:"fee"`
	WalletTxId string `json:"walletTxId"`
	IsInner    bool   `json:"isInner"`
	Status     string `json:"status"`
	Remark     string `json:"remark"`
	CreatedAt  int64  `json:"createdAt"`
	UpdatedAt  int64  `json:"updatedAt"`
}

A WithdrawalModel represents a withdrawal.

type WithdrawalQuotasModel

type WithdrawalQuotasModel struct {
	Currency            string `json:"currency"`
	AvailableAmount     string `json:"availableAmount"`
	RemainAmount        string `json:"remainAmount"`
	WithdrawMinSize     string `json:"withdrawMinSize"`
	LimitBTCAmount      string `json:"limitBTCAmount"`
	InnerWithdrawMinFee string `json:"innerWithdrawMinFee"`
	UsedBTCAmount       string `json:"usedBTCAmount"`
	IsWithdrawEnabled   bool   `json:"isWithdrawEnabled"`
	WithdrawMinFee      string `json:"withdrawMinFee"`
	Precision           uint8  `json:"precision"`
	Chain               string `json:"chain"`
}

A WithdrawalQuotasModel represents the quotas for a currency.

type WithdrawalsModel

type WithdrawalsModel []*WithdrawalModel

A WithdrawalsModel is the set of *WithdrawalModel.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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