@sei-js/create-sei 0.0.0-internal-20240718212405 → 0.0.0
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 +12 -0
- package/dist/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +6 -6
- package/dist/templates/next-cosmos-template/src/app/favicon.ico +0 -0
- package/dist/templates/next-cosmos-template/src/app/index.css +1 -0
- package/dist/templates/next-cosmos-template/src/app/layout.tsx +2 -2
- package/dist/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +9 -9
- package/dist/templates/next-wagmi-template/src/app/constants/chain.ts +1 -0
- package/dist/templates/next-wagmi-template/src/app/favicon.ico +0 -0
- package/dist/templates/next-wagmi-template/src/app/index.css +1 -0
- package/dist/templates/next-wagmi-template/src/app/layout.tsx +2 -2
- package/dist/templates/next-wagmi-template/yarn.lock +8 -13
- package/dist/templates/vite-cosmos-template/index.html +1 -2
- package/dist/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +6 -6
- package/dist/templates/vite-cosmos-template/src/index.css +1 -0
- package/dist/templates/vite-wagmi-template/index.html +1 -2
- package/dist/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +27 -27
- package/dist/templates/vite-wagmi-template/src/constants/chain.ts +4 -3
- package/dist/templates/vite-wagmi-template/src/index.css +2 -2
- package/dist/templates/vite-wagmi-template/yarn.lock +325 -244
- package/package.json +1 -1
- package/dist/templates/next-wagmi-template/public/next.svg +0 -1
- package/dist/templates/next-wagmi-template/public/vercel.svg +0 -1
- package/dist/templates/templates/next-cosmos-template/.eslintrc.json +0 -3
- package/dist/templates/templates/next-cosmos-template/README.md +0 -60
- package/dist/templates/templates/next-cosmos-template/next-env.d.ts +0 -5
- package/dist/templates/templates/next-cosmos-template/next.config.mjs +0 -14
- package/dist/templates/templates/next-cosmos-template/package.json +0 -31
- package/dist/templates/templates/next-cosmos-template/public/next.svg +0 -1
- package/dist/templates/templates/next-cosmos-template/public/sei-logotype.svg +0 -15
- package/dist/templates/templates/next-cosmos-template/public/vercel.svg +0 -1
- package/dist/templates/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +0 -177
- package/dist/templates/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +0 -156
- package/dist/templates/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +0 -110
- package/dist/templates/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +0 -26
- package/dist/templates/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +0 -39
- package/dist/templates/templates/next-cosmos-template/src/app/components/index.ts +0 -3
- package/dist/templates/templates/next-cosmos-template/src/app/constants/chain.ts +0 -16
- package/dist/templates/templates/next-cosmos-template/src/app/constants/index.ts +0 -1
- package/dist/templates/templates/next-cosmos-template/src/app/index.css +0 -171
- package/dist/templates/templates/next-cosmos-template/src/app/layout.tsx +0 -21
- package/dist/templates/templates/next-cosmos-template/src/app/page.tsx +0 -17
- package/dist/templates/templates/next-cosmos-template/tsconfig.json +0 -26
- package/dist/templates/templates/next-cosmos-template/yarn.lock +0 -9814
- package/dist/templates/templates/next-wagmi-template/.eslintrc.json +0 -3
- package/dist/templates/templates/next-wagmi-template/README.md +0 -58
- package/dist/templates/templates/next-wagmi-template/next-env.d.ts +0 -5
- package/dist/templates/templates/next-wagmi-template/next.config.mjs +0 -4
- package/dist/templates/templates/next-wagmi-template/package.json +0 -30
- package/dist/templates/templates/next-wagmi-template/public/sei-logotype.svg +0 -15
- package/dist/templates/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +0 -271
- package/dist/templates/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +0 -156
- package/dist/templates/templates/next-wagmi-template/src/app/components/Homepage/Homepage.tsx +0 -113
- package/dist/templates/templates/next-wagmi-template/src/app/components/Web3Provider.tsx +0 -73
- package/dist/templates/templates/next-wagmi-template/src/app/components/index.ts +0 -2
- package/dist/templates/templates/next-wagmi-template/src/app/constants/chain.ts +0 -7
- package/dist/templates/templates/next-wagmi-template/src/app/constants/index.ts +0 -1
- package/dist/templates/templates/next-wagmi-template/src/app/index.css +0 -171
- package/dist/templates/templates/next-wagmi-template/src/app/layout.tsx +0 -21
- package/dist/templates/templates/next-wagmi-template/src/app/page.tsx +0 -21
- package/dist/templates/templates/next-wagmi-template/tsconfig.json +0 -26
- package/dist/templates/templates/next-wagmi-template/yarn.lock +0 -4809
- package/dist/templates/templates/vite-cosmos-template/.eslintrc.cjs +0 -18
- package/dist/templates/templates/vite-cosmos-template/README.md +0 -72
- package/dist/templates/templates/vite-cosmos-template/favicon.ico +0 -0
- package/dist/templates/templates/vite-cosmos-template/index.html +0 -16
- package/dist/templates/templates/vite-cosmos-template/package.json +0 -35
- package/dist/templates/templates/vite-cosmos-template/public/sei-logotype.svg +0 -15
- package/dist/templates/templates/vite-cosmos-template/src/App.tsx +0 -16
- package/dist/templates/templates/vite-cosmos-template/src/assets/react.svg +0 -1
- package/dist/templates/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +0 -177
- package/dist/templates/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +0 -156
- package/dist/templates/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +0 -102
- package/dist/templates/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +0 -26
- package/dist/templates/templates/vite-cosmos-template/src/components/Web3Provider.tsx +0 -45
- package/dist/templates/templates/vite-cosmos-template/src/components/index.ts +0 -4
- package/dist/templates/templates/vite-cosmos-template/src/constants/chain.ts +0 -16
- package/dist/templates/templates/vite-cosmos-template/src/constants/index.ts +0 -1
- package/dist/templates/templates/vite-cosmos-template/src/index.css +0 -171
- package/dist/templates/templates/vite-cosmos-template/src/main.tsx +0 -12
- package/dist/templates/templates/vite-cosmos-template/src/vite-env.d.ts +0 -1
- package/dist/templates/templates/vite-cosmos-template/tsconfig.app.json +0 -27
- package/dist/templates/templates/vite-cosmos-template/tsconfig.json +0 -11
- package/dist/templates/templates/vite-cosmos-template/tsconfig.node.json +0 -14
- package/dist/templates/templates/vite-cosmos-template/vite.config.ts +0 -7
- package/dist/templates/templates/vite-cosmos-template/yarn.lock +0 -9323
- package/dist/templates/templates/vite-wagmi-template/.eslintrc.cjs +0 -18
- package/dist/templates/templates/vite-wagmi-template/README.md +0 -72
- package/dist/templates/templates/vite-wagmi-template/favicon.ico +0 -0
- package/dist/templates/templates/vite-wagmi-template/index.html +0 -12
- package/dist/templates/templates/vite-wagmi-template/package.json +0 -33
- package/dist/templates/templates/vite-wagmi-template/public/sei-logotype.svg +0 -15
- package/dist/templates/templates/vite-wagmi-template/src/App.tsx +0 -22
- package/dist/templates/templates/vite-wagmi-template/src/assets/react.svg +0 -1
- package/dist/templates/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +0 -269
- package/dist/templates/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +0 -156
- package/dist/templates/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +0 -106
- package/dist/templates/templates/vite-wagmi-template/src/components/Web3Provider.tsx +0 -71
- package/dist/templates/templates/vite-wagmi-template/src/constants/chain.ts +0 -6
- package/dist/templates/templates/vite-wagmi-template/src/constants/index.ts +0 -1
- package/dist/templates/templates/vite-wagmi-template/src/index.css +0 -170
- package/dist/templates/templates/vite-wagmi-template/src/main.tsx +0 -12
- package/dist/templates/templates/vite-wagmi-template/src/vite-env.d.ts +0 -1
- package/dist/templates/templates/vite-wagmi-template/tsconfig.app.json +0 -27
- package/dist/templates/templates/vite-wagmi-template/tsconfig.json +0 -11
- package/dist/templates/templates/vite-wagmi-template/tsconfig.node.json +0 -14
- package/dist/templates/templates/vite-wagmi-template/vite.config.ts +0 -10
- package/dist/templates/templates/vite-wagmi-template/yarn.lock +0 -4603
- package/dist/templates/vite-cosmos-template/_gitignore +0 -24
- package/dist/templates/vite-cosmos-template/public/vite.svg +0 -1
- package/dist/templates/vite-wagmi-template/_gitignore +0 -24
- package/dist/templates/vite-wagmi-template/public/vite.svg +0 -1
- /package/dist/templates/{templates/next-cosmos-template/src/app → vite-cosmos-template}/favicon.ico +0 -0
- /package/dist/templates/{templates/next-wagmi-template/src/app → vite-wagmi-template}/favicon.ico +0 -0
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-11-8-18-19-18zm-10 15c2-4 5-7 10-7s8 3 9 7h-19zm-39 3c0 6 4 10 10 10 4 0 7-2 9-5l8 5c-3 5-9 8-17 8-11 0-19-7-19-18s8-18 19-18c8 0 14 3 17 8l-8 5c-2-3-5-5-9-5-6 0-10 4-10 10zm83-29v46h-9V5h9zM37 0l37 64H0L37 0zm92 5-27 48L74 5h10l18 30 17-30h10zm59 12v10l-3-1c-6 0-10 4-10 10v15h-9V17h9v9c0-5 6-9 13-9z"/></svg>
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Next-Cosmos Sei App Template
|
|
2
|
-
|
|
3
|
-
This repo provides a basic framework for an application that interacts with Sei via Cosmos endpoints.
|
|
4
|
-
|
|
5
|
-
## Getting Started
|
|
6
|
-
|
|
7
|
-
Install dependencies by running
|
|
8
|
-
```bash
|
|
9
|
-
npm install
|
|
10
|
-
#or
|
|
11
|
-
yarn
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
Then, run the development server:
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm run dev
|
|
18
|
-
# or
|
|
19
|
-
yarn dev
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
23
|
-
|
|
24
|
-
You can start editing the page by modifying `src/app/page.tsx`. The page auto-updates as you edit the file.
|
|
25
|
-
|
|
26
|
-
## Repository Basics
|
|
27
|
-
This repository includes basic features that allow you to connect to a wallet and use the wallet to interact with the chain.
|
|
28
|
-
|
|
29
|
-
Additionally, basic examples and links to documentation are provided on the example homepage in `src/app/components/Homepage`.
|
|
30
|
-
|
|
31
|
-
### Web3 Provider
|
|
32
|
-
This component is a Sei specific wrapper around CosmosKit Provider that should wrap the application. Wrapping the application in this provider will enable it to access hooks in CosmosKit. These hooks are enable connection to a wallet and interaction with the chain.
|
|
33
|
-
|
|
34
|
-
To change the list of supported wallets, as well as connection configurations you can modify the `src/app/components/Web3Provider.tsx` component.
|
|
35
|
-
|
|
36
|
-
### Wallet Connect Button
|
|
37
|
-
This component provides an interface to connect your wallet to the application. It utilizies CosmosKit's hooks and modal.
|
|
38
|
-
|
|
39
|
-
To customize the wallet connect button or connection logic, you can modify the `src/app/components/WalletConnectButton.tsx` component.
|
|
40
|
-
|
|
41
|
-
### Changing the Chain
|
|
42
|
-
This application connects to the arctic-1 devnet by default
|
|
43
|
-
|
|
44
|
-
To change the chain the app connects to, edit the `selectedChain` variable in the `chain.ts` file in `src/app/constants`
|
|
45
|
-
|
|
46
|
-
## Learn More
|
|
47
|
-
|
|
48
|
-
### Next.js
|
|
49
|
-
To learn more about Next.js, take a look at the following resources:
|
|
50
|
-
|
|
51
|
-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
|
52
|
-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
|
53
|
-
|
|
54
|
-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
|
55
|
-
|
|
56
|
-
## Deploy on Vercel
|
|
57
|
-
|
|
58
|
-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
|
59
|
-
|
|
60
|
-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "template-next-cosmos-sei-app",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "next dev",
|
|
7
|
-
"build": "next build",
|
|
8
|
-
"start": "next start",
|
|
9
|
-
"lint": "next lint"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@cosmos-kit/react": "^2.17.0",
|
|
13
|
-
"@interchain-ui/react": "1.23.21",
|
|
14
|
-
"@interchain-ui/react-no-ssr": "^0.1.4",
|
|
15
|
-
"@sei-js/cosmjs": "^1.0.7",
|
|
16
|
-
"@tanstack/react-query": "^5.45.1",
|
|
17
|
-
"chain-registry": "^1.63.5",
|
|
18
|
-
"cosmos-kit": "^2.18.0",
|
|
19
|
-
"next": "14.2.4",
|
|
20
|
-
"pino-pretty": "^11.2.1",
|
|
21
|
-
"react": "^18",
|
|
22
|
-
"react-dom": "^18"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@types/node": "^20",
|
|
26
|
-
"@types/react": "^18",
|
|
27
|
-
"@types/react-dom": "^18",
|
|
28
|
-
"eslint-config-next": "14.2.4",
|
|
29
|
-
"typescript": "^5"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<svg width="86" height="32" viewBox="0 0 86 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g id="sei-logotype" clip-path="url(#clip0_1_53)">
|
|
3
|
-
<path id="Vector" fill-rule="evenodd" clip-rule="evenodd" d="M15.8553 31.8727C20.5775 31.8727 24.8201 29.8188 27.7383 26.5556C26.3808 25.3758 24.3351 25.3041 22.8899 26.4702L22.6138 26.693C19.9677 28.8281 16.1121 28.5128 13.8481 25.9762C12.6133 24.5927 10.4986 24.4514 9.09076 25.6584L5.90753 28.3874C8.63393 30.5685 12.0923 31.8727 15.8553 31.8727ZM21.0223 24.1558C23.5427 22.1221 27.0852 22.195 29.5092 24.1592C30.9581 21.7586 31.7917 18.9448 31.7917 15.9363C31.7917 12.5934 30.7624 9.49098 29.0035 6.9285C27.8696 6.68701 26.6405 6.96905 25.7075 7.79581L25.442 8.03112C22.8973 10.2861 19.0312 10.1491 16.6526 7.71961C15.3553 6.39459 13.2362 6.35106 11.8856 7.62174L8.1813 11.1067L6.1435 8.94069L9.84784 5.45571C12.3779 3.07544 16.3473 3.15694 18.7775 5.63906C20.0473 6.936 22.1112 7.00916 23.4696 5.80535L23.7351 5.57004C24.5597 4.83932 25.5138 4.3467 26.5127 4.08762C23.6893 1.54648 19.9529 0 15.8553 0C7.76541 0 1.08344 6.02803 0.0559658 13.8374C2.51319 12.6583 5.54417 13.112 7.5477 15.1637C8.81252 16.4589 10.8491 16.5956 12.2757 15.4811L14.3469 13.863C16.9498 11.8295 20.6294 11.9279 23.1199 14.0978L27.1522 17.6109L25.1986 19.8531L21.1663 16.34C19.7502 15.1062 17.6579 15.0502 16.1777 16.2066L14.1066 17.8246C11.4855 19.8723 7.74378 19.6211 5.41997 17.2414C4.06868 15.8577 1.85863 15.8094 0.448196 17.1329L0 17.5534C0.335417 20.8819 1.69509 23.9081 3.75904 26.3121L7.15509 23.4006C9.79233 21.1396 13.7538 21.4042 16.0669 23.9959C17.2755 25.3501 19.3337 25.5184 20.7463 24.3786L21.0223 24.1558Z" fill="url(#paint0_linear_1_53)"/>
|
|
4
|
-
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M85.5173 2.22307C85.5173 3.44217 84.5132 4.44614 83.2944 4.44614C82.0751 4.44614 81.071 3.44217 81.071 2.22307C81.071 0.968111 82.0751 0 83.2944 0C84.5132 0 85.5173 0.968111 85.5173 2.22307ZM85.0152 26.139H81.6448V8.60541H85.0152V26.139ZM43.2705 21.0474C43.2705 24.382 45.888 26.5692 50.0114 26.5692C54.1707 26.5692 57.039 24.4537 57.039 21.1191C57.039 18.5016 55.5692 17.1391 52.593 16.422L49.5095 15.669C47.7884 15.2388 46.9278 14.4499 46.9278 13.2667C46.9278 11.6532 48.1111 10.7209 50.2266 10.7209C52.2703 10.7209 53.4536 11.8324 53.5253 13.5894H56.7526C56.6809 10.2548 54.1707 8.10343 50.3341 8.10343C46.4617 8.10343 43.7367 10.1472 43.7367 13.3742C43.7367 15.9558 45.2067 17.4977 48.3262 18.2506L51.4098 18.9678C53.2385 19.4339 53.8122 20.151 53.8122 21.3343C53.8122 22.9478 52.4497 23.9159 50.0831 23.9159C47.8601 23.9159 46.4975 22.8402 46.4975 21.0474H43.2705ZM69.0593 26.5692C73.3981 26.5692 76.3382 24.4537 77.1989 20.6889H74.0436C73.4698 22.6968 71.749 23.7725 69.1311 23.7725C65.7965 23.7725 63.8605 21.7286 63.6094 18.0355L77.1631 17.9997V16.7447C77.1631 11.5456 73.9002 8.10343 68.9165 8.10343C63.8246 8.10343 60.3465 11.9042 60.3465 17.3901C60.3465 22.8402 63.8963 26.5692 69.0593 26.5692ZM68.9165 10.936C71.8925 10.936 73.7926 12.8723 73.7926 15.7766H63.6811C64.1115 12.693 65.9758 10.936 68.9165 10.936Z" fill="black"/>
|
|
5
|
-
</g>
|
|
6
|
-
<defs>
|
|
7
|
-
<linearGradient id="paint0_linear_1_53" x1="15.8958" y1="2.37374e-07" x2="22.1762" y2="31.8667" gradientUnits="userSpaceOnUse">
|
|
8
|
-
<stop stop-color="#780000"/>
|
|
9
|
-
<stop offset="1" stop-color="#C1121F"/>
|
|
10
|
-
</linearGradient>
|
|
11
|
-
<clipPath id="clip0_1_53">
|
|
12
|
-
<rect width="85.5172" height="32" fill="white"/>
|
|
13
|
-
</clipPath>
|
|
14
|
-
</defs>
|
|
15
|
-
</svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-11-8-18-19-18zm-10 15c2-4 5-7 10-7s8 3 9 7h-19zm-39 3c0 6 4 10 10 10 4 0 7-2 9-5l8 5c-3 5-9 8-17 8-11 0-19-7-19-18s8-18 19-18c8 0 14 3 17 8l-8 5c-2-3-5-5-9-5-6 0-10 4-10 10zm83-29v46h-9V5h9zM37 0l37 64H0L37 0zm92 5-27 48L74 5h10l18 30 17-30h10zm59 12v10l-3-1c-6 0-10 4-10 10v15h-9V17h9v9c0-5 6-9 13-9z"/></svg>
|
package/dist/templates/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { getCosmWasmClient, getQueryClient, getSigningCosmWasmClient, getStargateClient } from "@sei-js/cosmjs";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { defaultUrls, selectedChain } from "../../constants";
|
|
4
|
-
import { useChain } from "@cosmos-kit/react";
|
|
5
|
-
|
|
6
|
-
import './Homepage.css'
|
|
7
|
-
type ExampleProps = {
|
|
8
|
-
chainId: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function Examples({ chainId }: ExampleProps) {
|
|
12
|
-
const [balance, setBalance] = useState(0)
|
|
13
|
-
const [pool, setPool] = useState({ bonded_tokens: 0, not_bonded_tokens: 0 });
|
|
14
|
-
const [count, setCount] = useState(0)
|
|
15
|
-
|
|
16
|
-
const { address, getOfflineSignerAmino } = useChain(selectedChain.chain_name);
|
|
17
|
-
|
|
18
|
-
// Example of using the query client to query Sei modules
|
|
19
|
-
const getStakingPool = async () => {
|
|
20
|
-
const queryClient = await getQueryClient(defaultUrls[chainId].rest);
|
|
21
|
-
const result = await queryClient.cosmos.staking.v1beta1.pool({});
|
|
22
|
-
setPool(result.pool)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const renderStakingPoolExample = () => {
|
|
26
|
-
return (
|
|
27
|
-
<div className="card">
|
|
28
|
-
<div className="card-header">
|
|
29
|
-
<p className="card__title">Staking Pool</p>
|
|
30
|
-
<small className="card__description">
|
|
31
|
-
<a
|
|
32
|
-
href="https://sei-protocol.github.io/sei-js/functions/cosmjs.getQueryClient.html"
|
|
33
|
-
target="_blank">Sei QueryClient</a> query example
|
|
34
|
-
</small>
|
|
35
|
-
</div>
|
|
36
|
-
<div className="card-body">
|
|
37
|
-
<div className="content-background space-between">
|
|
38
|
-
<small>Bonded Tokens</small>
|
|
39
|
-
<p>{pool ? pool.bonded_tokens : '---'} SEI</p>
|
|
40
|
-
</div>
|
|
41
|
-
<div className="content-background space-between">
|
|
42
|
-
<small>Unbonded Tokens</small>
|
|
43
|
-
<p>{pool ? pool.not_bonded_tokens : '---'} SEI</p>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
<div className="card-footer">
|
|
47
|
-
<button onClick={getStakingPool}>Fetch Staking Data</button>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const getBalanceStargate = async () => {
|
|
54
|
-
if (!address) {
|
|
55
|
-
return undefined
|
|
56
|
-
}
|
|
57
|
-
const queryClient = await getStargateClient(defaultUrls[chainId].rpc);
|
|
58
|
-
const useiBalance = await queryClient.getBalance(address, 'usei');
|
|
59
|
-
const seiBalance = Number(useiBalance.amount) / 1000000
|
|
60
|
-
setBalance(seiBalance);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const renderBalanceExample = () => {
|
|
64
|
-
return (
|
|
65
|
-
<div className="card">
|
|
66
|
-
<div className="card-header">
|
|
67
|
-
<p className="card__title">Wallet Balance</p>
|
|
68
|
-
<small className="card__description">
|
|
69
|
-
<a
|
|
70
|
-
href="https://cosmos.github.io/cosmjs/latest/stargate/classes/StargateClient.html"
|
|
71
|
-
target="_blank">Stargate Client</a> query example
|
|
72
|
-
</small>
|
|
73
|
-
</div>
|
|
74
|
-
<div className="card-body">
|
|
75
|
-
<div className="content-background space-between">
|
|
76
|
-
<small>SEI</small>
|
|
77
|
-
<p>{balance ? balance : '---' } SEI</p>
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
<div className="card-footer">
|
|
81
|
-
<button onClick={getBalanceStargate}>Fetch balance</button>
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
)
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const fetchCount = async () => {
|
|
88
|
-
const cosmWasmClient = await getCosmWasmClient(defaultUrls[chainId].rpc);
|
|
89
|
-
console.log(cosmWasmClient);
|
|
90
|
-
const CONTRACT_ADDRESS =
|
|
91
|
-
"sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m";
|
|
92
|
-
const response = await cosmWasmClient.queryContractSmart(CONTRACT_ADDRESS, {
|
|
93
|
-
get_count: {},
|
|
94
|
-
});
|
|
95
|
-
const result = response?.count;
|
|
96
|
-
if (result) {
|
|
97
|
-
setCount(result);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const incrementCounter = async () => {
|
|
102
|
-
if (!address) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
const offlineSigner = await getOfflineSignerAmino();
|
|
106
|
-
const signingCosmWasmClient = await getSigningCosmWasmClient(
|
|
107
|
-
defaultUrls[chainId].rpc,
|
|
108
|
-
offlineSigner
|
|
109
|
-
)
|
|
110
|
-
|
|
111
|
-
try {
|
|
112
|
-
const senderAddress = address;
|
|
113
|
-
const CONTRACT_ADDRESS =
|
|
114
|
-
"sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m";
|
|
115
|
-
|
|
116
|
-
// Build message content
|
|
117
|
-
const msg = { increment: {} };
|
|
118
|
-
|
|
119
|
-
// Define gas price and limit
|
|
120
|
-
const fee = {
|
|
121
|
-
amount: [{ amount: "20000", denom: "usei" }],
|
|
122
|
-
gas: "200000",
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
// Call smart contract execute msg
|
|
126
|
-
await signingCosmWasmClient?.execute(senderAddress, CONTRACT_ADDRESS, msg, fee);
|
|
127
|
-
|
|
128
|
-
await fetchCount();
|
|
129
|
-
|
|
130
|
-
} catch (error) {
|
|
131
|
-
console.log(error)
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const renderCounterContractExample = () => {
|
|
136
|
-
return (
|
|
137
|
-
<div className="card">
|
|
138
|
-
<div className="card-header">
|
|
139
|
-
<p className="card__title">Smart contract interaction</p>
|
|
140
|
-
<small>
|
|
141
|
-
<a
|
|
142
|
-
href="https://cosmos.github.io/cosmjs/latest/cosmwasm-stargate/classes/SigningCosmWasmClient.html"
|
|
143
|
-
target="_blank">
|
|
144
|
-
CosmWasm Clients
|
|
145
|
-
</a> example of smart
|
|
146
|
-
contract interaction
|
|
147
|
-
</small>
|
|
148
|
-
</div>
|
|
149
|
-
<div className="card-body">
|
|
150
|
-
<div className="content-background space-between">
|
|
151
|
-
<small>Count</small>
|
|
152
|
-
<p>{count}</p>
|
|
153
|
-
<button
|
|
154
|
-
className="small outline"
|
|
155
|
-
onClick={incrementCounter}
|
|
156
|
-
>
|
|
157
|
-
Increase
|
|
158
|
-
</button>
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
<div className="card-footer">
|
|
162
|
-
<button onClick={fetchCount}>Fetch count</button>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
)
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return (
|
|
169
|
-
<div className="grid">
|
|
170
|
-
{renderBalanceExample()}
|
|
171
|
-
{renderStakingPoolExample()}
|
|
172
|
-
{renderCounterContractExample()}
|
|
173
|
-
</div>
|
|
174
|
-
)
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export default Examples;
|
package/dist/templates/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
#root {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
min-height: 100vh;
|
|
5
|
-
}
|
|
6
|
-
.app {
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: 100%;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.logo {
|
|
12
|
-
width: 20%;
|
|
13
|
-
align-self: center;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.container {
|
|
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
|
-
}
|
|
27
|
-
|
|
28
|
-
.grid {
|
|
29
|
-
width: 100%;
|
|
30
|
-
display: grid;
|
|
31
|
-
grid-template-columns: repeat(1, 1fr);
|
|
32
|
-
gap: 1rem;
|
|
33
|
-
}
|
|
34
|
-
.grid.docs {
|
|
35
|
-
grid-template-columns: repeat(1, 1fr);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.card {
|
|
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
|
-
}
|
|
46
|
-
|
|
47
|
-
.card.secondary {
|
|
48
|
-
background: transparent;
|
|
49
|
-
border: 1px solid var(--border);
|
|
50
|
-
box-shadow: none;
|
|
51
|
-
}
|
|
52
|
-
.card.intro {
|
|
53
|
-
display: flex;
|
|
54
|
-
flex-direction: column;
|
|
55
|
-
gap: 1rem;
|
|
56
|
-
justify-content: space-between;
|
|
57
|
-
align-items: flex-start;
|
|
58
|
-
}
|
|
59
|
-
.card-header {
|
|
60
|
-
display: flex;
|
|
61
|
-
flex-direction: column;
|
|
62
|
-
justify-content: space-between;
|
|
63
|
-
gap: 0.25rem;
|
|
64
|
-
}
|
|
65
|
-
.card-body {
|
|
66
|
-
display: flex;
|
|
67
|
-
flex-direction: column;
|
|
68
|
-
justify-content: space-between;
|
|
69
|
-
margin: 1.5rem 0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.card-footer {
|
|
73
|
-
display: flex;
|
|
74
|
-
flex-direction: row;
|
|
75
|
-
gap: 0.5rem;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.card__title {
|
|
79
|
-
font-size: 1.15rem;
|
|
80
|
-
font-weight: 600;
|
|
81
|
-
}
|
|
82
|
-
.content-background {
|
|
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
|
-
}
|
|
91
|
-
|
|
92
|
-
.wallet-address {
|
|
93
|
-
text-wrap: anywhere;
|
|
94
|
-
line-break: anywhere;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.space-between {
|
|
98
|
-
justify-content: space-between;
|
|
99
|
-
gap: 1rem;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.hide-on-mobile {
|
|
103
|
-
display: none;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.hide-on-desktop {
|
|
107
|
-
display: block;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.external-link {
|
|
111
|
-
display: inline-flex;
|
|
112
|
-
gap: 0.25rem;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.get-started {
|
|
116
|
-
text-align: center;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.wallet-connect {
|
|
120
|
-
display: flex;
|
|
121
|
-
gap: 1rem;
|
|
122
|
-
align-items: center;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
@media (min-width: 768px) {
|
|
127
|
-
|
|
128
|
-
.card.intro {
|
|
129
|
-
grid-column: span 2;
|
|
130
|
-
flex-direction: row;
|
|
131
|
-
align-items: center;
|
|
132
|
-
}
|
|
133
|
-
.hide-on-mobile {
|
|
134
|
-
display: block;
|
|
135
|
-
}
|
|
136
|
-
.hide-on-desktop {
|
|
137
|
-
display: none;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.container {
|
|
141
|
-
max-width: 96rem;
|
|
142
|
-
padding: 2rem;
|
|
143
|
-
}
|
|
144
|
-
.grid {
|
|
145
|
-
grid-template-columns: repeat(3, 1fr);
|
|
146
|
-
}
|
|
147
|
-
.grid.docs {
|
|
148
|
-
grid-template-columns: repeat(3, 1fr);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
@media (min-width: 1024px) {
|
|
153
|
-
.container {
|
|
154
|
-
max-width: 80rem;
|
|
155
|
-
}
|
|
156
|
-
}
|
package/dist/templates/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import './Homepage.css'
|
|
4
|
-
import Examples from './Examples';
|
|
5
|
-
import { selectedChain } from '../../constants';
|
|
6
|
-
import { WalletConnectButton } from '..';
|
|
7
|
-
|
|
8
|
-
type HelpItem = {
|
|
9
|
-
title: string;
|
|
10
|
-
description: string;
|
|
11
|
-
link: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const renderHelpItem = ({ title, description, link }: HelpItem) => (
|
|
15
|
-
<div className="card secondary">
|
|
16
|
-
<div className="card-header">
|
|
17
|
-
<p className="card__title">
|
|
18
|
-
<a href={link} target='_blank' rel='noopener noreferrer' className="external-link">
|
|
19
|
-
{title} {externalIcon}
|
|
20
|
-
</a>
|
|
21
|
-
</p>
|
|
22
|
-
<small className="card__description">
|
|
23
|
-
{description}
|
|
24
|
-
</small>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
const helpItems: HelpItem[] = [
|
|
30
|
-
{
|
|
31
|
-
title: 'Sei Docs',
|
|
32
|
-
description: 'Find in-depth information about Sei.',
|
|
33
|
-
link: 'https://docs.sei.io/'
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
title: 'CosmosKit',
|
|
37
|
-
description: "Learn about CosmosKit and it's hooks for chain interaction.",
|
|
38
|
-
link: 'https://docs.cosmology.zone/cosmos-kit/get-started'
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
title: 'sei-js',
|
|
42
|
-
description: 'Interact with Sei using @sei-js/cosmjs.',
|
|
43
|
-
link: 'https://sei-protocol.github.io/sei-js/modules/cosmjs.html'
|
|
44
|
-
}
|
|
45
|
-
];
|
|
46
|
-
|
|
47
|
-
const externalIcon = (
|
|
48
|
-
<svg
|
|
49
|
-
width="16"
|
|
50
|
-
height="16"
|
|
51
|
-
viewBox="0 0 16 16"
|
|
52
|
-
fill="none"
|
|
53
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
54
|
-
>
|
|
55
|
-
<path
|
|
56
|
-
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"
|
|
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
|
-
/>
|
|
76
|
-
</svg>
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
export function Homepage() {
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<div className="container">
|
|
83
|
-
<img src="sei-logotype.svg" className="logo" alt="SEI logotype" />
|
|
84
|
-
<div className="card intro">
|
|
85
|
-
<div className="card-header">
|
|
86
|
-
<p className="card__title">Wallet address</p>
|
|
87
|
-
<small className="card__description">
|
|
88
|
-
Connect wallet to see your address and balance
|
|
89
|
-
</small>
|
|
90
|
-
</div>
|
|
91
|
-
<WalletConnectButton/>
|
|
92
|
-
</div>
|
|
93
|
-
<Examples chainId={selectedChain.chain_id}/>
|
|
94
|
-
<div className="get-started">
|
|
95
|
-
Get started by editing <code>src/app/page.tsx</code>
|
|
96
|
-
</div>
|
|
97
|
-
<div className="grid docs">
|
|
98
|
-
{
|
|
99
|
-
helpItems.map((item, _) => (
|
|
100
|
-
<div key={item.title}>
|
|
101
|
-
{renderHelpItem(item)}
|
|
102
|
-
</div>
|
|
103
|
-
))
|
|
104
|
-
}
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export default Homepage;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { useChain } from "@cosmos-kit/react";
|
|
2
|
-
|
|
3
|
-
import "@interchain-ui/react/styles";
|
|
4
|
-
|
|
5
|
-
import { truncateSeiAddress } from "@sei-js/cosmjs";
|
|
6
|
-
import { selectedChain } from "../../constants";
|
|
7
|
-
|
|
8
|
-
export function WalletConnectButton() {
|
|
9
|
-
const {
|
|
10
|
-
isWalletConnected,
|
|
11
|
-
address,
|
|
12
|
-
connect,
|
|
13
|
-
openView,
|
|
14
|
-
} = useChain(selectedChain.chain_name);
|
|
15
|
-
|
|
16
|
-
const truncatedSeiAddr = address ? truncateSeiAddress(address) : ""
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<button
|
|
20
|
-
className="primary"
|
|
21
|
-
onClick={isWalletConnected ? openView : connect}
|
|
22
|
-
>
|
|
23
|
-
{isWalletConnected ? truncateSeiAddress(truncatedSeiAddr) : "Connect"}
|
|
24
|
-
</button>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
import { ChainProvider } from '@cosmos-kit/react';
|
|
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'
|
|
13
|
-
import { selectedChain } from '../constants';
|
|
14
|
-
|
|
15
|
-
interface Web3ProviderProps {
|
|
16
|
-
children: ReactNode;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const compassWallet = new CompassExtensionWallet({
|
|
20
|
-
...compassExtensionInfo,
|
|
21
|
-
mobileDisabled: false,
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
function Web3Provider({ children }: Web3ProviderProps) {
|
|
25
|
-
|
|
26
|
-
// Define your supported wallets here
|
|
27
|
-
const wallets = [compassWallet, ...finWallets, ...keplrWallets];
|
|
28
|
-
|
|
29
|
-
// Define the list of sei chain you would like to connect to here.
|
|
30
|
-
const chains = [selectedChain]
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<ChainProvider chains={chains} assetLists={[COSMOS_KIT_ASSET_LIST]} wallets={wallets}>
|
|
34
|
-
{children}
|
|
35
|
-
</ChainProvider>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default Web3Provider;
|