UNPKG

@exchanges/binance

Version:

Exchange provider for Binance API

32 lines 1.77 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.apiKeyCall = void 0; const publicCall_1 = require("./publicCall"); function apiKeyCall(options) { return __awaiter(this, void 0, void 0, function* () { if (!options) throw new TypeError('apiKeyCall options is empty'); if (typeof options !== 'object') throw new TypeError('apiKeyCall options is not object'); if (!options.host) throw new TypeError('apiKeyCall options.host is empty'); if (!options.path) throw new TypeError('apiKeyCall options.path is empty'); if (!options.apiKey) throw new Error('apiKeyCall options.apiKey is empty'); if (!options.method) throw new TypeError('apiKeyCall options.method is empty'); return (0, publicCall_1.publicCall)(Object.assign(Object.assign({}, options), { headers: Object.assign(Object.assign({}, options.headers), { 'X-MBX-APIKEY': options.apiKey }) })); }); } exports.apiKeyCall = apiKeyCall; //# sourceMappingURL=apiKeyCall.js.map