Documentation
¶
Index ¶
- type AccountBalance
- type BankAccount
- type Bitflyer
- func (b *Bitflyer) CancelAllExchangeOrders() error
- func (b *Bitflyer) CancelAllOrders()
- func (b *Bitflyer) CancelExchangeOrder(orderID int64) error
- func (b *Bitflyer) CancelOrder()
- func (b *Bitflyer) CancelParentOrder()
- func (b *Bitflyer) CheckFXString(p pair.CurrencyPair) pair.CurrencyPair
- func (b *Bitflyer) GetAccountBalance()
- func (b *Bitflyer) GetAddressInfoCA(addressln string) (ChainAnalysisAddress, error)
- func (b *Bitflyer) GetAllOrders()
- func (b *Bitflyer) GetBankAccSummary()
- func (b *Bitflyer) GetBlockCA(blockhash string) (ChainAnalysisBlock, error)
- func (b *Bitflyer) GetBlockbyHeightCA(height int64) (ChainAnalysisBlock, error)
- func (b *Bitflyer) GetCashDeposits()
- func (b *Bitflyer) GetChats(FromDate string) ([]ChatLog, error)
- func (b *Bitflyer) GetCollateralAccounts()
- func (b *Bitflyer) GetDepositAddress()
- func (b *Bitflyer) GetDepositCancellationHistory()
- func (b *Bitflyer) GetDepositHistory()
- func (b *Bitflyer) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (b *Bitflyer) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error)
- func (b *Bitflyer) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error)
- func (b *Bitflyer) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
- func (b *Bitflyer) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error)
- func (b *Bitflyer) GetExchangeStatus() (string, error)
- func (b *Bitflyer) GetExecutionHistory(symbol string) ([]ExecutedTrade, error)
- func (b *Bitflyer) GetExecutions()
- func (b *Bitflyer) GetLatestBlockCA() (ChainAnalysisBlock, error)
- func (b *Bitflyer) GetMarginChange()
- func (b *Bitflyer) GetMarginStatus()
- func (b *Bitflyer) GetMarkets() ([]MarketInfo, error)
- func (b *Bitflyer) GetOpenInterest()
- func (b *Bitflyer) GetOrderBook(symbol string) (Orderbook, error)
- func (b *Bitflyer) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (b *Bitflyer) GetParentOrderDetails()
- func (b *Bitflyer) GetParentOrders()
- func (b *Bitflyer) GetPermissions()
- func (b *Bitflyer) GetTicker(symbol string) (Ticker, error)
- func (b *Bitflyer) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (b *Bitflyer) GetTradingCommission()
- func (b *Bitflyer) GetTransactionByHashCA(txHash string) (ChainAnalysisTransaction, error)
- func (b *Bitflyer) GetTransactionHistory()
- func (b *Bitflyer) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error)
- func (b *Bitflyer) Run()
- func (b *Bitflyer) SendAuthHTTPRequest(path string, params url.Values, result interface{})
- func (b *Bitflyer) SendHTTPRequest(path string, result interface{}) error
- func (b *Bitflyer) SendOrder()
- func (b *Bitflyer) SendParentOrder()
- func (b *Bitflyer) SetDefaults()
- func (b *Bitflyer) Setup(exch config.ExchangeConfig)
- func (b *Bitflyer) Start(wg *sync.WaitGroup)
- func (b *Bitflyer) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, ...) (int64, error)
- func (b *Bitflyer) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (b *Bitflyer) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (b *Bitflyer) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error)
- func (b *Bitflyer) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error)
- func (b *Bitflyer) WithdrawFiatExchangeFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error)
- func (b *Bitflyer) WithdrawFunds()
- type CancellationHistory
- type CashDeposit
- type ChainAnalysisAddress
- type ChainAnalysisBlock
- type ChainAnalysisTransaction
- type ChatLog
- type CollateralAccounts
- type CollateralHistory
- type DepositAddress
- type DepositHistory
- type ExecutedTrade
- type Executions
- type MarginStatus
- type MarketInfo
- type OpenInterest
- type Orderbook
- type Orders
- type ParentOrderDetail
- type ParentOrders
- type Ticker
- type TransactionHistory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalance ¶
type AccountBalance struct { CurrencyCode string `json:"currency_code"` Amount float64 `json:"amount"` Available float64 `json:"available"` }
AccountBalance holds account balance information
type BankAccount ¶
type BankAccount struct { ID int64 `json:"id"` IsVerified bool `json:"is_verified"` BankName string `json:"bank_name"` BranchName string `json:"branch_name"` AccountType string `json:"account_type"` AccountNumber int `json:"account_number"` AccountName string `json:"account_name"` }
BankAccount holds bank account information
type Bitflyer ¶
Bitflyer is the overarching type across this package
func (*Bitflyer) CancelAllExchangeOrders ¶
CancelAllExchangeOrders cancels all orders associated with a currency pair
func (*Bitflyer) CancelAllOrders ¶
func (b *Bitflyer) CancelAllOrders()
CancelAllOrders cancels all orders on the exchange
func (*Bitflyer) CancelExchangeOrder ¶
CancelExchangeOrder cancels an order by its corresponding ID number
func (*Bitflyer) CancelParentOrder ¶
func (b *Bitflyer) CancelParentOrder()
CancelParentOrder cancels a special order
func (*Bitflyer) CheckFXString ¶
func (b *Bitflyer) CheckFXString(p pair.CurrencyPair) pair.CurrencyPair
CheckFXString upgrades currency pair if needed
func (*Bitflyer) GetAccountBalance ¶
func (b *Bitflyer) GetAccountBalance()
GetAccountBalance returnsthe full list of account funds
func (*Bitflyer) GetAddressInfoCA ¶
func (b *Bitflyer) GetAddressInfoCA(addressln string) (ChainAnalysisAddress, error)
GetAddressInfoCA returns balance information for address by addressln string from bitflyer chain analysis system
func (*Bitflyer) GetAllOrders ¶
func (b *Bitflyer) GetAllOrders()
GetAllOrders returns a list of all orders
func (*Bitflyer) GetBankAccSummary ¶
func (b *Bitflyer) GetBankAccSummary()
GetBankAccSummary returns a full list of bank accounts assoc. with your keys
func (*Bitflyer) GetBlockCA ¶
func (b *Bitflyer) GetBlockCA(blockhash string) (ChainAnalysisBlock, error)
GetBlockCA returns block information by blockhash from bitflyer chain analysis system
func (*Bitflyer) GetBlockbyHeightCA ¶
func (b *Bitflyer) GetBlockbyHeightCA(height int64) (ChainAnalysisBlock, error)
GetBlockbyHeightCA returns the block information by height from bitflyer chain analysis system
func (*Bitflyer) GetCashDeposits ¶
func (b *Bitflyer) GetCashDeposits()
GetCashDeposits returns a full list of cash deposits to the exchange
func (*Bitflyer) GetChats ¶
GetChats returns trollbox chat log Note: returns vary from instant to infinty
func (*Bitflyer) GetCollateralAccounts ¶
func (b *Bitflyer) GetCollateralAccounts()
GetCollateralAccounts returns a full list of collateralised accounts
func (*Bitflyer) GetDepositAddress ¶
func (b *Bitflyer) GetDepositAddress()
GetDepositAddress returns an address for cryptocurrency deposits
func (*Bitflyer) GetDepositCancellationHistory ¶
func (b *Bitflyer) GetDepositCancellationHistory()
GetDepositCancellationHistory returns the cancellation history of deposits
func (*Bitflyer) GetDepositHistory ¶
func (b *Bitflyer) GetDepositHistory()
GetDepositHistory returns a full history of deposits
func (*Bitflyer) GetExchangeAccountInfo ¶
func (b *Bitflyer) GetExchangeAccountInfo() (exchange.AccountInfo, error)
GetExchangeAccountInfo retrieves balances for all enabled currencies on the Bitflyer exchange
func (*Bitflyer) GetExchangeDepositAddress ¶
func (b *Bitflyer) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error)
GetExchangeDepositAddress returns a deposit address for a specified currency
func (*Bitflyer) GetExchangeFundTransferHistory ¶
func (b *Bitflyer) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error)
GetExchangeFundTransferHistory returns funding history, deposits and withdrawals
func (*Bitflyer) GetExchangeHistory ¶
func (b *Bitflyer) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data since exchange opening.
func (*Bitflyer) GetExchangeOrderInfo ¶
func (b *Bitflyer) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error)
GetExchangeOrderInfo returns information on a current open order
func (*Bitflyer) GetExchangeStatus ¶
GetExchangeStatus returns exchange status information
func (*Bitflyer) GetExecutionHistory ¶
func (b *Bitflyer) GetExecutionHistory(symbol string) ([]ExecutedTrade, error)
GetExecutionHistory returns past trades that were executed on the market
func (*Bitflyer) GetExecutions ¶
func (b *Bitflyer) GetExecutions()
GetExecutions returns execution details
func (*Bitflyer) GetLatestBlockCA ¶
func (b *Bitflyer) GetLatestBlockCA() (ChainAnalysisBlock, error)
GetLatestBlockCA returns the latest block information from bitflyer chain analysis system
func (*Bitflyer) GetMarginChange ¶
func (b *Bitflyer) GetMarginChange()
GetMarginChange returns collateral history
func (*Bitflyer) GetMarginStatus ¶
func (b *Bitflyer) GetMarginStatus()
GetMarginStatus returns current margin status
func (*Bitflyer) GetMarkets ¶
func (b *Bitflyer) GetMarkets() ([]MarketInfo, error)
GetMarkets returns market information
func (*Bitflyer) GetOpenInterest ¶
func (b *Bitflyer) GetOpenInterest()
GetOpenInterest returns a summary of open interest
func (*Bitflyer) GetOrderBook ¶
GetOrderBook returns market orderbook depth
func (*Bitflyer) GetOrderbookEx ¶
GetOrderbookEx returns the orderbook for a currency pair
func (*Bitflyer) GetParentOrderDetails ¶
func (b *Bitflyer) GetParentOrderDetails()
GetParentOrderDetails returns a detailing of a parent order
func (*Bitflyer) GetParentOrders ¶
func (b *Bitflyer) GetParentOrders()
GetParentOrders returns a list of all parent orders
func (*Bitflyer) GetPermissions ¶
func (b *Bitflyer) GetPermissions()
GetPermissions returns current permissions for associated with your API keys
func (*Bitflyer) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*Bitflyer) GetTradingCommission ¶
func (b *Bitflyer) GetTradingCommission()
GetTradingCommission returns trading commission
func (*Bitflyer) GetTransactionByHashCA ¶
func (b *Bitflyer) GetTransactionByHashCA(txHash string) (ChainAnalysisTransaction, error)
GetTransactionByHashCA returns transaction information by txHash from bitflyer chain analysis system
func (*Bitflyer) GetTransactionHistory ¶
func (b *Bitflyer) GetTransactionHistory()
GetTransactionHistory returns a full history of transactions
func (*Bitflyer) ModifyExchangeOrder ¶
ModifyExchangeOrder will allow of changing orderbook placement and limit to market conversion
func (*Bitflyer) SendAuthHTTPRequest ¶
SendAuthHTTPRequest sends an authenticated HTTP request Note: HTTP not done due to incorrect account privileges, please open a PR if you have access and update the authenticated requests
func (*Bitflyer) SendHTTPRequest ¶
SendHTTPRequest sends an unauthenticated request
func (*Bitflyer) SendParentOrder ¶
func (b *Bitflyer) SendParentOrder()
SendParentOrder sends a special order
func (*Bitflyer) SetDefaults ¶
func (b *Bitflyer) SetDefaults()
SetDefaults sets the basic defaults for Bitflyer
func (*Bitflyer) Setup ¶
func (b *Bitflyer) Setup(exch config.ExchangeConfig)
Setup takes in the supplied exchange configuration details and sets params
func (*Bitflyer) SubmitExchangeOrder ¶
func (b *Bitflyer) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error)
SubmitExchangeOrder submits a new order
func (*Bitflyer) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*Bitflyer) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*Bitflyer) WithdrawCryptoExchangeFunds ¶
func (b *Bitflyer) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error)
WithdrawCryptoExchangeFunds returns a withdrawal ID when a withdrawal is submitted
func (*Bitflyer) WithdrawFiatExchangeFunds ¶
func (b *Bitflyer) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error)
WithdrawFiatExchangeFunds returns a withdrawal ID when a withdrawal is submitted
func (*Bitflyer) WithdrawFiatExchangeFundsToInternationalBank ¶
func (b *Bitflyer) WithdrawFiatExchangeFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error)
WithdrawFiatExchangeFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
func (*Bitflyer) WithdrawFunds ¶
func (b *Bitflyer) WithdrawFunds()
WithdrawFunds withdraws funds to a certain bank
type CancellationHistory ¶
type CancellationHistory struct { ID int64 `json:"id"` OrderID string `json:"order_id"` CurrencyCode string `json:"currency_code"` Amount float64 `json:"amount"` Status string `json:"status"` EventDate string `json:"event_date"` }
CancellationHistory cancellation history
type CashDeposit ¶
type CashDeposit struct { ID int64 `json:"id"` OrderID string `json:"order_id"` CurrencyCode string `json:"currency_code"` Amount float64 `json:"amount"` Status string `json:"status"` EventDate string `json:"event_date"` }
CashDeposit holds cash deposit information
type ChainAnalysisAddress ¶
type ChainAnalysisAddress struct { Address string `json:"address"` UnconfirmedBalance float64 `json:"unconfirmed_balance"` ConfirmedBalance float64 `json:"confirmed_balance"` }
ChainAnalysisAddress holds address information from the bitcoin network
type ChainAnalysisBlock ¶
type ChainAnalysisBlock struct { BlockHash string `json:"block_hash"` Height int64 `json:"height"` IsMain bool `json:"is_main"` Version float64 `json:"version"` PreviousBlock string `json:"prev_block"` MerkleRoot string `json:"merkle_root"` Timestamp string `json:"timestamp"` Bits int64 `json:"bits"` Nonce int64 `json:"nonce"` TxNum int64 `json:"txnum"` TotalFees float64 `json:"total_fees"` TxHashes []string `json:"tx_hashes"` }
ChainAnalysisBlock holds block information from the bitcoin network
type ChainAnalysisTransaction ¶
type ChainAnalysisTransaction struct { TxHash string `json:"tx_hash"` BlockHeight int64 `json:"block_height"` Confirmations int64 `json:"confirmed"` Fees float64 `json:"fees"` Size int64 `json:"size"` ReceivedDate string `json:"received_date"` Version float64 `json:"version"` LockTime int64 `json:"lock_time"` Inputs []struct { PrevHash string `json:"prev_hash"` PrevIndex int `json:"prev_index"` Value int64 `json:"value"` Script string `json:"script"` Address string `json:"address"` Sequence int64 `json:"sequence"` } `json:"inputs"` Outputs []struct { Value int64 `json:"value"` Script string `json:"script"` Address string `json:"address"` } `json:"outputs"` }
ChainAnalysisTransaction holds transaction data from the bitcoin network
type ChatLog ¶
type ChatLog struct { Nickname string `json:"nickname"` Message string `json:"message"` Date string `json:"date"` }
ChatLog holds chat log information
type CollateralAccounts ¶
type CollateralAccounts struct { CurrencyCode string `json:"currency_code"` Amount float64 `json:"amount"` }
CollateralAccounts holds collateral balances
type CollateralHistory ¶
type CollateralHistory struct { ID int64 `json:"id"` CurrencyCode string `json:"currency_code"` Change float64 `json:"change"` Amount float64 `json:"amount"` Reason string `json:"reason_code"` Date string `json:"date"` }
CollateralHistory holds collateral history data
type DepositAddress ¶
type DepositAddress struct { Type string `json:"type"` CurrencyCode string `json:"currency_code"` Address string `json:"address"` }
DepositAddress hold depositing address information
type DepositHistory ¶
type DepositHistory struct { ID int64 `json:"id"` OrderID int64 `json:"order_id"` CurrencyCode string `json:"currency_code"` Amount float64 `json:"amount"` Address string `json:"address"` TXHash string `json:"tx_hash"` Status string `json:"status"` EventDate string `json:"event_date"` }
DepositHistory holds deposit history information
type ExecutedTrade ¶
type ExecutedTrade struct { ID int64 `json:"id"` Side string `json:"side"` Price float64 `json:"price"` Size float64 `json:"size"` ExecDate string `json:"exec_date"` BuyAcceptedID string `json:"buy_child_order_acceptance_id"` SellAcceptedID string `json:"sell_child_order_acceptance_id"` }
ExecutedTrade holds past trade information
type Executions ¶
type Executions struct { ID int64 `json:"id"` ChildOrderID string `json:"child_order_id"` Side string `json:"side"` Price float64 `json:"price"` Size float64 `json:"size"` Commission float64 `json:"commission"` ExecDate string `json:"exec_date"` ChildOrderAcceptanceID string `json:"child_order_acceptance_id"` }
Executions holds past executed trade details
type MarginStatus ¶
type MarginStatus struct { Collateral float64 `json:"collateral"` OpenPosPNL float64 `json:"open_position_pnl"` RequiredCollateral float64 `json:"require_collateral"` KeepRate float64 `json:"keep_rate"` }
MarginStatus holds margin status information
type MarketInfo ¶
MarketInfo holds market information returned from bitflyer
type OpenInterest ¶
type OpenInterest struct { ProductCode string `json:"product_code"` Side string `json:"side"` Price float64 `json:"price"` Size float64 `json:"size"` Commission float64 `json:"commission"` SwapPointAccumulate float64 `json:"swap_point_accumulate"` RequiredCollateral float64 `json:"require_collateral"` OpenDate string `json:"open_date"` Leverage float64 `json:"leverage"` PNL float64 `json:"pnl"` }
OpenInterest holds open interest information
type Orderbook ¶
type Orderbook struct { MidPrice float64 `json:"mid_price"` Bids []struct { Price float64 `json:"price"` Size float64 `json:"size"` } `json:"bids"` Asks []struct { Price float64 `json:"price"` Size float64 `json:"size"` } `json:"asks"` }
Orderbook holds orderbook information
type Orders ¶
type Orders struct { ID int64 `json:"id"` ChildOrderID string `json:"child_order_id"` ProductCode string `json:"product_code"` Side string `json:"side"` ChildOrderType string `json:"child_order_type"` Price float64 `json:"price"` AveragePrice float64 `json:"average_price"` Size float64 `json:"size"` ChildOrderState string `json:"child_order_state"` ExpireDate string `json:"expire_date"` ChildOrderDate string `json:"child_order_date"` ChildOrderAcceptanceID string `json:"child_order_acceptance_id"` OutstandingSize float64 `json:"outstanding_size"` CancelSize float64 `json:"cancel_size"` ExecutedSize float64 `json:"executed_size"` TotalCommission float64 `json:"total_commission"` }
Orders holds order full order information
type ParentOrderDetail ¶
type ParentOrderDetail struct { ID int64 `json:"id"` ParentOrderID string `json:"parent_order_id"` OrderMethod string `json:"order_method"` MinutesToExpire float64 `json:"minute_to_expire"` Parameters []struct { ProductCode string `json:"product_code"` ConditionType string `json:"condition_type"` Side string `json:"side"` Price float64 `json:"price"` Size float64 `json:"size"` TriggerPrice float64 `json:"trigger_price"` Offset float64 `json:"offset"` } `json:"parameters"` }
ParentOrderDetail holds detailed information about an order
type ParentOrders ¶
type ParentOrders struct { ID int64 `json:"id"` ParentOrderID string `json:"parent_order_id"` ProductCode string `json:"product_code"` Side string `json:"side"` ParentOrderType string `json:"parent_order_type"` Price float64 `json:"price"` AveragePrice float64 `json:"average_price"` Size float64 `json:"size"` ParentOrderState string `json:"parent_order_state"` ExpireDate string `json:"expire_date"` ParentOrderDate string `json:"parent_order_date"` ParentOrderAcceptanceID string `json:"parent_order_acceptance_id"` OutstandingSize float64 `json:"outstanding_size"` CancelSize float64 `json:"cancel_size"` ExecutedSize float64 `json:"executed_size"` TotalCommission float64 `json:"total_commission"` }
ParentOrders holds order full order information
type Ticker ¶
type Ticker struct { ProductCode string `json:"product_code"` TimeStamp string `json:"timestamp"` TickID int64 `json:"tick_id"` BestBid float64 `json:"best_bid"` BestAsk float64 `json:"best_ask"` BestBidSize float64 `json:"best_bid_size"` BestAskSize float64 `json:"best_ask_size"` TotalBidDepth float64 `json:"total_bid_depth"` TotalAskDepth float64 `json:"total_ask_depth"` Last float64 `json:"ltp"` Volume float64 `json:"volume"` VolumeByProduct float64 `json:"volume_by_product"` }
Ticker holds ticker information
type TransactionHistory ¶
type TransactionHistory struct { ID int64 `json:"id"` OrderID int64 `json:"order_id"` CurrencyCode string `json:"currency_code"` Amount float64 `json:"amount"` Address string `json:"address"` TXHash string `json:"tx_hash"` Fee float64 `json:"fee"` AdditionalFee float64 `json:"additional_fee"` Status string `json:"status"` EventDate string `json:"event_date"` }
TransactionHistory holds prior transaction history data