-
-
Notifications
You must be signed in to change notification settings - Fork 246
feat: initial multichain (react) playground #1331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5406248
fix: implement UI for multichain playground
elribonazo 639301e
fix: add lock
elribonazo 89e4c08
fix: improve useSDK
elribonazo b51e599
fix: install modal web show initial QRCode
elribonazo d2835f0
fix: clean install modal after closing
elribonazo f5aa755
fix: unload and re-launching modals
elribonazo ae0292a
fix: linter fixes
elribonazo 1b881b2
fix: type module
elribonazo d32f8aa
fix: rollback to cjs config in multichain-react
elribonazo 471fab6
fix: build fix
elribonazo 2cc064f
fix: convert craco to cjs
elribonazo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,36 @@ | ||
| { | ||
| "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json", | ||
| "vcs": { | ||
| "enabled": false, | ||
| "clientKind": "git", | ||
| "useIgnoreFile": false | ||
| }, | ||
| "files": { | ||
| "includes": ["packages/sdk-multichain/src/**", "!**/node_modules/**", "!**/dist/**"], | ||
| "ignoreUnknown": false | ||
| }, | ||
| "formatter": { | ||
| "enabled": true, | ||
| "indentStyle": "tab", | ||
| "lineWidth": 180 | ||
| }, | ||
| "linter": { | ||
| "enabled": true, | ||
| "rules": { | ||
| "recommended": true | ||
| } | ||
| }, | ||
| "javascript": { | ||
| "formatter": { | ||
| "quoteStyle": "single" | ||
| } | ||
| }, | ||
| "assist": { | ||
| "enabled": true, | ||
| "actions": { | ||
| "source": { | ||
| "organizeImports": "on" | ||
| } | ||
| } | ||
| } | ||
| "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json", | ||
| "vcs": { | ||
| "enabled": false, | ||
| "clientKind": "git", | ||
| "useIgnoreFile": false | ||
| }, | ||
| "files": { | ||
| "includes": ["packages/sdk-multichain/src/**", "playground/multichain-node/src/**", "playground/multichain-react/src/**", "!**/node_modules/**", "!**/dist/**"], | ||
| "ignoreUnknown": false | ||
| }, | ||
| "formatter": { | ||
| "enabled": true, | ||
| "indentStyle": "tab", | ||
| "lineWidth": 180 | ||
| }, | ||
| "linter": { | ||
| "enabled": true, | ||
| "rules": { | ||
| "recommended": true | ||
| } | ||
| }, | ||
| "javascript": { | ||
| "formatter": { | ||
| "quoteStyle": "single" | ||
| } | ||
| }, | ||
| "assist": { | ||
| "enabled": true, | ||
| "actions": { | ||
| "source": { | ||
| "organizeImports": "on" | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "ignores": [ | ||
| "@lavamoat/allow-scripts", | ||
| "@lavamoat/preinstall-always-fail", | ||
| "@metamask/auto-changelog", | ||
| "@types/*", | ||
| "@yarnpkg/types", | ||
| "prettier-plugin-packagejson", | ||
| "ts-node", | ||
| "typedoc", | ||
| "buffer" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| indent_style = space | ||
| indent_size = 2 | ||
| end_of_line = lf | ||
| charset = utf-8 | ||
| trim_trailing_whitespace = true | ||
| insert_final_newline = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Helius RPC API Configuration | ||
| # Optional: Helius RPC API key for enhanced Solana RPC performance | ||
| # If not provided, the app will fall back to public Solana RPC endpoints | ||
| # Get your API key from: https://www.helius.dev/ | ||
| REACT_APP_HELIUS_API_KEY=your_helius_api_key_here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| * text=auto | ||
|
|
||
| yarn.lock linguist-generated=false | ||
|
|
||
| # yarn v3 | ||
| # See: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored | ||
| /.yarn/releases/** binary | ||
| /.yarn/plugins/** binary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| .DS_Store | ||
| dist/ | ||
| coverage/ | ||
| docs/ | ||
| .env | ||
|
|
||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| lerna-debug.log* | ||
|
|
||
| # Diagnostic reports (https://nodejs.org/api/report.html) | ||
| report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
|
||
| # Runtime data | ||
| pids | ||
| *.pid | ||
| *.seed | ||
| *.pid.lock | ||
|
|
||
| # Coverage directory used by tools like istanbul | ||
| coverage | ||
| *.lcov | ||
|
|
||
| # nyc test coverage | ||
| .nyc_output | ||
|
|
||
| # node-waf configuration | ||
| .lock-wscript | ||
|
|
||
| # Compiled binary addons (https://nodejs.org/api/addons.html) | ||
| build/Release | ||
|
|
||
| # Dependency directories | ||
| node_modules/ | ||
|
|
||
| # TypeScript cache | ||
| *.tsbuildinfo | ||
|
|
||
| # Optional npm cache directory | ||
| .npm | ||
|
|
||
| # Optional eslint cache | ||
| .eslintcache | ||
|
|
||
| # Microbundle cache | ||
| .rpt2_cache/ | ||
| .rts2_cache_cjs/ | ||
| .rts2_cache_es/ | ||
| .rts2_cache_umd/ | ||
|
|
||
| # Optional REPL history | ||
| .node_repl_history | ||
|
|
||
| # Output of 'npm pack' | ||
| *.tgz | ||
|
|
||
| # Yarn Integrity file | ||
| .yarn-integrity | ||
|
|
||
| # dotenv environment variables file | ||
| .env | ||
| .env.test | ||
|
|
||
| # Stores VSCode versions used for testing VSCode extensions | ||
| .vscode-test | ||
|
|
||
| # yarn v3 (w/o zero-install) | ||
| # See: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored | ||
| .pnp.* | ||
| .yarn/* | ||
| !.yarn/patches | ||
| !.yarn/plugins | ||
| !.yarn/releases | ||
| !.yarn/sdks | ||
| !.yarn/versions | ||
|
|
||
| build/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Changelog | ||
| All notable changes to this project will be documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| [Unreleased]: https://github.com/MetaMask/metamask-sdk/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # MetaMask Test Dapp Multichain | ||
|
|
||
| A test dapp for the MetaMask Multichain API. | ||
|
|
||
| ## Installation | ||
|
|
||
| `yarn` | ||
|
|
||
| ## Configuration | ||
|
|
||
| ### Environment Variables | ||
|
|
||
| This project supports optional environment variables for enhanced functionality: | ||
|
|
||
| #### Helius RPC API Key (Optional) | ||
| For improved Solana RPC performance, you can configure a Helius API key: | ||
|
|
||
| 1. Copy the example environment file: | ||
| ```bash | ||
| cp .env.example .env.local | ||
| ``` | ||
|
|
||
| 2. Get a free API key from [Helius](https://www.helius.dev/) | ||
|
|
||
| 3. Add your API key to `.env.local`: | ||
| ``` | ||
| REACT_APP_HELIUS_API_KEY=your_actual_api_key_here | ||
| ``` | ||
|
|
||
| **Note:** If no Helius API key is provided, the app will automatically fall back to public Solana RPC endpoints. | ||
|
|
||
| ## Usage | ||
|
|
||
| To start the development server: | ||
|
|
||
| `yarn start` | ||
|
|
||
| This will launch the test dapp, allowing you to interact with the MetaMask Multichain API. | ||
|
|
||
| ## Contributing | ||
|
|
||
| #### This project uses the [MetaMask Module Template](https://github.com/MetaMask/metamask-module-template) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| const webpack = require('webpack'); | ||
|
|
||
| module.exports = { | ||
| webpack: { | ||
| configure: (webpackConfig) => { | ||
| webpackConfig.resolve.fallback = { | ||
| ...webpackConfig.resolve.fallback, | ||
| buffer: require.resolve('buffer'), | ||
| process: require.resolve('process/browser.js'), | ||
| }; | ||
| webpackConfig.plugins.push( | ||
| new webpack.ProvidePlugin({ | ||
| Buffer: ['buffer', 'Buffer'], | ||
| process: 'process/browser.js', | ||
| }), | ||
| ); | ||
| return webpackConfig; | ||
| }, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| throw new Error( | ||
| 'This package is published to npm so that the static files can be hosted locally for testing. This package cannot be run directly.', | ||
| ); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.