diff --git a/.env.defaults b/.env.defaults index 20e97162..bc3c7f9b 100644 --- a/.env.defaults +++ b/.env.defaults @@ -1,4 +1,4 @@ NETTYPE=0 SERVER_URL=api.mymonero.com -APP_VERSION=1.2.4 +APP_VERSION=1.3.0 APP_NAME=MyMonero diff --git a/package-lock.json b/package-lock.json index cf999799..30346c79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "MyMonero", - "version": "1.2.4", + "version": "1.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "MyMonero", - "version": "1.2.4", + "version": "1.3.0", "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "@mymonero/changenow-exchange-integration": "^1.3.0-alpha.26", - "@mymonero/mymonero-app-bridge": "^1.0.11", + "@mymonero/mymonero-app-bridge": "^2.1.13", "@mymonero/mymonero-bigint": "^1.0.5", "@mymonero/mymonero-exchange-helper": "^1.3.1-alpha.4", "@mymonero/mymonero-hosted-api": "^1.1.5", @@ -19,6 +19,7 @@ "@mymonero/mymonero-monero-config": "^1.0.5", "@mymonero/mymonero-money-format": "^1.0.5", "@mymonero/mymonero-net-service-utils": "^1.0.5", + "@mymonero/mymonero-openalias": "^2.1.13", "@mymonero/mymonero-page-templates": "^2.0.2", "@mymonero/mymonero-paymentid-utils": "^1.0.5", "@mymonero/mymonero-request-utils": "^1.1.4", @@ -1731,24 +1732,29 @@ } }, "node_modules/@mymonero/mymonero-app-bridge": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@mymonero/mymonero-app-bridge/-/mymonero-app-bridge-1.1.15.tgz", - "integrity": "sha512-gyE0iIvHL6TcKvC+OJ8Em9gv+27QrSiPyOFYLDktQKgF1hnxcZKqiV9p1qn+7zS1sVQSPCDOoENgmA7gpMyGLw==", + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@mymonero/mymonero-app-bridge/-/mymonero-app-bridge-2.1.13.tgz", + "integrity": "sha512-G9tGh1aGZseQaOI+4yHxTdY5SzOtO0cmdewW0nd4UehomW/Zrhi2MJwASLObeJ8TYWcZMVCMqAlxy1ksmk+neA==", "dependencies": { - "@mymonero/mymonero-bigint": "^1.1.15", - "@mymonero/mymonero-bridge-utils": "^1.1.15", - "@mymonero/mymonero-nettype": "^1.1.15" + "@mymonero/mymonero-bigint": "^2.1.13", + "@mymonero/mymonero-bridge-utils": "^2.1.13", + "@mymonero/mymonero-nettype": "^2.1.13" } }, + "node_modules/@mymonero/mymonero-app-bridge/node_modules/@mymonero/mymonero-bigint": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@mymonero/mymonero-bigint/-/mymonero-bigint-2.1.13.tgz", + "integrity": "sha512-CK4uYErErLDVvZ0e9AHzJ4WV0HWN0NlahUqDCYNGYb63rxVo6i68YOBAStdkuPfNLkDVekDiQIuhq7xOdBvZMQ==" + }, "node_modules/@mymonero/mymonero-bigint": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@mymonero/mymonero-bigint/-/mymonero-bigint-1.2.0.tgz", "integrity": "sha512-3ZN9ZkbZMpTj8ILrAaQ2D9XcBgq3x1bFOBnLZscKGpjJfrKdQmAkX4cl1Y2KKPl8E/vhCoHaGnIFaenDSP05hg==" }, "node_modules/@mymonero/mymonero-bridge-utils": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@mymonero/mymonero-bridge-utils/-/mymonero-bridge-utils-1.2.0.tgz", - "integrity": "sha512-8CuSHm0Q6C6hXPCppZZGrJLP3NEa5guR9Ks0SfzmDl+hLqwFjd4oqKZoWYURn4pnu83nKnYmQH28k1eAEHQJeA==" + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@mymonero/mymonero-bridge-utils/-/mymonero-bridge-utils-2.1.13.tgz", + "integrity": "sha512-bLmLZxz2lezv5NrFQuA4iYrZm6xno1f1JLgoQm4hpMpw3F+GsqyMxD7QDIGLTp0eLUpL38btgLtXPe2C8w27iQ==" }, "node_modules/@mymonero/mymonero-exchange": { "version": "1.3.1-alpha.0", @@ -1823,9 +1829,17 @@ "integrity": "sha512-JVC9efqhjRcYSewP8kb0Hdi4tzgC2tpM+Fvu8GJIdIsc4GjyI3guk14klieDSCfPImObBaTlCXycWZUxwE0aiA==" }, "node_modules/@mymonero/mymonero-nettype": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@mymonero/mymonero-nettype/-/mymonero-nettype-1.1.15.tgz", - "integrity": "sha512-e/ICbZ+zW2IYuniU8XdHk0211hs/lih5pSm3WyKaIZ+rDstdw1ELSfaBVzs0AG5fAswDHZKvCelCUChf9ybi1g==" + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@mymonero/mymonero-nettype/-/mymonero-nettype-2.1.13.tgz", + "integrity": "sha512-rt3x4hXtwx20TuiOmhN0pAqdmhbPVhMT5QMjmynbdP0u0QdU7IbhIO+3Lc+sN4ZjW9B0pjsFZcHYzlILMrXeRw==" + }, + "node_modules/@mymonero/mymonero-openalias": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@mymonero/mymonero-openalias/-/mymonero-openalias-2.1.13.tgz", + "integrity": "sha512-293zVq4X7BqWQlaM9SXYqTHuhmTnKQRckvdzXxwgWeddItuofCWHUtJUjB1tHMKmEahqdRG05GrMz7oRIxBErQ==", + "dependencies": { + "axios": "^0.21.3" + } }, "node_modules/@mymonero/mymonero-page-templates": { "version": "2.0.2", @@ -10441,13 +10455,20 @@ } }, "@mymonero/mymonero-app-bridge": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@mymonero/mymonero-app-bridge/-/mymonero-app-bridge-1.1.15.tgz", - "integrity": "sha512-gyE0iIvHL6TcKvC+OJ8Em9gv+27QrSiPyOFYLDktQKgF1hnxcZKqiV9p1qn+7zS1sVQSPCDOoENgmA7gpMyGLw==", + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@mymonero/mymonero-app-bridge/-/mymonero-app-bridge-2.1.13.tgz", + "integrity": "sha512-G9tGh1aGZseQaOI+4yHxTdY5SzOtO0cmdewW0nd4UehomW/Zrhi2MJwASLObeJ8TYWcZMVCMqAlxy1ksmk+neA==", "requires": { - "@mymonero/mymonero-bigint": "^1.1.15", - "@mymonero/mymonero-bridge-utils": "^1.1.15", - "@mymonero/mymonero-nettype": "^1.1.15" + "@mymonero/mymonero-bigint": "^2.1.13", + "@mymonero/mymonero-bridge-utils": "^2.1.13", + "@mymonero/mymonero-nettype": "^2.1.13" + }, + "dependencies": { + "@mymonero/mymonero-bigint": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@mymonero/mymonero-bigint/-/mymonero-bigint-2.1.13.tgz", + "integrity": "sha512-CK4uYErErLDVvZ0e9AHzJ4WV0HWN0NlahUqDCYNGYb63rxVo6i68YOBAStdkuPfNLkDVekDiQIuhq7xOdBvZMQ==" + } } }, "@mymonero/mymonero-bigint": { @@ -10456,9 +10477,9 @@ "integrity": "sha512-3ZN9ZkbZMpTj8ILrAaQ2D9XcBgq3x1bFOBnLZscKGpjJfrKdQmAkX4cl1Y2KKPl8E/vhCoHaGnIFaenDSP05hg==" }, "@mymonero/mymonero-bridge-utils": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@mymonero/mymonero-bridge-utils/-/mymonero-bridge-utils-1.2.0.tgz", - "integrity": "sha512-8CuSHm0Q6C6hXPCppZZGrJLP3NEa5guR9Ks0SfzmDl+hLqwFjd4oqKZoWYURn4pnu83nKnYmQH28k1eAEHQJeA==" + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@mymonero/mymonero-bridge-utils/-/mymonero-bridge-utils-2.1.13.tgz", + "integrity": "sha512-bLmLZxz2lezv5NrFQuA4iYrZm6xno1f1JLgoQm4hpMpw3F+GsqyMxD7QDIGLTp0eLUpL38btgLtXPe2C8w27iQ==" }, "@mymonero/mymonero-exchange": { "version": "1.3.1-alpha.0", @@ -10535,9 +10556,17 @@ "integrity": "sha512-JVC9efqhjRcYSewP8kb0Hdi4tzgC2tpM+Fvu8GJIdIsc4GjyI3guk14klieDSCfPImObBaTlCXycWZUxwE0aiA==" }, "@mymonero/mymonero-nettype": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@mymonero/mymonero-nettype/-/mymonero-nettype-1.1.15.tgz", - "integrity": "sha512-e/ICbZ+zW2IYuniU8XdHk0211hs/lih5pSm3WyKaIZ+rDstdw1ELSfaBVzs0AG5fAswDHZKvCelCUChf9ybi1g==" + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@mymonero/mymonero-nettype/-/mymonero-nettype-2.1.13.tgz", + "integrity": "sha512-rt3x4hXtwx20TuiOmhN0pAqdmhbPVhMT5QMjmynbdP0u0QdU7IbhIO+3Lc+sN4ZjW9B0pjsFZcHYzlILMrXeRw==" + }, + "@mymonero/mymonero-openalias": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@mymonero/mymonero-openalias/-/mymonero-openalias-2.1.13.tgz", + "integrity": "sha512-293zVq4X7BqWQlaM9SXYqTHuhmTnKQRckvdzXxwgWeddItuofCWHUtJUjB1tHMKmEahqdRG05GrMz7oRIxBErQ==", + "requires": { + "axios": "^0.21.3" + } }, "@mymonero/mymonero-page-templates": { "version": "2.0.2", diff --git a/package.json b/package.json index 7543792f..bf2a5fa8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "MyMonero", "author": "MyMonero", "description": "The simplest way to use Monero", - "version": "1.2.4", + "version": "1.3.0", "license": "SEE LICENSE IN LICENSE.txt", "repository": "https://github.com/mymonero/mymonero-web-js", "scripts": { @@ -16,7 +16,7 @@ }, "dependencies": { "@mymonero/changenow-exchange-integration": "^1.3.0-alpha.26", - "@mymonero/mymonero-app-bridge": "^1.0.11", + "@mymonero/mymonero-app-bridge": "^2.1.13", "@mymonero/mymonero-bigint": "^1.0.5", "@mymonero/mymonero-exchange-helper": "^1.3.1-alpha.4", "@mymonero/mymonero-hosted-api": "^1.1.5", @@ -25,6 +25,7 @@ "@mymonero/mymonero-monero-config": "^1.0.5", "@mymonero/mymonero-money-format": "^1.0.5", "@mymonero/mymonero-net-service-utils": "^1.0.5", + "@mymonero/mymonero-openalias": "^2.1.13", "@mymonero/mymonero-page-templates": "^2.0.2", "@mymonero/mymonero-paymentid-utils": "^1.0.5", "@mymonero/mymonero-request-utils": "^1.1.4", diff --git a/src/OpenAlias/TXTResolver.web.js b/src/OpenAlias/TXTResolver.web.js index 82997451..1af25008 100644 --- a/src/OpenAlias/TXTResolver.web.js +++ b/src/OpenAlias/TXTResolver.web.js @@ -1,7 +1,9 @@ 'use strict' const request = require('xhr') +const OpenAlias = require('@mymonero/mymonero-openalias') +//TODO: instead of having the TXTRecords function, use instance of OpenAlias instead class TXTResolver { // // Accessors @@ -9,10 +11,14 @@ class TXTResolver { name, fn // (err, records, dnssec_used, secured, dnssec_fail_reason) -> Void ) { - const completeURL = 'https://cloudflare-dns.com/dns-query?ct=application/dns-json&name=' + encodeURIComponent(name) + '&type=TXT' - const requestHandle = request( - completeURL, - function (err, response, body) { + const completeURL = 'https://cloudflare-dns.com/dns-query?name=' + encodeURIComponent(name) + '&type=TXT' + + const requestHandle = request({ + uri: completeURL, + headers: { + "accept": "application/dns-json" + } + }, function (err, response, body) { if (err) { fn(err) return