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 alp.exs
Raw

priv/specs/extracted/alp.exs

# Alp Exchange Specification
#
# Auto-generated by: mix ccxt.extract alp
# CCXT version: 4.5.42
# Spec format version: 2
#
# 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: [
"US"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"CBC" => "Cashbery",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 18,
"coveragePercent" => 100,
"enabledMethods" => 20,
"excluded" => [
%{
"method" => "editOrder",
"reason" => "emulated (returns cached data, no HTTP call)"
}
],
"excludedMethods" => 1,
"extractableMethods" => 19,
"failures" => [
%{
"error" => "alp only limits orders are supported",
"method" => "createMarketOrder"
}
]
},
endpoints: [
%{
api_section: "private",
auth: true,
cost: 50,
expects: :single,
market_type: :spot,
method: :post,
name: :cancel_order,
param_mappings: %{
"id" => "order"
},
params: [
:id,
:symbol
],
path: "/order-cancel/",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 50,
expects: :single,
market_type: :spot,
method: :post,
name: :create_limit_order,
param_mappings: %{
"side" => "type",
"symbol" => "pair"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/order/",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 50,
expects: :single,
market_type: :spot,
method: :post,
name: :create_order,
param_mappings: %{
"side" => "type",
"symbol" => "pair"
},
params: [
:symbol,
:type,
:side,
:amount,
:price
],
path: "/order/",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 50,
expects: :single,
market_type: :spot,
method: :get,
name: :fetch_balance,
param_mappings: %{},
params: [],
path: "/wallets/",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 50,
default_params: %{
"status" => "3"
},
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_closed_orders,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/orders/own/",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 50,
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_deposits,
param_mappings: %{},
params: [
:code,
:since,
:limit
],
path: "/deposits/",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
expects: :single,
market_type: :spot,
method: :get,
name: :fetch_l2_order_book,
param_mappings: %{
"symbol" => "pair_name"
},
params: [
:symbol,
:limit
],
path: "/orderbook/{pair_name}",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/pairs/",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 50,
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_my_trades,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/exchanges/own/",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"type" => "60"
},
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_ohlcv,
param_mappings: %{
"symbol" => "pair",
"timeframe" => "type"
},
params: [
:symbol,
:timeframe,
:since,
:limit
],
path: "/charts/{pair}/{type}/chart/",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 50,
default_params: %{
"status" => "1"
},
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_open_orders,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/orders/own/",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 50,
expects: :single,
market_type: :spot,
method: :get,
name: :fetch_order,
param_mappings: %{},
params: [
:id,
:symbol
],
path: "/order/{id}/",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
expects: :single,
market_type: :spot,
method: :get,
name: :fetch_order_book,
param_mappings: %{
"symbol" => "pair_name"
},
params: [
:symbol,
:limit
],
path: "/orderbook/{pair_name}",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 50,
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_orders,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/orders/own/",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
expects: :single,
market_type: :spot,
method: :get,
name: :fetch_ticker,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol
],
path: "/ticker/",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_tickers,
param_mappings: %{},
params: [
:symbols
],
path: "/ticker/",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_trades,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/exchanges/",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 50,
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_withdrawals,
param_mappings: %{
"code" => "currency_id"
},
params: [
:code,
:since,
:limit
],
path: "/withdraws/",
source: :intercepted
}
],
error_code_details: %{
"Out of balance" => %{
description: "{\"date\":1570599531.4814300537,\"error\":\"Out of balance -9.99243661 BTC\"}",
type: :insufficient_balance
}
},
error_codes: %{
"Out of balance" => :insufficient_balance
},
exceptions: %{
broad: %{
"Out of balance" => :insufficient_funds
}
},
exchange_options: %{
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"networksById" => %{}
},
extended_metadata: %{
fees_url: "https://alp.com/fees/",
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://github.com/user-attachments/assets/dce49f3a-61e5-4ba0-a2fe-41d192fd0e5d",
referral_url: "https://alp.com/?r=123788"
},
extracted_metadata: %{
ccxt_version: "4.5.42"
},
features: %{
future: %{},
spot: %{
create_order: %{
hedged: false,
iceberg: false,
leverage: false,
margin_mode: false,
market_buy_by_cost: false,
market_buy_requires_price: false,
self_trade_prevention: false,
stop_loss_price: false,
take_profit_price: false,
time_in_force: %{
fok: false,
gtd: false,
ioc: false,
po: false
},
trailing: false,
trigger_direction: false,
trigger_price: false
},
fetch_closed_orders: %{
limit: 2000,
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
fetch_my_trades: %{
limit: 100,
margin_mode: false,
symbol_required: false
},
fetch_ohlcv: %{
limit: 720
},
fetch_open_orders: %{
limit: 2000,
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
fetch_order: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
fetch_orders: %{
limit: 2000,
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
sandbox: false
},
swap: %{}
},
fees: %{
trading: %{
maker: 0.002,
taker: 0.002
}
},
forward_aliases: nil,
handle_content_type_application_zip: nil,
handle_errors_source: "handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if (response === undefined) {\n return undefined; // fallback to default error handler\n }\n //\n // {\"date\":1570599531.4814300537,\"error\":\"Out of balance -9.99243661 BTC\"}\n //\n const error = this.safeString(response, 'error');\n if (error !== undefined) {\n const feedback = this.id + ' ' + body;\n this.throwExactlyMatchedException(this.exceptions['exact'], error, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], error, feedback);\n throw new errors.ExchangeError(feedback); // unknown error\n }\n return undefined;\n }",
has: %{
add_margin: false,
borrow_cross_margin: false,
borrow_isolated_margin: false,
borrow_margin: false,
c_o_r_s: false,
cancel_all_orders: false,
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: false,
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_a_d_l_rank: 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: true,
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: false,
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: true,
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: false,
fetch_leverage_tiers: false,
fetch_leverages: false,
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: false,
fetch_order_with_client_order_id: false,
fetch_order_ws: false,
fetch_orders: true,
fetch_orders_by_status: false,
fetch_orders_ws: false,
fetch_position: false,
fetch_position_a_d_l_rank: false,
fetch_position_history: false,
fetch_position_mode: false,
fetch_position_ws: false,
fetch_positions: false,
fetch_positions_a_d_l_rank: false,
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: false,
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: true,
fetch_withdrawals_ws: false,
future: false,
margin: false,
option: false,
private_api: true,
public_api: true,
reduce_margin: false,
repay_cross_margin: false,
repay_isolated_margin: false,
repay_margin: false,
sandbox: false,
set_leverage: false,
set_margin: false,
set_margin_mode: false,
set_position_mode: false,
sign_in: false,
spot: true,
swap: false,
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: "alp",
markets: nil,
name: "Alp",
ohlcv_timestamp_resolution: :seconds,
options: %{},
order_mappings: nil,
param_mappings: %{
"code" => "currency_id",
"id" => "order",
"side" => "type",
"symbol" => "pair",
"timeframe" => "type"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [],
"line_end" => 772,
"line_start" => 760,
"mappings" => [],
"name" => "parseBalance",
"signature" => "parseBalance (response): Balances",
"source" => "parseBalance (response): Balances {\n const result: Dict = { 'info': response };\n for (let i = 0; i < response.length; i++) {\n const balance = response[i];\n const currencyId = this.safeString (balance, 'currency');\n const code = this.safeCurrencyCode (currencyId);\n const account = this.account ();\n account['used'] = this.safeString (balance, 'reserve');\n account['total'] = this.safeString (balance, 'balance');\n result[code] = account;\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 503,
"line_start" => 494,
"mappings" => [],
"name" => "parseBidsAsks",
"signature" => "parseBidsAsks (bidasks, priceKey: IndexType = 0, amountKey: IndexType = 1, countOrIdKey: IndexType = 2)",
"source" => "parseBidsAsks (bidasks, priceKey: IndexType = 0, amountKey: IndexType = 1, countOrIdKey: IndexType = 2) {\n const result = [];\n for (let i = 0; i < bidasks.length; i++) {\n const bidask = bidasks[i];\n if (bidask) {\n result.push (this.parseBidAsk (bidask, priceKey, amountKey));\n }\n }\n return result;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 362,
"line_start" => 304,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "base + '/' + quote"
},
%{
"comment" => nil,
"key" => "base",
"value" => "base"
},
%{
"comment" => nil,
"key" => "quote",
"value" => "quote"
},
%{
"comment" => nil,
"key" => "settle",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "baseId",
"value" => "baseId"
},
%{
"comment" => nil,
"key" => "quoteId",
"value" => "quoteId"
},
%{
"comment" => nil,
"key" => "settleId",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "'spot'"
},
%{
"comment" => nil,
"key" => "spot",
"value" => "true"
},
%{
"comment" => nil,
"key" => "margin",
"value" => "false"
},
%{
"comment" => nil,
"key" => "swap",
"value" => "false"
},
%{
"comment" => nil,
"key" => "future",
"value" => "false"
},
%{
"comment" => nil,
"key" => "option",
"value" => "false"
},
%{
"comment" => nil,
"key" => "active",
"value" => "true"
},
%{
"comment" => nil,
"key" => "contract",
"value" => "false"
},
%{
"comment" => nil,
"key" => "linear",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "inverse",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "contractSize",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "expiry",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "expiryDatetime",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "strike",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "optionType",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "precision",
"value" => "{\n 'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'amount_precision'))),\n 'price': this.parseNumber (this.parsePrecision ((pricePrecision))),\n }"
},
%{
"comment" => nil,
"key" => "limits",
"value" => "{\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.parseNumber (amountLimit),\n 'max': this.safeNumber (market, 'maximum_order_size'),\n },\n 'price': {\n 'min': this.parseNumber (priceLimit),\n 'max': undefined,\n },\n 'cost': {\n 'min': this.parseNumber (Precise.stringMul (priceLimit, amountLimit)),\n 'max': undefined,\n },\n }"
},
%{
"comment" => nil,
"key" => "created",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "market"
},
%{
"comment" => nil,
"key" => "leverage",
"value" => "{\n 'min': undefined,\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "{\n 'min': this.parseNumber (amountLimit),\n 'max': this.safeNumber (market, 'maximum_order_size'),\n }"
},
%{
"comment" => nil,
"key" => "price",
"value" => "{\n 'min': this.parseNumber (priceLimit),\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "{\n 'min': this.parseNumber (Precise.stringMul (priceLimit, amountLimit)),\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "min",
"value" => "this.parseNumber (priceLimit)"
},
%{
"comment" => nil,
"key" => "max",
"value" => "undefined"
}
],
"name" => "parseMarket",
"signature" => "parseMarket (market: Dict): Market",
"source" => "parseMarket (market: Dict): Market {\n const id = this.safeString (market, 'name');\n const baseId = this.safeString (market, 'currency1');\n const quoteId = this.safeString (market, 'currency2');\n const base = this.safeCurrencyCode (baseId);\n const quote = this.safeCurrencyCode (quoteId);\n const pricePrecision = this.safeString (market, 'price_precision');\n const priceLimit = this.parsePrecision (pricePrecision);\n const amountLimit = this.safeString (market, 'minimum_order_size');\n return {\n 'id': id,\n 'symbol': base + '/' + quote,\n 'base': base,\n 'quote': quote,\n 'settle': undefined,\n 'baseId': baseId,\n 'quoteId': quoteId,\n 'settleId': undefined,\n 'type': 'spot',\n 'spot': true,\n 'margin': false,\n 'swap': false,\n 'future': false,\n 'option': false,\n 'active': true,\n 'contract': false,\n 'linear': undefined,\n 'inverse': undefined,\n 'contractSize': undefined,\n 'expiry': undefined,\n 'expiryDatetime': undefined,\n 'strike': undefined,\n 'optionType': undefined,\n 'precision': {\n 'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'amount_precision'))),\n 'price': this.parseNumber (this.parsePrecision ((pricePrecision))),\n },\n 'limits': {\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.parseNumber (amountLimit),\n 'max': this.safeNumber (market, 'maximum_order_size'),\n },\n 'price': {\n 'min': this.parseNumber (priceLimit),\n 'max': undefined,\n },\n 'cost': {\n 'min': this.parseNumber (Precise.stringMul (priceLimit, amountLimit)),\n 'max': undefined,\n },\n },\n 'created': undefined,\n 'info': market,\n };\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"time\":1591296000,\n \"open\":0.024746,\n \"close\":0.024728,\n \"low\":0.024728,\n \"high\":0.024753,\n \"volume\":16.624\n }"
],
"line_end" => 722,
"line_start" => 703,
"mappings" => [],
"name" => "parseOHLCV",
"signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
"source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // {\n // \"time\":1591296000,\n // \"open\":0.024746,\n // \"close\":0.024728,\n // \"low\":0.024728,\n // \"high\":0.024753,\n // \"volume\":16.624\n // }\n //\n return [\n this.safeTimestamp (ohlcv, 'time'),\n this.safeNumber (ohlcv, 'open'),\n this.safeNumber (ohlcv, 'high'),\n this.safeNumber (ohlcv, 'low'),\n this.safeNumber (ohlcv, 'close'),\n this.safeNumber (ohlcv, 'volume'),\n ];\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": \"923763073\",\n \"date\": \"1635451090368\",\n \"type\": \"sell\",\n \"pair\": \"XRP_USDT\",\n \"price\": \"1.00000000\",\n \"amount\": \"0.00000000\",\n \"status\": \"3\",\n \"amount_filled\": \"10.00000000\",\n \"amount_original\": \"10.0\"\n \"trades\": [],\n }",
"{\n \"success\": true,\n \"date\": \"1635451754.497541\",\n \"type\": \"sell\",\n \"oid\": \"923776755\",\n \"price\": \"1.0\",\n \"amount\": \"10.0\",\n \"amount_filled\": \"0.0\",\n \"amount_original\": \"10.0\",\n \"trades\": []\n }"
],
"line_end" => 867,
"line_start" => 797,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "clientOrderId",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "type",
"value" => "'limit'"
},
%{
"comment" => nil,
"key" => "timeInForce",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "postOnly",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "triggerPrice",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "filled",
"value" => "filled"
},
%{
"comment" => nil,
"key" => "remaining",
"value" => "remaining"
},
%{
"comment" => nil,
"key" => "trades",
"value" => "trades"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "order"
},
%{
"comment" => nil,
"key" => "lastTradeTimestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
}
],
"name" => "parseOrder",
"signature" => "parseOrder (order: Dict, market: Market = undefined): Order",
"source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // fetchClosedOrders / fetchOrder\n // {\n // \"id\": \"923763073\",\n // \"date\": \"1635451090368\",\n // \"type\": \"sell\",\n // \"pair\": \"XRP_USDT\",\n // \"price\": \"1.00000000\",\n // \"amount\": \"0.00000000\",\n // \"status\": \"3\",\n // \"amount_filled\": \"10.00000000\",\n // \"amount_original\": \"10.0\"\n // \"trades\": [],\n // }\n //\n // createOrder\n // {\n // \"success\": true,\n // \"date\": \"1635451754.497541\",\n // \"type\": \"sell\",\n // \"oid\": \"923776755\",\n // \"price\": \"1.0\",\n // \"amount\": \"10.0\",\n // \"amount_filled\": \"0.0\",\n // \"amount_original\": \"10.0\",\n // \"trades\": []\n // }\n //\n const marketId = this.safeString (order, 'pair');\n market = this.safeMarket (marketId, market, '_');\n const symbol = market['symbol'];\n const success = this.safeBool (order, 'success', false);\n let timestamp = undefined;\n if (success) {\n timestamp = this.safeTimestamp (order, 'date');\n } else {\n timestamp = this.safeInteger (order, 'date');\n }\n const price = this.safeString (order, 'price');\n const remaining = this.safeString (order, 'amount');\n const filled = this.safeString (order, 'amount_filled');\n const amount = this.safeString (order, 'amount_original');\n const status = this.parseOrderStatus (this.safeString (order, 'status'));\n const id = this.safeStringN (order, [ 'oid', 'id', 'order' ]);\n const trades = this.safeValue (order, 'trades');\n const side = this.safeString2 (order, 'my_side', 'type');\n return this.safeOrder ({\n 'id': id,\n 'clientOrderId': undefined,\n 'datetime': this.iso8601 (timestamp),\n 'timestamp': timestamp,\n 'status': status,\n 'symbol': symbol,\n 'type': 'limit',\n 'timeInForce': undefined,\n 'postOnly': undefined,\n 'side': side,\n 'price': price,\n 'triggerPrice': undefined,\n 'cost': undefined,\n 'amount': amount,\n 'filled': filled,\n 'remaining': remaining,\n 'trades': trades,\n 'fee': undefined,\n 'info': order,\n 'lastTradeTimestamp': undefined,\n 'average': undefined,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 795,
"line_start" => 788,
"mappings" => [],
"name" => "parseOrderStatus",
"signature" => "parseOrderStatus (status: Str)",
"source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n '1': 'open',\n '2': 'canceled',\n '3': 'closed',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"timestamp\": \"1674658.445272\",\n \"pair\": \"BTC_USDT\",\n \"last\": \"22476.85\",\n \"diff\": \"458.96\",\n \"vol\": \"6660.847784\",\n \"high\": \"23106.08\",\n \"low\": \"22348.29\",\n \"buy\": \"22508.46\",\n \"sell\": \"22521.11\"\n }"
],
"line_end" => 468,
"line_start" => 427,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "ticker"
},
%{
"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, 'buy')"
},
%{
"comment" => nil,
"key" => "bidVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "ask",
"value" => "this.safeString (ticker, 'sell')"
},
%{
"comment" => nil,
"key" => "askVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "vwap",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "open",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "close",
"value" => "last"
},
%{
"comment" => nil,
"key" => "last",
"value" => "last"
},
%{
"comment" => nil,
"key" => "previousClose",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "change",
"value" => "this.safeString (ticker, 'diff')"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "baseVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "quoteVolume",
"value" => "this.safeString (ticker, 'vol')"
}
],
"name" => "parseTicker",
"signature" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
"source" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n //\n // {\n // \"timestamp\": \"1674658.445272\",\n // \"pair\": \"BTC_USDT\",\n // \"last\": \"22476.85\",\n // \"diff\": \"458.96\",\n // \"vol\": \"6660.847784\",\n // \"high\": \"23106.08\",\n // \"low\": \"22348.29\",\n // \"buy\": \"22508.46\",\n // \"sell\": \"22521.11\"\n // }\n //\n const timestampStr = this.safeString (ticker, 'timestamp');\n const timestamp = parseInt (Precise.stringMul (timestampStr, '1000000'));\n const marketId = this.safeString (ticker, 'pair');\n market = this.safeMarket (marketId, market, '_');\n const last = this.safeString (ticker, 'last');\n return this.safeTicker ({\n 'info': ticker,\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, 'buy'),\n 'bidVolume': undefined,\n 'ask': this.safeString (ticker, 'sell'),\n 'askVolume': undefined,\n 'vwap': undefined,\n 'open': undefined,\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': this.safeString (ticker, 'diff'),\n 'percentage': undefined,\n 'average': undefined,\n 'baseVolume': undefined,\n 'quoteVolume': this.safeString (ticker, 'vol'),\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": \"202203440\",\n \"timestamp\": \"1637856276.264215\",\n \"pair\": \"AAVE_USDT\",\n \"price\": \"320.79900000\",\n \"amount\": \"0.05000000\",\n \"type\": \"buy\"\n }",
"{\n \"id\": \"202203440\",\n \"timestamp\": \"1637856276.264215\",\n \"pair\": \"AAVE_USDT\",\n \"price\": \"320.79900000\",\n \"amount\": \"0.05000000\",\n \"type\": \"buy\",\n \"my_side\": \"buy\"\n }"
],
"line_end" => 553,
"line_start" => 505,
"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" => "market['symbol']"
},
%{
"comment" => nil,
"key" => "order",
"value" => "id"
},
%{
"comment" => nil,
"key" => "type",
"value" => "'limit'"
},
%{
"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" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
}
],
"name" => "parseTrade",
"signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade",
"source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // fetchTrades (public)\n //\n // {\n // \"id\": \"202203440\",\n // \"timestamp\": \"1637856276.264215\",\n // \"pair\": \"AAVE_USDT\",\n // \"price\": \"320.79900000\",\n // \"amount\": \"0.05000000\",\n // \"type\": \"buy\"\n // }\n //\n // fetchMyTrades (private)\n //\n // {\n // \"id\": \"202203440\",\n // \"timestamp\": \"1637856276.264215\",\n // \"pair\": \"AAVE_USDT\",\n // \"price\": \"320.79900000\",\n // \"amount\": \"0.05000000\",\n // \"type\": \"buy\",\n // \"my_side\": \"buy\"\n // }\n //\n const marketId = this.safeString (trade, 'pair');\n market = this.safeMarket (marketId, market, '_');\n const timestampRaw = this.safeString (trade, 'timestamp');\n const timestamp = this.parseToInt (Precise.stringMul (timestampRaw, '1000000'));\n const priceString = this.safeString (trade, 'price');\n const amountString = this.safeString (trade, 'amount');\n const id = this.safeString (trade, 'id');\n const side = this.safeString2 (trade, 'my_side', 'type');\n return this.safeTrade ({\n 'id': id,\n 'info': trade,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': market['symbol'],\n 'order': id,\n 'type': 'limit',\n 'side': side,\n 'takerOrMaker': undefined,\n 'price': priceString,\n 'amount': amountString,\n 'cost': undefined,\n 'fee': undefined,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"timestamp\": 1485363039.18359,\n \"id\": 317,\n \"currency\": \"BTC\",\n \"amount\": 530.00000000\n }",
"{\n \"id\": 403,\n \"timestamp\": 1485363466.868539,\n \"currency\": \"BTC\",\n \"amount\": 0.53000000,\n \"status\": 20\n }"
],
"line_end" => 690,
"line_start" => 646,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (transaction, 'id')"
},
%{
"comment" => nil,
"key" => "info",
"value" => "transaction"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "network",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "address",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "addressTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "addressFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "this.safeCurrencyCode (currencyId, currency)"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.safeNumber (transaction, 'amount')"
},
%{
"comment" => nil,
"key" => "txid",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "this.parseTransactionStatus (statusId)"
},
%{
"comment" => nil,
"key" => "comment",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "internal",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "updated",
"value" => "undefined"
}
],
"name" => "parseTransaction",
"signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
"source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // deposit\n // {\n // \"timestamp\": 1485363039.18359,\n // \"id\": 317,\n // \"currency\": \"BTC\",\n // \"amount\": 530.00000000\n // }\n //\n // withdrawal\n // {\n // \"id\": 403,\n // \"timestamp\": 1485363466.868539,\n // \"currency\": \"BTC\",\n // \"amount\": 0.53000000,\n // \"status\": 20\n // }\n //\n const timestamp = this.safeTimestamp (transaction, 'timestamp');\n const currencyId = this.safeString (transaction, 'currency');\n const statusId = this.safeString (transaction, 'status');\n return {\n 'id': this.safeString (transaction, 'id'),\n 'info': transaction,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'network': undefined,\n 'address': undefined,\n 'addressTo': undefined,\n 'addressFrom': undefined,\n 'tag': undefined,\n 'tagTo': undefined,\n 'tagFrom': undefined,\n 'currency': this.safeCurrencyCode (currencyId, currency),\n 'amount': this.safeNumber (transaction, 'amount'),\n 'txid': undefined,\n 'type': undefined,\n 'status': this.parseTransactionStatus (statusId),\n 'comment': undefined,\n 'internal': undefined,\n 'fee': undefined,\n 'updated': undefined,\n };\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 701,
"line_start" => 692,
"mappings" => [],
"name" => "parseTransactionStatus",
"signature" => "parseTransactionStatus (status: Str)",
"source" => "parseTransactionStatus (status: Str) {\n const statuses: Dict = {\n '10': 'pending', // New\n '20': 'pending', // Verified, waiting for approving\n '30': 'ok', // Approved by moderator\n '40': 'failed', // Refused by moderator. See your email for more details\n '50': 'canceled', // Cancelled by user\n };\n return this.safeString (statuses, status, status);\n }"
}
],
path_prefix: "",
pro: false,
quote_json_numbers: nil,
rate_limits: %{
interval_ms: 10,
period: 1000,
requests: 100,
rolling_window_size: 60000
},
raw_endpoints: %{
private: [
%{
auth: false,
cost: 50,
method: :get,
path: "/deposits/"
},
%{
auth: false,
cost: 50,
method: :get,
path: "/exchanges/own/"
},
%{
auth: false,
cost: 50,
method: :get,
path: "/order/{id}/"
},
%{
auth: false,
cost: 50,
method: :get,
path: "/orders/own/"
},
%{
auth: false,
cost: 50,
method: :get,
path: "/wallets/"
},
%{
auth: false,
cost: 50,
method: :get,
path: "/withdraws/"
},
%{
auth: false,
cost: 50,
method: :post,
path: "/order-cancel/"
},
%{
auth: false,
cost: 50,
method: :post,
path: "/order/"
}
],
public: [
%{
auth: false,
cost: 1,
method: :get,
path: "/charts/{pair}/{type}/chart/"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/currencies/"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/exchanges/"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/orderbook/{pair_name}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/pairs/"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/ticker/"
}
]
},
required_credentials: %{
api_key: true,
password: false,
secret: true,
uid: false
},
requires_eddsa: false,
response_error: nil,
signing: %{
api_key_header: "X-KEY",
confidence: :medium,
nonce_header: "X-NONCE",
pattern: :hmac_sha256_headers,
signature_header: "X-SIGN"
},
spec_format_version: 2,
status: %{
"eta" => nil,
"status" => "ok",
"updated" => nil,
"url" => nil
},
symbol_format: nil,
symbol_formats: nil,
symbol_patterns: %{},
timeframes: %{
"15m" => "15",
"1d" => "D",
"1h" => "60",
"30m" => "30",
"4h" => "240",
"5m" => "5"
},
url_strategy: %{
detected_from: "fallback",
pattern: :no_prefix,
prefix: nil
},
urls: %{
api: "https://alp.com/api",
api_sections: %{
"rest" => "https://alp.com/api"
},
doc: "https://alpcomdev.github.io/alp-api-docs/",
other: nil,
sandbox: nil,
www: "https://alp.com"
},
version: "v1",
ws: nil
}