okex-withdrawal-fee
Version:
Get OKEx withdrawal fees of all currencies.
25 lines (24 loc) • 902 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const okex_withdrawal_fee_map_1 = __importDefault(require("./data/okex_withdrawal_fee_map"));
/**
* Get withdrawal fee of the symbol.
*
* @param symbol The symbol name
* @param platform The platform, optional
* @returns WithdrawalFee or undefined
*/
// eslint-disable-next-line import/prefer-default-export
function getWithdrawalFee(symbol, platform) {
if (!(symbol in okex_withdrawal_fee_map_1.default))
return undefined;
if (platform) {
const arr = okex_withdrawal_fee_map_1.default[symbol];
return arr.find(x => x.platform === platform);
}
return okex_withdrawal_fee_map_1.default[symbol];
}
exports.getWithdrawalFee = getWithdrawalFee;