openapi

package module
v0.0.0-...-635a551 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: MIT Imports: 21 Imported by: 0

README

Go API client for openapi

#Overview Deribit provides three different interfaces to access the API: * JSON-RPC over Websocket * JSON-RPC over HTTP * FIX (Financial Information eXchange) With the API Console you can use and test the JSON-RPC API, both via HTTP and via Websocket. To visit the API console, go to Account > API tab > API Console tab. ##Naming Deribit tradeable assets or instruments use the following system of naming: |Kind|Examples|Template|Comments| |----|--------|--------|--------| |Future|BTC-25MAR16, BTC-5AUG16|BTC-DMMMYY|BTC is currency, DMMMYY is expiration date, D stands for day of month (1 or 2 digits), MMM - month (3 first letters in English), YY stands for year.| |Perpetual|BTC-PERPETUAL ||Perpetual contract for currency BTC.| |Option|BTC-25MAR16-420-C, BTC-5AUG16-580-P|BTC-DMMMYY-STRIKE-K|STRIKE is option strike price in USD. Template K is option kind: C for call options or P for put options.| # JSON-RPC JSON-RPC is a light-weight remote procedure call (RPC) protocol. The JSON-RPC specification defines the data structures that are used for the messages that are exchanged between client and server, as well as the rules around their processing. JSON-RPC uses JSON (RFC 4627) as data format. JSON-RPC is transport agnostic: it does not specify which transport mechanism must be used. The Deribit API supports both Websocket (preferred) and HTTP (with limitations: subscriptions are not supported over HTTP). ## Request messages > An example of a request message: json { \"jsonrpc\": \"2.0\", \"id\": 8066, \"method\": \"public/ticker\", \"params\": { \"instrument\": \"BTC-24AUG18-6500-P\" } } According to the JSON-RPC sepcification the requests must be JSON objects with the following fields. |Name|Type|Description| |----|----|-----------| |jsonrpc|string|The version of the JSON-RPC spec: "2.0"| |id|integer or string|An identifier of the request. If it is included, then the response will contain the same identifier| |method|string|The method to be invoked| |params|object|The parameters values for the method. The field names must match with the expected parameter names. The parameters that are expected are described in the documentation for the methods, below.| <aside class="warning"> The JSON-RPC specification describes two features that are currently not supported by the API:

  • Specification of parameter values by position
  • Batch requests
## Response messages > An example of a response message: json { \"jsonrpc\": \"2.0\", \"id\": 5239, \"testnet\": false, \"result\": [ { \"currency\": \"BTC\", \"currencyLong\": \"Bitcoin\", \"minConfirmation\": 2, \"txFee\": 0.0006, \"isActive\": true, \"coinType\": \"BITCOIN\", \"baseAddress\": null } ], \"usIn\": 1535043730126248, \"usOut\": 1535043730126250, \"usDiff\": 2 } The JSON-RPC API always responds with a JSON object with the following fields. |Name|Type|Description| |----|----|-----------| |id|integer|This is the same id that was sent in the request.| |result|any|If successful, the result of the API call. The format for the result is described with each method.| |error|error object|Only present if there was an error invoking the method. The error object is described below.| |testnet|boolean|Indicates whether the API in use is actually the test API. false for production server, true for test server.| |usIn|integer|The timestamp when the requests was received (microseconds since the Unix epoch)| |usOut|integer|The timestamp when the response was sent (microseconds since the Unix epoch)| |usDiff|integer|The number of microseconds that was spent handling the request| <aside class="notice"> The fields testnet, usIn, usOut and usDiff are not part of the JSON-RPC standard.

In order not to clutter the examples they will generally be omitted from the example code.

> An example of a response with an error: json { \"jsonrpc\": \"2.0\", \"id\": 8163, \"error\": { \"code\": 11050, \"message\": \"bad_request\" }, \"testnet\": false, \"usIn\": 1535037392434763, \"usOut\": 1535037392448119, \"usDiff\": 13356 } In case of an error the response message will contain the error field, with as value an object with the following with the following fields: |Name|Type|Description |----|----|-----------| |code|integer|A number that indicates the kind of error.| |message|string|A short description that indicates the kind of error.| |data|any|Additional data about the error. This field may be omitted.| ## Notifications > An example of a notification: json { \"jsonrpc\": \"2.0\", \"method\": \"subscription\", \"params\": { \"channel\": \"deribit_price_index.btc_usd\", \"data\": { \"timestamp\": 1535098298227, \"price\": 6521.17, \"index_name\": \"btc_usd\" } } } API users can subscribe to certain types of notifications. This means that they will receive JSON-RPC notification-messages from the server when certain events occur, such as changes to the index price or changes to the order book for a certain instrument. The API methods public/subscribe and private/subscribe are used to set up a subscription. Since HTTP does not support the sending of messages from server to client, these methods are only availble when using the Websocket transport mechanism. At the moment of subscription a "channel" must be specified. The channel determines the type of events that will be received. See Subscriptions for more details about the channels. In accordance with the JSON-RPC specification, the format of a notification is that of a request message without an id field. The value of the method field will always be "subscription". The params field will always be an object with 2 members: channel and data. The value of the channel member is the name of the channel (a string). The value of the data member is an object that contains data that is specific for the channel. ## Authentication > An example of a JSON request with token: json { \"id\": 5647, \"method\": \"private/get_subaccounts\", \"params\": { \"access_token\": \"67SVutDoVZSzkUStHSuk51WntMNBJ5mh5DYZhwzpiqDF\" } } The API consists of public and private methods. The public methods do not require authentication. The private methods use OAuth 2.0 authentication. This means that a valid OAuth access token must be included in the request, which can get achived by calling method public/auth. When the token was assigned to the user, it should be passed along, with other request parameters, back to the server: |Connection type|Access token placement |----|-----------| |Websocket|Inside request JSON parameters, as an access_token field| |HTTP (REST)|Header Authorization: bearer ```Token``` value| ### Additional authorization method - basic user credentials <span style="color:red"> ! Not recommended - however, it could be useful for quick testing API
Every private method could be accessed by providing, inside HTTP Authorization: Basic XXX header, values with user ClientId and assigned ClientSecret (both values can be found on the API page on the Deribit website) encoded with Base64: Authorization: Basic BASE64(ClientId + : + ClientSecret) ### Additional authorization method - Deribit signature credentials The Derbit service provides dedicated authorization method, which harness user generated signature to increase security level for passing request data. Generated value is passed inside Authorization header, coded as: Authorization: deri-hmac-sha256 id=ClientId,ts=Timestamp,sig=Signature,nonce=Nonce where: |Deribit credential|Description |----|-----------| |ClientId|Can be found on the API page on the Deribit website| |Timestamp|Time when the request was generated - given as miliseconds. It's valid for 60 seconds since generation, after that time any request with an old timestamp will be rejected.| |Signature|Value for signature calculated as described below | |Nonce|Single usage, user generated initialization vector for the server token| The signature is generated by the following formula: Signature = HEX_STRING( HMAC-SHA256( ClientSecret, StringToSign ) );
StringToSign = Timestamp + "\n" + Nonce + "\n" + RequestData;
RequestData = UPPERCASE(HTTP_METHOD()) + "\n" + URI() + "\n" + RequestBody + "\n";
e.g. (using shell with openssl tool):     ClientId=AAAAAAAAAAA
    ClientSecret=ABCD
    Timestamp=$( date +%s000 )
    Nonce=$( cat /dev/urandom | tr -dc 'a-z0-9' | head -c8 )
    URI="/api/v2/private/get_account_summary?currency=BTC"
    HttpMethod=GET
    Body=""

    Signature=$( echo -ne "${Timestamp}\n${Nonce}\n${HttpMethod}\n${URI}\n${Body}\n" | openssl sha256 -r -hmac "$ClientSecret" | cut -f1 -d' ' )

    echo $Signature

    shell output> ea40d5e5e4fae235ab22b61da98121fbf4acdc06db03d632e23c66bcccb90d2c (WARNING: Exact value depends on current timestamp and client credentials

    curl -s -X ${HttpMethod} -H "Authorization: deri-hmac-sha256 id=${ClientId},ts=${Timestamp},nonce=${Nonce},sig=${Signature}" "https://www.deribit.com${URI}"

### Additional authorization method - signature credentials (WebSocket API) When connecting through Websocket, user can request for authorization using client_credential method, which requires providing following parameters (as a part of JSON request): |JSON parameter|Description |----|-----------| |grant_type|Must be client_signature| |client_id|Can be found on the API page on the Deribit website| |timestamp|Time when the request was generated - given as miliseconds. It's valid for 60 seconds since generation, after that time any request with an old timestamp will be rejected.| |signature|Value for signature calculated as described below | |nonce|Single usage, user generated initialization vector for the server token| |data|Optional field, which contains any user specific value| The signature is generated by the following formula: StringToSign = Timestamp + "\n" + Nonce + "\n" + Data;
Signature = HEX_STRING( HMAC-SHA256( ClientSecret, StringToSign ) );
e.g. (using shell with openssl tool):     ClientId=AAAAAAAAAAA
    ClientSecret=ABCD
    Timestamp=$( date +%s000 ) # e.g. 1554883365000
    Nonce=$( cat /dev/urandom | tr -dc 'a-z0-9' | head -c8 ) # e.g. fdbmmz79
    Data=""

    Signature=$( echo -ne "${Timestamp}\n${Nonce}\n${Data}\n" | openssl sha256 -r -hmac "$ClientSecret" | cut -f1 -d' ' )

    echo $Signature

    shell output> e20c9cd5639d41f8bbc88f4d699c4baf94a4f0ee320e9a116b72743c449eb994 (WARNING: Exact value depends on current timestamp and client credentials

You can also check the signature value using some online tools like, e.g: https://codebeautify.org/hmac-generator (but don't forget about adding newline after each part of the hashed text and remember that you should use it only with your test credentials). Here's a sample JSON request created using the values from the example above: {
  "jsonrpc" : "2.0",
  "id" : 9929,
  "method" : "public/auth",
  "params" :
  {
    "grant_type" : "client_signature",
    "client_id" : "AAAAAAAAAAA",
    "timestamp": "1554883365000",
    "nonce": "fdbmmz79",
    "data": "",
    "signature" : "e20c9cd5639d41f8bbc88f4d699c4baf94a4f0ee320e9a116b72743c449eb994"
  }
}
### Access scope When asking for access token user can provide the required access level (called scope) which defines what type of functionality he/she wants to use, and whether requests are only going to check for some data or also to update them. Scopes are required and checked for private methods, so if you plan to use only public information you can stay with values assigned by default. |Scope|Description |----|-----------| |account:read|Access to account methods - read only data| |account:read_write|Access to account methods - allows to manage account settings, add subaccounts, etc.| |trade:read|Access to trade methods - read only data| |trade:read_write|Access to trade methods - required to create and modify orders| |wallet:read|Access to wallet methods - read only data| |wallet:read_write|Access to wallet methods - allows to withdraw, generate new deposit address, etc.| |wallet:none, account:none, trade:none|Blocked access to specified functionality| <span style="color:red">NOTICE: Depending on choosing an authentication method (grant type) some scopes could be narrowed by the server. e.g. when grant_type = client_credentials and scope = wallet:read_write it's modified by the server as scope = wallet:read" ## JSON-RPC over websocket Websocket is the prefered transport mechanism for the JSON-RPC API, because it is faster and because it can support subscriptions and cancel on disconnect. The code examples that can be found next to each of the methods show how websockets can be used from Python or Javascript/node.js. ## JSON-RPC over HTTP Besides websockets it is also possible to use the API via HTTP. The code examples for 'shell' show how this can be done using curl. Note that subscriptions and cancel on disconnect are not supported via HTTP. #Methods

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 2.0.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional

Put the package under your project folder and add the following in import:

import "./openapi"

Documentation for API Endpoints

All URIs are relative to https://www.deribit.com/api/v2

Class Method HTTP request Description
AccountManagementApi PrivateChangeSubaccountNameGet Get /private/change_subaccount_name Change the user name for a subaccount
AccountManagementApi PrivateCreateSubaccountGet Get /private/create_subaccount Create a new subaccount
AccountManagementApi PrivateDisableTfaForSubaccountGet Get /private/disable_tfa_for_subaccount Disable two factor authentication for a subaccount.
AccountManagementApi PrivateGetAccountSummaryGet Get /private/get_account_summary Retrieves user account summary.
AccountManagementApi PrivateGetEmailLanguageGet Get /private/get_email_language Retrieves the language to be used for emails.
AccountManagementApi PrivateGetNewAnnouncementsGet Get /private/get_new_announcements Retrieves announcements that have not been marked read by the user.
AccountManagementApi PrivateGetPositionGet Get /private/get_position Retrieve user position.
AccountManagementApi PrivateGetPositionsGet Get /private/get_positions Retrieve user positions.
AccountManagementApi PrivateGetSubaccountsGet Get /private/get_subaccounts Get information about subaccounts
AccountManagementApi PrivateSetAnnouncementAsReadGet Get /private/set_announcement_as_read Marks an announcement as read, so it will not be shown in `get_new_announcements`.
AccountManagementApi PrivateSetEmailForSubaccountGet Get /private/set_email_for_subaccount Assign an email address to a subaccount. User will receive an email with confirmation link.
AccountManagementApi PrivateSetEmailLanguageGet Get /private/set_email_language Changes the language to be used for emails.
AccountManagementApi PrivateSetPasswordForSubaccountGet Get /private/set_password_for_subaccount Set the password for the subaccount
AccountManagementApi PrivateToggleNotificationsFromSubaccountGet Get /private/toggle_notifications_from_subaccount Enable or disable sending of notifications for the subaccount.
AccountManagementApi PrivateToggleSubaccountLoginGet Get /private/toggle_subaccount_login Enable or disable login for a subaccount. If login is disabled and a session for the subaccount exists, this session will be terminated.
AccountManagementApi PublicGetAnnouncementsGet Get /public/get_announcements Retrieves announcements from the last 30 days.
AuthenticationApi PublicAuthGet Get /public/auth Authenticate
InternalApi PrivateAddToAddressBookGet Get /private/add_to_address_book Adds new entry to address book of given type
InternalApi PrivateDisableTfaWithRecoveryCodeGet Get /private/disable_tfa_with_recovery_code Disables TFA with one time recovery code
InternalApi PrivateGetAddressBookGet Get /private/get_address_book Retrieves address book of given type
InternalApi PrivateRemoveFromAddressBookGet Get /private/remove_from_address_book Adds new entry to address book of given type
InternalApi PrivateSubmitTransferToSubaccountGet Get /private/submit_transfer_to_subaccount Transfer funds to a subaccount.
InternalApi PrivateSubmitTransferToUserGet Get /private/submit_transfer_to_user Transfer funds to a another user.
InternalApi PrivateToggleDepositAddressCreationGet Get /private/toggle_deposit_address_creation Enable or disable deposit address creation
InternalApi PublicGetFooterGet Get /public/get_footer Get information to be displayed in the footer of the website.
InternalApi PublicGetOptionMarkPricesGet Get /public/get_option_mark_prices Retrives market prices and its implied volatility of options instruments
InternalApi PublicValidateFieldGet Get /public/validate_field Method used to introduce the client software connected to Deribit platform over websocket. Provided data may have an impact on the maintained connection and will be collected for internal statistical purposes. In response, Deribit will also introduce itself.
MarketDataApi PublicGetBookSummaryByCurrencyGet Get /public/get_book_summary_by_currency Retrieves the summary information such as open interest, 24h volume, etc. for all instruments for the currency (optionally filtered by kind).
MarketDataApi PublicGetBookSummaryByInstrumentGet Get /public/get_book_summary_by_instrument Retrieves the summary information such as open interest, 24h volume, etc. for a specific instrument.
MarketDataApi PublicGetContractSizeGet Get /public/get_contract_size Retrieves contract size of provided instrument.
MarketDataApi PublicGetCurrenciesGet Get /public/get_currencies Retrieves all cryptocurrencies supported by the API.
MarketDataApi PublicGetFundingChartDataGet Get /public/get_funding_chart_data Retrieve the latest user trades that have occurred for PERPETUAL instruments in a specific currency symbol and within given time range.
MarketDataApi PublicGetHistoricalVolatilityGet Get /public/get_historical_volatility Provides information about historical volatility for given cryptocurrency.
MarketDataApi PublicGetIndexGet Get /public/get_index Retrieves the current index price for the instruments, for the selected currency.
MarketDataApi PublicGetInstrumentsGet Get /public/get_instruments Retrieves available trading instruments. This method can be used to see which instruments are available for trading, or which instruments have existed historically.
MarketDataApi PublicGetLastSettlementsByCurrencyGet Get /public/get_last_settlements_by_currency Retrieves historical settlement, delivery and bankruptcy events coming from all instruments within given currency.
MarketDataApi PublicGetLastSettlementsByInstrumentGet Get /public/get_last_settlements_by_instrument Retrieves historical public settlement, delivery and bankruptcy events filtered by instrument name.
MarketDataApi PublicGetLastTradesByCurrencyAndTimeGet Get /public/get_last_trades_by_currency_and_time Retrieve the latest trades that have occurred for instruments in a specific currency symbol and within given time range.
MarketDataApi PublicGetLastTradesByCurrencyGet Get /public/get_last_trades_by_currency Retrieve the latest trades that have occurred for instruments in a specific currency symbol.
MarketDataApi PublicGetLastTradesByInstrumentAndTimeGet Get /public/get_last_trades_by_instrument_and_time Retrieve the latest trades that have occurred for a specific instrument and within given time range.
MarketDataApi PublicGetLastTradesByInstrumentGet Get /public/get_last_trades_by_instrument Retrieve the latest trades that have occurred for a specific instrument.
MarketDataApi PublicGetOrderBookGet Get /public/get_order_book Retrieves the order book, along with other market values for a given instrument.
MarketDataApi PublicGetTradeVolumesGet Get /public/get_trade_volumes Retrieves aggregated 24h trade volumes for different instrument types and currencies.
MarketDataApi PublicGetTradingviewChartDataGet Get /public/get_tradingview_chart_data Publicly available market data used to generate a TradingView candle chart.
MarketDataApi PublicTickerGet Get /public/ticker Get ticker for an instrument.
PrivateApi PrivateAddToAddressBookGet Get /private/add_to_address_book Adds new entry to address book of given type
PrivateApi PrivateBuyGet Get /private/buy Places a buy order for an instrument.
PrivateApi PrivateCancelAllByCurrencyGet Get /private/cancel_all_by_currency Cancels all orders by currency, optionally filtered by instrument kind and/or order type.
PrivateApi PrivateCancelAllByInstrumentGet Get /private/cancel_all_by_instrument Cancels all orders by instrument, optionally filtered by order type.
PrivateApi PrivateCancelAllGet Get /private/cancel_all This method cancels all users orders and stop orders within all currencies and instrument kinds.
PrivateApi PrivateCancelGet Get /private/cancel Cancel an order, specified by order id
PrivateApi PrivateCancelTransferByIdGet Get /private/cancel_transfer_by_id Cancel transfer
PrivateApi PrivateCancelWithdrawalGet Get /private/cancel_withdrawal Cancels withdrawal request
PrivateApi PrivateChangeSubaccountNameGet Get /private/change_subaccount_name Change the user name for a subaccount
PrivateApi PrivateClosePositionGet Get /private/close_position Makes closing position reduce only order .
PrivateApi PrivateCreateDepositAddressGet Get /private/create_deposit_address Creates deposit address in currency
PrivateApi PrivateCreateSubaccountGet Get /private/create_subaccount Create a new subaccount
PrivateApi PrivateDisableTfaForSubaccountGet Get /private/disable_tfa_for_subaccount Disable two factor authentication for a subaccount.
PrivateApi PrivateDisableTfaWithRecoveryCodeGet Get /private/disable_tfa_with_recovery_code Disables TFA with one time recovery code
PrivateApi PrivateEditGet Get /private/edit Change price, amount and/or other properties of an order.
PrivateApi PrivateGetAccountSummaryGet Get /private/get_account_summary Retrieves user account summary.
PrivateApi PrivateGetAddressBookGet Get /private/get_address_book Retrieves address book of given type
PrivateApi PrivateGetCurrentDepositAddressGet Get /private/get_current_deposit_address Retrieve deposit address for currency
PrivateApi PrivateGetDepositsGet Get /private/get_deposits Retrieve the latest users deposits
PrivateApi PrivateGetEmailLanguageGet Get /private/get_email_language Retrieves the language to be used for emails.
PrivateApi PrivateGetMarginsGet Get /private/get_margins Get margins for given instrument, amount and price.
PrivateApi PrivateGetNewAnnouncementsGet Get /private/get_new_announcements Retrieves announcements that have not been marked read by the user.
PrivateApi PrivateGetOpenOrdersByCurrencyGet Get /private/get_open_orders_by_currency Retrieves list of user's open orders.
PrivateApi PrivateGetOpenOrdersByInstrumentGet Get /private/get_open_orders_by_instrument Retrieves list of user's open orders within given Instrument.
PrivateApi PrivateGetOrderHistoryByCurrencyGet Get /private/get_order_history_by_currency Retrieves history of orders that have been partially or fully filled.
PrivateApi PrivateGetOrderHistoryByInstrumentGet Get /private/get_order_history_by_instrument Retrieves history of orders that have been partially or fully filled.
PrivateApi PrivateGetOrderMarginByIdsGet Get /private/get_order_margin_by_ids Retrieves initial margins of given orders
PrivateApi PrivateGetOrderStateGet Get /private/get_order_state Retrieve the current state of an order.
PrivateApi PrivateGetPositionGet Get /private/get_position Retrieve user position.
PrivateApi PrivateGetPositionsGet Get /private/get_positions Retrieve user positions.
PrivateApi PrivateGetSettlementHistoryByCurrencyGet Get /private/get_settlement_history_by_currency Retrieves settlement, delivery and bankruptcy events that have affected your account.
PrivateApi PrivateGetSettlementHistoryByInstrumentGet Get /private/get_settlement_history_by_instrument Retrieves public settlement, delivery and bankruptcy events filtered by instrument name
PrivateApi PrivateGetSubaccountsGet Get /private/get_subaccounts Get information about subaccounts
PrivateApi PrivateGetTransfersGet Get /private/get_transfers Adds new entry to address book of given type
PrivateApi PrivateGetUserTradesByCurrencyAndTimeGet Get /private/get_user_trades_by_currency_and_time Retrieve the latest user trades that have occurred for instruments in a specific currency symbol and within given time range.
PrivateApi PrivateGetUserTradesByCurrencyGet Get /private/get_user_trades_by_currency Retrieve the latest user trades that have occurred for instruments in a specific currency symbol.
PrivateApi PrivateGetUserTradesByInstrumentAndTimeGet Get /private/get_user_trades_by_instrument_and_time Retrieve the latest user trades that have occurred for a specific instrument and within given time range.
PrivateApi PrivateGetUserTradesByInstrumentGet Get /private/get_user_trades_by_instrument Retrieve the latest user trades that have occurred for a specific instrument.
PrivateApi PrivateGetUserTradesByOrderGet Get /private/get_user_trades_by_order Retrieve the list of user trades that was created for given order
PrivateApi PrivateGetWithdrawalsGet Get /private/get_withdrawals Retrieve the latest users withdrawals
PrivateApi PrivateRemoveFromAddressBookGet Get /private/remove_from_address_book Adds new entry to address book of given type
PrivateApi PrivateSellGet Get /private/sell Places a sell order for an instrument.
PrivateApi PrivateSetAnnouncementAsReadGet Get /private/set_announcement_as_read Marks an announcement as read, so it will not be shown in `get_new_announcements`.
PrivateApi PrivateSetEmailForSubaccountGet Get /private/set_email_for_subaccount Assign an email address to a subaccount. User will receive an email with confirmation link.
PrivateApi PrivateSetEmailLanguageGet Get /private/set_email_language Changes the language to be used for emails.
PrivateApi PrivateSetPasswordForSubaccountGet Get /private/set_password_for_subaccount Set the password for the subaccount
PrivateApi PrivateSubmitTransferToSubaccountGet Get /private/submit_transfer_to_subaccount Transfer funds to a subaccount.
PrivateApi PrivateSubmitTransferToUserGet Get /private/submit_transfer_to_user Transfer funds to a another user.
PrivateApi PrivateToggleDepositAddressCreationGet Get /private/toggle_deposit_address_creation Enable or disable deposit address creation
PrivateApi PrivateToggleNotificationsFromSubaccountGet Get /private/toggle_notifications_from_subaccount Enable or disable sending of notifications for the subaccount.
PrivateApi PrivateToggleSubaccountLoginGet Get /private/toggle_subaccount_login Enable or disable login for a subaccount. If login is disabled and a session for the subaccount exists, this session will be terminated.
PrivateApi PrivateWithdrawGet Get /private/withdraw Creates a new withdrawal request
PublicApi PublicAuthGet Get /public/auth Authenticate
PublicApi PublicGetAnnouncementsGet Get /public/get_announcements Retrieves announcements from the last 30 days.
PublicApi PublicGetBookSummaryByCurrencyGet Get /public/get_book_summary_by_currency Retrieves the summary information such as open interest, 24h volume, etc. for all instruments for the currency (optionally filtered by kind).
PublicApi PublicGetBookSummaryByInstrumentGet Get /public/get_book_summary_by_instrument Retrieves the summary information such as open interest, 24h volume, etc. for a specific instrument.
PublicApi PublicGetContractSizeGet Get /public/get_contract_size Retrieves contract size of provided instrument.
PublicApi PublicGetCurrenciesGet Get /public/get_currencies Retrieves all cryptocurrencies supported by the API.
PublicApi PublicGetFundingChartDataGet Get /public/get_funding_chart_data Retrieve the latest user trades that have occurred for PERPETUAL instruments in a specific currency symbol and within given time range.
PublicApi PublicGetHistoricalVolatilityGet Get /public/get_historical_volatility Provides information about historical volatility for given cryptocurrency.
PublicApi PublicGetIndexGet Get /public/get_index Retrieves the current index price for the instruments, for the selected currency.
PublicApi PublicGetInstrumentsGet Get /public/get_instruments Retrieves available trading instruments. This method can be used to see which instruments are available for trading, or which instruments have existed historically.
PublicApi PublicGetLastSettlementsByCurrencyGet Get /public/get_last_settlements_by_currency Retrieves historical settlement, delivery and bankruptcy events coming from all instruments within given currency.
PublicApi PublicGetLastSettlementsByInstrumentGet Get /public/get_last_settlements_by_instrument Retrieves historical public settlement, delivery and bankruptcy events filtered by instrument name.
PublicApi PublicGetLastTradesByCurrencyAndTimeGet Get /public/get_last_trades_by_currency_and_time Retrieve the latest trades that have occurred for instruments in a specific currency symbol and within given time range.
PublicApi PublicGetLastTradesByCurrencyGet Get /public/get_last_trades_by_currency Retrieve the latest trades that have occurred for instruments in a specific currency symbol.
PublicApi PublicGetLastTradesByInstrumentAndTimeGet Get /public/get_last_trades_by_instrument_and_time Retrieve the latest trades that have occurred for a specific instrument and within given time range.
PublicApi PublicGetLastTradesByInstrumentGet Get /public/get_last_trades_by_instrument Retrieve the latest trades that have occurred for a specific instrument.
PublicApi PublicGetOrderBookGet Get /public/get_order_book Retrieves the order book, along with other market values for a given instrument.
PublicApi PublicGetTimeGet Get /public/get_time Retrieves the current time (in milliseconds). This API endpoint can be used to check the clock skew between your software and Deribit's systems.
PublicApi PublicGetTradeVolumesGet Get /public/get_trade_volumes Retrieves aggregated 24h trade volumes for different instrument types and currencies.
PublicApi PublicGetTradingviewChartDataGet Get /public/get_tradingview_chart_data Publicly available market data used to generate a TradingView candle chart.
PublicApi PublicTestGet Get /public/test Tests the connection to the API server, and returns its version. You can use this to make sure the API is reachable, and matches the expected version.
PublicApi PublicTickerGet Get /public/ticker Get ticker for an instrument.
PublicApi PublicValidateFieldGet Get /public/validate_field Method used to introduce the client software connected to Deribit platform over websocket. Provided data may have an impact on the maintained connection and will be collected for internal statistical purposes. In response, Deribit will also introduce itself.
SupportingApi PublicGetTimeGet Get /public/get_time Retrieves the current time (in milliseconds). This API endpoint can be used to check the clock skew between your software and Deribit's systems.
SupportingApi PublicTestGet Get /public/test Tests the connection to the API server, and returns its version. You can use this to make sure the API is reachable, and matches the expected version.
TradingApi PrivateBuyGet Get /private/buy Places a buy order for an instrument.
TradingApi PrivateCancelAllByCurrencyGet Get /private/cancel_all_by_currency Cancels all orders by currency, optionally filtered by instrument kind and/or order type.
TradingApi PrivateCancelAllByInstrumentGet Get /private/cancel_all_by_instrument Cancels all orders by instrument, optionally filtered by order type.
TradingApi PrivateCancelAllGet Get /private/cancel_all This method cancels all users orders and stop orders within all currencies and instrument kinds.
TradingApi PrivateCancelGet Get /private/cancel Cancel an order, specified by order id
TradingApi PrivateClosePositionGet Get /private/close_position Makes closing position reduce only order .
TradingApi PrivateEditGet Get /private/edit Change price, amount and/or other properties of an order.
TradingApi PrivateGetMarginsGet Get /private/get_margins Get margins for given instrument, amount and price.
TradingApi PrivateGetOpenOrdersByCurrencyGet Get /private/get_open_orders_by_currency Retrieves list of user's open orders.
TradingApi PrivateGetOpenOrdersByInstrumentGet Get /private/get_open_orders_by_instrument Retrieves list of user's open orders within given Instrument.
TradingApi PrivateGetOrderHistoryByCurrencyGet Get /private/get_order_history_by_currency Retrieves history of orders that have been partially or fully filled.
TradingApi PrivateGetOrderHistoryByInstrumentGet Get /private/get_order_history_by_instrument Retrieves history of orders that have been partially or fully filled.
TradingApi PrivateGetOrderMarginByIdsGet Get /private/get_order_margin_by_ids Retrieves initial margins of given orders
TradingApi PrivateGetOrderStateGet Get /private/get_order_state Retrieve the current state of an order.
TradingApi PrivateGetSettlementHistoryByCurrencyGet Get /private/get_settlement_history_by_currency Retrieves settlement, delivery and bankruptcy events that have affected your account.
TradingApi PrivateGetSettlementHistoryByInstrumentGet Get /private/get_settlement_history_by_instrument Retrieves public settlement, delivery and bankruptcy events filtered by instrument name
TradingApi PrivateGetUserTradesByCurrencyAndTimeGet Get /private/get_user_trades_by_currency_and_time Retrieve the latest user trades that have occurred for instruments in a specific currency symbol and within given time range.
TradingApi PrivateGetUserTradesByCurrencyGet Get /private/get_user_trades_by_currency Retrieve the latest user trades that have occurred for instruments in a specific currency symbol.
TradingApi PrivateGetUserTradesByInstrumentAndTimeGet Get /private/get_user_trades_by_instrument_and_time Retrieve the latest user trades that have occurred for a specific instrument and within given time range.
TradingApi PrivateGetUserTradesByInstrumentGet Get /private/get_user_trades_by_instrument Retrieve the latest user trades that have occurred for a specific instrument.
TradingApi PrivateGetUserTradesByOrderGet Get /private/get_user_trades_by_order Retrieve the list of user trades that was created for given order
TradingApi PrivateSellGet Get /private/sell Places a sell order for an instrument.
WalletApi PrivateAddToAddressBookGet Get /private/add_to_address_book Adds new entry to address book of given type
WalletApi PrivateCancelTransferByIdGet Get /private/cancel_transfer_by_id Cancel transfer
WalletApi PrivateCancelWithdrawalGet Get /private/cancel_withdrawal Cancels withdrawal request
WalletApi PrivateCreateDepositAddressGet Get /private/create_deposit_address Creates deposit address in currency
WalletApi PrivateGetAddressBookGet Get /private/get_address_book Retrieves address book of given type
WalletApi PrivateGetCurrentDepositAddressGet Get /private/get_current_deposit_address Retrieve deposit address for currency
WalletApi PrivateGetDepositsGet Get /private/get_deposits Retrieve the latest users deposits
WalletApi PrivateGetTransfersGet Get /private/get_transfers Adds new entry to address book of given type
WalletApi PrivateGetWithdrawalsGet Get /private/get_withdrawals Retrieve the latest users withdrawals
WalletApi PrivateRemoveFromAddressBookGet Get /private/remove_from_address_book Adds new entry to address book of given type
WalletApi PrivateSubmitTransferToSubaccountGet Get /private/submit_transfer_to_subaccount Transfer funds to a subaccount.
WalletApi PrivateSubmitTransferToUserGet Get /private/submit_transfer_to_user Transfer funds to a another user.
WalletApi PrivateToggleDepositAddressCreationGet Get /private/toggle_deposit_address_creation Enable or disable deposit address creation
WalletApi PrivateWithdrawGet Get /private/withdraw Creates a new withdrawal request

Documentation For Models

Documentation For Authorization

bearerAuth

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

Author

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	AccountManagementApi *AccountManagementApiService

	AuthenticationApi *AuthenticationApiService

	InternalApi *InternalApiService

	MarketDataApi *MarketDataApiService

	PrivateApi *PrivateApiService

	PublicApi *PublicApiService

	SupportingApi *SupportingApiService

	TradingApi *TradingApiService

	WalletApi *WalletApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the Deribit API API v2.0.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

Change base path to allow switching to mocks

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the OpenAPI operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

type AccountManagementApiService

type AccountManagementApiService service

func (*AccountManagementApiService) PrivateChangeSubaccountNameGet

func (a *AccountManagementApiService) PrivateChangeSubaccountNameGet(ctx context.Context, sid int32, name string) (map[string]interface{}, *http.Response, error)

AccountManagementApiService Change the user name for a subaccount

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param sid The user id for the subaccount
  • @param name The new user name

@return map[string]interface{}

func (*AccountManagementApiService) PrivateCreateSubaccountGet

func (a *AccountManagementApiService) PrivateCreateSubaccountGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

AccountManagementApiService Create a new subaccount

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*AccountManagementApiService) PrivateDisableTfaForSubaccountGet

func (a *AccountManagementApiService) PrivateDisableTfaForSubaccountGet(ctx context.Context, sid int32) (map[string]interface{}, *http.Response, error)

AccountManagementApiService Disable two factor authentication for a subaccount.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param sid The user id for the subaccount

@return map[string]interface{}

func (*AccountManagementApiService) PrivateGetAccountSummaryGet

func (a *AccountManagementApiService) PrivateGetAccountSummaryGet(ctx context.Context, currency string, localVarOptionals *PrivateGetAccountSummaryGetOpts) (map[string]interface{}, *http.Response, error)

func (*AccountManagementApiService) PrivateGetEmailLanguageGet

func (a *AccountManagementApiService) PrivateGetEmailLanguageGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

AccountManagementApiService Retrieves the language to be used for emails.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*AccountManagementApiService) PrivateGetNewAnnouncementsGet

func (a *AccountManagementApiService) PrivateGetNewAnnouncementsGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

AccountManagementApiService Retrieves announcements that have not been marked read by the user.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*AccountManagementApiService) PrivateGetPositionGet

func (a *AccountManagementApiService) PrivateGetPositionGet(ctx context.Context, instrumentName string) (map[string]interface{}, *http.Response, error)

AccountManagementApiService Retrieve user position.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param instrumentName Instrument name

@return map[string]interface{}

func (*AccountManagementApiService) PrivateGetPositionsGet

func (a *AccountManagementApiService) PrivateGetPositionsGet(ctx context.Context, currency string, localVarOptionals *PrivateGetPositionsGetOpts) (map[string]interface{}, *http.Response, error)

func (*AccountManagementApiService) PrivateGetSubaccountsGet

func (a *AccountManagementApiService) PrivateGetSubaccountsGet(ctx context.Context, localVarOptionals *PrivateGetSubaccountsGetOpts) (map[string]interface{}, *http.Response, error)

func (*AccountManagementApiService) PrivateSetAnnouncementAsReadGet

func (a *AccountManagementApiService) PrivateSetAnnouncementAsReadGet(ctx context.Context, announcementId float32) (map[string]interface{}, *http.Response, error)

AccountManagementApiService Marks an announcement as read, so it will not be shown in `get_new_announcements`.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param announcementId the ID of the announcement

@return map[string]interface{}

func (*AccountManagementApiService) PrivateSetEmailForSubaccountGet

func (a *AccountManagementApiService) PrivateSetEmailForSubaccountGet(ctx context.Context, sid int32, email string) (map[string]interface{}, *http.Response, error)

AccountManagementApiService Assign an email address to a subaccount. User will receive an email with confirmation link.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param sid The user id for the subaccount
  • @param email The email address for the subaccount

@return map[string]interface{}

func (*AccountManagementApiService) PrivateSetEmailLanguageGet

func (a *AccountManagementApiService) PrivateSetEmailLanguageGet(ctx context.Context, language string) (map[string]interface{}, *http.Response, error)

AccountManagementApiService Changes the language to be used for emails.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param language The abbreviated language name. Valid values include `\"en\"`, `\"ko\"`, `\"zh\"`

@return map[string]interface{}

func (*AccountManagementApiService) PrivateSetPasswordForSubaccountGet

func (a *AccountManagementApiService) PrivateSetPasswordForSubaccountGet(ctx context.Context, sid int32, password string) (map[string]interface{}, *http.Response, error)

AccountManagementApiService Set the password for the subaccount

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param sid The user id for the subaccount
  • @param password The password for the subaccount

@return map[string]interface{}

func (*AccountManagementApiService) PrivateToggleNotificationsFromSubaccountGet

func (a *AccountManagementApiService) PrivateToggleNotificationsFromSubaccountGet(ctx context.Context, sid int32, state bool) (map[string]interface{}, *http.Response, error)

AccountManagementApiService Enable or disable sending of notifications for the subaccount.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param sid The user id for the subaccount
  • @param state enable (`true`) or disable (`false`) notifications

@return map[string]interface{}

func (*AccountManagementApiService) PrivateToggleSubaccountLoginGet

func (a *AccountManagementApiService) PrivateToggleSubaccountLoginGet(ctx context.Context, sid int32, state string) (map[string]interface{}, *http.Response, error)

AccountManagementApiService Enable or disable login for a subaccount. If login is disabled and a session for the subaccount exists, this session will be terminated.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param sid The user id for the subaccount
  • @param state enable or disable login.

@return map[string]interface{}

func (*AccountManagementApiService) PublicGetAnnouncementsGet

func (a *AccountManagementApiService) PublicGetAnnouncementsGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

AccountManagementApiService Retrieves announcements from the last 30 days.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

type AddressBookItem

type AddressBookItem struct {
	// Currency, i.e `\"BTC\"`, `\"ETH\"`
	Currency string `json:"currency"`
	// Address in proper format for currency
	Address string `json:"address"`
	// Address book type
	Type string `json:"type,omitempty"`
	// The timestamp (seconds since the Unix epoch, with millisecond precision)
	CreationTimestamp int32 `json:"creation_timestamp"`
}

type AuthenticationApiService

type AuthenticationApiService service

func (*AuthenticationApiService) PublicAuthGet

func (a *AuthenticationApiService) PublicAuthGet(ctx context.Context, grantType string, username string, password string, clientId string, clientSecret string, refreshToken string, timestamp string, signature string, localVarOptionals *PublicAuthGetOpts) (map[string]interface{}, *http.Response, error)

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type BookSummary

type BookSummary struct {
	// Name of the underlying future, or `'index_price'` (options only)
	UnderlyingIndex string `json:"underlying_index,omitempty"`
	// The total 24h traded volume (in base currency)
	Volume float32 `json:"volume"`
	// Volume in usd (futures only)
	VolumeUsd float32 `json:"volume_usd,omitempty"`
	// underlying price for implied volatility calculations (options only)
	UnderlyingPrice float32 `json:"underlying_price,omitempty"`
	// The current best bid price, `null` if there aren't any bids
	BidPrice float32 `json:"bid_price"`
	// The total amount of outstanding contracts in the corresponding amount units. For perpetual and futures the amount is in USD units, for options it is amount of corresponding cryptocurrency contracts, e.g., BTC or ETH.
	OpenInterest float32 `json:"open_interest"`
	// Quote currency
	QuoteCurrency string `json:"quote_currency"`
	// Price of the 24h highest trade
	High float32 `json:"high"`
	// Estimated delivery price, in USD (futures only). For more details, see Documentation > General > Expiration Price
	EstimatedDeliveryPrice float32 `json:"estimated_delivery_price,omitempty"`
	// The price of the latest trade, `null` if there weren't any trades
	Last float32 `json:"last"`
	// The average of the best bid and ask, `null` if there aren't any asks or bids
	MidPrice float32 `json:"mid_price"`
	// Interest rate used in implied volatility calculations (options only)
	InterestRate float32 `json:"interest_rate,omitempty"`
	// Funding 8h (perpetual only)
	Funding8h float32 `json:"funding_8h,omitempty"`
	// The current instrument market price
	MarkPrice float32 `json:"mark_price"`
	// The current best ask price, `null` if there aren't any asks
	AskPrice float32 `json:"ask_price"`
	// Unique instrument identifier
	InstrumentName string `json:"instrument_name"`
	// Price of the 24h lowest trade, `null` if there weren't any trades
	Low float32 `json:"low"`
	// Base currency
	BaseCurrency string `json:"base_currency,omitempty"`
	// The timestamp (seconds since the Unix epoch, with millisecond precision)
	CreationTimestamp int32 `json:"creation_timestamp"`
	// Current funding (perpetual only)
	CurrentFunding float32 `json:"current_funding,omitempty"`
}

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	HTTPClient    *http.Client
}

func NewConfiguration

func NewConfiguration() *Configuration

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

type Currency

type Currency struct {
	// Minimum number of block chain confirmations before deposit is accepted.
	MinConfirmations int32 `json:"min_confirmations,omitempty"`
	// The minimum transaction fee paid for withdrawals
	MinWithdrawalFee float32 `json:"min_withdrawal_fee,omitempty"`
	// False if deposit address creation is disabled
	DisabledDepositAddressCreation bool `json:"disabled_deposit_address_creation,omitempty"`
	// The abbreviation of the currency. This abbreviation is used elsewhere in the API to identify the currency.
	Currency string `json:"currency"`
	// The full name for the currency.
	CurrencyLong string `json:"currency_long"`
	// The total transaction fee paid for withdrawals
	WithdrawalFee float32 `json:"withdrawal_fee"`
	// fee precision
	FeePrecision         int32                          `json:"fee_precision,omitempty"`
	WithdrawalPriorities []CurrencyWithdrawalPriorities `json:"withdrawal_priorities,omitempty"`
	// The type of the currency.
	CoinType string `json:"coin_type"`
}

type CurrencyPortfolio

type CurrencyPortfolio struct {
	MaintenanceMargin        float32 `json:"maintenance_margin"`
	AvailableWithdrawalFunds float32 `json:"available_withdrawal_funds"`
	InitialMargin            float32 `json:"initial_margin"`
	AvailableFunds           float32 `json:"available_funds"`
	Currency                 string  `json:"currency"`
	MarginBalance            float32 `json:"margin_balance"`
	Equity                   float32 `json:"equity"`
	Balance                  float32 `json:"balance"`
}

type CurrencyWithdrawalPriorities

type CurrencyWithdrawalPriorities struct {
	Name  string  `json:"name"`
	Value float32 `json:"value"`
}

type Deposit

type Deposit struct {
	// The timestamp (seconds since the Unix epoch, with millisecond precision)
	UpdatedTimestamp int32 `json:"updated_timestamp"`
	// Deposit state, allowed values : `pending`, `completed`, `rejected`, `replaced`
	State string `json:"state"`
	// The timestamp (seconds since the Unix epoch, with millisecond precision)
	ReceivedTimestamp int32 `json:"received_timestamp"`
	// Currency, i.e `\"BTC\"`, `\"ETH\"`
	Currency string `json:"currency"`
	// Address in proper format for currency
	Address string `json:"address"`
	// Amount of funds in given currency
	Amount float32 `json:"amount"`
	// Transaction id in proper format for currency, `null` if id is not available
	TransactionId *string `json:"transaction_id"`
}

type GenericOpenAPIError

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

GenericOpenAPIError Provides access to the body, error and model on returned errors.

func (GenericOpenAPIError) Body

func (e GenericOpenAPIError) Body() []byte

Body returns the raw bytes of the response

func (GenericOpenAPIError) Error

func (e GenericOpenAPIError) Error() string

Error returns non-empty string if there was an error.

func (GenericOpenAPIError) Model

func (e GenericOpenAPIError) Model() interface{}

Model returns the unpacked model of the error

type Instrument

type Instrument struct {
	// The currency in which the instrument prices are quoted.
	QuoteCurrency string `json:"quote_currency"`
	// Instrument kind, `\"future\"` or `\"option\"`
	Kind string `json:"kind"`
	// specifies minimal price change and, as follows, the number of decimal places for instrument prices
	TickSize float32 `json:"tick_size"`
	// Contract size for instrument
	ContractSize int32 `json:"contract_size"`
	// Indicates if the instrument can currently be traded.
	IsActive bool `json:"is_active"`
	// The option type (only for options)
	OptionType string `json:"option_type,omitempty"`
	// Minimum amount for trading. For perpetual and futures - in USD units, for options it is amount of corresponding cryptocurrency contracts, e.g., BTC or ETH.
	MinTradeAmount float32 `json:"min_trade_amount"`
	// Unique instrument identifier
	InstrumentName string `json:"instrument_name"`
	// The settlement period.
	SettlementPeriod string `json:"settlement_period"`
	// The strike value. (only for options)
	Strike float32 `json:"strike,omitempty"`
	// The underlying currency being traded.
	BaseCurrency string `json:"base_currency"`
	// The time when the instrument was first created (milliseconds)
	CreationTimestamp int32 `json:"creation_timestamp"`
	// The time when the instrument will expire (milliseconds)
	ExpirationTimestamp int32 `json:"expiration_timestamp"`
}

type InternalApiService

type InternalApiService service

func (*InternalApiService) PrivateAddToAddressBookGet

func (a *InternalApiService) PrivateAddToAddressBookGet(ctx context.Context, currency string, type_ string, address string, name string, localVarOptionals *PrivateAddToAddressBookGetOpts) (map[string]interface{}, *http.Response, error)

func (*InternalApiService) PrivateDisableTfaWithRecoveryCodeGet

func (a *InternalApiService) PrivateDisableTfaWithRecoveryCodeGet(ctx context.Context, password string, code string) (map[string]interface{}, *http.Response, error)

InternalApiService Disables TFA with one time recovery code

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param password The password for the subaccount
  • @param code One time recovery code

@return map[string]interface{}

func (*InternalApiService) PrivateGetAddressBookGet

func (a *InternalApiService) PrivateGetAddressBookGet(ctx context.Context, currency string, type_ string) (map[string]interface{}, *http.Response, error)

InternalApiService Retrieves address book of given type

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol
  • @param type_ Address book type

@return map[string]interface{}

func (*InternalApiService) PrivateRemoveFromAddressBookGet

func (a *InternalApiService) PrivateRemoveFromAddressBookGet(ctx context.Context, currency string, type_ string, address string, localVarOptionals *PrivateRemoveFromAddressBookGetOpts) (map[string]interface{}, *http.Response, error)

func (*InternalApiService) PrivateSubmitTransferToSubaccountGet

func (a *InternalApiService) PrivateSubmitTransferToSubaccountGet(ctx context.Context, currency string, amount float32, destination int32) (map[string]interface{}, *http.Response, error)

InternalApiService Transfer funds to a subaccount.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol
  • @param amount Amount of funds to be transferred
  • @param destination Id of destination subaccount

@return map[string]interface{}

func (*InternalApiService) PrivateSubmitTransferToUserGet

func (a *InternalApiService) PrivateSubmitTransferToUserGet(ctx context.Context, currency string, amount float32, destination string, localVarOptionals *PrivateSubmitTransferToUserGetOpts) (map[string]interface{}, *http.Response, error)

func (*InternalApiService) PrivateToggleDepositAddressCreationGet

func (a *InternalApiService) PrivateToggleDepositAddressCreationGet(ctx context.Context, currency string, state bool) (map[string]interface{}, *http.Response, error)

InternalApiService Enable or disable deposit address creation

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol
  • @param state

@return map[string]interface{}

func (*InternalApiService) PublicGetFooterGet

func (a *InternalApiService) PublicGetFooterGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

InternalApiService Get information to be displayed in the footer of the website.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*InternalApiService) PublicGetOptionMarkPricesGet

func (a *InternalApiService) PublicGetOptionMarkPricesGet(ctx context.Context, currency string) (map[string]interface{}, *http.Response, error)

InternalApiService Retrives market prices and its implied volatility of options instruments

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol

@return map[string]interface{}

func (*InternalApiService) PublicValidateFieldGet

func (a *InternalApiService) PublicValidateFieldGet(ctx context.Context, field string, value string, localVarOptionals *PublicValidateFieldGetOpts) (map[string]interface{}, *http.Response, error)

type KeyNumberPair

type KeyNumberPair struct {
	Name  string  `json:"name"`
	Value float32 `json:"value"`
}

type MarketDataApiService

type MarketDataApiService service

func (*MarketDataApiService) PublicGetBookSummaryByCurrencyGet

func (a *MarketDataApiService) PublicGetBookSummaryByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PublicGetBookSummaryByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*MarketDataApiService) PublicGetBookSummaryByInstrumentGet

func (a *MarketDataApiService) PublicGetBookSummaryByInstrumentGet(ctx context.Context, instrumentName string) (map[string]interface{}, *http.Response, error)

MarketDataApiService Retrieves the summary information such as open interest, 24h volume, etc. for a specific instrument.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param instrumentName Instrument name

@return map[string]interface{}

func (*MarketDataApiService) PublicGetContractSizeGet

func (a *MarketDataApiService) PublicGetContractSizeGet(ctx context.Context, instrumentName string) (map[string]interface{}, *http.Response, error)

MarketDataApiService Retrieves contract size of provided instrument.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param instrumentName Instrument name

@return map[string]interface{}

func (*MarketDataApiService) PublicGetCurrenciesGet

func (a *MarketDataApiService) PublicGetCurrenciesGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

MarketDataApiService Retrieves all cryptocurrencies supported by the API.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*MarketDataApiService) PublicGetFundingChartDataGet

func (a *MarketDataApiService) PublicGetFundingChartDataGet(ctx context.Context, instrumentName string, localVarOptionals *PublicGetFundingChartDataGetOpts) (map[string]interface{}, *http.Response, error)

func (*MarketDataApiService) PublicGetHistoricalVolatilityGet

func (a *MarketDataApiService) PublicGetHistoricalVolatilityGet(ctx context.Context, currency string) (map[string]interface{}, *http.Response, error)

MarketDataApiService Provides information about historical volatility for given cryptocurrency.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol

@return map[string]interface{}

func (*MarketDataApiService) PublicGetIndexGet

func (a *MarketDataApiService) PublicGetIndexGet(ctx context.Context, currency string) (map[string]interface{}, *http.Response, error)

MarketDataApiService Retrieves the current index price for the instruments, for the selected currency.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol

@return map[string]interface{}

func (*MarketDataApiService) PublicGetInstrumentsGet

func (a *MarketDataApiService) PublicGetInstrumentsGet(ctx context.Context, currency string, localVarOptionals *PublicGetInstrumentsGetOpts) (map[string]interface{}, *http.Response, error)

func (*MarketDataApiService) PublicGetLastSettlementsByCurrencyGet

func (a *MarketDataApiService) PublicGetLastSettlementsByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PublicGetLastSettlementsByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*MarketDataApiService) PublicGetLastSettlementsByInstrumentGet

func (a *MarketDataApiService) PublicGetLastSettlementsByInstrumentGet(ctx context.Context, instrumentName string, localVarOptionals *PublicGetLastSettlementsByInstrumentGetOpts) (map[string]interface{}, *http.Response, error)

func (*MarketDataApiService) PublicGetLastTradesByCurrencyAndTimeGet

func (a *MarketDataApiService) PublicGetLastTradesByCurrencyAndTimeGet(ctx context.Context, currency string, startTimestamp int32, endTimestamp int32, localVarOptionals *PublicGetLastTradesByCurrencyAndTimeGetOpts) (map[string]interface{}, *http.Response, error)

func (*MarketDataApiService) PublicGetLastTradesByCurrencyGet

func (a *MarketDataApiService) PublicGetLastTradesByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PublicGetLastTradesByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*MarketDataApiService) PublicGetLastTradesByInstrumentAndTimeGet

func (a *MarketDataApiService) PublicGetLastTradesByInstrumentAndTimeGet(ctx context.Context, instrumentName string, startTimestamp int32, endTimestamp int32, localVarOptionals *PublicGetLastTradesByInstrumentAndTimeGetOpts) (map[string]interface{}, *http.Response, error)

func (*MarketDataApiService) PublicGetLastTradesByInstrumentGet

func (a *MarketDataApiService) PublicGetLastTradesByInstrumentGet(ctx context.Context, instrumentName string, localVarOptionals *PublicGetLastTradesByInstrumentGetOpts) (map[string]interface{}, *http.Response, error)

func (*MarketDataApiService) PublicGetOrderBookGet

func (a *MarketDataApiService) PublicGetOrderBookGet(ctx context.Context, instrumentName string, localVarOptionals *PublicGetOrderBookGetOpts) (map[string]interface{}, *http.Response, error)

func (*MarketDataApiService) PublicGetTradeVolumesGet

func (a *MarketDataApiService) PublicGetTradeVolumesGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

MarketDataApiService Retrieves aggregated 24h trade volumes for different instrument types and currencies.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*MarketDataApiService) PublicGetTradingviewChartDataGet

func (a *MarketDataApiService) PublicGetTradingviewChartDataGet(ctx context.Context, instrumentName string, startTimestamp int32, endTimestamp int32) (map[string]interface{}, *http.Response, error)

MarketDataApiService Publicly available market data used to generate a TradingView candle chart.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param instrumentName Instrument name
  • @param startTimestamp The earliest timestamp to return result for
  • @param endTimestamp The most recent timestamp to return result for

@return map[string]interface{}

func (*MarketDataApiService) PublicTickerGet

func (a *MarketDataApiService) PublicTickerGet(ctx context.Context, instrumentName string) (map[string]interface{}, *http.Response, error)

MarketDataApiService Get ticker for an instrument.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param instrumentName Instrument name

@return map[string]interface{}

type Order

type Order struct {
	// direction, `buy` or `sell`
	Direction string `json:"direction"`
	// `true` for reduce-only orders only
	ReduceOnly bool `json:"reduce_only,omitempty"`
	// Whether the stop order has been triggered (Only for stop orders)
	Triggered bool `json:"triggered,omitempty"`
	// Unique order identifier
	OrderId string `json:"order_id"`
	// Price in base currency
	Price float32 `json:"price"`
	// Order time in force: `\"good_til_cancelled\"`, `\"fill_or_kill\"`, `\"immediate_or_cancel\"`
	TimeInForce string `json:"time_in_force"`
	// `true` if created with API
	Api bool `json:"api"`
	// order state, `\"open\"`, `\"filled\"`, `\"rejected\"`, `\"cancelled\"`, `\"untriggered\"`
	OrderState string `json:"order_state"`
	// Implied volatility in percent. (Only if `advanced=\"implv\"`)
	Implv float32 `json:"implv,omitempty"`
	// advanced type: `\"usd\"` or `\"implv\"` (Only for options; field is omitted if not applicable).
	Advanced string `json:"advanced,omitempty"`
	// `true` for post-only orders only
	PostOnly bool `json:"post_only"`
	// Option price in USD (Only if `advanced=\"usd\"`)
	Usd float32 `json:"usd,omitempty"`
	// stop price (Only for future stop orders)
	StopPrice float32 `json:"stop_price,omitempty"`
	// order type, `\"limit\"`, `\"market\"`, `\"stop_limit\"`, `\"stop_market\"`
	OrderType string `json:"order_type"`
	// The timestamp (seconds since the Unix epoch, with millisecond precision)
	LastUpdateTimestamp int32 `json:"last_update_timestamp"`
	// Original order type. Optional field
	OriginalOrderType string `json:"original_order_type,omitempty"`
	// Maximum amount within an order to be shown to other traders, 0 for invisible order.
	MaxShow float32 `json:"max_show"`
	// Profit and loss in base currency.
	ProfitLoss float32 `json:"profit_loss,omitempty"`
	// `true` if order was automatically created during liquidation
	IsLiquidation bool `json:"is_liquidation"`
	// Filled amount of the order. For perpetual and futures the filled_amount is in USD units, for options - in units or corresponding cryptocurrency contracts, e.g., BTC or ETH.
	FilledAmount float32 `json:"filled_amount,omitempty"`
	// user defined label (up to 32 characters)
	Label string `json:"label"`
	// Commission paid so far (in base currency)
	Commission float32 `json:"commission,omitempty"`
	// It represents the requested order size. For perpetual and futures the amount is in USD units, for options it is amount of corresponding cryptocurrency contracts, e.g., BTC or ETH.
	Amount float32 `json:"amount,omitempty"`
	// Trigger type (Only for stop orders). Allowed values: `\"index_price\"`, `\"mark_price\"`, `\"last_price\"`.
	Trigger string `json:"trigger,omitempty"`
	// Unique instrument identifier
	InstrumentName string `json:"instrument_name,omitempty"`
	// The timestamp (seconds since the Unix epoch, with millisecond precision)
	CreationTimestamp int32 `json:"creation_timestamp"`
	// Average fill price of the order
	AveragePrice float32 `json:"average_price,omitempty"`
}

type OrderIdInitialMarginPair

type OrderIdInitialMarginPair struct {
	// Unique order identifier
	OrderId string `json:"order_id"`
	// Initial margin of order, in base currency
	InitialMargin float32 `json:"initial_margin"`
}

type Portfolio

type Portfolio struct {
	Eth PortfolioEth `json:"eth"`
	Btc PortfolioEth `json:"btc"`
}

type PortfolioEth

type PortfolioEth struct {
	MaintenanceMargin        float32 `json:"maintenance_margin"`
	AvailableWithdrawalFunds float32 `json:"available_withdrawal_funds"`
	InitialMargin            float32 `json:"initial_margin"`
	AvailableFunds           float32 `json:"available_funds"`
	Currency                 string  `json:"currency"`
	MarginBalance            float32 `json:"margin_balance"`
	Equity                   float32 `json:"equity"`
	Balance                  float32 `json:"balance"`
}

type Position

type Position struct {
	// direction, `buy` or `sell`
	Direction string `json:"direction"`
	// Only for options, average price in USD
	AveragePriceUsd float32 `json:"average_price_usd,omitempty"`
	// Only for futures, estimated liquidation price
	EstimatedLiquidationPrice float32 `json:"estimated_liquidation_price,omitempty"`
	// Floating profit or loss
	FloatingProfitLoss float32 `json:"floating_profit_loss"`
	// Only for options, floating profit or loss in USD
	FloatingProfitLossUsd float32 `json:"floating_profit_loss_usd,omitempty"`
	// Open orders margin
	OpenOrdersMargin float32 `json:"open_orders_margin"`
	// Profit or loss from position
	TotalProfitLoss float32 `json:"total_profit_loss"`
	// Realized profit or loss
	RealizedProfitLoss float32 `json:"realized_profit_loss,omitempty"`
	// Delta parameter
	Delta float32 `json:"delta"`
	// Initial margin
	InitialMargin float32 `json:"initial_margin"`
	// Position size for futures size in quote currency (e.g. USD), for options size is in base currency (e.g. BTC)
	Size float32 `json:"size"`
	// Maintenance margin
	MaintenanceMargin float32 `json:"maintenance_margin"`
	// Instrument kind, `\"future\"` or `\"option\"`
	Kind string `json:"kind"`
	// Current mark price for position's instrument
	MarkPrice float32 `json:"mark_price"`
	// Average price of trades that built this position
	AveragePrice float32 `json:"average_price"`
	// Last settlement price for position's instrument 0 if instrument wasn't settled yet
	SettlementPrice float32 `json:"settlement_price"`
	// Current index price
	IndexPrice float32 `json:"index_price"`
	// Unique instrument identifier
	InstrumentName string `json:"instrument_name"`
	// Only for futures, position size in base currency
	SizeCurrency float32 `json:"size_currency,omitempty"`
}

type PrivateAddToAddressBookGetOpts

type PrivateAddToAddressBookGetOpts struct {
	Tfa optional.String
}

type PrivateApiService

type PrivateApiService service

func (*PrivateApiService) PrivateAddToAddressBookGet

func (a *PrivateApiService) PrivateAddToAddressBookGet(ctx context.Context, currency string, type_ string, address string, name string, localVarOptionals *PrivateAddToAddressBookGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateBuyGet

func (a *PrivateApiService) PrivateBuyGet(ctx context.Context, instrumentName string, amount float32, localVarOptionals *PrivateBuyGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateCancelAllByCurrencyGet

func (a *PrivateApiService) PrivateCancelAllByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PrivateCancelAllByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateCancelAllByInstrumentGet

func (a *PrivateApiService) PrivateCancelAllByInstrumentGet(ctx context.Context, instrumentName string, localVarOptionals *PrivateCancelAllByInstrumentGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateCancelAllGet

func (a *PrivateApiService) PrivateCancelAllGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

PrivateApiService This method cancels all users orders and stop orders within all currencies and instrument kinds.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*PrivateApiService) PrivateCancelGet

func (a *PrivateApiService) PrivateCancelGet(ctx context.Context, orderId string) (map[string]interface{}, *http.Response, error)

PrivateApiService Cancel an order, specified by order id

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param orderId The order id

@return map[string]interface{}

func (*PrivateApiService) PrivateCancelTransferByIdGet

func (a *PrivateApiService) PrivateCancelTransferByIdGet(ctx context.Context, currency string, id int32, localVarOptionals *PrivateCancelTransferByIdGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateCancelWithdrawalGet

func (a *PrivateApiService) PrivateCancelWithdrawalGet(ctx context.Context, currency string, id float32) (map[string]interface{}, *http.Response, error)

PrivateApiService Cancels withdrawal request

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol
  • @param id The withdrawal id

@return map[string]interface{}

func (*PrivateApiService) PrivateChangeSubaccountNameGet

func (a *PrivateApiService) PrivateChangeSubaccountNameGet(ctx context.Context, sid int32, name string) (map[string]interface{}, *http.Response, error)

PrivateApiService Change the user name for a subaccount

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param sid The user id for the subaccount
  • @param name The new user name

@return map[string]interface{}

func (*PrivateApiService) PrivateClosePositionGet

func (a *PrivateApiService) PrivateClosePositionGet(ctx context.Context, instrumentName string, type_ string, localVarOptionals *PrivateClosePositionGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateCreateDepositAddressGet

func (a *PrivateApiService) PrivateCreateDepositAddressGet(ctx context.Context, currency string) (map[string]interface{}, *http.Response, error)

PrivateApiService Creates deposit address in currency

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol

@return map[string]interface{}

func (*PrivateApiService) PrivateCreateSubaccountGet

func (a *PrivateApiService) PrivateCreateSubaccountGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

PrivateApiService Create a new subaccount

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*PrivateApiService) PrivateDisableTfaForSubaccountGet

func (a *PrivateApiService) PrivateDisableTfaForSubaccountGet(ctx context.Context, sid int32) (map[string]interface{}, *http.Response, error)

PrivateApiService Disable two factor authentication for a subaccount.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param sid The user id for the subaccount

@return map[string]interface{}

func (*PrivateApiService) PrivateDisableTfaWithRecoveryCodeGet

func (a *PrivateApiService) PrivateDisableTfaWithRecoveryCodeGet(ctx context.Context, password string, code string) (map[string]interface{}, *http.Response, error)

PrivateApiService Disables TFA with one time recovery code

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param password The password for the subaccount
  • @param code One time recovery code

@return map[string]interface{}

func (*PrivateApiService) PrivateEditGet

func (a *PrivateApiService) PrivateEditGet(ctx context.Context, orderId string, amount float32, price float32, localVarOptionals *PrivateEditGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetAccountSummaryGet

func (a *PrivateApiService) PrivateGetAccountSummaryGet(ctx context.Context, currency string, localVarOptionals *PrivateGetAccountSummaryGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetAddressBookGet

func (a *PrivateApiService) PrivateGetAddressBookGet(ctx context.Context, currency string, type_ string) (map[string]interface{}, *http.Response, error)

PrivateApiService Retrieves address book of given type

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol
  • @param type_ Address book type

@return map[string]interface{}

func (*PrivateApiService) PrivateGetCurrentDepositAddressGet

func (a *PrivateApiService) PrivateGetCurrentDepositAddressGet(ctx context.Context, currency string) (map[string]interface{}, *http.Response, error)

PrivateApiService Retrieve deposit address for currency

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol

@return map[string]interface{}

func (*PrivateApiService) PrivateGetDepositsGet

func (a *PrivateApiService) PrivateGetDepositsGet(ctx context.Context, currency string, localVarOptionals *PrivateGetDepositsGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetEmailLanguageGet

func (a *PrivateApiService) PrivateGetEmailLanguageGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

PrivateApiService Retrieves the language to be used for emails.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*PrivateApiService) PrivateGetMarginsGet

func (a *PrivateApiService) PrivateGetMarginsGet(ctx context.Context, instrumentName string, amount float32, price float32) (map[string]interface{}, *http.Response, error)

PrivateApiService Get margins for given instrument, amount and price.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param instrumentName Instrument name
  • @param amount Amount, integer for future, float for option. For perpetual and futures the amount is in USD units, for options it is amount of corresponding cryptocurrency contracts, e.g., BTC or ETH.
  • @param price Price

@return map[string]interface{}

func (*PrivateApiService) PrivateGetNewAnnouncementsGet

func (a *PrivateApiService) PrivateGetNewAnnouncementsGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

PrivateApiService Retrieves announcements that have not been marked read by the user.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*PrivateApiService) PrivateGetOpenOrdersByCurrencyGet

func (a *PrivateApiService) PrivateGetOpenOrdersByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PrivateGetOpenOrdersByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetOpenOrdersByInstrumentGet

func (a *PrivateApiService) PrivateGetOpenOrdersByInstrumentGet(ctx context.Context, instrumentName string, localVarOptionals *PrivateGetOpenOrdersByInstrumentGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetOrderHistoryByCurrencyGet

func (a *PrivateApiService) PrivateGetOrderHistoryByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PrivateGetOrderHistoryByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetOrderHistoryByInstrumentGet

func (a *PrivateApiService) PrivateGetOrderHistoryByInstrumentGet(ctx context.Context, instrumentName string, localVarOptionals *PrivateGetOrderHistoryByInstrumentGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetOrderMarginByIdsGet

func (a *PrivateApiService) PrivateGetOrderMarginByIdsGet(ctx context.Context, ids []string) (map[string]interface{}, *http.Response, error)

PrivateApiService Retrieves initial margins of given orders

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param ids Ids of orders

@return map[string]interface{}

func (*PrivateApiService) PrivateGetOrderStateGet

func (a *PrivateApiService) PrivateGetOrderStateGet(ctx context.Context, orderId string) (map[string]interface{}, *http.Response, error)

PrivateApiService Retrieve the current state of an order.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param orderId The order id

@return map[string]interface{}

func (*PrivateApiService) PrivateGetPositionGet

func (a *PrivateApiService) PrivateGetPositionGet(ctx context.Context, instrumentName string) (map[string]interface{}, *http.Response, error)

PrivateApiService Retrieve user position.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param instrumentName Instrument name

@return map[string]interface{}

func (*PrivateApiService) PrivateGetPositionsGet

func (a *PrivateApiService) PrivateGetPositionsGet(ctx context.Context, currency string, localVarOptionals *PrivateGetPositionsGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetSettlementHistoryByCurrencyGet

func (a *PrivateApiService) PrivateGetSettlementHistoryByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PrivateGetSettlementHistoryByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetSettlementHistoryByInstrumentGet

func (a *PrivateApiService) PrivateGetSettlementHistoryByInstrumentGet(ctx context.Context, instrumentName string, localVarOptionals *PrivateGetSettlementHistoryByInstrumentGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetSubaccountsGet

func (a *PrivateApiService) PrivateGetSubaccountsGet(ctx context.Context, localVarOptionals *PrivateGetSubaccountsGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetTransfersGet

func (a *PrivateApiService) PrivateGetTransfersGet(ctx context.Context, currency string, localVarOptionals *PrivateGetTransfersGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetUserTradesByCurrencyAndTimeGet

func (a *PrivateApiService) PrivateGetUserTradesByCurrencyAndTimeGet(ctx context.Context, currency string, startTimestamp int32, endTimestamp int32, localVarOptionals *PrivateGetUserTradesByCurrencyAndTimeGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetUserTradesByCurrencyGet

func (a *PrivateApiService) PrivateGetUserTradesByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PrivateGetUserTradesByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetUserTradesByInstrumentAndTimeGet

func (a *PrivateApiService) PrivateGetUserTradesByInstrumentAndTimeGet(ctx context.Context, instrumentName string, startTimestamp int32, endTimestamp int32, localVarOptionals *PrivateGetUserTradesByInstrumentAndTimeGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetUserTradesByInstrumentGet

func (a *PrivateApiService) PrivateGetUserTradesByInstrumentGet(ctx context.Context, instrumentName string, localVarOptionals *PrivateGetUserTradesByInstrumentGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetUserTradesByOrderGet

func (a *PrivateApiService) PrivateGetUserTradesByOrderGet(ctx context.Context, orderId string, localVarOptionals *PrivateGetUserTradesByOrderGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateGetWithdrawalsGet

func (a *PrivateApiService) PrivateGetWithdrawalsGet(ctx context.Context, currency string, localVarOptionals *PrivateGetWithdrawalsGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateRemoveFromAddressBookGet

func (a *PrivateApiService) PrivateRemoveFromAddressBookGet(ctx context.Context, currency string, type_ string, address string, localVarOptionals *PrivateRemoveFromAddressBookGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateSellGet

func (a *PrivateApiService) PrivateSellGet(ctx context.Context, instrumentName string, amount float32, localVarOptionals *PrivateSellGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateSetAnnouncementAsReadGet

func (a *PrivateApiService) PrivateSetAnnouncementAsReadGet(ctx context.Context, announcementId float32) (map[string]interface{}, *http.Response, error)

PrivateApiService Marks an announcement as read, so it will not be shown in `get_new_announcements`.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param announcementId the ID of the announcement

@return map[string]interface{}

func (*PrivateApiService) PrivateSetEmailForSubaccountGet

func (a *PrivateApiService) PrivateSetEmailForSubaccountGet(ctx context.Context, sid int32, email string) (map[string]interface{}, *http.Response, error)

PrivateApiService Assign an email address to a subaccount. User will receive an email with confirmation link.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param sid The user id for the subaccount
  • @param email The email address for the subaccount

@return map[string]interface{}

func (*PrivateApiService) PrivateSetEmailLanguageGet

func (a *PrivateApiService) PrivateSetEmailLanguageGet(ctx context.Context, language string) (map[string]interface{}, *http.Response, error)

PrivateApiService Changes the language to be used for emails.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param language The abbreviated language name. Valid values include `\"en\"`, `\"ko\"`, `\"zh\"`

@return map[string]interface{}

func (*PrivateApiService) PrivateSetPasswordForSubaccountGet

func (a *PrivateApiService) PrivateSetPasswordForSubaccountGet(ctx context.Context, sid int32, password string) (map[string]interface{}, *http.Response, error)

PrivateApiService Set the password for the subaccount

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param sid The user id for the subaccount
  • @param password The password for the subaccount

@return map[string]interface{}

func (*PrivateApiService) PrivateSubmitTransferToSubaccountGet

func (a *PrivateApiService) PrivateSubmitTransferToSubaccountGet(ctx context.Context, currency string, amount float32, destination int32) (map[string]interface{}, *http.Response, error)

PrivateApiService Transfer funds to a subaccount.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol
  • @param amount Amount of funds to be transferred
  • @param destination Id of destination subaccount

@return map[string]interface{}

func (*PrivateApiService) PrivateSubmitTransferToUserGet

func (a *PrivateApiService) PrivateSubmitTransferToUserGet(ctx context.Context, currency string, amount float32, destination string, localVarOptionals *PrivateSubmitTransferToUserGetOpts) (map[string]interface{}, *http.Response, error)

func (*PrivateApiService) PrivateToggleDepositAddressCreationGet

func (a *PrivateApiService) PrivateToggleDepositAddressCreationGet(ctx context.Context, currency string, state bool) (map[string]interface{}, *http.Response, error)

PrivateApiService Enable or disable deposit address creation

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol
  • @param state

@return map[string]interface{}

func (*PrivateApiService) PrivateToggleNotificationsFromSubaccountGet

func (a *PrivateApiService) PrivateToggleNotificationsFromSubaccountGet(ctx context.Context, sid int32, state bool) (map[string]interface{}, *http.Response, error)

PrivateApiService Enable or disable sending of notifications for the subaccount.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param sid The user id for the subaccount
  • @param state enable (`true`) or disable (`false`) notifications

@return map[string]interface{}

func (*PrivateApiService) PrivateToggleSubaccountLoginGet

func (a *PrivateApiService) PrivateToggleSubaccountLoginGet(ctx context.Context, sid int32, state string) (map[string]interface{}, *http.Response, error)

PrivateApiService Enable or disable login for a subaccount. If login is disabled and a session for the subaccount exists, this session will be terminated.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param sid The user id for the subaccount
  • @param state enable or disable login.

@return map[string]interface{}

func (*PrivateApiService) PrivateWithdrawGet

func (a *PrivateApiService) PrivateWithdrawGet(ctx context.Context, currency string, address string, amount float32, localVarOptionals *PrivateWithdrawGetOpts) (map[string]interface{}, *http.Response, error)

type PrivateBuyGetOpts

type PrivateBuyGetOpts struct {
	Type_       optional.String
	Label       optional.String
	Price       optional.Float32
	TimeInForce optional.String
	MaxShow     optional.Float32
	PostOnly    optional.Bool
	ReduceOnly  optional.Bool
	StopPrice   optional.Float32
	Trigger     optional.String
	Advanced    optional.String
}

type PrivateCancelAllByCurrencyGetOpts

type PrivateCancelAllByCurrencyGetOpts struct {
	Kind  optional.String
	Type_ optional.String
}

type PrivateCancelAllByInstrumentGetOpts

type PrivateCancelAllByInstrumentGetOpts struct {
	Type_ optional.String
}

type PrivateCancelTransferByIdGetOpts

type PrivateCancelTransferByIdGetOpts struct {
	Tfa optional.String
}

type PrivateClosePositionGetOpts

type PrivateClosePositionGetOpts struct {
	Price optional.Float32
}

type PrivateEditGetOpts

type PrivateEditGetOpts struct {
	PostOnly  optional.Bool
	Advanced  optional.String
	StopPrice optional.Float32
}

type PrivateGetAccountSummaryGetOpts

type PrivateGetAccountSummaryGetOpts struct {
	Extended optional.Bool
}

type PrivateGetDepositsGetOpts

type PrivateGetDepositsGetOpts struct {
	Count  optional.Int32
	Offset optional.Int32
}

type PrivateGetOpenOrdersByCurrencyGetOpts

type PrivateGetOpenOrdersByCurrencyGetOpts struct {
	Kind  optional.String
	Type_ optional.String
}

type PrivateGetOpenOrdersByInstrumentGetOpts

type PrivateGetOpenOrdersByInstrumentGetOpts struct {
	Type_ optional.String
}

type PrivateGetOrderHistoryByCurrencyGetOpts

type PrivateGetOrderHistoryByCurrencyGetOpts struct {
	Kind            optional.String
	Count           optional.Int32
	Offset          optional.Int32
	IncludeOld      optional.Bool
	IncludeUnfilled optional.Bool
}

type PrivateGetOrderHistoryByInstrumentGetOpts

type PrivateGetOrderHistoryByInstrumentGetOpts struct {
	Count           optional.Int32
	Offset          optional.Int32
	IncludeOld      optional.Bool
	IncludeUnfilled optional.Bool
}

type PrivateGetPositionsGetOpts

type PrivateGetPositionsGetOpts struct {
	Kind optional.String
}

type PrivateGetSettlementHistoryByCurrencyGetOpts

type PrivateGetSettlementHistoryByCurrencyGetOpts struct {
	Type_ optional.String
	Count optional.Int32
}

type PrivateGetSettlementHistoryByInstrumentGetOpts

type PrivateGetSettlementHistoryByInstrumentGetOpts struct {
	Type_ optional.String
	Count optional.Int32
}

type PrivateGetSubaccountsGetOpts

type PrivateGetSubaccountsGetOpts struct {
	WithPortfolio optional.Bool
}

type PrivateGetTransfersGetOpts

type PrivateGetTransfersGetOpts struct {
	Count  optional.Int32
	Offset optional.Int32
}

type PrivateGetUserTradesByCurrencyAndTimeGetOpts

type PrivateGetUserTradesByCurrencyAndTimeGetOpts struct {
	Kind       optional.String
	Count      optional.Int32
	IncludeOld optional.Bool
	Sorting    optional.String
}

type PrivateGetUserTradesByCurrencyGetOpts

type PrivateGetUserTradesByCurrencyGetOpts struct {
	Kind       optional.String
	StartId    optional.String
	EndId      optional.String
	Count      optional.Int32
	IncludeOld optional.Bool
	Sorting    optional.String
}

type PrivateGetUserTradesByInstrumentAndTimeGetOpts

type PrivateGetUserTradesByInstrumentAndTimeGetOpts struct {
	Count      optional.Int32
	IncludeOld optional.Bool
	Sorting    optional.String
}

type PrivateGetUserTradesByInstrumentGetOpts

type PrivateGetUserTradesByInstrumentGetOpts struct {
	StartSeq   optional.Int32
	EndSeq     optional.Int32
	Count      optional.Int32
	IncludeOld optional.Bool
	Sorting    optional.String
}

type PrivateGetUserTradesByOrderGetOpts

type PrivateGetUserTradesByOrderGetOpts struct {
	Sorting optional.String
}

type PrivateGetWithdrawalsGetOpts

type PrivateGetWithdrawalsGetOpts struct {
	Count  optional.Int32
	Offset optional.Int32
}

type PrivateRemoveFromAddressBookGetOpts

type PrivateRemoveFromAddressBookGetOpts struct {
	Tfa optional.String
}

type PrivateSellGetOpts

type PrivateSellGetOpts struct {
	Type_       optional.String
	Label       optional.String
	Price       optional.Float32
	TimeInForce optional.String
	MaxShow     optional.Float32
	PostOnly    optional.Bool
	ReduceOnly  optional.Bool
	StopPrice   optional.Float32
	Trigger     optional.String
	Advanced    optional.String
}

type PrivateSubmitTransferToUserGetOpts

type PrivateSubmitTransferToUserGetOpts struct {
	Tfa optional.String
}

type PrivateWithdrawGetOpts

type PrivateWithdrawGetOpts struct {
	Priority optional.String
	Tfa      optional.String
}

type PublicApiService

type PublicApiService service

func (*PublicApiService) PublicAuthGet

func (a *PublicApiService) PublicAuthGet(ctx context.Context, grantType string, username string, password string, clientId string, clientSecret string, refreshToken string, timestamp string, signature string, localVarOptionals *PublicAuthGetOpts) (map[string]interface{}, *http.Response, error)

func (*PublicApiService) PublicGetAnnouncementsGet

func (a *PublicApiService) PublicGetAnnouncementsGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

PublicApiService Retrieves announcements from the last 30 days.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*PublicApiService) PublicGetBookSummaryByCurrencyGet

func (a *PublicApiService) PublicGetBookSummaryByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PublicGetBookSummaryByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*PublicApiService) PublicGetBookSummaryByInstrumentGet

func (a *PublicApiService) PublicGetBookSummaryByInstrumentGet(ctx context.Context, instrumentName string) (map[string]interface{}, *http.Response, error)

PublicApiService Retrieves the summary information such as open interest, 24h volume, etc. for a specific instrument.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param instrumentName Instrument name

@return map[string]interface{}

func (*PublicApiService) PublicGetContractSizeGet

func (a *PublicApiService) PublicGetContractSizeGet(ctx context.Context, instrumentName string) (map[string]interface{}, *http.Response, error)

PublicApiService Retrieves contract size of provided instrument.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param instrumentName Instrument name

@return map[string]interface{}

func (*PublicApiService) PublicGetCurrenciesGet

func (a *PublicApiService) PublicGetCurrenciesGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

PublicApiService Retrieves all cryptocurrencies supported by the API.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*PublicApiService) PublicGetFundingChartDataGet

func (a *PublicApiService) PublicGetFundingChartDataGet(ctx context.Context, instrumentName string, localVarOptionals *PublicGetFundingChartDataGetOpts) (map[string]interface{}, *http.Response, error)

func (*PublicApiService) PublicGetHistoricalVolatilityGet

func (a *PublicApiService) PublicGetHistoricalVolatilityGet(ctx context.Context, currency string) (map[string]interface{}, *http.Response, error)

PublicApiService Provides information about historical volatility for given cryptocurrency.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol

@return map[string]interface{}

func (*PublicApiService) PublicGetIndexGet

func (a *PublicApiService) PublicGetIndexGet(ctx context.Context, currency string) (map[string]interface{}, *http.Response, error)

PublicApiService Retrieves the current index price for the instruments, for the selected currency.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol

@return map[string]interface{}

func (*PublicApiService) PublicGetInstrumentsGet

func (a *PublicApiService) PublicGetInstrumentsGet(ctx context.Context, currency string, localVarOptionals *PublicGetInstrumentsGetOpts) (map[string]interface{}, *http.Response, error)

func (*PublicApiService) PublicGetLastSettlementsByCurrencyGet

func (a *PublicApiService) PublicGetLastSettlementsByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PublicGetLastSettlementsByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*PublicApiService) PublicGetLastSettlementsByInstrumentGet

func (a *PublicApiService) PublicGetLastSettlementsByInstrumentGet(ctx context.Context, instrumentName string, localVarOptionals *PublicGetLastSettlementsByInstrumentGetOpts) (map[string]interface{}, *http.Response, error)

func (*PublicApiService) PublicGetLastTradesByCurrencyAndTimeGet

func (a *PublicApiService) PublicGetLastTradesByCurrencyAndTimeGet(ctx context.Context, currency string, startTimestamp int32, endTimestamp int32, localVarOptionals *PublicGetLastTradesByCurrencyAndTimeGetOpts) (map[string]interface{}, *http.Response, error)

func (*PublicApiService) PublicGetLastTradesByCurrencyGet

func (a *PublicApiService) PublicGetLastTradesByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PublicGetLastTradesByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*PublicApiService) PublicGetLastTradesByInstrumentAndTimeGet

func (a *PublicApiService) PublicGetLastTradesByInstrumentAndTimeGet(ctx context.Context, instrumentName string, startTimestamp int32, endTimestamp int32, localVarOptionals *PublicGetLastTradesByInstrumentAndTimeGetOpts) (map[string]interface{}, *http.Response, error)

func (*PublicApiService) PublicGetLastTradesByInstrumentGet

func (a *PublicApiService) PublicGetLastTradesByInstrumentGet(ctx context.Context, instrumentName string, localVarOptionals *PublicGetLastTradesByInstrumentGetOpts) (map[string]interface{}, *http.Response, error)

func (*PublicApiService) PublicGetOrderBookGet

func (a *PublicApiService) PublicGetOrderBookGet(ctx context.Context, instrumentName string, localVarOptionals *PublicGetOrderBookGetOpts) (map[string]interface{}, *http.Response, error)

func (*PublicApiService) PublicGetTimeGet

func (a *PublicApiService) PublicGetTimeGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

PublicApiService Retrieves the current time (in milliseconds). This API endpoint can be used to check the clock skew between your software and Deribit's systems.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*PublicApiService) PublicGetTradeVolumesGet

func (a *PublicApiService) PublicGetTradeVolumesGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

PublicApiService Retrieves aggregated 24h trade volumes for different instrument types and currencies.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*PublicApiService) PublicGetTradingviewChartDataGet

func (a *PublicApiService) PublicGetTradingviewChartDataGet(ctx context.Context, instrumentName string, startTimestamp int32, endTimestamp int32) (map[string]interface{}, *http.Response, error)

PublicApiService Publicly available market data used to generate a TradingView candle chart.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param instrumentName Instrument name
  • @param startTimestamp The earliest timestamp to return result for
  • @param endTimestamp The most recent timestamp to return result for

@return map[string]interface{}

func (*PublicApiService) PublicTestGet

func (a *PublicApiService) PublicTestGet(ctx context.Context, localVarOptionals *PublicTestGetOpts) (map[string]interface{}, *http.Response, error)

func (*PublicApiService) PublicTickerGet

func (a *PublicApiService) PublicTickerGet(ctx context.Context, instrumentName string) (map[string]interface{}, *http.Response, error)

PublicApiService Get ticker for an instrument.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param instrumentName Instrument name

@return map[string]interface{}

func (*PublicApiService) PublicValidateFieldGet

func (a *PublicApiService) PublicValidateFieldGet(ctx context.Context, field string, value string, localVarOptionals *PublicValidateFieldGetOpts) (map[string]interface{}, *http.Response, error)

type PublicAuthGetOpts

type PublicAuthGetOpts struct {
	Nonce optional.String
	State optional.String
	Scope optional.String
}

type PublicGetBookSummaryByCurrencyGetOpts

type PublicGetBookSummaryByCurrencyGetOpts struct {
	Kind optional.String
}

type PublicGetFundingChartDataGetOpts

type PublicGetFundingChartDataGetOpts struct {
	Length optional.String
}

type PublicGetInstrumentsGetOpts

type PublicGetInstrumentsGetOpts struct {
	Kind    optional.String
	Expired optional.Bool
}

type PublicGetLastSettlementsByCurrencyGetOpts

type PublicGetLastSettlementsByCurrencyGetOpts struct {
	Type_                optional.String
	Count                optional.Int32
	Continuation         optional.String
	SearchStartTimestamp optional.Int32
}

type PublicGetLastSettlementsByInstrumentGetOpts

type PublicGetLastSettlementsByInstrumentGetOpts struct {
	Type_                optional.String
	Count                optional.Int32
	Continuation         optional.String
	SearchStartTimestamp optional.Int32
}

type PublicGetLastTradesByCurrencyAndTimeGetOpts

type PublicGetLastTradesByCurrencyAndTimeGetOpts struct {
	Kind       optional.String
	Count      optional.Int32
	IncludeOld optional.Bool
	Sorting    optional.String
}

type PublicGetLastTradesByCurrencyGetOpts

type PublicGetLastTradesByCurrencyGetOpts struct {
	Kind       optional.String
	StartId    optional.String
	EndId      optional.String
	Count      optional.Int32
	IncludeOld optional.Bool
	Sorting    optional.String
}

type PublicGetLastTradesByInstrumentAndTimeGetOpts

type PublicGetLastTradesByInstrumentAndTimeGetOpts struct {
	Count      optional.Int32
	IncludeOld optional.Bool
	Sorting    optional.String
}

type PublicGetLastTradesByInstrumentGetOpts

type PublicGetLastTradesByInstrumentGetOpts struct {
	StartSeq   optional.Int32
	EndSeq     optional.Int32
	Count      optional.Int32
	IncludeOld optional.Bool
	Sorting    optional.String
}

type PublicGetOrderBookGetOpts

type PublicGetOrderBookGetOpts struct {
	Depth optional.Float32
}

type PublicTestGetOpts

type PublicTestGetOpts struct {
	ExpectedResult optional.String
}

type PublicTrade

type PublicTrade struct {
	// Trade direction of the taker
	Direction string `json:"direction"`
	// Direction of the \"tick\" (`0` = Plus Tick, `1` = Zero-Plus Tick, `2` = Minus Tick, `3` = Zero-Minus Tick).
	TickDirection int32 `json:"tick_direction"`
	// The timestamp of the trade
	Timestamp int32 `json:"timestamp"`
	// The price of the trade
	Price float32 `json:"price"`
	// The sequence number of the trade within instrument
	TradeSeq int32 `json:"trade_seq"`
	// Unique (per currency) trade identifier
	TradeId string `json:"trade_id"`
	// Option implied volatility for the price (Option only)
	Iv float32 `json:"iv,omitempty"`
	// Index Price at the moment of trade
	IndexPrice float32 `json:"index_price"`
	// Trade amount. For perpetual and futures - in USD units, for options it is amount of corresponding cryptocurrency contracts, e.g., BTC or ETH.
	Amount float32 `json:"amount"`
	// Unique instrument identifier
	InstrumentName string `json:"instrument_name"`
}

type PublicValidateFieldGetOpts

type PublicValidateFieldGetOpts struct {
	Value2 optional.String
}

type Settlement

type Settlement struct {
	// total value of session profit and losses (in base currency)
	SessionProfitLoss float32 `json:"session_profit_loss"`
	// mark price for at the settlement time (in quote currency; settlement and delivery only)
	MarkPrice float32 `json:"mark_price,omitempty"`
	// funding (in base currency ; settlement for perpetual product only)
	Funding float32 `json:"funding"`
	// the amount of the socialized losses (in base currency; bankruptcy only)
	Socialized float32 `json:"socialized,omitempty"`
	// value of session bankrupcy (in base currency; bankruptcy only)
	SessionBankrupcy float32 `json:"session_bankrupcy,omitempty"`
	// The timestamp (seconds since the Unix epoch, with millisecond precision)
	Timestamp int32 `json:"timestamp"`
	// profit and loss (in base currency; settlement and delivery only)
	ProfitLoss float32 `json:"profit_loss,omitempty"`
	// funded amount (bankruptcy only)
	Funded float32 `json:"funded,omitempty"`
	// underlying index price at time of event (in quote currency; settlement and delivery only)
	IndexPrice float32 `json:"index_price"`
	// total amount of paid taxes/fees (in base currency; bankruptcy only)
	SessionTax float32 `json:"session_tax,omitempty"`
	// rate of paid texes/fees (in base currency; bankruptcy only)
	SessionTaxRate float32 `json:"session_tax_rate,omitempty"`
	// instrument name (settlement and delivery only)
	InstrumentName string `json:"instrument_name"`
	// position size (in quote currency; settlement and delivery only)
	Position float32 `json:"position"`
	// The type of settlement. `settlement`, `delivery` or `bankruptcy`.
	Type string `json:"type"`
}

type SupportingApiService

type SupportingApiService service

func (*SupportingApiService) PublicGetTimeGet

func (a *SupportingApiService) PublicGetTimeGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

SupportingApiService Retrieves the current time (in milliseconds). This API endpoint can be used to check the clock skew between your software and Deribit's systems.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*SupportingApiService) PublicTestGet

func (a *SupportingApiService) PublicTestGet(ctx context.Context, localVarOptionals *PublicTestGetOpts) (map[string]interface{}, *http.Response, error)

type TradesVolumes

type TradesVolumes struct {
	// Total 24h trade volume for call options. This is expressed in the base currency, e.g. BTC for `btc_usd`
	CallsVolume float32 `json:"calls_volume"`
	// Total 24h trade volume for put options. This is expressed in the base currency, e.g. BTC for `btc_usd`
	PutsVolume float32 `json:"puts_volume"`
	// Currency pair: `\"btc_usd\"` or `\"eth_usd\"`
	CurrencyPair string `json:"currency_pair"`
	// Total 24h trade volume for futures. This is expressed in the base currency, e.g. BTC for `btc_usd`
	FuturesVolume float32 `json:"futures_volume"`
}

type TradingApiService

type TradingApiService service

func (*TradingApiService) PrivateBuyGet

func (a *TradingApiService) PrivateBuyGet(ctx context.Context, instrumentName string, amount float32, localVarOptionals *PrivateBuyGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateCancelAllByCurrencyGet

func (a *TradingApiService) PrivateCancelAllByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PrivateCancelAllByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateCancelAllByInstrumentGet

func (a *TradingApiService) PrivateCancelAllByInstrumentGet(ctx context.Context, instrumentName string, localVarOptionals *PrivateCancelAllByInstrumentGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateCancelAllGet

func (a *TradingApiService) PrivateCancelAllGet(ctx context.Context) (map[string]interface{}, *http.Response, error)

TradingApiService This method cancels all users orders and stop orders within all currencies and instrument kinds.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]interface{}

func (*TradingApiService) PrivateCancelGet

func (a *TradingApiService) PrivateCancelGet(ctx context.Context, orderId string) (map[string]interface{}, *http.Response, error)

TradingApiService Cancel an order, specified by order id

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param orderId The order id

@return map[string]interface{}

func (*TradingApiService) PrivateClosePositionGet

func (a *TradingApiService) PrivateClosePositionGet(ctx context.Context, instrumentName string, type_ string, localVarOptionals *PrivateClosePositionGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateEditGet

func (a *TradingApiService) PrivateEditGet(ctx context.Context, orderId string, amount float32, price float32, localVarOptionals *PrivateEditGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateGetMarginsGet

func (a *TradingApiService) PrivateGetMarginsGet(ctx context.Context, instrumentName string, amount float32, price float32) (map[string]interface{}, *http.Response, error)

TradingApiService Get margins for given instrument, amount and price.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param instrumentName Instrument name
  • @param amount Amount, integer for future, float for option. For perpetual and futures the amount is in USD units, for options it is amount of corresponding cryptocurrency contracts, e.g., BTC or ETH.
  • @param price Price

@return map[string]interface{}

func (*TradingApiService) PrivateGetOpenOrdersByCurrencyGet

func (a *TradingApiService) PrivateGetOpenOrdersByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PrivateGetOpenOrdersByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateGetOpenOrdersByInstrumentGet

func (a *TradingApiService) PrivateGetOpenOrdersByInstrumentGet(ctx context.Context, instrumentName string, localVarOptionals *PrivateGetOpenOrdersByInstrumentGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateGetOrderHistoryByCurrencyGet

func (a *TradingApiService) PrivateGetOrderHistoryByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PrivateGetOrderHistoryByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateGetOrderHistoryByInstrumentGet

func (a *TradingApiService) PrivateGetOrderHistoryByInstrumentGet(ctx context.Context, instrumentName string, localVarOptionals *PrivateGetOrderHistoryByInstrumentGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateGetOrderMarginByIdsGet

func (a *TradingApiService) PrivateGetOrderMarginByIdsGet(ctx context.Context, ids []string) (map[string]interface{}, *http.Response, error)

TradingApiService Retrieves initial margins of given orders

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param ids Ids of orders

@return map[string]interface{}

func (*TradingApiService) PrivateGetOrderStateGet

func (a *TradingApiService) PrivateGetOrderStateGet(ctx context.Context, orderId string) (map[string]interface{}, *http.Response, error)

TradingApiService Retrieve the current state of an order.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param orderId The order id

@return map[string]interface{}

func (*TradingApiService) PrivateGetSettlementHistoryByCurrencyGet

func (a *TradingApiService) PrivateGetSettlementHistoryByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PrivateGetSettlementHistoryByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateGetSettlementHistoryByInstrumentGet

func (a *TradingApiService) PrivateGetSettlementHistoryByInstrumentGet(ctx context.Context, instrumentName string, localVarOptionals *PrivateGetSettlementHistoryByInstrumentGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateGetUserTradesByCurrencyAndTimeGet

func (a *TradingApiService) PrivateGetUserTradesByCurrencyAndTimeGet(ctx context.Context, currency string, startTimestamp int32, endTimestamp int32, localVarOptionals *PrivateGetUserTradesByCurrencyAndTimeGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateGetUserTradesByCurrencyGet

func (a *TradingApiService) PrivateGetUserTradesByCurrencyGet(ctx context.Context, currency string, localVarOptionals *PrivateGetUserTradesByCurrencyGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateGetUserTradesByInstrumentAndTimeGet

func (a *TradingApiService) PrivateGetUserTradesByInstrumentAndTimeGet(ctx context.Context, instrumentName string, startTimestamp int32, endTimestamp int32, localVarOptionals *PrivateGetUserTradesByInstrumentAndTimeGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateGetUserTradesByInstrumentGet

func (a *TradingApiService) PrivateGetUserTradesByInstrumentGet(ctx context.Context, instrumentName string, localVarOptionals *PrivateGetUserTradesByInstrumentGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateGetUserTradesByOrderGet

func (a *TradingApiService) PrivateGetUserTradesByOrderGet(ctx context.Context, orderId string, localVarOptionals *PrivateGetUserTradesByOrderGetOpts) (map[string]interface{}, *http.Response, error)

func (*TradingApiService) PrivateSellGet

func (a *TradingApiService) PrivateSellGet(ctx context.Context, instrumentName string, amount float32, localVarOptionals *PrivateSellGetOpts) (map[string]interface{}, *http.Response, error)

type TransferItem

type TransferItem struct {
	// The timestamp (seconds since the Unix epoch, with millisecond precision)
	UpdatedTimestamp int32 `json:"updated_timestamp"`
	// Transfer direction
	Direction string `json:"direction,omitempty"`
	// Amount of funds in given currency
	Amount float32 `json:"amount"`
	// For transfer from/to subaccount returns this subaccount name, for transfer to other account returns address, for transfer from other account returns that accounts username.
	OtherSide string `json:"other_side"`
	// Currency, i.e `\"BTC\"`, `\"ETH\"`
	Currency string `json:"currency"`
	// Transfer state, allowed values : `prepared`, `confirmed`, `cancelled`, `waiting_for_admin`, `rejection_reason`
	State string `json:"state"`
	// The timestamp (seconds since the Unix epoch, with millisecond precision)
	CreatedTimestamp int32 `json:"created_timestamp"`
	// Type of transfer: `user` - sent to user, `subaccount` - sent to subaccount
	Type string `json:"type"`
	// Id of transfer
	Id int32 `json:"id"`
}

type Types

type Types struct {
}

type UserTrade

type UserTrade struct {
	// Trade direction of the taker
	Direction string `json:"direction"`
	// Currency, i.e `\"BTC\"`, `\"ETH\"`
	FeeCurrency string `json:"fee_currency"`
	// Id of the user order (maker or taker), i.e. subscriber's order id that took part in the trade
	OrderId string `json:"order_id"`
	// The timestamp of the trade
	Timestamp int32 `json:"timestamp"`
	// The price of the trade
	Price float32 `json:"price"`
	// Option implied volatility for the price (Option only)
	Iv float32 `json:"iv,omitempty"`
	// Unique (per currency) trade identifier
	TradeId string `json:"trade_id"`
	// User's fee in units of the specified `fee_currency`
	Fee float32 `json:"fee"`
	// Order type: `\"limit`, `\"market\"`, or `\"liquidation\"`
	OrderType string `json:"order_type,omitempty"`
	// The sequence number of the trade within instrument
	TradeSeq int32 `json:"trade_seq"`
	// `true` if the trade is against own order. This can only happen when your account has self-trading enabled. Contact an administrator if you think you need that
	SelfTrade bool `json:"self_trade"`
	// order state, `\"open\"`, `\"filled\"`, `\"rejected\"`, `\"cancelled\"`, `\"untriggered\"` or `\"archive\"` (if order was archived)
	State string `json:"state"`
	// User defined label (presented only when previously set for order by user)
	Label string `json:"label,omitempty"`
	// Index Price at the moment of trade
	IndexPrice float32 `json:"index_price"`
	// Trade amount. For perpetual and futures - in USD units, for options it is amount of corresponding cryptocurrency contracts, e.g., BTC or ETH.
	Amount float32 `json:"amount"`
	// Unique instrument identifier
	InstrumentName string `json:"instrument_name"`
	// Direction of the \"tick\" (`0` = Plus Tick, `1` = Zero-Plus Tick, `2` = Minus Tick, `3` = Zero-Minus Tick).
	TickDirection int32 `json:"tick_direction"`
	// Always `null`, except for a self-trade which is possible only if self-trading is switched on for the account (in that case this will be id of the maker order of the subscriber)
	MatchingId string `json:"matching_id"`
	// Describes what was role of users order: `\"M\"` when it was maker order, `\"T\"` when it was taker order
	Liquidity string `json:"liquidity,omitempty"`
}

type WalletApiService

type WalletApiService service

func (*WalletApiService) PrivateAddToAddressBookGet

func (a *WalletApiService) PrivateAddToAddressBookGet(ctx context.Context, currency string, type_ string, address string, name string, localVarOptionals *PrivateAddToAddressBookGetOpts) (map[string]interface{}, *http.Response, error)

func (*WalletApiService) PrivateCancelTransferByIdGet

func (a *WalletApiService) PrivateCancelTransferByIdGet(ctx context.Context, currency string, id int32, localVarOptionals *PrivateCancelTransferByIdGetOpts) (map[string]interface{}, *http.Response, error)

func (*WalletApiService) PrivateCancelWithdrawalGet

func (a *WalletApiService) PrivateCancelWithdrawalGet(ctx context.Context, currency string, id float32) (map[string]interface{}, *http.Response, error)

WalletApiService Cancels withdrawal request

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol
  • @param id The withdrawal id

@return map[string]interface{}

func (*WalletApiService) PrivateCreateDepositAddressGet

func (a *WalletApiService) PrivateCreateDepositAddressGet(ctx context.Context, currency string) (map[string]interface{}, *http.Response, error)

WalletApiService Creates deposit address in currency

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol

@return map[string]interface{}

func (*WalletApiService) PrivateGetAddressBookGet

func (a *WalletApiService) PrivateGetAddressBookGet(ctx context.Context, currency string, type_ string) (map[string]interface{}, *http.Response, error)

WalletApiService Retrieves address book of given type

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol
  • @param type_ Address book type

@return map[string]interface{}

func (*WalletApiService) PrivateGetCurrentDepositAddressGet

func (a *WalletApiService) PrivateGetCurrentDepositAddressGet(ctx context.Context, currency string) (map[string]interface{}, *http.Response, error)

WalletApiService Retrieve deposit address for currency

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol

@return map[string]interface{}

func (*WalletApiService) PrivateGetDepositsGet

func (a *WalletApiService) PrivateGetDepositsGet(ctx context.Context, currency string, localVarOptionals *PrivateGetDepositsGetOpts) (map[string]interface{}, *http.Response, error)

func (*WalletApiService) PrivateGetTransfersGet

func (a *WalletApiService) PrivateGetTransfersGet(ctx context.Context, currency string, localVarOptionals *PrivateGetTransfersGetOpts) (map[string]interface{}, *http.Response, error)

func (*WalletApiService) PrivateGetWithdrawalsGet

func (a *WalletApiService) PrivateGetWithdrawalsGet(ctx context.Context, currency string, localVarOptionals *PrivateGetWithdrawalsGetOpts) (map[string]interface{}, *http.Response, error)

func (*WalletApiService) PrivateRemoveFromAddressBookGet

func (a *WalletApiService) PrivateRemoveFromAddressBookGet(ctx context.Context, currency string, type_ string, address string, localVarOptionals *PrivateRemoveFromAddressBookGetOpts) (map[string]interface{}, *http.Response, error)

func (*WalletApiService) PrivateSubmitTransferToSubaccountGet

func (a *WalletApiService) PrivateSubmitTransferToSubaccountGet(ctx context.Context, currency string, amount float32, destination int32) (map[string]interface{}, *http.Response, error)

WalletApiService Transfer funds to a subaccount.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol
  • @param amount Amount of funds to be transferred
  • @param destination Id of destination subaccount

@return map[string]interface{}

func (*WalletApiService) PrivateSubmitTransferToUserGet

func (a *WalletApiService) PrivateSubmitTransferToUserGet(ctx context.Context, currency string, amount float32, destination string, localVarOptionals *PrivateSubmitTransferToUserGetOpts) (map[string]interface{}, *http.Response, error)

func (*WalletApiService) PrivateToggleDepositAddressCreationGet

func (a *WalletApiService) PrivateToggleDepositAddressCreationGet(ctx context.Context, currency string, state bool) (map[string]interface{}, *http.Response, error)

WalletApiService Enable or disable deposit address creation

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param currency The currency symbol
  • @param state

@return map[string]interface{}

func (*WalletApiService) PrivateWithdrawGet

func (a *WalletApiService) PrivateWithdrawGet(ctx context.Context, currency string, address string, amount float32, localVarOptionals *PrivateWithdrawGetOpts) (map[string]interface{}, *http.Response, error)

type Withdrawal

type Withdrawal struct {
	// The timestamp (seconds since the Unix epoch, with millisecond precision)
	UpdatedTimestamp int32 `json:"updated_timestamp"`
	// Fee in currency
	Fee float32 `json:"fee,omitempty"`
	// The timestamp (seconds since the Unix epoch, with millisecond precision) of withdrawal confirmation, `null` when not confirmed
	ConfirmedTimestamp *int32 `json:"confirmed_timestamp,omitempty"`
	// Amount of funds in given currency
	Amount float32 `json:"amount"`
	// Id of priority level
	Priority float32 `json:"priority,omitempty"`
	// Currency, i.e `\"BTC\"`, `\"ETH\"`
	Currency string `json:"currency"`
	// Withdrawal state, allowed values : `unconfirmed`, `confirmed`, `cancelled`, `completed`, `interrupted`, `rejected`
	State string `json:"state"`
	// Address in proper format for currency
	Address string `json:"address"`
	// The timestamp (seconds since the Unix epoch, with millisecond precision)
	CreatedTimestamp int32 `json:"created_timestamp,omitempty"`
	// Withdrawal id in Deribit system
	Id int32 `json:"id,omitempty"`
	// Transaction id in proper format for currency, `null` if id is not available
	TransactionId *string `json:"transaction_id"`
}

Jump to

Keyboard shortcuts

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