Skip to content

Commit

Permalink
explorers list fixed, different logo, new domains
Browse files Browse the repository at this point in the history
  • Loading branch information
tempe-techie committed Jan 16, 2024
1 parent 2ca72c9 commit 14b9aeb
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 144 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"scripts": {
"serve": "export NODE_ENV=development && webpack --mode='development' --watch --config ./webpack.config.js",
"build": "export NODE_ENV=production && webpack --mode='production' --config ./webpack.config.js",
"serve-window": "set NODE_ENV=development && webpack --config ./webpack.config.js",
"build-window": "set NODE_ENV=production && webpack --config ./webpack.config.js"
"serve-windows": "set NODE_ENV=development && webpack --config ./webpack.config.js",
"build-windows": "set NODE_ENV=production && webpack --config ./webpack.config.js"
},
"author": "",
"license": "ISC",
Expand Down
Binary file modified src/assets/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 13 additions & 24 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,23 @@ chrome.webNavigation.onBeforeNavigate.addListener(function(data) {

// check if request comes from a block explorer search
if (
url.href.startsWith("https://optimistic.etherscan.io/search?") ||
url.href.startsWith("https://polygonscan.com/search?") ||
url.href.startsWith("https://arbiscan.io/search?") ||
url.href.startsWith("https://songbird-explorer.flare.network/search?") ||
url.href.startsWith("https://flare-explorer.flare.network/search?") ||
url.href.startsWith("https://basescan.org/search?") ||
url.href.startsWith("https://etherscan.io/search?") ||
url.href.startsWith("https://bscscan.com/search?") ||
url.href.startsWith("https://etherscan.io/search?") ||
url.href.startsWith("https://era.zksync.network/search?") ||
url.href.startsWith("https://flare-explorer.flare.network") ||
url.href.startsWith("https://ftmscan.com/search?") ||
url.href.startsWith("https://gnosisscan.io/search?")
url.href.startsWith("https://gnosisscan.io/search?") ||
url.href.startsWith("https://gnosis.blockscout.com") ||
url.href.startsWith("https://kromascan.com/search?") ||
url.href.startsWith("https://lineascan.build/search?") ||
url.href.startsWith("https://nova.arbiscan.io/search?") ||
url.href.startsWith("https://optimistic.etherscan.io/search?") ||
url.href.startsWith("https://polygonscan.com/search?") ||
url.href.startsWith("https://scan.zkfair.io") ||
url.href.startsWith("https://scrollscan.com/search?") ||
url.href.startsWith("https://songbird-explorer.flare.network")
) {
// if so, redirect user to domain owner's address page on block explorer
getDomainHolder(domainName, tldData.address, tldData.chainId).then(function(resp) {
Expand All @@ -42,24 +49,6 @@ chrome.webNavigation.onBeforeNavigate.addListener(function(data) {
return chrome.tabs.update(data.tabId, { url: data.url });
}
});
} else if (url.href.startsWith("https://blockscout.com/xdai/mainnet/search")) {
// gnosis chain explorer support
getDomainHolder(domainName, tldData.address, tldData.chainId).then(function(resp) {
if (resp && resp.startsWith("0x")) {
return chrome.tabs.update(data.tabId, { url: "https://" + url.host + "/xdai/mainnet/address/" + resp });
} else {
return chrome.tabs.update(data.tabId, { url: data.url });
}
}); //
} else if (url.href.startsWith("https://explorer.zksync.io/search")) {
// gnosis chain explorer support
getDomainHolder(domainName, tldData.address, tldData.chainId).then(function(resp) {
if (resp && resp.startsWith("0x")) {
return chrome.tabs.update(data.tabId, { url: "https://" + url.host + "/address/" + resp });
} else {
return chrome.tabs.update(data.tabId, { url: data.url });
}
});
} else {
// otherwise check if user has a URL stored in domain data and redirect there, or redirect to domain page on Punk Domains
getDomainDataUrl(domainName, queryParts[1].toLowerCase(), tldData.address, tldData.chainId, result.punkFastMode).then(function(resp) {
Expand Down
70 changes: 44 additions & 26 deletions src/utils/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ export const getFallbackProvider = (networkId) => {
urls = [
"https://mainnet.optimism.io"
];
} else if (networkId === 14) {
// Flare Mainnet
urls = [
"https://flare-api.flare.network/ext/C/rpc"
];
} else if (networkId === 19) {
// Songbird Canary-Network
urls = [
"https://songbird-api.flare.network/ext/C/rpc"
];
} else if (networkId === 56) {
// BNB Smart Chain Mainnet
urls = [
"https://bsc-dataseed.binance.org"
];
} else if (networkId === 100) {
// Gnosis Chain
urls = [
Expand All @@ -16,51 +31,54 @@ export const getFallbackProvider = (networkId) => {
} else if (networkId === 137) {
// Polygon PoS Chain
urls = [
"https://polygon-rpc.com/"
"https://rpc.ankr.com/polygon"
];
} else if (networkId === 42161) {
// Arbitrum
} else if (networkId === 250) {
// Fantom Opera
urls = [
"https://arb1.arbitrum.io/rpc"
"https://rpc.fantom.network"
];
// +
} else if (networkId === 19) {
// Songbird Canary-Network
} else if (networkId === 255) {
// Kroma
urls = [
"https://songbird-api.flare.network/ext/C/rpc"
"https://api.kroma.network"
];
} else if (networkId === 14) {
// Flare Mainnet
} else if (networkId === 324) {
// zkSync Era Mainnet
urls = [
"https://flare-api.flare.network/ext/C/rpc"
"https://mainnet.era.zksync.io"
];
} else if (networkId === 8453) {
}else if (networkId === 8453) {
// Base
urls = [
"https://mainnet.base.org"
];
// ++
} else if (networkId === 1) {
// Ethereum Mainnet
} else if (networkId === 42161) {
// Arbitrum One
urls = [
"https://mainnet.infura.io/v3/"
"https://arb1.arbitrum.io/rpc"
];
} else if (networkId === 56) {
// BNB Smart Chain Mainnet
} else if (networkId === 42170) {
// Arbitrum Nova
urls = [
"https://bsc-dataseed.binance.org"
"https://nova.arbitrum.io/rpc"
];
} else if (networkId === 250) {
// Fantom Opera
} else if (networkId === 42766) {
// ZKFair
urls = [
"https://rpc.fantom.network"
"https://rpc.zkfair.io"
];
} else if (networkId === 324) {
// zkSync Era Mainnet
} else if (networkId === 59144) {
// Linea
urls = [
"https://mainnet.era.zksync.io"
"https://rpc.linea.build"
];
}
} else if (networkId === 534352) {
// Scroll
urls = [
"https://rpc.scroll.io"
];
}

if (urls) {
const providers = urls.map(url => new ethers.providers.JsonRpcProvider(url));
Expand Down
39 changes: 22 additions & 17 deletions src/utils/punk.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,41 @@ import { getTldInterface } from "./interfaces";
export const getDomainDataUrl = async (domainName, tld, tldAddress, chainId, mode) => {
let baseUrl = "https://punk.domains";

if (tld === "klima") {
baseUrl = "https://www.kns.earth";
} else if (tld === "smol") {
baseUrl = "https://smol.domains";
// +
} else if (tld === "sgb") {
baseUrl = "https://songbird.domains";
} else if (tld === "flr") {
baseUrl = "https://flr.domains";
} else if (tld === "basebook") {
baseUrl = "https://id.basebook.xyz";
// ++
if (tld === "basebook") {
baseUrl = "https://id.basebook.xyz";
} else if (tld === "based") {
baseUrl = "https://basednames.xyz";
} else if (tld === "basepunk") {
baseUrl = "https://id.basepunk.xyz";
} else if (tld === "basin") {
baseUrl = "https://app.basin.global";
} else if (tld === "wildbunch") {
baseUrl = "https://twb.punk.domains";
} else if (tld === "dope") {
baseUrl = "https://dns.dopewars.gg";
} else if (tld === "fantom") {
baseUrl = "https://fantomnames.org";
baseUrl = "https://fantomname.org";
} else if (tld === "flr") {
baseUrl = "https://flr.domains";
} else if (tld === "giveth") {
baseUrl = "https://giveth.punk.domains";
} else if (tld === "klima") {
baseUrl = "https://www.kns.earth";
} else if (tld === "op") {
baseUrl = "https://optimistic.domains";
} else if (tld === "dope") {
} else if (tld === "pool") {
baseUrl = "https://names.pooly.me";
} else if (tld === "ppl") {
baseUrl = "https://ppl.domains";
} else if (tld === "satrap") {
baseUrl = "https://id.satraps.io";
} else if (tld === "scrolly") {
baseUrl = "https://sns.scrolly.xyz";
} else if (tld === "sgb") {
baseUrl = "https://songbird.domains";
} else if (tld === "smol") {
baseUrl = "https://smol.domains";
} else if (tld === "zksoul") {
baseUrl = "https://id.zkchat.net";
}


const punkUrl = baseUrl + "/#/domain/"+chainId+"/"+tld+"/"+domainName;

Expand Down
Loading

0 comments on commit 14b9aeb

Please sign in to comment.