1.0.7 • Published 7 months ago

@xfilecom/exchange-api v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

@xfilecom/exchange-api

여러 암호화폐 거래소의 API를 통합하여 일관된 인터페이스로 제공하는 Node.js 라이브러리입니다.

설치

npm install @xfilecom/exchange-api

지원하는 거래소

  • GOPAX
  • Gate.io

사용 방법

import { GopaxAdapter, GateioAdapter } from "@xfilecom/exchange-api";

// GOPAX 클라이언트 초기화
const gopax = new GopaxAdapter("API_KEY", "SECRET_KEY");

// Gate.io 클라이언트 초기화
const gateio = new GateioAdapter("API_KEY", "SECRET_KEY");

// 마켓 정보 조회
const gopaxMarkets = await gopax.getMarkets();
const gateioMarkets = await gateio.getMarkets();

// 티커 정보 조회
const btcKrwTicker = await gopax.getTicker("BTC-KRW");
const btcUsdtTicker = await gateio.getTicker("BTC_USDT");

// 호가창 정보 조회
const gopaxOrderBook = await gopax.getOrderBook("BTC-KRW");
const gateioOrderBook = await gateio.getOrderBook("BTC_USDT");

인터페이스

MarketInfo

interface MarketInfo {
  symbol: string; // 거래 쌍 (예: BTC-USDT)
  baseCurrency: string; // 기��� 화폐 (예: BTC)
  quoteCurrency: string; // 상대 화폐 (예: USDT)
  minPrice: string; // 최소 주문 가격
  maxPrice: string; // 최대 주문 가격
  minAmount: string; // 최소 주문 수량
  maxAmount: string; // 최대 주문 수량
  priceTickSize: string; // 가격 단위
  amountTickSize: string; // 수량 단위
}

Ticker

interface Ticker {
  symbol: string; // 거래 쌍
  lastPrice: string; // 마지막 거래 가격
  bidPrice: string; // 매수 호가
  askPrice: string; // 매도 호가
  volume24h: string; // 24시간 거래량
  high24h: string; // 24시간 최고가
  low24h: string; // 24시간 최저가
  timestamp: number; // 타임스탬프
}

OrderBook

interface OrderBook {
  symbol: string; // 거래 쌍
  bids: [string, string][]; // [가격, 수량] 매수 호가
  asks: [string, string][]; // [가격, 수량] 매도 호가
  timestamp: number; // 타임스탬프
}

라이선스

MIT

1.0.7

7 months ago

1.0.6

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago