Skip to content

Commit d7b3b07

Browse files
Merge pull request #162 from sei-protocol/feat/btns-quick-start
feat: incorporate user input components in quickstart guide
2 parents 36cce09 + a75585c commit d7b3b07

File tree

4 files changed

+217
-4052
lines changed

4 files changed

+217
-4052
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import React, { useState } from 'react';
2+
import styles from '../../styles/SeiTraceSearch.module.css';
3+
4+
const SeiTraceSearch = () => {
5+
const [address, setAddress] = useState('');
6+
const [error, setError] = useState('');
7+
8+
const isValidAddress = (addr: string) => {
9+
// Accept addresses starting with 'sei' or '0x' and of reasonable length
10+
const seiPattern = /^sei[a-z0-9]{8,}$/i;
11+
const evmPattern = /^0x[a-fA-F0-9]{40}$/;
12+
return seiPattern.test(addr) || evmPattern.test(addr);
13+
};
14+
15+
const getSeiTraceUrl = (addr: string) => {
16+
const chainParam = '?chain=pacific-1';
17+
// For all addresses, use '/address/' path
18+
return `https://seitrace.com/address/${addr}${chainParam}`;
19+
};
20+
21+
const handleSubmit = (e: React.FormEvent) => {
22+
e.preventDefault();
23+
const trimmedAddress = address.trim();
24+
if (trimmedAddress) {
25+
if (isValidAddress(trimmedAddress)) {
26+
const url = getSeiTraceUrl(trimmedAddress);
27+
window.open(url, '_blank');
28+
setError('');
29+
} else {
30+
setError('Please enter a valid Sei or EVM address.');
31+
}
32+
}
33+
};
34+
35+
return (
36+
<form onSubmit={handleSubmit} className={styles.form}>
37+
<div className={styles.inputContainer}>
38+
<input
39+
id="addressInput"
40+
type="text"
41+
placeholder="Enter address"
42+
value={address}
43+
onChange={(e) => setAddress(e.target.value)}
44+
className={`${styles.input} ${error ? styles.error : ''}`}
45+
/>
46+
<button type="submit" className={styles.button}>
47+
View on SEITRACE
48+
</button>
49+
</div>
50+
{error && <div className={styles.errorMessage}>{error}</div>}
51+
</form>
52+
);
53+
};
54+
55+
export default SeiTraceSearch;

pages/start/user-quickstart.mdx

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ title: 'Connect to Sei'
44

55
import { Callout } from 'nextra/components';
66
import { ImageWithCaption } from "../../components";
7+
import CustomConnectButton from "../../components/EvmWalletConnect/CustomConnectButton";
8+
import EvmWalletConnect from "../../components/EvmWalletConnect/EvmWalletConnect";
9+
import SeiTraceSearch from "../../components/AddressSearch/SeiTraceSearch";
710
import addressTranslationImage from "../../public/assets/address-derivation.png";
811
import linkAddressesImage from "../../public/assets/link-addresses.png";
912
import linkSuccessImage from "../../public/assets/link-success.png";
@@ -27,13 +30,14 @@ For additional help with wallet apps, see our [Setting up a Wallet](/users/walle
2730

2831
## Connecting Your Wallet
2932

30-
When you connect your wallet to an application on Sei, you'll automatically be prompted to join
31-
the correct network within your wallet interface.
33+
For a quick setup, simply click the "Connect Wallet" button below to connect directly from this guide.
3234

33-
To test this, simply click the "Connect Wallet" button on the Sei App at [app.sei.io](https://app.sei.io/).
34-
If you'd like to jump right in, the demo below walks you through how to connect to the Sei network.
35-
> Please follow the instructions shared by your chosen wallet provider to add a new network manually.
36-
> If your wallet does not prompt you to join the Sei Network, you can find network details [here](/user-guides/wallet-setup) to manually add Sei network.
35+
<EvmWalletConnect />
36+
37+
After connecting, your wallet will automatically prompt you to join the correct Sei network.
38+
39+
To try connecting within the Sei App itself, visit [app.sei.io](https://app.sei.io) and click the "Connect Wallet" button. If you're ready to dive in, the demo below walks you through connecting to the Sei network step-by-step.
40+
> If your wallet doesn’t automatically prompt you to join the Sei Network, please add it manually by following the network details [here](/user-guides/wallet-setup).
3741
3842
<br/>
3943

@@ -44,7 +48,7 @@ If you'd like to jump right in, the demo below walks you through how to connect
4448
</video>
4549
</div>
4650

47-
### Dual Address Support
51+
## Dual Address Support
4852

4953
Sei supports two wallet address types:
5054

@@ -56,27 +60,25 @@ You can find your corresponding wallet addresses directly in the Sei app.
5660

5761
For more details on interoperability, explore our article [here](https://blog.sei.io/sei-v2-interoperability/).
5862

59-
## Linking Wallet Addresses
63+
### How to Link Your Addresses
6064

6165
<Callout emoji="💡">
62-
Many Sei apps require linked addresses for cross-VM functionality. It’s recommended for all users.
66+
Linking addresses is recommended for all users to enable cross-VM functionality in many Sei apps.
6367
</Callout>
6468

65-
To use Sei apps that leverage interoperability, you must link your Sei and EVM (0x) addresses. Each Sei address has a corresponding EVM address, and vice versa. This link is required the first time you use Sei.
69+
To use interoperability features in Sei apps, you’ll need to link your Sei and EVM (0x) addresses. Each Sei address has a corresponding EVM address, derived from the same public key, and this link is required on your first use.
6670

6771
<Callout type="warning">
68-
You cannot choose which addresses are linked.
69-
Each Sei account has one specific Sei address and one specific EVM address, derived from the same public key.
72+
Address linking is automatic—each Sei account is tied to a single Sei address and a single EVM address, both derived from the same public key.
7073
</Callout>
7174

72-
### How to Link Your Addresses
75+
Follow these steps to link your Sei and EVM addresses:
7376

74-
1. Navigate to [app.sei.io](https://app.sei.io) using your web browser.
75-
2. On the Dashboard, look for the "Addresses" box.
76-
3. Complete captcha, if required.
77-
3. Click the "Link Addresses" button. This will prompt you to sign a message with your wallet - it's not a transaction,
78-
and will not charge you any gas fees.
79-
4. Once you have signed that message, your accounts will be linked.
77+
1. Go to [app.sei.io](https://app.sei.io) in your browser.
78+
2. In the Dashboard, locate the "Addresses" box.
79+
3. Complete any required captcha.
80+
4. Click "Link Addresses" to start the process. You’ll be prompted to sign a message with your wallet—this is not a transaction and incurs no gas fees.
81+
5. Once signed, your Sei and EVM addresses will be linked.
8082

8183
<br/>
8284

@@ -87,7 +89,15 @@ and will not charge you any gas fees.
8789
</video>
8890
</div>
8991

90-
For more details, check the [Linking Addresses guide](/user-guides/linking-addresses).
92+
For more details, check the [Linking Addresses guide](/users/linking-addresses).
93+
94+
### How to View Your Address Pair
95+
96+
You can view your wallet address on any Sei blockchain explorer to see your transactions and balances.
97+
98+
Enter your Sei or EVM address below to view it on SEITRACE:
99+
100+
<SeiTraceSearch />
91101

92102
## Onboarding from Centralized Exchanges
93103

styles/SeiTraceSearch.module.css

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
.form {
2+
margin-top: 1rem;
3+
}
4+
5+
.label {
6+
color: #ddd;
7+
font-size: 1rem;
8+
}
9+
10+
.inputContainer {
11+
display: flex;
12+
margin-top: 0.5rem;
13+
}
14+
15+
.input {
16+
flex: 1;
17+
padding: 0.75rem 1rem;
18+
font-size: 1rem;
19+
border: none;
20+
border-radius: 25px 0 0 25px;
21+
background-color: #1a1a1a;
22+
color: #fff;
23+
outline: none;
24+
transition: background-color 0.3s;
25+
}
26+
27+
.input::placeholder {
28+
color: #666;
29+
}
30+
31+
.input.error {
32+
background-color: #2a1a1a;
33+
box-shadow: inset 0 0 0 2px #e74c3c;
34+
}
35+
36+
.input:not(.error) {
37+
box-shadow: inset 0 0 0 2px #333;
38+
}
39+
40+
.button {
41+
padding: 0 1.5rem;
42+
font-size: 1rem;
43+
border: none;
44+
border-radius: 0 25px 25px 0;
45+
background-color: #1a1a1a;
46+
color: #fff;
47+
cursor: pointer;
48+
transition: background-color 0.3s;
49+
box-shadow: inset 0 0 0 2px #333;
50+
}
51+
52+
.button:hover {
53+
background-color: #333;
54+
}
55+
56+
.errorMessage {
57+
color: #e74c3c;
58+
margin-top: 0.5rem;
59+
font-size: 0.9rem;
60+
}
61+

0 commit comments

Comments
 (0)