opennode
Version:
Node.js library for the OpenNode API.
109 lines • 4.29 kB
JavaScript
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createLnUrlWithdrawal = exports.payoutInfo = exports.initiatePayout = exports.refundInfo = exports.listRefunds = exports.refundCharge = exports.signatureIsValid = exports.initiateWithdrawalAsync = exports.accountBalance = exports.getBalance = exports.listCurrencies = exports.listRates = exports.listWithdrawals = exports.withdrawalInfo = exports.initiateExchange = exports.initiateWithdrawal = exports.listCharges = exports.chargeInfo = exports.createCharge = exports.setCredentials = exports.OpenNodeError = exports.OpenNodeClient = void 0;
const client_1 = require("./client");
var client_2 = require("./client");
Object.defineProperty(exports, "OpenNodeClient", { enumerable: true, get: function () { return client_2.OpenNodeClient; } });
var OpenNodeError_1 = require("./OpenNodeError");
Object.defineProperty(exports, "OpenNodeError", { enumerable: true, get: function () { return OpenNodeError_1.OpenNodeError; } });
__exportStar(require("./types"), exports);
let instance;
function setCredentials(key, environment = "live") {
if (instance !== undefined) {
process.emitWarning("opennode.setCredentials was called multiple times", "OpenNode-SetCred", "OPND001");
return;
}
instance = new client_1.OpenNodeClient(key, environment);
}
exports.setCredentials = setCredentials;
function createCharge(charge) {
return instance.createCharge(charge);
}
exports.createCharge = createCharge;
function chargeInfo(id) {
return instance.chargeInfo(id);
}
exports.chargeInfo = chargeInfo;
function listCharges() {
return instance.listCharges();
}
exports.listCharges = listCharges;
function initiateWithdrawal(withdrawal) {
return instance.initiateWithdrawal(withdrawal);
}
exports.initiateWithdrawal = initiateWithdrawal;
function initiateExchange(exchange) {
return instance.initiateExchange(exchange);
}
exports.initiateExchange = initiateExchange;
function withdrawalInfo(id) {
return instance.withdrawalInfo(id);
}
exports.withdrawalInfo = withdrawalInfo;
function listWithdrawals() {
return instance.listWithdrawals();
}
exports.listWithdrawals = listWithdrawals;
function listRates() {
return instance.listRates();
}
exports.listRates = listRates;
function listCurrencies() {
return instance.listCurrencies();
}
exports.listCurrencies = listCurrencies;
function getBalance() {
return instance.userBalance();
}
exports.getBalance = getBalance;
function accountBalance() {
return instance.accountBalance();
}
exports.accountBalance = accountBalance;
function initiateWithdrawalAsync(withdrawal) {
return instance.initiateWithdrawalAsync(withdrawal);
}
exports.initiateWithdrawalAsync = initiateWithdrawalAsync;
function signatureIsValid(charge) {
return instance.verifySignature(charge);
}
exports.signatureIsValid = signatureIsValid;
function refundCharge(refund) {
return instance.refundCharge(refund);
}
exports.refundCharge = refundCharge;
function listRefunds() {
return instance.listRefunds();
}
exports.listRefunds = listRefunds;
function refundInfo(id) {
return instance.refundInfo(id);
}
exports.refundInfo = refundInfo;
function initiatePayout(payout) {
return instance.initiatePayout(payout);
}
exports.initiatePayout = initiatePayout;
function payoutInfo(id) {
return instance.payoutInfo(id);
}
exports.payoutInfo = payoutInfo;
function createLnUrlWithdrawal(withdrawal) {
return instance.createLnUrlWithdrawal(withdrawal);
}
exports.createLnUrlWithdrawal = createLnUrlWithdrawal;
//# sourceMappingURL=index.js.map
;