# Coinbase Advanced Exchange Specification # # Auto-generated by: mix ccxt.extract coinbase # 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: :pro, comment: nil, countries: [ "US" ], currencies: %{}, currency_aliases: %{ "BCHSV" => "BSV", "CGLD" => "CELO", "XBT" => "BTC" }, dex: false, enable_rate_limit: true, endpoint_extraction_stats: %{ "capturedMethods" => 49, "coveragePercent" => 100, "enabledMethods" => 52, "excluded" => [ %{ "method" => "fetchDepositAddress", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchTradingFee", "reason" => "emulated (returns cached data, no HTTP call)" } ], "excludedMethods" => 2, "extractableMethods" => 50, "failures" => [ %{ "error" => "coinbase prepareAccountRequest() method requires an account_id (or accountId) parameter", "method" => "fetchDepositAddresses" } ] }, endpoints: [ %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "order_ids" => [ "test-order-id" ] }, market_type: :spot, method: :post, name: :cancel_order, param_mappings: %{}, params: [ :id, :symbol ], path: "/brokerage/orders/batch_cancel", response_transformer: {:extract_path, ["results"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "order_ids" => [ "test-order-id" ] }, market_type: :spot, method: :post, name: :cancel_orders, param_mappings: %{}, params: [ :ids, :symbol ], path: "/brokerage/orders/batch_cancel", response_transformer: {:extract_path, ["results"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :post, name: :create_convert_trade, param_mappings: %{ "fromCode" => "from_account", "id" => "trade_id", "toCode" => "to_account" }, params: [ :id, :fromCode, :toCode, :amount ], path: "/brokerage/convert/trade/{trade_id}", response_transformer: {:extract_path, ["trade"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "limit" => 250 }, market_type: :spot, method: :get, name: :create_deposit_address, param_mappings: %{}, params: [ :code ], path: "/brokerage/accounts", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "client_order_id" => "ccxt-4fb9e694-e37d-4a2f-9c1e-5f8c5f689856", "order_configuration" => %{ "limit_limit_gtc" => %{ "base_size" => "0.001", "limit_price" => "50000", "post_only" => false } }, "side" => "BUY" }, market_type: :spot, method: :post, name: :create_limit_buy_order, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :amount, :price ], path: "/brokerage/orders", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "client_order_id" => "ccxt-ed55c998-d125-4235-a389-ebca347ddd26", "order_configuration" => %{ "limit_limit_gtc" => %{ "base_size" => "0.001", "limit_price" => "50000", "post_only" => false } } }, market_type: :spot, method: :post, name: :create_limit_order, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :side, :amount, :price ], path: "/brokerage/orders", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "client_order_id" => "ccxt-d74b15c6-2dd2-45b8-9e83-da723c92aa04", "order_configuration" => %{ "limit_limit_gtc" => %{ "base_size" => "0.001", "limit_price" => "50000", "post_only" => false } }, "side" => "SELL" }, market_type: :spot, method: :post, name: :create_limit_sell_order, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :amount, :price ], path: "/brokerage/orders", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "client_order_id" => "ccxt-d210d1f3-f77d-408c-84d0-e1b81bf16c24", "order_configuration" => %{ "market_market_ioc" => %{ "quote_size" => "0.001" } }, "side" => "BUY" }, market_type: :spot, method: :post, name: :create_market_buy_order, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :amount ], path: "/brokerage/orders", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "client_order_id" => "ccxt-3b1fee48-7f7c-4882-936b-7fb10c3cfb6e", "order_configuration" => %{ "market_market_ioc" => %{ "quote_size" => "100" } }, "side" => "BUY" }, market_type: :spot, method: :post, name: :create_market_buy_order_with_cost, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :cost ], path: "/brokerage/orders", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "client_order_id" => "ccxt-3abd9499-e7d1-4d0a-95e7-99d1d6786b19", "order_configuration" => %{ "market_market_ioc" => %{ "quote_size" => "0.001" } } }, market_type: :spot, method: :post, name: :create_market_order, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :side, :amount, :price ], path: "/brokerage/orders", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "client_order_id" => "ccxt-f5ec8985-6333-4f89-90c3-f9b05a0e6497", "order_configuration" => %{ "market_market_ioc" => %{ "base_size" => "0.001" } }, "side" => "SELL" }, market_type: :spot, method: :post, name: :create_market_sell_order, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :amount ], path: "/brokerage/orders", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "client_order_id" => "ccxt-3b163e45-31a8-4c03-b279-951ab297d78a", "order_configuration" => %{ "limit_limit_gtc" => %{ "base_size" => "0.001", "limit_price" => "50000", "post_only" => false } } }, market_type: :spot, method: :post, name: :create_order, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/brokerage/orders", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "client_order_id" => "ccxt-e16cf805-d380-464f-83d7-7175666c260f", "order_configuration" => %{ "limit_limit_gtc" => %{ "base_size" => "0.001", "limit_price" => "50000", "post_only" => true } } }, market_type: :spot, method: :post, name: :create_post_only_order, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/brokerage/orders", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "client_order_id" => "ccxt-0ca7d297-478e-44ec-b827-30540fc549e2", "order_configuration" => %{ "stop_limit_stop_limit_gtc" => %{ "base_size" => "0.001", "limit_price" => "50000", "stop_direction" => "STOP_DIRECTION_STOP_DOWN", "stop_price" => "48000" } }, "triggerDirection" => "below" }, market_type: :swap, method: :post, name: :create_stop_limit_order, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :side, :amount, :price, :triggerPrice ], path: "/brokerage/orders", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "client_order_id" => "ccxt-26ba9d81-000b-424f-96fa-99a164bb0e96", "order_configuration" => %{ "stop_limit_stop_limit_gtc" => %{ "base_size" => "0.001", "limit_price" => "50000", "stop_direction" => "STOP_DIRECTION_STOP_DOWN", "stop_price" => "48000" } }, "triggerDirection" => "below" }, market_type: :swap, method: :post, name: :create_stop_order, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :type, :side, :amount, :price, :triggerPrice ], path: "/brokerage/orders", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :post, name: :edit_order, param_mappings: %{ "amount" => "size", "id" => "order_id" }, params: [ :id, :symbol, :type, :side, :amount, :price ], path: "/brokerage/orders/edit", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "limit" => 250 }, market_type: :spot, method: :get, name: :fetch_accounts, param_mappings: %{}, params: [], path: "/brokerage/accounts", source: :intercepted }, %{ api_section: "v2/private", auth: true, cost: 10.6, default_params: %{ "limit" => 250 }, market_type: :spot, method: :get, name: :fetch_balance, param_mappings: %{}, params: [], path: "/accounts", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 3, default_params: %{ "product_ids" => [ "BTCUSDT" ] }, market_type: :spot, method: :get, name: :fetch_bids_asks, param_mappings: %{}, params: [ :symbols ], path: "/brokerage/best_bid_ask", response_transformer: {:extract_path, ["pricebooks"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "limit" => 100, "order_status" => "CANCELLED" }, market_type: :spot, method: :get, name: :fetch_canceled_orders, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :since, :limit ], path: "/brokerage/orders/historical/batch", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "limit" => 100, "order_status" => "FILLED" }, market_type: :spot, method: :get, name: :fetch_closed_orders, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :since, :limit ], path: "/brokerage/orders/historical/batch", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :post, name: :fetch_convert_quote, param_mappings: %{ "fromCode" => "from_account", "toCode" => "to_account" }, params: [ :fromCode, :toCode, :amount ], path: "/brokerage/convert/quote", response_transformer: {:extract_path, ["trade"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "to_account" => "USDT" }, market_type: :spot, method: :get, name: :fetch_convert_trade, param_mappings: %{ "code" => "from_account", "id" => "trade_id" }, params: [ :id, :code ], path: "/brokerage/convert/trade/{trade_id}", response_transformer: {:extract_path, ["trade"]}, source: :intercepted }, %{ api_section: "v2/public", auth: false, cost: 10.6, market_type: :spot, method: :get, name: :fetch_currencies, param_mappings: %{}, params: [], path: "/currencies", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "limit" => 250 }, market_type: :spot, method: :get, name: :fetch_deposit, param_mappings: %{}, params: [], path: "/brokerage/accounts", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "limit" => 250 }, market_type: :spot, method: :get, name: :fetch_deposit_addresses_by_network, param_mappings: %{}, params: [ :code ], path: "/brokerage/accounts", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_deposit_method_id, param_mappings: %{ "arg0" => "payment_method_id" }, params: [], path: "/brokerage/payment_methods/{payment_method_id}", response_transformer: {:extract_path, ["payment_method"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_deposit_method_ids, param_mappings: %{}, params: [], path: "/brokerage/payment_methods", response_transformer: {:extract_path, ["payment_methods"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "limit" => 250 }, market_type: :spot, method: :get, name: :fetch_deposits, param_mappings: %{}, params: [ :code, :since, :limit ], path: "/brokerage/accounts", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "limit" => 250 }, market_type: :spot, method: :get, name: :fetch_deposits_withdrawals, param_mappings: %{}, params: [ :code, :since, :limit ], path: "/brokerage/accounts", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "limit" => 250 }, market_type: :spot, method: :get, name: :fetch_ledger, param_mappings: %{}, params: [ :code, :since, :limit ], path: "/brokerage/accounts", response_transformer: {:extract_path, ["pagination", "next_starting_after"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 3, market_type: :spot, method: :get, name: :fetch_markets, param_mappings: %{}, params: [], path: "/brokerage/market/products", source: :intercepted }, %{ api_section: "v2/private", auth: true, cost: 10.6, default_params: %{ "account_id" => "test-account-id" }, market_type: :spot, method: :get, name: :fetch_my_buys, param_mappings: %{}, params: [], path: "/accounts/{account_id}/buys", source: :intercepted }, %{ api_section: "v2/private", auth: true, cost: 10.6, default_params: %{ "account_id" => "test-account-id" }, market_type: :spot, method: :get, name: :fetch_my_sells, param_mappings: %{}, params: [], path: "/accounts/{account_id}/sells", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_my_trades, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :since, :limit ], path: "/brokerage/orders/historical/fills", source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 3, default_params: %{ "end" => "", "granularity" => "ONE_HOUR" }, market_type: :spot, method: :get, name: :fetch_ohlcv, param_mappings: %{ "since" => "start", "symbol" => "product_id", "timeframe" => "granularity" }, params: [ :symbol, :timeframe, :since, :limit ], path: "/brokerage/market/products/{product_id}/candles", response_transformer: {:extract_path, ["candles"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "limit" => 100, "order_status" => "OPEN" }, market_type: :spot, method: :get, name: :fetch_open_orders, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :since, :limit ], path: "/brokerage/orders/historical/batch", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_order, param_mappings: %{ "id" => "order_id" }, params: [ :id, :symbol ], path: "/brokerage/orders/historical/{order_id}", response_transformer: {:extract_path_unwrap, ["order"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 3, market_type: :spot, method: :get, name: :fetch_order_book, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :limit ], path: "/brokerage/market/product_book", response_transformer: {:extract_path_unwrap, ["pricebook"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "limit" => 100 }, market_type: :spot, method: :get, name: :fetch_orders, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol, :since, :limit ], path: "/brokerage/orders/historical/batch", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "portfolio_uuid" => "test-portfolio-id" }, market_type: :swap, method: :get, name: :fetch_position, param_mappings: %{}, params: [ :symbol ], path: "/brokerage/intx/positions/{portfolio_uuid}/{symbol}", response_transformer: {:extract_path_unwrap, ["position"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "portfolio_uuid" => "test-portfolio-id" }, market_type: :swap, method: :get, name: :fetch_positions, param_mappings: %{}, params: [ :symbols ], path: "/brokerage/intx/positions/{portfolio_uuid}", response_transformer: {:extract_path, ["positions"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 3, default_params: %{ "limit" => 1 }, market_type: :spot, method: :get, name: :fetch_ticker, param_mappings: %{ "symbol" => "product_id" }, params: [ :symbol ], path: "/brokerage/market/products/{product_id}/ticker", source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 3, default_params: %{ "product_ids" => [ "BTCUSDT" ], "product_type" => "SPOT" }, market_type: :spot, method: :get, name: :fetch_tickers, param_mappings: %{}, params: [ :symbols ], path: "/brokerage/market/products", response_transformer: {:extract_path, ["products"]}, source: :intercepted }, %{ api_section: "v2/public", auth: false, cost: 10.6, market_type: :spot, method: :get, name: :fetch_time, param_mappings: %{}, params: [], path: "/time", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 3, default_params: %{ "end" => "" }, market_type: :spot, method: :get, name: :fetch_trades, param_mappings: %{ "since" => "start", "symbol" => "product_id" }, params: [ :symbol, :since, :limit ], path: "/brokerage/market/products/{product_id}/ticker", response_transformer: {:extract_path, ["trades"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 3, default_params: %{ "product_type" => "SPOT" }, market_type: :spot, method: :get, name: :fetch_trading_fees, param_mappings: %{}, params: [], path: "/brokerage/transaction_summary", response_transformer: {:extract_path, ["fee_tier"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "limit" => 250 }, market_type: :spot, method: :get, name: :fetch_withdrawals, param_mappings: %{}, params: [ :code, :since, :limit ], path: "/brokerage/accounts", source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "limit" => 250 }, market_type: :spot, method: :get, name: :withdraw, param_mappings: %{}, params: [ :code, :amount, :address, :tag ], path: "/brokerage/accounts", response_transformer: {:extract_path, ["data"]}, source: :intercepted } ], error_code_details: %{ "INSUFFICIENT_FUND" => %{ description: nil, type: :insufficient_balance }, "INVALID_ARGUMENT" => %{ description: nil, type: :invalid_parameters }, "Insufficient balance in source account" => %{ description: nil, type: :insufficient_balance }, "PERMISSION_DENIED" => %{ description: nil, type: :access_restricted }, "PREVIEW_INSUFFICIENT_FUND" => %{ description: nil, type: :insufficient_balance }, "PREVIEW_STOP_PRICE_ABOVE_LAST_TRADE_PRICE" => %{ description: nil, type: :invalid_order }, "UNSUPPORTED_ORDER_CONFIGURATION" => %{ description: nil, type: :invalid_parameters }, "authentication_error" => %{ description: "401 Invalid auth (generic)", type: :invalid_credentials }, "expired_token" => %{ description: "401 Expired Oauth token", type: :invalid_credentials }, "identity_verification_required" => %{ description: "400 Identity verification is required to complete this request", type: :invalid_credentials }, "internal_server_error" => %{ description: "500 Internal server error", type: :exchange_error }, "invalid_authentication_method" => %{ description: "401 API access is blocked for deleted users.", type: :invalid_credentials }, "invalid_request" => %{ description: "400 Invalid request", type: :exchange_error }, "invalid_scope" => %{ description: "403 User hasn’t authenticated necessary scope", type: :invalid_credentials }, "invalid_token" => %{ description: "401 Invalid Oauth token", type: :invalid_credentials }, "jumio_face_match_verification_required" => %{ description: "400 Document verification including face match is required to complete this request", type: :invalid_credentials }, "jumio_verification_required" => %{ description: "400 Document verification is required to complete this request", type: :invalid_credentials }, "not_found" => %{ description: "404 Resource not found", type: :exchange_error }, "order with this orderID was not found" => %{ description: "order with this orderID was not found", type: :order_not_found }, "param_required" => %{ description: "400 Missing parameter", type: :exchange_error }, "personal_details_required" => %{ description: "400 User’s personal detail required to complete this request", type: :invalid_credentials }, "rate_limit_exceeded" => %{ description: "429 Rate limit exceeded", type: :rate_limited }, "request timestamp expired" => %{ description: "{\"errors\":[{\"id\":\"authentication_error\",\"message\":\"request timestamp expired\"}]}", type: :invalid_credentials }, "revoked_token" => %{ description: "401 Revoked Oauth token", type: :invalid_credentials }, "two_factor_required" => %{ description: "402 When sending money over 2fa limit", type: :invalid_credentials }, "unverified_email" => %{ description: "400 User has not verified their email", type: :invalid_credentials }, "validation_error" => %{ description: "400 Unable to validate POST/PUT", type: :exchange_error } }, error_codes: %{ "INSUFFICIENT_FUND" => :insufficient_balance, "INVALID_ARGUMENT" => :invalid_parameters, "Insufficient balance in source account" => :insufficient_balance, "PERMISSION_DENIED" => :access_restricted, "PREVIEW_INSUFFICIENT_FUND" => :insufficient_balance, "PREVIEW_STOP_PRICE_ABOVE_LAST_TRADE_PRICE" => :invalid_order, "UNSUPPORTED_ORDER_CONFIGURATION" => :invalid_parameters, "authentication_error" => :invalid_credentials, "expired_token" => :invalid_credentials, "identity_verification_required" => :invalid_credentials, "internal_server_error" => :exchange_error, "invalid_authentication_method" => :invalid_credentials, "invalid_request" => :exchange_error, "invalid_scope" => :invalid_credentials, "invalid_token" => :invalid_credentials, "jumio_face_match_verification_required" => :invalid_credentials, "jumio_verification_required" => :invalid_credentials, "not_found" => :exchange_error, "order with this orderID was not found" => :order_not_found, "param_required" => :exchange_error, "personal_details_required" => :invalid_credentials, "rate_limit_exceeded" => :rate_limited, "request timestamp expired" => :invalid_credentials, "revoked_token" => :invalid_credentials, "two_factor_required" => :invalid_credentials, "unverified_email" => :invalid_credentials, "validation_error" => :exchange_error }, exceptions: %{ broad: %{ "Insufficient balance in source account" => :insufficient_funds, "order with this orderID was not found" => :order_not_found, "request timestamp expired" => :invalid_nonce }, exact: %{ "INSUFFICIENT_FUND" => :insufficient_funds, "INVALID_ARGUMENT" => :bad_request, "PERMISSION_DENIED" => :permission_denied, "PREVIEW_INSUFFICIENT_FUND" => :insufficient_funds, "PREVIEW_STOP_PRICE_ABOVE_LAST_TRADE_PRICE" => :invalid_order, "UNSUPPORTED_ORDER_CONFIGURATION" => :bad_request, "authentication_error" => :authentication_error, "expired_token" => :authentication_error, "identity_verification_required" => :authentication_error, "internal_server_error" => :exchange_error, "invalid_authentication_method" => :authentication_error, "invalid_request" => :exchange_error, "invalid_scope" => :authentication_error, "invalid_token" => :authentication_error, "jumio_face_match_verification_required" => :authentication_error, "jumio_verification_required" => :authentication_error, "not_found" => :exchange_error, "param_required" => :exchange_error, "personal_details_required" => :authentication_error, "rate_limit_exceeded" => :rate_limit_exceeded, "revoked_token" => :authentication_error, "two_factor_required" => :authentication_error, "unverified_email" => :authentication_error, "validation_error" => :exchange_error } }, exchange_options: %{ "accounts" => [ "wallet", "fiat" ], "adjustForTimeDifference" => false, "advanced" => true, "brokerId" => "ccxt", "createMarketBuyOrderRequiresPrice" => true, "defaultNetworkCodeReplacements" => %{ "BRC20" => %{ "BRC20" => "BTC" }, "CRO" => %{ "CRC20" => "CRONOS" }, "ETH" => %{ "ERC20" => "ETH" }, "TRX" => %{ "TRC20" => "TRX" } }, "fetchAccounts" => "fetchAccountsV3", "fetchBalance" => "v2PrivateGetAccounts", "fetchCurrencies" => %{ "expires" => 5000 }, "fetchMarkets" => "fetchMarketsV3", "fetchTicker" => "fetchTickerV3", "fetchTickers" => "fetchTickersV3", "fetchTime" => "v2PublicGetTime", "networks" => %{ "ERC20" => "ethereum", "XLM" => "stellar" }, "networksById" => %{ "ethereum" => "ERC20", "stellar" => "XLM" }, "stablePairs" => [ "BUSD-USD", "CBETH-ETH", "DAI-USD", "GUSD-USD", "GYEN-USD", "PAX-USD", "PAX-USDT", "USDC-EUR", "USDC-GBP", "USDT-EUR", "USDT-GBP", "USDT-USD", "USDT-USDC", "WBTC-BTC" ], "timeDifference" => 0, "usePrivate" => false, "user_native_currency" => "USD", "v3Accounts" => [ "ACCOUNT_TYPE_CRYPTO", "ACCOUNT_TYPE_FIAT" ] }, extended_metadata: %{ limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{}, "price" => %{} }, logo_url: "https://user-images.githubusercontent.com/1294454/40811661-b6eceae2-653a-11e8-829e-10bfadb078cf.jpg", referral_url: "https://www.coinbase.com/join/58cbe25a355148797479dbd2" }, extracted_metadata: %{ ccxt_version: "4.5.34" }, features: %{ default: %{ create_order: %{ hedged: false, iceberg: false, leverage: true, margin_mode: true, market_buy_by_cost: true, market_buy_requires_price: true, self_trade_prevention: false, stop_loss_price: true, take_profit_price: true, time_in_force: %{ fok: true, gtd: true, ioc: true, po: true }, trailing: false, trigger_direction: true, trigger_price: true }, fetch_closed_orders: %{ margin_mode: false, symbol_required: false, trailing: false, trigger: false, until_days: 10000 }, fetch_my_trades: %{ limit: 3000, margin_mode: false, symbol_required: false, until_days: 10000 }, fetch_ohlcv: %{ limit: 300 }, fetch_open_orders: %{ margin_mode: false, symbol_required: false, trailing: false, trigger: false }, fetch_order: %{ margin_mode: false, symbol_required: false, trailing: false, trigger: false }, fetch_orders: %{ margin_mode: false, symbol_required: false, trailing: false, trigger: false, until_days: 10000 }, sandbox: false }, future: %{ linear: %{ extends: "default" } }, spot: %{ extends: "default" }, swap: %{ linear: %{ extends: "default" } } }, fees: %{ trading: %{ maker: 0.006, percentage: true, taker: 0.012, tier_based: true, tiers: %{ maker: [ %{ fee: 0.004, volume: 0 }, %{ fee: 0.0025, volume: 10000 }, %{ fee: 0.0015, volume: 50000 }, %{ fee: 0.001, volume: 100000 }, %{ fee: 0.0008, volume: 1000000 }, %{ fee: 0.0006, volume: 15000000 }, %{ fee: 0.0003, volume: 75000000 }, %{ fee: 0, volume: 250000000 }, %{ fee: 0, volume: 400000000 } ], taker: [ %{ fee: 0.006, volume: 0 }, %{ fee: 0.004, volume: 10000 }, %{ fee: 0.0025, volume: 50000 }, %{ fee: 0.002, volume: 100000 }, %{ fee: 0.0018, volume: 1000000 }, %{ fee: 0.0016, volume: 15000000 }, %{ fee: 0.0012, volume: 75000000 }, %{ fee: 0.0008, volume: 250000000 }, %{ fee: 0.0005, volume: 400000000 } ] } } }, 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 const feedback = this.id + ' ' + body;\n //\n // {\"error\": \"invalid_request\", \"error_description\": \"The request is missing a required parameter, includes an unsupported parameter value, or is otherwise malformed.\"}\n //\n // or\n //\n // {\n // \"errors\": [\n // {\n // \"id\": \"not_found\",\n // \"message\": \"Not found\"\n // }\n // ]\n // }\n // or\n // {\n // \"success\": false,\n // \"error_response\": {\n // \"error\": \"UNKNOWN_FAILURE_REASON\",\n // \"message\": \"\",\n // \"error_details\": \"\",\n // \"preview_failure_reason\": \"PREVIEW_STOP_PRICE_ABOVE_LAST_TRADE_PRICE\"\n // },\n // \"order_configuration\": {\n // \"stop_limit_stop_limit_gtc\": {\n // \"base_size\": \"0.0001\",\n // \"limit_price\": \"2000\",\n // \"stop_price\": \"2005\",\n // \"stop_direction\": \"STOP_DIRECTION_STOP_DOWN\",\n // \"reduce_only\": false\n // }\n // }\n // }\n //\n let errorCode = this.safeString(response, 'error');\n if (errorCode !== undefined) {\n const errorMessage = this.safeString2(response, 'error_description', 'error');\n this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], errorMessage, feedback);\n throw new errors.ExchangeError(feedback);\n }\n const errorResponse = this.safeDict(response, 'error_response');\n if (errorResponse !== undefined) {\n const errorMessageInner = this.safeString2(errorResponse, 'preview_failure_reason', 'preview_failure_reason');\n this.throwExactlyMatchedException(this.exceptions['exact'], errorMessageInner, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], errorMessageInner, feedback);\n throw new errors.ExchangeError(feedback);\n }\n const errors$1 = this.safeList(response, 'errors');\n if (errors$1 !== undefined) {\n if (Array.isArray(errors$1)) {\n const numErrors = errors$1.length;\n if (numErrors > 0) {\n errorCode = this.safeString(errors$1[0], 'id');\n const errorMessage = this.safeString(errors$1[0], 'message');\n if (errorCode !== undefined) {\n this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], errorMessage, feedback);\n throw new errors.ExchangeError(feedback);\n }\n }\n }\n }\n const advancedTrade = this.options['advanced'];\n if (!('data' in response) && (!advancedTrade)) {\n throw new errors.ExchangeError(this.id + ' failed due to a malformed response ' + this.json(response));\n }\n return undefined;\n }", has: %{ add_margin: false, borrow_cross_margin: false, borrow_isolated_margin: false, borrow_margin: false, c_o_r_s: true, 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: true, cancel_orders_with_client_order_id: false, cancel_orders_ws: false, close_all_positions: false, close_position: true, create_convert_trade: true, create_deposit_address: true, create_limit_buy_order: true, create_limit_buy_order_ws: false, create_limit_order: true, create_limit_order_ws: false, create_limit_sell_order: true, create_limit_sell_order_ws: false, create_market_buy_order: true, create_market_buy_order_with_cost: true, 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: true, 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: true, create_post_only_order_ws: false, create_reduce_only_order: false, create_reduce_only_order_ws: false, create_stop_limit_order: true, 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: true, 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: true, edit_order: true, edit_order_with_client_order_id: false, edit_order_ws: false, edit_orders: false, fetch_accounts: true, fetch_balance: true, fetch_balance_ws: false, fetch_bids_asks: true, 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: true, fetch_closed_order: false, fetch_closed_orders: true, fetch_closed_orders_ws: false, fetch_convert_currencies: false, fetch_convert_quote: true, fetch_convert_trade: true, fetch_convert_trade_history: false, fetch_cross_borrow_rate: false, fetch_cross_borrow_rates: false, fetch_currencies: true, fetch_currencies_ws: true, fetch_deposit: true, fetch_deposit_address: true, fetch_deposit_addresses: true, fetch_deposit_addresses_by_network: true, fetch_deposit_method_id: true, fetch_deposit_method_ids: true, fetch_deposit_withdraw_fee: false, fetch_deposit_withdraw_fees: false, fetch_deposits: true, fetch_deposits_withdrawals: true, 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: false, fetch_l3_order_book: false, fetch_last_prices: false, fetch_ledger: true, 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_buys: true, fetch_my_liquidations: false, fetch_my_sells: true, 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: true, 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: true, fetch_trades: true, fetch_trades_ws: false, fetch_trading_fee: true, fetch_trading_fees: true, 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: true, watch_order_book_for_symbols: true, watch_orders: true, watch_orders_for_symbols: false, watch_position: false, watch_positions: false, watch_status: false, watch_ticker: true, watch_tickers: true, watch_trades: true, watch_trades_for_symbols: true, withdraw: true, ws: false }, http_config: %{ headers: %{ "CB-VERSION" => "2018-05-30" }, user_agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36" }, id: "coinbase", markets: nil, name: "Coinbase Advanced", ohlcv_timestamp_resolution: :seconds, options: %{ "accounts" => [ "wallet", "fiat" ], :adjust_for_time_difference => false, "advanced" => true, :broker_id => "ccxt", :create_market_buy_order_requires_price => true, "fetch_accounts" => "fetchAccountsV3", :fetch_balance => "v2PrivateGetAccounts", :fetch_currencies => %{ "expires" => 5000 }, :fetch_markets => "fetchMarketsV3", "fetch_ticker" => "fetchTickerV3", "fetch_tickers" => "fetchTickersV3", "fetch_time" => "v2PublicGetTime", :networks => %{ "ERC20" => "ethereum", "XLM" => "stellar" }, "stable_pairs" => [ "BUSD-USD", "CBETH-ETH", "DAI-USD", "GUSD-USD", "GYEN-USD", "PAX-USD", "PAX-USDT", "USDC-EUR", "USDC-GBP", "USDT-EUR", "USDT-GBP", "USDT-USD", "USDT-USDC", "WBTC-BTC" ], :time_difference => 0, "use_private" => false, "user_native_currency" => "USD", "v3_accounts" => [ "ACCOUNT_TYPE_CRYPTO", "ACCOUNT_TYPE_FIAT" ] }, order_mappings: %{ side_format: :uppercase, side_key: "side", type_format: nil, type_key: nil }, param_mappings: %{ "amount" => "size", "arg0" => "payment_method_id", "code" => "from_account", "fromCode" => "from_account", "id" => "order_id", "since" => "start", "symbol" => "product_id", "timeframe" => "granularity", "toCode" => "to_account" }, parse_methods: [ %{ "comment" => nil, "examples" => [ "{\n \"id\": \"XLM\",\n \"name\": \"XLM Wallet\",\n \"primary\": false,\n \"type\": \"wallet\",\n \"currency\": {\n \"code\": \"XLM\",\n \"name\": \"Stellar Lumens\",\n \"color\": \"#000000\",\n \"sort_index\": 127,\n \"exponent\": 7,\n \"type\": \"crypto\",\n \"address_regex\": \"^G[A-Z2-7]{55}$\",\n \"asset_id\": \"13b83335-5ede-595b-821e-5bcdfa80560f\",\n \"destination_tag_name\": \"XLM Memo ID\",\n \"destination_tag_regex\": \"^[ -~]{1,28}$\"\n },\n \"balance\": {\n \"amount\": \"0.0000000\",\n \"currency\": \"XLM\"\n },\n \"created_at\": null,\n \"updated_at\": null,\n \"resource\": \"account\",\n \"resource_path\": \"/v2/accounts/XLM\",\n \"allow_deposits\": true,\n \"allow_withdrawals\": true\n }", "{\n \"uuid\": \"11111111-1111-1111-1111-111111111111\",\n \"name\": \"USDC Wallet\",\n \"currency\": \"USDC\",\n \"available_balance\": {\n \"value\": \"0.0000000000000000\",\n \"currency\": \"USDC\"\n },\n \"default\": true,\n \"active\": true,\n \"created_at\": \"2023-01-04T06:20:06.456Z\",\n \"updated_at\": \"2023-01-04T06:20:07.181Z\",\n \"deleted_at\": null,\n \"type\": \"ACCOUNT_TYPE_CRYPTO\",\n \"ready\": false,\n \"hold\": {\n \"value\": \"0.0000000000000000\",\n \"currency\": \"USDC\"\n }\n }" ], "line_end" => 780, "line_start" => 711, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "this.safeString2 (account, 'id', 'uuid')" }, %{ "comment" => nil, "key" => "type", "value" => "(active !== undefined) ? this.safeStringLower (parts, 1) : typeV2" }, %{ "comment" => nil, "key" => "code", "value" => "this.safeCurrencyCode (currencyId)" }, %{ "comment" => nil, "key" => "info", "value" => "account" } ], "name" => "parseAccount", "signature" => "parseAccount (account)", "source" => "parseAccount (account) {\n //\n // fetchAccountsV2\n //\n // {\n // \"id\": \"XLM\",\n // \"name\": \"XLM Wallet\",\n // \"primary\": false,\n // \"type\": \"wallet\",\n // \"currency\": {\n // \"code\": \"XLM\",\n // \"name\": \"Stellar Lumens\",\n // \"color\": \"#000000\",\n // \"sort_index\": 127,\n // \"exponent\": 7,\n // \"type\": \"crypto\",\n // \"address_regex\": \"^G[A-Z2-7]{55}$\",\n // \"asset_id\": \"13b83335-5ede-595b-821e-5bcdfa80560f\",\n // \"destination_tag_name\": \"XLM Memo ID\",\n // \"destination_tag_regex\": \"^[ -~]{1,28}$\"\n // },\n // \"balance\": {\n // \"amount\": \"0.0000000\",\n // \"currency\": \"XLM\"\n // },\n // \"created_at\": null,\n // \"updated_at\": null,\n // \"resource\": \"account\",\n // \"resource_path\": \"/v2/accounts/XLM\",\n // \"allow_deposits\": true,\n // \"allow_withdrawals\": true\n // }\n //\n // fetchAccountsV3\n //\n // {\n // \"uuid\": \"11111111-1111-1111-1111-111111111111\",\n // \"name\": \"USDC Wallet\",\n // \"currency\": \"USDC\",\n // \"available_balance\": {\n // \"value\": \"0.0000000000000000\",\n // \"currency\": \"USDC\"\n // },\n // \"default\": true,\n // \"active\": true,\n // \"created_at\": \"2023-01-04T06:20:06.456Z\",\n // \"updated_at\": \"2023-01-04T06:20:07.181Z\",\n // \"deleted_at\": null,\n // \"type\": \"ACCOUNT_TYPE_CRYPTO\",\n // \"ready\": false,\n // \"hold\": {\n // \"value\": \"0.0000000000000000\",\n // \"currency\": \"USDC\"\n // }\n // }\n //\n const active = this.safeBool (account, 'active');\n const currencyIdV3 = this.safeString (account, 'currency');\n const currency = this.safeDict (account, 'currency', {});\n const currencyId = this.safeString (currency, 'code', currencyIdV3);\n const typeV3 = this.safeString (account, 'name');\n const typeV2 = this.safeString (account, 'type');\n const parts = typeV3.split (' ');\n return {\n 'id': this.safeString2 (account, 'id', 'uuid'),\n 'type': (active !== undefined) ? this.safeStringLower (parts, 1) : typeV2,\n 'code': this.safeCurrencyCode (currencyId),\n 'info': account,\n };\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"product_id\":\"BIT-26APR24-CDE\",\n \"price\":\"71145\",\n \"price_percentage_change_24h\":\"-2.36722931247427\",\n \"volume_24h\":\"108549\",\n \"volume_percentage_change_24h\":\"155.78255337197794\",\n \"base_increment\":\"1\",\n \"quote_increment\":\"0.01\",\n \"quote_min_size\":\"0\",\n \"quote_max_size\":\"100000000\",\n \"base_min_size\":\"1\",\n \"base_max_size\":\"100000000\",\n \"base_name\":\"\",\n \"quote_name\":\"US Dollar\",\n \"watched\":false,\n \"is_disabled\":false,\n \"new\":false,\n \"status\":\"\",\n \"cancel_only\":false,\n \"limit_only\":false,\n \"post_only\":false,\n \"trading_disabled\":false,\n \"auction_mode\":false,\n \"product_type\":\"FUTURE\",\n \"quote_currency_id\":\"USD\",\n \"base_currency_id\":\"\",\n \"fcm_trading_session_details\":{\n \"is_session_open\":true,\n \"open_time\":\"2024-04-08T22:00:00Z\",\n \"close_time\":\"2024-04-09T21:00:00Z\"\n },\n \"mid_market_price\":\"71105\",\n \"alias\":\"\",\n \"alias_to\":[\n ],\n \"base_display_symbol\":\"\",\n \"quote_display_symbol\":\"USD\",\n \"view_only\":false,\n \"price_increment\":\"5\",\n \"display_name\":\"BTC 26 APR 24\",\n \"product_venue\":\"FCM\",\n \"future_product_details\":{\n \"venue\":\"cde\",\n \"contract_code\":\"BIT\",\n \"contract_expiry\":\"2024-04-26T15:00:00Z\",\n \"contract_size\":\"0.01\",\n \"contract_root_unit\":\"BTC\",\n \"group_description\":\"Nano Bitcoin Futures\",\n \"contract_expiry_timezone\":\"Europe/London\",\n \"group_short_description\":\"Nano BTC\",\n \"risk_managed_by\":\"MANAGED_BY_FCM\",\n \"contract_expiry_type\":\"EXPIRING\",\n \"contract_display_name\":\"BTC 26 APR 24\"\n }\n }", "{\n \"product_id\":\"ETH-PERP-INTX\",\n \"price\":\"3630.98\",\n \"price_percentage_change_24h\":\"0.65142426292038\",\n \"volume_24h\":\"114020.1501\",\n \"volume_percentage_change_24h\":\"63.33650787154869\",\n \"base_increment\":\"0.0001\",\n \"quote_increment\":\"0.01\",\n \"quote_min_size\":\"10\",\n \"quote_max_size\":\"50000000\",\n \"base_min_size\":\"0.0001\",\n \"base_max_size\":\"50000\",\n \"base_name\":\"\",\n \"quote_name\":\"USDC\",\n \"watched\":false,\n \"is_disabled\":false,\n \"new\":false,\n \"status\":\"\",\n \"cancel_only\":false,\n \"limit_only\":false,\n \"post_only\":false,\n \"trading_disabled\":false,\n \"auction_mode\":false,\n \"product_type\":\"FUTURE\",\n \"quote_currency_id\":\"USDC\",\n \"base_currency_id\":\"\",\n \"fcm_trading_session_details\":null,\n \"mid_market_price\":\"3630.975\",\n \"alias\":\"\",\n \"alias_to\":[],\n \"base_display_symbol\":\"\",\n \"quote_display_symbol\":\"USDC\",\n \"view_only\":false,\n \"price_increment\":\"0.01\",\n \"display_name\":\"ETH PERP\",\n \"product_venue\":\"INTX\",\n \"future_product_details\":{\n \"venue\":\"\",\n \"contract_code\":\"ETH\",\n \"contract_expiry\":null,\n \"contract_size\":\"1\",\n \"contract_root_unit\":\"ETH\",\n \"group_description\":\"\",\n \"contract_expiry_timezone\":\"\",\n \"group_short_description\":\"\",\n \"risk_managed_by\":\"MANAGED_BY_VENUE\",\n \"contract_expiry_type\":\"PERPETUAL\",\n \"perpetual_details\":{\n \"open_interest\":\"0\",\n \"funding_rate\":\"0.000016\",\n \"funding_time\":\"2024-04-09T09:00:00.000008Z\",\n \"max_leverage\":\"10\"\n },\n \"contract_display_name\":\"ETH PERPETUAL\"\n }\n }" ], "line_end" => 1867, "line_start" => 1672, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "base", "value" => "base" }, %{ "comment" => nil, "key" => "quote", "value" => "quote" }, %{ "comment" => nil, "key" => "settle", "value" => "quote" }, %{ "comment" => nil, "key" => "baseId", "value" => "baseId" }, %{ "comment" => nil, "key" => "quoteId", "value" => "quoteId" }, %{ "comment" => nil, "key" => "settleId", "value" => "quoteId" }, %{ "comment" => nil, "key" => "type", "value" => "type" }, %{ "comment" => nil, "key" => "spot", "value" => "false" }, %{ "comment" => nil, "key" => "margin", "value" => "false" }, %{ "comment" => nil, "key" => "swap", "value" => "isSwap" }, %{ "comment" => nil, "key" => "future", "value" => "!isSwap" }, %{ "comment" => nil, "key" => "option", "value" => "false" }, %{ "comment" => nil, "key" => "active", "value" => "!tradingDisabled" }, %{ "comment" => nil, "key" => "contract", "value" => "true" }, %{ "comment" => nil, "key" => "linear", "value" => "true" }, %{ "comment" => nil, "key" => "inverse", "value" => "false" }, %{ "comment" => nil, "key" => "taker", "value" => "taker" }, %{ "comment" => nil, "key" => "maker", "value" => "maker" }, %{ "comment" => nil, "key" => "contractSize", "value" => "contractSize" }, %{ "comment" => nil, "key" => "expiry", "value" => "expireTimestamp" }, %{ "comment" => nil, "key" => "expiryDatetime", "value" => "expireDateTime" }, %{ "comment" => nil, "key" => "strike", "value" => "undefined" }, %{ "comment" => nil, "key" => "optionType", "value" => "undefined" }, %{ "comment" => nil, "key" => "precision", "value" => "{\n 'amount': this.safeNumber (market, 'base_increment'),\n 'price': this.safeNumber2 (market, 'price_increment', 'quote_increment'),\n }" }, %{ "comment" => nil, "key" => "limits", "value" => "{\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.safeNumber (market, 'base_min_size'),\n 'max': this.safeNumber (market, 'base_max_size'),\n },\n 'price': {\n 'min': undefined,\n 'max': undefined,\n },\n 'cost': {\n 'min': this.safeNumber (market, 'quote_min_size'),\n 'max': this.safeNumber (market, 'quote_max_size'),\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.safeNumber (market, 'base_min_size'),\n 'max': this.safeNumber (market, 'base_max_size'),\n }" }, %{ "comment" => nil, "key" => "price", "value" => "{\n 'min': undefined,\n 'max': undefined,\n }" }, %{ "comment" => nil, "key" => "cost", "value" => "{\n 'min': this.safeNumber (market, 'quote_min_size'),\n 'max': this.safeNumber (market, 'quote_max_size'),\n }" }, %{ "comment" => nil, "key" => "min", "value" => "undefined" }, %{ "comment" => nil, "key" => "max", "value" => "undefined" } ], "name" => "parseContractMarket", "signature" => "parseContractMarket (market, feeTier): MarketInterface", "source" => "parseContractMarket (market, feeTier): MarketInterface {\n // expiring\n //\n // {\n // \"product_id\":\"BIT-26APR24-CDE\",\n // \"price\":\"71145\",\n // \"price_percentage_change_24h\":\"-2.36722931247427\",\n // \"volume_24h\":\"108549\",\n // \"volume_percentage_change_24h\":\"155.78255337197794\",\n // \"base_increment\":\"1\",\n // \"quote_increment\":\"0.01\",\n // \"quote_min_size\":\"0\",\n // \"quote_max_size\":\"100000000\",\n // \"base_min_size\":\"1\",\n // \"base_max_size\":\"100000000\",\n // \"base_name\":\"\",\n // \"quote_name\":\"US Dollar\",\n // \"watched\":false,\n // \"is_disabled\":false,\n // \"new\":false,\n // \"status\":\"\",\n // \"cancel_only\":false,\n // \"limit_only\":false,\n // \"post_only\":false,\n // \"trading_disabled\":false,\n // \"auction_mode\":false,\n // \"product_type\":\"FUTURE\",\n // \"quote_currency_id\":\"USD\",\n // \"base_currency_id\":\"\",\n // \"fcm_trading_session_details\":{\n // \"is_session_open\":true,\n // \"open_time\":\"2024-04-08T22:00:00Z\",\n // \"close_time\":\"2024-04-09T21:00:00Z\"\n // },\n // \"mid_market_price\":\"71105\",\n // \"alias\":\"\",\n // \"alias_to\":[\n // ],\n // \"base_display_symbol\":\"\",\n // \"quote_display_symbol\":\"USD\",\n // \"view_only\":false,\n // \"price_increment\":\"5\",\n // \"display_name\":\"BTC 26 APR 24\",\n // \"product_venue\":\"FCM\",\n // \"future_product_details\":{\n // \"venue\":\"cde\",\n // \"contract_code\":\"BIT\",\n // \"contract_expiry\":\"2024-04-26T15:00:00Z\",\n // \"contract_size\":\"0.01\",\n // \"contract_root_unit\":\"BTC\",\n // \"group_description\":\"Nano Bitcoin Futures\",\n // \"contract_expiry_timezone\":\"Europe/London\",\n // \"group_short_description\":\"Nano BTC\",\n // \"risk_managed_by\":\"MANAGED_BY_FCM\",\n // \"contract_expiry_type\":\"EXPIRING\",\n // \"contract_display_name\":\"BTC 26 APR 24\"\n // }\n // }\n //\n // perpetual\n //\n // {\n // \"product_id\":\"ETH-PERP-INTX\",\n // \"price\":\"3630.98\",\n // \"price_percentage_change_24h\":\"0.65142426292038\",\n // \"volume_24h\":\"114020.1501\",\n // \"volume_percentage_change_24h\":\"63.33650787154869\",\n // \"base_increment\":\"0.0001\",\n // \"quote_increment\":\"0.01\",\n // \"quote_min_size\":\"10\",\n // \"quote_max_size\":\"50000000\",\n // \"base_min_size\":\"0.0001\",\n // \"base_max_size\":\"50000\",\n // \"base_name\":\"\",\n // \"quote_name\":\"USDC\",\n // \"watched\":false,\n // \"is_disabled\":false,\n // \"new\":false,\n // \"status\":\"\",\n // \"cancel_only\":false,\n // \"limit_only\":false,\n // \"post_only\":false,\n // \"trading_disabled\":false,\n // \"auction_mode\":false,\n // \"product_type\":\"FUTURE\",\n // \"quote_currency_id\":\"USDC\",\n // \"base_currency_id\":\"\",\n // \"fcm_trading_session_details\":null,\n // \"mid_market_price\":\"3630.975\",\n // \"alias\":\"\",\n // \"alias_to\":[],\n // \"base_display_symbol\":\"\",\n // \"quote_display_symbol\":\"USDC\",\n // \"view_only\":false,\n // \"price_increment\":\"0.01\",\n // \"display_name\":\"ETH PERP\",\n // \"product_venue\":\"INTX\",\n // \"future_product_details\":{\n // \"venue\":\"\",\n // \"contract_code\":\"ETH\",\n // \"contract_expiry\":null,\n // \"contract_size\":\"1\",\n // \"contract_root_unit\":\"ETH\",\n // \"group_description\":\"\",\n // \"contract_expiry_timezone\":\"\",\n // \"group_short_description\":\"\",\n // \"risk_managed_by\":\"MANAGED_BY_VENUE\",\n // \"contract_expiry_type\":\"PERPETUAL\",\n // \"perpetual_details\":{\n // \"open_interest\":\"0\",\n // \"funding_rate\":\"0.000016\",\n // \"funding_time\":\"2024-04-09T09:00:00.000008Z\",\n // \"max_leverage\":\"10\"\n // },\n // \"contract_display_name\":\"ETH PERPETUAL\"\n // }\n // }\n //\n const id = this.safeString (market, 'product_id');\n const futureProductDetails = this.safeDict (market, 'future_product_details', {});\n const contractExpiryType = this.safeString (futureProductDetails, 'contract_expiry_type');\n const contractSize = this.safeNumber (futureProductDetails, 'contract_size');\n const contractExpire = this.safeString (futureProductDetails, 'contract_expiry');\n const expireTimestamp = this.parse8601 (contractExpire);\n const expireDateTime = this.iso8601 (expireTimestamp);\n const isSwap = (contractExpiryType === 'PERPETUAL');\n const baseId = this.safeString (futureProductDetails, 'contract_root_unit');\n const quoteId = this.safeString (market, 'quote_currency_id');\n const base = this.safeCurrencyCode (baseId);\n const quote = this.safeCurrencyCode (quoteId);\n const tradingDisabled = this.safeBool (market, 'is_disabled');\n let symbol = base + '/' + quote;\n let type = undefined;\n if (isSwap) {\n type = 'swap';\n symbol = symbol + ':' + quote;\n } else {\n type = 'future';\n symbol = symbol + ':' + quote + '-' + this.yymmdd (expireTimestamp);\n }\n const takerFeeRate = this.safeNumber (feeTier, 'taker_fee_rate');\n const makerFeeRate = this.safeNumber (feeTier, 'maker_fee_rate');\n const taker = takerFeeRate ? takerFeeRate : this.parseNumber ('0.06');\n const maker = makerFeeRate ? makerFeeRate : this.parseNumber ('0.04');\n return this.safeMarketStructure ({\n 'id': id,\n 'symbol': symbol,\n 'base': base,\n 'quote': quote,\n 'settle': quote,\n 'baseId': baseId,\n 'quoteId': quoteId,\n 'settleId': quoteId,\n 'type': type,\n 'spot': false,\n 'margin': false,\n 'swap': isSwap,\n 'future': !isSwap,\n 'option': false,\n 'active': !tradingDisabled,\n 'contract': true,\n 'linear': true,\n 'inverse': false,\n 'taker': taker,\n 'maker': maker,\n 'contractSize': contractSize,\n 'expiry': expireTimestamp,\n 'expiryDatetime': expireDateTime,\n 'strike': undefined,\n 'optionType': undefined,\n 'precision': {\n 'amount': this.safeNumber (market, 'base_increment'),\n 'price': this.safeNumber2 (market, 'price_increment', 'quote_increment'),\n },\n 'limits': {\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.safeNumber (market, 'base_min_size'),\n 'max': this.safeNumber (market, 'base_max_size'),\n },\n 'price': {\n 'min': undefined,\n 'max': undefined,\n },\n 'cost': {\n 'min': this.safeNumber (market, 'quote_min_size'),\n 'max': this.safeNumber (market, 'quote_max_size'),\n },\n },\n 'created': undefined,\n 'info': market,\n });\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 4704, "line_start" => 4684, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "conversion" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (conversion, 'id')" }, %{ "comment" => nil, "key" => "fromCurrency", "value" => "fromCode" }, %{ "comment" => nil, "key" => "fromAmount", "value" => "this.safeNumber (fromAmountStructure, 'value')" }, %{ "comment" => nil, "key" => "toCurrency", "value" => "toCode" }, %{ "comment" => nil, "key" => "toAmount", "value" => "undefined" }, %{ "comment" => nil, "key" => "price", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "this.safeNumber (feeAmountStructure, 'value')" } ], "name" => "parseConversion", "signature" => "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion", "source" => "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n const fromCoin = this.safeString (conversion, 'source_currency');\n const fromCode = this.safeCurrencyCode (fromCoin, fromCurrency);\n const to = this.safeString (conversion, 'target_currency');\n const toCode = this.safeCurrencyCode (to, toCurrency);\n const fromAmountStructure = this.safeDict (conversion, 'user_entered_amount');\n const feeStructure = this.safeDict (conversion, 'total_fee');\n const feeAmountStructure = this.safeDict (feeStructure, 'amount');\n return {\n 'info': conversion,\n 'timestamp': undefined,\n 'datetime': undefined,\n 'id': this.safeString (conversion, 'id'),\n 'fromCurrency': fromCode,\n 'fromAmount': this.safeNumber (fromAmountStructure, 'value'),\n 'toCurrency': toCode,\n 'toAmount': undefined,\n 'price': undefined,\n 'fee': this.safeNumber (feeAmountStructure, 'value'),\n } as Conversion;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2424, "line_start" => 2373, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "response" } ], "name" => "parseCustomBalance", "signature" => "parseCustomBalance (response, params = {})", "source" => "parseCustomBalance (response, params = {}) {\n const balances = this.safeList2 (response, 'data', 'accounts', []);\n const accounts = this.safeList (params, 'type', this.options['accounts']);\n const v3Accounts = this.safeList (params, 'type', this.options['v3Accounts']);\n const result: Dict = { 'info': response };\n for (let b = 0; b < balances.length; b++) {\n const balance = balances[b];\n const type = this.safeString (balance, 'type');\n if (this.inArray (type, accounts)) {\n const value = this.safeDict (balance, 'balance');\n if (value !== undefined) {\n const currencyId = this.safeString (value, 'currency');\n const code = this.safeCurrencyCode (currencyId);\n const total = this.safeString (value, 'amount');\n const free = total;\n let account = this.safeDict (result, code);\n if (account === undefined) {\n account = this.account ();\n account['free'] = free;\n account['total'] = total;\n } else {\n account['free'] = Precise.stringAdd (account['free'], total);\n account['total'] = Precise.stringAdd (account['total'], total);\n }\n result[code] = account;\n }\n } else if (this.inArray (type, v3Accounts)) {\n const available = this.safeDict (balance, 'available_balance');\n const hold = this.safeDict (balance, 'hold');\n if (available !== undefined && hold !== undefined) {\n const currencyId = this.safeString (available, 'currency');\n const code = this.safeCurrencyCode (currencyId);\n const used = this.safeString (hold, 'value');\n const free = this.safeString (available, 'value');\n const total = Precise.stringAdd (used, free);\n let account = this.safeDict (result, code);\n if (account === undefined) {\n account = this.account ();\n account['free'] = free;\n account['used'] = used;\n account['total'] = total;\n } else {\n account['free'] = Precise.stringAdd (account['free'], free);\n account['used'] = Precise.stringAdd (account['used'], used);\n account['total'] = Precise.stringAdd (account['total'], total);\n }\n result[code] = account;\n }\n }\n }\n return this.safeBalance (result);\n }" }, %{ "comment" => nil, "examples" => [ "{\n id: '64ceb5f1-5fa2-5310-a4ff-9fd46271003d',\n address: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',\n address_info: {\n address: 'GCF74576I7AQ56SLMKBQAP255EGUOWCRVII3S44KEXVNJEOIFVBDMXVL',\n destination_tag: '3722061866'\n },\n name: null,\n created_at: '2023-05-29T21:12:12Z',\n updated_at: '2023-05-29T21:12:12Z',\n network: 'solana',\n uri_scheme: 'solana',\n resource: 'address',\n resource_path: '/v2/accounts/a7b3d387-bfb8-5ce7-b8da-1f507e81cf25/addresses/64ceb5f1-5fa2-5310-a4ff-9fd46271003d',\n warnings: [\n {\n type: 'correct_address_warning',\n title: 'This is an ERC20 USDC address.',\n details: 'Only send ERC20 USD Coin (USDC) to this address.',\n image_url: 'https://www.coinbase.com/assets/addresses/global-receive-warning-a3d91807e61c717e5a38d270965003dcc025ca8a3cea40ec3d7835b7c86087fa.png',\n options: [ { text: 'I understand', style: 'primary', id: 'dismiss' } ]\n }\n ],\n qr_code_image_url: 'https://static-assets.coinbase.com/p2p/l2/asset_network_combinations/v5/usdc-solana.png',\n address_label: 'USDC address (Solana)',\n default_receive: true,\n deposit_uri: 'solana:5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk?spl-token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',\n callback_url: null,\n share_address_copy: {\n line1: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',\n line2: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.'\n },\n receive_subtitle: 'ERC-20',\n inline_warning: {\n text: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.',\n tooltip: {\n title: 'USDC (Solana)',\n subtitle: 'This address can only receive USDC-SPL from Solana network.'\n }\n }\n }", "{\n \"id\":\"3f2434234943-8c1c-50ef-a5a1-342213bbf45d\",\n \"address\":\"0x123123126F5921XXXXX\",\n \"currency\":\"USDC\",\n \"name\":\"\",\n \"network\":\"ethereum\",\n \"created_at\":\"2022-03-17T09:20:17.002Z\",\n \"updated_at\":\"2022-03-17T09:20:17.002Z\",\n \"resource\":\"addresses\",\n \"resource_path\":\"v2/accounts/b1091c6e-9ef2-5e4d-b352-665d0cf8f742/addresses/32fd0943-8c1c-50ef-a5a1-342213bbf45d\",\n \"destination_tag\":\"\"\n }" ], "line_end" => 4368, "line_start" => 4291, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "depositAddress" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (currencyId, currency)" }, %{ "comment" => nil, "key" => "network", "value" => "this.networkIdToCode (networkId, code)" }, %{ "comment" => nil, "key" => "address", "value" => "address" }, %{ "comment" => nil, "key" => "tag", "value" => "this.safeString (addressInfo, 'destination_tag')" } ], "name" => "parseDepositAddress", "signature" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress", "source" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n //\n // {\n // id: '64ceb5f1-5fa2-5310-a4ff-9fd46271003d',\n // address: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',\n // address_info: {\n // address: 'GCF74576I7AQ56SLMKBQAP255EGUOWCRVII3S44KEXVNJEOIFVBDMXVL',\n // destination_tag: '3722061866'\n // },\n // name: null,\n // created_at: '2023-05-29T21:12:12Z',\n // updated_at: '2023-05-29T21:12:12Z',\n // network: 'solana',\n // uri_scheme: 'solana',\n // resource: 'address',\n // resource_path: '/v2/accounts/a7b3d387-bfb8-5ce7-b8da-1f507e81cf25/addresses/64ceb5f1-5fa2-5310-a4ff-9fd46271003d',\n // warnings: [\n // {\n // type: 'correct_address_warning',\n // title: 'This is an ERC20 USDC address.',\n // details: 'Only send ERC20 USD Coin (USDC) to this address.',\n // image_url: 'https://www.coinbase.com/assets/addresses/global-receive-warning-a3d91807e61c717e5a38d270965003dcc025ca8a3cea40ec3d7835b7c86087fa.png',\n // options: [ { text: 'I understand', style: 'primary', id: 'dismiss' } ]\n // }\n // ],\n // qr_code_image_url: 'https://static-assets.coinbase.com/p2p/l2/asset_network_combinations/v5/usdc-solana.png',\n // address_label: 'USDC address (Solana)',\n // default_receive: true,\n // deposit_uri: 'solana:5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk?spl-token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',\n // callback_url: null,\n // share_address_copy: {\n // line1: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',\n // line2: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.'\n // },\n // receive_subtitle: 'ERC-20',\n // inline_warning: {\n // text: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.',\n // tooltip: {\n // title: 'USDC (Solana)',\n // subtitle: 'This address can only receive USDC-SPL from Solana network.'\n // }\n // }\n // }\n //\n // {\n // \"id\":\"3f2434234943-8c1c-50ef-a5a1-342213bbf45d\",\n // \"address\":\"0x123123126F5921XXXXX\",\n // \"currency\":\"USDC\",\n // \"name\":\"\",\n // \"network\":\"ethereum\",\n // \"created_at\":\"2022-03-17T09:20:17.002Z\",\n // \"updated_at\":\"2022-03-17T09:20:17.002Z\",\n // \"resource\":\"addresses\",\n // \"resource_path\":\"v2/accounts/b1091c6e-9ef2-5e4d-b352-665d0cf8f742/addresses/32fd0943-8c1c-50ef-a5a1-342213bbf45d\",\n // \"destination_tag\":\"\"\n // }\n //\n const address = this.safeString (depositAddress, 'address');\n this.checkAddress (address);\n const networkId = this.safeString (depositAddress, 'network');\n const code = this.safeCurrencyCode (undefined, currency);\n const addressLabel = this.safeString (depositAddress, 'address_label');\n let currencyId = undefined;\n if (addressLabel !== undefined) {\n const splitAddressLabel = addressLabel.split (' ');\n currencyId = this.safeString (splitAddressLabel, 0);\n } else {\n currencyId = this.safeString (depositAddress, 'currency');\n }\n const addressInfo = this.safeDict (depositAddress, 'address_info');\n return {\n 'info': depositAddress,\n 'currency': this.safeCurrencyCode (currencyId, currency),\n 'network': this.networkIdToCode (networkId, code),\n 'address': address,\n 'tag': this.safeString (addressInfo, 'destination_tag'),\n } as DepositAddress;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 4601, "line_start" => 4593, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "depositId" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (depositId, 'id')" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeString (depositId, 'currency')" }, %{ "comment" => nil, "key" => "verified", "value" => "this.safeBool (depositId, 'verified')" }, %{ "comment" => nil, "key" => "tag", "value" => "this.safeString (depositId, 'name')" } ], "name" => "parseDepositMethodId", "signature" => "parseDepositMethodId (depositId)", "source" => "parseDepositMethodId (depositId) {\n return {\n 'info': depositId,\n 'id': this.safeString (depositId, 'id'),\n 'currency': this.safeString (depositId, 'currency'),\n 'verified': this.safeBool (depositId, 'verified'),\n 'tag': this.safeString (depositId, 'name'),\n };\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 4591, "line_start" => 4584, "mappings" => [], "name" => "parseDepositMethodIds", "signature" => "parseDepositMethodIds (ids, params = {})", "source" => "parseDepositMethodIds (ids, params = {}) {\n const result = [];\n for (let i = 0; i < ids.length; i++) {\n const id = this.extend (this.parseDepositMethodId (ids[i]), params);\n result.push (id);\n }\n return result;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"id\": \"34e4816b-4c8c-5323-a01c-35a9fa26e490\",\n \"type\": \"send\",\n \"status\": \"completed\",\n \"amount\": { amount: \"28.31976528\", currency: \"BCH\" },\n \"native_amount\": { amount: \"2799.65\", currency: \"GBP\" },\n \"description\": null,\n \"created_at\": \"2019-02-28T12:35:20Z\",\n \"updated_at\": \"2019-02-28T12:43:24Z\",\n \"resource\": \"transaction\",\n \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/34e4816b-4c8c-5323-a01c-35a9fa26e490\",\n \"instant_exchange\": false,\n \"network\": {\n \"status\": \"confirmed\",\n \"hash\": \"56222d865dae83774fccb2efbd9829cf08c75c94ce135bfe4276f3fb46d49701\",\n \"transaction_url\": \"https://bch.btc.com/56222d865dae83774fccb2efbd9829cf08c75c94ce135bfe4276f3fb46d49701\"\n },\n \"from\": { resource: \"bitcoin_cash_network\", currency: \"BCH\" },\n \"details\": { title: 'Received Bitcoin Cash', subtitle: \"From Bitcoin Cash address\" }\n }", "{\n \"id\": \"459aad99-2c41-5698-ac71-b6b81a05196c\",\n \"type\": \"send\",\n \"status\": \"completed\",\n \"amount\": { amount: \"-0.36775642\", currency: \"BTC\" },\n \"native_amount\": { amount: \"-1111.65\", currency: \"GBP\" },\n \"description\": null,\n \"created_at\": \"2019-03-20T08:37:07Z\",\n \"updated_at\": \"2019-03-20T08:49:33Z\",\n \"resource\": \"transaction\",\n \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/459aad99-2c41-5698-ac71-b6b81a05196c\",\n \"instant_exchange\": false,\n \"network\": {\n \"status\": \"confirmed\",\n \"hash\": \"2732bbcf35c69217c47b36dce64933d103895277fe25738ffb9284092701e05b\",\n \"transaction_url\": \"https://blockchain.info/tx/2732bbcf35c69217c47b36dce64933d103895277fe25738ffb9284092701e05b\",\n \"transaction_fee\": { amount: \"0.00000000\", currency: \"BTC\" },\n \"transaction_amount\": { amount: \"0.36775642\", currency: \"BTC\" },\n \"confirmations\": 15682\n },\n \"to\": {\n \"resource\": \"bitcoin_address\",\n \"address\": \"1AHnhqbvbYx3rnZx8uC7NbFZaTe4tafFHX\",\n \"currency\": \"BTC\",\n \"address_info\": { address: \"1AHnhqbvbYx3rnZx8uC7NbFZaTe4tafFHX\" }\n },\n \"idem\": \"da0a2f14-a2af-4c5a-a37e-d4484caf582bsend\",\n \"application\": {\n \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n \"resource\": \"application\",\n \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n },\n \"details\": { title: 'Sent Bitcoin', subtitle: \"To Bitcoin address\" }\n }", "{\n \"id\": \"5b1b9fb8-5007-5393-b923-02903b973fdc\",\n \"type\": \"pro_deposit\",\n \"status\": \"completed\",\n \"amount\": { amount: \"-0.00001111\", currency: \"BCH\" },\n \"native_amount\": { amount: \"0.00\", currency: \"GBP\" },\n \"description\": null,\n \"created_at\": \"2019-02-28T13:31:58Z\",\n \"updated_at\": \"2019-02-28T13:31:58Z\",\n \"resource\": \"transaction\",\n \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/5b1b9fb8-5007-5393-b923-02903b973fdc\",\n \"instant_exchange\": false,\n \"application\": {\n \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n \"resource\": \"application\",\n \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n },\n \"details\": { title: 'Transferred Bitcoin Cash', subtitle: \"To Coinbase Pro\" }\n }", "{\n \"id\": \"badb7313-a9d3-5c07-abd0-00f8b44199b1\",\n \"type\": \"exchange_deposit\",\n \"status\": \"completed\",\n \"amount\": { amount: \"-0.43704149\", currency: \"BCH\" },\n \"native_amount\": { amount: \"-51.90\", currency: \"GBP\" },\n \"description\": null,\n \"created_at\": \"2019-03-19T10:30:40Z\",\n \"updated_at\": \"2019-03-19T10:30:40Z\",\n \"resource\": \"transaction\",\n \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/badb7313-a9d3-5c07-abd0-00f8b44199b1\",\n \"instant_exchange\": false,\n \"details\": { title: 'Transferred Bitcoin Cash', subtitle: \"To GDAX\" }\n }", "{\n \"id\": \"9c4b642c-8688-58bf-8962-13cef64097de\",\n \"type\": \"exchange_withdrawal\",\n \"status\": \"completed\",\n \"amount\": { amount: \"0.57729420\", currency: \"BTC\" },\n \"native_amount\": { amount: \"4418.72\", currency: \"GBP\" },\n \"description\": null,\n \"created_at\": \"2018-02-17T11:33:33Z\",\n \"updated_at\": \"2018-02-17T11:33:33Z\",\n \"resource\": \"transaction\",\n \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/9c4b642c-8688-58bf-8962-13cef64097de\",\n \"instant_exchange\": false,\n \"details\": { title: 'Transferred Bitcoin', subtitle: \"From GDAX\" }\n }" ], "line_end" => 2907, "line_start" => 2599, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "item" }, %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "direction", "value" => "direction" }, %{ "comment" => nil, "key" => "account", "value" => "accountId" }, %{ "comment" => nil, "key" => "referenceId", "value" => "undefined" }, %{ "comment" => nil, "key" => "referenceAccount", "value" => "undefined" }, %{ "comment" => nil, "key" => "type", "value" => "type" }, %{ "comment" => nil, "key" => "currency", "value" => "code" }, %{ "comment" => nil, "key" => "amount", "value" => "this.parseNumber (amount)" }, %{ "comment" => nil, "key" => "before", "value" => "undefined" }, %{ "comment" => nil, "key" => "after", "value" => "undefined" }, %{ "comment" => nil, "key" => "status", "value" => "status" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" }, %{ "comment" => nil, "key" => "cost", "value" => "feeAmount" }, %{ "comment" => nil, "key" => "currency", "value" => "feeCurrencyCode" } ], "name" => "parseLedgerEntry", "signature" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry", "source" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n //\n // crypto deposit transaction\n //\n // {\n // \"id\": \"34e4816b-4c8c-5323-a01c-35a9fa26e490\",\n // \"type\": \"send\",\n // \"status\": \"completed\",\n // \"amount\": { amount: \"28.31976528\", currency: \"BCH\" },\n // \"native_amount\": { amount: \"2799.65\", currency: \"GBP\" },\n // \"description\": null,\n // \"created_at\": \"2019-02-28T12:35:20Z\",\n // \"updated_at\": \"2019-02-28T12:43:24Z\",\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/34e4816b-4c8c-5323-a01c-35a9fa26e490\",\n // \"instant_exchange\": false,\n // \"network\": {\n // \"status\": \"confirmed\",\n // \"hash\": \"56222d865dae83774fccb2efbd9829cf08c75c94ce135bfe4276f3fb46d49701\",\n // \"transaction_url\": \"https://bch.btc.com/56222d865dae83774fccb2efbd9829cf08c75c94ce135bfe4276f3fb46d49701\"\n // },\n // \"from\": { resource: \"bitcoin_cash_network\", currency: \"BCH\" },\n // \"details\": { title: 'Received Bitcoin Cash', subtitle: \"From Bitcoin Cash address\" }\n // }\n //\n // crypto withdrawal transaction\n //\n // {\n // \"id\": \"459aad99-2c41-5698-ac71-b6b81a05196c\",\n // \"type\": \"send\",\n // \"status\": \"completed\",\n // \"amount\": { amount: \"-0.36775642\", currency: \"BTC\" },\n // \"native_amount\": { amount: \"-1111.65\", currency: \"GBP\" },\n // \"description\": null,\n // \"created_at\": \"2019-03-20T08:37:07Z\",\n // \"updated_at\": \"2019-03-20T08:49:33Z\",\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/459aad99-2c41-5698-ac71-b6b81a05196c\",\n // \"instant_exchange\": false,\n // \"network\": {\n // \"status\": \"confirmed\",\n // \"hash\": \"2732bbcf35c69217c47b36dce64933d103895277fe25738ffb9284092701e05b\",\n // \"transaction_url\": \"https://blockchain.info/tx/2732bbcf35c69217c47b36dce64933d103895277fe25738ffb9284092701e05b\",\n // \"transaction_fee\": { amount: \"0.00000000\", currency: \"BTC\" },\n // \"transaction_amount\": { amount: \"0.36775642\", currency: \"BTC\" },\n // \"confirmations\": 15682\n // },\n // \"to\": {\n // \"resource\": \"bitcoin_address\",\n // \"address\": \"1AHnhqbvbYx3rnZx8uC7NbFZaTe4tafFHX\",\n // \"currency\": \"BTC\",\n // \"address_info\": { address: \"1AHnhqbvbYx3rnZx8uC7NbFZaTe4tafFHX\" }\n // },\n // \"idem\": \"da0a2f14-a2af-4c5a-a37e-d4484caf582bsend\",\n // \"application\": {\n // \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n // \"resource\": \"application\",\n // \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n // },\n // \"details\": { title: 'Sent Bitcoin', subtitle: \"To Bitcoin address\" }\n // }\n //\n // withdrawal transaction from coinbase to coinbasepro\n //\n // {\n // \"id\": \"5b1b9fb8-5007-5393-b923-02903b973fdc\",\n // \"type\": \"pro_deposit\",\n // \"status\": \"completed\",\n // \"amount\": { amount: \"-0.00001111\", currency: \"BCH\" },\n // \"native_amount\": { amount: \"0.00\", currency: \"GBP\" },\n // \"description\": null,\n // \"created_at\": \"2019-02-28T13:31:58Z\",\n // \"updated_at\": \"2019-02-28T13:31:58Z\",\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/5b1b9fb8-5007-5393-b923-02903b973fdc\",\n // \"instant_exchange\": false,\n // \"application\": {\n // \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n // \"resource\": \"application\",\n // \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n // },\n // \"details\": { title: 'Transferred Bitcoin Cash', subtitle: \"To Coinbase Pro\" }\n // }\n //\n // withdrawal transaction from coinbase to gdax\n //\n // {\n // \"id\": \"badb7313-a9d3-5c07-abd0-00f8b44199b1\",\n // \"type\": \"exchange_deposit\",\n // \"status\": \"completed\",\n // \"amount\": { amount: \"-0.43704149\", currency: \"BCH\" },\n // \"native_amount\": { amount: \"-51.90\", currency: \"GBP\" },\n // \"description\": null,\n // \"created_at\": \"2019-03-19T10:30:40Z\",\n // \"updated_at\": \"2019-03-19T10:30:40Z\",\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/badb7313-a9d3-5c07-abd0-00f8b44199b1\",\n // \"instant_exchange\": false,\n // \"details\": { title: 'Transferred Bitcoin Cash', subtitle: \"To GDAX\" }\n // }\n //\n // deposit transaction from gdax to coinbase\n //\n // {\n // \"id\": \"9c4b642c-8688-58bf-8962-13cef64097de\",\n // \"type\": \"exchange_withdrawal\",\n // \"status\": \"completed\",\n // \"amount\": { amount: \"0.57729420\", currency: \"BTC\" },\n // \"native_amount\": { amount: \"4418.72\", currency: \"GBP\" },\n // \"description\": null,\n // \"created_at\": \"2018-02-17T11:33:33Z\",\n // \"updated_at\": \"2018-02-17T11:33:33Z\",\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/9c4b642c-8688-58bf-8962-13cef64097de\",\n // \"instant_exchange\": false,\n // \"details\": { title: 'Transferred Bitcoin', subtitle: \"From GDAX\" }\n // }\n //\n // deposit transaction from coinbasepro to coinbase\n //\n // {\n // \"id\": \"8d6dd0b9-3416-568a-889d-8f112fae9e81\",\n // \"type\": \"pro_withdrawal\",\n // \"status\": \"completed\",\n // \"amount\": { amount: \"0.40555386\", currency: \"BTC\" },\n // \"native_amount\": { amount: \"1140.27\", currency: \"GBP\" },\n // \"description\": null,\n // \"created_at\": \"2019-03-04T19:41:58Z\",\n // \"updated_at\": \"2019-03-04T19:41:58Z\",\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/8d6dd0b9-3416-568a-889d-8f112fae9e81\",\n // \"instant_exchange\": false,\n // \"application\": {\n // \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n // \"resource\": \"application\",\n // \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n // },\n // \"details\": { title: 'Transferred Bitcoin', subtitle: \"From Coinbase Pro\" }\n // }\n //\n // sell trade\n //\n // {\n // \"id\": \"a9409207-df64-585b-97ab-a50780d2149e\",\n // \"type\": \"sell\",\n // \"status\": \"completed\",\n // \"amount\": { amount: \"-9.09922880\", currency: \"BTC\" },\n // \"native_amount\": { amount: \"-7285.73\", currency: \"GBP\" },\n // \"description\": null,\n // \"created_at\": \"2017-03-27T15:38:34Z\",\n // \"updated_at\": \"2017-03-27T15:38:34Z\",\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/a9409207-df64-585b-97ab-a50780d2149e\",\n // \"instant_exchange\": false,\n // \"sell\": {\n // \"id\": \"e3550b4d-8ae6-5de3-95fe-1fb01ba83051\",\n // \"resource\": \"sell\",\n // \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/sells/e3550b4d-8ae6-5de3-95fe-1fb01ba83051\"\n // },\n // \"details\": {\n // \"title\": \"Sold Bitcoin\",\n // \"subtitle\": \"Using EUR Wallet\",\n // \"payment_method_name\": \"EUR Wallet\"\n // }\n // }\n //\n // buy trade\n //\n // {\n // \"id\": \"63eeed67-9396-5912-86e9-73c4f10fe147\",\n // \"type\": \"buy\",\n // \"status\": \"completed\",\n // \"amount\": { amount: \"2.39605772\", currency: \"ETH\" },\n // \"native_amount\": { amount: \"98.31\", currency: \"GBP\" },\n // \"description\": null,\n // \"created_at\": \"2017-03-27T09:07:56Z\",\n // \"updated_at\": \"2017-03-27T09:07:57Z\",\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/8902f85d-4a69-5d74-82fe-8e390201bda7/transactions/63eeed67-9396-5912-86e9-73c4f10fe147\",\n // \"instant_exchange\": false,\n // \"buy\": {\n // \"id\": \"20b25b36-76c6-5353-aa57-b06a29a39d82\",\n // \"resource\": \"buy\",\n // \"resource_path\": \"/v2/accounts/8902f85d-4a69-5d74-82fe-8e390201bda7/buys/20b25b36-76c6-5353-aa57-b06a29a39d82\"\n // },\n // \"details\": {\n // \"title\": \"Bought Ethereum\",\n // \"subtitle\": \"Using EUR Wallet\",\n // \"payment_method_name\": \"EUR Wallet\"\n // }\n // }\n //\n // fiat deposit transaction\n //\n // {\n // \"id\": \"04ed4113-3732-5b0c-af86-b1d2146977d0\",\n // \"type\": \"fiat_deposit\",\n // \"status\": \"completed\",\n // \"amount\": { amount: \"114.02\", currency: \"EUR\" },\n // \"native_amount\": { amount: \"97.23\", currency: \"GBP\" },\n // \"description\": null,\n // \"created_at\": \"2017-02-09T07:01:21Z\",\n // \"updated_at\": \"2017-02-09T07:01:22Z\",\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/04ed4113-3732-5b0c-af86-b1d2146977d0\",\n // \"instant_exchange\": false,\n // \"fiat_deposit\": {\n // \"id\": \"f34c19f3-b730-5e3d-9f72-96520448677a\",\n // \"resource\": \"fiat_deposit\",\n // \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/deposits/f34c19f3-b730-5e3d-9f72-96520448677a\"\n // },\n // \"details\": {\n // \"title\": \"Deposited funds\",\n // \"subtitle\": \"From SEPA Transfer (GB47 BARC 20..., reference CBADVI)\",\n // \"payment_method_name\": \"SEPA Transfer (GB47 BARC 20..., reference CBADVI)\"\n // }\n // }\n //\n // fiat withdrawal transaction\n //\n // {\n // \"id\": \"957d98e2-f80e-5e2f-a28e-02945aa93079\",\n // \"type\": \"fiat_withdrawal\",\n // \"status\": \"completed\",\n // \"amount\": { amount: \"-11000.00\", currency: \"EUR\" },\n // \"native_amount\": { amount: \"-9698.22\", currency: \"GBP\" },\n // \"description\": null,\n // \"created_at\": \"2017-12-06T13:19:19Z\",\n // \"updated_at\": \"2017-12-06T13:19:19Z\",\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/957d98e2-f80e-5e2f-a28e-02945aa93079\",\n // \"instant_exchange\": false,\n // \"fiat_withdrawal\": {\n // \"id\": \"f4bf1fd9-ab3b-5de7-906d-ed3e23f7a4e7\",\n // \"resource\": \"fiat_withdrawal\",\n // \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/withdrawals/f4bf1fd9-ab3b-5de7-906d-ed3e23f7a4e7\"\n // },\n // \"details\": {\n // \"title\": \"Withdrew funds\",\n // \"subtitle\": \"To HSBC BANK PLC (GB74 MIDL...)\",\n // \"payment_method_name\": \"HSBC BANK PLC (GB74 MIDL...)\"\n // }\n // }\n //\n const amountInfo = this.safeDict (item, 'amount', {});\n let amount = this.safeString (amountInfo, 'amount');\n let direction = undefined;\n if (Precise.stringLt (amount, '0')) {\n direction = 'out';\n amount = Precise.stringNeg (amount);\n } else {\n direction = 'in';\n }\n const currencyId = this.safeString (amountInfo, 'currency');\n const code = this.safeCurrencyCode (currencyId, currency);\n currency = this.safeCurrency (currencyId, currency);\n //\n // the address and txid do not belong to the unified ledger structure\n //\n // let address = undefined;\n // if (item['to']) {\n // address = this.safeString (item['to'], 'address');\n // }\n // let txid = undefined;\n //\n let fee = undefined;\n const networkInfo = this.safeDict (item, 'network', {});\n // txid = network['hash']; // txid does not belong to the unified ledger structure\n const feeInfo = this.safeDict (networkInfo, 'transaction_fee');\n if (feeInfo !== undefined) {\n const feeCurrencyId = this.safeString (feeInfo, 'currency');\n const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId, currency);\n const feeAmount = this.safeNumber (feeInfo, 'amount');\n fee = {\n 'cost': feeAmount,\n 'currency': feeCurrencyCode,\n };\n }\n const timestamp = this.parse8601 (this.safeString (item, 'created_at'));\n const id = this.safeString (item, 'id');\n const type = this.parseLedgerEntryType (this.safeString (item, 'type'));\n const status = this.parseLedgerEntryStatus (this.safeString (item, 'status'));\n const path = this.safeString (item, 'resource_path');\n let accountId = undefined;\n if (path !== undefined) {\n const parts = path.split ('/');\n const numParts = parts.length;\n if (numParts > 3) {\n accountId = parts[3];\n }\n }\n return this.safeLedgerEntry ({\n 'info': item,\n 'id': id,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'direction': direction,\n 'account': accountId,\n 'referenceId': undefined,\n 'referenceAccount': undefined,\n 'type': type,\n 'currency': code,\n 'amount': this.parseNumber (amount),\n 'before': undefined,\n 'after': undefined,\n 'status': status,\n 'fee': fee,\n }, currency) as LedgerEntry;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2582, "line_start" => 2577, "mappings" => [], "name" => "parseLedgerEntryStatus", "signature" => "parseLedgerEntryStatus (status)", "source" => "parseLedgerEntryStatus (status) {\n const types: Dict = {\n 'completed': 'ok',\n };\n return this.safeString (types, status, status);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2597, "line_start" => 2584, "mappings" => [], "name" => "parseLedgerEntryType", "signature" => "parseLedgerEntryType (type)", "source" => "parseLedgerEntryType (type) {\n const types: Dict = {\n 'buy': 'trade',\n 'sell': 'trade',\n 'fiat_deposit': 'transaction',\n 'fiat_withdrawal': 'transaction',\n 'exchange_deposit': 'transaction', // fiat withdrawal (from coinbase to coinbasepro)\n 'exchange_withdrawal': 'transaction', // fiat deposit (to coinbase from coinbasepro)\n 'send': 'transaction', // crypto deposit OR withdrawal\n 'pro_deposit': 'transaction', // crypto withdrawal (from coinbase to coinbasepro)\n 'pro_withdrawal': 'transaction', // crypto deposit (to coinbase from coinbasepro)\n };\n return this.safeString (types, type, type);\n }" }, %{ "comment" => nil, "examples" => [ "[\n {\n \"start\": \"1673391780\",\n \"low\": \"17414.36\",\n \"high\": \"17417.99\",\n \"open\": \"17417.74\",\n \"close\": \"17417.38\",\n \"volume\": \"1.87780853\"\n },\n ]" ], "line_end" => 3886, "line_start" => 3865, "mappings" => [], "name" => "parseOHLCV", "signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV", "source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // [\n // {\n // \"start\": \"1673391780\",\n // \"low\": \"17414.36\",\n // \"high\": \"17417.99\",\n // \"open\": \"17417.74\",\n // \"close\": \"17417.38\",\n // \"volume\": \"1.87780853\"\n // },\n // ]\n //\n return [\n this.safeTimestamp (ohlcv, 'start'),\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 \"order_id\": \"52cfe5e2-0b29-4c19-a245-a6a773de5030\",\n \"product_id\": \"LTC-BTC\",\n \"side\": \"SELL\",\n \"client_order_id\": \"4d760580-6fca-4094-a70b-ebcca8626288\"\n }", "{\n \"success\": true,\n \"failure_reason\": \"UNKNOWN_CANCEL_FAILURE_REASON\",\n \"order_id\": \"bb8851a3-4fda-4a2c-aa06-9048db0e0f0d\"\n }", "{\n \"order_id\": \"9bc1eb3b-5b46-4b71-9628-ae2ed0cca75b\",\n \"product_id\": \"LTC-BTC\",\n \"user_id\": \"1111111-1111-1111-1111-111111111111\",\n \"order_configuration\": {\n \"limit_limit_gtc\": {\n \"base_size\": \"0.2\",\n \"limit_price\": \"0.006\",\n \"post_only\": false\n },\n \"stop_limit_stop_limit_gtc\": {\n \"base_size\": \"48.54\",\n \"limit_price\": \"6.998\",\n \"stop_price\": \"7.0687\",\n \"stop_direction\": \"STOP_DIRECTION_STOP_DOWN\"\n }\n },\n \"side\": \"SELL\",\n \"client_order_id\": \"e5fe8482-05bb-428f-ad4d-dbc8ce39239c\",\n \"status\": \"OPEN\",\n \"time_in_force\": \"GOOD_UNTIL_CANCELLED\",\n \"created_time\": \"2023-01-16T23:37:23.947030Z\",\n \"completion_percentage\": \"0\",\n \"filled_size\": \"0\",\n \"average_filled_price\": \"0\",\n \"fee\": \"\",\n \"number_of_fills\": \"0\",\n \"filled_value\": \"0\",\n \"pending_cancel\": false,\n \"size_in_quote\": false,\n \"total_fees\": \"0\",\n \"size_inclusive_of_fees\": false,\n \"total_value_after_fees\": \"0\",\n \"trigger_status\": \"INVALID_ORDER_TYPE\",\n \"order_type\": \"LIMIT\",\n \"reject_reason\": \"REJECT_REASON_UNSPECIFIED\",\n \"settled\": false,\n \"product_type\": \"SPOT\",\n \"reject_message\": \"\",\n \"cancel_message\": \"\"\n }" ], "line_end" => 3357, "line_start" => 3223, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "order" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (order, 'order_id')" }, %{ "comment" => nil, "key" => "clientOrderId", "value" => "this.safeString (order, 'client_order_id')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "this.parse8601 (datetime)" }, %{ "comment" => nil, "key" => "datetime", "value" => "datetime" }, %{ "comment" => nil, "key" => "lastTradeTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "type", "value" => "this.parseOrderType (this.safeString (order, 'order_type'))" }, %{ "comment" => nil, "key" => "timeInForce", "value" => "this.parseTimeInForce (this.safeString (order, 'time_in_force'))" }, %{ "comment" => nil, "key" => "postOnly", "value" => "postOnly" }, %{ "comment" => nil, "key" => "side", "value" => "this.safeStringLower (order, 'side')" }, %{ "comment" => nil, "key" => "price", "value" => "price" }, %{ "comment" => nil, "key" => "triggerPrice", "value" => "triggerPrice" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "filled", "value" => "this.safeString (order, 'filled_size')" }, %{ "comment" => nil, "key" => "remaining", "value" => "undefined" }, %{ "comment" => nil, "key" => "cost", "value" => "undefined" }, %{ "comment" => nil, "key" => "average", "value" => "this.safeString (order, 'average_filled_price')" }, %{ "comment" => nil, "key" => "status", "value" => "this.parseOrderStatus (this.safeString (order, 'status'))" }, %{ "comment" => nil, "key" => "fee", "value" => "{\n 'cost': this.safeString (order, 'total_fees'),\n 'currency': currencyFee,\n }" }, %{ "comment" => nil, "key" => "trades", "value" => "undefined" }, %{ "comment" => nil, "key" => "cost", "value" => "this.safeString (order, 'total_fees')" }, %{ "comment" => nil, "key" => "currency", "value" => "currencyFee" } ], "name" => "parseOrder", "signature" => "parseOrder (order: Dict, market: Market = undefined): Order", "source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // createOrder\n //\n // {\n // \"order_id\": \"52cfe5e2-0b29-4c19-a245-a6a773de5030\",\n // \"product_id\": \"LTC-BTC\",\n // \"side\": \"SELL\",\n // \"client_order_id\": \"4d760580-6fca-4094-a70b-ebcca8626288\"\n // }\n //\n // cancelOrder, cancelOrders\n //\n // {\n // \"success\": true,\n // \"failure_reason\": \"UNKNOWN_CANCEL_FAILURE_REASON\",\n // \"order_id\": \"bb8851a3-4fda-4a2c-aa06-9048db0e0f0d\"\n // }\n //\n // fetchOrder, fetchOrders, fetchOpenOrders, fetchClosedOrders, fetchCanceledOrders\n //\n // {\n // \"order_id\": \"9bc1eb3b-5b46-4b71-9628-ae2ed0cca75b\",\n // \"product_id\": \"LTC-BTC\",\n // \"user_id\": \"1111111-1111-1111-1111-111111111111\",\n // \"order_configuration\": {\n // \"limit_limit_gtc\": {\n // \"base_size\": \"0.2\",\n // \"limit_price\": \"0.006\",\n // \"post_only\": false\n // },\n // \"stop_limit_stop_limit_gtc\": {\n // \"base_size\": \"48.54\",\n // \"limit_price\": \"6.998\",\n // \"stop_price\": \"7.0687\",\n // \"stop_direction\": \"STOP_DIRECTION_STOP_DOWN\"\n // }\n // },\n // \"side\": \"SELL\",\n // \"client_order_id\": \"e5fe8482-05bb-428f-ad4d-dbc8ce39239c\",\n // \"status\": \"OPEN\",\n // \"time_in_force\": \"GOOD_UNTIL_CANCELLED\",\n // \"created_time\": \"2023-01-16T23:37:23.947030Z\",\n // \"completion_percentage\": \"0\",\n // \"filled_size\": \"0\",\n // \"average_filled_price\": \"0\",\n // \"fee\": \"\",\n // \"number_of_fills\": \"0\",\n // \"filled_value\": \"0\",\n // \"pending_cancel\": false,\n // \"size_in_quote\": false,\n // \"total_fees\": \"0\",\n // \"size_inclusive_of_fees\": false,\n // \"total_value_after_fees\": \"0\",\n // \"trigger_status\": \"INVALID_ORDER_TYPE\",\n // \"order_type\": \"LIMIT\",\n // \"reject_reason\": \"REJECT_REASON_UNSPECIFIED\",\n // \"settled\": false,\n // \"product_type\": \"SPOT\",\n // \"reject_message\": \"\",\n // \"cancel_message\": \"\"\n // }\n //\n const marketId = this.safeString (order, 'product_id');\n const symbol = this.safeSymbol (marketId, market, '-');\n if (symbol !== undefined) {\n market = this.safeMarket (symbol, market);\n }\n const orderConfiguration = this.safeDict (order, 'order_configuration', {});\n const limitGTC = this.safeDict (orderConfiguration, 'limit_limit_gtc');\n const limitGTD = this.safeDict (orderConfiguration, 'limit_limit_gtd');\n const limitIOC = this.safeDict (orderConfiguration, 'sor_limit_ioc');\n const stopLimitGTC = this.safeDict (orderConfiguration, 'stop_limit_stop_limit_gtc');\n const stopLimitGTD = this.safeDict (orderConfiguration, 'stop_limit_stop_limit_gtd');\n const marketIOC = this.safeDict (orderConfiguration, 'market_market_ioc');\n const isLimit = ((limitGTC !== undefined) || (limitGTD !== undefined) || (limitIOC !== undefined));\n const isStop = ((stopLimitGTC !== undefined) || (stopLimitGTD !== undefined));\n let price = undefined;\n let amount = undefined;\n let postOnly = undefined;\n let triggerPrice = undefined;\n if (isLimit) {\n let target = undefined;\n if (limitGTC !== undefined) {\n target = limitGTC;\n } else if (limitGTD !== undefined) {\n target = limitGTD;\n } else {\n target = limitIOC;\n }\n price = this.safeString (target, 'limit_price');\n amount = this.safeString (target, 'base_size');\n postOnly = this.safeBool (target, 'post_only');\n } else if (isStop) {\n const stopTarget = (stopLimitGTC !== undefined) ? stopLimitGTC : stopLimitGTD;\n price = this.safeString (stopTarget, 'limit_price');\n amount = this.safeString (stopTarget, 'base_size');\n postOnly = this.safeBool (stopTarget, 'post_only');\n triggerPrice = this.safeString (stopTarget, 'stop_price');\n } else {\n amount = this.safeString (marketIOC, 'base_size');\n }\n const datetime = this.safeString (order, 'created_time');\n const totalFees = this.safeString (order, 'total_fees');\n let currencyFee = undefined;\n if ((totalFees !== undefined) && (market !== undefined)) {\n currencyFee = market['quote'];\n }\n return this.safeOrder ({\n 'info': order,\n 'id': this.safeString (order, 'order_id'),\n 'clientOrderId': this.safeString (order, 'client_order_id'),\n 'timestamp': this.parse8601 (datetime),\n 'datetime': datetime,\n 'lastTradeTimestamp': undefined,\n 'symbol': symbol,\n 'type': this.parseOrderType (this.safeString (order, 'order_type')),\n 'timeInForce': this.parseTimeInForce (this.safeString (order, 'time_in_force')),\n 'postOnly': postOnly,\n 'side': this.safeStringLower (order, 'side'),\n 'price': price,\n 'triggerPrice': triggerPrice,\n 'amount': amount,\n 'filled': this.safeString (order, 'filled_size'),\n 'remaining': undefined,\n 'cost': undefined,\n 'average': this.safeString (order, 'average_filled_price'),\n 'status': this.parseOrderStatus (this.safeString (order, 'status')),\n 'fee': {\n 'cost': this.safeString (order, 'total_fees'),\n 'currency': currencyFee,\n },\n 'trades': undefined,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 3369, "line_start" => 3359, "mappings" => [], "name" => "parseOrderStatus", "signature" => "parseOrderStatus (status: Str)", "source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'OPEN': 'open',\n 'FILLED': 'closed',\n 'CANCELLED': 'canceled',\n 'EXPIRED': 'canceled',\n 'FAILED': 'canceled',\n 'UNKNOWN_ORDER_STATUS': undefined,\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 3382, "line_start" => 3371, "mappings" => [], "name" => "parseOrderType", "signature" => "parseOrderType (type: Str)", "source" => "parseOrderType (type: Str) {\n if (type === 'UNKNOWN_ORDER_TYPE') {\n return undefined;\n }\n const types: Dict = {\n 'MARKET': 'market',\n 'LIMIT': 'limit',\n 'STOP': 'limit',\n 'STOP_LIMIT': 'limit',\n };\n return this.safeString (types, type, type);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 5078, "line_start" => 5032, "mappings" => [ %{ "comment" => nil, "key" => "currency", "value" => "currencyCode" }, %{ "comment" => nil, "key" => "available_balance", "value" => "availableBalance" }, %{ "comment" => nil, "key" => "hold_amount", "value" => "holdAmount > 0 ? holdAmount : 0" }, %{ "comment" => nil, "key" => "wallet_name", "value" => "portfolioName" }, %{ "comment" => nil, "key" => "account_id", "value" => "portfolioUuid" }, %{ "comment" => nil, "key" => "account_uuid", "value" => "this.safeString (position, 'account_uuid', '')" }, %{ "comment" => nil, "key" => "total_balance_fiat", "value" => "totalBalanceFiat" }, %{ "comment" => nil, "key" => "total_balance_crypto", "value" => "this.parseNumber (this.safeString (position, 'total_balance_crypto', '0'))" }, %{ "comment" => nil, "key" => "available_to_trade_fiat", "value" => "this.parseNumber (this.safeString (position, 'available_to_trade_fiat', '0'))" }, %{ "comment" => nil, "key" => "available_to_trade_crypto", "value" => "this.parseNumber (this.safeString (position, 'available_to_trade_crypto', '0'))" }, %{ "comment" => nil, "key" => "available_to_transfer_fiat", "value" => "this.parseNumber (this.safeString (position, 'available_to_transfer_fiat', '0'))" }, %{ "comment" => nil, "key" => "available_to_transfer_crypto", "value" => "this.parseNumber (this.safeString (position, 'available_to_trade_crypto', '0'))" }, %{ "comment" => nil, "key" => "allocation", "value" => "this.parseNumber (this.safeString (position, 'allocation', '0'))" }, %{ "comment" => nil, "key" => "cost_basis", "value" => "this.parseNumber (costBasisStr)" }, %{ "comment" => nil, "key" => "cost_basis_currency", "value" => "this.safeString (costBasisDict, 'currency', 'USD')" }, %{ "comment" => nil, "key" => "is_cash", "value" => "this.safeBool (position, 'is_cash', false)" }, %{ "comment" => nil, "key" => "average_entry_price", "value" => "this.parseNumber (averageEntryPriceStr)" }, %{ "comment" => nil, "key" => "average_entry_price_currency", "value" => "this.safeString (averageEntryPriceDict, 'currency', 'USD')" }, %{ "comment" => nil, "key" => "asset_uuid", "value" => "this.safeString (position, 'asset_uuid', '')" }, %{ "comment" => nil, "key" => "unrealized_pnl", "value" => "this.parseNumber (this.safeString (position, 'unrealized_pnl', '0'))" }, %{ "comment" => nil, "key" => "asset_color", "value" => "this.safeString (position, 'asset_color', '')" }, %{ "comment" => nil, "key" => "account_type", "value" => "this.safeString (position, 'account_type', '')" } ], "name" => "parsePortfolioDetails", "signature" => "parsePortfolioDetails (portfolioData: Dict)", "source" => "parsePortfolioDetails (portfolioData: Dict) {\n const breakdown = portfolioData['breakdown'];\n const portfolioInfo = this.safeDict (breakdown, 'portfolio', {});\n const portfolioName = this.safeString (portfolioInfo, 'name', 'Unknown');\n const portfolioUuid = this.safeString (portfolioInfo, 'uuid', '');\n const spotPositions = this.safeList (breakdown, 'spot_positions', []);\n const parsedPositions = [];\n for (let i = 0; i < spotPositions.length; i++) {\n const position: Dict = spotPositions[i];\n const currencyCode = this.safeString (position, 'asset', 'Unknown');\n const availableBalanceStr = this.safeString (position, 'available_to_trade_fiat', '0');\n const availableBalance = this.parseNumber (availableBalanceStr);\n const totalBalanceFiatStr = this.safeString (position, 'total_balance_fiat', '0');\n const totalBalanceFiat = this.parseNumber (totalBalanceFiatStr);\n const holdAmount = totalBalanceFiat - availableBalance;\n const costBasisDict = this.safeDict (position, 'cost_basis', {});\n const costBasisStr = this.safeString (costBasisDict, 'value', '0');\n const averageEntryPriceDict = this.safeDict (position, 'average_entry_price', {});\n const averageEntryPriceStr = this.safeString (averageEntryPriceDict, 'value', '0');\n const positionData: Dict = {\n 'currency': currencyCode,\n 'available_balance': availableBalance,\n 'hold_amount': holdAmount > 0 ? holdAmount : 0,\n 'wallet_name': portfolioName,\n 'account_id': portfolioUuid,\n 'account_uuid': this.safeString (position, 'account_uuid', ''),\n 'total_balance_fiat': totalBalanceFiat,\n 'total_balance_crypto': this.parseNumber (this.safeString (position, 'total_balance_crypto', '0')),\n 'available_to_trade_fiat': this.parseNumber (this.safeString (position, 'available_to_trade_fiat', '0')),\n 'available_to_trade_crypto': this.parseNumber (this.safeString (position, 'available_to_trade_crypto', '0')),\n 'available_to_transfer_fiat': this.parseNumber (this.safeString (position, 'available_to_transfer_fiat', '0')),\n 'available_to_transfer_crypto': this.parseNumber (this.safeString (position, 'available_to_trade_crypto', '0')),\n 'allocation': this.parseNumber (this.safeString (position, 'allocation', '0')),\n 'cost_basis': this.parseNumber (costBasisStr),\n 'cost_basis_currency': this.safeString (costBasisDict, 'currency', 'USD'),\n 'is_cash': this.safeBool (position, 'is_cash', false),\n 'average_entry_price': this.parseNumber (averageEntryPriceStr),\n 'average_entry_price_currency': this.safeString (averageEntryPriceDict, 'currency', 'USD'),\n 'asset_uuid': this.safeString (position, 'asset_uuid', ''),\n 'unrealized_pnl': this.parseNumber (this.safeString (position, 'unrealized_pnl', '0')),\n 'asset_color': this.safeString (position, 'asset_color', ''),\n 'account_type': this.safeString (position, 'account_type', ''),\n };\n parsedPositions.push (positionData);\n }\n return parsedPositions;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"product_id\": \"1r4njf84-0-0\",\n \"product_uuid\": \"cd34c18b-3665-4ed8-9305-3db277c49fc5\",\n \"symbol\": \"ADA-PERP-INTX\",\n \"vwap\": {\n \"value\": \"0.6171\",\n \"currency\": \"USDC\"\n },\n \"position_side\": \"POSITION_SIDE_LONG\",\n \"net_size\": \"20\",\n \"buy_order_size\": \"0\",\n \"sell_order_size\": \"0\",\n \"im_contribution\": \"0.1\",\n \"unrealized_pnl\": {\n \"value\": \"0.074\",\n \"currency\": \"USDC\"\n },\n \"mark_price\": {\n \"value\": \"0.6208\",\n \"currency\": \"USDC\"\n },\n \"liquidation_price\": {\n \"value\": \"0\",\n \"currency\": \"USDC\"\n },\n \"leverage\": \"1\",\n \"im_notional\": {\n \"value\": \"12.342\",\n \"currency\": \"USDC\"\n },\n \"mm_notional\": {\n \"value\": \"0.814572\",\n \"currency\": \"USDC\"\n },\n \"position_notional\": {\n \"value\": \"12.342\",\n \"currency\": \"USDC\"\n },\n \"margin_type\": \"MARGIN_TYPE_CROSS\",\n \"liquidation_buffer\": \"19.677828\",\n \"liquidation_percentage\": \"4689.3506\",\n \"portfolio_summary\": {\n \"portfolio_uuid\": \"018ebd63-1f6d-7c8e-ada9-0761c5a2235f\",\n \"collateral\": \"20.4184\",\n \"position_notional\": \"12.342\",\n \"open_position_notional\": \"12.342\",\n \"pending_fees\": \"0\",\n \"borrow\": \"0\",\n \"accrued_interest\": \"0\",\n \"rolling_debt\": \"0\",\n \"portfolio_initial_margin\": \"0.1\",\n \"portfolio_im_notional\": {\n \"value\": \"12.342\",\n \"currency\": \"USDC\"\n },\n \"portfolio_maintenance_margin\": \"0.066\",\n \"portfolio_mm_notional\": {\n \"value\": \"0.814572\",\n \"currency\": \"USDC\"\n },\n \"liquidation_percentage\": \"4689.3506\",\n \"liquidation_buffer\": \"19.677828\",\n \"margin_type\": \"MARGIN_TYPE_CROSS\",\n \"margin_flags\": \"PORTFOLIO_MARGIN_FLAGS_UNSPECIFIED\",\n \"liquidation_status\": \"PORTFOLIO_LIQUIDATION_STATUS_NOT_LIQUIDATING\",\n \"unrealized_pnl\": {\n \"value\": \"0.074\",\n \"currency\": \"USDC\"\n },\n \"buying_power\": {\n \"value\": \"8.1504\",\n \"currency\": \"USDC\"\n },\n \"total_balance\": {\n \"value\": \"20.4924\",\n \"currency\": \"USDC\"\n },\n \"max_withdrawal\": {\n \"value\": \"8.0764\",\n \"currency\": \"USDC\"\n }\n },\n \"entry_vwap\": {\n \"value\": \"0.6091\",\n \"currency\": \"USDC\"\n }\n }" ], "line_end" => 4949, "line_start" => 4814, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "position" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (position, 'product_id')" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (marketId, market)" }, %{ "comment" => nil, "key" => "notional", "value" => "this.safeNumber (notionalObject, 'value')" }, %{ "comment" => nil, "key" => "marginMode", "value" => "marginMode" }, %{ "comment" => nil, "key" => "liquidationPrice", "value" => "liquidationPrice" }, %{ "comment" => nil, "key" => "entryPrice", "value" => "this.safeNumber (vwapObject, 'value')" }, %{ "comment" => nil, "key" => "unrealizedPnl", "value" => "this.safeNumber (unrealizedPNLObject, 'value')" }, %{ "comment" => nil, "key" => "realizedPnl", "value" => "undefined" }, %{ "comment" => nil, "key" => "percentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "contracts", "value" => "this.safeNumber (position, 'net_size')" }, %{ "comment" => nil, "key" => "contractSize", "value" => "market['contractSize']" }, %{ "comment" => nil, "key" => "markPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "lastPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "hedged", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "lastUpdateTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "maintenanceMargin", "value" => "undefined" }, %{ "comment" => nil, "key" => "maintenanceMarginPercentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "collateral", "value" => "this.safeNumber (summaryObject, 'collateral')" }, %{ "comment" => nil, "key" => "initialMargin", "value" => "undefined" }, %{ "comment" => nil, "key" => "initialMarginPercentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "leverage", "value" => "this.safeNumber (position, 'leverage')" }, %{ "comment" => nil, "key" => "marginRatio", "value" => "undefined" }, %{ "comment" => nil, "key" => "stopLossPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "takeProfitPrice", "value" => "undefined" } ], "name" => "parsePosition", "signature" => "parsePosition (position: Dict, market: Market = undefined)", "source" => "parsePosition (position: Dict, market: Market = undefined) {\n //\n // {\n // \"product_id\": \"1r4njf84-0-0\",\n // \"product_uuid\": \"cd34c18b-3665-4ed8-9305-3db277c49fc5\",\n // \"symbol\": \"ADA-PERP-INTX\",\n // \"vwap\": {\n // \"value\": \"0.6171\",\n // \"currency\": \"USDC\"\n // },\n // \"position_side\": \"POSITION_SIDE_LONG\",\n // \"net_size\": \"20\",\n // \"buy_order_size\": \"0\",\n // \"sell_order_size\": \"0\",\n // \"im_contribution\": \"0.1\",\n // \"unrealized_pnl\": {\n // \"value\": \"0.074\",\n // \"currency\": \"USDC\"\n // },\n // \"mark_price\": {\n // \"value\": \"0.6208\",\n // \"currency\": \"USDC\"\n // },\n // \"liquidation_price\": {\n // \"value\": \"0\",\n // \"currency\": \"USDC\"\n // },\n // \"leverage\": \"1\",\n // \"im_notional\": {\n // \"value\": \"12.342\",\n // \"currency\": \"USDC\"\n // },\n // \"mm_notional\": {\n // \"value\": \"0.814572\",\n // \"currency\": \"USDC\"\n // },\n // \"position_notional\": {\n // \"value\": \"12.342\",\n // \"currency\": \"USDC\"\n // },\n // \"margin_type\": \"MARGIN_TYPE_CROSS\",\n // \"liquidation_buffer\": \"19.677828\",\n // \"liquidation_percentage\": \"4689.3506\",\n // \"portfolio_summary\": {\n // \"portfolio_uuid\": \"018ebd63-1f6d-7c8e-ada9-0761c5a2235f\",\n // \"collateral\": \"20.4184\",\n // \"position_notional\": \"12.342\",\n // \"open_position_notional\": \"12.342\",\n // \"pending_fees\": \"0\",\n // \"borrow\": \"0\",\n // \"accrued_interest\": \"0\",\n // \"rolling_debt\": \"0\",\n // \"portfolio_initial_margin\": \"0.1\",\n // \"portfolio_im_notional\": {\n // \"value\": \"12.342\",\n // \"currency\": \"USDC\"\n // },\n // \"portfolio_maintenance_margin\": \"0.066\",\n // \"portfolio_mm_notional\": {\n // \"value\": \"0.814572\",\n // \"currency\": \"USDC\"\n // },\n // \"liquidation_percentage\": \"4689.3506\",\n // \"liquidation_buffer\": \"19.677828\",\n // \"margin_type\": \"MARGIN_TYPE_CROSS\",\n // \"margin_flags\": \"PORTFOLIO_MARGIN_FLAGS_UNSPECIFIED\",\n // \"liquidation_status\": \"PORTFOLIO_LIQUIDATION_STATUS_NOT_LIQUIDATING\",\n // \"unrealized_pnl\": {\n // \"value\": \"0.074\",\n // \"currency\": \"USDC\"\n // },\n // \"buying_power\": {\n // \"value\": \"8.1504\",\n // \"currency\": \"USDC\"\n // },\n // \"total_balance\": {\n // \"value\": \"20.4924\",\n // \"currency\": \"USDC\"\n // },\n // \"max_withdrawal\": {\n // \"value\": \"8.0764\",\n // \"currency\": \"USDC\"\n // }\n // },\n // \"entry_vwap\": {\n // \"value\": \"0.6091\",\n // \"currency\": \"USDC\"\n // }\n // }\n //\n const marketId = this.safeString (position, 'symbol', '');\n market = this.safeMarket (marketId, market);\n const rawMargin = this.safeString (position, 'margin_type');\n let marginMode = undefined;\n if (rawMargin !== undefined) {\n marginMode = (rawMargin === 'MARGIN_TYPE_CROSS') ? 'cross' : 'isolated';\n }\n const notionalObject = this.safeDict (position, 'position_notional', {});\n const positionSide = this.safeString (position, 'position_side');\n const side = (positionSide === 'POSITION_SIDE_LONG') ? 'long' : 'short';\n const unrealizedPNLObject = this.safeDict (position, 'unrealized_pnl', {});\n const liquidationPriceObject = this.safeDict (position, 'liquidation_price', {});\n const liquidationPrice = this.safeNumber (liquidationPriceObject, 'value');\n const vwapObject = this.safeDict (position, 'vwap', {});\n const summaryObject = this.safeDict (position, 'portfolio_summary', {});\n return this.safePosition ({\n 'info': position,\n 'id': this.safeString (position, 'product_id'),\n 'symbol': this.safeSymbol (marketId, market),\n 'notional': this.safeNumber (notionalObject, 'value'),\n 'marginMode': marginMode,\n 'liquidationPrice': liquidationPrice,\n 'entryPrice': this.safeNumber (vwapObject, 'value'),\n 'unrealizedPnl': this.safeNumber (unrealizedPNLObject, 'value'),\n 'realizedPnl': undefined,\n 'percentage': undefined,\n 'contracts': this.safeNumber (position, 'net_size'),\n 'contractSize': market['contractSize'],\n 'markPrice': undefined,\n 'lastPrice': undefined,\n 'side': side,\n 'hedged': undefined,\n 'timestamp': undefined,\n 'datetime': undefined,\n 'lastUpdateTimestamp': undefined,\n 'maintenanceMargin': undefined,\n 'maintenanceMarginPercentage': undefined,\n 'collateral': this.safeNumber (summaryObject, 'collateral'),\n 'initialMargin': undefined,\n 'initialMarginPercentage': undefined,\n 'leverage': this.safeNumber (position, 'leverage'),\n 'marginRatio': undefined,\n 'stopLossPrice': undefined,\n 'takeProfitPrice': undefined,\n });\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"product_id\": \"TONE-USD\",\n \"price\": \"0.01523\",\n \"price_percentage_change_24h\": \"1.94109772423025\",\n \"volume_24h\": \"19773129\",\n \"volume_percentage_change_24h\": \"437.0170530929949\",\n \"base_increment\": \"1\",\n \"quote_increment\": \"0.00001\",\n \"quote_min_size\": \"1\",\n \"quote_max_size\": \"10000000\",\n \"base_min_size\": \"26.7187147229469674\",\n \"base_max_size\": \"267187147.2294696735908216\",\n \"base_name\": \"TE-FOOD\",\n \"quote_name\": \"US Dollar\",\n \"watched\": false,\n \"is_disabled\": false,\n \"new\": false,\n \"status\": \"online\",\n \"cancel_only\": false,\n \"limit_only\": false,\n \"post_only\": false,\n \"trading_disabled\": false,\n \"auction_mode\": false,\n \"product_type\": \"SPOT\",\n \"quote_currency_id\": \"USD\",\n \"base_currency_id\": \"TONE\",\n \"fcm_trading_session_details\": null,\n \"mid_market_price\": \"\"\n }" ], "line_end" => 1670, "line_start" => 1575, "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" => "marketType" }, %{ "comment" => nil, "key" => "spot", "value" => "(marketType === 'spot')" }, %{ "comment" => nil, "key" => "margin", "value" => "undefined" }, %{ "comment" => nil, "key" => "swap", "value" => "false" }, %{ "comment" => nil, "key" => "future", "value" => "false" }, %{ "comment" => nil, "key" => "option", "value" => "false" }, %{ "comment" => nil, "key" => "active", "value" => "!tradingDisabled" }, %{ "comment" => nil, "key" => "contract", "value" => "false" }, %{ "comment" => nil, "key" => "linear", "value" => "undefined" }, %{ "comment" => nil, "key" => "inverse", "value" => "undefined" }, %{ "comment" => nil, "key" => "taker", "value" => "takerFee" }, %{ "comment" => nil, "key" => "maker", "value" => "makerFee" }, %{ "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.safeNumber (market, 'base_increment'),\n 'price': this.safeNumber2 (market, 'price_increment', 'quote_increment'),\n }" }, %{ "comment" => nil, "key" => "limits", "value" => "{\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.safeNumber (market, 'base_min_size'),\n 'max': this.safeNumber (market, 'base_max_size'),\n },\n 'price': {\n 'min': undefined,\n 'max': undefined,\n },\n 'cost': {\n 'min': this.safeNumber (market, 'quote_min_size'),\n 'max': this.safeNumber (market, 'quote_max_size'),\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.safeNumber (market, 'base_min_size'),\n 'max': this.safeNumber (market, 'base_max_size'),\n }" }, %{ "comment" => nil, "key" => "price", "value" => "{\n 'min': undefined,\n 'max': undefined,\n }" }, %{ "comment" => nil, "key" => "cost", "value" => "{\n 'min': this.safeNumber (market, 'quote_min_size'),\n 'max': this.safeNumber (market, 'quote_max_size'),\n }" }, %{ "comment" => nil, "key" => "min", "value" => "undefined" }, %{ "comment" => nil, "key" => "max", "value" => "undefined" } ], "name" => "parseSpotMarket", "signature" => "parseSpotMarket (market, feeTier): MarketInterface", "source" => "parseSpotMarket (market, feeTier): MarketInterface {\n //\n // {\n // \"product_id\": \"TONE-USD\",\n // \"price\": \"0.01523\",\n // \"price_percentage_change_24h\": \"1.94109772423025\",\n // \"volume_24h\": \"19773129\",\n // \"volume_percentage_change_24h\": \"437.0170530929949\",\n // \"base_increment\": \"1\",\n // \"quote_increment\": \"0.00001\",\n // \"quote_min_size\": \"1\",\n // \"quote_max_size\": \"10000000\",\n // \"base_min_size\": \"26.7187147229469674\",\n // \"base_max_size\": \"267187147.2294696735908216\",\n // \"base_name\": \"TE-FOOD\",\n // \"quote_name\": \"US Dollar\",\n // \"watched\": false,\n // \"is_disabled\": false,\n // \"new\": false,\n // \"status\": \"online\",\n // \"cancel_only\": false,\n // \"limit_only\": false,\n // \"post_only\": false,\n // \"trading_disabled\": false,\n // \"auction_mode\": false,\n // \"product_type\": \"SPOT\",\n // \"quote_currency_id\": \"USD\",\n // \"base_currency_id\": \"TONE\",\n // \"fcm_trading_session_details\": null,\n // \"mid_market_price\": \"\"\n // }\n //\n const id = this.safeString (market, 'product_id');\n const baseId = this.safeString (market, 'base_currency_id');\n const quoteId = this.safeString (market, 'quote_currency_id');\n const base = this.safeCurrencyCode (baseId);\n const quote = this.safeCurrencyCode (quoteId);\n const marketType = this.safeStringLower (market, 'product_type');\n const tradingDisabled = this.safeBool (market, 'trading_disabled');\n const stablePairs = this.safeList (this.options, 'stablePairs', []);\n const defaultTakerFee = this.safeNumber (this.fees['trading'], 'taker');\n const defaultMakerFee = this.safeNumber (this.fees['trading'], 'maker');\n const takerFee = this.inArray (id, stablePairs) ? 0.00001 : this.safeNumber (feeTier, 'taker_fee_rate', defaultTakerFee);\n const makerFee = this.inArray (id, stablePairs) ? 0.0 : this.safeNumber (feeTier, 'maker_fee_rate', defaultMakerFee);\n return this.safeMarketStructure ({\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': marketType,\n 'spot': (marketType === 'spot'),\n 'margin': undefined,\n 'swap': false,\n 'future': false,\n 'option': false,\n 'active': !tradingDisabled,\n 'contract': false,\n 'linear': undefined,\n 'inverse': undefined,\n 'taker': takerFee,\n 'maker': makerFee,\n 'contractSize': undefined,\n 'expiry': undefined,\n 'expiryDatetime': undefined,\n 'strike': undefined,\n 'optionType': undefined,\n 'precision': {\n 'amount': this.safeNumber (market, 'base_increment'),\n 'price': this.safeNumber2 (market, 'price_increment', 'quote_increment'),\n },\n 'limits': {\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.safeNumber (market, 'base_min_size'),\n 'max': this.safeNumber (market, 'base_max_size'),\n },\n 'price': {\n 'min': undefined,\n 'max': undefined,\n },\n 'cost': {\n 'min': this.safeNumber (market, 'quote_min_size'),\n 'max': this.safeNumber (market, 'quote_max_size'),\n },\n },\n 'created': undefined,\n 'info': market,\n });\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"bid\": 20713.37,\n \"ask\": 20924.65,\n \"price\": 20809.83\n }", "{\n \"trade_id\": \"10209805\",\n \"product_id\": \"BTC-USDT\",\n \"price\": \"19381.27\",\n \"size\": \"0.1\",\n \"time\": \"2023-01-13T20:35:41.865970Z\",\n \"side\": \"BUY\",\n \"bid\": \"\",\n \"ask\": \"\"\n }", "[\n {\n \"product_id\": \"ETH-USD\",\n \"price\": \"4471.59\",\n \"price_percentage_change_24h\": \"0.14243387238731\",\n \"volume_24h\": \"87329.92990204\",\n \"volume_percentage_change_24h\": \"-60.7789801794578\",\n \"base_increment\": \"0.00000001\",\n \"quote_increment\": \"0.01\",\n \"quote_min_size\": \"1\",\n \"quote_max_size\": \"150000000\",\n \"base_min_size\": \"0.00000001\",\n \"base_max_size\": \"42000\",\n \"base_name\": \"Ethereum\",\n \"quote_name\": \"US Dollar\",\n \"watched\": false,\n \"is_disabled\": false,\n \"new\": false,\n \"status\": \"online\",\n \"cancel_only\": false,\n \"limit_only\": false,\n \"post_only\": false,\n \"trading_disabled\": false,\n \"auction_mode\": false,\n \"product_type\": \"SPOT\",\n \"quote_currency_id\": \"USD\",\n \"base_currency_id\": \"ETH\",\n \"fcm_trading_session_details\": null,\n \"mid_market_price\": \"\",\n \"alias\": \"\",\n \"alias_to\": [ \"ETH-USDC\" ],\n \"base_display_symbol\": \"ETH\",\n \"quote_display_symbol\": \"USD\",\n \"view_only\": false,\n \"price_increment\": \"0.01\",\n \"display_name\": \"ETH-USD\",\n \"product_venue\": \"CBE\",\n \"approximate_quote_24h_volume\": \"390503641.25\",\n \"new_at\": \"2023-01-01T00:00:00Z\"\n },\n ...\n ]", "{\n \"product_id\": \"TRAC-EUR\",\n \"bids\": [\n {\n \"price\": \"0.2384\",\n \"size\": \"386.1\"\n }\n ],\n \"asks\": [\n {\n \"price\": \"0.2406\",\n \"size\": \"672\"\n }\n ],\n \"time\": \"2023-06-30T07:15:24.656044Z\"\n }" ], "line_end" => 2371, "line_start" => 2240, "mappings" => [ %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "timestamp", "value" => "this.parse8601 (datetime)" }, %{ "comment" => nil, "key" => "datetime", "value" => "datetime" }, %{ "comment" => nil, "key" => "bid", "value" => "bid" }, %{ "comment" => nil, "key" => "ask", "value" => "ask" }, %{ "comment" => nil, "key" => "last", "value" => "last" }, %{ "comment" => nil, "key" => "high", "value" => "undefined" }, %{ "comment" => nil, "key" => "low", "value" => "undefined" }, %{ "comment" => nil, "key" => "bidVolume", "value" => "bidVolume" }, %{ "comment" => nil, "key" => "askVolume", "value" => "askVolume" }, %{ "comment" => nil, "key" => "vwap", "value" => "undefined" }, %{ "comment" => nil, "key" => "open", "value" => "undefined" }, %{ "comment" => nil, "key" => "close", "value" => "last" }, %{ "comment" => nil, "key" => "previousClose", "value" => "undefined" }, %{ "comment" => nil, "key" => "change", "value" => "undefined" }, %{ "comment" => nil, "key" => "percentage", "value" => "this.safeNumber (ticker, 'price_percentage_change_24h')" }, %{ "comment" => nil, "key" => "average", "value" => "undefined" }, %{ "comment" => nil, "key" => "baseVolume", "value" => "this.safeNumber (ticker, 'volume_24h')" }, %{ "comment" => nil, "key" => "quoteVolume", "value" => "this.safeNumber (ticker, 'approximate_quote_24h_volume')" }, %{ "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 // fetchTickerV2\n //\n // {\n // \"bid\": 20713.37,\n // \"ask\": 20924.65,\n // \"price\": 20809.83\n // }\n //\n // fetchTickerV3\n //\n // {\n // \"trade_id\": \"10209805\",\n // \"product_id\": \"BTC-USDT\",\n // \"price\": \"19381.27\",\n // \"size\": \"0.1\",\n // \"time\": \"2023-01-13T20:35:41.865970Z\",\n // \"side\": \"BUY\",\n // \"bid\": \"\",\n // \"ask\": \"\"\n // }\n //\n // fetchTickersV2\n //\n // \"48691.23\"\n //\n // fetchTickersV3\n //\n // [\n // {\n // \"product_id\": \"ETH-USD\",\n // \"price\": \"4471.59\",\n // \"price_percentage_change_24h\": \"0.14243387238731\",\n // \"volume_24h\": \"87329.92990204\",\n // \"volume_percentage_change_24h\": \"-60.7789801794578\",\n // \"base_increment\": \"0.00000001\",\n // \"quote_increment\": \"0.01\",\n // \"quote_min_size\": \"1\",\n // \"quote_max_size\": \"150000000\",\n // \"base_min_size\": \"0.00000001\",\n // \"base_max_size\": \"42000\",\n // \"base_name\": \"Ethereum\",\n // \"quote_name\": \"US Dollar\",\n // \"watched\": false,\n // \"is_disabled\": false,\n // \"new\": false,\n // \"status\": \"online\",\n // \"cancel_only\": false,\n // \"limit_only\": false,\n // \"post_only\": false,\n // \"trading_disabled\": false,\n // \"auction_mode\": false,\n // \"product_type\": \"SPOT\",\n // \"quote_currency_id\": \"USD\",\n // \"base_currency_id\": \"ETH\",\n // \"fcm_trading_session_details\": null,\n // \"mid_market_price\": \"\",\n // \"alias\": \"\",\n // \"alias_to\": [ \"ETH-USDC\" ],\n // \"base_display_symbol\": \"ETH\",\n // \"quote_display_symbol\": \"USD\",\n // \"view_only\": false,\n // \"price_increment\": \"0.01\",\n // \"display_name\": \"ETH-USD\",\n // \"product_venue\": \"CBE\",\n // \"approximate_quote_24h_volume\": \"390503641.25\",\n // \"new_at\": \"2023-01-01T00:00:00Z\"\n // },\n // ...\n // ]\n //\n // fetchBidsAsks\n //\n // {\n // \"product_id\": \"TRAC-EUR\",\n // \"bids\": [\n // {\n // \"price\": \"0.2384\",\n // \"size\": \"386.1\"\n // }\n // ],\n // \"asks\": [\n // {\n // \"price\": \"0.2406\",\n // \"size\": \"672\"\n // }\n // ],\n // \"time\": \"2023-06-30T07:15:24.656044Z\"\n // }\n //\n let bid = this.safeNumber (ticker, 'bid');\n let ask = this.safeNumber (ticker, 'ask');\n let bidVolume = undefined;\n let askVolume = undefined;\n if (('bids' in ticker)) {\n const bids = this.safeList (ticker, 'bids', []);\n const asks = this.safeList (ticker, 'asks', []);\n const firstBid = this.safeDict (bids, 0, {});\n const firstAsk = this.safeDict (asks, 0, {});\n bid = this.safeNumber (firstBid, 'price');\n bidVolume = this.safeNumber (firstBid, 'size');\n ask = this.safeNumber (firstAsk, 'price');\n askVolume = this.safeNumber (firstAsk, 'size');\n }\n const marketId = this.safeString (ticker, 'product_id');\n market = this.safeMarket (marketId, market);\n const last = this.safeNumber (ticker, 'price');\n const datetime = this.safeString (ticker, 'time');\n return this.safeTicker ({\n 'symbol': market['symbol'],\n 'timestamp': this.parse8601 (datetime),\n 'datetime': datetime,\n 'bid': bid,\n 'ask': ask,\n 'last': last,\n 'high': undefined,\n 'low': undefined,\n 'bidVolume': bidVolume,\n 'askVolume': askVolume,\n 'vwap': undefined,\n 'open': undefined,\n 'close': last,\n 'previousClose': undefined,\n 'change': undefined,\n 'percentage': this.safeNumber (ticker, 'price_percentage_change_24h'),\n 'average': undefined,\n 'baseVolume': this.safeNumber (ticker, 'volume_24h'),\n 'quoteVolume': this.safeNumber (ticker, 'approximate_quote_24h_volume'),\n 'info': ticker,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 3393, "line_start" => 3384, "mappings" => [], "name" => "parseTimeInForce", "signature" => "parseTimeInForce (timeInForce: Str)", "source" => "parseTimeInForce (timeInForce: Str) {\n const timeInForces: Dict = {\n 'GOOD_UNTIL_CANCELLED': 'GTC',\n 'GOOD_UNTIL_DATE_TIME': 'GTD',\n 'IMMEDIATE_OR_CANCEL': 'IOC',\n 'FILL_OR_KILL': 'FOK',\n 'UNKNOWN_TIME_IN_FORCE': undefined,\n };\n return this.safeString (timeInForces, timeInForce, timeInForce);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"id\": \"67e0eaec-07d7-54c4-a72c-2e92826897df\",\n \"status\": \"completed\",\n \"payment_method\": {\n \"id\": \"83562370-3e5c-51db-87da-752af5ab9559\",\n \"resource\": \"payment_method\",\n \"resource_path\": \"/v2/payment-methods/83562370-3e5c-51db-87da-752af5ab9559\"\n },\n \"transaction\": {\n \"id\": \"441b9494-b3f0-5b98-b9b0-4d82c21c252a\",\n \"resource\": \"transaction\",\n \"resource_path\": \"/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/transactions/441b9494-b3f0-5b98-b9b0-4d82c21c252a\"\n },\n \"amount\": { \"amount\": \"1.00000000\", \"currency\": \"BTC\" },\n \"total\": { \"amount\": \"10.25\", \"currency\": \"USD\" },\n \"subtotal\": { \"amount\": \"10.10\", \"currency\": \"USD\" },\n \"created_at\": \"2015-01-31T20:49:02Z\",\n \"updated_at\": \"2015-02-11T16:54:02-08:00\",\n \"resource\": \"buy\",\n \"resource_path\": \"/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/buys/67e0eaec-07d7-54c4-a72c-2e92826897df\",\n \"committed\": true,\n \"instant\": false,\n \"fee\": { \"amount\": \"0.15\", \"currency\": \"USD\" },\n \"payout_at\": \"2015-02-18T16:54:00-08:00\"\n }", "{\n \"trade_id\": \"10092327\",\n \"product_id\": \"BTC-USDT\",\n \"price\": \"17488.12\",\n \"size\": \"0.0000623\",\n \"time\": \"2023-01-11T00:52:37.557001Z\",\n \"side\": \"BUY\",\n \"bid\": \"\",\n \"ask\": \"\"\n }", "{\n \"entry_id\": \"b88b82cc89e326a2778874795102cbafd08dd979a2a7a3c69603fc4c23c2e010\",\n \"trade_id\": \"cdc39e45-bbd3-44ec-bf02-61742dfb16a1\",\n \"order_id\": \"813a53c5-3e39-47bb-863d-2faf685d22d8\",\n \"trade_time\": \"2023-01-18T01:37:38.091377090Z\",\n \"trade_type\": \"FILL\",\n \"price\": \"21220.64\",\n \"size\": \"0.0046830664333996\",\n \"commission\": \"0.0000280983986004\",\n \"product_id\": \"BTC-USDT\",\n \"sequence_timestamp\": \"2023-01-18T01:37:38.092520Z\",\n \"liquidity_indicator\": \"UNKNOWN_LIQUIDITY_INDICATOR\",\n \"size_in_quote\": true,\n \"user_id\": \"1111111-1111-1111-1111-111111111111\",\n \"side\": \"BUY\"\n }" ], "line_end" => 1325, "line_start" => 1195, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "trade" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString2 (trade, 'id', 'trade_id')" }, %{ "comment" => nil, "key" => "order", "value" => "this.safeString (trade, 'order_id')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "this.parse8601 (datetime)" }, %{ "comment" => nil, "key" => "datetime", "value" => "datetime" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "type", "value" => "undefined" }, %{ "comment" => nil, "key" => "side", "value" => "(side === 'unknown_order_side') ? undefined : side" }, %{ "comment" => nil, "key" => "takerOrMaker", "value" => "(takerOrMaker === 'unknown_liquidity_indicator') ? undefined : takerOrMaker" }, %{ "comment" => nil, "key" => "price", "value" => "priceString" }, %{ "comment" => nil, "key" => "amount", "value" => "amountString" }, %{ "comment" => nil, "key" => "cost", "value" => "cost" }, %{ "comment" => nil, "key" => "fee", "value" => "{\n 'cost': feeCost,\n 'currency': this.safeCurrencyCode (feeCurrencyId),\n }" }, %{ "comment" => nil, "key" => "cost", "value" => "feeCost" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (feeCurrencyId)" } ], "name" => "parseTrade", "signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade", "source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // fetchMyBuys, fetchMySells\n //\n // {\n // \"id\": \"67e0eaec-07d7-54c4-a72c-2e92826897df\",\n // \"status\": \"completed\",\n // \"payment_method\": {\n // \"id\": \"83562370-3e5c-51db-87da-752af5ab9559\",\n // \"resource\": \"payment_method\",\n // \"resource_path\": \"/v2/payment-methods/83562370-3e5c-51db-87da-752af5ab9559\"\n // },\n // \"transaction\": {\n // \"id\": \"441b9494-b3f0-5b98-b9b0-4d82c21c252a\",\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/transactions/441b9494-b3f0-5b98-b9b0-4d82c21c252a\"\n // },\n // \"amount\": { \"amount\": \"1.00000000\", \"currency\": \"BTC\" },\n // \"total\": { \"amount\": \"10.25\", \"currency\": \"USD\" },\n // \"subtotal\": { \"amount\": \"10.10\", \"currency\": \"USD\" },\n // \"created_at\": \"2015-01-31T20:49:02Z\",\n // \"updated_at\": \"2015-02-11T16:54:02-08:00\",\n // \"resource\": \"buy\",\n // \"resource_path\": \"/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/buys/67e0eaec-07d7-54c4-a72c-2e92826897df\",\n // \"committed\": true,\n // \"instant\": false,\n // \"fee\": { \"amount\": \"0.15\", \"currency\": \"USD\" },\n // \"payout_at\": \"2015-02-18T16:54:00-08:00\"\n // }\n //\n // fetchTrades\n //\n // {\n // \"trade_id\": \"10092327\",\n // \"product_id\": \"BTC-USDT\",\n // \"price\": \"17488.12\",\n // \"size\": \"0.0000623\",\n // \"time\": \"2023-01-11T00:52:37.557001Z\",\n // \"side\": \"BUY\",\n // \"bid\": \"\",\n // \"ask\": \"\"\n // }\n //\n // fetchMyTrades\n //\n // {\n // \"entry_id\": \"b88b82cc89e326a2778874795102cbafd08dd979a2a7a3c69603fc4c23c2e010\",\n // \"trade_id\": \"cdc39e45-bbd3-44ec-bf02-61742dfb16a1\",\n // \"order_id\": \"813a53c5-3e39-47bb-863d-2faf685d22d8\",\n // \"trade_time\": \"2023-01-18T01:37:38.091377090Z\",\n // \"trade_type\": \"FILL\",\n // \"price\": \"21220.64\",\n // \"size\": \"0.0046830664333996\",\n // \"commission\": \"0.0000280983986004\",\n // \"product_id\": \"BTC-USDT\",\n // \"sequence_timestamp\": \"2023-01-18T01:37:38.092520Z\",\n // \"liquidity_indicator\": \"UNKNOWN_LIQUIDITY_INDICATOR\",\n // \"size_in_quote\": true,\n // \"user_id\": \"1111111-1111-1111-1111-111111111111\",\n // \"side\": \"BUY\"\n // }\n //\n let symbol = undefined;\n const totalObject = this.safeDict (trade, 'total', {});\n const amountObject = this.safeDict (trade, 'amount', {});\n const subtotalObject = this.safeDict (trade, 'subtotal', {});\n const feeObject = this.safeDict (trade, 'fee', {});\n const marketId = this.safeString (trade, 'product_id');\n market = this.safeMarket (marketId, market, '-');\n if (market !== undefined) {\n symbol = market['symbol'];\n } else {\n const baseId = this.safeString (amountObject, 'currency');\n const quoteId = this.safeString (totalObject, 'currency');\n if ((baseId !== undefined) && (quoteId !== undefined)) {\n const base = this.safeCurrencyCode (baseId);\n const quote = this.safeCurrencyCode (quoteId);\n symbol = base + '/' + quote;\n }\n }\n const sizeInQuote = this.safeBool (trade, 'size_in_quote');\n const v3Price = this.safeString (trade, 'price');\n let v3Cost = undefined;\n let v3Amount = this.safeString (trade, 'size');\n if (sizeInQuote) {\n // calculate base size\n v3Cost = v3Amount;\n v3Amount = Precise.stringDiv (v3Amount, v3Price);\n }\n const v3FeeCost = this.safeString (trade, 'commission');\n const amountString = this.safeString (amountObject, 'amount', v3Amount);\n const costString = this.safeString (subtotalObject, 'amount', v3Cost);\n let priceString = undefined;\n let cost = undefined;\n if ((costString !== undefined) && (amountString !== undefined)) {\n priceString = Precise.stringDiv (costString, amountString);\n } else {\n priceString = v3Price;\n }\n if ((priceString !== undefined) && (amountString !== undefined)) {\n cost = Precise.stringMul (priceString, amountString);\n } else {\n cost = costString;\n }\n let feeCurrencyId = this.safeString (feeObject, 'currency');\n const feeCost = this.safeNumber (feeObject, 'amount', this.parseNumber (v3FeeCost));\n if ((feeCurrencyId === undefined) && (market !== undefined) && (feeCost !== undefined)) {\n feeCurrencyId = market['quote'];\n }\n const datetime = this.safeStringN (trade, [ 'created_at', 'trade_time', 'time' ]);\n const side = this.safeStringLower2 (trade, 'resource', 'side');\n const takerOrMaker = this.safeStringLower (trade, 'liquidity_indicator');\n return this.safeTrade ({\n 'info': trade,\n 'id': this.safeString2 (trade, 'id', 'trade_id'),\n 'order': this.safeString (trade, 'order_id'),\n 'timestamp': this.parse8601 (datetime),\n 'datetime': datetime,\n 'symbol': symbol,\n 'type': undefined,\n 'side': (side === 'unknown_order_side') ? undefined : side,\n 'takerOrMaker': (takerOrMaker === 'unknown_liquidity_indicator') ? undefined : takerOrMaker,\n 'price': priceString,\n 'amount': amountString,\n 'cost': cost,\n 'fee': {\n 'cost': feeCost,\n 'currency': this.safeCurrencyCode (feeCurrencyId),\n },\n });\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"id\": \"f34c19f3-b730-5e3d-9f72\",\n \"status\": \"completed\",\n \"payment_method\": {\n \"id\": \"a022b31d-f9c7-5043-98f2\",\n \"resource\": \"payment_method\",\n \"resource_path\": \"/v2/payment-methods/a022b31d-f9c7-5043-98f2\"\n },\n \"transaction\": {\n \"id\": \"04ed4113-3732-5b0c-af86-b1d2146977d0\",\n \"resource\": \"transaction\",\n \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/04ed4113-3732-5b0c-af86\"\n },\n \"user_reference\": \"2VTYTH\",\n \"created_at\": \"2017-02-09T07:01:18Z\",\n \"updated_at\": \"2017-02-09T07:01:26Z\",\n \"resource\": \"deposit\",\n \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/deposits/f34c19f3-b730-5e3d-9f72\",\n \"committed\": true,\n \"payout_at\": \"2017-02-12T07:01:17Z\",\n \"instant\": false,\n \"fee\": { \"amount\": \"0.00\", \"currency\": \"EUR\" },\n \"amount\": { \"amount\": \"114.02\", \"currency\": \"EUR\" },\n \"subtotal\": { \"amount\": \"114.02\", \"currency\": \"EUR\" },\n \"hold_until\": null,\n \"hold_days\": 0,\n \"hold_business_days\": 0,\n \"next_step\": null\n }", "{\n \"id\": \"cfcc3b4a-eeb6-5e8c-8058\",\n \"status\": \"completed\",\n \"payment_method\": {\n \"id\": \"8b94cfa4-f7fd-5a12-a76a\",\n \"resource\": \"payment_method\",\n \"resource_path\": \"/v2/payment-methods/8b94cfa4-f7fd-5a12-a76a\"\n },\n \"transaction\": {\n \"id\": \"fcc2550b-5104-5f83-a444\",\n \"resource\": \"transaction\",\n \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/fcc2550b-5104-5f83-a444\"\n },\n \"user_reference\": \"MEUGK\",\n \"created_at\": \"2018-07-26T08:55:12Z\",\n \"updated_at\": \"2018-07-26T08:58:18Z\",\n \"resource\": \"withdrawal\",\n \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/withdrawals/cfcc3b4a-eeb6-5e8c-8058\",\n \"committed\": true,\n \"payout_at\": \"2018-07-31T08:55:12Z\",\n \"instant\": false,\n \"fee\": { \"amount\": \"0.15\", \"currency\": \"EUR\" },\n \"amount\": { \"amount\": \"13130.69\", \"currency\": \"EUR\" },\n \"subtotal\": { \"amount\": \"13130.84\", \"currency\": \"EUR\" },\n \"idem\": \"e549dee5-63ed-4e79-8a96\",\n \"next_step\": null\n }", "{\n \"id\": \"a1794ecf-5693-55fa-70cf-ef731748ed82\",\n \"type\": \"send\",\n \"status\": \"pending\",\n \"amount\": {\n \"amount\": \"-14.008308\",\n \"currency\": \"USDC\"\n },\n \"native_amount\": {\n \"amount\": \"-18.74\",\n \"currency\": \"CAD\"\n },\n \"description\": null,\n \"created_at\": \"2024-01-12T01:27:31Z\",\n \"updated_at\": \"2024-01-12T01:27:31Z\",\n \"resource\": \"transaction\",\n \"resource_path\": \"/v2/accounts/a34bgfad-ed67-538b-bffc-730c98c10da0/transactions/a1794ecf-5693-55fa-70cf-ef731748ed82\",\n \"instant_exchange\": false,\n \"network\": {\n \"status\": \"pending\",\n \"status_description\": \"Pending (est. less than 10 minutes)\",\n \"transaction_fee\": {\n \"amount\": \"4.008308\",\n \"currency\": \"USDC\"\n },\n \"transaction_amount\": {\n \"amount\": \"10.000000\",\n \"currency\": \"USDC\"\n },\n \"confirmations\": 0\n },\n \"to\": {\n \"resource\": \"ethereum_address\",\n \"address\": \"0x9...\",\n \"currency\": \"USDC\",\n \"address_info\": {\n \"address\": \"0x9...\"\n }\n },\n \"idem\": \"748d8591-dg9a-7831-a45b-crd61dg78762\",\n \"details\": {\n \"title\": \"Sent USDC\",\n \"subtitle\": \"To USDC address on Ethereum network\",\n \"header\": \"Sent 14.008308 USDC ($18.74)\",\n \"health\": \"warning\"\n },\n \"hide_native_amount\": false\n }", "{\n \"amount\": {\n \"amount\": \"0.00014200\", (negative for withdrawal)\n \"currency\": \"BTC\"\n },\n \"created_at\": \"2024-03-29T15:48:30Z\",\n \"id\": \"0031a605-241d-514d-a97b-d4b99f3225d3\",\n \"idem\": \"092a979b-017e-4403-940a-2ca57811f442\", // field present only in case of withdrawal\n \"native_amount\": {\n \"amount\": \"9.85\", (negative for withdrawal)\n \"currency\": \"USD\"\n },\n \"network\": {\n \"status\": \"pending\", // if status is `off_blockchain` then no more other fields are present in this object\n \"hash\": \"5jYuvrNsvX2DZoMnzGYzVpYxJLfYu4GSK3xetG1H5LHrSovsuFCFYdFMwNRoiht3s6fBk92MM8QLLnz65xuEFTrE\",\n \"network_name\": \"solana\",\n \"transaction_fee\": {\n \"amount\": \"0.000100000\",\n \"currency\": \"SOL\"\n }\n },\n \"resource\": \"transaction\",\n \"resource_path\": \"/v2/accounts/dc504b1c-248e-5b68-a3b0-b991f7fa84e6/transactions/0031a605-241d-514d-a97b-d4b99f3225d3\",\n \"status\": \"completed\",\n \"type\": \"send\",\n \"from\": { // in some cases, field might be present for deposit\n \"id\": \"7fd10cd7-b091-5cee-ba41-c29e49a7cccf\",\n \"name\": \"Coinbase\",\n \"resource\": \"user\"\n },\n \"to\": { // field only present for withdrawal\n \"address\": \"5HA12BNthAvBwNYARYf9y5MqqCpB4qhCNFCs1Qw48ACE\",\n \"resource\": \"address\"\n },\n \"description\": \"C3 - One Time BTC Credit . Reference Case # 123.\", // in some cases, field might be present for deposit\n }" ], "line_end" => 1193, "line_start" => 979, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "transaction" }, %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "txid", "value" => "this.safeString (network, 'hash', id)" }, %{ "comment" => nil, "key" => "timestamp", "value" => "this.parse8601 (datetime)" }, %{ "comment" => nil, "key" => "datetime", "value" => "datetime" }, %{ "comment" => nil, "key" => "network", "value" => "this.networkIdToCode (networkId)" }, %{ "comment" => nil, "key" => "address", "value" => "addressTo" }, %{ "comment" => nil, "key" => "addressTo", "value" => "addressTo" }, %{ "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" => "type", "value" => "type" }, %{ "comment" => nil, "key" => "amount", "value" => "this.parseNumber (amountStringAbs)" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (currencyId, currency)" }, %{ "comment" => nil, "key" => "status", "value" => "status" }, %{ "comment" => nil, "key" => "updated", "value" => "this.parse8601 (this.safeString (transaction, 'updated_at'))" }, %{ "comment" => nil, "key" => "fee", "value" => "{\n 'cost': this.safeNumber (feeObject, 'amount'),\n 'currency': this.safeCurrencyCode (feeCurrencyId),\n }" }, %{ "comment" => nil, "key" => "cost", "value" => "this.safeNumber (feeObject, 'amount')" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (feeCurrencyId)" } ], "name" => "parseTransaction", "signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction", "source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // fiat deposit\n //\n // {\n // \"id\": \"f34c19f3-b730-5e3d-9f72\",\n // \"status\": \"completed\",\n // \"payment_method\": {\n // \"id\": \"a022b31d-f9c7-5043-98f2\",\n // \"resource\": \"payment_method\",\n // \"resource_path\": \"/v2/payment-methods/a022b31d-f9c7-5043-98f2\"\n // },\n // \"transaction\": {\n // \"id\": \"04ed4113-3732-5b0c-af86-b1d2146977d0\",\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/04ed4113-3732-5b0c-af86\"\n // },\n // \"user_reference\": \"2VTYTH\",\n // \"created_at\": \"2017-02-09T07:01:18Z\",\n // \"updated_at\": \"2017-02-09T07:01:26Z\",\n // \"resource\": \"deposit\",\n // \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/deposits/f34c19f3-b730-5e3d-9f72\",\n // \"committed\": true,\n // \"payout_at\": \"2017-02-12T07:01:17Z\",\n // \"instant\": false,\n // \"fee\": { \"amount\": \"0.00\", \"currency\": \"EUR\" },\n // \"amount\": { \"amount\": \"114.02\", \"currency\": \"EUR\" },\n // \"subtotal\": { \"amount\": \"114.02\", \"currency\": \"EUR\" },\n // \"hold_until\": null,\n // \"hold_days\": 0,\n // \"hold_business_days\": 0,\n // \"next_step\": null\n // }\n //\n // fiat_withdrawal\n //\n // {\n // \"id\": \"cfcc3b4a-eeb6-5e8c-8058\",\n // \"status\": \"completed\",\n // \"payment_method\": {\n // \"id\": \"8b94cfa4-f7fd-5a12-a76a\",\n // \"resource\": \"payment_method\",\n // \"resource_path\": \"/v2/payment-methods/8b94cfa4-f7fd-5a12-a76a\"\n // },\n // \"transaction\": {\n // \"id\": \"fcc2550b-5104-5f83-a444\",\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/fcc2550b-5104-5f83-a444\"\n // },\n // \"user_reference\": \"MEUGK\",\n // \"created_at\": \"2018-07-26T08:55:12Z\",\n // \"updated_at\": \"2018-07-26T08:58:18Z\",\n // \"resource\": \"withdrawal\",\n // \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/withdrawals/cfcc3b4a-eeb6-5e8c-8058\",\n // \"committed\": true,\n // \"payout_at\": \"2018-07-31T08:55:12Z\",\n // \"instant\": false,\n // \"fee\": { \"amount\": \"0.15\", \"currency\": \"EUR\" },\n // \"amount\": { \"amount\": \"13130.69\", \"currency\": \"EUR\" },\n // \"subtotal\": { \"amount\": \"13130.84\", \"currency\": \"EUR\" },\n // \"idem\": \"e549dee5-63ed-4e79-8a96\",\n // \"next_step\": null\n // }\n //\n // withdraw\n //\n // {\n // \"id\": \"a1794ecf-5693-55fa-70cf-ef731748ed82\",\n // \"type\": \"send\",\n // \"status\": \"pending\",\n // \"amount\": {\n // \"amount\": \"-14.008308\",\n // \"currency\": \"USDC\"\n // },\n // \"native_amount\": {\n // \"amount\": \"-18.74\",\n // \"currency\": \"CAD\"\n // },\n // \"description\": null,\n // \"created_at\": \"2024-01-12T01:27:31Z\",\n // \"updated_at\": \"2024-01-12T01:27:31Z\",\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/a34bgfad-ed67-538b-bffc-730c98c10da0/transactions/a1794ecf-5693-55fa-70cf-ef731748ed82\",\n // \"instant_exchange\": false,\n // \"network\": {\n // \"status\": \"pending\",\n // \"status_description\": \"Pending (est. less than 10 minutes)\",\n // \"transaction_fee\": {\n // \"amount\": \"4.008308\",\n // \"currency\": \"USDC\"\n // },\n // \"transaction_amount\": {\n // \"amount\": \"10.000000\",\n // \"currency\": \"USDC\"\n // },\n // \"confirmations\": 0\n // },\n // \"to\": {\n // \"resource\": \"ethereum_address\",\n // \"address\": \"0x9...\",\n // \"currency\": \"USDC\",\n // \"address_info\": {\n // \"address\": \"0x9...\"\n // }\n // },\n // \"idem\": \"748d8591-dg9a-7831-a45b-crd61dg78762\",\n // \"details\": {\n // \"title\": \"Sent USDC\",\n // \"subtitle\": \"To USDC address on Ethereum network\",\n // \"header\": \"Sent 14.008308 USDC ($18.74)\",\n // \"health\": \"warning\"\n // },\n // \"hide_native_amount\": false\n // }\n //\n //\n // crypto deposit & withdrawal (using `/transactions` endpoint)\n // {\n // \"amount\": {\n // \"amount\": \"0.00014200\", (negative for withdrawal)\n // \"currency\": \"BTC\"\n // },\n // \"created_at\": \"2024-03-29T15:48:30Z\",\n // \"id\": \"0031a605-241d-514d-a97b-d4b99f3225d3\",\n // \"idem\": \"092a979b-017e-4403-940a-2ca57811f442\", // field present only in case of withdrawal\n // \"native_amount\": {\n // \"amount\": \"9.85\", (negative for withdrawal)\n // \"currency\": \"USD\"\n // },\n // \"network\": {\n // \"status\": \"pending\", // if status is `off_blockchain` then no more other fields are present in this object\n // \"hash\": \"5jYuvrNsvX2DZoMnzGYzVpYxJLfYu4GSK3xetG1H5LHrSovsuFCFYdFMwNRoiht3s6fBk92MM8QLLnz65xuEFTrE\",\n // \"network_name\": \"solana\",\n // \"transaction_fee\": {\n // \"amount\": \"0.000100000\",\n // \"currency\": \"SOL\"\n // }\n // },\n // \"resource\": \"transaction\",\n // \"resource_path\": \"/v2/accounts/dc504b1c-248e-5b68-a3b0-b991f7fa84e6/transactions/0031a605-241d-514d-a97b-d4b99f3225d3\",\n // \"status\": \"completed\",\n // \"type\": \"send\",\n // \"from\": { // in some cases, field might be present for deposit\n // \"id\": \"7fd10cd7-b091-5cee-ba41-c29e49a7cccf\",\n // \"name\": \"Coinbase\",\n // \"resource\": \"user\"\n // },\n // \"to\": { // field only present for withdrawal\n // \"address\": \"5HA12BNthAvBwNYARYf9y5MqqCpB4qhCNFCs1Qw48ACE\",\n // \"resource\": \"address\"\n // },\n // \"description\": \"C3 - One Time BTC Credit . Reference Case # 123.\", // in some cases, field might be present for deposit\n // }\n //\n const transactionType = this.safeString (transaction, 'type');\n let amountAndCurrencyObject = undefined;\n let feeObject = undefined;\n const network = this.safeDict (transaction, 'network', {});\n if (transactionType === 'send') {\n amountAndCurrencyObject = this.safeDict (network, 'transaction_amount');\n feeObject = this.safeDict (network, 'transaction_fee', {});\n } else {\n amountAndCurrencyObject = this.safeDict (transaction, 'subtotal');\n feeObject = this.safeDict (transaction, 'fee', {});\n }\n if (amountAndCurrencyObject === undefined) {\n amountAndCurrencyObject = this.safeDict (transaction, 'amount');\n }\n const amountString = this.safeString (amountAndCurrencyObject, 'amount');\n const amountStringAbs = Precise.stringAbs (amountString);\n let status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n if (status === undefined) {\n const committed = this.safeBool (transaction, 'committed');\n status = committed ? 'ok' : 'pending';\n }\n const id = this.safeString (transaction, 'id');\n const currencyId = this.safeString (amountAndCurrencyObject, 'currency');\n const feeCurrencyId = this.safeString (feeObject, 'currency');\n const datetime = this.safeString (transaction, 'created_at');\n const resource = this.safeString (transaction, 'resource');\n let type = resource;\n if (!this.inArray (type, [ 'deposit', 'withdrawal' ])) {\n if (Precise.stringGt (amountString, '0')) {\n type = 'deposit';\n } else if (Precise.stringLt (amountString, '0')) {\n type = 'withdrawal';\n }\n }\n const toObject = this.safeDict (transaction, 'to');\n const addressTo = this.safeString (toObject, 'address');\n const networkId = this.safeString (network, 'network_name');\n return {\n 'info': transaction,\n 'id': id,\n 'txid': this.safeString (network, 'hash', id),\n 'timestamp': this.parse8601 (datetime),\n 'datetime': datetime,\n 'network': this.networkIdToCode (networkId),\n 'address': addressTo,\n 'addressTo': addressTo,\n 'addressFrom': undefined,\n 'tag': undefined,\n 'tagTo': undefined,\n 'tagFrom': undefined,\n 'type': type,\n 'amount': this.parseNumber (amountStringAbs),\n 'currency': this.safeCurrencyCode (currencyId, currency),\n 'status': status,\n 'updated': this.parse8601 (this.safeString (transaction, 'updated_at')),\n 'fee': {\n 'cost': this.safeNumber (feeObject, 'amount'),\n 'currency': this.safeCurrencyCode (feeCurrencyId),\n },\n } as Transaction;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 977, "line_start" => 970, "mappings" => [], "name" => "parseTransactionStatus", "signature" => "parseTransactionStatus (status: Str)", "source" => "parseTransactionStatus (status: Str) {\n const statuses: Dict = {\n 'created': 'pending',\n 'completed': 'ok',\n 'canceled': 'canceled',\n };\n return this.safeString (statuses, status, status);\n }" } ], path_prefix: "/api/v3/", pro: true, quote_json_numbers: nil, rate_limits: %{ interval_ms: 34, period: 1000, requests: 29, 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: "error", field: "error", message_field: "error_description", success_values: nil, type: :error_present }, signing: %{ api_key_header: "CB-ACCESS-KEY", confidence: :high, passphrase_header: "CB-ACCESS-PASSPHRASE", pattern: :hmac_sha256_headers, signature_header: "CB-ACCESS-SIGN", timestamp_header: "CB-ACCESS-TIMESTAMP" }, spec_format_version: 1, status: %{ "eta" => nil, "status" => "ok", "updated" => nil, "url" => nil }, symbol_format: nil, symbol_formats: %{ future: %{ base: "BTC", base_id: "BTC", case: :upper, contract: true, contract_size: 0.01, expiry: 1924012800000, expiry_datetime: "2030-12-20T16:00:00.000Z", id: "BIP-20DEC30-CDE", inverse: false, limits: %{ "amount" => %{ "max" => 5000, "min" => 1 }, "cost" => %{ "max" => 100000000, "min" => 0 }, "leverage" => %{}, "price" => %{} }, linear: true, maker: 0.04, precision: %{ "amount" => 1, "price" => 5 }, quote: "USD", quote_id: "USD", separator: "-", settle: "USD", settle_id: "USD", symbol: "BTC/USD:USD-301220", taker: 0.06 }, precision_mode: 4, sample_limits: %{ "amount" => %{ "max" => 3400, "min" => 1.0e-8 }, "cost" => %{ "max" => 150000000, "min" => 1 }, "price" => %{} }, sample_precision: %{ "amount" => 1.0e-8, "price" => 0.01 }, spot: %{ base: "BTC", base_id: "BTC", case: :upper, contract: false, id: "BTC-USD", limits: %{ "amount" => %{ "max" => 3400, "min" => 1.0e-8 }, "cost" => %{ "max" => 150000000, "min" => 1 }, "leverage" => %{}, "price" => %{} }, maker: 0.006, precision: %{ "amount" => 1.0e-8, "price" => 0.01 }, quote: "USD", quote_id: "USD", separator: "-", symbol: "BTC/USD", taker: 0.012 }, swap: %{ base: "BTC", base_id: "BTC", case: :upper, contract: true, contract_size: 1, id: "BTC-PERP-INTX", inverse: false, limits: %{ "amount" => %{ "max" => 1000000000000000000, "min" => 0.0001 }, "cost" => %{ "max" => 50000000, "min" => 10 }, "leverage" => %{}, "price" => %{} }, linear: true, maker: 0.04, precision: %{ "amount" => 0.0001, "price" => 0.1 }, quote: "USDC", quote_id: "USDC", separator: "-", settle: "USDC", settle_id: "USDC", symbol: "BTC/USDC:USDC", taker: 0.06 } }, symbol_patterns: %{ future: %{ case: :upper, component_order: [ :base, :quote, :date ], date_format: :ddmmmyy, pattern: :future_ddmmmyy, separator: "-", suffix: nil }, spot: %{ case: :upper, component_order: nil, date_format: nil, pattern: :dash_upper, separator: "-", suffix: nil }, swap: %{ case: :upper, component_order: nil, date_format: nil, pattern: :implicit, separator: "-", suffix: nil } }, timeframes: %{ "15m" => "FIFTEEN_MINUTE", "1d" => "ONE_DAY", "1h" => "ONE_HOUR", "1m" => "ONE_MINUTE", "2h" => "TWO_HOUR", "30m" => "THIRTY_MINUTE", "5m" => "FIVE_MINUTE", "6h" => "SIX_HOUR" }, url_strategy: %{ detected_from: "sign_method", note: "advanced_trade_api", pattern: :coinbase_v3, prefix: "/api/v3/" }, urls: %{ api: "https://api.coinbase.com", api_sections: %{ "rest" => "https://api.coinbase.com" }, doc: [ "https://developers.coinbase.com/api/v2", "https://docs.cloud.coinbase.com/advanced-trade/docs/welcome" ], other: nil, sandbox: nil, www: "https://www.coinbase.com" }, version: "v2", ws: %{ auth: %{ algorithm: :sha256, encoding: :hex, market_specific: false, message_format: :inline, pattern: :inline_subscribe, payload_format: "timestamp + channel + product_ids", requires_passphrase: false, timestamp_unit: :seconds }, channel_templates: %{ watch_order_book: %{ channel_name: "level2", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :type_subscribe }, watch_order_book_for_symbols: %{ channel_name: "level2", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :type_subscribe }, watch_orders: %{ channel_name: "user", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :type_subscribe }, watch_ticker: %{ channel_name: "ticker", market_id_format: :native, params: [], pattern: :type_subscribe }, watch_tickers: %{ channel_name: "ticker_batch", market_id_format: :native, params: [], pattern: :type_subscribe }, watch_trades: %{ channel_name: "market_trades", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :type_subscribe }, watch_trades_for_symbols: %{ channel_name: "market_trades", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :type_subscribe } }, has: %{ watch_balance: false, watch_bids_asks: nil, watch_liquidations: nil, watch_liquidations_for_symbols: nil, watch_my_liquidations: nil, watch_my_liquidations_for_symbols: nil, watch_my_trades: false, watch_ohlcv: false, watch_ohlcv_for_symbols: nil, watch_order_book: true, watch_order_book_for_symbols: true, watch_orders: true, watch_orders_for_symbols: nil, watch_position: nil, watch_positions: nil, watch_status: nil, watch_ticker: true, watch_tickers: true, watch_trades: true, watch_trades_for_symbols: true }, message_patterns: [ %{ args_field: "channel", format: :type, keys: [ "api_key", "channel", "product_ids", "signature", "timestamp", "type" ], kind_field: "type", kind_value: "subscribe", sources: [ :send, :watch ] }, %{ args_field: "channel", format: :type, keys: [ "channel", "product_ids", "type" ], kind_field: "type", kind_value: "subscribe", sources: [ :send, :watch, :watch_multiple ] }, %{ args_field: "channel", format: :type, keys: [ "api_key", "channel", "product_ids", "signature", "timestamp", "type" ], kind_field: "type", kind_value: "unsubscribe", sources: [ :send, :watch ] }, %{ args_field: "channel", format: :type, keys: [ "channel", "product_ids", "type" ], kind_field: "type", kind_value: "unsubscribe", sources: [ :send, :watch, :watch_multiple ] } ], subscription_config: %{ args_field: "product_ids", args_format: :string_list, channels_field: "channels", market_id_format: :native, op_field: "type" }, subscription_pattern: :type_subscribe, urls: "wss://advanced-trade-ws.coinbase.com", watch_methods: [ "watchOrderBook", "watchOrderBookForSymbols", "watchOrders", "watchTicker", "watchTickers", "watchTrades", "watchTradesForSymbols" ] } }