From 1597c9a18b796383586bb8e461475c3afe29d20e Mon Sep 17 00:00:00 2001 From: bluecco Date: Mon, 25 Mar 2024 10:03:18 +0100 Subject: [PATCH] fix: remove goerli for sepolia --- src/connectors/argentMobile/modal/login.ts | 8 ++++---- src/connectors/argentMobile/modal/starknet/adapter.ts | 8 ++++---- src/connectors/injected/index.ts | 3 +-- src/helpers/mapTargetUrlToNetworkId.ts | 6 +++--- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/connectors/argentMobile/modal/login.ts b/src/connectors/argentMobile/modal/login.ts index e3b3c5e..56b62a8 100644 --- a/src/connectors/argentMobile/modal/login.ts +++ b/src/connectors/argentMobile/modal/login.ts @@ -126,8 +126,8 @@ const getBridgeUrl = (chainId: unknown) => { } const chainIdNumber = parseInt(`${chainId}`) if ( - String(chainId).startsWith(Network.SN_GOERLI) || - chainIdNumber === 5 // testnet numeric value + String(chainId).startsWith(Network.SN_SEPOLIA) || + chainIdNumber === 11155111 // sepolia numeric value ) { return "https://login.hydrogen.argent47.net" } @@ -148,8 +148,8 @@ const getMobileUrl = (chainId: unknown) => { } const chainIdNumber = parseInt(`${chainId}`) if ( - String(chainId).startsWith(Network.SN_GOERLI) || - chainIdNumber === 5 // testnet numeric value + String(chainId).startsWith(Network.SN_SEPOLIA) || + chainIdNumber === 11155111 // sepolia numeric value ) { return "argent-dev://" } diff --git a/src/connectors/argentMobile/modal/starknet/adapter.ts b/src/connectors/argentMobile/modal/starknet/adapter.ts index 9441101..550187e 100644 --- a/src/connectors/argentMobile/modal/starknet/adapter.ts +++ b/src/connectors/argentMobile/modal/starknet/adapter.ts @@ -107,8 +107,8 @@ export class StarknetAdapter } getNetworkName(chainId: string): constants.NetworkName { - if (chainId === "SN_GOERLI") { - return constants.NetworkName.SN_GOERLI + if (chainId === "SN_SEPOLIA") { + return constants.NetworkName.SN_SEPOLIA } if (chainId === "SN_MAIN") { @@ -229,8 +229,8 @@ export class StarknetAdapter } private handleRequestChainId = () => { - return this.chainId === constants.NetworkName.SN_GOERLI - ? constants.StarknetChainId.SN_GOERLI + return this.chainId === constants.NetworkName.SN_SEPOLIA + ? constants.StarknetChainId.SN_SEPOLIA : constants.StarknetChainId.SN_MAIN } diff --git a/src/connectors/injected/index.ts b/src/connectors/injected/index.ts index c893e2f..ef37f4e 100644 --- a/src/connectors/injected/index.ts +++ b/src/connectors/injected/index.ts @@ -85,11 +85,10 @@ export class InjectedConnector extends Connector { chainId?: StarknetChainId, accounts?: string[], ): void { - const { SN_GOERLI, SN_MAIN, SN_SEPOLIA } = constants.StarknetChainId + const { SN_MAIN, SN_SEPOLIA } = constants.StarknetChainId const account = accounts?.[0] switch (chainId) { case SN_MAIN: - case SN_GOERLI: case SN_SEPOLIA: this.emit("change", { chainId, account }) break diff --git a/src/helpers/mapTargetUrlToNetworkId.ts b/src/helpers/mapTargetUrlToNetworkId.ts index e64f2d7..580a52d 100644 --- a/src/helpers/mapTargetUrlToNetworkId.ts +++ b/src/helpers/mapTargetUrlToNetworkId.ts @@ -3,7 +3,7 @@ import { constants } from "starknet" // Using NetworkName as a value. const Network: typeof constants.NetworkName = constants.NetworkName -const DEVELOPMENT_NETWORK = Network.SN_GOERLI +const DEVELOPMENT_NETWORK = Network.SN_SEPOLIA export function mapTargetUrlToNetworkId(target: string): constants.NetworkName { try { @@ -12,13 +12,13 @@ export function mapTargetUrlToNetworkId(target: string): constants.NetworkName { return DEVELOPMENT_NETWORK } if (origin.includes("hydrogen")) { - return Network.SN_GOERLI + return Network.SN_SEPOLIA } if (origin.includes("staging")) { return Network.SN_MAIN } if (origin.includes("dev")) { - return Network.SN_GOERLI + return Network.SN_SEPOLIA } if (origin.includes("argent.xyz")) { return Network.SN_MAIN