Packages

Elixir client library for cryptocurrency exchanges — generated from CCXT specs via compile-time macros.

Current section

Files

Jump to
ccxt_client priv specs extracted zebpay.exs
Raw

priv/specs/extracted/zebpay.exs

# Zebpay Exchange Specification
#
# Auto-generated by: mix ccxt.extract zebpay
# CCXT version: 4.5.34
# Spec format version: 1
#
# Review before use:
# - signing: Detected from sign() method, verify with testnet
# - endpoints: Raw paths extracted, map to unified API as needed
# - exceptions: Extracted (exact, broad, HTTP status codes)
# - features/options: Extracted from describe()
# - classification: Set to :supported initially, promote after validation
#
%{
api_param_requirements: nil,
certified: false,
classification: :supported,
comment: nil,
countries: [
"IN"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 20,
"coveragePercent" => 100,
"enabledMethods" => 24,
"excluded" => [
%{
"method" => "editOrder",
"reason" => "emulated (returns cached data, no HTTP call)"
}
],
"excludedMethods" => 1,
"extractableMethods" => 23,
"failures" => [
%{
"error" => "zebpay spot market orders require cost in params",
"method" => "createMarketOrder"
},
%{
"error" => "zebpay fetchMyTrades() does not support spot markets",
"method" => "fetchMyTrades"
},
%{
"error" => "zebpay fetchOHLCV() requires a both a since and until/endtime parameter for spot markets",
"method" => "fetchOHLCV"
}
]
},
endpoints: [
%{
api_section: "private/spot",
auth: true,
cost: 10,
market_type: :spot,
method: :delete,
name: :cancel_all_orders,
param_mappings: %{},
params: [
:symbol
],
path: "/v2/ex/orders/cancelAll",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private/spot",
auth: true,
cost: 10,
market_type: :spot,
method: :delete,
name: :cancel_order,
param_mappings: %{
"id" => "orderId"
},
params: [
:id,
:symbol
],
path: "/v2/ex/order",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private/spot",
auth: true,
cost: 10,
default_params: %{
"clientOrderId" => "<generated>",
"timeInForce" => "GTC",
"type" => "LIMIT"
},
market_type: :spot,
method: :post,
name: :create_limit_order,
param_mappings: %{},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/v2/ex/orders",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private/spot",
auth: true,
cost: 10,
default_params: %{
"clientOrderId" => "<generated>",
"timeInForce" => "GTC"
},
market_type: :spot,
method: :post,
name: :create_order,
param_mappings: %{},
params: [
:symbol,
:type,
:side,
:amount,
:price
],
path: "/v2/ex/orders",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private/spot",
auth: true,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_balance,
param_mappings: %{},
params: [],
path: "/v2/account/balance",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public/spot",
auth: false,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_currencies,
param_mappings: %{},
params: [],
path: "/v2/ex/currencies",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public/spot",
auth: false,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_l2_order_book,
param_mappings: %{},
params: [
:symbol,
:limit
],
path: "/v2/market/orderbook",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private/swap",
auth: true,
cost: 10,
default_params: %{
"symbol" => "BTCUSDT"
},
market_type: :swap,
method: :get,
name: :fetch_leverage,
param_mappings: %{},
params: [
:symbol
],
path: "/v1/trade/userLeverage",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "private/swap",
auth: true,
cost: 10,
market_type: :swap,
method: :get,
name: :fetch_leverages,
param_mappings: %{},
params: [
:symbols
],
path: "/v1/trade/userLeverages",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public/spot",
auth: false,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/v2/ex/exchangeInfo",
response_transformer: {:extract_path, ["data", "symbols"]},
source: :intercepted
},
%{
api_section: "private/spot",
auth: true,
cost: 10,
default_params: %{
"currentPage" => 1
},
market_type: :spot,
method: :get,
name: :fetch_open_orders,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/v2/ex/orders",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private/spot",
auth: true,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_order,
param_mappings: %{
"id" => "orderId"
},
params: [
:id,
:symbol
],
path: "/v2/ex/order",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "public/spot",
auth: false,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_order_book,
param_mappings: %{},
params: [
:symbol,
:limit
],
path: "/v2/market/orderbook",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "private/spot",
auth: true,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_order_trades,
param_mappings: %{
"id" => "orderId"
},
params: [
:id,
:symbol,
:since,
:limit
],
path: "/v2/ex/order/fills",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private/swap",
auth: true,
cost: 10,
default_params: %{
"symbols" => [
"BTCUSDT"
]
},
market_type: :swap,
method: :get,
name: :fetch_positions,
param_mappings: %{},
params: [
:symbols
],
path: "/v1/trade/positions",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public/spot",
auth: false,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_ticker,
param_mappings: %{},
params: [
:symbol
],
path: "/v2/market/ticker",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "public/spot",
auth: false,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_tickers,
param_mappings: %{},
params: [
:symbols
],
path: "/v2/market/allTickers",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public/spot",
auth: false,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_trades,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/v2/market/trades",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private/spot",
auth: true,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_trading_fee,
param_mappings: %{},
params: [
:symbol
],
path: "/v2/ex/tradefee",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "private/swap",
auth: true,
cost: 10,
default_params: %{
"symbol" => "BTCUSDT"
},
market_type: :swap,
method: :post,
name: :set_leverage,
param_mappings: %{},
params: [
:leverage,
:symbol
],
path: "/v1/trade/update/userLeverage",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
}
],
error_code_details: %{
3013 => %{
description: nil,
type: :order_not_found
},
400 => %{
description: "Bad Request -- Invalid request format",
type: :invalid_parameters
},
401 => %{
description: "Unauthorized -- Invalid API Key",
type: :invalid_credentials
},
403 => %{
description: "Forbidden -- The request is forbidden",
type: :exchange_error
},
404 => %{
description: "Not Found -- The specified resource could not be found",
type: :exchange_error
},
429 => %{
description: "Too Many Requests -- Access limit breached",
type: :rate_limited
},
500 => %{
description: "Internal Server Error -- We had a problem with our server. Try again later.",
type: :network_error
},
503 => %{
description: "Service Unavailable -- We're temporarily offline for maintenance. Please try again later.",
type: :network_error
},
77 => %{
description: nil,
type: :invalid_order
},
"Insufficient margin" => %{
description: nil,
type: :insufficient_balance
},
"Invalid trade order type" => %{
description: nil,
type: :invalid_order
},
"InvalidOrder" => %{
description: "Rate should be in the range of",
type: :invalid_order
},
"Order quantity is out of range" => %{
description: nil,
type: :invalid_order
},
"insufficient balance" => %{
description: nil,
type: :insufficient_balance
},
"leverage must be in [1,8]" => %{
description: nil,
type: :invalid_parameters
},
"the request you sent is invalid" => %{
description: nil,
type: :invalid_parameters
}
},
error_codes: %{
3013 => :order_not_found,
400 => :invalid_parameters,
401 => :invalid_credentials,
403 => :exchange_error,
404 => :exchange_error,
429 => :rate_limited,
500 => :network_error,
503 => :network_error,
77 => :invalid_order,
"Insufficient margin" => :insufficient_balance,
"Invalid trade order type" => :invalid_order,
"InvalidOrder" => :invalid_order,
"Order quantity is out of range" => :invalid_order,
"insufficient balance" => :insufficient_balance,
"leverage must be in [1,8]" => :invalid_parameters,
"the request you sent is invalid" => :invalid_parameters
},
exceptions: %{
broad: %{
"InvalidOrder" => :invalid_order
},
exact: %{
"3013" => :order_not_found,
"400" => :bad_request,
"401" => :authentication_error,
"403" => :not_supported,
"404" => :not_supported,
"429" => :rate_limit_exceeded,
"500" => :exchange_not_available,
"503" => :exchange_not_available,
"77" => :invalid_order,
"Insufficient margin" => :insufficient_funds,
"Invalid trade order type" => :invalid_order,
"Order quantity is out of range" => :invalid_order,
"insufficient balance" => :insufficient_funds,
"leverage must be in [1,8]" => :bad_request,
"the request you sent is invalid" => :bad_request
}
},
exchange_options: %{
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"defaultType" => "spot",
"fetchMarkets" => %{
"types" => [
"spot",
"swap"
]
},
"networksById" => %{}
},
extended_metadata: %{
fees_url: "https://zebpay.com/in/features/pricing",
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://github.com/user-attachments/assets/8094e7be-55a7-46f4-a087-0ca31b48ecad"
},
extracted_metadata: %{
ccxt_version: "4.5.34"
},
features: %{
default: %{
fetch_ohlcv: %{
limit: 100
}
}
},
fees: nil,
handle_content_type_application_zip: nil,
handle_errors_source: "handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if (!response) {\n this.throwBroadlyMatchedException(this.exceptions['broad'], body, body);\n return undefined;\n }\n //\n // bad\n // { \"code\": \"400100\", \"msg\": \"validation.createOrder.clientOidIsRequired\" }\n // good\n // { code: \"200000\", data: { ... }}\n // {\"statusDescription\":\"Order quantity is out of range\",\"data\":{},\"statusCode\":400,\"customMessage\":[\"Order quantity is out of range\"]}\n //\n const errorCode = this.safeString2(response, 'code', 'statusCode');\n const message = this.safeString2(response, 'msg', 'statusDescription');\n const feedback = this.id + ' ' + message;\n this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);\n this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);\n this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);\n return undefined;\n }",
has: %{
add_margin: true,
borrow_cross_margin: false,
borrow_isolated_margin: false,
borrow_margin: false,
c_o_r_s: false,
cancel_all_orders: true,
cancel_all_orders_ws: false,
cancel_order: true,
cancel_order_with_client_order_id: false,
cancel_order_ws: false,
cancel_orders: false,
cancel_orders_with_client_order_id: false,
cancel_orders_ws: false,
close_all_positions: false,
close_position: true,
create_deposit_address: false,
create_limit_buy_order: false,
create_limit_buy_order_ws: false,
create_limit_order: true,
create_limit_order_ws: false,
create_limit_sell_order: false,
create_limit_sell_order_ws: false,
create_market_buy_order: false,
create_market_buy_order_with_cost: false,
create_market_buy_order_with_cost_ws: false,
create_market_buy_order_ws: false,
create_market_order: true,
create_market_order_with_cost: false,
create_market_order_with_cost_ws: false,
create_market_order_ws: true,
create_market_sell_order: false,
create_market_sell_order_with_cost: false,
create_market_sell_order_with_cost_ws: false,
create_market_sell_order_ws: false,
create_order: true,
create_order_with_take_profit_and_stop_loss: false,
create_order_with_take_profit_and_stop_loss_ws: false,
create_order_ws: false,
create_orders: false,
create_post_only_order: false,
create_post_only_order_ws: false,
create_reduce_only_order: false,
create_reduce_only_order_ws: false,
create_stop_limit_order: false,
create_stop_limit_order_ws: false,
create_stop_loss_order: false,
create_stop_loss_order_ws: false,
create_stop_market_order: false,
create_stop_market_order_ws: false,
create_stop_order: false,
create_stop_order_ws: false,
create_take_profit_order: false,
create_take_profit_order_ws: false,
create_trailing_amount_order: false,
create_trailing_amount_order_ws: false,
create_trailing_percent_order: false,
create_trailing_percent_order_ws: false,
create_trigger_order: false,
create_trigger_order_ws: false,
deposit: false,
edit_order: true,
edit_order_with_client_order_id: false,
edit_order_ws: false,
edit_orders: false,
fetch_accounts: false,
fetch_balance: true,
fetch_balance_ws: false,
fetch_bids_asks: false,
fetch_borrow_interest: false,
fetch_borrow_rate: false,
fetch_borrow_rate_histories: false,
fetch_borrow_rate_history: false,
fetch_borrow_rates: false,
fetch_borrow_rates_per_symbol: false,
fetch_canceled_and_closed_orders: false,
fetch_canceled_orders: false,
fetch_closed_order: false,
fetch_closed_orders: false,
fetch_closed_orders_ws: false,
fetch_convert_currencies: false,
fetch_convert_quote: false,
fetch_convert_trade: false,
fetch_convert_trade_history: false,
fetch_cross_borrow_rate: false,
fetch_cross_borrow_rates: false,
fetch_currencies: true,
fetch_currencies_ws: true,
fetch_deposit: false,
fetch_deposit_address: false,
fetch_deposit_addresses: false,
fetch_deposit_addresses_by_network: false,
fetch_deposit_withdraw_fee: false,
fetch_deposit_withdraw_fees: false,
fetch_deposits: false,
fetch_deposits_withdrawals: false,
fetch_deposits_ws: false,
fetch_funding_history: false,
fetch_funding_interval: false,
fetch_funding_intervals: false,
fetch_funding_rate: false,
fetch_funding_rate_history: false,
fetch_funding_rates: false,
fetch_greeks: false,
fetch_index_ohlcv: false,
fetch_isolated_borrow_rate: false,
fetch_isolated_borrow_rates: false,
fetch_isolated_positions: false,
fetch_l2_order_book: true,
fetch_l3_order_book: false,
fetch_last_prices: false,
fetch_ledger: false,
fetch_ledger_entry: false,
fetch_leverage: true,
fetch_leverage_tiers: false,
fetch_leverages: true,
fetch_liquidations: false,
fetch_long_short_ratio: false,
fetch_long_short_ratio_history: false,
fetch_margin_adjustment_history: false,
fetch_margin_mode: false,
fetch_margin_modes: false,
fetch_mark_ohlcv: false,
fetch_mark_prices: false,
fetch_market_leverage_tiers: false,
fetch_markets: true,
fetch_markets_ws: false,
fetch_my_liquidations: false,
fetch_my_settlement_history: false,
fetch_my_trades: true,
fetch_my_trades_ws: false,
fetch_ohlcv: true,
fetch_ohlcv_ws: false,
fetch_open_interest: false,
fetch_open_interest_history: false,
fetch_open_interests: false,
fetch_open_order: false,
fetch_open_orders: true,
fetch_open_orders_ws: false,
fetch_option: false,
fetch_option_chain: false,
fetch_order: true,
fetch_order_book: true,
fetch_order_book_ws: false,
fetch_order_books: false,
fetch_order_trades: true,
fetch_order_with_client_order_id: false,
fetch_order_ws: false,
fetch_orders: false,
fetch_orders_by_status: false,
fetch_orders_ws: false,
fetch_position: false,
fetch_position_history: false,
fetch_position_mode: false,
fetch_position_ws: false,
fetch_positions: true,
fetch_positions_for_symbol: false,
fetch_positions_for_symbol_ws: false,
fetch_positions_history: false,
fetch_positions_risk: false,
fetch_positions_ws: false,
fetch_premium_index_ohlcv: false,
fetch_settlement_history: false,
fetch_status: false,
fetch_ticker: true,
fetch_ticker_ws: false,
fetch_tickers: true,
fetch_tickers_ws: false,
fetch_time: false,
fetch_trades: true,
fetch_trades_ws: false,
fetch_trading_fee: true,
fetch_trading_fees: false,
fetch_trading_fees_ws: false,
fetch_trading_limits: false,
fetch_transaction_fee: false,
fetch_transaction_fees: false,
fetch_transactions: false,
fetch_transfer: false,
fetch_transfers: false,
fetch_underlying_assets: false,
fetch_volatility_history: false,
fetch_withdraw_addresses: false,
fetch_withdrawal: false,
fetch_withdrawal_whitelist: false,
fetch_withdrawals: false,
fetch_withdrawals_ws: false,
future: false,
margin: false,
option: false,
private_api: true,
public_api: true,
reduce_margin: true,
repay_cross_margin: false,
repay_isolated_margin: false,
sandbox: false,
set_leverage: true,
set_margin: false,
set_margin_mode: false,
set_position_mode: false,
sign_in: false,
spot: true,
swap: true,
transfer: false,
un_watch_my_trades: false,
un_watch_ohlcv: false,
un_watch_ohlcv_for_symbols: false,
un_watch_order_book: false,
un_watch_order_book_for_symbols: false,
un_watch_orders: false,
un_watch_positions: false,
un_watch_ticker: false,
un_watch_tickers: false,
un_watch_trades: false,
un_watch_trades_for_symbols: false,
watch_balance: false,
watch_bids_asks: false,
watch_liquidations: false,
watch_liquidations_for_symbols: false,
watch_my_liquidations: false,
watch_my_liquidations_for_symbols: false,
watch_my_trades: false,
watch_ohlcv: false,
watch_ohlcv_for_symbols: false,
watch_order_book: false,
watch_order_book_for_symbols: false,
watch_orders: false,
watch_orders_for_symbols: false,
watch_position: false,
watch_positions: false,
watch_status: false,
watch_ticker: false,
watch_tickers: false,
watch_trades: false,
watch_trades_for_symbols: false,
withdraw: false,
ws: false
},
http_config: nil,
id: "zebpay",
markets: nil,
name: "Zebpay",
ohlcv_timestamp_resolution: :unknown,
options: %{
default_account_type: "spot",
default_type: "spot",
fetch_markets: %{
"types" => [
"spot",
"swap"
]
}
},
order_mappings: %{
side_format: :uppercase,
side_key: "side",
type_format: :uppercase,
type_key: "type"
},
param_mappings: %{
"id" => "orderId"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [],
"line_end" => 1720,
"line_start" => 1702,
"mappings" => [],
"name" => "parseBalance",
"signature" => "parseBalance (response): Balances",
"source" => "parseBalance (response): Balances {\n const result: Dict = {\n 'info': response,\n 'timestamp': undefined,\n 'datetime': undefined,\n };\n const currencyList = this.safeList (response, 'data', []);\n for (let i = 0; i < currencyList.length; i++) {\n const entry = currencyList[i];\n const account = this.account ();\n account['total'] = this.safeString (entry, 'total');\n account['free'] = this.safeString (entry, 'free');\n account['used'] = this.safeString (entry, 'used');\n const currencyId = this.safeString (entry, 'currency');\n const code = this.safeCurrencyCode (currencyId);\n result[code] = account;\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1776,
"line_start" => 1763,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "info"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "marketId"
},
%{
"comment" => nil,
"key" => "marginMode",
"value" => "marginMode"
},
%{
"comment" => nil,
"key" => "longLeverage",
"value" => "leverageValue"
},
%{
"comment" => nil,
"key" => "shortLeverage",
"value" => "leverageValueShort"
}
],
"name" => "parseLeverage",
"signature" => "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
"source" => "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n const marketId = this.safeString (leverage, 'symbol');\n const info = this.safeDict (leverage, 'info');\n const leverageValue = this.safeInteger (leverage, 'longLeverage');\n const leverageValueShort = this.safeInteger (leverage, 'shortLeverage');\n const marginMode = this.safeString (leverage, 'marginMode');\n return {\n 'info': info,\n 'symbol': marketId,\n 'marginMode': marginMode,\n 'longLeverage': leverageValue,\n 'shortLeverage': leverageValueShort,\n } as Leverage;\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"symbol\": \"BTCINR\",\n \"type\": \"reduce\",\n \"amount\": 1000,\n \"code\": \"INR\",\n \"status\": \"ok\"\n }"
],
"line_end" => 1867,
"line_start" => 1844,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "info"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "market['id']"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "marginMode",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.safeNumber (info, 'amount')"
},
%{
"comment" => nil,
"key" => "total",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "code",
"value" => "this.safeString (info, 'code')"
},
%{
"comment" => nil,
"key" => "status",
"value" => "this.safeString (info, 'status')"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
}
],
"name" => "parseMarginModification",
"signature" => "parseMarginModification (info, market: Market = undefined): MarginModification",
"source" => "parseMarginModification (info, market: Market = undefined): MarginModification {\n //\n // {\n // \"symbol\": \"BTCINR\",\n // \"type\": \"reduce\",\n // \"amount\": 1000,\n // \"code\": \"INR\",\n // \"status\": \"ok\"\n // }\n //\n const timestamp = this.milliseconds ();\n return {\n 'info': info,\n 'symbol': market['id'],\n 'type': undefined,\n 'marginMode': undefined,\n 'amount': this.safeNumber (info, 'amount'),\n 'total': undefined,\n 'code': this.safeString (info, 'code'),\n 'status': this.safeString (info, 'status'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n };\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"clientOrderId\": \"64507d02921f1c0001ff6892-123-zeb\",\n \"datetime\": \"2025-03-14T14:34:34.4567\",\n \"timestamp\": 1741962557553,\n \"status\": \"open\",\n \"symbol\": \"BTCINR\",\n \"type\": \"market\",\n \"timeInForce\": \"GTC\",\n \"side\": \"buy\",\n \"price\": 700000,\n \"amount\": 0.002,\n \"filled\": null,\n \"remaining\": 0.002,\n \"trades\": []\n }"
],
"line_end" => 1333,
"line_start" => 1276,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "orderId"
},
%{
"comment" => nil,
"key" => "clientOrderId",
"value" => "clientOrderId"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "timeInForce",
"value" => "timeInForce"
},
%{
"comment" => nil,
"key" => "postOnly",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "reduceOnly",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "triggerPrice",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "filled",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "remaining",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "datetime"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "info",
"value" => "order"
},
%{
"comment" => nil,
"key" => "lastTradeTimestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "lastUpdateTimestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "trades",
"value" => "undefined"
}
],
"name" => "parseOrder",
"signature" => "parseOrder (order: Dict, market: Market = undefined): Order",
"source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // {\n // \"clientOrderId\": \"64507d02921f1c0001ff6892-123-zeb\",\n // \"datetime\": \"2025-03-14T14:34:34.4567\",\n // \"timestamp\": 1741962557553,\n // \"status\": \"open\",\n // \"symbol\": \"BTCINR\",\n // \"type\": \"market\",\n // \"timeInForce\": \"GTC\",\n // \"side\": \"buy\",\n // \"price\": 700000,\n // \"amount\": 0.002,\n // \"filled\": null,\n // \"remaining\": 0.002,\n // \"trades\": []\n // }\n //\n const marketId = this.safeString (order, 'symbol');\n market = this.safeMarket (marketId, market);\n const symbol = market['symbol'];\n const type = this.safeString (order, 'type');\n const timestamp = this.safeNumber (order, 'timestamp');\n const datetime = this.iso8601 (timestamp);\n const price = this.safeString (order, 'price');\n const side = this.safeString (order, 'side');\n const amount = this.safeString (order, 'amount');\n const clientOrderId = this.safeString (order, 'clientOrderId');\n const timeInForce = this.safeString (order, 'timeInForce');\n const status = this.safeStringLower (order, 'status');\n const orderId = this.safeString (order, 'orderId', undefined);\n const parsedOrder = this.safeOrder ({\n 'id': orderId,\n 'clientOrderId': clientOrderId,\n 'symbol': symbol,\n 'type': type,\n 'timeInForce': timeInForce,\n 'postOnly': undefined,\n 'reduceOnly': undefined,\n 'side': side,\n 'amount': amount,\n 'price': price,\n 'triggerPrice': undefined,\n 'cost': undefined,\n 'filled': undefined,\n 'remaining': undefined,\n 'timestamp': timestamp,\n 'datetime': datetime,\n 'fee': undefined,\n 'status': status,\n 'info': order,\n 'lastTradeTimestamp': undefined,\n 'lastUpdateTimestamp': undefined,\n 'average': undefined,\n 'trades': undefined,\n }, market);\n return parsedOrder;\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\":\"long\",\n \"symbol\":\"pf_ftmusd\",\n \"entryPrice\":\"0.4921\",\n \"datetime\":\"2023-02-22T11:37:16.685Z\",\n \"contractSize\":\"1\",\n \"leverage\":\"1.0\"\n }"
],
"line_end" => 1761,
"line_start" => 1722,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "position"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "marketId"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "this.parse8601 (datetime)"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "datetime"
},
%{
"comment" => nil,
"key" => "initialMargin",
"value" => "this.safeNumber (position, 'initialMargin')"
},
%{
"comment" => nil,
"key" => "initialMarginPercentage",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "maintenanceMargin",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "maintenanceMarginPercentage",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "entryPrice",
"value" => "this.safeNumber (position, 'entryPrice')"
},
%{
"comment" => nil,
"key" => "notional",
"value" => "this.safeNumber (position, 'notional')"
},
%{
"comment" => nil,
"key" => "leverage",
"value" => "leverage"
},
%{
"comment" => nil,
"key" => "unrealizedPnl",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "contracts",
"value" => "this.safeNumber (position, 'contracts')"
},
%{
"comment" => nil,
"key" => "contractSize",
"value" => "this.safeNumber (market, 'contractSize')"
},
%{
"comment" => nil,
"key" => "marginRatio",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "liquidationPrice",
"value" => "this.safeNumber (position, 'liquidationPrice')"
},
%{
"comment" => nil,
"key" => "markPrice",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "collateral",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "marginType",
"value" => "'isolated'"
},
%{
"comment" => nil,
"key" => "side",
"value" => "this.safeString (position, 'side')"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "undefined"
}
],
"name" => "parsePosition",
"signature" => "parsePosition (position: Dict, market: Market = undefined)",
"source" => "parsePosition (position: Dict, market: Market = undefined) {\n //\n // isolated\n // {\n // \"id\":\"long\",\n // \"symbol\":\"pf_ftmusd\",\n // \"entryPrice\":\"0.4921\",\n // \"datetime\":\"2023-02-22T11:37:16.685Z\",\n // \"contractSize\":\"1\",\n // \"leverage\":\"1.0\"\n // }\n //\n const leverage = this.safeNumber (position, 'leverage');\n const datetime = this.safeString (position, 'datetime');\n const marketId = this.safeString (position, 'symbol');\n market = this.safeMarket (marketId, market);\n return {\n 'info': position,\n 'symbol': marketId,\n 'timestamp': this.parse8601 (datetime),\n 'datetime': datetime,\n 'initialMargin': this.safeNumber (position, 'initialMargin'),\n 'initialMarginPercentage': undefined,\n 'maintenanceMargin': undefined,\n 'maintenanceMarginPercentage': undefined,\n 'entryPrice': this.safeNumber (position, 'entryPrice'),\n 'notional': this.safeNumber (position, 'notional'),\n 'leverage': leverage,\n 'unrealizedPnl': undefined,\n 'contracts': this.safeNumber (position, 'contracts'),\n 'contractSize': this.safeNumber (market, 'contractSize'),\n 'marginRatio': undefined,\n 'liquidationPrice': this.safeNumber (position, 'liquidationPrice'),\n 'markPrice': undefined,\n 'collateral': undefined,\n 'marginType': 'isolated',\n 'side': this.safeString (position, 'side'),\n 'percentage': undefined,\n };\n }"
},
%{
"comment" => nil,
"examples" => [
"[\n {\n \"symbol\": \"BTC-INR\",\n \"bestBid\": \"4900000\",\n \"bestBidQty\": \"0.00014938\",\n \"bestAsk\": \"\",\n \"bestAskQty\": \"0\",\n \"priceChange\": \"-98134.56\",\n \"priceChangePercent\": \"-1.84\",\n \"high\": \"5433400\",\n \"low\": \"5333400\",\n \"vol\": \"0.0002\",\n \"volValue\": \"1066.68\",\n \"last\": \"5333400\"\n }\n ]"
],
"line_end" => 1842,
"line_start" => 1791,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "marketId"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "market['symbol']"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "high",
"value" => "this.safeString (ticker, 'high')"
},
%{
"comment" => nil,
"key" => "low",
"value" => "this.safeString (ticker, 'low')"
},
%{
"comment" => nil,
"key" => "bid",
"value" => "this.safeString (ticker, 'bid')"
},
%{
"comment" => nil,
"key" => "bidVolume",
"value" => "bidVolume"
},
%{
"comment" => nil,
"key" => "ask",
"value" => "this.safeString (ticker, 'ask')"
},
%{
"comment" => nil,
"key" => "askVolume",
"value" => "askVolume"
},
%{
"comment" => nil,
"key" => "vwap",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "open",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "close",
"value" => "close"
},
%{
"comment" => nil,
"key" => "last",
"value" => "last"
},
%{
"comment" => nil,
"key" => "previousClose",
"value" => "this.safeString (ticker, 'previousClose')"
},
%{
"comment" => nil,
"key" => "change",
"value" => "this.safeString (ticker, 'change')"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "percentage"
},
%{
"comment" => nil,
"key" => "average",
"value" => "this.safeString (ticker, 'average')"
},
%{
"comment" => nil,
"key" => "baseVolume",
"value" => "this.safeString (ticker, 'baseVolume')"
},
%{
"comment" => nil,
"key" => "quoteVolume",
"value" => "this.safeString (ticker, 'quoteVolume')"
},
%{
"comment" => nil,
"key" => "markPrice",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "ticker"
}
],
"name" => "parseTicker",
"signature" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
"source" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n //\n // [\n // {\n // \"symbol\": \"BTC-INR\",\n // \"bestBid\": \"4900000\",\n // \"bestBidQty\": \"0.00014938\",\n // \"bestAsk\": \"\",\n // \"bestAskQty\": \"0\",\n // \"priceChange\": \"-98134.56\",\n // \"priceChangePercent\": \"-1.84\",\n // \"high\": \"5433400\",\n // \"low\": \"5333400\",\n // \"vol\": \"0.0002\",\n // \"volValue\": \"1066.68\",\n // \"last\": \"5333400\"\n // }\n // ]\n //\n const timestamp = this.safeInteger2 (ticker, 'timestamp', 'ts', undefined);\n const marketId = this.safeString (ticker, 'symbol');\n market = this.safeMarket (marketId);\n const close = this.safeString (ticker, 'close', undefined);\n const last = this.safeString (ticker, 'last', undefined);\n const percentage = this.safeString (ticker, 'percentage');\n const bidVolume = this.safeString (ticker, 'bidVolume');\n const askVolume = this.safeString (ticker, 'askVolume');\n return this.safeTicker ({\n 'id': marketId,\n 'symbol': market['symbol'],\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'high': this.safeString (ticker, 'high'),\n 'low': this.safeString (ticker, 'low'),\n 'bid': this.safeString (ticker, 'bid'),\n 'bidVolume': bidVolume,\n 'ask': this.safeString (ticker, 'ask'),\n 'askVolume': askVolume,\n 'vwap': undefined,\n 'open': undefined,\n 'close': close,\n 'last': last,\n 'previousClose': this.safeString (ticker, 'previousClose'),\n 'change': this.safeString (ticker, 'change'),\n 'percentage': percentage,\n 'average': this.safeString (ticker, 'average'),\n 'baseVolume': this.safeString (ticker, 'baseVolume'),\n 'quoteVolume': this.safeString (ticker, 'quoteVolume'),\n 'markPrice': undefined,\n 'info': ticker,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": \"32164924331503616\",\n \"symbol\": \"LINK_USDT\",\n \"accountType\": \"SPOT\",\n \"orderId\": \"32164923987566592\",\n \"side\": \"SELL\",\n \"type\": \"MARKET\",\n \"matchRole\": \"TAKER\",\n \"createTime\": 1648635115525,\n \"price\": \"11\",\n \"quantity\": \"0.5\",\n \"amount\": \"5.5\",\n \"feeCurrency\": \"USDT\",\n \"feeAmount\": \"0.007975\",\n \"pageId\": \"32164924331503616\",\n \"clientOrderId\": \"myOwnId-321\"\n }",
"{\n aggregateTradeId: '2659115835',\n symbol: 'ETHINR',\n price: '292848',\n quantity: '0.147',\n firstTradeId: '7018766077',\n lastTradeId: '7018766081',\n tradeTime: '1765381971447',\n isBuyerMarketMaker: true\n }"
],
"line_end" => 944,
"line_start" => 887,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "info",
"value" => "trade"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "order",
"value" => "orderId"
},
%{
"comment" => nil,
"key" => "type",
"value" => "this.safeStringLower (trade, 'type')"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "takerOrMaker",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "price",
"value" => "priceString"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amountString"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "this.safeString (trade, 'cost')"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "this.safeDict (trade, 'fee')"
}
],
"name" => "parseTrade",
"signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade",
"source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // fetchMyTrades\n //\n // {\n // \"id\": \"32164924331503616\",\n // \"symbol\": \"LINK_USDT\",\n // \"accountType\": \"SPOT\",\n // \"orderId\": \"32164923987566592\",\n // \"side\": \"SELL\",\n // \"type\": \"MARKET\",\n // \"matchRole\": \"TAKER\",\n // \"createTime\": 1648635115525,\n // \"price\": \"11\",\n // \"quantity\": \"0.5\",\n // \"amount\": \"5.5\",\n // \"feeCurrency\": \"USDT\",\n // \"feeAmount\": \"0.007975\",\n // \"pageId\": \"32164924331503616\",\n // \"clientOrderId\": \"myOwnId-321\"\n // }\n // {\n // aggregateTradeId: '2659115835',\n // symbol: 'ETHINR',\n // price: '292848',\n // quantity: '0.147',\n // firstTradeId: '7018766077',\n // lastTradeId: '7018766081',\n // tradeTime: '1765381971447',\n // isBuyerMarketMaker: true\n // }\n //\n //\n const id = this.safeString2 (trade, 'id', 'aggregateTradeId');\n const orderId = this.safeString2 (trade, 'id', 'order');\n const timestamp = this.safeInteger2 (trade, 'timestamp', 'tradeTime');\n const marketId = this.safeString (trade, 'symbol');\n market = this.safeMarket (marketId, market, '_');\n const symbol = market['symbol'];\n const side = this.safeStringLower (trade, 'side');\n const priceString = this.safeString (trade, 'price');\n const amountString = this.safeString2 (trade, 'amount', 'quantity');\n return this.safeTrade ({\n 'id': id,\n 'info': trade,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': symbol,\n 'order': orderId,\n 'type': this.safeStringLower (trade, 'type'),\n 'side': side,\n 'takerOrMaker': undefined,\n 'price': priceString,\n 'amount': amountString,\n 'cost': this.safeString (trade, 'cost'),\n 'fee': this.safeDict (trade, 'fee'),\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1789,
"line_start" => 1778,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "maker",
"value" => "this.safeNumber2 (fee, 'makerFeeRate', 'makerFee')"
},
%{
"comment" => nil,
"key" => "taker",
"value" => "this.safeNumber2 (fee, 'takerFeeRate', 'takerFee')"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tierBased",
"value" => "undefined"
}
],
"name" => "parseTradingFee",
"signature" => "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
"source" => "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n const marketId = this.safeString (fee, 'symbol');\n const symbol = this.safeSymbol (marketId, market);\n return {\n 'info': fee,\n 'symbol': symbol,\n 'maker': this.safeNumber2 (fee, 'makerFeeRate', 'makerFee'),\n 'taker': this.safeNumber2 (fee, 'takerFeeRate', 'takerFee'),\n 'percentage': undefined,\n 'tierBased': undefined,\n };\n }"
}
],
path_prefix: "",
pro: false,
quote_json_numbers: nil,
rate_limits: %{
interval_ms: 50,
period: 1000,
requests: 20,
rolling_window_size: 60000
},
raw_endpoints: %{
private: [],
public: []
},
required_credentials: %{
api_key: true,
password: false,
secret: true,
uid: false
},
requires_eddsa: false,
response_error: %{
code_field: "code",
field: "code",
message_field: "msg",
success_values: [
"200000"
],
type: :success_code
},
signing: %{
api_key_header: "X-AUTH-APIKEY",
confidence: :medium,
pattern: :hmac_sha256_headers,
signature_encoding: :hex,
signature_header: "X-AUTH-SIGNATURE"
},
spec_format_version: 1,
status: %{
"eta" => nil,
"status" => "ok",
"updated" => nil,
"url" => nil
},
symbol_format: nil,
symbol_formats: nil,
symbol_patterns: %{},
timeframes: %{
"12h" => 720,
"15m" => 15,
"1d" => 1440,
"1h" => 60,
"1m" => 1,
"1w" => 10080,
"2h" => 120,
"30m" => 30,
"4h" => 480,
"5m" => 5
},
url_strategy: %{
detected_from: "api_structure",
note: "paths_already_versioned",
pattern: :version_in_path,
prefix: nil
},
urls: %{
api: "https://sapi.zebpay.com",
api_sections: %{
"spot" => "https://sapi.zebpay.com",
"swap" => "https://futuresbe.zebpay.com"
},
doc: "https://github.com/zebpay/zebpay-api-references",
other: nil,
sandbox: %{
"spot" => "https://www.zebstage.com",
"swap" => "https://dev-futuresbe.zebstage.com"
},
www: "https://www.zebpay.com"
},
version: "v1",
ws: nil
}