diff --git a/package-lock.json b/package-lock.json index ab4d990..20e0c3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,9 @@ "version": "0.0.1", "license": "Apache-2.0", "dependencies": { - "haveno-ts": "^0.0.30" + "decimal.js": "^10.4.3", + "haveno-ts": "file:../haveno-ts/haveno-ts-0.0.30.tgz", + "xhr2": "^0.2.1" }, "devDependencies": { "@types/node": "^22.10.2", @@ -30,6 +32,11 @@ "resolved": "https://registry.npmjs.org/console/-/console-0.7.2.tgz", "integrity": "sha512-+JSDwGunA4MTEgAV/4VBKwUHonP8CzJ/6GIuwPi6acKFqFfHUdSGCm89ZxZ5FfGWdZfkdgAroy5bJ5FSeN/t4g==" }, + "node_modules/decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==" + }, "node_modules/google-protobuf": { "version": "3.21.4", "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.4.tgz", @@ -42,8 +49,9 @@ }, "node_modules/haveno-ts": { "version": "0.0.30", - "resolved": "https://registry.npmjs.org/haveno-ts/-/haveno-ts-0.0.30.tgz", - "integrity": "sha512-SbalfNq0s5lSVLuPWRuCxuvKGQhnmVUI5eWqNUB/aPjRa2x0/SvW/GR8DIV1OujI+f5KjP6GsAq2CCEtX7xGfw==", + "resolved": "file:../haveno-ts/haveno-ts-0.0.30.tgz", + "integrity": "sha512-RhbwZIIhtMKGfGfKxpwhhPenFBML2AwFd0f8Y1f//gfZT3ewYYN+7C5g2fZwrMWJRp4IZfCmeCGpKOeh74ILXg==", + "license": "Apache-2.0", "dependencies": { "@types/node": "^18.14.2", "console": "^0.7.2", @@ -82,6 +90,14 @@ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true + }, + "node_modules/xhr2": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.2.1.tgz", + "integrity": "sha512-sID0rrVCqkVNUn8t6xuv9+6FViXjUVXq8H5rWOH2rz9fDNQEd4g0EA2XlcEdJXRz5BMEn4O1pJFdT+z4YHhoWw==", + "engines": { + "node": ">= 6" + } } } } diff --git a/package.json b/package.json index 590ad71..3cc43c1 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,6 @@ "typescript": "^5.7.2" }, "dependencies": { - "haveno-ts": "^0.0.30" + "haveno-ts": "file:../haveno-ts/haveno-ts-0.0.30.tgz" } } diff --git a/src/index.ts b/src/index.ts index 108c295..bda7a0c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,6 @@ +import XMLHttpRequest from "xhr2"; // Import the class directly +(global as any).XMLHttpRequest = XMLHttpRequest; + import { HavenoClient } from "haveno-ts"; main(); @@ -10,4 +13,4 @@ async function main() { // get available balance const balances = await client.getBalances(); console.log("Available balance: " + balances.getAvailableBalance()); -} \ No newline at end of file +}