korea-crypto-exchange
Version:
한국의 주요 암호화폐 거래소(업비트, 빗썸) API를 쉽게 구현할 수 있도록 도와주는 TypeScript 라이브러리
33 lines (32 loc) • 1.26 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpbitQuotation = exports.UpbitExchange = exports.UpbitStrategy = void 0;
const exchange_1 = require("./exchange");
Object.defineProperty(exports, "UpbitExchange", { enumerable: true, get: function () { return exchange_1.UpbitExchange; } });
const quotation_1 = require("./quotation");
Object.defineProperty(exports, "UpbitQuotation", { enumerable: true, get: function () { return quotation_1.UpbitQuotation; } });
class UpbitStrategy {
constructor(config) {
this.exchange = new exchange_1.UpbitExchange(config);
this.quotation = new quotation_1.UpbitQuotation(config);
}
// IExchangeStrategy 구현
async placeOrder(params) {
return this.exchange.placeOrder(params);
}
// UpbitExchange 메서드 위임
async getAccounts() {
return this.exchange.getAccounts();
}
async getOrderDetail(params) {
return this.exchange.getOrderDetail(params);
}
// UpbitQuotation 메서드 위임
async getTickers(params) {
return this.quotation.getTickers(params);
}
async getOrderbook(params) {
return this.quotation.getOrderbook(params);
}
}
exports.UpbitStrategy = UpbitStrategy;