forked from 0xsequence/sequence.js
-
Notifications
You must be signed in to change notification settings - Fork 2
0xsequence/master #180
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
0xsequence/master #180
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6820e16
2.3.7 (#131)
Dargon789 0849f07
Update extras/docs/package.json
Dargon789 e6b0691
Update extras/web/package.json
Dargon789 472df86
Merge branch 'master' into 0xsequence/master
Dargon789 a1be7e9
0xsequence-1.9.19
Dargon789 26c1f79
Update packages/0xsequence/tests/browser/wallet-provider/dapp.test.ts
Dargon789 33d7b74
Update packages/auth/src/session.ts
Dargon789 3cae6f4
Update tests.yml (#187)
Dargon789 d63fb64
Potential fix for code scanning alert no. 61: Cross-window communicat…
Dargon789 58bd45f
Merge branch 'master' into 0xsequence/master
Dargon789 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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
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,2 @@ | ||
| .eslintrc.js | ||
| packages/**/dist |
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,48 @@ | ||
| const { off } = require("process") | ||
|
|
||
| module.exports = { | ||
| parser: '@typescript-eslint/parser', | ||
| parserOptions: { | ||
| ecmaVersion: 2018, | ||
| sourceType: 'module' | ||
| }, | ||
|
|
||
| extends: [ | ||
| 'plugin:@typescript-eslint/recommended', | ||
| 'plugin:import/errors', | ||
| 'plugin:import/warnings', | ||
| 'plugin:import/typescript', | ||
| 'prettier' | ||
| ], | ||
|
|
||
| rules: { | ||
| '@typescript-eslint/no-unused-vars': 'off', | ||
| '@typescript-eslint/no-explicit-any': 'off', | ||
| '@typescript-eslint/no-non-null-assertion': 'off', | ||
| '@typescript-eslint/explicit-module-boundary-types': 'off', | ||
| '@typescript-eslint/ban-types': 'off', | ||
| '@typescript-eslint/ban-ts-comment': 'off', | ||
| '@typescript-eslint/no-empty-function': 'off', | ||
| '@typescript-eslint/no-inferrable-types': 'off', | ||
| '@typescript-eslint/no-var-requires': 'off', | ||
| '@typescript-eslint/no-this-alias': 'off', | ||
|
|
||
| 'import/no-unresolved': 'off', | ||
| 'import/no-default-export': 2, | ||
| 'import/no-named-as-default-member': 'off', | ||
| 'import/export': 'off' | ||
|
|
||
|
|
||
| // 'import/order': [ | ||
| // 'warn', | ||
| // { | ||
| // 'groups': ['builtin', 'external', 'parent', 'sibling', 'index'], | ||
| // 'alphabetize': { | ||
| // 'order': 'asc', /* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */ | ||
| // 'caseInsensitive': true /* ignore case. Options: [true, false] */ | ||
| // } | ||
| // }, | ||
| // ] | ||
|
|
||
| } | ||
| } | ||
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 |
|---|---|---|
| @@ -1,41 +1,26 @@ | ||
| # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
| # See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
|
||
| # Dependencies | ||
| node_modules | ||
| .pnp | ||
| .pnp.js | ||
| node_modules/ | ||
| cache/ | ||
| build/ | ||
| dist/ | ||
|
|
||
| # Local env files | ||
| .env | ||
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local | ||
| test_chain/ | ||
|
|
||
| # Testing | ||
| coverage | ||
|
|
||
| # Turbo | ||
| .turbo | ||
|
|
||
| # Vercel | ||
| .vercel | ||
|
|
||
| # Build Outputs | ||
| .next/ | ||
| out/ | ||
| build | ||
| dist | ||
| *.js.map | ||
| PROD.env | ||
|
|
||
| .DS_Store | ||
| .vscode | ||
| .idea | ||
| *.iml | ||
| .cache | ||
| package-lock.json | ||
| coverage | ||
| .rts2_cache* | ||
|
|
||
| # Debug | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| lerna-debug.log* | ||
|
|
||
| # Misc | ||
| .DS_Store | ||
| *.pem | ||
|
|
||
| # Husky | ||
| .husky/ | ||
| .nyc_output/ |
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,26 @@ | ||
| { | ||
| "include": [ | ||
| "packages/**/*.ts" | ||
| ], | ||
| "exclude": [ | ||
| "**/*.d.ts", | ||
| "**/dist/*", | ||
| "**/tests/*", | ||
| "**/0xsequence/*" | ||
| ], | ||
| "extension": [ | ||
| ".ts" | ||
| ], | ||
| "require": [ | ||
| "ts-node/register", | ||
| "babel-core/register" | ||
| ], | ||
| "reporter": [ | ||
| "html", | ||
| "text", | ||
| "lcov" | ||
| ], | ||
| "sourceMap": true, | ||
| "instrument": true, | ||
| "all": 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 |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| { | ||
| "printWidth": 120, | ||
| "tabWidth": 2, | ||
| "useTabs": false, | ||
| "semi": false, | ||
| "singleQuote": true | ||
| "singleQuote": true, | ||
| "trailingComma": "none", | ||
| "arrowParens": "avoid", | ||
| "printWidth": 130 | ||
| } |
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 |
|---|---|---|
| @@ -1,39 +1,118 @@ | ||
| ## sequence.js v3 core libraries and SDK | ||
| 0xsequence | ||
| ========== | ||
|
|
||
| **NOTE: please see [v2](https://github.com/0xsequence/sequence.js/tree/v2) branch for sequence.js 2.x.x** | ||
| [Sequence](https://sequence.xyz): a modular web3 stack and smart wallet for Ethereum chains | ||
|
|
||
| --- | ||
| ## Usage | ||
|
|
||
| `npm install 0xsequence ethers` | ||
|
|
||
| or | ||
|
|
||
| `pnpm install 0xsequence ethers` | ||
|
|
||
| or | ||
|
|
||
| `yarn add 0xsequence ethers` | ||
|
|
||
| Sequence v3 core libraries and [wallet-contracts-v3](https://github.com/0xsequence/wallet-contracts-v3) SDK. | ||
|
|
||
| ## Packages | ||
|
|
||
| - `@0xsequence/wallet-primitives`: stateless low-level utilities specifically for interacting directly with sequence wallet's smart contracts | ||
| - `@0xsequence/wallet-core`: higher level utilities for creating and using sequence wallets | ||
| - `@0xsequence/wallet-wdk`: all-in-one wallet development kit for building a sequence wallet product | ||
| - [0xsequence](./packages/0xsequence) | ||
| - [@0xsequence/abi](./packages/abi) | ||
| - [@0xsequence/api](./packages/api) | ||
| - [@0xsequence/auth](./packages/auth) | ||
| - [@0xsequence/core](./packages/core) | ||
| - [@0xsequence/deployer](./packages/deployer) | ||
| - [@0xsequence/guard](./packages/guard) | ||
| - [@0xsequence/multicall](./packages/multicall) | ||
| - [@0xsequence/network](./packages/network) | ||
| - [@0xsequence/provider](./packages/provider) | ||
| - [@0xsequence/relayer](./packages/relayer) | ||
| - [@0xsequence/replacer](./packages/replacer) | ||
| - [@0xsequence/sessions](./packages/sessions) | ||
| - [@0xsequence/signhub](./packages/signhub) | ||
| - [@0xsequence/utils](./packages/utils) | ||
| - [@0xsequence/wallet](./packages/wallet) | ||
|
|
||
|
|
||
| ## Development Environment | ||
|
|
||
| Below are notes and instructions on how to get your development environment up and running, | ||
| and enjoyable. | ||
|
|
||
| 1. **Install dependencies** | ||
| Run, `pnpm install` | ||
|
|
||
| 2. **Workflow** -- we use the amazing [preconstruct](https://github.com/preconstruct/preconstruct) | ||
| package to handle our monorepo build system. | ||
|
|
||
| 3. **Local dev** -- when you're working on the code in this repository, you can safely run | ||
| `pnpm dev` at the root-level, which will link all packages/** together, so that when a | ||
| local dependency from packages/** is used by another, it will automatically be linked | ||
| without having to run a build command. Just remember: run `pnpm dev` anytime you developing | ||
| in this repo. Note, that when you run `pnpm build` it will clear the dev environment, so | ||
| you will need to run `pnpm dev` again after a build. However, `pnpm build` should only be | ||
| used when making a release. | ||
|
|
||
| ## Development | ||
| 4. **Testing** -- to test the system, you can run `pnpm test` at the top-level or at an individual | ||
| package-level. | ||
|
|
||
| ### Getting Started | ||
| 5. **Type-checking** -- to typecheck the system you can run `pnpm typecheck` at any level. | ||
|
|
||
| 1. Install dependencies: | ||
| `pnpm install` | ||
| 6. **Building** -- to _compile_ the project to dist files for a release, run `pnpm build` at | ||
| the root-level. Note building packages repeatedly during development is unnecessary with | ||
| `preconstruct`. During local development run `pnpm dev` and when building to make a release, | ||
| run `pnpm build`. | ||
|
|
||
| 2. Build all packages: | ||
| `pnpm build` | ||
| 7. **Versioning** -- this repository uses the handy [changesets](https://github.com/atlassian/changesets) | ||
| package for package versioning across the monorepo, as well as changelogs. See _Releasing_ section below. | ||
|
|
||
| ### Development Workflow | ||
|
|
||
| - Run development mode across all packages: | ||
| `pnpm dev` | ||
| ## Releasing to NPM | ||
|
|
||
| - Run tests: | ||
| `pnpm test` | ||
| 0xsequence uses changesets to do versioning. This makes releasing really easy and changelogs are automatically generated. | ||
|
|
||
| > **Note:** Tests require [anvil](https://github.com/foundry-rs/foundry/tree/master/anvil) and [forge](https://github.com/foundry-rs/foundry) to be installed. You can run a local anvil instance using `pnpm run test:anvil`. | ||
| ### How to do a release | ||
|
|
||
| - Linting and formatting is enforced via git hooks | ||
| 1. Run `pnpm` to make sure everything is up to date | ||
| 2. Code.. do your magic | ||
| 3. Run `pnpm changeset` to generate a new .changeset/ entry explaining the code changes | ||
| 4. Version bump all packages regardless of them having changes or not | ||
| 5. Run `pnpm i` to update the pnpm-lock.yaml. | ||
| 6. Commit and submit your changes as a PR for review | ||
| 7. Once merged and you're ready to make a release, continue to the next step. If you're not | ||
| ready to make a release, then go back to step 2. | ||
| 8. Run `pnpm build && pnpm test` to double check all tests pass | ||
| 9. Run `pnpm version-packages` to bump versions of the packages | ||
| 10. Run `pnpm install` so we update our pnpm-lock.yaml file with our newly created version | ||
| 11. Commit files after versioning. This is the commit that will be published and tagged: `git push --no-verify` | ||
| 12. Run `pnpm release`. If the 2FA code timesout while publishing, run the command again | ||
| with a new code, only the packages that were not published will be published. | ||
| 13. Finally, push your git tags, via: `git push --tags --no-verify` | ||
|
|
||
| ## License | ||
|
|
||
| ## How to do a snapshot release | ||
|
|
||
| Snapshot releases are versioned as 0.0.0-YYYYmmddHHMMSS and are intended for testing builds only. | ||
|
|
||
| 1. `pnpm snapshot` (select all packages even if unchanged, the message is not important) | ||
| 2. Do not commit any changes to package.json's or CHANGELOG.md's that happened during 1. | ||
|
|
||
| ## NOTES | ||
|
|
||
| 1. Browser tests can be run with `pnpm test` or, separately `pnpm test:server` and `pnpm test:run` | ||
| 2. To run a specific test, run `pnpm test:only <test-file-basename>`, ie. `pnpm test:only window-transport` | ||
|
|
||
|
|
||
| ## TIPS | ||
|
|
||
| * If you're using node v18+ and you hit the error `Error: error:0308010C:digital envelope routines::unsupported`, | ||
| make sure to first set, `export NODE_OPTIONS=--openssl-legacy-provider` | ||
|
|
||
|
|
||
| ## LICENSE | ||
|
|
||
| Apache-2.0 | ||
|
|
||
| Copyright (c) 2017-present Horizon Blockchain Games Inc. / https://horizon.io |
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,19 @@ | ||
| module.exports = { | ||
| presets: [ | ||
| ['@babel/preset-env', { | ||
| targets: { | ||
| esmodules: true | ||
| }, | ||
| bugfixes: true, | ||
| loose: true, | ||
| exclude: [ | ||
| '@babel/plugin-transform-async-to-generator', | ||
| '@babel/plugin-transform-regenerator' | ||
| ] | ||
| }], | ||
| '@babel/preset-typescript' | ||
| ], | ||
| plugins: [ | ||
| ['@babel/plugin-transform-class-properties', { loose: true }] | ||
| ] | ||
| } |
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.