API Reference Bingex v0.1.7
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.
This module provides encoders/encoders to perform conversions from local terms to BingX API terms, and vice versa.
HTTP adapter for making requests to the BingX API.
Represents an HTTP error when communicating with the BingX API.
Constructs and signs HTTP requests for the BingX API.
Represents an HTTP response from the BingX API.
Handles request signing for 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 an account event in BingX swaps.
Parses and structures response data for closing all swap positions on BingX.
Parses and structures response data for closing all swap positions on BingX.
Represents a configuration event in BingX swaps.
Represents contract information for a swap contract in BingX.
Parses and structures positions data for BingX swaps.
Represents detailed order information for a swap contract in BingX.
defmodule EventSource do
use Bingex.Swap.EventSocket
require Logger
alias Bingex.Swap.EventSocket
alias Bingex.User
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
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 historical positions data for BingX swaps.
Parses and structures quote data for BingX swaps.
Parses and structures server time data for BingX swaps.
Handles serialization and transformation of orders for BingX Swap.
Represents balance information for a BingX swap account.
Represents order information for a swap contract in BingX.
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 position change info for BingX swaps.
Decodes individual position data returned by the BingX swap API.
Represents position update information for a swap contract in BingX (ws event).
Handles price events in BingX swaps.
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
Process.flag(:trap_exit, true)
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
Represents real-time quote information for a swap contract in BingX.
Processes leverage setting response data for BingX swaps.
Processes trade events in BingX swaps.
Represents a wallet balance update event for a swap account in BingX (ws event).
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.