1.2.0 • Published 2 years ago
node-upbit v1.2.0
node-upbit
npm 사용:
$ npm i node-upbityarn 사용:
$ yarn add node-upbit예제(usage)
TypeScript 사용 예제
import { ExchangeService, QuoationService } from "node-upbit";Quoation API
업비트 ACCESS_KEY없이 코인 시세정보를 조회할 수 있는 API
const quoationService = new QuoationService();//마켓 코드 조회
const res = await quoationService.getMarketAllInfo();// 분 캔들 조회
const res2 = await quoationService.getMinutesCandles({
minutes: "60",
marketCoin: "KRW-BTC",
count: 10,
});// 일 캔들 조회
const res3 = await quoationService.getDayCandles({
marketCoin: "KRW-BTC",
count: 10,
});// 주 캔들 조회
const res4 = await quoationService.getWeekCandles({
marketCoin: "KRW-BTC",
count: 10,
});// 월 캔들 조회
const res5 = await quoationService.getMonthCandles({
marketCoin: "KRW-BTC",
count: 10,
});// 현재가 정보 조회
const res6 = await quoationService.getTicker(["KRW-BTC"]);// 호가 정보 조회
const res7 = await quoationService.getOrderbook(["KRW-BTC"]);Exchange API
업비트에서 발급받은 ACCESS_KEY, SERET_KEY를 이용하여 자산조회,주문 등을 할 수 있는 API
// UBIT_ACCESS_KEY 업비트에서 발급받은 ACCESS_KEY
// UBIT_SECRET_KEY 업비트에서 발급받은 SECRET_KEY
const exchangeService = new ExchangeService(UBIT_ACCESS_KEY, UBIT_SECRET_KEY);//전체 계좌 조회
const res8 = await exchangeService.getAllAccount();//주문 가능 정보
const res9 = await exchangeService.getOrderChance("KRW-BTC");// API 키 리스트 조회
const res10 = await exchangeService.getApiKeyStatus();