Skip to content

Commit 6d7a2c5

Browse files
authored
feat: AppKit Solana Example (#684)
* first commit for solana example * fix show balance when connected * add social and delete a cast * encode signature in base58
1 parent 2a6fc94 commit 6d7a2c5

17 files changed

+9316
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

33
.DS_Store
4+
.next
45

56
# dependencies
67
node_modules
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_PROJECT_ID=YOUR_PROJECT_ID
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module.exports = {
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:react/recommended"
10+
],
11+
"overrides": [
12+
{
13+
"env": {
14+
"node": true
15+
},
16+
"files": [
17+
".eslintrc.{js,cjs}"
18+
],
19+
"parserOptions": {
20+
"sourceType": "script"
21+
}
22+
}
23+
],
24+
"parser": "@typescript-eslint/parser",
25+
"parserOptions": {
26+
"ecmaVersion": "latest",
27+
"sourceType": "module"
28+
},
29+
"plugins": [
30+
"@typescript-eslint",
31+
"react"
32+
],
33+
"rules": {
34+
"react/react-in-jsx-scope": "off"
35+
}
36+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Vite + React
2+
3+
This is a [Vite](https://vitejs.dev) project together with React.
4+
5+
[![Edit in CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/github/codesandbox/codesandbox-template-vite-react/main)
6+
7+
[Configuration](https://codesandbox.io/docs/projects/learn/setting-up/tasks) `.codesandbox/tasks.json` has been added to optimize it for [CodeSandbox](https://codesandbox.io/dashboard).
8+
9+
## Usage
10+
11+
1. Go to [WalletConnect Cloud](https://cloud.walletconnect.com) and create a new project.
12+
2. Copy your `Project ID`
13+
3. Rename `.env.example` to `.env` and paste your `Project ID` as the value for `VITE_PROJECT_ID`
14+
4. Run `yarn` to install dependencies
15+
5. Run `yarn dev` to start the development server
16+
17+
## Resources
18+
19+
- [CodeSandbox — Docs](https://codesandbox.io/docs/projects)
20+
- [CodeSandbox — Discord](https://discord.gg/Ggarp3pX5H)
21+
- [Vite — GitHub](https://github.com/vitejs/vite)
22+
- [Vite — Docs](https://vitejs.dev/guide/)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/walletconnect.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>AppKit Solana v1</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "sandbox",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"@solana/wallet-adapter-wallets": "0.19.32",
14+
"@solana/web3.js": "^1.95.3",
15+
"@web3modal/solana": "^5.1.3",
16+
"bs58": "^6.0.0",
17+
"react": "18.3.1",
18+
"react-dom": "18.3.1"
19+
},
20+
"devDependencies": {
21+
"@types/react": "18.3.4",
22+
"@types/react-dom": "18.3.0",
23+
"@typescript-eslint/eslint-plugin": "8.3.0",
24+
"@typescript-eslint/parser": "8.3.0",
25+
"@vitejs/plugin-react-swc": "3.7.0",
26+
"eslint": "9.9.1",
27+
"eslint-plugin-react": "7.35.0",
28+
"eslint-plugin-react-hooks": "4.6.2",
29+
"eslint-plugin-react-refresh": "0.4.11",
30+
"typescript": "5.5.4",
31+
"vite": "5.4.2"
32+
},
33+
"overrides": {
34+
"vite": "5.4.2"
35+
}
36+
}

0 commit comments

Comments
 (0)