Files
jackwener__opencli/clis/binance/prices.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

20 lines
612 B
JavaScript

import { cli, Strategy } from '@jackwener/opencli/registry';
cli({
site: 'binance',
name: 'prices',
description: 'Latest prices for all trading pairs',
domain: 'data-api.binance.vision',
strategy: Strategy.PUBLIC,
browser: false,
args: [
{ name: 'limit', type: 'int', default: 20, help: 'Number of prices' },
],
columns: ['rank', 'symbol', 'price'],
pipeline: [
{ fetch: { url: 'https://data-api.binance.vision/api/v3/ticker/price' } },
{ map: { rank: '${{ index + 1 }}', symbol: '${{ item.symbol }}', price: '${{ item.price }}' } },
{ limit: '${{ args.limit }}' },
],
});