Documentation
¶
Index ¶
- type AccountType
- type Balance
- type Beneficiary
- type Chain
- type Client
- func (c *Client) CreateInternalTransfer(coin oc.SymbolId, amount oc.Amount, fromAccount oc.AccountType, ...) (*TransferResponse, error)
- func (c *Client) CreateUniversalTransfer(coin oc.SymbolId, amount oc.Amount, fromMemberId int, toMemberId int, ...) (*TransferResponse, error)
- func (c *Client) GetAllCoinsBalance(accountType oc.AccountType, coinMaybe oc.SymbolId) (*GetAllCoinsBalanceResponse, error)
- func (c *Client) GetCoinInfo(coinMaybe oc.SymbolId) (*GetCoinInfoResponse, error)
- func (c *Client) GetMasterDepositAddress(coin oc.SymbolId, network oc.NetworkId) (*GetDepositAddressResponse, error)
- func (c *Client) GetSubDepositAddress(accountId oc.AccountId, coin oc.SymbolId, network oc.NetworkId) (*GetDepositAddressResponse, error)
- func (c *Client) GetWithdrawalRecords(args *WithdrawalRecordsRequest) (*WithdrawalRecordsResponse, error)
- func (c *Client) Request(method, path string, input interface{}, output interface{}, query url.Values) ([]byte, error)
- func (c *Client) SetBaseURL(baseURL string)
- func (c *Client) Withdraw(request *WithdrawRequest) (*WithdrawResponse, error)
- type CoinInfo
- type DepositAddressChain
- type GetAllCoinsBalanceResponse
- type GetAllCoinsBalanceResult
- type GetCoinInfoResponse
- type GetCoinInfoResult
- type GetDepositAddressResponse
- type GetDepositAddressResult
- type Response
- type RetCode
- type TransferRequest
- type TransferResponse
- type TransferResult
- type TransferStatus
- type UniversalTransferRequest
- type WithdrawRequest
- type WithdrawResponse
- type WithdrawResult
- type WithdrawalRecord
- type WithdrawalRecordsRequest
- type WithdrawalRecordsResponse
- type WithdrawalRecordsResult
- type WithdrawalStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountType ¶
type AccountType = string
const ( AccountTypeUnified AccountType = "UNIFIED" AccountTypeFund AccountType = "FUND" AccountTypeSpot AccountType = "SPOT" AccountTypeLinear AccountType = "LINEAR" AccountTypeInverse AccountType = "INVERSE" )
type Beneficiary ¶
type Beneficiary struct {
}
type Chain ¶
type Chain struct {
ChainType string `json:"chainType"`
Confirmation string `json:"confirmation"`
WithdrawFee string `json:"withdrawFee"`
DepositMin string `json:"depositMin"`
WithdrawMin string `json:"withdrawMin"`
Chain string `json:"chain"`
ChainDeposit string `json:"chainDeposit"`
ChainWithdraw string `json:"chainWithdraw"`
MinAccuracy string `json:"minAccuracy"`
WithdrawPercentageFee string `json:"withdrawPercentageFee"`
ContractAddress string `json:"contractAddress"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateInternalTransfer ¶
func (c *Client) CreateInternalTransfer(coin oc.SymbolId, amount oc.Amount, fromAccount oc.AccountType, toAccount oc.AccountType) (*TransferResponse, error)
https://bybit-exchange.github.io/docs/v5/asset/transfer/create-inter-transfer
func (*Client) CreateUniversalTransfer ¶
func (c *Client) CreateUniversalTransfer(coin oc.SymbolId, amount oc.Amount, fromMemberId int, toMemberId int, fromAccountType oc.AccountType, toAccountType oc.AccountType) (*TransferResponse, error)
https://bybit-exchange.github.io/docs/v5/asset/transfer/unitransfer
func (*Client) GetAllCoinsBalance ¶
func (c *Client) GetAllCoinsBalance(accountType oc.AccountType, coinMaybe oc.SymbolId) (*GetAllCoinsBalanceResponse, error)
https://bybit-exchange.github.io/docs/v5/asset/balance/all-balance
func (*Client) GetCoinInfo ¶
func (c *Client) GetCoinInfo(coinMaybe oc.SymbolId) (*GetCoinInfoResponse, error)
func (*Client) GetMasterDepositAddress ¶
func (c *Client) GetMasterDepositAddress(coin oc.SymbolId, network oc.NetworkId) (*GetDepositAddressResponse, error)
https://bybit-exchange.github.io/docs/v5/asset/deposit/master-deposit-addr
func (*Client) GetSubDepositAddress ¶
func (c *Client) GetSubDepositAddress(accountId oc.AccountId, coin oc.SymbolId, network oc.NetworkId) (*GetDepositAddressResponse, error)
https://bybit-exchange.github.io/docs/v5/asset/deposit/sub-deposit-addr
func (*Client) GetWithdrawalRecords ¶
func (c *Client) GetWithdrawalRecords(args *WithdrawalRecordsRequest) (*WithdrawalRecordsResponse, error)
https://bybit-exchange.github.io/docs/v5/asset/withdraw/withdraw-record
func (*Client) Request ¶
func (c *Client) Request(method, path string, input interface{}, output interface{}, query url.Values) ([]byte, error)
Request makes an authenticated HTTP request to the OKX API
func (*Client) SetBaseURL ¶
func (*Client) Withdraw ¶
func (c *Client) Withdraw(request *WithdrawRequest) (*WithdrawResponse, error)
type DepositAddressChain ¶
type GetAllCoinsBalanceResponse ¶
type GetAllCoinsBalanceResponse = Response[GetAllCoinsBalanceResult]
type GetCoinInfoResponse ¶
type GetCoinInfoResponse = Response[GetCoinInfoResult]
type GetCoinInfoResult ¶
type GetCoinInfoResult struct {
Rows []CoinInfo `json:"rows"`
}
type GetDepositAddressResponse ¶
type GetDepositAddressResponse = Response[GetDepositAddressResult]
type GetDepositAddressResult ¶
type GetDepositAddressResult struct {
Coin string `json:"coin"`
Chains []DepositAddressChain `json:"chains"`
}
type TransferRequest ¶
type TransferRequest struct {
TransferID string `json:"transferId"` // UUID, must be manually generated
Coin oc.SymbolId `json:"coin"` // Coin symbol in uppercase
Amount string `json:"amount"` // Transfer amount
FromAccountType oc.AccountType `json:"fromAccountType"` // Source account type
ToAccountType oc.AccountType `json:"toAccountType"` // Destination account type
}
type TransferResponse ¶
type TransferResponse = Response[TransferResult]
type TransferResult ¶
type TransferResult struct {
TransferID string `json:"transferId"`
Status TransferStatus `json:"status"`
}
type TransferStatus ¶
type TransferStatus string
const TransferStateSuccess TransferStatus = "SUCCESS"
type UniversalTransferRequest ¶
type UniversalTransferRequest struct {
TransferID string `json:"transferId"` // UUID, must be manually generated
Coin oc.SymbolId `json:"coin"` // Coin symbol in uppercase
Amount string `json:"amount"` // Transfer amount
FromMemberId int `json:"fromMemberId"` // From UID
ToMemberId int `json:"toMemberId"` // To UID
FromAccountType oc.AccountType `json:"fromAccountType"` // Source account type
ToAccountType oc.AccountType `json:"toAccountType"` // Destination account type
}
type WithdrawRequest ¶
type WithdrawRequest struct {
Coin oc.SymbolId `json:"coin"` // Required, uppercase only
Chain oc.NetworkId `json:"chain,omitempty"` // Optional, depends on forceChain
Address oc.Address `json:"address"` // Required, wallet address or Bybit UID
Tag string `json:"tag,omitempty"` // Optional, required if tag exists in address book
Amount oc.Amount `json:"amount"` // Required, withdrawal amount
Timestamp int64 `json:"timestamp"` // Required, current timestamp in ms
ForceChain *int `json:"forceChain,omitempty"` // Optional, 0=default, 1=force on-chain, 2=UID withdraw
AccountType AccountType `json:"accountType,omitempty"` // Optional, SPOT(default) or FUND
FeeType *int `json:"feeType,omitempty"` // Optional, 0=manual fee calc, 1=auto deduct
RequestID string `json:"requestId,omitempty"` // Optional, unique ID for idempotency
Beneficiary *Beneficiary `json:"beneficiary,omitempty"` // Optional, travel rule info
}
type WithdrawResponse ¶
type WithdrawResponse = Response[WithdrawResult]
type WithdrawResult ¶
type WithdrawResult struct {
ID string `json:"id"` // Withdrawal ID
}
type WithdrawalRecord ¶
type WithdrawalRecord struct {
WithdrawId string `json:"withdrawId"`
TxID client.TransactionId `json:"txID"`
WithdrawType int `json:"withdrawType"`
Coin oc.SymbolId `json:"coin"`
Chain oc.NetworkId `json:"chain"`
Amount oc.Amount `json:"amount"`
WithdrawFee oc.Amount `json:"withdrawFee"`
Status WithdrawalStatus `json:"status"`
ToAddress oc.Address `json:"toAddress"`
Tag string `json:"tag"`
CreateTime string `json:"createTime"`
UpdateTime string `json:"updateTime"`
}
type WithdrawalRecordsRequest ¶
type WithdrawalRecordsRequest struct {
WithdrawID string `json:"withdrawID,omitempty"`
TxID client.TransactionId `json:"txID,omitempty"`
Coin *oc.SymbolId `json:"coin,omitempty"`
WithdrawType *int `json:"withdrawType,omitempty"`
StartTime *int64 `json:"startTime,omitempty"`
EndTime *int64 `json:"endTime,omitempty"`
Limit *int `json:"limit,omitempty"`
Cursor string `json:"cursor,omitempty"`
}
type WithdrawalRecordsResponse ¶
type WithdrawalRecordsResponse = Response[WithdrawalRecordsResult]
type WithdrawalRecordsResult ¶
type WithdrawalRecordsResult struct {
Rows []WithdrawalRecord `json:"rows"`
NextPageCursor string `json:"nextPageCursor"`
}
type WithdrawalStatus ¶
type WithdrawalStatus string
WithdrawalStatus represents the status of a withdrawal
const ( WithdrawalStatusSecurityCheck WithdrawalStatus = "SecurityCheck" WithdrawalStatusPending WithdrawalStatus = "Pending" WithdrawalStatusSuccess WithdrawalStatus = "success" WithdrawalStatusCancelByUser WithdrawalStatus = "CancelByUser" WithdrawalStatusReject WithdrawalStatus = "Reject" WithdrawalStatusFail WithdrawalStatus = "Fail" WithdrawalStatusBlockchainConfirmed WithdrawalStatus = "BlockchainConfirmed" WithdrawalStatusMoreInformationRequired WithdrawalStatus = "MoreInformationRequired" WithdrawalStatusUnknown WithdrawalStatus = "Unknown" )
Click to show internal directories.
Click to hide internal directories.