Skip to content

Commit d6d4609

Browse files
authored
Merge pull request #334 from fuseio/feat/flash_details
flash details and button
2 parents 9bf6280 + 4e4fa7b commit d6d4609

2 files changed

Lines changed: 23 additions & 16 deletions

File tree

docs/components/ConnectToEmberButton/ConnectButton.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,21 @@ import styles from "./styles.module.css";
33

44
export default function ConnectButton() {
55
const [networkStatus, setNetworkStatus] = useState("disconnected"); // "disconnected" | "wrong_network" | "connected"
6-
const CHAIN_ID_DECIMAL = 1264453517;
6+
const CHAIN_ID_DECIMAL = 10920;
77
const CHAIN_ID_HEX = `0x${CHAIN_ID_DECIMAL.toString(16)}`;
88

99
const EMBER_TESTNET = {
1010
chainId: CHAIN_ID_HEX,
1111
chainName: "Flash Testnet",
1212
nativeCurrency: {
13-
name: "FUSE",
14-
symbol: "FUSE",
13+
name: "ETH",
14+
symbol: "ETH",
1515
decimals: 18,
1616
},
17-
rpcUrls: ["https://rpc.flash.fuse.io"],
18-
blockExplorerUrls: ["https://explorer.flash.fuse.io"],
17+
rpcUrls: [
18+
"https://floral-green-gadget.fuse-flash.quiknode.pro/0b560e99d1a605b43771fc313dbc3e7054df160e/",
19+
],
20+
blockExplorerUrls: ["https://fuse-flash.explorer.quicknode.com/"],
1921
};
2022

2123
const checkNetwork = async () => {
@@ -54,8 +56,13 @@ export default function ConnectButton() {
5456
params: [{chainId: EMBER_TESTNET.chainId}],
5557
});
5658
} catch (switchError) {
57-
// If network doesn't exist, add it
58-
if (switchError.code === 4902) {
59+
// Check both the top-level code and originalError.code
60+
if (
61+
switchError.code === 4902 ||
62+
(switchError.data &&
63+
switchError.data.originalError &&
64+
switchError.data.originalError.code === 4902)
65+
) {
5966
try {
6067
await window.ethereum.request({
6168
method: "wallet_addEthereumChain",

docs/fuse-ember/connect-to-ember/connect-to-ember.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ Use the information below to connect and submit transactions to Ember.
1313

1414
## Testnet
1515

16-
| Property | Description |
17-
| --------------- | ------------------------------- |
18-
| Name | Flash Testnet |
19-
| Description | The public testnet for Ember. |
20-
| Chain ID | 1264453517 |
21-
| RPC URL | https://rpc.flash.fuse.io |
22-
| Explorer URL | https://explorer.flash.fuse.io |
23-
| Sequencer URL | https://sequencer.flash.fuse.io |
24-
| Currency Symbol | FUSE |
16+
| Property | Description |
17+
| --------------- | --------------------------------------------------------------------------------------------- |
18+
| Name | Flash Testnet |
19+
| Description | The public testnet for Ember. |
20+
| Chain ID | 10920 |
21+
| RPC URL | https://floral-green-gadget.fuse-flash.quiknode.pro/0b560e99d1a605b43771fc313dbc3e7054df160e/ |
22+
| Explorer URL | https://fuse-flash.explorer.quicknode.com/ |
23+
| Sequencer URL | https://sequencer.flash.fuse.io |
24+
| Currency Symbol | ETH |
2525

2626
<ConnectButton />
2727

0 commit comments

Comments
 (0)