parse_currency

Function parse_currency 

Source
pub fn parse_currency(data: &Value) -> Result<Currency>
Expand description

Parse currency information from Binance API response.

§Arguments

  • data - Binance currency data JSON

§Returns

Returns a CCXT Currency.

§Binance API Response Format

{
  "coin": "BTC",
  "name": "Bitcoin",
  "networkList": [
    {
      "network": "BTC",
      "coin": "BTC",
      "withdrawIntegerMultiple": "0.00000001",
      "isDefault": true,
      "depositEnable": true,
      "withdrawEnable": true,
      "depositDesc": "",
      "withdrawDesc": "",
      "name": "Bitcoin",
      "resetAddressStatus": false,
      "addressRegex": "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bc1)[0-9A-Za-z]{39,59}$",
      "memoRegex": "",
      "withdrawFee": "0.0005",
      "withdrawMin": "0.001",
      "withdrawMax": "9000",
      "minConfirm": 1,
      "unLockConfirm": 2
    }
  ],
  "trading": true,
  "isLegalMoney": false
}