ceffu

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 17 Imported by: 0

README

Ceffu Client for Go

This is a trivial client for the Ceffu API written in Go. Currently, this package is in experimental stage.

Usage

package main

import "github.com/DenrianWeiss/ceffu"
import "net/http"

const API_KEY = ""
const PRIVATE_KEY = ""

func main() {
	cl, err := ceffu.New(API_KEY, PRIVATE_KEY, http.DefaultClient, nil, ceffu.CeffuApiBaseUrl)
	if err != nil {
		panic(err)
	}
	cl.GetStatus(ceffu.BusinessTypeDeposit, "10")
}

Documentation

Index

Constants

View Source
const (
	ErrorBadRequest              = "G20002" // Server cannot or will not process the request due to something that is perceived to be a client error
	ErrorExceededPaginationSize  = "G20003" // The request params exceeded the pagination size
	ErrorExceededPaginationLimit = "G20004" // The request params exceeded the pagination limit
	ErrorInvalidParameterValue   = "G20005" // Invalid input params value
	ErrorTimeStampEmpty          = "G20006" // Request params timestamp is missing
	ErrorTimeStampExpired        = "G20007" // Request params timestamp is expired
	ErrorMissingKey              = "G20008" // Missisng API Key or Signature in the request
	ErrorInvalidSignature        = "G20009" // Invalid signature
	ErrorInvalidApiKey           = "G20010" // Invalid API Key
	ErrorInvalidIP               = "G20011" // Invalid IP
	ErrorRateLimitExceeded       = "G20012" // Rate limit exceeded
	ErrorNoWalletPermission      = "G20013" // No wallet permission
	ErrorInvalidReqIDFormat      = "G20014" // Invalid request ID format
	ErrorDuplicateReqID          = "G20015" // Duplicate request ID
	ErrorEndpointPermission      = "G20016" // No endpoint permission
	ErrorSubWithdrawNotSupported = "G20017" // Withdraw not supported for sub wallet
	ErrorSubWalletIDRequired     = "G20018" // Sub wallet ID is required
	ErrorPrimeWalletIDRequired   = "G20019" // Prime wallet ID is required
	ErrorWalletIDNotFound        = "G20020" // Wallet with the given ID not found
	ErrorWalletRelationship      = "G20021" // Invalid wallet relationship
	ErrorInvalidAmount           = "G20022" // Invalid amount
	ErrorInvalidRequestFormat    = "G20023" // Invalid request format
	ErrorWalletTypeNotSupported  = "G20024" // Wallet type not supported
	ErrorAddressNotActivated     = "G20025" // Address is not activated. Please contact the account manager to activate your deposit address.
	ErrorSearchableTimeRange     = "G20026" // The time range is too large to search. Please narrow down the time range.
	ErrorPrimeOrSubIDRequired    = "G20027" // Prime or sub wallet ID is required
	ErrorApiKeyExpired           = "G20028" // API Key is expired
	ErrorMirrorLink              = "G20029" // Invalid Mirror linkage relationship
	ErrorSubWalletIDNotSupported = "G20030" // Sub wallet ID is not supported for this endpoint
)
View Source
const (
	GetMirrorXLinkIdListApi       = "mirrorX/mirrorXLinkId/list"
	GetMirrorXDelegationOrdersApi = "mirrorX/order/list"
	GetMirrorXAvailableAmountApi  = "mirrorX/order/check"
	GetMirrorXAssetPositionsApi   = "mirrorX/positions/list"
	CreateMirrorXOrderApi         = "mirrorX/order"
)
View Source
const BusinessTypeDeposit = "10"
View Source
const BusinessTypeTransferToBinanceExchange = "30"
View Source
const BusinessTypeWithdraw = "20"
View Source
const CeffuApiBaseUrl = "https://open-api.ceffu.com"
View Source
const CeffuVersion2Path = "/open-api/v2/"
View Source
const CeffuVersionPath = "/open-api/v1/"
View Source
const WalletTypePrime = "20"
View Source
const WalletTypeQualified = "10"

Variables

View Source
var ErrorMap = map[string]string{
	ErrorBadRequest:              "bad request",
	ErrorExceededPaginationSize:  "the request params exceeded the pagination size",
	ErrorExceededPaginationLimit: "the request params exceeded the pagination limit",
	ErrorInvalidParameterValue:   "invalid input params value",
	ErrorTimeStampEmpty:          "request params timestamp is missing",
	ErrorTimeStampExpired:        "request params timestamp is expired",
	ErrorMissingKey:              "missing api key or signature in the request",
	ErrorInvalidSignature:        "invalid signature",
	ErrorInvalidApiKey:           "invalid api key",
	ErrorInvalidIP:               "invalid ip",
	ErrorRateLimitExceeded:       "rate limit exceeded",
	ErrorNoWalletPermission:      "no wallet permission",
	ErrorInvalidReqIDFormat:      "invalid request id format",
	ErrorDuplicateReqID:          "duplicate request id",
	ErrorEndpointPermission:      "no endpoint permission",
	ErrorSubWithdrawNotSupported: "withdraw not supported for sub wallet",
	ErrorSubWalletIDRequired:     "sub wallet id is required",
	ErrorPrimeWalletIDRequired:   "prime wallet id is required",
	ErrorWalletIDNotFound:        "wallet with the given id not found",
	ErrorWalletRelationship:      "invalid wallet relationship",
	ErrorInvalidAmount:           "invalid amount",
	ErrorInvalidRequestFormat:    "invalid request format",
	ErrorWalletTypeNotSupported:  "wallet type not supported",
	ErrorAddressNotActivated:     "address is not activated. please contact the account manager to activate your deposit address",
	ErrorSearchableTimeRange:     "the time range is too large to search. please narrow down the time range",
	ErrorPrimeOrSubIDRequired:    "prime or sub wallet id is required",
	ErrorApiKeyExpired:           "api key is expired",
	ErrorMirrorLink:              "invalid mirror linkage relationship",
	ErrorSubWalletIDNotSupported: "sub wallet id is not supported for this endpoint",
}

Error code to message map

Functions

func GetReqId

func GetReqId() int64

Types

type Client

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

func New

func New(apiKey string, x509KeyBase64 string, client *http.Client, logger *log.Logger, baseUrl string) (*Client, error)

New creates a new Client from a base64 encoded x509 private key. The key must be in PKCS8 format. Also, the key must be RSA. x509KeyEncoded is the base64 encoded x509 private key. aka, the part between BEGIN PRIVATE KEY line and END PRIVATE KEY line. client is the http client to use. If nil, http.DefaultClient is used. logger is the logger to use. If nil, no logging is done. baseUrl is the base url to use. If empty, the default url is used.

func (*Client) CreateMirrorXOrder

func (c *Client) CreateMirrorXOrder(req *CreateMirrorXOrderReq) (*CreateMirrorXOrderResp, error)

CreateMirrorXOrder place mirrorX order @param mirrorXLinkId: mirrorXLinkId, must have, binded binance uid @param orderType: order type, must have, 10: buy, 20: sell @param coinSymbol: coin symbol, must have, example: "USDT" @param amount: amount, must have, example: "100" @param timestamp: timestamp, must have, example: 1630000000

func (*Client) CreateSubWallet

func (c *Client) CreateSubWallet(parentWalletId int64, walletName string, autoCollection bool, requestId ...int64) (*CreateSubWalletResp, error)

CreateSubWallet creates a sub wallet for certain organization parentWalletId: required walletName: required, max 20 char autoCollection: optional, default false(0) requestId: optional, default random

func (*Client) CreateWallet

func (c *Client) CreateWallet(walletName string, walletType int, requestId ...int64) (*CreateWalletResp, error)

CreateWallet creates a wallet for certain organization walletName: required walletType: required, Use WalletTypeInt* requestId: optional, default random

func (*Client) GetAllSubWallet

func (c *Client) GetAllSubWallet(parentWalletId int64, pageLimit int, pageNo int) (*GetAllSubWalletResp, error)

GetAllSubWallet gets all sub wallets under a prime account parentWalletId: prime account id pageLimit: optional, default 25 max 25 pageNo: optional, default 1

func (*Client) GetAllSubWalletDepositAddress

func (c *Client) GetAllSubWalletDepositAddress(parentWalletId int64, coinSymbol string, network string, pageLimit int, pageNo int) (*GetAllSubWalletDepositAddressResp, error)

GetAllSubWalletDepositAddress get All sub wallet deposit address under the requested Parent Wallet ID (Prime), coinSymbol and network. (Only applicable to Parent Wallet Id(Prime)) parentWalletId: prime account id coinSymbol: required network: required pageLimit: optional, default 25 max 25 pageNo: optional, default 1

func (*Client) GetAllSubWalletDepositHistory

func (c *Client) GetAllSubWalletDepositHistory(parentWalletId int64, coinSymbol string, network string, pageLimit int, pageNo int) (*GetAllSubWalletDepositHistoryResp, error)

GetAllSubWalletDepositHistory gets deposit history for all sub wallets parentWalletId required, prime or qualified account id coinSymbol: optional network: optional pageLimit: optional, default 25 max 25 pageNo: optional, default 1

func (*Client) GetAssetDetails

func (c *Client) GetAssetDetails(coinSymbol string, network string, walletId string, pageLimit int, pageNo int) (*GetAssetDetailsResp, error)

GetAssetDetails returns the asset details of a wallet coinSymbol: optional, if not provided, all coins will be returned network: optional, if not provided, all networks will be returned walletId: required pageLimit: optional, default 25, max 25 pageNo: optional, default 1

func (*Client) GetAssetSummary

func (c *Client) GetAssetSummary(walletId string) (*GetAssetSummaryResp, error)

GetAssetSummary This method allows you to fetch the specified wallet's asset summary,

represented in its equivalent BTC & USD value.
Please note that this equivalent value is provided for reference only and is based on our internal calculation.

WalletId required

func (*Client) GetDepositAddress

func (c *Client) GetDepositAddress(coinSymbol string, network string, walletId string) (*GetDepositAddressResp, error)

GetDepositAddress returns the deposit address of a coin coinSymbol: required network: required, network symbol in capital letters walletId: required

func (*Client) GetDepositDetail

func (c *Client) GetDepositDetail(txId string) (*GetDepositDetailResp, error)

GetDepositDetail queries the deposit detail of a transaction txId: required, transaction id for corresponding deposit

func (*Client) GetDepositHistory

func (c *Client) GetDepositHistory(walletId string, coinSymbol string, network string, startTime int64, endTime int64, pageLimit int, pageNo int) (*GetDepositHistoryResp, error)

GetDepositHistory returns the deposit history of a coin walletId: required coinSymbol: optional, if not provided, all coins will be returned network: optional, if not provided, all networks will be returned startTime: required, unix timestamp in milliseconds endTime: optional, default to current time, unix timestamp in milliseconds pageLimit: optional, default 25, max 25 pageNo: optional, default 1

func (*Client) GetMirrorXAssetPositions

func (c *Client) GetMirrorXAssetPositions(mirrorXLinkId string, excludeZeroAmountFlag bool, pageLimit int, pageNo int) (*GetMirrorXAssetPositionsResp, error)

GetMirrorXAssetPositions get mirrorX asset positions @param mirrorXLinkId: mirrorXLinkId, must have, binded binance uid @param excludeZeroAmountFlag: exclude zero amount flag, optional, default false @param pageLimit: page limit, optional, default 10 @param pageNo: page no, optional, default 1

func (*Client) GetMirrorXAvailableAmount

func (c *Client) GetMirrorXAvailableAmount(mirrorXLinkId string, coinSymbol string, orderType MirrorXOrderType) (*GetMirrorXAvailableAmountResp, error)

GetMirrorXAvailableAmount get mirrorX available amount @param mirrorXLinkId: mirrorXLinkId, must have, binded binance uid @param coinSymbol: coin symbol, must have, example: "USDT" @param orderType: order type, must have, 10: buy, 20: sell

func (*Client) GetMirrorXDelegationOrders

func (c *Client) GetMirrorXDelegationOrders(mirrorXLinkId string, coinSymbol string, orderType MirrorXOrderType, startTime int, endTime int, pageLimit int, pageNo int) (*GetMirrorXDelegationOrdersResp, error)

GetMirrorXDelegationOrders get mirrorX delegation orders @param mirrorXLinkId: mirrorXLinkId, must have, binded binance uid @param coinSymbol: coin symbol optional, if not set, will return all orders, example: "USDT" @param orderType: order type, optional, if not set, will return all orders, 10: buy, 20: sell @param startTime: start time, required @param endTime: end time, required @param pageLimit: page limit, optional, default 10 @param pageNo: page no, optional, default 1

func (c *Client) GetMirrorXLinkList(pageLimit, pageNo int) (*GetMirrorXLinkListResp, error)

func (*Client) GetPrimeSupportedCoinList

func (c *Client) GetPrimeSupportedCoinList() (*GetPrimeSupportedCoinListResp, error)

GetPrimeSupportedCoinList returns the list of supported coins

func (*Client) GetPublicKey

func (c *Client) GetPublicKey() rsa.PublicKey

func (*Client) GetQualifiedSupportedCoinList

func (c *Client) GetQualifiedSupportedCoinList() (*GetQualifiedSupportedCoinListResp, error)

GetQualifiedSupportedCoinList returns the list of coins that are supported by Ceffu's qualified wallet

func (*Client) GetStatus

func (c *Client) GetStatus(business string, walletType string) (resp *GetStatusResp, err error)

func (*Client) GetSubWalletAssetDetails

func (c *Client) GetSubWalletAssetDetails(walletId int64, coinSymbol string, network string, pageLimit int, pageNo int) (*GetSubWalletAssetDetailsResp, error)

GetSubWalletAssetDetails gets asset details of a sub wallet coinSymbol: optional network: optional pageLimit: optional, default 25 max 25 pageNo: optional, default 1 walletId: required

func (*Client) GetSubWalletDepositAddress

func (c *Client) GetSubWalletDepositAddress(walletId int64, coinSymbol string, network string) (*GetSubWalletDepositAddressResp, error)

GetSubWalletDepositAddress gets deposit address for a sub wallet coinSymbol: required for prime, not required for qualified network: required walletId: required, sub wallet id

func (*Client) GetSubWalletDepositHistory

func (c *Client) GetSubWalletDepositHistory(walletId int64, coinSymbol string, network string, startTime int64, endTime int64, pageLimit int, pageNo int) (*GetSubWalletDepositHistoryResp, error)

GetSubWalletDepositHistory gets deposit history for a sub wallet, v2 api walletId: sub wallet id coinSymbol: optional network: optional startTime: required, unix timestamp in millisecond endTime: optional, unix timestamp in millisecond, default now pageLimit: optional, default 25 max 25 pageNo: optional, default 1

func (*Client) GetSubWalletSummary

func (c *Client) GetSubWalletSummary(walletIdStr string) (*GetSubWalletSummaryResp, error)

GetSubWalletSummary return asset summary for subaccounts in certain prime/qualified account walletIdStr: prime or qualified account id

func (*Client) GetTransferDetailWithExchange

func (c *Client) GetTransferDetailWithExchange(orderViewId string, walletId string) (*GetTransferDetailWithExchangeResp, error)

GetTransferDetailWithExchange queries the transfer detail of a transaction orderViewId: required, order view id for corresponding transfer walletId: required

func (*Client) GetTransferHistory

func (c *Client) GetTransferHistory(walletId int64, coinSymbol string, direction SubWalletTransferType, status SubWalletTransferStatus, startTime int64, endTime int64, pageLimit int, pageNo int) (*GetSubWalletTransferHistoryResp, error)

GetTransferHistory gets transfer history between sub wallet and prime wallet walletId: required, prime wallet id coinSymbol: optional, to filter txs. direction: optional, transfer direction status: optional, to filter txs. startTime: required, unix timestamp in millisecond endTime: optional, unix timestamp in millisecond, default now pageLimit: default 25 max 25 pageNo: default 1

func (*Client) GetTransferHistoryWithExchange

func (c *Client) GetTransferHistoryWithExchange(walletId string, coinSymbol string, direction TransferDirection, status WithdrawStatus, startTime int64, endTime int64, pageLimit int, pageNo int) (*GetTransferHistoryWithExchangeResp, error)

GetTransferHistoryWithExchange returns the transfer history of a coin walletId required coinSymbol optional, if not provided, all coins will be returned direction optional, if not provided, all directions will be returned status optional, if not provided, all statuses will be returned startTime required, unix timestamp in milliseconds endTime optional, default to current time, unix timestamp in milliseconds pageLimit optional, default 25, max 25 pageNo optional, default 1

func (*Client) GetWalletList

func (c *Client) GetWalletList(pageLimit int, pageNo int) (*GetWalletListResp, error)

GetWalletList returns the list of wallets for certain organization pageLimit: optional, default 25, max 25 pageNo: optional, default 1

func (*Client) GetWithdrawalDetail

func (c *Client) GetWithdrawalDetail(orderViewId string) (*GetWithdrawalDetailResp, error)

GetWithdrawalDetail queries the withdrawal detail of a transaction orderViewId: required, order view id for corresponding withdrawal

func (*Client) GetWithdrawalFee

func (c *Client) GetWithdrawalFee(walletId string, coinSymbol string, network string, amount string) (*GetWithdrawalFeeResp, error)

GetWithdrawalFee returns the withdrawal fee of a coin walletId: required coinSymbol: required network: required, network symbol in capital letters amount: optional, if not provided, the minimum withdrawal amount will be returned

func (*Client) GetWithdrawalHistory

func (c *Client) GetWithdrawalHistory(walletId string, network string, coinSymbol string, status WithdrawStatus, startTime int64, endTime int64, pageLimit int, pageNo int) (*GetWithdrawalHistoryResp, error)

GetWithdrawalHistory returns the withdrawal history of a coin walletId required network optional, if not provided, all networks will be returned coinSymbol optional, if not provided, all coins will be returned status optional, if not provided, all statuses will be returned startTime required, unix timestamp in milliseconds endTime optional, default to current time, unix timestamp in milliseconds pageLimit optional, default 25, max 25 pageNo optional, default 1

func (*Client) Logf

func (c *Client) Logf(format string, v ...interface{})

func (*Client) SignString

func (c *Client) SignString(message string) (string, error)

func (*Client) TransferWithExchange

func (c *Client) TransferWithExchange(amount string, coinSymbol string, direction int, exchangeCode int, exchangeUserId string, parentWalletId ...int64) (*TransferWithExchangeResp, error)

TransferWithExchange transfers from ceffu to binance exchange(currently only 1 direction is supported) amount: transfer amount, decimal string coinSymbol: coin symbol, e.g. BTC direction: transfer direction, use TransferDirectionInt* exchangeCode: only 10(Binance) supported. exchangeUserId: string, binance UID parentWalletId: if using parent shared wallet, required. requestId: optional, default random

func (*Client) TransferWithSubWallet

func (c *Client) TransferWithSubWallet(coinSymbol string, amount float64, fromWalletId int64, toWalletId int64, requestId ...int64) (*TransferWithSubWalletResp, error)

TransferWithSubWallet transfer assets between sub wallets and main wallet coinSymbol: required amount: required fromWalletId: required toWalletId: required requestId: optional, default random

func (*Client) UpdateSubWallet

func (c *Client) UpdateSubWallet(autoCollection bool, walletId int64, walletName string, requestId ...int64) (*UpdateSubWalletResp, error)

UpdateSubWallet updates a sub wallet for certain organization autoCollection: optional, default false(0) walletId: required walletName: optional, max 20 char requestId: optional, default random

func (*Client) UpdateWallet

func (c *Client) UpdateWallet(walletId int64, walletName string, requestId ...int64) (*UpdateWalletResp, error)

UpdateWallet updates a wallet for certain organization walletId: required walletName: required requestId: optional, default random

func (*Client) Withdrawal

func (c *Client) Withdrawal(amount string, coinSymbol string, memo string, network string, walletId int64, withdrawalAddress string, requestId ...int64) (*WithdrawalResp, error)

Withdrawal withdraws from ceffu amount: withdrawal amount, decimal string coinSymbol: coin symbol, e.g. BTC memo: optional, memo for tx network: string, network for tx requestId: optional, default random walletId: required withdrawalAddress: required

type CreateMirrorXOrderReq

type CreateMirrorXOrderReq struct {
	MirrorXLinkId int    `json:"mirrorXLinkId"`
	OrderType     int    `json:"orderType"`
	CoinSymbol    string `json:"coinSymbol"`
	Amount        string `json:"amount"`
	RequestId     string `json:"requestId"`
}

type CreateMirrorXOrderResp

type CreateMirrorXOrderResp struct {
	Data struct {
		OrderViewId string `json:"orderViewId"`
		Status      int    `json:"status"`
		RequestId   string `json:"requestId"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type CreateSubWalletResp

type CreateSubWalletResp struct {
	Data struct {
		WalletID       int64  `json:"walletId"`
		WalletName     string `json:"walletName"`
		WalletType     int    `json:"walletType"`
		ParentWalletID int64  `json:"parentWalletId"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type CreateWalletResp

type CreateWalletResp struct {
	Data struct {
		WalletID   int64  `json:"walletId"`
		WalletName string `json:"walletName"`
		WalletType int    `json:"walletType"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetAllSubWalletDepositAddressResp

type GetAllSubWalletDepositAddressResp struct {
	Data struct {
		Data []struct {
			WalletAddress string `json:"walletAddress"`
			Memo          string `json:"memo"`
			WalletID      int64  `json:"walletId"`
		} `json:"data"`
		TotalPage int `json:"totalPage"`
		PageNo    int `json:"pageNo"`
		PageLimit int `json:"pageLimit"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetAllSubWalletDepositHistoryResp

type GetAllSubWalletDepositHistoryResp struct {
	Data struct {
		Data []struct {
			OrderViewId         interface{} `json:"orderViewId"`
			TxId                *string     `json:"txId"`
			TransferType        int         `json:"transferType"`
			Direction           int         `json:"direction"`
			FromAddress         string      `json:"fromAddress"`
			ToAddress           string      `json:"toAddress"`
			Network             *string     `json:"network"`
			CoinSymbol          string      `json:"coinSymbol"`
			Amount              string      `json:"amount"`
			FeeSymbol           interface{} `json:"feeSymbol"`
			FeeAmount           string      `json:"feeAmount"`
			Status              int         `json:"status"`
			ConfirmedBlockCount interface{} `json:"confirmedBlockCount"`
			UnlockConfirm       interface{} `json:"unlockConfirm"`
			MaxConfirmBlock     interface{} `json:"maxConfirmBlock"`
			Memo                interface{} `json:"memo"`
			TxTime              int64       `json:"txTime"`
			WalletIdStr         string      `json:"walletIdStr"`
			RequestId           interface{} `json:"requestId"`
		} `json:"data"`
		TotalPage int `json:"totalPage"`
		PageNo    int `json:"pageNo"`
		PageLimit int `json:"pageLimit"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetAllSubWalletResp

type GetAllSubWalletResp struct {
	Data struct {
		Data      []int64 `json:"data"`
		TotalPage int     `json:"totalPage"`
		PageNo    int     `json:"pageNo"`
		PageLimit int     `json:"pageLimit"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetAssetDetailsResp

type GetAssetDetailsResp struct {
	Data struct {
		Data []struct {
			CoinSymbol      string `json:"coinSymbol"`
			Network         string `json:"network"`
			Amount          string `json:"amount"`
			AvailableAmount string `json:"availableAmount"`
		} `json:"data"`
		TotalPage int `json:"totalPage"`
		PageNo    int `json:"pageNo"`
		PageLimit int `json:"pageLimit"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetAssetSummaryResp

type GetAssetSummaryResp struct {
	Data struct {
		WalletIDStr      string `json:"walletIdStr"`
		TotalAmountInBTC string `json:"totalAmountInBTC"`
		TotalAmountInUSD string `json:"totalAmountInUSD"`
		Data             []struct {
			WalletIDStr         string `json:"walletIdStr"`
			SubTotalAmountInBTC string `json:"subTotalAmountInBTC"`
			SubTotalAmountInUSD string `json:"subTotalAmountInUSD"`
		} `json:"data"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetDepositAddressResp

type GetDepositAddressResp struct {
	Data struct {
		WalletAddress string `json:"walletAddress"`
		Memo          string `json:"memo"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetDepositDetailResp

type GetDepositDetailResp struct {
	Data []struct {
		OrderViewId         string      `json:"orderViewId"`
		TxId                interface{} `json:"txId"` // String or null
		TransferType        int         `json:"transferType"`
		Direction           int         `json:"direction"`
		FromAddress         string      `json:"fromAddress"`
		ToAddress           string      `json:"toAddress"`
		Network             interface{} `json:"network"` // String or null
		CoinSymbol          string      `json:"coinSymbol"`
		Amount              string      `json:"amount"`
		FeeSymbol           interface{} `json:"feeSymbol"` // String or null
		FeeAmount           string      `json:"feeAmount"`
		Status              int         `json:"status"`
		ConfirmedBlockCount interface{} `json:"confirmedBlockCount"` // int or null
		UnlockConfirm       interface{} `json:"unlockConfirm"`       // int or null
		MaxConfirmBlock     interface{} `json:"maxConfirmBlock"`     // int or null
		Memo                interface{} `json:"memo"`
		TxTime              int64       `json:"txTime"`
		WalletId            int64       `json:"walletId"`
		RequestId           interface{} `json:"requestId"` // String or null
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetDepositHistoryResp

type GetDepositHistoryResp struct {
	Data struct {
		Data []struct {
			OrderViewID         string            `json:"orderViewId"`
			TxID                interface{}       `json:"txId"` // String or null
			TransferType        TransferType      `json:"transferType"`
			Direction           TransferDirection `json:"direction"` // See constants.go/TransferDirectionInt*
			FromAddress         string            `json:"fromAddress"`
			ToAddress           string            `json:"toAddress"`
			Network             interface{}       `json:"network"` // String or null
			CoinSymbol          string            `json:"coinSymbol"`
			Amount              string            `json:"amount"`
			FeeSymbol           interface{}       `json:"feeSymbol"`
			FeeAmount           string            `json:"feeAmount"`
			Status              int               `json:"status"`
			ConfirmedBlockCount int               `json:"confirmedBlockCount"`
			UnlockConfirm       int               `json:"unlockConfirm"`
			MaxConfirmBlock     interface{}       `json:"maxConfirmBlock"`
			Memo                interface{}       `json:"memo"` // String or null
			TxTime              int64             `json:"txTime"`
			WalletID            int64             `json:"walletId"`
		} `json:"data"`
		TotalPage int `json:"totalPage"`
		PageNo    int `json:"pageNo"`
		PageLimit int `json:"pageLimit"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetMirrorXAssetPositionsResp

type GetMirrorXAssetPositionsResp struct {
	Data struct {
		Data []struct {
			MirrorXLinkId  string `json:"mirrorXLinkId"`
			BinanceUID     string `json:"binanceUID"`
			WalletIdStr    string `json:"walletIdStr"`
			CoinSymbol     string `json:"coinSymbol"`
			MirrorXBalance string `json:"mirrorXBalance"`
		} `json:"data"`
		TotalPage int `json:"totalPage"`
		PageNo    int `json:"pageNo"`
		PageLimit int `json:"pageLimit"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetMirrorXAvailableAmountResp

type GetMirrorXAvailableAmountResp struct {
	Data struct {
		CoinSymbol         string `json:"coinSymbol"`
		MaxAvailableAmount string `json:"maxAvailableAmount"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetMirrorXDelegationOrdersResp

type GetMirrorXDelegationOrdersResp struct {
	Data struct {
		Data []struct {
			MirrorXLinkId string `json:"mirrorXLinkId"`
			BinanceUID    string `json:"binanceUID"`
			WalletIdStr   string `json:"walletIdStr"`
			OrderType     int    `json:"orderType"`
			Amount        string `json:"amount"`
			CoinSymbol    string `json:"coinSymbol"`
			Status        int    `json:"status"`
			OrderTime     string `json:"orderTime"`
			OrderViewId   string `json:"orderViewId"`
		} `json:"data"`
		TotalPage int `json:"totalPage"`
		PageNo    int `json:"pageNo"`
		PageLimit int `json:"pageLimit"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetMirrorXLinkListResp

type GetMirrorXLinkListResp struct {
	Data struct {
		Data []struct {
			MirrorXLinkId string `json:"mirrorXLinkId"`
			BinanceUID    string `json:"binanceUID"`
			WalletIdStr   string `json:"walletIdStr"`
			Label         string `json:"label"`
			Status        int    `json:"status"`
			CreateDate    string `json:"createDate"`
		} `json:"data"`
		TotalPage int `json:"totalPage"`
		PageNo    int `json:"pageNo"`
		PageLimit int `json:"pageLimit"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetPrimeSupportedCoinListResp

type GetPrimeSupportedCoinListResp struct {
	Data []struct {
		CoinID            int    `json:"coinId"`
		CoinSymbol        string `json:"coinSymbol"`
		CoinFullName      string `json:"coinFullName"`
		NetworkConfigList []struct {
			CoinSymbol       string `json:"coinSymbol"`
			CoinFullName     string `json:"coinFullName"`
			Network          string `json:"network"`
			DepositEnable    bool   `json:"depositEnable"`
			WithdrawalEnable bool   `json:"withdrawalEnable"`
			WithdrawalMin    string `json:"withdrawalMin"`
			WithdrawalMax    string `json:"withdrawalMax"`
			Precision        int    `json:"precision"`
			WithdrawalFee    string `json:"withdrawalFee"`
			AddressRegex     string `json:"addressRegex"`
		} `json:"networkConfigList"`
		DepositEnable    bool `json:"depositEnable"`
		WithdrawalEnable bool `json:"withdrawalEnable"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetQualifiedSupportedCoinListResp

type GetQualifiedSupportedCoinListResp struct {
	Data []struct {
		CoinID           int         `json:"coinId"`
		CoinSymbol       string      `json:"coinSymbol"`
		CoinFullName     interface{} `json:"coinFullName"`
		Network          string      `json:"network"`
		Protocol         interface{} `json:"protocol"`
		DepositEnable    bool        `json:"depositEnable"`
		WithdrawalEnable bool        `json:"withdrawalEnable"`
		WithdrawalMin    string      `json:"withdrawalMin"`
		WithdrawalMax    interface{} `json:"withdrawalMax"`
		Precision        int         `json:"precision"`
		AddressRegex     string      `json:"addressRegex"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetStatusResp

type GetStatusResp struct {
	Data struct {
		Status  int    `json:"status"`
		Message string `json:"message"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetSubWalletAssetDetailsResp

type GetSubWalletAssetDetailsResp struct {
	Data struct {
		Data []struct {
			CoinSymbol      string      `json:"coinSymbol"`
			Network         interface{} `json:"network"`
			Amount          string      `json:"amount"`
			AvailableAmount string      `json:"availableAmount"`
		} `json:"data"`
		TotalPage int `json:"totalPage"`
		PageNo    int `json:"pageNo"`
		PageLimit int `json:"pageLimit"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetSubWalletDepositAddressResp

type GetSubWalletDepositAddressResp struct {
	Data struct {
		WalletAddress string `json:"walletAddress"`
		Memo          string `json:"memo"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetSubWalletDepositHistoryResp

type GetSubWalletDepositHistoryResp struct {
	Data []struct {
		Direction           int     `json:"direction"`
		Network             string  `json:"network"`
		Memo                int     `json:"memo"`
		CoinSymbol          string  `json:"coinSymbol"`
		Amount              float64 `json:"amount"`
		FeeSymbol           string  `json:"feeSymbol"`
		FeeAmount           float64 `json:"feeAmount"`
		WalletID            int64   `json:"walletId"`
		FromAddress         string  `json:"fromAddress"`
		ToAddress           string  `json:"toAddress"`
		OrderViewID         int64   `json:"orderViewId"`
		TransferType        int     `json:"transferType"`
		Status              int     `json:"status"`
		TxID                string  `json:"txId"`
		TxTime              int64   `json:"txTime"`
		ConfirmedBlockCount int     `json:"confirmedBlockCount"`
		MaxConfirmedBlock   string  `json:"maxConfirmedBlock"`
		UnlockConfirm       string  `json:"unlockConfirm"`
	} `json:"data"`
	PageLimit int `json:"pageLimit"`
	PageNo    int `json:"pageNo"`
	TotalPage int `json:"totalPage"`
}

type GetSubWalletSummaryResp

type GetSubWalletSummaryResp struct {
	Data struct {
		WalletIDStr      string `json:"walletIdStr"`
		TotalAmountInBTC string `json:"totalAmountInBTC"`
		TotalAmountInUSD string `json:"totalAmountInUSD"`
		Data             []struct {
			WalletIDStr         string `json:"walletIdStr"`
			SubTotalAmountInBTC string `json:"subTotalAmountInBTC"`
			SubTotalAmountInUSD string `json:"subTotalAmountInUSD"`
		} `json:"data"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetSubWalletTransferHistoryResp

type GetSubWalletTransferHistoryResp struct {
	Data struct {
		Data []struct {
			OrderViewId  string `json:"orderViewId"`
			Direction    int    `json:"direction"`
			FromWalletId int64  `json:"fromWalletId"`
			ToWalletId   int64  `json:"toWalletId"`
			CoinSymbol   string `json:"coinSymbol"`
			Amount       string `json:"amount"`
			Status       int    `json:"status"`
		} `json:"data"`
		TotalPage int `json:"totalPage"`
		PageNo    int `json:"pageNo"`
		PageLimit int `json:"pageLimit"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetTransferDetailWithExchangeResp

type GetTransferDetailWithExchangeResp struct {
	Data struct {
		OrderViewID    string            `json:"orderViewId"`
		Direction      TransferDirection `json:"direction"`
		WalletID       int64             `json:"walletId"`
		CreateTime     int64             `json:"createTime"`
		ExchangeCode   int               `json:"exchangeCode"`
		ExchangeUserID string            `json:"exchangeUserId"`
		CoinSymbol     string            `json:"coinSymbol"`
		Amount         string            `json:"amount"`
		Status         int               `json:"status"`
		RequestID      string            `json:"requestId"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetTransferHistoryWithExchangeResp

type GetTransferHistoryWithExchangeResp struct {
	Data struct {
		Data []struct {
			OrderViewID    string      `json:"orderViewId"`
			Direction      int         `json:"direction"`
			WalletID       int64       `json:"walletId"`
			CreateTime     int64       `json:"createTime"`
			ExchangeCode   int         `json:"exchangeCode"`
			ExchangeUserID string      `json:"exchangeUserId"`
			CoinSymbol     string      `json:"coinSymbol"`
			Amount         string      `json:"amount"`
			Status         int         `json:"status"`
			RequestID      interface{} `json:"requestId"`
		} `json:"data"`
		TotalPage int `json:"totalPage"`
		PageNo    int `json:"pageNo"`
		PageLimit int `json:"pageLimit"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetWalletListResp

type GetWalletListResp struct {
	Data struct {
		Data []struct {
			WalletID    int64  `json:"walletId"`
			WalletName  string `json:"walletName"`
			WalletType  int    `json:"walletType"`
			WalletIDStr string `json:"walletIdStr"`
		} `json:"data"`
		TotalPage int `json:"totalPage"`
		PageNo    int `json:"pageNo"`
		PageLimit int `json:"pageLimit"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetWithdrawalDetailResp

type GetWithdrawalDetailResp struct {
	Data struct {
		OrderViewID         string `json:"orderViewId"`
		TxID                string `json:"txId"`
		TransferType        int    `json:"transferType"`
		Direction           int    `json:"direction"`
		FromAddress         string `json:"fromAddress"`
		ToAddress           string `json:"toAddress"`
		Network             string `json:"network"`
		CoinSymbol          string `json:"coinSymbol"`
		Amount              string `json:"amount"`
		FeeSymbol           string `json:"feeSymbol"`
		FeeAmount           string `json:"feeAmount"`
		Status              int    `json:"status"`
		ConfirmedBlockCount int    `json:"confirmedBlockCount"`
		Memo                string `json:"memo"`
		TxTime              int64  `json:"txTime"`
		WalletID            int64  `json:"walletId"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetWithdrawalFeeResp

type GetWithdrawalFeeResp struct {
	Data struct {
		FeeAmount string `json:"feeAmount"`
		FeeSymbol string `json:"feeSymbol"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type GetWithdrawalHistoryResp

type GetWithdrawalHistoryResp struct {
	Data []struct {
		Direction           int          `json:"direction"`
		Network             string       `json:"network"`
		Memo                int          `json:"memo"`
		CoinSymbol          string       `json:"coinSymbol"`
		Amount              float64      `json:"amount"`
		FeeSymbol           string       `json:"feeSymbol"`
		FeeAmount           float64      `json:"feeAmount"`
		WalletID            int64        `json:"walletId"`
		FromAddress         string       `json:"fromAddress"`
		ToAddress           string       `json:"toAddress"`
		OrderViewID         int64        `json:"orderViewId"`
		TransferType        TransferType `json:"transferType"`
		Status              int          `json:"status"`
		TxID                string       `json:"txId"`
		TxTime              int64        `json:"txTime"`
		ConfirmedBlockCount int          `json:"confirmedBlockCount"`
		MaxConfirmedBlock   string       `json:"maxConfirmedBlock"`
		UnlockConfirm       string       `json:"unlockConfirm"`
	} `json:"data"`
	PageLimit int `json:"pageLimit"`
	PageNo    int `json:"pageNo"`
	TotalPage int `json:"totalPage"`
}

type MirrorXOrderType

type MirrorXOrderType int
const (
	MirrorXOrderTypeAll      MirrorXOrderType = 0
	MirrorXOrderTypeDeposit  MirrorXOrderType = 10
	MirrorXOrderTypeWithdraw MirrorXOrderType = 20
)

type SubWalletTransferStatus

type SubWalletTransferStatus int
const (
	SubWalletTransferStatusPending    SubWalletTransferStatus = 10
	SubWalletTransferStatusProcessing SubWalletTransferStatus = 20
	SubWalletTransferStatusSuccess    SubWalletTransferStatus = 30
	SubWalletTransferStatusFailed     SubWalletTransferStatus = 99
)

type SubWalletTransferType

type SubWalletTransferType int
const (
	SubWalletNotFiltered SubWalletTransferType = 0
	SubWalletParentToSub SubWalletTransferType = 10
	SubWalletSubToParent SubWalletTransferType = 20
	SubWalletSubToSub    SubWalletTransferType = 30
)

type TransferDirection

type TransferDirection int
const (
	TransferDirectionIntDeposit  TransferDirection = 10
	TransferDirectionIntWithdraw TransferDirection = 20
)

type TransferType

type TransferType int
const (
	TransferTypeOnChain  TransferType = 10
	TransferTypeInternal TransferType = 20
)

type TransferWithExchangeResp

type TransferWithExchangeResp struct {
	Data struct {
		OrderViewID string            `json:"orderViewId"`
		Status      WithdrawStatus    `json:"status"`
		Direction   TransferDirection `json:"direction"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type TransferWithSubWalletResp

type TransferWithSubWalletResp struct {
	Data struct {
		OrderViewID string `json:"orderViewId"`
		Status      int    `json:"status"`
		Direction   int    `json:"direction"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type UpdateSubWalletResp

type UpdateSubWalletResp struct {
	ParentWalletID int    `json:"parentWalletId"`
	WalletID       int    `json:"walletId"`
	WalletName     string `json:"walletName"`
	WalletType     int    `json:"walletType"`
	AutoCollection int    `json:"autoCollection"`
}

type UpdateWalletResp

type UpdateWalletResp struct {
	Data struct {
		WalletID   int64  `json:"walletId"`
		WalletName string `json:"walletName"`
		WalletType int    `json:"walletType"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type WalletType

type WalletType int
const (
	WalletTypeIntQualified WalletType = 10
	WalletTypeIntPrime     WalletType = 20
)

type WithdrawStatus

type WithdrawStatus int
const (
	WithdrawStatusPending    WithdrawStatus = 10
	WithdrawStatusProcessing WithdrawStatus = 20
	WithdrawStatusSuccess    WithdrawStatus = 30
	WithdrawStatusConfirmed  WithdrawStatus = 40
	WithdrawStatusFailed     WithdrawStatus = 99
)

type WithdrawalResp

type WithdrawalResp struct {
	Data struct {
		OrderViewID  string         `json:"orderViewId"`
		Status       WithdrawStatus `json:"status"` // See WithdrawStatusInt*
		TransferType TransferType   `json:"transferType"`
	} `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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