Skip to content

Commit 966ec39

Browse files
yacine-benichouYacine Benichou
and
Yacine Benichou
authored
Fix issue where supported network link did not work for certain netwo… (#1415)
* Fix issue where supported network link did not work for certain networks + Fix typos * Edits * Apply small syntax suggestion --------- Co-authored-by: Yacine Benichou <[email protected]>
1 parent e0d557e commit 966ec39

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/features/vrf/v2/components/CostTable.tsx

+11-6
Original file line numberDiff line numberDiff line change
@@ -274,19 +274,23 @@ export const CostTable = ({ mainChain, chain, method }: Props) => {
274274

275275
const getsupportedNetworkShortcut = () => {
276276
const mainChainName = mainChain.name.toLowerCase()
277+
const subChainName = chain.name.toLowerCase()
277278
switch (mainChainName) {
278279
case "ethereum":
280+
if (subChainName !== "mainnet") {
281+
return `${subChainName}-${chain.type}`
282+
}
279283
return `${mainChainName}-${chain.type}`
280284
case "bnb chain":
281-
return `${mainChainName}-chain${chain.type === "testnet" ? "-" + chain.type : ""}`
285+
return `${mainChainName.replace(" ", "-")}${chain.type === "testnet" ? "-" + chain.type : ""}`
282286
case "polygon":
283-
return `${mainChainName}-matic-${chain.type === "testnet" ? chain.name + "-" + chain.type : chain.type}`
287+
return `${mainChainName}-matic-${chain.type === "testnet" ? subChainName + "-" + chain.type : chain.type}`
284288
case "avalanche":
285-
return `${mainChainName}-${chain.type === "testnet" ? chain.name + "-" + chain.type : chain.type}`
289+
return `${mainChainName}-${chain.type === "testnet" ? subChainName + "-" + chain.type : chain.type}`
286290
case "fantom":
287291
return `${mainChainName}-${chain.type}`
288292
case "arbitrum":
289-
return `${mainChainName}-${chain.type === "testnet" ? chain.name + "-" + chain.type : chain.type}`
293+
return `${mainChainName}-${chain.type === "testnet" ? subChainName + "-" + chain.type : chain.type}`
290294
default:
291295
throw new Error("network/chain does not exist or is not supported by VRF yet.")
292296
}
@@ -527,7 +531,8 @@ export const CostTable = ({ mainChain, chain, method }: Props) => {
527531
<>
528532
<h6>Maximum cost per request under the selected gas lane: {formatmaxCost()} LINK</h6>
529533
<p>
530-
If you use the subscription method, a minimum balance of LINK is required use VRF. Check your balance at
534+
If you use the subscription method, a minimum balance of LINK is required to use VRF. Check your balance
535+
at
531536
<a href="https://vrf.chain.link" target="_blank">
532537
{" "}
533538
vrf.chain.link
@@ -537,7 +542,7 @@ export const CostTable = ({ mainChain, chain, method }: Props) => {
537542
</>
538543
)}
539544
<p>
540-
To see these parameters in more detail, read the
545+
To see these parameters in greater detail, read the
541546
<a href={`/vrf/v2/${kebabize(method)}/supported-networks/#${getsupportedNetworkShortcut()}`} target="_blank">
542547
{" "}
543548
Supported Networks{" "}

0 commit comments

Comments
 (0)