Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KrakenConvertUSDT ¶
KrakenConvertUSDT converts all USDT to Euros
Types ¶
type ExchangeWithdrawResponse ¶
type ExchangeWithdrawResponse struct { ExchangeResponse *withdraw.ExchangeResponse Exchange string `json:"exchange"` Type withdraw.RequestType `json:"type"` DestinationAddress string `json:"destination"` Time time.Time `json:"time"` Error error `json:"error"` Success bool `json:"success"` }
ExchangeWithdrawResponse is a struct that is designed to represent the response from the ExchangesWithdrawals API call. ExchangesWithdrawals is a simple function which returns deposit, withdraw, trade and withdrawal information so we will only add the information there which we are interested in: ExchangesResponse is a struct that includes information about the request as well as the response, we're only interested in the response hence why we've added resp. We've used the Withdrawal struct as that is the response from the exchange (withdraw.ExchangeResponse). The Exchange key is the exchange used to make the request. The Type key represents the type of information requested in the Call function. The DestinationAddress is the address the withdrawal was sent to if the request used the DepositAddress field. The Time key is when the request was made and the Err field returns errors if any occurred.
func CreateExchangeWithdrawResponse ¶
func CreateExchangeWithdrawResponse(withdrawRequest *withdraw.Request, exchangeManager exchange.IBotExchange) (ExchangeWithdrawResponse, error)
CreateExchangeWithdrawResponse function creates a withraw request using exchangeManager and returns the exchangeWithdrawResponse including response It first creates an exchange manager by name which will fetch the exchange name from the engine. This function will fetch the exchange details from the exchange name and returns the balance of an asset for a user. Next it creates the WithdrawManager for a given exchange, tries to withdraw the crypto asset, and gets the destination address. This is done by calling the withdraw crypto trade function so here's the thing this function returns an Exchange response which holds the deposit id on that exchange. Finally, we update the results which we return in JSON format. After we make sure that the withdrawal functionality is working we can inject the functionality in the withdrawal method of the engine struct.
func KrakenInternationalBankAccountWithdrawal ¶
func KrakenInternationalBankAccountWithdrawal(code currency.Code, d *dealer.Dealer) (ExchangeWithdrawResponse, error)
KrakenInternationalBankAccountWithdrawal withdraws funds to an international bank account