"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.fetchAddresses = exports.fetchPublicKey = exports.fetchSeed = exports.fetchSeq = exports.fetchEffectiveBalance = exports.fetchEffectiveBalanceConfirmations = exports.deleteAddressFromWallet = exports.fetchMultipleBalance = exports.fetchBalance = exports.fetchValidate = exports.data = exports.fetchScriptInfo = exports.fetchBalanceConfirmations = exports.fetchBalanceDetails = exports.fetchScriptInfoMeta = exports.fetchDataKey = void 0; var request_1 = __importStar(require("../../tools/request")); var query_1 = __importDefault(require("../../tools/query")); function fetchDataKey(base, address, key, options) { if (options === void 0) { options = Object.create(null); } return request_1.default({ base: base, url: "/addresses/data/" + address + "/" + encodeURIComponent(key), options: options }); } exports.fetchDataKey = fetchDataKey; function fetchScriptInfoMeta(base, address) { return request_1.default({ base: base, url: "/addresses/scriptInfo/" + address + "/meta" }); } exports.fetchScriptInfoMeta = fetchScriptInfoMeta; function fetchBalanceDetails(base, address, options) { if (options === void 0) { options = Object.create(null); } return request_1.default({ base: base, url: "/addresses/balance/details/" + address, options: options }); } exports.fetchBalanceDetails = fetchBalanceDetails; function fetchBalanceConfirmations(base, address, confirmations, options) { if (options === void 0) { options = Object.create(null); } return request_1.default({ base: base, url: "/addresses/balance/" + address + "/" + confirmations, options: options }); } exports.fetchBalanceConfirmations = fetchBalanceConfirmations; function fetchScriptInfo(base, address, options) { if (options === void 0) { options = Object.create(null); } return request_1.default({ base: base, url: "/addresses/scriptInfo/" + address, options: options }); } exports.fetchScriptInfo = fetchScriptInfo; function data(base, address, params, options) { if (params === void 0) { params = Object.create(null); } if (options === void 0) { options = Object.create(null); } return request_1.default({ base: base, url: "/addresses/data/" + address + query_1.default(params), options: options }); } exports.data = data; function fetchValidate(base, address) { return request_1.default({ base: base, url: "/addresses/validate/" + address }); } exports.fetchValidate = fetchValidate; function fetchBalance(base, address, options) { if (options === void 0) { options = Object.create(null); } return request_1.default({ base: base, url: "/addresses/balance/" + address, options: options }); } exports.fetchBalance = fetchBalance; function fetchMultipleBalance(base, addresses, options) { if (options === void 0) { options = Object.create(null); } return fetch(base + "/addresses/balance", { method: "POST", body: JSON.stringify({ addresses: addresses }), headers: { "Content-Type": "application/json" } }).then(request_1.parseResponse); } exports.fetchMultipleBalance = fetchMultipleBalance; function deleteAddressFromWallet(base, address, options) { if (options === void 0) { options = Object.create(null); } return request_1.default({ base: base, url: "/addresses/" + address, options: __assign(__assign({}, options), { method: 'DELETE' }) }); } exports.deleteAddressFromWallet = deleteAddressFromWallet; function fetchEffectiveBalanceConfirmations(base, address, confirmations, options) { if (options === void 0) { options = Object.create(null); } return request_1.default({ base: base, url: "/addresses/effectiveBalance/" + address + "/" + confirmations, options: options }); } exports.fetchEffectiveBalanceConfirmations = fetchEffectiveBalanceConfirmations; function fetchEffectiveBalance(base, address, options) { if (options === void 0) { options = Object.create(null); } return request_1.default({ base: base, url: "/addresses/effectiveBalance/" + address, options: options }); } exports.fetchEffectiveBalance = fetchEffectiveBalance; function fetchSeq(base, from, to) { return request_1.default({ base: base, url: "/addresses/seq/" + from + "/" + to }); } exports.fetchSeq = fetchSeq; function fetchSeed(base, address) { return request_1.default({ base: base, url: "/addresses/seed/" + address }); } exports.fetchSeed = fetchSeed; function fetchPublicKey(base, publicKey) { return request_1.default({ base: base, url: "/addresses/publicKey/" + publicKey }); } exports.fetchPublicKey = fetchPublicKey; function fetchAddresses(base) { return request_1.default({ base: base, url: '/addresses' }); } exports.fetchAddresses = fetchAddresses; //# sourceMappingURL=index.js.map