From acb9a5c79fb63e0485e17242c168290ed5d3b04f Mon Sep 17 00:00:00 2001 From: bluecco Date: Mon, 29 Jul 2024 16:35:16 +0200 Subject: [PATCH 1/4] fix: wc params for argent mobile --- .../argentMobile/modal/argentModal.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/connectors/argentMobile/modal/argentModal.ts b/src/connectors/argentMobile/modal/argentModal.ts index be6a846..8b9772e 100644 --- a/src/connectors/argentMobile/modal/argentModal.ts +++ b/src/connectors/argentMobile/modal/argentModal.ts @@ -72,21 +72,10 @@ class ArgentModal { const wcParam = encodeURIComponent(wcUri) const href = encodeURIComponent(window.location.href) - /* - // KEEPING IN CASE NEEDS TO BE REVERTED - const desktopWcParam = encodeURIComponent( - `${this.mobileUrl}app/wc?uri=${wcParam}`, - - this.showModal({ - desktop: `${this.bridgeUrl}?wc=${desktopWcParam}&device=desktop`, - ios: `${this.mobileUrl}app/wc?uri=${wcParam}&href=${href}&device=mobile`, - android: `${this.mobileUrl}app/wc?uri=${wcParam}&href=${href}&device=mobile`, - }) - - ) */ + const desktopWcParam = encodeURIComponent(wcParam) this.showModal({ - desktop: `${this.bridgeUrl}?wc=${wcParam}&device=desktop`, + desktop: `${this.bridgeUrl}?wc=${desktopWcParam}&href=${href}&device=desktop`, ios: `${this.mobileUrl}app/wc?uri=${wcParam}&href=${href}&device=mobile`, android: `${this.mobileUrl}app/wc?uri=${wcParam}&href=${href}&device=mobile`, }) @@ -109,7 +98,7 @@ class ArgentModal { this should be ignored and not considered valid as it's only used for automatically redirecting the users to approve or reject a signing request. */ this.showModal({ - desktop: `${this.bridgeUrl}?action=sign&device=desktop`, + desktop: `${this.bridgeUrl}?action=sign&device=desktop&href=${href}`, ios: `${this.mobileUrl}app/wc/request?href=${href}&device=mobile`, android: `${this.mobileUrl}app/wc/request?href=${href}&device=mobile`, }) From 792deaf974ef073266c2bf211552b5507b5528ca Mon Sep 17 00:00:00 2001 From: bluecco Date: Tue, 6 Aug 2024 14:50:50 +0200 Subject: [PATCH 2/4] fix: udpate argent mobile login link --- src/connectors/argentMobile/modal/argentModal.ts | 9 +++++---- src/connectors/argentMobile/modal/login.ts | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/connectors/argentMobile/modal/argentModal.ts b/src/connectors/argentMobile/modal/argentModal.ts index 8b9772e..4941f7f 100644 --- a/src/connectors/argentMobile/modal/argentModal.ts +++ b/src/connectors/argentMobile/modal/argentModal.ts @@ -59,7 +59,7 @@ interface Urls { } class ArgentModal { - public bridgeUrl = "https://login.argent.xyz" + public bridgeUrl = "https://mobile-login.argent.xyz" public mobileUrl = "argent://" public type: "overlay" | "window" = "overlay" public wcUri?: string @@ -72,10 +72,9 @@ class ArgentModal { const wcParam = encodeURIComponent(wcUri) const href = encodeURIComponent(window.location.href) - const desktopWcParam = encodeURIComponent(wcParam) - this.showModal({ - desktop: `${this.bridgeUrl}?wc=${desktopWcParam}&href=${href}&device=desktop`, + //desktop: `http://localhost:3001?wc=${wcParam}&href=${href}&device=desktop`, + desktop: `${this.bridgeUrl}?wc=${wcParam}&href=${href}&device=desktop`, ios: `${this.mobileUrl}app/wc?uri=${wcParam}&href=${href}&device=mobile`, android: `${this.mobileUrl}app/wc?uri=${wcParam}&href=${href}&device=mobile`, }) @@ -84,6 +83,7 @@ class ArgentModal { public showApprovalModal(_: RequestArguments): void { if (device === "desktop") { this.showModal({ + //desktop: `http://localhost:3001?action=sign`, desktop: `${this.bridgeUrl}?action=sign`, ios: "", android: "", @@ -98,6 +98,7 @@ class ArgentModal { this should be ignored and not considered valid as it's only used for automatically redirecting the users to approve or reject a signing request. */ this.showModal({ + //desktop: `http://localhost:3001?action=sign&device=desktop&href=${href}`, desktop: `${this.bridgeUrl}?action=sign&device=desktop&href=${href}`, ios: `${this.mobileUrl}app/wc/request?href=${href}&device=mobile`, android: `${this.mobileUrl}app/wc/request?href=${href}&device=mobile`, diff --git a/src/connectors/argentMobile/modal/login.ts b/src/connectors/argentMobile/modal/login.ts index 56b62a8..834b41d 100644 --- a/src/connectors/argentMobile/modal/login.ts +++ b/src/connectors/argentMobile/modal/login.ts @@ -129,14 +129,14 @@ const getBridgeUrl = (chainId: unknown) => { String(chainId).startsWith(Network.SN_SEPOLIA) || chainIdNumber === 11155111 // sepolia numeric value ) { - return "https://login.hydrogen.argent47.net" + return "https://mobile-login.hydrogen.argent47.net" } if ( String(chainId).startsWith(Network.SN_MAIN) || chainIdNumber === 1 // mainnet numeric value ) { - return "https://login.argent.xyz" + return "https://mobile-login.argent.xyz" } } From d1d11dc7bbfb2c5e1bf6ec90c737670b176e4b1c Mon Sep 17 00:00:00 2001 From: bluecco Date: Tue, 6 Aug 2024 15:00:25 +0200 Subject: [PATCH 3/4] chore: revert prod argent mobile login --- src/connectors/argentMobile/modal/login.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connectors/argentMobile/modal/login.ts b/src/connectors/argentMobile/modal/login.ts index 834b41d..c25f88b 100644 --- a/src/connectors/argentMobile/modal/login.ts +++ b/src/connectors/argentMobile/modal/login.ts @@ -136,7 +136,7 @@ const getBridgeUrl = (chainId: unknown) => { String(chainId).startsWith(Network.SN_MAIN) || chainIdNumber === 1 // mainnet numeric value ) { - return "https://mobile-login.argent.xyz" + return "https://login.argent.xyz" } } From 4e4a988f8d431d1c2afb53be8963c4a26137e426 Mon Sep 17 00:00:00 2001 From: bluecco Date: Tue, 6 Aug 2024 15:01:49 +0200 Subject: [PATCH 4/4] chore: remove comments --- src/connectors/argentMobile/modal/argentModal.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/connectors/argentMobile/modal/argentModal.ts b/src/connectors/argentMobile/modal/argentModal.ts index 4941f7f..418f4fe 100644 --- a/src/connectors/argentMobile/modal/argentModal.ts +++ b/src/connectors/argentMobile/modal/argentModal.ts @@ -59,7 +59,7 @@ interface Urls { } class ArgentModal { - public bridgeUrl = "https://mobile-login.argent.xyz" + public bridgeUrl = "https://login.argent.xyz" public mobileUrl = "argent://" public type: "overlay" | "window" = "overlay" public wcUri?: string @@ -73,7 +73,6 @@ class ArgentModal { const href = encodeURIComponent(window.location.href) this.showModal({ - //desktop: `http://localhost:3001?wc=${wcParam}&href=${href}&device=desktop`, desktop: `${this.bridgeUrl}?wc=${wcParam}&href=${href}&device=desktop`, ios: `${this.mobileUrl}app/wc?uri=${wcParam}&href=${href}&device=mobile`, android: `${this.mobileUrl}app/wc?uri=${wcParam}&href=${href}&device=mobile`, @@ -83,7 +82,6 @@ class ArgentModal { public showApprovalModal(_: RequestArguments): void { if (device === "desktop") { this.showModal({ - //desktop: `http://localhost:3001?action=sign`, desktop: `${this.bridgeUrl}?action=sign`, ios: "", android: "", @@ -98,7 +96,6 @@ class ArgentModal { this should be ignored and not considered valid as it's only used for automatically redirecting the users to approve or reject a signing request. */ this.showModal({ - //desktop: `http://localhost:3001?action=sign&device=desktop&href=${href}`, desktop: `${this.bridgeUrl}?action=sign&device=desktop&href=${href}`, ios: `${this.mobileUrl}app/wc/request?href=${href}&device=mobile`, android: `${this.mobileUrl}app/wc/request?href=${href}&device=mobile`,