Files
jackwener__opencli/clis/binance/pairs.js
jakevin 00e200b0b7 migrate: move binance adapters from src/clis/ to clis/ (#967)
Binance was the only adapter left in src/clis/ after the TS→JS
migration (PR #928). Move all 11 adapters and the test file to
clis/binance/, strip TypeScript syntax from the test, and switch
the test import to the @jackwener/opencli/pipeline package export.
2026-04-11 21:21:52 +08:00

22 lines
743 B
JavaScript

import { cli, Strategy } from '@jackwener/opencli/registry';
cli({
site: 'binance',
name: 'pairs',
description: 'List active trading pairs on Binance',
domain: 'data-api.binance.vision',
strategy: Strategy.PUBLIC,
browser: false,
args: [
{ name: 'limit', type: 'int', default: 20, help: 'Number of trading pairs' },
],
columns: ['symbol', 'base', 'quote', 'status'],
pipeline: [
{ fetch: { url: 'https://data-api.binance.vision/api/v3/exchangeInfo' } },
{ select: 'symbols' },
{ filter: 'item.status === \'TRADING\'' },
{ map: { symbol: '${{ item.symbol }}', base: '${{ item.baseAsset }}', quote: '${{ item.quoteAsset }}', status: '${{ item.status }}' } },
{ limit: '${{ args.limit }}' },
],
});