Skip to content

Commit

Permalink
fix: add more referrer
Browse files Browse the repository at this point in the history
  • Loading branch information
HappySean2845 committed Jun 5, 2024
1 parent 90e4d00 commit 56e4a45
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
import { availableChains } from "./config/chains";
import { availableChains } from './config/chains'

export const isCyberWallet = () =>
typeof document !== "undefined" &&
typeof document !== 'undefined' &&
[
"https://next.wallet.cyber.co/",
"https://wallet-sandbox.cyber.co/",
"https://wallet.cyber.co/",
"https://cyberwallet-sandbox-cyberconnect.vercel.app/",
].includes(document.referrer);
'https://next.wallet.cyber.co/',
'https://wallet-sandbox.cyber.co/',
'https://wallet.cyber.co/',
'https://cyberwallet-sandbox-cyberconnect.vercel.app/',
'https://link3.to/',
'https://stg.link3.to/',
'https://next.link3.to/',
].includes(document.referrer)

export function isChainUnsupported(chainId: number) {
return !Object.values(availableChains)
.map((chain) => chain.id)
.includes(chainId);
.includes(chainId)
}

export function getSignerAddress() {
const storage = localStorage.getItem("cyber-app-sdk");
const storage = localStorage.getItem('cyber-app-sdk')

if (!storage) {
return null;
return null
}

const cyberAccountData = JSON.parse(storage);
return cyberAccountData.ownerAddress;
const cyberAccountData = JSON.parse(storage)
return cyberAccountData.ownerAddress
}

0 comments on commit 56e4a45

Please sign in to comment.