UNPKG

ccxt-xigua

Version:

A JavaScript / Python / PHP cryptocurrency trading library with support for 130+ exchanges

33 lines (31 loc) 792 B
const makeNewMarket = ({ base: baseNmae, quto: qutoName, pricePrecision, type = 'spot', amountPrecision = 0.01 }) => { const base = baseNmae.toUpperCase(); const quote = qutoName.toUpperCase(); const id = base + quote; const symbol = base + '/' + quote; const market = { "id": id, "symbol": symbol, "base": base, "quote": quote, "baseId": base, "quoteId": quote, "type": type, "spot": type === "spot", "swap": type === "swap", "future": type === "future", "option": type === "option", "active": true, "contract": false, "precision": { "amount": amountPrecision, // 写死数量 "price": pricePrecision }, "limits": null, "info": null }; return market; } module.exports = { makeNewMarket };