import { TonClient } from "@rsquad-test/core"; let library: typeof TonClient; try { library = require("./tonclient.node"); } catch (error) { const fs = require("fs"); const os = require("os"); const path = require("path"); let addonPath = path.resolve(__dirname, "tonclient.node"); if (fs.existsSync(addonPath)) { throw error; } addonPath = path.resolve(os.homedir(), "tonclient.node"); library = require(addonPath); } (async () => { TonClient.loadBinaryLibrary((): Promise => new Promise((res) => res(library))); })(); export { TonClient };