From 04e1ffd090c2918682e5c2daa26e50d584ee6ee4 Mon Sep 17 00:00:00 2001 From: Ronny Esterluss Date: Thu, 18 Jul 2024 14:10:53 +0200 Subject: [PATCH 1/3] switch to latest uhttp --- frontend/package.json | 2 +- frontend/yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 83a5b23..aaa8162 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -3,7 +3,7 @@ "version": "0.2.0", "private": true, "dependencies": { - "@hoprnet/phttp-lib": "^3.0.1", + "@hoprnet/uhttp-lib": "3.1.4-beta1", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 392d886..084fecc 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -1310,21 +1310,21 @@ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== -"@hoprnet/phttp-crypto@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@hoprnet/phttp-crypto/-/phttp-crypto-1.0.0.tgz#684815ab5c18b76f4458bf0ddf8bec4c15f653fe" - integrity sha512-IBeEULHWVDaQPDDU0aSZqHJ6EFPuuS2F6uj5/9wvU440JPujakDELIg8wIRVk5fjJvrjbVeVUv8c7p5dbuqhFg== +"@hoprnet/uhttp-crypto@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@hoprnet/uhttp-crypto/-/uhttp-crypto-1.0.1.tgz#0b2f92228bb9bc14c7ada2531f5f3b7ce029e7ab" + integrity sha512-yvZBBuf+gUDPyABqv127v1z3+AhLtBPwmkmndKC+Rw/SJ4UGKDw3WTyk44chUQwVZlwIitWIKA+M3xZPNsxkRQ== dependencies: "@noble/ciphers" "^0.4.1" "@noble/curves" "^1.3.0" "@noble/hashes" "^1.3.3" -"@hoprnet/phttp-lib@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@hoprnet/phttp-lib/-/phttp-lib-3.0.1.tgz#2204a45c08829db85b009d5fd9d504a6c59f460f" - integrity sha512-+YIYJjetF/oxj06pAuHxjPlffQcMiXoJJRn2QStiriV8IarRL/bm4OnS3GOiqacLrHIt6vVrARCgTb0cagkC4Q== +"@hoprnet/uhttp-lib@3.1.4-beta1": + version "3.1.4-beta1" + resolved "https://registry.yarnpkg.com/@hoprnet/uhttp-lib/-/uhttp-lib-3.1.4-beta1.tgz#bb2e662a1c93e50f5e25a6d180e9a31ab181e2eb" + integrity sha512-SAyJ2OrzJC7ZdPEQCFrFnOONSp/jWitL6hDkamZxOmrfqghcKVswnIk65zK2/049rxr4+/w+tIe1OEttlDJ/6g== dependencies: - "@hoprnet/phttp-crypto" "^1.0.0" + "@hoprnet/uhttp-crypto" "^1.0.1" debug "^4.3.4" isomorphic-ws "^5.0.0" lz-string "^1.5.0" From fe6c5d2035cde8c8a145e343108aa51b35b2a5ed Mon Sep 17 00:00:00 2001 From: Ronny Esterluss Date: Thu, 18 Jul 2024 14:11:02 +0200 Subject: [PATCH 2/3] expose new env var --- frontend/.env.example | 1 + frontend/src/Portfolio.js | 1 + 2 files changed, 2 insertions(+) diff --git a/frontend/.env.example b/frontend/.env.example index e74d09d..f48a0e9 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -2,3 +2,4 @@ REACT_APP_BACKEND_URL=backend.mytokentracker.xyz //'127.0.0.1:8787' if local se REACT_APP_uHTTP_DP_ENDPOINT= //leave empty to use default REACT_APP_uHTTP_TOKEN= REACT_APP_uHTTP_FORCE_ZERO_HOP=true +REACT_APP_uHTTP_CLIENT_ASSOCIATED=false diff --git a/frontend/src/Portfolio.js b/frontend/src/Portfolio.js index 066073a..2cb6e7e 100644 --- a/frontend/src/Portfolio.js +++ b/frontend/src/Portfolio.js @@ -8,6 +8,7 @@ const notRealTokenRegEx = /visit|www|http|.com|.org|claim/gi; let uHTTPOptions = { forceZeroHop: process.env.REACT_APP_uHTTP_FORCE_ZERO_HOP ? JSON.parse(process.env.REACT_APP_uHTTP_FORCE_ZERO_HOP) : false, + clientAssociatedExitNodes: process.env.REACT_APP_uHTTP_CLIENT_ASSOCIATED ? JSON.parse(process.env.REACT_APP_uHTTP_CLIENT_ASSOCIATED) : false, } if(process.env.REACT_APP_uHTTP_DP_ENDPOINT) uHTTPOptions.discoveryPlatformEndpoint = process.env.REACT_APP_uHTTP_DP_ENDPOINT; From 9a3f4dabcbae8a6034f7bc2100609aed11f54003 Mon Sep 17 00:00:00 2001 From: Ronny Esterluss Date: Thu, 18 Jul 2024 14:19:35 +0200 Subject: [PATCH 3/3] fix library ref --- frontend/src/Portfolio.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Portfolio.js b/frontend/src/Portfolio.js index 2cb6e7e..c1395ee 100644 --- a/frontend/src/Portfolio.js +++ b/frontend/src/Portfolio.js @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; import { formatEther } from 'viem' import Icon from "./Icon"; -import { Routing } from '@hoprnet/phttp-lib'; +import { Routing } from '@hoprnet/uhttp-lib'; import millify from "millify"; const notRealTokenRegEx = /visit|www|http|.com|.org|claim/gi;