Skip to content

Commit 9b743b5

Browse files
committed
fix: add functional dapp example with solana + evm network support using our latest sdk
1 parent f43be4a commit 9b743b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3779
-66
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"packages/devnext",
2424
"packages/deve2e",
2525
"packages/playground-next",
26-
"packages/sdk-multichain"
26+
"packages/sdk-multichain",
27+
"playground/multichain-react"
2728
],
2829
"scripts": {
2930
"build": "yarn install && cd packages/sdk-socket-server-next && yarn install && cd ../.. && yarn workspaces foreach --verbose run build:pre-tsc && yarn workspaces foreach --verbose --topological --parallel --no-private run build && yarn workspaces foreach --verbose run build:post-tsc ",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"ignores": [
3+
"@lavamoat/allow-scripts",
4+
"@lavamoat/preinstall-always-fail",
5+
"@metamask/auto-changelog",
6+
"@types/*",
7+
"@yarnpkg/types",
8+
"prettier-plugin-packagejson",
9+
"ts-node",
10+
"typedoc",
11+
"buffer"
12+
]
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Helius RPC API Configuration
2+
# Optional: Helius RPC API key for enhanced Solana RPC performance
3+
# If not provided, the app will fall back to public Solana RPC endpoints
4+
# Get your API key from: https://www.helius.dev/
5+
REACT_APP_HELIUS_API_KEY=your_helius_api_key_here
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
* text=auto
2+
3+
yarn.lock linguist-generated=false
4+
5+
# yarn v3
6+
# See: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
7+
/.yarn/releases/** binary
8+
/.yarn/plugins/** binary
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
.DS_Store
2+
dist/
3+
coverage/
4+
docs/
5+
.env
6+
7+
# Logs
8+
logs
9+
*.log
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
lerna-debug.log*
14+
15+
# Diagnostic reports (https://nodejs.org/api/report.html)
16+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
17+
18+
# Runtime data
19+
pids
20+
*.pid
21+
*.seed
22+
*.pid.lock
23+
24+
# Coverage directory used by tools like istanbul
25+
coverage
26+
*.lcov
27+
28+
# nyc test coverage
29+
.nyc_output
30+
31+
# node-waf configuration
32+
.lock-wscript
33+
34+
# Compiled binary addons (https://nodejs.org/api/addons.html)
35+
build/Release
36+
37+
# Dependency directories
38+
node_modules/
39+
40+
# TypeScript cache
41+
*.tsbuildinfo
42+
43+
# Optional npm cache directory
44+
.npm
45+
46+
# Optional eslint cache
47+
.eslintcache
48+
49+
# Microbundle cache
50+
.rpt2_cache/
51+
.rts2_cache_cjs/
52+
.rts2_cache_es/
53+
.rts2_cache_umd/
54+
55+
# Optional REPL history
56+
.node_repl_history
57+
58+
# Output of 'npm pack'
59+
*.tgz
60+
61+
# Yarn Integrity file
62+
.yarn-integrity
63+
64+
# dotenv environment variables file
65+
.env
66+
.env.test
67+
68+
# Stores VSCode versions used for testing VSCode extensions
69+
.vscode-test
70+
71+
# yarn v3 (w/o zero-install)
72+
# See: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
73+
.pnp.*
74+
.yarn/*
75+
!.yarn/patches
76+
!.yarn/plugins
77+
!.yarn/releases
78+
!.yarn/sdks
79+
!.yarn/versions
80+
81+
build/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# MetaMask Test Dapp Multichain
2+
3+
A test dapp for the MetaMask Multichain API.
4+
5+
## Installation
6+
7+
`yarn`
8+
9+
## Configuration
10+
11+
### Environment Variables
12+
13+
This project supports optional environment variables for enhanced functionality:
14+
15+
#### Helius RPC API Key (Optional)
16+
For improved Solana RPC performance, you can configure a Helius API key:
17+
18+
1. Copy the example environment file:
19+
```bash
20+
cp .env.example .env.local
21+
```
22+
23+
2. Get a free API key from [Helius](https://www.helius.dev/)
24+
25+
3. Add your API key to `.env.local`:
26+
```
27+
REACT_APP_HELIUS_API_KEY=your_actual_api_key_here
28+
```
29+
30+
**Note:** If no Helius API key is provided, the app will automatically fall back to public Solana RPC endpoints.
31+
32+
## Usage
33+
34+
To start the development server:
35+
36+
`yarn start`
37+
38+
This will launch the test dapp, allowing you to interact with the MetaMask Multichain API.
39+
40+
## Contributing
41+
42+
#### This project uses the [MetaMask Module Template](https://github.com/MetaMask/metamask-module-template)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
7+
},
8+
"files": {
9+
"includes": ["**", "!**/node_modules/**", "!**/dist/**"],
10+
"ignoreUnknown": false
11+
},
12+
"formatter": {
13+
"enabled": true,
14+
"indentStyle": "tab",
15+
"lineWidth": 180
16+
},
17+
"linter": {
18+
"enabled": true,
19+
"rules": {
20+
"recommended": true
21+
}
22+
},
23+
"javascript": {
24+
"formatter": {
25+
"quoteStyle": "double"
26+
}
27+
},
28+
"assist": {
29+
"enabled": true,
30+
"actions": {
31+
"source": {
32+
"organizeImports": "on"
33+
}
34+
}
35+
}
36+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import webpack from 'webpack';
2+
3+
4+
export default {
5+
webpack: {
6+
configure: (webpackConfig) => {
7+
webpackConfig.resolve.fallback = {
8+
...webpackConfig.resolve.fallback,
9+
buffer: require.resolve('buffer'),
10+
};
11+
webpackConfig.plugins.push(
12+
new webpack.ProvidePlugin({
13+
Buffer: ['buffer', 'Buffer'],
14+
process: 'process/browser',
15+
})
16+
);
17+
return webpackConfig;
18+
},
19+
},
20+
};

0 commit comments

Comments
 (0)