account

package
v0.3.18 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Account Asset (https://bybit-exchange.github.io/docs/account_asset/#t-introduction)

Enums Definitions (https://bybit-exchange.github.io/docs/account_asset/#t-enums)

Transfer Data Endpoints (https://bybit-exchange.github.io/docs/account_asset/#t-transfer_api)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get[T any](c *Client, path string, param any) (T, error)

func Post

func Post[T any](c *Client, path string, param any) (T, error)

Types

type AccountType

type AccountType string

Account type (from_account_type/to_account_type) (https://bybit-exchange.github.io/docs/account_asset/#account-type-from_account_type-to_account_type)

const (
	AccountContract   AccountType = "CONTRACT"
	AccountSpot       AccountType = "SPOT"
	AccountInvestment AccountType = "INVESTMENT"
	AccountOption     AccountType = "OPTION"
	AccountUnified    AccountType = "UNIFIED"
)

type Client

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

Account Asset HTTP client

func NewClient

func NewClient(client *transport.Client) *Client

func (*Client) CreateInternalTransfer

func (this *Client) CreateInternalTransfer(v CreateInternalTransfer) (string, error)

func (*Client) Get

func (this *Client) Get(path string, param any, ret any) error

func (*Client) Post

func (this *Client) Post(path string, param any, ret any) error

func (*Client) QueryInternalTransferList

func (this *Client) QueryInternalTransferList(v QueryInternalTransferList) (InternalTransfers, error)

func (*Client) Transport

func (this *Client) Transport() *transport.Client

type CreateInternalTransfer

type CreateInternalTransfer struct {
	// param as json on body
	TransferID      string `json:"transfer_id"`
	Coin            string `json:"coin"`
	Amount          string `json:"amount"`
	FromAccountType string `json:"from_account_type"`
	ToAccountType   string `json:"to_account_type"`
}

Create Internal Transfer (https://bybit-exchange.github.io/docs/account_asset/#t-createinternaltransfer)

func (CreateInternalTransfer) Do

func (this CreateInternalTransfer) Do(client *Client) (string, error)

type InternalTransfer

type InternalTransfer struct {
	TransferID      string         `json:"transfer_id"`
	Coin            string         `json:"coin"`
	Amount          string         `json:"amount"`
	FromAccountType AccountType    `json:"from_account_type"`
	ToAccountType   AccountType    `json:"to_account_type"`
	Timestamp       string         `json:"timestamp"`
	Status          TransferStatus `json:"status"`
}

type InternalTransfers

type InternalTransfers struct {
	List   []InternalTransfer `json:"list"`
	Cursor string             `json:"cursor"`
}

type OperatorType

type OperatorType string

Operator type (https://bybit-exchange.github.io/docs/account_asset/#operator-type)

const (
	OperatorSystem        OperatorType = "SYSTEM"
	OperatorUser          OperatorType = "USER"
	OperatorAdmin         OperatorType = "ADMIN"
	OperatorAffiliateUser OperatorType = "AFFILIATE_USER"
)

type PageDirection

type PageDirection string

Page direction (direction) (https://bybit-exchange.github.io/docs/account_asset/#page-direction-direction)

const (
	PagePrev PageDirection = "Prev"
	PageNext PageDirection = "Next"
)

type QueryInternalTransferList

type QueryInternalTransferList struct {
	TransferID *string         `param:"transfer_id"`
	Coin       *string         `param:"coin"`
	Status     *TransferStatus `param:"status"`
	StartTime  *int            `param:"start_time"`
	EndTime    *int            `param:"end_time"`
	Direction  *PageDirection  `param:"direction"`
	Limit      *int            `param:"limit"`
	Cursor     *string         `param:"cursor"`
}

Query Internal Transfer List (https://bybit-exchange.github.io/docs/account_asset/#t-querytransferlist)

func (QueryInternalTransferList) Do

type Response

type Response[T any] struct {
	RetCode int    `json:"ret_code"`
	RetMsg  string `json:"ret_msg"`
	ExtCode string `json:"ext_code"`
	ExtInfo string `json:"ext_info"`
	Result  T      `json:"result"`
	TimeNow int64  `json:"time_now"`
}

type TransferStatus

type TransferStatus string

Transfer status (status) (https://bybit-exchange.github.io/docs/account_asset/#transfer-status-status)

const (
	TransferSuccess TransferStatus = "SUCCESS"
	TransferPending TransferStatus = "PENDING"
	TransferFailed  TransferStatus = "FAILED"
)

type TransferType

type TransferType string

Transfer type (type) (https://bybit-exchange.github.io/docs/account_asset/#transfer-type-type)

const (
	TransferIn  TransferType = "IN"
	TransferOut TransferType = "OUT"
)

type Withdraw

type Withdraw string

Withdraw status (status) (https://bybit-exchange.github.io/docs/account_asset/#withdraw-status-status)

const (
	WithdrawSecurityCheck       Withdraw = "SecurityCheck"
	WithdrawPending             Withdraw = "Pending"
	WithdrawSuccess             Withdraw = "success"
	WithdrawCancelByUser        Withdraw = "CancelByUser"
	WithdrawReject              Withdraw = "Reject"
	WithdrawFail                Withdraw = "Fail"
	WithdrawBlockchainConfirmed Withdraw = "BlockchainConfirmed"
)

Jump to

Keyboard shortcuts

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