Skip to content

Commit

Permalink
Merge pull request #89 from argentlabs/feat/sepolia-ww-argent-mobile
Browse files Browse the repository at this point in the history
fix: remove goerli for sepolia
  • Loading branch information
bluecco authored Mar 26, 2024
2 parents 4302df4 + 1597c9a commit feaa356
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/connectors/argentMobile/modal/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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://"
}
Expand Down
8 changes: 4 additions & 4 deletions src/connectors/argentMobile/modal/starknet/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -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
}

Expand Down
3 changes: 1 addition & 2 deletions src/connectors/injected/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/helpers/mapTargetUrlToNetworkId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit feaa356

Please sign in to comment.