From 9ad2e2c99d050b4139f9f53c3d7f25f4306034cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Holm=20Gj=C3=B8rup?= Date: Mon, 19 Aug 2024 11:30:06 +0200 Subject: [PATCH 1/2] Use new wallet-proxy endpoint and prepare release of 1.6.3 --- packages/browser-wallet/CHANGELOG.md | 6 ++++++ packages/browser-wallet/package.json | 2 +- .../browser-wallet/src/popup/shared/utils/wallet-proxy.ts | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/browser-wallet/CHANGELOG.md b/packages/browser-wallet/CHANGELOG.md index 13900711f..f8d9e4fc2 100644 --- a/packages/browser-wallet/CHANGELOG.md +++ b/packages/browser-wallet/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.6.3 + +### Fixed + +- Use new wallet proxy endpoint `/v2/ip_info` which include Company ID Providers, as these are now removed from the `/v1/ip_info`. + ## 1.6.2 ### Fixed diff --git a/packages/browser-wallet/package.json b/packages/browser-wallet/package.json index 85d22269e..c8139d34a 100644 --- a/packages/browser-wallet/package.json +++ b/packages/browser-wallet/package.json @@ -1,7 +1,7 @@ { "name": "@concordium/browser-wallet", "private": true, - "version": "1.6.2", + "version": "1.6.3", "description": "Browser extension wallet for the Concordium blockchain", "author": "Concordium Software", "license": "Apache-2.0", diff --git a/packages/browser-wallet/src/popup/shared/utils/wallet-proxy.ts b/packages/browser-wallet/src/popup/shared/utils/wallet-proxy.ts index e91c29ce0..140f43169 100644 --- a/packages/browser-wallet/src/popup/shared/utils/wallet-proxy.ts +++ b/packages/browser-wallet/src/popup/shared/utils/wallet-proxy.ts @@ -259,7 +259,7 @@ export async function getTransactions( } export async function getIdentityProviders(): Promise { - const proxyPath = `/v1/ip_info`; + const proxyPath = `/v2/ip_info`; const response = await (await getWalletProxy()).get(proxyPath); return response.data; } From 062262ee11586432680e95d64bc70164a71c879d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Holm=20Gj=C3=B8rup?= Date: Mon, 19 Aug 2024 14:03:47 +0200 Subject: [PATCH 2/2] Only use the new endpoint for testnet --- packages/browser-wallet/CHANGELOG.md | 2 +- .../browser-wallet/src/popup/shared/utils/wallet-proxy.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/browser-wallet/CHANGELOG.md b/packages/browser-wallet/CHANGELOG.md index f8d9e4fc2..f249b7715 100644 --- a/packages/browser-wallet/CHANGELOG.md +++ b/packages/browser-wallet/CHANGELOG.md @@ -4,7 +4,7 @@ ### Fixed -- Use new wallet proxy endpoint `/v2/ip_info` which include Company ID Providers, as these are now removed from the `/v1/ip_info`. +- Use new wallet proxy endpoint `/v2/ip_info` which includes Company ID Providers, as these are now removed from the `/v1/ip_info`. ## 1.6.2 diff --git a/packages/browser-wallet/src/popup/shared/utils/wallet-proxy.ts b/packages/browser-wallet/src/popup/shared/utils/wallet-proxy.ts index 140f43169..0721e29c6 100644 --- a/packages/browser-wallet/src/popup/shared/utils/wallet-proxy.ts +++ b/packages/browser-wallet/src/popup/shared/utils/wallet-proxy.ts @@ -259,7 +259,12 @@ export async function getTransactions( } export async function getIdentityProviders(): Promise { - const proxyPath = `/v2/ip_info`; + const currentNetwork = await storedCurrentNetwork.get(); + if (currentNetwork === undefined) { + throw new Error('Tried to access wallet proxy without a loaded network.'); + } + // Use the new endpoint for Testnet only, this logic can be simplified once Company ID as been released on mainnet. + const proxyPath = currentNetwork.name === 'Concordium Testnet' ? '/v2/ip_info' : '/v1/ip_info'; const response = await (await getWalletProxy()).get(proxyPath); return response.data; }