從 requiredCredentials 可以知道在上方交易所內的 object 參數放入哪些欄位
const ccxt = require ('ccxt');
(async function () {
const exchange = new ccxt.binance ({...})
console.log(exchange.requiredCredentials)
},
}) ();
const ccxt = require ('ccxt');
(async function () {
const exchange = new ccxt.binance ({...})
console.log(exchange.has)
},
}) ();
const ccxt = require ('ccxt');
(async function () {
const exchange = new ccxt.binance ({...})
console.log(await exchange.loadMarkets ())
},
}) ();
最小下單金額可以從 ['TOKEN/TOKEN']['limits']['cost']['min']
獲取
const markets = await exchange.loadMarkets ();
console.log(markets["ETH/USDT"]?.limits?.cost?.min)
https://github.com/ccxt/ccxt/issues/1972#issuecomment-366834844
const ccxt = require("ccxt");
const FTX_API_KEY = process.env.ftx_api_key;
const FTX_API_SECRET = process.env.ftx_api_secret;
(async function() {
let ftx = new ccxt.ftx({
apiKey: FTX_API_KEY,
secret: FTX_API_SECRET
});
const symbol = 'BTC/USD'
const amount = 0.0001 // BTC
const order = await ftx.createOrder(symbol, 'market', 'buy', amount);
console.log (order)
})();
const ccxt = require ('ccxt');
const bitgetKey = "";
const bitgetSecret = "";
(async function () {
const exchange = new ccxt.bitget ({
apiKey: bitgetKey,
secret: bitgetSecret,
password: ""
})
const symbol = "ETH/USDT";
const amount = 0.0065;
const triggerPrice = 1000;
const order = await exchange.createOrder(symbol, 'limit', 'buy', amount, triggerPrice);
console.log('order', order);
}) ();
(async function () {
const exchange = new ccxt.binance({
});
const fr = await exchange.fetchFundingRateHistory(
"BTCUSD_PERP",
Date.now() - 24 * 1000 * 60 * 60, // 24 小時內
20
);
console.log(fr);
})();
(async function () {
const exchange = new ccxt.binance({
});
const oi = await exchange.fetchOpenInterestHistory(
"BTC/USDT:USDT",
"15m", // timeframe
Date.now() - 1000 * 24 * 60 * 60, // since
10 // limit
);
console.log(oi);
})();
e.g.
https://min-api.cryptocompare.com/data/v2/histominute?fsym=BTC&tsym=USD&limit=2000&toTs=1578217560