Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .changeset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ with multi-package repos, or single-package repos to help you version and publis
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
[our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md)
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.eslintrc.js
packages/**/dist
48 changes: 48 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const { off } = require("process")
Comment thread
Dargon789 marked this conversation as resolved.

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] */
// }
// },
// ]

}
}
16 changes: 8 additions & 8 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@ runs:
using: 'composite'

steps:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup PNPM
uses: pnpm/action-setup@v3
uses: pnpm/action-setup@v2
with:
version: 10
version: 8
run_install: false

- name: Get pnpm store directory
Expand All @@ -22,7 +17,7 @@ runs:
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Setup pnpm cache
uses: actions/cache@v4
uses: actions/cache@v3
with:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
Expand All @@ -33,6 +28,11 @@ runs:
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
Expand Down
51 changes: 18 additions & 33 deletions .gitignore
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/
26 changes: 26 additions & 0 deletions .nycrc
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
}
8 changes: 6 additions & 2 deletions .prettierrc
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
}
17 changes: 17 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
Copyright (c) 2017-present Horizon Blockchain Games Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


------------------------------------------------------------------------


Apache License
Version 2.0, January 2004
Expand Down
121 changes: 100 additions & 21 deletions README.md
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
19 changes: 19 additions & 0 deletions babel.config.js
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 }]
]
}
Loading
Loading