API Reference Bingex v0.1.8
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.
Parses and structures response data for closing all swap positions on BingX.
Parses and structures response data for closing all swap positions on BingX.
Parses and structures balance data for BingX swap accounts.
Parses and structures contract data for BingX swap markets.
Processes leverage info response data for BingX swaps.
Parses and structures historical order data for BingX swaps.
Parses and structures positions data for BingX swaps.
Parses and structures historical positions data for BingX swaps.
Parses and structures quote data for BingX swaps.
Parses and structures server time data for BingX swaps.
Parses and structures order placement data for BingX swaps.
Parses and structures batch order placement data for BingX swaps.
Parses and structures test order placement data for BingX swaps.
Processes leverage setting response data for BingX swaps.
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 BingX swaps.
Represents balance information for a BingX swap account.
Represents a configuration event in BingX swaps.
Represents contract information for a swap contract in BingX.
Represents detailed order information for a swap contract in BingX.
Represents detailed position update information for a swap contract in BingX.
Represents order information for a swap contract in BingX.
Decodes individual position data returned by the BingX swap API.
Represents position update information for a swap contract in BingX.
Handles price events in BingX swaps.
Represents real-time quote information for a swap contract in BingX.
Processes trade events in BingX swaps.
Represents a wallet balance update event for a swap account in BingX.
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 an interface to interact with the BingX User API.
Represents the listen key data for user authentication in BingX.
Retrieves and structures referral data for a user in BingX.
Retrieves and structures a list of referral data for a user in BingX.
Represents referral information for a user in BingX.