Skip to content

Commit d8fa607

Browse files
committed
Merge branch 'main' into feat/docs-revamp-layout
2 parents b60e00a + 4611a5c commit d8fa607

File tree

6 files changed

+118
-8
lines changed

6 files changed

+118
-8
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import React, { useEffect, useState } from 'react';
2+
import styles from '../../styles/InteractiveTerminal.module.css';
3+
4+
const InteractiveTerminal: React.FC = () => {
5+
const [jsonData, setJsonData] = useState<any>(null);
6+
const [expandedNodes, setExpandedNodes] = useState<Set<string>>(new Set());
7+
8+
useEffect(() => {
9+
fetch('https://raw.githubusercontent.com/cosmos/chain-registry/refs/heads/master/sei/chain.json')
10+
.then((res) => res.json())
11+
.then((data) => setJsonData(data))
12+
.catch((err) => console.error('Failed to fetch JSON data:', err));
13+
}, []);
14+
15+
const toggleNode = (path: string) => {
16+
setExpandedNodes((prevNodes) => {
17+
const newNodes = new Set(prevNodes);
18+
if (newNodes.has(path)) {
19+
newNodes.delete(path);
20+
} else {
21+
newNodes.add(path);
22+
}
23+
return newNodes;
24+
});
25+
};
26+
27+
const renderNode = (key: string, value: any, path: string) => {
28+
const isExpandable = typeof value === 'object' && value !== null;
29+
const isOpen = expandedNodes.has(path);
30+
const displayKey = key || 'root';
31+
32+
return (
33+
<div key={path} className={styles.node}>
34+
<div className={styles.nodeHeader} onClick={() => isExpandable && toggleNode(path)}>
35+
{isExpandable && (isOpen ? '▼' : '▶')} {displayKey}
36+
</div>
37+
{isExpandable && isOpen && (
38+
<div className={styles.nodeChildren}>
39+
{Object.entries(value).map(([childKey, childValue]) => renderNode(childKey, childValue, `${path}.${childKey}`))}
40+
</div>
41+
)}
42+
{!isExpandable && <div className={styles.leafNode}>{String(value)}</div>}
43+
</div>
44+
);
45+
};
46+
47+
return (
48+
<div className={styles.terminal}>
49+
<div className={styles.header}>
50+
<div className={styles.circle} style={{ backgroundColor: '#FF605C' }} />
51+
<div className={styles.circle} style={{ backgroundColor: '#FFBD44' }} />
52+
<div className={styles.circle} style={{ backgroundColor: '#00CA4E' }} />
53+
</div>
54+
<div className={styles.body}>{jsonData ? renderNode('', jsonData, 'root') : <div className={styles.loading}>Loading...</div>}</div>
55+
</div>
56+
);
57+
};
58+
59+
export default InteractiveTerminal;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as InteractiveTerminal } from './InteractiveTerminal';

components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ export * from './Nfts';
1515
export * from './VersionFetcher';
1616
export * from './PropertyInfo';
1717
export * from './EcosystemMap';
18+
export * from './InteractiveTerminal';

pages/build/dev-ecosystem-providers/wallets.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Wallets are essential for managing assets and interacting with the Sei blockchai
1313

1414
| Wallet | EVM Support | Native Support | Authentication Method | Coin Type | Type | Mobile Support | Link |
1515
|--------------------------------|-------------|----------------|-----------------------|-----------|----------|----------------|-----------------------------------------------------------------------------------------------|
16+
| **Arculus** ||| Hardware | 118 / 60 | Software || [Arculus](https://www.getarculus.com) |
1617
| **Compass** ||| Mnemonic / Privkey | 118 | Software || [Compass Wallet](https://compasswallet.io) |
1718
| **Fin** ||| Mnemonic / Privkey | 118 | Software || [Fin Wallet](https://finwallet.com) |
1819
| **Keplr** ||| Mnemonic / Privkey | 118 | Software || [Keplr Wallet](https://wallet.keplr.app) |

pages/users/wallet-setup.mdx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,11 @@ import cosmSigningImage from "../../public/assets/cosm-signing.png";
88

99
### Installing a Wallet app
1010

11-
**For complete functionality, it is recommended to navigate Sei with one of the wallets listed on the Wallets Page:**
12-
13-
[Wallets Page](../dev-ecosystem-providers/wallets.mdx)
14-
15-
For more wallet options, please visit our [registry](https://github.com/sei-protocol/chain-registry/blob/main/wallets.json).
11+
**For complete functionality, it is recommended to use one of the wallets listed on the [Wallets Page](../dev-ecosystem-providers/wallets.mdx)**
1612

1713
<Callout type="warning">
18-
**Caution:** It is not recommended to manually import from an EVM-only wallet
19-
to a native Sei wallet, or vice versa. Doing so may result in a different
20-
address.
14+
**Attention:** Manually importing your wallet using a mnemonic from an EVM-only wallet app
15+
to a Cosmos based wallet app, or vice versa is not recommended. This may generate unexpected wallet address due to differing [cointypes](https://en.bitcoin.it/wiki/BIP_0044#Coin_type).
2116
</Callout>
2217

2318
### Adding the Network to Metamask

styles/InteractiveTerminal.module.css

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
.terminal {
2+
background-color: #1e1e1e;
3+
color: #00ff00;
4+
border-radius: 8px;
5+
padding: 16px;
6+
font-family: 'Courier New', monospace;
7+
width: 600px;
8+
margin: 0 auto;
9+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
10+
}
11+
12+
.header {
13+
display: flex;
14+
justify-content: flex-start;
15+
padding-bottom: 8px;
16+
}
17+
18+
.circle {
19+
width: 12px;
20+
height: 12px;
21+
border-radius: 50%;
22+
margin-right: 8px;
23+
}
24+
25+
.body {
26+
background-color: #1b1b1b;
27+
border-radius: 4px;
28+
padding: 8px;
29+
overflow-y: auto;
30+
max-height: 400px;
31+
}
32+
33+
.node {
34+
margin-left: 16px;
35+
}
36+
37+
.nodeHeader {
38+
cursor: pointer;
39+
user-select: none;
40+
}
41+
42+
.nodeChildren {
43+
margin-left: 16px;
44+
}
45+
46+
.leafNode {
47+
margin-left: 32px;
48+
}
49+
50+
.loading {
51+
text-align: center;
52+
color: #d1d5db;
53+
}

0 commit comments

Comments
 (0)