@sei-js/create-sei 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +16 -25
- package/biome.json +8 -0
- package/dist/main.js +12 -11
- package/dist/templates/next-cosmos-template/.eslintrc.json +1 -1
- package/dist/templates/next-cosmos-template/next.config.mjs +9 -9
- package/dist/templates/next-cosmos-template/package.json +29 -29
- package/dist/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +162 -171
- package/dist/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +92 -94
- package/dist/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +22 -49
- package/dist/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +11 -19
- package/dist/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +13 -17
- package/dist/templates/next-cosmos-template/src/app/components/index.ts +3 -3
- package/dist/templates/next-cosmos-template/src/app/constants/chain.ts +9 -9
- package/dist/templates/next-cosmos-template/src/app/constants/index.ts +1 -1
- package/dist/templates/next-cosmos-template/src/app/index.css +99 -86
- package/dist/templates/next-cosmos-template/src/app/layout.tsx +12 -12
- package/dist/templates/next-cosmos-template/src/app/page.tsx +13 -13
- package/dist/templates/next-cosmos-template/tsconfig.json +24 -24
- package/dist/templates/next-wagmi-template/.eslintrc.json +1 -1
- package/dist/templates/next-wagmi-template/package.json +28 -28
- package/dist/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +223 -237
- package/dist/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +92 -94
- package/dist/templates/next-wagmi-template/src/app/components/Homepage/Homepage.tsx +10 -36
- package/dist/templates/next-wagmi-template/src/app/components/Web3Provider.tsx +29 -28
- package/dist/templates/next-wagmi-template/src/app/components/index.ts +2 -2
- package/dist/templates/next-wagmi-template/src/app/constants/chain.ts +2 -2
- package/dist/templates/next-wagmi-template/src/app/constants/index.ts +1 -1
- package/dist/templates/next-wagmi-template/src/app/index.css +99 -86
- package/dist/templates/next-wagmi-template/src/app/layout.tsx +12 -12
- package/dist/templates/next-wagmi-template/src/app/page.tsx +17 -17
- package/dist/templates/next-wagmi-template/tsconfig.json +24 -24
- package/dist/templates/vite-cosmos-template/.eslintrc.cjs +10 -17
- package/dist/templates/vite-cosmos-template/package.json +33 -33
- package/dist/templates/vite-cosmos-template/src/App.tsx +11 -12
- package/dist/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +162 -171
- package/dist/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +92 -94
- package/dist/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +20 -45
- package/dist/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +11 -19
- package/dist/templates/vite-cosmos-template/src/components/Web3Provider.tsx +14 -18
- package/dist/templates/vite-cosmos-template/src/components/index.ts +4 -4
- package/dist/templates/vite-cosmos-template/src/constants/chain.ts +9 -9
- package/dist/templates/vite-cosmos-template/src/constants/index.ts +1 -1
- package/dist/templates/vite-cosmos-template/src/index.css +99 -86
- package/dist/templates/vite-cosmos-template/src/main.tsx +10 -10
- package/dist/templates/vite-cosmos-template/tsconfig.app.json +21 -23
- package/dist/templates/vite-cosmos-template/tsconfig.json +9 -9
- package/dist/templates/vite-cosmos-template/tsconfig.node.json +11 -11
- package/dist/templates/vite-cosmos-template/vite.config.ts +4 -4
- package/dist/templates/vite-wagmi-template/.eslintrc.cjs +10 -17
- package/dist/templates/vite-wagmi-template/package.json +31 -31
- package/dist/templates/vite-wagmi-template/src/App.tsx +12 -13
- package/dist/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +225 -239
- package/dist/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +92 -94
- package/dist/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +28 -53
- package/dist/templates/vite-wagmi-template/src/components/Web3Provider.tsx +29 -28
- package/dist/templates/vite-wagmi-template/src/constants/chain.ts +1 -1
- package/dist/templates/vite-wagmi-template/src/constants/index.ts +1 -1
- package/dist/templates/vite-wagmi-template/src/index.css +98 -85
- package/dist/templates/vite-wagmi-template/src/main.tsx +10 -10
- package/dist/templates/vite-wagmi-template/tsconfig.app.json +21 -23
- package/dist/templates/vite-wagmi-template/tsconfig.json +9 -9
- package/dist/templates/vite-wagmi-template/tsconfig.node.json +11 -11
- package/dist/templates/vite-wagmi-template/vite.config.ts +7 -7
- package/package.json +3 -2
- package/src/main.ts +31 -33
- package/templates/next-cosmos-template/.eslintrc.json +1 -1
- package/templates/next-cosmos-template/next.config.mjs +9 -9
- package/templates/next-cosmos-template/package.json +29 -29
- package/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +162 -171
- package/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +92 -94
- package/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +22 -49
- package/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +11 -19
- package/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +13 -17
- package/templates/next-cosmos-template/src/app/components/index.ts +3 -3
- package/templates/next-cosmos-template/src/app/constants/chain.ts +9 -9
- package/templates/next-cosmos-template/src/app/constants/index.ts +1 -1
- package/templates/next-cosmos-template/src/app/index.css +99 -86
- package/templates/next-cosmos-template/src/app/layout.tsx +12 -12
- package/templates/next-cosmos-template/src/app/page.tsx +13 -13
- package/templates/next-cosmos-template/tsconfig.json +24 -24
- package/templates/next-wagmi-template/.eslintrc.json +1 -1
- package/templates/next-wagmi-template/package.json +28 -28
- package/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +223 -237
- package/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +92 -94
- package/templates/next-wagmi-template/src/app/components/Homepage/Homepage.tsx +10 -36
- package/templates/next-wagmi-template/src/app/components/Web3Provider.tsx +29 -28
- package/templates/next-wagmi-template/src/app/components/index.ts +2 -2
- package/templates/next-wagmi-template/src/app/constants/chain.ts +2 -2
- package/templates/next-wagmi-template/src/app/constants/index.ts +1 -1
- package/templates/next-wagmi-template/src/app/index.css +99 -86
- package/templates/next-wagmi-template/src/app/layout.tsx +12 -12
- package/templates/next-wagmi-template/src/app/page.tsx +17 -17
- package/templates/next-wagmi-template/tsconfig.json +24 -24
- package/templates/vite-cosmos-template/.eslintrc.cjs +10 -17
- package/templates/vite-cosmos-template/package.json +33 -33
- package/templates/vite-cosmos-template/src/App.tsx +11 -12
- package/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +162 -171
- package/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +92 -94
- package/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +20 -45
- package/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +11 -19
- package/templates/vite-cosmos-template/src/components/Web3Provider.tsx +14 -18
- package/templates/vite-cosmos-template/src/components/index.ts +4 -4
- package/templates/vite-cosmos-template/src/constants/chain.ts +9 -9
- package/templates/vite-cosmos-template/src/constants/index.ts +1 -1
- package/templates/vite-cosmos-template/src/index.css +99 -86
- package/templates/vite-cosmos-template/src/main.tsx +10 -10
- package/templates/vite-cosmos-template/tsconfig.app.json +21 -23
- package/templates/vite-cosmos-template/tsconfig.json +9 -9
- package/templates/vite-cosmos-template/tsconfig.node.json +11 -11
- package/templates/vite-cosmos-template/vite.config.ts +4 -4
- package/templates/vite-wagmi-template/.eslintrc.cjs +10 -17
- package/templates/vite-wagmi-template/package.json +31 -31
- package/templates/vite-wagmi-template/src/App.tsx +12 -13
- package/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +225 -239
- package/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +92 -94
- package/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +28 -53
- package/templates/vite-wagmi-template/src/components/Web3Provider.tsx +29 -28
- package/templates/vite-wagmi-template/src/constants/chain.ts +1 -1
- package/templates/vite-wagmi-template/src/constants/index.ts +1 -1
- package/templates/vite-wagmi-template/src/index.css +98 -85
- package/templates/vite-wagmi-template/src/main.tsx +10 -10
- package/templates/vite-wagmi-template/tsconfig.app.json +21 -23
- package/templates/vite-wagmi-template/tsconfig.json +9 -9
- package/templates/vite-wagmi-template/tsconfig.node.json +11 -11
- package/templates/vite-wagmi-template/vite.config.ts +7 -7
- package/tsconfig.json +24 -28
|
@@ -1,156 +1,154 @@
|
|
|
1
1
|
#root {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
min-height: 100vh;
|
|
5
5
|
}
|
|
6
6
|
.app {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.logo {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
width: 20%;
|
|
13
|
+
align-self: center;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.container {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
margin: 0 auto;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: 3rem;
|
|
21
|
+
width: 100%;
|
|
22
|
+
padding: 1rem;
|
|
23
|
+
height: -webkit-fill-available;
|
|
24
|
+
flex-grow: 1;
|
|
25
|
+
justify-content: center;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.grid {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
width: 100%;
|
|
30
|
+
display: grid;
|
|
31
|
+
grid-template-columns: repeat(1, 1fr);
|
|
32
|
+
gap: 1rem;
|
|
33
33
|
}
|
|
34
34
|
.grid.docs {
|
|
35
|
-
|
|
35
|
+
grid-template-columns: repeat(1, 1fr);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.card {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
width: 100%;
|
|
40
|
+
padding: 1.5em;
|
|
41
|
+
border-radius: 1rem;
|
|
42
|
+
background: var(--card);
|
|
43
|
+
color: var(--card-foreground);
|
|
44
|
+
box-shadow: 0px 4px 6px 0px rgba(0, 0, 0, 0.09);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.card.secondary {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
background: transparent;
|
|
49
|
+
border: 1px solid var(--border);
|
|
50
|
+
box-shadow: none;
|
|
51
51
|
}
|
|
52
52
|
.card.intro {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
gap: 1rem;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
align-items: flex-start;
|
|
58
58
|
}
|
|
59
59
|
.card-header {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
justify-content: space-between;
|
|
63
|
+
gap: 0.25rem;
|
|
64
64
|
}
|
|
65
65
|
.card-body {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
justify-content: space-between;
|
|
69
|
+
margin: 1.5rem 0;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.card-footer {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: row;
|
|
75
|
+
gap: 0.5rem;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.card__title {
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
font-size: 1.15rem;
|
|
80
|
+
font-weight: 600;
|
|
81
81
|
}
|
|
82
82
|
.content-background {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
background: #fafaf9;
|
|
85
|
+
border-radius: 4rem;
|
|
86
|
+
padding: 0 1rem;
|
|
87
|
+
height: 3.5rem;
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.wallet-address {
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
text-wrap: anywhere;
|
|
94
|
+
line-break: anywhere;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
.space-between {
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
justify-content: space-between;
|
|
99
|
+
gap: 1rem;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
.hide-on-mobile {
|
|
103
|
-
|
|
103
|
+
display: none;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
.hide-on-desktop {
|
|
107
|
-
|
|
107
|
+
display: block;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
.external-link {
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
display: inline-flex;
|
|
112
|
+
gap: 0.25rem;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
.get-started {
|
|
116
|
-
|
|
116
|
+
text-align: center;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
.wallet-connect {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
display: flex;
|
|
121
|
+
gap: 1rem;
|
|
122
|
+
align-items: center;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
|
|
126
125
|
@media (min-width: 768px) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
126
|
+
.card.intro {
|
|
127
|
+
grid-column: span 2;
|
|
128
|
+
flex-direction: row;
|
|
129
|
+
align-items: center;
|
|
130
|
+
}
|
|
131
|
+
.hide-on-mobile {
|
|
132
|
+
display: block;
|
|
133
|
+
}
|
|
134
|
+
.hide-on-desktop {
|
|
135
|
+
display: none;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.container {
|
|
139
|
+
max-width: 96rem;
|
|
140
|
+
padding: 2rem;
|
|
141
|
+
}
|
|
142
|
+
.grid {
|
|
143
|
+
grid-template-columns: repeat(3, 1fr);
|
|
144
|
+
}
|
|
145
|
+
.grid.docs {
|
|
146
|
+
grid-template-columns: repeat(3, 1fr);
|
|
147
|
+
}
|
|
150
148
|
}
|
|
151
149
|
|
|
152
150
|
@media (min-width: 1024px) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
.container {
|
|
152
|
+
max-width: 80rem;
|
|
153
|
+
}
|
|
156
154
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import './Homepage.css'
|
|
3
|
+
import './Homepage.css';
|
|
4
4
|
import Examples from './Examples';
|
|
5
5
|
import { selectedChain } from '../../constants';
|
|
6
6
|
import { WalletConnectButton } from '..';
|
|
@@ -15,13 +15,11 @@ const renderHelpItem = ({ title, description, link }: HelpItem) => (
|
|
|
15
15
|
<div className="card secondary">
|
|
16
16
|
<div className="card-header">
|
|
17
17
|
<p className="card__title">
|
|
18
|
-
<a href={link} target=
|
|
18
|
+
<a href={link} target="_blank" rel="noopener noreferrer" className="external-link">
|
|
19
19
|
{title} {externalIcon}
|
|
20
20
|
</a>
|
|
21
21
|
</p>
|
|
22
|
-
<small className="card__description">
|
|
23
|
-
{description}
|
|
24
|
-
</small>
|
|
22
|
+
<small className="card__description">{description}</small>
|
|
25
23
|
</div>
|
|
26
24
|
</div>
|
|
27
25
|
);
|
|
@@ -35,7 +33,7 @@ const helpItems: HelpItem[] = [
|
|
|
35
33
|
{
|
|
36
34
|
title: 'CosmosKit',
|
|
37
35
|
description: "Learn about CosmosKit and it's hooks for chain interaction.",
|
|
38
|
-
link: 'https://
|
|
36
|
+
link: 'https://hyperweb.io/stack/cosmos-kit'
|
|
39
37
|
},
|
|
40
38
|
{
|
|
41
39
|
title: 'sei-js',
|
|
@@ -45,63 +43,38 @@ const helpItems: HelpItem[] = [
|
|
|
45
43
|
];
|
|
46
44
|
|
|
47
45
|
const externalIcon = (
|
|
48
|
-
<svg
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
d="
|
|
57
|
-
stroke="#9F1239"
|
|
58
|
-
strokeWidth="1.33333"
|
|
59
|
-
strokeLinecap="round"
|
|
60
|
-
strokeLinejoin="round"
|
|
61
|
-
/>
|
|
62
|
-
<path
|
|
63
|
-
d="M10 2H14V6"
|
|
64
|
-
stroke="#9F1239"
|
|
65
|
-
strokeWidth="1.33333"
|
|
66
|
-
strokeLinecap="round"
|
|
67
|
-
strokeLinejoin="round"
|
|
68
|
-
/>
|
|
69
|
-
<path
|
|
70
|
-
d="M6.66663 9.33333L14 2"
|
|
71
|
-
stroke="#9F1239"
|
|
72
|
-
strokeWidth="1.33333"
|
|
73
|
-
strokeLinecap="round"
|
|
74
|
-
strokeLinejoin="round"
|
|
75
|
-
/>
|
|
46
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
47
|
+
<path
|
|
48
|
+
d="M12 8.66667V12.6667C12 13.0203 11.8595 13.3594 11.6095 13.6095C11.3594 13.8595 11.0203 14 10.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V5.33333C2 4.97971 2.14048 4.64057 2.39052 4.39052C2.64057 4.14048 2.97971 4 3.33333 4H7.33333"
|
|
49
|
+
stroke="#9F1239"
|
|
50
|
+
strokeWidth="1.33333"
|
|
51
|
+
strokeLinecap="round"
|
|
52
|
+
strokeLinejoin="round"
|
|
53
|
+
/>
|
|
54
|
+
<path d="M10 2H14V6" stroke="#9F1239" strokeWidth="1.33333" strokeLinecap="round" strokeLinejoin="round" />
|
|
55
|
+
<path d="M6.66663 9.33333L14 2" stroke="#9F1239" strokeWidth="1.33333" strokeLinecap="round" strokeLinejoin="round" />
|
|
76
56
|
</svg>
|
|
77
|
-
|
|
57
|
+
);
|
|
78
58
|
|
|
79
59
|
export function Homepage() {
|
|
80
|
-
|
|
81
60
|
return (
|
|
82
61
|
<div className="container">
|
|
83
62
|
<img src="sei-logotype.svg" className="logo" alt="SEI logotype" />
|
|
84
63
|
<div className="card intro">
|
|
85
64
|
<div className="card-header">
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
Connect wallet to see your address and balance
|
|
89
|
-
</small>
|
|
65
|
+
<p className="card__title">Wallet address</p>
|
|
66
|
+
<small className="card__description">Connect wallet to see your address and balance</small>
|
|
90
67
|
</div>
|
|
91
|
-
<WalletConnectButton/>
|
|
68
|
+
<WalletConnectButton />
|
|
92
69
|
</div>
|
|
93
|
-
<Examples chainId={selectedChain.chain_id}/>
|
|
70
|
+
<Examples chainId={selectedChain.chain_id} />
|
|
94
71
|
<div className="get-started">
|
|
95
72
|
Get started by editing <code>src/app/page.tsx</code>
|
|
96
73
|
</div>
|
|
97
74
|
<div className="grid docs">
|
|
98
|
-
{
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
{renderHelpItem(item)}
|
|
102
|
-
</div>
|
|
103
|
-
))
|
|
104
|
-
}
|
|
75
|
+
{helpItems.map((item, _) => (
|
|
76
|
+
<div key={item.title}>{renderHelpItem(item)}</div>
|
|
77
|
+
))}
|
|
105
78
|
</div>
|
|
106
79
|
</div>
|
|
107
80
|
);
|
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
import { useChain } from
|
|
1
|
+
import { useChain } from '@cosmos-kit/react';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import '@interchain-ui/react/styles';
|
|
4
4
|
|
|
5
|
-
import { truncateSeiAddress } from
|
|
6
|
-
import { selectedChain } from
|
|
5
|
+
import { truncateSeiAddress } from '@sei-js/cosmjs';
|
|
6
|
+
import { selectedChain } from '../../constants';
|
|
7
7
|
|
|
8
8
|
export function WalletConnectButton() {
|
|
9
|
-
|
|
10
|
-
isWalletConnected,
|
|
11
|
-
address,
|
|
12
|
-
connect,
|
|
13
|
-
openView,
|
|
14
|
-
} = useChain(selectedChain.chain_name);
|
|
9
|
+
const { isWalletConnected, address, connect, openView } = useChain(selectedChain.chain_name);
|
|
15
10
|
|
|
16
|
-
|
|
11
|
+
const truncatedSeiAddr = address ? truncateSeiAddress(address) : '';
|
|
17
12
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{isWalletConnected ? truncateSeiAddress(truncatedSeiAddr) : "Connect"}
|
|
24
|
-
</button>
|
|
25
|
-
);
|
|
13
|
+
return (
|
|
14
|
+
<button className="primary" onClick={isWalletConnected ? openView : connect}>
|
|
15
|
+
{isWalletConnected ? truncateSeiAddress(truncatedSeiAddr) : 'Connect'}
|
|
16
|
+
</button>
|
|
17
|
+
);
|
|
26
18
|
}
|
|
@@ -4,12 +4,9 @@ import { ReactNode } from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { ChainProvider } from '@cosmos-kit/react';
|
|
6
6
|
import { COSMOS_KIT_ASSET_LIST } from '@sei-js/cosmjs';
|
|
7
|
-
import { wallets as finWallets } from '@cosmos-kit/fin'
|
|
8
|
-
import { wallets as keplrWallets } from '@cosmos-kit/keplr'
|
|
9
|
-
import {
|
|
10
|
-
CompassExtensionWallet,
|
|
11
|
-
compassExtensionInfo,
|
|
12
|
-
} from '@cosmos-kit/compass-extension'
|
|
7
|
+
import { wallets as finWallets } from '@cosmos-kit/fin';
|
|
8
|
+
import { wallets as keplrWallets } from '@cosmos-kit/keplr';
|
|
9
|
+
import { CompassExtensionWallet, compassExtensionInfo } from '@cosmos-kit/compass-extension';
|
|
13
10
|
import { selectedChain } from '../constants';
|
|
14
11
|
|
|
15
12
|
interface Web3ProviderProps {
|
|
@@ -17,22 +14,21 @@ interface Web3ProviderProps {
|
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
const compassWallet = new CompassExtensionWallet({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})
|
|
17
|
+
...compassExtensionInfo,
|
|
18
|
+
mobileDisabled: false
|
|
19
|
+
});
|
|
23
20
|
|
|
24
21
|
function Web3Provider({ children }: Web3ProviderProps) {
|
|
22
|
+
// Define your supported wallets here
|
|
23
|
+
const wallets = [compassWallet, ...finWallets, ...keplrWallets];
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// Define the list of sei chain you would like to connect to here.
|
|
30
|
-
const chains = [selectedChain]
|
|
25
|
+
// Define the list of sei chain you would like to connect to here.
|
|
26
|
+
const chains = [selectedChain];
|
|
31
27
|
|
|
32
28
|
return (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
<ChainProvider chains={chains} assetLists={[COSMOS_KIT_ASSET_LIST]} wallets={wallets}>
|
|
30
|
+
{children}
|
|
31
|
+
</ChainProvider>
|
|
36
32
|
);
|
|
37
33
|
}
|
|
38
34
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Homepage/Homepage'
|
|
2
|
-
export * from './WalletConnectButton/WalletConnectButton'
|
|
3
|
-
export * from './Web3Provider'
|
|
1
|
+
export * from './Homepage/Homepage';
|
|
2
|
+
export * from './WalletConnectButton/WalletConnectButton';
|
|
3
|
+
export * from './Web3Provider';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ARCTIC_1_SEI_COSMOS_KIT_CHAIN, ATLANTIC_2_SEI_COSMOS_KIT_CHAIN, PACIFIC_1_SEI_COSMOS_KIT_CHAIN } from '@sei-js/cosmjs';
|
|
2
2
|
|
|
3
3
|
export type Urls = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
rpc: string;
|
|
5
|
+
rest: string;
|
|
6
|
+
};
|
|
7
7
|
|
|
8
|
-
export const defaultUrls: {[chainName: string]: Urls} = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
8
|
+
export const defaultUrls: { [chainName: string]: Urls } = {
|
|
9
|
+
[PACIFIC_1_SEI_COSMOS_KIT_CHAIN.chain_id]: { rpc: 'https://rpc.sei-apis.com', rest: 'https://rest-arctic-1.sei-apis.com' },
|
|
10
|
+
[ATLANTIC_2_SEI_COSMOS_KIT_CHAIN.chain_id]: { rpc: 'https://rpc-testnet.sei-apis.com', rest: 'https://rest-testnet.sei-apis.com' },
|
|
11
|
+
[ARCTIC_1_SEI_COSMOS_KIT_CHAIN.chain_id]: { rpc: 'https://rpc-arctic-1.sei-apis.com', rest: 'https://rest-arctic-1.sei-apis.com' }
|
|
12
|
+
};
|
|
13
13
|
|
|
14
14
|
// Set your selected chain here
|
|
15
15
|
// To point to mainnet, use PACIFIC_1_SEI_COSMOS_KIT_CHAIN
|
|
16
|
-
export const selectedChain = ARCTIC_1_SEI_COSMOS_KIT_CHAIN
|
|
16
|
+
export const selectedChain = ARCTIC_1_SEI_COSMOS_KIT_CHAIN;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './chain';
|
|
1
|
+
export * from './chain';
|