diff --git a/.circleci/publish.yml b/.circleci/publish.yml new file mode 100644 index 00000000..6d554d7f --- /dev/null +++ b/.circleci/publish.yml @@ -0,0 +1,94 @@ +version: 2.1 + +orbs: + slack: circleci/slack@3.4.2 + +jobs: + install: + working_directory: ~/etherspot-prime-sdk + docker: + - image: cimg/node:18.16.0 + auth: + username: $DOCKERHUB_USER + password: $DOCKERHUB_PASSWORD + steps: + - checkout + - run: + name: Authenticate with registry + command: echo "//registry.npmjs.org/:_authToken=$ETHERSPOT_NPM_TOKEN" > ~/etherspot-prime-sdk/.npmrc + - restore_cache: + key: dependency-cache-{{ checksum "package.json" }} + - run: + name: Install dependencies + command: npm install + - save_cache: + key: dependency-cache-{{ checksum "package.json" }} + paths: + - ./node_modules + - slack/status: + fail_only: true + failure_message: "Triggered by: *${CIRCLE_USERNAME}* \n\n Ooops! The *$CIRCLE_JOB* job has failed! :circleci-fail:" + webhook: "${SLACK_WEBHOOK_URL}" + + publish: + working_directory: ~/etherspot-prime-sdk + docker: + - image: cimg/node:18.16.0 + auth: + username: $DOCKERHUB_USER + password: $DOCKERHUB_PASSWORD + steps: + - checkout + - restore_cache: + key: dependency-cache-{{ checksum "package.json" }} + - run: + name: Authenticate with registry + command: echo "//registry.npmjs.org/:_authToken=$ETHERSPOT_NPM_TOKEN" > ~/etherspot-prime-sdk/.npmrc + - run: + name: Build Etherpot Prime SDK + command: npm run build + - run: + name: Publish package to npm + command: npm publish + - run: + name: Announce Publish + command: | + chmod +x .circleci/announcePublish.sh + .circleci/announcePublish.sh "Etherspot Prime SDK" "$(node -e "console.log(require('./package.json').version)")" + - slack/status: + fail_only: true + failure_message: "Triggered by: *${CIRCLE_USERNAME}* \n\n Ooops! The *$CIRCLE_JOB* job has failed! :circleci-fail:" + only_for_branches: master + webhook: "${SLACK_WEBHOOK_URL}" + publish-github-release: + docker: + - image: ardd97/ghr + steps: + - checkout + - run: + name: "Publish Release on GitHub" + command: | + PACKAGE_VERSION="$(jq .version package.json -r)" + echo $PACKAGE_VERSION + ghr -t "${GITHUB_TOKEN}" -u "${CIRCLE_PROJECT_USERNAME}" -r "${CIRCLE_PROJECT_REPONAME}" -c "${CIRCLE_SHA1}" "$PACKAGE_VERSION" + +workflows: + version: 2.1 + install_and_publish: + jobs: + - install: + context: general-vars + - publish: + context: general-vars + requires: + - install + filters: + branches: + only: + - master + - publish-github-release: + context: general-vars + filters: + branches: + only: + - master diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..5f55f30b --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,26 @@ + + +## Description + +- + +## Motivation and Context + + +- + +## How Has This Been Tested? + + + +- +- +- + +## Screenshots (if appropriate): + +## Types of changes + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) diff --git a/.github/workflows/check-package-version.yml b/.github/workflows/check-package-version.yml new file mode 100644 index 00000000..084654f6 --- /dev/null +++ b/.github/workflows/check-package-version.yml @@ -0,0 +1,24 @@ +name: Check if package version is updated + +on: + pull_request: + branches: + - master +jobs: + start: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Check if version has been updated + id: check + uses: EndBug/version-check@v2.1.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + file-name: ./package.json + - name: Log when changed + if: steps.check.outputs.changed == 'true' + run: 'echo "Yayy!! Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"' + - name: Log when unchanged + if: steps.check.outputs.changed == 'false' + run: echo "No version change :/ Please update version in package.json!" && exit 1 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..c9ce7408 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## [1.0.0] - 2023-06-01 + +### New +- Initial version published 🚀 diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..fa397aa1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Etherspot + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 3ced563c..80817d55 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# Etherspot Lite SDK - +# Etherspot Prime SDK +## Account Abstraction (ERC-4337) SDK ![MIT licensed][license-image] - + diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..7cbeb778 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +# Reporting security issues + +If you think you have found a security vulnerability, please send an email to [security@etherspot.io](mailto:security@etherspot.io). This address can be used for all of Etherspot's open source (including but not limited to SDK, Prime SDK, BUIDler, React Etherspot Kit). + +Etherspot will send you a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance. + +**Important:** We ask you to not disclose the vulnerability before it have been fixed and announced, unless you received a response from the Etherspot security team that you can do so.