API Reference Bingex v0.1.13
Modules
Bingex is an Elixir library for interacting with the BingX exchange, providing a transparent and reliable API interface.
Represents an error that occurs within the BingX API.
Represents a standardized API response from BingX.
Represents an HTTP error (based on Mint.HTTPError
).
Represents HTTP request payload for the BingX API.
Represents an HTTP response from the BingX API.
Defines the structure and types for orders in BingX.
Provides an abstraction over WebSocket connections for BingX.
Provides an interface to interact with the BingX Swap API.
Represents response content on Bingex.Swap.cancel_all_orders
request.
Represents response content on Bingex.Swap.close_all_positions
request.
Represents response content on Bingex.Swap.get_balance
request.
Represents response content on Bingex.Swap.get_contracts
request.
Represents response content on Bingex.Swap.get_income_history
request.
Represents response content on Bingex.Swap.get_leverage
request.
Represents response content on Bingex.Swap.get_orders_history
request.
Represents response content on Bingex.Swap.get_positions
request.
Represents response content on Bingex.Swap.get_positions_history
request.
Represents response content on Bingex.Swap.get_quotes
request.
Represents response content on Bingex.Swap.get_server_time
request.
Represents response content on Bingex.Swap.plase_order
request.
Represents response content on Bingex.Swap.place_orders
request.
Represents response content on Bingex.Swap.place_test_order
request.
Represents response content on Bingex.Swap.set_leverage
request.
defmodule EventSource do
use Bingex.Swap.EventSocket
require Logger
alias Bingex.Swap.EventSocket
def start_link(listen_key) do
EventSocket.start_link(listen_key, __MODULE__, :state)
end
@impl true
def handle_event(type, event, state) do
Logger.info(%{ type: type, event: event, state: state })
{:ok, state}
end
end
Represents an account event in swap.
Represents balance information for a swap account.
Represents a configuration event.
Represents contract information for a swap contract.
Represents detailed order information for a swap contract.
Represents detailed position update information for a swap contract.
Represents income update as part of the capital flow.
Represents order information for a swap contract.
Represents individual position information.
Represents basic position update information.
Represents price update event.
Represents real-time quote information for a swap contract.
Represents trade event from a swap account.
Represents a wallet balance update event for a swap account.
defmodule PriceSource do
use Bingex.Swap.PriceSocket
alias Bingex.Swap.PriceSocket
def start_link(_args \\ []) do
PriceSocket.start_link(__MODULE__, :state)
end
@impl true
def handle_connect(state) do
PriceSocket.subscribe(symbol: "BTC-USDT", type: :last)
{:ok, state}
end
@impl true
def handle_event(type, event, state) do
IO.inspect({type, event, state})
{:ok, state}
end
end
Provides general types.
Provides an interface to interact with the BingX User API.
Represents response content on Bingex.User.generate_listen_key
request.
Represents response content on Bingex.User.get_referral
request.
Represents response content on Bingex.User.get_referrals
request.
Represents referral information for a user in BingX.