-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
8,929 additions
and
6,617 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -76,4 +76,8 @@ node_modules/ | |
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
packages/snap/.yalc/ | ||
|
||
packages/snap/yalc.lock | ||
|
||
.idea/ |
This file contains 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 +1 @@ | ||
v16 | ||
lts/* |
This file contains 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 @@ | ||
/* eslint-disable */ | ||
//prettier-ignore | ||
module.exports = { | ||
name: "@yarnpkg/plugin-allow-scripts", | ||
factory: function (require) { | ||
var plugin=(()=>{var l=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(o,e)=>(typeof require<"u"?require:o)[e]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var u=(t,o)=>{for(var e in o)l(t,e,{get:o[e],enumerable:!0})},f=(t,o,e,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of a(o))!c.call(t,i)&&i!==e&&l(t,i,{get:()=>o[i],enumerable:!(r=s(o,i))||r.enumerable});return t};var m=t=>f(l({},"__esModule",{value:!0}),t);var g={};u(g,{default:()=>d});var n=p("@yarnpkg/shell"),x={hooks:{afterAllInstalled:async()=>{let t=await(0,n.execute)("yarn run allow-scripts");t!==0&&process.exit(t)}}},d=x;return m(g);})(); | ||
return plugin; | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains 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,7 +1,15 @@ | ||
enableScripts: false | ||
|
||
enableTelemetry: 0 | ||
|
||
logFilters: | ||
- code: YN0004 | ||
level: discard | ||
|
||
nodeLinker: node-modules | ||
|
||
plugins: | ||
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs | ||
spec: '@yarnpkg/plugin-workspace-tools' | ||
|
||
yarnPath: .yarn/releases/yarn-3.2.1.cjs | ||
- path: .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs | ||
spec: 'https://raw.githubusercontent.com/LavaMoat/LavaMoat/main/packages/yarn-plugin-allow-scripts/bundles/@yarnpkg/plugin-allow-scripts.js' |
This file contains 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,63 +1,53 @@ | ||
# Casper Snap | ||
# @metamask/template-snap-monorepo | ||
|
||
Snap to enable MetaMask users interaction with [Casper](https://docs.casperlabs.io/) dapps. | ||
For detailed documentation and integration instructions see our [helper](https://casper-ecosystem.github.io/casper-manager/). | ||
This repository demonstrates how to develop a snap with TypeScript. For detailed | ||
instructions, see [the MetaMask documentation](https://docs.metamask.io/guide/snaps.html#serving-a-snap-to-your-local-environment). | ||
|
||
Read the [FAQ](FAQ.md) and the [Knowledge Base](KnowledgeBase.md). | ||
MetaMask Snaps is a system that allows anyone to safely expand the capabilities | ||
of MetaMask. A _snap_ is a program that we run in an isolated environment that | ||
can customize the wallet experience. | ||
|
||
## Testing Casper Snap | ||
## Snaps is pre-release software | ||
|
||
The snap have been audited by [Halborn](https://www.halborn.com/) on the 20th June 2023. | ||
You can find the audit [here](./audits/20_06_2023_Casper_Management_Snap_App_WebApp_Pentest_Report_Halborn_Final.pdf). | ||
You can find the code difference between the audit and now [here](https://github.com/casper-ecosystem/casper-manager/compare/halbornAudit...main). | ||
To interact with (your) Snaps, you will need to install [MetaMask Flask](https://metamask.io/flask/), | ||
a canary distribution for developers that provides access to upcoming features. | ||
|
||
## Testing Casper Manager Snap | ||
## Getting Started | ||
|
||
### MetaMask Snaps Open Beta | ||
The MetaMask Snaps Open Beta is a first look at what's possible when extending the capabilities of your wallet. We invite those who are comfortable trying new features to test out these Snaps built by talented community developers. | ||
Clone the template-snap repository [using this template](https://github.com/MetaMask/template-snap-monorepo/generate) | ||
and set up the development environment: | ||
|
||
### Live demo dapp | ||
|
||
Test Casper Snap inside [CasperHolders Testnet](https://testnet.casperholders.io/) or [Div3](https://div3.in). | ||
|
||
## Development | ||
|
||
### Requirements | ||
|
||
``` | ||
node version 16 or above | ||
```shell | ||
yarn install && yarn start | ||
``` | ||
|
||
### Usage | ||
## Cloning | ||
|
||
- For nvm users | ||
This repository contains GitHub Actions that you may find useful, see | ||
`.github/workflows` and [Releasing & Publishing](https://github.com/MetaMask/template-snap-monorepo/edit/main/README.md#releasing--publishing) | ||
below for more information. | ||
|
||
```sh | ||
nvm use | ||
``` | ||
If you clone or create this repository outside the MetaMask GitHub organization, | ||
you probably want to run `./scripts/cleanup.sh` to remove some files that will | ||
not work properly outside the MetaMask GitHub organization. | ||
|
||
--- | ||
If you don't wish to use any of the existing GitHub actions in this repository, | ||
simply delete the `.github/workflows` directory. | ||
|
||
- Enable corepack | ||
## Contributing | ||
|
||
```sh | ||
corepack enable | ||
``` | ||
### Testing and Linting | ||
|
||
- Install packages | ||
Run `yarn test` to run the tests once. | ||
|
||
```sh | ||
yarn install | ||
``` | ||
Run `yarn lint` to run the linter, or run `yarn lint:fix` to run the linter and | ||
fix any automatically fixable issues. | ||
|
||
- Run local snap server | ||
### Using NPM packages with scripts | ||
|
||
```sh | ||
yarn start | ||
``` | ||
Scripts are disabled by default for security reasons. If you need to use NPM | ||
packages with scripts, you can run `yarn allow-scripts auto`, and enable the | ||
script in the `lavamoat.allowScripts` section of `package.json`. | ||
|
||
- Run snap tests | ||
|
||
```sh | ||
yarn test | ||
``` | ||
See the documentation for [@lavamoat/allow-scripts](https://github.com/LavaMoat/LavaMoat/tree/main/packages/allow-scripts) | ||
for more information. |
This file contains 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,15 +1,14 @@ | ||
{ | ||
"name": "@metamask/snap-box", | ||
"version": "1.0.4", | ||
"private": true, | ||
"name": "root", | ||
"version": "0.1.0", | ||
"description": "", | ||
"homepage": "https://github.com/MetaMask/snap-box#readme", | ||
"homepage": "https://github.com/MetaMask/template-snap-monorepo#readme", | ||
"bugs": { | ||
"url": "https://github.com/MetaMask/snap-box/issues" | ||
"url": "https://github.com/MetaMask/template-snap-monorepo/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/MetaMask/snap-box.git" | ||
"url": "git+https://github.com/MetaMask/template-snap-monorepo.git" | ||
}, | ||
"license": "(MIT-0 OR Apache-2.0)", | ||
"author": "", | ||
|
@@ -19,61 +18,42 @@ | |
"scripts": { | ||
"build": "yarn workspaces foreach --parallel --topological --verbose run build", | ||
"lint": "yarn lint:eslint && yarn lint:misc --check", | ||
"lint:eslint": "eslint . --cache --ext js,ts", | ||
"lint:eslint": "eslint . --cache --ext js,jsx,ts,tsx", | ||
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", | ||
"lint:misc": "prettier '**/*.json' '**/*.md' '!**/CHANGELOG.md' '**/*.yml' --ignore-path .gitignore", | ||
"release": "release-it", | ||
"start": "yarn workspaces foreach --parallel --interlaced --verbose run start", | ||
"test": "yarn workspaces foreach --parallel --verbose run test" | ||
"test": "yarn workspace snap run test" | ||
}, | ||
"devDependencies": { | ||
"@metamask/eslint-config": "10.0.0", | ||
"@metamask/eslint-config-jest": "10.0.0", | ||
"@metamask/eslint-config-nodejs": "10.0.0", | ||
"@metamask/eslint-config-typescript": "10.0.0", | ||
"@playwright/test": "1.34.3", | ||
"@release-it-plugins/workspaces": "^3.2.0", | ||
"@types/isomorphic-fetch": "0.0.36", | ||
"@types/jest": "29.5.1", | ||
"@typescript-eslint/eslint-plugin": "5.59.7", | ||
"@typescript-eslint/parser": "5.59.7", | ||
"eslint": "8.41.0", | ||
"eslint-config-prettier": "8.8.0", | ||
"eslint-plugin-import": "2.27.5", | ||
"eslint-plugin-jest": "26.9.0", | ||
"eslint-plugin-jsdoc": "39.9.1", | ||
"eslint-plugin-node": "11.1.0", | ||
"eslint-plugin-prettier": "4.2.1", | ||
"jest": "29.5.0", | ||
"prettier": "2.8.8", | ||
"prettier-plugin-packagejson": "2.4.3", | ||
"release-it": "15.10.3", | ||
"ts-jest": "29.1.0", | ||
"typescript": "4.9.5" | ||
"@lavamoat/allow-scripts": "^3.0.0", | ||
"@lavamoat/preinstall-always-fail": "^2.0.0", | ||
"@metamask/eslint-config": "^12.2.0", | ||
"@metamask/eslint-config-jest": "^12.1.0", | ||
"@metamask/eslint-config-nodejs": "^12.1.0", | ||
"@metamask/eslint-config-typescript": "^12.1.0", | ||
"@typescript-eslint/eslint-plugin": "^5.42.1", | ||
"@typescript-eslint/parser": "^5.42.1", | ||
"eslint": "^8.45.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "~2.26.0", | ||
"eslint-plugin-jest": "^27.1.5", | ||
"eslint-plugin-jsdoc": "^41.1.2", | ||
"eslint-plugin-n": "^15.7.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"prettier": "^2.7.1", | ||
"prettier-plugin-packagejson": "^2.2.18", | ||
"sharp": "^0.32.6", | ||
"typescript": "5.1.6" | ||
}, | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
"node": ">=16.0.0" | ||
"node": ">=18.6.0" | ||
}, | ||
"release-it": { | ||
"plugins": { | ||
"@release-it-plugins/workspaces": { | ||
"workspaces": [ | ||
"packages/snap", | ||
"packages/lib" | ||
] | ||
} | ||
}, | ||
"git": { | ||
"requireCleanWorkingDir": false, | ||
"commitMessage": "chore: release v${version}" | ||
}, | ||
"hooks": { | ||
"after:bump": "yarn build" | ||
}, | ||
"npm": false, | ||
"github": { | ||
"release": true | ||
"lavamoat": { | ||
"allowScripts": { | ||
"@lavamoat/preinstall-always-fail": false, | ||
"sharp": true | ||
} | ||
} | ||
} |
This file contains 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
Oops, something went wrong.