UNPKG

@volare.finance/volare.js

Version:
34 lines 1.32 kB
"use strict"; /** * @file notification.ts * @author astra <astra@volare.finance> * @date 2022 */ Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const utils_js_1 = require("@volare.finance/utils.js"); const axios_1 = tslib_1.__importDefault(require("axios")); const dotenv_1 = require("dotenv"); const notification_1 = require("../../src/apis/notification"); (0, dotenv_1.config)({ path: '.env', encoding: 'utf8', }); const URL = String(process.env.API_URL); const ENDPOINT = String(process.env.ENDPOINT); if (!utils_js_1.ERC20.IsInited()) { utils_js_1.ERC20.Init(ENDPOINT); } (() => tslib_1.__awaiter(void 0, void 0, void 0, function* () { const instance = axios_1.default.create({ baseURL: URL, headers: { 'Content-Type': 'application/json; charset=utf-8', }, }); const notification = new notification_1.Notification(instance); console.log(yield notification.read('0x4b894b31a767e52dd66a681187970155dd0f3a0c', ['0xce9fa09b798a31f6b053a0e39bd79f8ce7a3c719028e504ffc8081c67434864f'])); const notifications = yield notification.notifications('0x4b894b31a767e52dd66a681187970155dd0f3a0c', true); console.log(JSON.stringify(notifications, undefined, 2)); }))(); //# sourceMappingURL=notification.js.map