From c21d7c7e33b70389d1408fc44a4ad792a5fabe0f Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev Date: Wed, 13 Jan 2021 16:49:22 +0400 Subject: [PATCH 1/7] Feature: Remove travis, add github action test workflow (#82) * Remove travis, add github action test workflow * install lerna on the ci * Add yarn global bin path * Add comment --- .github/workflows/test.yml | 20 ++++++++++++++++++ .travis.yml | 43 -------------------------------------- 2 files changed, 20 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..5191f02a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,20 @@ +name: Test +on: [push, pull_request] +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [12.x] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: | + yarn global add lerna + # approach taken from https://github.com/actions/setup-node/issues/85 + echo "$(yarn global bin)" >> $GITHUB_PATH + - run: lerna bootstrap + - run: lerna run test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c86958de..00000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -if: (branch = master) OR (branch = development) OR (tag IS present) -language: node_js -node_js: '12' -before_install: - - yarn global add lerna - - lerna bootstrap - # Needed to deploy pull request and releases - - pip install awscli --upgrade --user -cache: - yarn: true -script: | - lerna run test - - if [ -n "$TRAVIS_TAG" ] - then - # build project for NPM publishing -> content goes to /dist - echo "Build NPM package" - yarn build - cd dist/ - # https://classic.yarnpkg.com/en/docs/cli/pack/ - yarn pack --filename safe-apps-sdk-$TRAVIS_TAG.tgz - cd .. - else - echo "No tagged commit, won't build NPM lib" - fi -deploy: - # Prepare production env deployment, no development deploy since the app - # is a npm library - - provider: s3 - bucket: $STAGING_BUCKET_NAME - access_key_id: $AWS_ACCESS_KEY_ID - secret_access_key: $AWS_SECRET_ACCESS_KEY - skip_cleanup: true - local_dir: dist - upload-dir: releases/$TRAVIS_TAG - region: eu-central-1 - on: - tags: true - - - provider: script - script: bash travis/prepare_production_deployment.sh - on: - tags: true From 5285872bfa68728fda9eae407193ecfb87bcd34b Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev Date: Mon, 1 Feb 2021 13:09:23 +0400 Subject: [PATCH 2/7] Feature: Accept "latest" as an argument for getBlockByNumber (#88) * wip * accept 'latest' as an arg --- package.json | 12 +- packages/safe-apps-react-sdk/package.json | 8 +- packages/safe-apps-sdk/package.json | 8 +- packages/safe-apps-sdk/src/eth/eth.test.ts | 15 ++ packages/safe-apps-sdk/src/eth/index.ts | 14 +- yarn.lock | 289 ++++++++++++--------- 6 files changed, 206 insertions(+), 140 deletions(-) diff --git a/package.json b/package.json index 3db87a4e..117b04e2 100644 --- a/package.json +++ b/package.json @@ -19,12 +19,12 @@ "devDependencies": { "@types/react": "^17.0.0", "@types/react-dom": "^17.0.0", - "@typescript-eslint/eslint-plugin": "^4.10.0", - "@typescript-eslint/parser": "^4.10.0", - "eslint": "7.15.0", - "eslint-config-prettier": "^7.0.0", - "eslint-plugin-prettier": "^3.2.0", - "eslint-plugin-react": "^7.21.5", + "@typescript-eslint/eslint-plugin": "^4.14.1", + "@typescript-eslint/parser": "^4.14.1", + "eslint": "7.18.0", + "eslint-config-prettier": "^7.2.0", + "eslint-plugin-prettier": "^3.3.1", + "eslint-plugin-react": "^7.22.0", "eslint-plugin-react-hooks": "^4.2.0", "jest": "^26.6.3", "ts-jest": "^26.4.4", diff --git a/packages/safe-apps-react-sdk/package.json b/packages/safe-apps-react-sdk/package.json index 82a6465a..21bb9d9b 100644 --- a/packages/safe-apps-react-sdk/package.json +++ b/packages/safe-apps-react-sdk/package.json @@ -11,8 +11,8 @@ ], "author": "Gnosis (https://gnosis.pm)", "dependencies": { - "@gnosis.pm/safe-apps-sdk": "1.0.3-beta.0", - "@types/jest": "^26.0.19" + "@gnosis.pm/safe-apps-sdk": "1.0.3", + "@types/jest": "^26.0.20" }, "peerDependencies": { "@types/node": "^12.0.0", @@ -21,12 +21,12 @@ }, "devDependencies": { "babel-eslint": "^10.0.0", - "eslint": "^7.5.0", + "eslint": "^7.18.0", "eslint-config-react-app": "^6.0.0", "eslint-plugin-flowtype": "^5.2.0", "eslint-plugin-import": "^2.22.0", "eslint-plugin-jsx-a11y": "^6.3.1", - "eslint-plugin-react": "^7.20.3", + "eslint-plugin-react": "^7.22.0", "eslint-plugin-react-hooks": "^4.0.8", "rimraf": "^3.0.2" }, diff --git a/packages/safe-apps-sdk/package.json b/packages/safe-apps-sdk/package.json index 30ca98fa..3f647d6e 100644 --- a/packages/safe-apps-sdk/package.json +++ b/packages/safe-apps-sdk/package.json @@ -28,13 +28,13 @@ "web3-core": "^1.3.0" }, "devDependencies": { - "@types/jest": "^26.0.15", - "@types/node": "^14.14.8", + "@types/jest": "^26.0.20", + "@types/node": "^14.14.22", "@types/semver": "^7.3.4", - "husky": "^4.3.0", + "husky": "^4.3.8", "jest": "^26.6.3", "lint-staged": "^10.5.1", - "prettier": "^2.1.2", + "prettier": "^2.2.1", "rimraf": "^3.0.2" }, "peerDependencies": { diff --git a/packages/safe-apps-sdk/src/eth/eth.test.ts b/packages/safe-apps-sdk/src/eth/eth.test.ts index ae3f3a06..4a419516 100644 --- a/packages/safe-apps-sdk/src/eth/eth.test.ts +++ b/packages/safe-apps-sdk/src/eth/eth.test.ts @@ -249,6 +249,21 @@ describe('Safe Apps SDK Read RPC Requests', () => { '*', ); }); + + it('Should accept "latest" as an argument for block number', () => { + sdkInstance.eth.getBlockByNumber(['latest', true]); + + expect(spy).toHaveBeenCalledWith( + expect.objectContaining({ + method: METHODS.rpcCall, + params: { + call: 'eth_getBlockByNumber', + params: ['latest', true], + }, + }), + '*', + ); + }); }); describe('getTransactionByHash', () => { diff --git a/packages/safe-apps-sdk/src/eth/index.ts b/packages/safe-apps-sdk/src/eth/index.ts index 3e697879..b5e70ad4 100644 --- a/packages/safe-apps-sdk/src/eth/index.ts +++ b/packages/safe-apps-sdk/src/eth/index.ts @@ -14,10 +14,13 @@ import { METHODS } from '../communication/methods'; // eslint-disable-next-line @typescript-eslint/no-explicit-any type Formatter = (arg: any) => any; +type BlockNumberArg = number | 'earliest' | 'latest' | 'pending'; + const inputFormatters: Record = { defaultBlockParam: (arg = 'latest') => arg, returnFullTxObjectParam: (arg = false): boolean => arg, - numberToHex: (arg: number): string => `0x${arg.toString(16)}`, + blockNumberToHex: (arg: BlockNumberArg): string => + Number.isInteger(arg) ? `0x${arg.toString(16)}` : (arg as string), }; type BuildRequestArgs = { @@ -53,7 +56,7 @@ class Eth { }); this.getStorageAt = this.buildRequest<[string, number, string?], string>({ call: RPC_CALLS.eth_getStorageAt, - formatters: [null, inputFormatters.numberToHex, inputFormatters.defaultBlockParam], + formatters: [null, inputFormatters.blockNumberToHex, inputFormatters.defaultBlockParam], }); this.getPastLogs = this.buildRequest<[PastLogsOptions], Log[]>({ call: RPC_CALLS.eth_getLogs, @@ -62,9 +65,12 @@ class Eth { call: RPC_CALLS.eth_getBlockByHash, formatters: [null, inputFormatters.returnFullTxObjectParam], }); - this.getBlockByNumber = this.buildRequest<[number, boolean?], BlockTransactionString | BlockTransactionObject>({ + this.getBlockByNumber = this.buildRequest< + [BlockNumberArg, boolean?], + BlockTransactionString | BlockTransactionObject + >({ call: RPC_CALLS.eth_getBlockByNumber, - formatters: [inputFormatters.numberToHex, inputFormatters.returnFullTxObjectParam], + formatters: [inputFormatters.blockNumberToHex, inputFormatters.returnFullTxObjectParam], }); this.getTransactionByHash = this.buildRequest<[string], Web3TransactionObject>({ call: RPC_CALLS.eth_getTransactionByHash, diff --git a/yarn.lock b/yarn.lock index 7a8da8f4..8d5ab36e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -293,10 +293,10 @@ exec-sh "^0.3.2" minimist "^1.2.0" -"@eslint/eslintrc@^0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.2.2.tgz#d01fc791e2fc33e88a29d6f3dc7e93d0cd784b76" - integrity sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ== +"@eslint/eslintrc@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.3.0.tgz#d736d6963d7003b6514e6324bec9c602ac340318" + integrity sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg== dependencies: ajv "^6.12.4" debug "^4.1.1" @@ -305,7 +305,7 @@ ignore "^4.0.6" import-fresh "^3.2.1" js-yaml "^3.13.1" - lodash "^4.17.19" + lodash "^4.17.20" minimatch "^3.0.4" strip-json-comments "^3.1.1" @@ -470,14 +470,6 @@ unique-filename "^1.1.1" which "^1.3.1" -"@gnosis.pm/safe-apps-sdk@1.0.3-beta.0": - version "1.0.3-beta.0" - resolved "https://registry.yarnpkg.com/@gnosis.pm/safe-apps-sdk/-/safe-apps-sdk-1.0.3-beta.0.tgz#637100b47f31da284f9d83a043ccc4ed6be44348" - integrity sha512-nM2Yl5tU0f3w+eEgLqHcrXCyN/CSme1FYBJesZHTEULlzOA2DMLq1mLvUDXGRVPJD74MaVoc5GiDC9mLNE3ZCw== - dependencies: - semver "^7.3.2" - web3-core "^1.3.0" - "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -1587,7 +1579,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@26.x", "@types/jest@^26.0.15": +"@types/jest@26.x": version "26.0.18" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.18.tgz#3c5f9228e9ac15bd42f903f1acf2ad6ea5ed73d9" integrity sha512-scDPs+mELZgsFetTgBSsIxKGrlitn9t/d2ecP+S1QSIGD+31fkMBEftLfOAX5k3tU06/0PjreJIQ+gWEbbHqpw== @@ -1595,10 +1587,10 @@ jest-diff "^26.0.0" pretty-format "^26.0.0" -"@types/jest@^26.0.19": - version "26.0.19" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.19.tgz#e6fa1e3def5842ec85045bd5210e9bb8289de790" - integrity sha512-jqHoirTG61fee6v6rwbnEuKhpSKih0tuhqeFbCmMmErhtu3BYlOZaXWjffgOstMM4S/3iQD31lI5bGLTrs97yQ== +"@types/jest@^26.0.20": + version "26.0.20" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.20.tgz#cd2f2702ecf69e86b586e1f5223a60e454056307" + integrity sha512-9zi2Y+5USJRxd0FsahERhBwlcvFh6D2GLQnY2FH2BzK8J9s9omvNHIbvABwIluXa0fD8XVKMLTO0aOEuUfACAA== dependencies: jest-diff "^26.0.0" pretty-format "^26.0.0" @@ -1623,7 +1615,7 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.1.tgz#283f669ff76d7b8260df8ab7a4262cc83d988256" integrity sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg== -"@types/node@*", "@types/node@>= 8", "@types/node@^14.14.8": +"@types/node@*", "@types/node@>= 8": version "14.14.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.12.tgz#0b1d86f8c40141091285dea02e4940df73bba43f" integrity sha512-ASH8OPHMNlkdjrEdmoILmzFfsJICvhBsFfAum4aKZ/9U4B6M6tTmTPh+f3ttWdD74CEGV5XvXWkbyfSdXaTd7g== @@ -1633,6 +1625,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.8.tgz#efd6d1a90525519fc608c9db16c8a78f7693a978" integrity sha512-D4k2kNi0URNBxIRCb1khTnkWNHv8KSL1owPmS/K5e5t8B2GzMReY7AsJIY1BnP5KdlgC4rj9jk2IkDMasIE7xg== +"@types/node@^14.14.22": + version "14.14.22" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.22.tgz#0d29f382472c4ccf3bd96ff0ce47daf5b7b84b18" + integrity sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw== + "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" @@ -1690,61 +1687,62 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^4.10.0": - version "4.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.10.0.tgz#19ed3baf4bc4232c5a7fcd32eaca75c3a5baf9f3" - integrity sha512-h6/V46o6aXpKRlarP1AiJEXuCJ7cMQdlpfMDrcllIgX3dFkLwEBTXAoNP98ZoOmqd1xvymMVRAI4e7yVvlzWEg== +"@typescript-eslint/eslint-plugin@^4.14.1": + version "4.14.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.14.1.tgz#22dd301ce228aaab3416b14ead10b1db3e7d3180" + integrity sha512-5JriGbYhtqMS1kRcZTQxndz1lKMwwEXKbwZbkUZNnp6MJX0+OVXnG0kOlBZP4LUAxEyzu3cs+EXd/97MJXsGfw== dependencies: - "@typescript-eslint/experimental-utils" "4.10.0" - "@typescript-eslint/scope-manager" "4.10.0" + "@typescript-eslint/experimental-utils" "4.14.1" + "@typescript-eslint/scope-manager" "4.14.1" debug "^4.1.1" functional-red-black-tree "^1.0.1" + lodash "^4.17.15" regexpp "^3.0.0" semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@4.10.0": - version "4.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.10.0.tgz#dbf5d0f89802d5feaf7d11e5b32df29bbc2f3a0e" - integrity sha512-opX+7ai1sdWBOIoBgpVJrH5e89ra1KoLrJTz0UtWAa4IekkKmqDosk5r6xqRaNJfCXEfteW4HXQAwMdx+jjEmw== +"@typescript-eslint/experimental-utils@4.14.1": + version "4.14.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.14.1.tgz#a5c945cb24dabb96747180e1cfc8487f8066f471" + integrity sha512-2CuHWOJwvpw0LofbyG5gvYjEyoJeSvVH2PnfUQSn0KQr4v8Dql2pr43ohmx4fdPQ/eVoTSFjTi/bsGEXl/zUUQ== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/scope-manager" "4.10.0" - "@typescript-eslint/types" "4.10.0" - "@typescript-eslint/typescript-estree" "4.10.0" + "@typescript-eslint/scope-manager" "4.14.1" + "@typescript-eslint/types" "4.14.1" + "@typescript-eslint/typescript-estree" "4.14.1" eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@^4.10.0": - version "4.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.10.0.tgz#1a622b0847b765b2d8f0ede6f0cdd85f03d76031" - integrity sha512-amBvUUGBMadzCW6c/qaZmfr3t9PyevcSWw7hY2FuevdZVp5QPw/K76VSQ5Sw3BxlgYCHZcK6DjIhSZK0PQNsQg== +"@typescript-eslint/parser@^4.14.1": + version "4.14.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.14.1.tgz#3bd6c24710cd557d8446625284bcc9c6d52817c6" + integrity sha512-mL3+gU18g9JPsHZuKMZ8Z0Ss9YP1S5xYZ7n68Z98GnPq02pYNQuRXL85b9GYhl6jpdvUc45Km7hAl71vybjUmw== dependencies: - "@typescript-eslint/scope-manager" "4.10.0" - "@typescript-eslint/types" "4.10.0" - "@typescript-eslint/typescript-estree" "4.10.0" + "@typescript-eslint/scope-manager" "4.14.1" + "@typescript-eslint/types" "4.14.1" + "@typescript-eslint/typescript-estree" "4.14.1" debug "^4.1.1" -"@typescript-eslint/scope-manager@4.10.0": - version "4.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.10.0.tgz#dbd7e1fc63d7363e3aaff742a6f2b8afdbac9d27" - integrity sha512-WAPVw35P+fcnOa8DEic0tQUhoJJsgt+g6DEcz257G7vHFMwmag58EfowdVbiNcdfcV27EFR0tUBVXkDoIvfisQ== +"@typescript-eslint/scope-manager@4.14.1": + version "4.14.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.14.1.tgz#8444534254c6f370e9aa974f035ced7fe713ce02" + integrity sha512-F4bjJcSqXqHnC9JGUlnqSa3fC2YH5zTtmACS1Hk+WX/nFB0guuynVK5ev35D4XZbdKjulXBAQMyRr216kmxghw== dependencies: - "@typescript-eslint/types" "4.10.0" - "@typescript-eslint/visitor-keys" "4.10.0" + "@typescript-eslint/types" "4.14.1" + "@typescript-eslint/visitor-keys" "4.14.1" -"@typescript-eslint/types@4.10.0": - version "4.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.10.0.tgz#12f983750ebad867f0c806e705c1953cd6415789" - integrity sha512-+dt5w1+Lqyd7wIPMa4XhJxUuE8+YF+vxQ6zxHyhLGHJjHiunPf0wSV8LtQwkpmAsRi1lEOoOIR30FG5S2HS33g== +"@typescript-eslint/types@4.14.1": + version "4.14.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.14.1.tgz#b3d2eb91dafd0fd8b3fce7c61512ac66bd0364aa" + integrity sha512-SkhzHdI/AllAgQSxXM89XwS1Tkic7csPdndUuTKabEwRcEfR8uQ/iPA3Dgio1rqsV3jtqZhY0QQni8rLswJM2w== -"@typescript-eslint/typescript-estree@4.10.0": - version "4.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.10.0.tgz#1e62e45fd57866afd42daf5e9fb6bd4e8dbcfa75" - integrity sha512-mGK0YRp9TOk6ZqZ98F++bW6X5kMTzCRROJkGXH62d2azhghmq+1LNLylkGe6uGUOQzD452NOAEth5VAF6PDo5g== +"@typescript-eslint/typescript-estree@4.14.1": + version "4.14.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.14.1.tgz#20d3b8c8e3cdc8f764bdd5e5b0606dd83da6075b" + integrity sha512-M8+7MbzKC1PvJIA8kR2sSBnex8bsR5auatLCnVlNTJczmJgqRn8M+sAlQfkEq7M4IY3WmaNJ+LJjPVRrREVSHQ== dependencies: - "@typescript-eslint/types" "4.10.0" - "@typescript-eslint/visitor-keys" "4.10.0" + "@typescript-eslint/types" "4.14.1" + "@typescript-eslint/visitor-keys" "4.14.1" debug "^4.1.1" globby "^11.0.1" is-glob "^4.0.1" @@ -1752,12 +1750,12 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/visitor-keys@4.10.0": - version "4.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.10.0.tgz#9478822329a9bc8ebcc80623d7f79a01da5ee451" - integrity sha512-hPyz5qmDMuZWFtHZkjcCpkAKHX8vdu1G3YsCLEd25ryZgnJfj6FQuJ5/O7R+dB1ueszilJmAFMtlU4CA6se3Jg== +"@typescript-eslint/visitor-keys@4.14.1": + version "4.14.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.14.1.tgz#e93c2ff27f47ee477a929b970ca89d60a117da91" + integrity sha512-TAblbDXOI7bd0C/9PE1G+AFo7R5uc+ty1ArDoxmrC1ah61Hn6shURKy7gLdRb1qKJmjHkqu5Oq+e4Kt0jwf1IA== dependencies: - "@typescript-eslint/types" "4.10.0" + "@typescript-eslint/types" "4.14.1" eslint-visitor-keys "^2.0.0" "@zkochan/cmd-shim@^3.1.0": @@ -1839,7 +1837,7 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4: +ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1849,6 +1847,16 @@ ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.0.3.tgz#13ae747eff125cafb230ac504b2406cf371eece2" + integrity sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + ansi-colors@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -2068,11 +2076,6 @@ ast-types-flow@^0.0.7: resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0= -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" @@ -3363,10 +3366,10 @@ escodegen@^1.14.1: optionalDependencies: source-map "~0.6.1" -eslint-config-prettier@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-7.0.0.tgz#c1ae4106f74e6c0357f44adb076771d032ac0e97" - integrity sha512-8Y8lGLVPPZdaNA7JXqnvETVC7IiVRgAP6afQu9gOQRn90YY3otMNh+x7Vr2vMePQntF+5erdSUBqSzCmU/AxaQ== +eslint-config-prettier@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-7.2.0.tgz#f4a4bd2832e810e8cc7c1411ec85b3e85c0c53f9" + integrity sha512-rV4Qu0C3nfJKPOAhFujFxB7RMP+URFyQqqOZW9DMRD7ZDTFyjaIlETU3xzHELt++4ugC0+Jm084HQYkkJe+Ivg== eslint-config-react-app@^6.0.0: version "6.0.0" @@ -3435,10 +3438,10 @@ eslint-plugin-jsx-a11y@^6.3.1: jsx-ast-utils "^3.1.0" language-tags "^1.0.5" -eslint-plugin-prettier@^3.2.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.0.tgz#61e295349a65688ffac0b7808ef0a8244bdd8d40" - integrity sha512-tMTwO8iUWlSRZIwS9k7/E4vrTsfvsrcM5p1eftyuqWH25nKsz/o6/54I7jwQ/3zobISyC7wMy9ZsFwgTxOcOpQ== +eslint-plugin-prettier@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz#7079cfa2497078905011e6f82e8dd8453d1371b7" + integrity sha512-Rq3jkcFY8RYeQLgk2cCwuc0P7SEFwDravPhsJZOQ5N4YI4DSg50NyqJ/9gdZHzQlHf8MvafSesbNJCcP/FF6pQ== dependencies: prettier-linter-helpers "^1.0.0" @@ -3447,10 +3450,10 @@ eslint-plugin-react-hooks@^4.0.8, eslint-plugin-react-hooks@^4.2.0: resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556" integrity sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ== -eslint-plugin-react@^7.20.3, eslint-plugin-react@^7.21.5: - version "7.21.5" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.21.5.tgz#50b21a412b9574bfe05b21db176e8b7b3b15bff3" - integrity sha512-8MaEggC2et0wSF6bUeywF7qQ46ER81irOdWS4QWxnnlAEsnzeBevk1sWh7fhpCghPpXb+8Ks7hvaft6L/xsR6g== +eslint-plugin-react@^7.22.0: + version "7.22.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.22.0.tgz#3d1c542d1d3169c45421c1215d9470e341707269" + integrity sha512-p30tuX3VS+NWv9nQot9xIGAHBXR0+xJVaZriEsHoJrASGCJZDJ8JLNM0YqKqI0AKm6Uxaa1VUHoNEibxRCMQHA== dependencies: array-includes "^3.1.1" array.prototype.flatmap "^1.2.3" @@ -3489,13 +3492,13 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@7.15.0, eslint@^7.5.0: - version "7.15.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.15.0.tgz#eb155fb8ed0865fcf5d903f76be2e5b6cd7e0bc7" - integrity sha512-Vr64xFDT8w30wFll643e7cGrIkPEU50yIiI36OdSIDoSGguIeaLzBo0vpGvzo9RECUqq7htURfwEtKqwytkqzA== +eslint@7.18.0, eslint@^7.18.0: + version "7.18.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.18.0.tgz#7fdcd2f3715a41fe6295a16234bd69aed2c75e67" + integrity sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ== dependencies: "@babel/code-frame" "^7.0.0" - "@eslint/eslintrc" "^0.2.2" + "@eslint/eslintrc" "^0.3.0" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -3519,7 +3522,7 @@ eslint@7.15.0, eslint@^7.5.0: js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" - lodash "^4.17.19" + lodash "^4.17.20" minimatch "^3.0.4" natural-compare "^1.4.0" optionator "^0.9.1" @@ -3528,7 +3531,7 @@ eslint@7.15.0, eslint@^7.5.0: semver "^7.2.1" strip-ansi "^6.0.0" strip-json-comments "^3.1.0" - table "^5.2.3" + table "^6.0.4" text-table "^0.2.0" v8-compile-cache "^2.0.3" @@ -3863,12 +3866,20 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -find-versions@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-3.2.0.tgz#10297f98030a786829681690545ef659ed1d254e" - integrity sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww== +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== dependencies: - semver-regex "^2.0.0" + locate-path "^6.0.0" + path-exists "^4.0.0" + +find-versions@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-4.0.0.tgz#3c57e573bf97769b8cb8df16934b627915da4965" + integrity sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ== + dependencies: + semver-regex "^3.1.2" flat-cache@^3.0.4: version "3.0.4" @@ -4379,18 +4390,18 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -husky@^4.3.0: - version "4.3.5" - resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.5.tgz#ab8d2a0eb6b62fef2853ee3d442c927d89290902" - integrity sha512-E5S/1HMoDDaqsH8kDF5zeKEQbYqe3wL9zJDyqyYqc8I4vHBtAoxkDBGXox0lZ9RI+k5GyB728vZdmnM4bYap+g== +husky@^4.3.8: + version "4.3.8" + resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.8.tgz#31144060be963fd6850e5cc8f019a1dfe194296d" + integrity sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow== dependencies: chalk "^4.0.0" ci-info "^2.0.0" compare-versions "^3.6.0" cosmiconfig "^7.0.0" - find-versions "^3.2.0" + find-versions "^4.0.0" opencollective-postinstall "^2.0.2" - pkg-dir "^4.2.0" + pkg-dir "^5.0.0" please-upgrade-node "^3.2.0" slash "^3.0.0" which-pm-runs "^1.0.0" @@ -5370,6 +5381,11 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" @@ -5620,6 +5636,13 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + lodash._reinterpolate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" @@ -5675,7 +5698,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.2.1: +lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.2.1: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== @@ -6531,6 +6554,13 @@ p-limit@^2.0.0, p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" @@ -6552,6 +6582,13 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + p-map-series@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-map-series/-/p-map-series-1.0.0.tgz#bf98fe575705658a9e1351befb85ae4c1f07bdca" @@ -6819,6 +6856,13 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +pkg-dir@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" + integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== + dependencies: + find-up "^5.0.0" + please-upgrade-node@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" @@ -6848,10 +6892,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5" - integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg== +prettier@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" + integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== pretty-format@^26.0.0, pretty-format@^26.6.2: version "26.6.2" @@ -7267,6 +7311,11 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" @@ -7437,10 +7486,10 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= -semver-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-2.0.0.tgz#a93c2c5844539a770233379107b38c7b4ac9d338" - integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw== +semver-regex@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-3.1.2.tgz#34b4c0d361eef262e07199dbef316d0f2ab11807" + integrity sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA== "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1: version "5.7.1" @@ -7552,15 +7601,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== - dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" - slice-ansi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" @@ -8020,15 +8060,15 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -table@^5.2.3: - version "5.4.6" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" - integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== +table@^6.0.4: + version "6.0.7" + resolved "https://registry.yarnpkg.com/table/-/table-6.0.7.tgz#e45897ffbcc1bcf9e8a87bf420f2c9e5a7a52a34" + integrity sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g== dependencies: - ajv "^6.10.2" - lodash "^4.17.14" - slice-ansi "^2.1.0" - string-width "^3.0.0" + ajv "^7.0.2" + lodash "^4.17.20" + slice-ansi "^4.0.0" + string-width "^4.2.0" tar@^4.4.10, tar@^4.4.12, tar@^4.4.8: version "4.4.13" @@ -8987,3 +9027,8 @@ yargs@^15.4.1: which-module "^2.0.0" y18n "^4.0.0" yargs-parser "^18.1.2" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From bb179ebecc0fae4b6815f127aae53ba9b0888a1e Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev Date: Thu, 4 Feb 2021 12:09:22 +0400 Subject: [PATCH 3/7] Feature: Add ethers provider (#89) * ethers provider wip * fix checkError func * eslint fixes * add getBlockNumber handler * add readme * add npm install command to the readme * add npm install command to the readme 2 * general readme update --- README.md | 17 +- packages/safe-apps-ethers-provider/README.md | 54 +++++ .../safe-apps-ethers-provider/package.json | 29 +++ .../safe-apps-ethers-provider/src/index.ts | 1 + .../safe-apps-ethers-provider/src/provider.ts | 171 +++++++++++++ .../safe-apps-ethers-provider/src/utils.ts | 6 + .../safe-apps-ethers-provider/tsconfig.json | 7 + packages/safe-apps-react-sdk/README.md | 4 +- packages/safe-apps-react-sdk/package.json | 5 +- packages/safe-apps-sdk/package.json | 4 +- yarn.lock | 228 +++++++++++++++++- 11 files changed, 505 insertions(+), 21 deletions(-) create mode 100644 packages/safe-apps-ethers-provider/README.md create mode 100644 packages/safe-apps-ethers-provider/package.json create mode 100644 packages/safe-apps-ethers-provider/src/index.ts create mode 100644 packages/safe-apps-ethers-provider/src/provider.ts create mode 100644 packages/safe-apps-ethers-provider/src/utils.ts create mode 100644 packages/safe-apps-ethers-provider/tsconfig.json diff --git a/README.md b/README.md index 7e6a57d7..698a1ea9 100644 --- a/README.md +++ b/README.md @@ -9,23 +9,22 @@ You can find more resources on Safe Apps in the [Gnosis Safe Developer Portal](h ## Packages -| Package | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------- | -| [safe-app-cra-template](https://github.com/gnosis/safe-apps-sdk/tree/master/packages/safe-app-cra-template) | CRA template to quickly bootstrap a Safe app | -| [safe-apps-react-sdk](https://github.com/gnosis/safe-apps-sdk/tree/master/packages/safe-apps-react-sdk) | A wrapper of safe-apps-sdk with helpful hooks | -| [safe-apps-sdk](https://github.com/gnosis/safe-apps-sdk/tree/master/packages/safe-apps-sdk) [![npm version](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-apps-sdk.svg)](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-apps-sdk) | JavaScript SDK | +| Package | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------- | +| [safe-app-cra-template](https://github.com/gnosis/safe-apps-sdk/tree/master/packages/safe-app-cra-template) | CRA template to quickly bootstrap a Safe app | +| [safe-apps-react-sdk](https://github.com/gnosis/safe-apps-sdk/tree/master/packages/safe-apps-react-sdk) | A wrapper of safe-apps-sdk with helpful hooks | +| [safe-apps-sdk](https://github.com/gnosis/safe-apps-sdk/tree/master/packages/safe-apps-sdk) [![npm version](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-apps-sdk.svg)](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-apps-sdk) | JavaScript SDK | +| [safe-apps-ethers-provider](https://github.com/gnosis/safe-apps-sdk/tree/master/packages/safe-apps-ethers-provider) | An ethers.js provider to be used with ethers.js contract instances | ## Setting up development environment ### Installing dependencies ``` - npm i -g lerna yarn global add lerna lerna bootstrap - ``` ### Running commands @@ -35,17 +34,13 @@ We will use `build` command as an example. Same applies to other commands. For all packages: ``` - lerna run build - ``` For a specific package: ``` - lerna run --scope @gnosis.pm/safe-apps-sdk build --stream - ``` `--stream` options enables command output. By default, lerna displays it only in case of an error. diff --git a/packages/safe-apps-ethers-provider/README.md b/packages/safe-apps-ethers-provider/README.md new file mode 100644 index 00000000..e645bfe8 --- /dev/null +++ b/packages/safe-apps-ethers-provider/README.md @@ -0,0 +1,54 @@ +# Safe Apps Ethers Provider + +[![npm](https://img.shields.io/npm/v/@gnosis.pm/safe-apps-ethers-provider)](https://www.npmjs.com/package/@gnosis.pm/safe-apps-ethers-provider) + +This is an ethers.js provider to use with ethers.js contract instances. + +### How to use + +- Add npm package + +```bash +yarn add @gnosis.pm/safe-apps-ethers-provider + +npm i @gnosis.pm/safe-apps-ethers-provider +``` + +- Usage example with [safe-apps-react-sdk](https://github.com/gnosis/safe-apps-sdk/tree/master/packages/safe-apps-react-sdk) + +```js +import React, { useMemo, useState } from 'react'; +import { useSafeAppsSDK } from '@gnosis.pm/safe-apps-react-sdk'; +import { ethers } from 'ethers'; +import { SafeAppsSdkProvider } from '@gnosis.pm/safe-apps-ethers-provider'; +import Contract from './contracts/DelayedTxModule.json'; + +const App = () => { + const { sdk, safe } = useSafeAppsSDK(); + const contract = useMemo(() => ethers.Contract(Contract.address, Contract.abi, new SafeAppsSdkProvider(safe, sdk)), [ + sdk, + safe, + ]); + + // calling write methods + const doSomething = async () => { + const { safeTxHash } = await sdk.txs.send({ + txs: [ + { + to: safe.safeAddress, + value: '0', + data: contract.interface.encodeFunctionData('someFunc', ['someArg']), + }, + ], + }); + }; + + return; +}; + +export default App; +``` + +#### More scenarios + +For the SDK overview documentation, please refer to the [safe-apps-sdk](https://github.com/gnosis/safe-apps-sdk/) documentation diff --git a/packages/safe-apps-ethers-provider/package.json b/packages/safe-apps-ethers-provider/package.json new file mode 100644 index 00000000..981a70bc --- /dev/null +++ b/packages/safe-apps-ethers-provider/package.json @@ -0,0 +1,29 @@ +{ + "name": "@gnosis.pm/safe-apps-ethers-provider", + "version": "1.0.0-beta.0", + "description": "An ethers.js provider wrapper of Safe Apps SDK", + "main": "dist/index.js", + "typings": "dist/index.d.ts", + "scripts": { + "build": "yarn rimraf dist && tsc", + "prepublishOnly": "yarn build", + "test": "echo No tests specified" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/gnosis/safe-apps-sdk.git" + }, + "author": "Gnosis (https://gnosis.io)", + "license": "MIT", + "bugs": { + "url": "https://github.com/gnosis/safe-apps-sdk/issues" + }, + "homepage": "https://github.com/gnosis/safe-apps-sdk#readme", + "dependencies": { + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7", + "@ethersproject/providers": "^5.0.19", + "@gnosis.pm/safe-apps-sdk": "^1.0.3" + } +} diff --git a/packages/safe-apps-ethers-provider/src/index.ts b/packages/safe-apps-ethers-provider/src/index.ts new file mode 100644 index 00000000..ceddbf59 --- /dev/null +++ b/packages/safe-apps-ethers-provider/src/index.ts @@ -0,0 +1 @@ +export { SafeAppsSdkProvider } from './provider'; diff --git a/packages/safe-apps-ethers-provider/src/provider.ts b/packages/safe-apps-ethers-provider/src/provider.ts new file mode 100644 index 00000000..3165fc77 --- /dev/null +++ b/packages/safe-apps-ethers-provider/src/provider.ts @@ -0,0 +1,171 @@ +import { BaseProvider, TransactionRequest, Network } from '@ethersproject/providers'; +import { checkProperties, getStatic, shallowCopy } from '@ethersproject/properties'; +import { hexlify, hexValue, isHexString } from '@ethersproject/bytes'; +import SafeAppsSDK, { SafeInfo } from '@gnosis.pm/safe-apps-sdk'; +import { Logger } from '@ethersproject/logger'; +import { getLowerCase } from './utils'; + +const logger = new Logger('safe_apps_sdk_ethers_provider'); + +const allowedTransactionKeys: { [key: string]: boolean } = { + chainId: true, + data: true, + gasLimit: true, + gasPrice: true, + nonce: true, + to: true, + value: true, +}; + +// eslint-disable-next-line +function checkError(method: string, error: any): any { + // Undo the "convenience" some nodes are attempting to prevent backwards + // incompatibility; maybe for v6 consider forwarding reverts as errors + if (method === 'call' && error.code === Logger.errors.SERVER_ERROR) { + const e = error.error; + if (e && e.message.match('reverted') && isHexString(e.data)) { + return e.data; + } + } + + throw error; +} + +export class SafeAppsSdkProvider extends BaseProvider { + _safe: SafeInfo; + _sdk: SafeAppsSDK; + + constructor(safe: SafeInfo, sdk: SafeAppsSDK) { + super(safe.network.toLowerCase()); + this._safe = safe; + this._sdk = sdk; + } + + async detectNetwork(): Promise { + const network = this.network; + + if (!network) { + logger.throwError('no network detected', Logger.errors.UNKNOWN_ERROR, {}); + } + + return network; + } + + async listAccounts(): Promise> { + return [this.formatter.address(this._safe.safeAddress)]; + } + + // eslint-disable-next-line + async send(method: string, params: any): Promise { + switch (method) { + case 'getBlockNumber': + const block = await this._sdk.eth.getBlockByNumber(['latest']); + + return block.number; + + case 'getBalance': + return this._sdk.eth.getBalance([getLowerCase(params.address), params.blockTag]); + + case 'getCode': + return this._sdk.eth.getCode([getLowerCase(params.address), params.blockTag]); + + case 'getStorageAt': + return this._sdk.eth.getStorageAt([getLowerCase(params.address), params.position, params.blockTag]); + + case 'getBlock': + if (params.blockTag) { + return this._sdk.eth.getBlockByNumber([params.blockTag, !!params.includeTransactions]); + } else if (params.blockHash) { + return this._sdk.eth.getBlockByHash([params.blockHash, !!params.includeTransactions]); + } + return logger.throwError('Invalid getBlock arguments', Logger.errors.INVALID_ARGUMENT, params); + + case 'getTransaction': + return this._sdk.eth.getTransactionByHash([params.transactionHash]); + + case 'getTransactionReceipt': + return this._sdk.eth.getTransactionReceipt([params.transactionHash]); + + case 'call': { + const hexlifyTransaction = getStatic< + (t: TransactionRequest, a?: { [key: string]: boolean }) => { [key: string]: string } + >(this.constructor, 'hexlifyTransaction'); + + return this._sdk.eth.call([hexlifyTransaction(params.transaction, { from: true }), params.blockTag]); + } + + case 'getLogs': + if (params.filter && params.filter.address != null) { + params.filter.address = getLowerCase(params.filter.address); + } + return this._sdk.eth.getPastLogs([params.filter]); + + default: + logger.throwError(method + ' not implemented', Logger.errors.NOT_IMPLEMENTED, { operation: method }); + break; + } + } + + // eslint-disable-next-line + async perform(method: string, params: any): Promise { + try { + return await this.send(method, params); + } catch (error) { + return checkError(method, error); + } + } + + // Convert an ethers.js transaction into a JSON-RPC transaction + // - gasLimit => gas + // - All values hexlified + // - All numeric values zero-striped + // - All addresses are lowercased + // NOTE: This allows a TransactionRequest, but all values should be resolved + // before this is called + // @TODO: This will likely be removed in future versions and prepareRequest + // will be the preferred method for this. + static hexlifyTransaction( + transaction: TransactionRequest, + allowExtra?: { [key: string]: boolean }, + ): { [key: string]: string } { + // Check only allowed properties are given + const allowed = shallowCopy(allowedTransactionKeys); + if (allowExtra) { + for (const key in allowExtra) { + if (allowExtra[key]) { + allowed[key] = true; + } + } + } + checkProperties(transaction, allowed); + + const result: { [key: string]: string } = {}; + + // Some nodes (INFURA ropsten; INFURA mainnet is fine) do not like leading zeros. + ['gasLimit', 'gasPrice', 'nonce', 'value'].forEach(function (key) { + // eslint-disable-next-line + if ((transaction)[key] == null) { + return; + } + // eslint-disable-next-line + const value = hexValue((transaction)[key]); + if (key === 'gasLimit') { + key = 'gas'; + } + + result[key] = value; + }); + + ['from', 'to', 'data'].forEach(function (key) { + // eslint-disable-next-line + if ((transaction)[key] == null) { + return; + } + + // eslint-disable-next-line + result[key] = hexlify((transaction)[key]); + }); + + return result; + } +} diff --git a/packages/safe-apps-ethers-provider/src/utils.ts b/packages/safe-apps-ethers-provider/src/utils.ts new file mode 100644 index 00000000..b1bdc24a --- /dev/null +++ b/packages/safe-apps-ethers-provider/src/utils.ts @@ -0,0 +1,6 @@ +export function getLowerCase(value: string): string { + if (value) { + return value.toLowerCase(); + } + return value; +} diff --git a/packages/safe-apps-ethers-provider/tsconfig.json b/packages/safe-apps-ethers-provider/tsconfig.json new file mode 100644 index 00000000..6a62dbc4 --- /dev/null +++ b/packages/safe-apps-ethers-provider/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist" + }, + "include": ["./src"] +} diff --git a/packages/safe-apps-react-sdk/README.md b/packages/safe-apps-react-sdk/README.md index 758fd167..4c604eb1 100644 --- a/packages/safe-apps-react-sdk/README.md +++ b/packages/safe-apps-react-sdk/README.md @@ -1,6 +1,6 @@ # Safe Apps React SDK -[![npm](https://img.shields.io/npm/v/@rmeissner/safe-apps-react-sdk)](https://www.npmjs.com/package/@rmeissner/safe-apps-react-sdk) +[![npm](https://img.shields.io/npm/v/@gnosis.pm/safe-apps-react-sdk)](https://www.npmjs.com/package/@gnosis.pm/safe-apps-react-sdk) This sdk should provide a simple way to write a React.js [Safe app](https://docs.gnosis.io/safe/docs/sdks_safe_apps/) @@ -10,6 +10,8 @@ This sdk should provide a simple way to write a React.js [Safe app](https://docs ```bash yarn add @gnosis.pm/safe-apps-react-sdk + +npm i @gnosis.pm/safe-apps-react-sdk ``` - Add `SafeProvider` diff --git a/packages/safe-apps-react-sdk/package.json b/packages/safe-apps-react-sdk/package.json index 21bb9d9b..1f698857 100644 --- a/packages/safe-apps-react-sdk/package.json +++ b/packages/safe-apps-react-sdk/package.json @@ -9,7 +9,7 @@ "dist/**/*", "README.md" ], - "author": "Gnosis (https://gnosis.pm)", + "author": "Gnosis (https://gnosis.io)", "dependencies": { "@gnosis.pm/safe-apps-sdk": "1.0.3", "@types/jest": "^26.0.20" @@ -21,13 +21,10 @@ }, "devDependencies": { "babel-eslint": "^10.0.0", - "eslint": "^7.18.0", "eslint-config-react-app": "^6.0.0", "eslint-plugin-flowtype": "^5.2.0", "eslint-plugin-import": "^2.22.0", "eslint-plugin-jsx-a11y": "^6.3.1", - "eslint-plugin-react": "^7.22.0", - "eslint-plugin-react-hooks": "^4.0.8", "rimraf": "^3.0.2" }, "scripts": { diff --git a/packages/safe-apps-sdk/package.json b/packages/safe-apps-sdk/package.json index 3f647d6e..28657f5d 100644 --- a/packages/safe-apps-sdk/package.json +++ b/packages/safe-apps-sdk/package.json @@ -15,13 +15,13 @@ ], "scripts": { "test": "jest", - "format-dist": "sed -i '' 's/\"files\":/\"_files\":/' dist/package.json", + "format-dist": "sed -i 's/\"files\":/\"_files\":/' dist/package.json", "build": "yarn rimraf dist && tsc && yarn format-dist", "format": "prettier --write \"src/**/*.ts\"", "lint": "tslint -p tsconfig.json", "prepublishOnly": "yarn build" }, - "author": "Gnosis (https://gnosis.pm)", + "author": "Gnosis (https://gnosis.io)", "license": "MIT", "dependencies": { "semver": "^7.3.2", diff --git a/yarn.lock b/yarn.lock index 8d5ab36e..f8c2ad16 100644 --- a/yarn.lock +++ b/yarn.lock @@ -309,6 +309,30 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@ethersproject/abstract-provider@^5.0.8": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.0.8.tgz#880793c29bfed33dff4c2b2be7ecb9ba966d52c0" + integrity sha512-fqJXkewcGdi8LogKMgRyzc/Ls2js07yor7+g9KfPs09uPOcQLg7cc34JN+lk34HH9gg2HU0DIA5797ZR8znkfw== + dependencies: + "@ethersproject/bignumber" "^5.0.13" + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/logger" "^5.0.8" + "@ethersproject/networks" "^5.0.7" + "@ethersproject/properties" "^5.0.7" + "@ethersproject/transactions" "^5.0.9" + "@ethersproject/web" "^5.0.12" + +"@ethersproject/abstract-signer@^5.0.10": + version "5.0.11" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.0.11.tgz#675da9ec168905c60ee79a6da95f7157ca956f46" + integrity sha512-RKOgPSEYafknA62SrD3OCK42AllHE4YBfKYXyQeM+sBP7Nq3X5FpzeoY4uzC43P4wIhmNoTHCKQuwnX7fBqb6Q== + dependencies: + "@ethersproject/abstract-provider" "^5.0.8" + "@ethersproject/bignumber" "^5.0.13" + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/logger" "^5.0.8" + "@ethersproject/properties" "^5.0.7" + "@ethersproject/address@^5.0.4": version "5.0.8" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.0.8.tgz#0c551659144a5a7643c6bea337149d410825298f" @@ -320,6 +344,32 @@ "@ethersproject/logger" "^5.0.5" "@ethersproject/rlp" "^5.0.3" +"@ethersproject/address@^5.0.9": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.0.9.tgz#347ef30dc8243c682574a3f23ff63f73c8f8cbf1" + integrity sha512-gKkmbZDMyGbVjr8nA5P0md1GgESqSGH7ILIrDidPdNXBl4adqbuA3OAuZx/O2oGpL6PtJ9BDa0kHheZ1ToHU3w== + dependencies: + "@ethersproject/bignumber" "^5.0.13" + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/keccak256" "^5.0.7" + "@ethersproject/logger" "^5.0.8" + "@ethersproject/rlp" "^5.0.7" + +"@ethersproject/base64@^5.0.7": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.0.7.tgz#d5da73699b4a33dc92bd8e5056ad1880b262057d" + integrity sha512-S5oh5DVfCo06xwJXT8fQC68mvJfgScTl2AXvbYMsHNfIBTDb084Wx4iA9MNlEReOv6HulkS+gyrUM/j3514rSw== + dependencies: + "@ethersproject/bytes" "^5.0.9" + +"@ethersproject/basex@^5.0.7": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.0.7.tgz#2f7026b12c9dee6cdc7b7bf1805461836e635495" + integrity sha512-OsXnRsujGmYD9LYyJlX+cVe5KfwgLUbUJrJMWdzRWogrygXd5HvGd7ygX1AYjlu1z8W/+t2FoQnczDR/H2iBjA== + dependencies: + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/properties" "^5.0.7" + "@ethersproject/bignumber@^5.0.10", "@ethersproject/bignumber@^5.0.7": version "5.0.12" resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.0.12.tgz#fe4a78667d7cb01790f75131147e82d6ea7e7cba" @@ -329,6 +379,15 @@ "@ethersproject/logger" "^5.0.5" bn.js "^4.4.0" +"@ethersproject/bignumber@^5.0.13": + version "5.0.13" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.0.13.tgz#a5466412b3b80104097b9c694f6ae827df4353fe" + integrity sha512-b89bX5li6aK492yuPP5mPgRVgIxxBP7ksaBtKX5QQBsrZTpNOjf/MR4CjcUrAw8g+RQuD6kap9lPjFgY4U1/5A== + dependencies: + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/logger" "^5.0.8" + bn.js "^4.4.0" + "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.0.8": version "5.0.8" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.0.8.tgz#cf1246a6a386086e590063a4602b1ffb6cc43db1" @@ -336,6 +395,13 @@ dependencies: "@ethersproject/logger" "^5.0.5" +"@ethersproject/bytes@^5.0.9": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.0.9.tgz#2748247402ad20df69f3a3e935dc7b58c0d75c08" + integrity sha512-k+17ZViDtAugC0s7HM6rdsTWEdIYII4RPCDkPEuxKc6i40Bs+m6tjRAtCECX06wKZnrEoR9pjOJRXHJ/VLoOcA== + dependencies: + "@ethersproject/logger" "^5.0.8" + "@ethersproject/constants@^5.0.4": version "5.0.7" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.0.7.tgz#44ff979e5781b17c8c6901266896c3ee745f4e7e" @@ -343,6 +409,27 @@ dependencies: "@ethersproject/bignumber" "^5.0.7" +"@ethersproject/constants@^5.0.8": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.0.8.tgz#50f2e23f48c0d1d0de3759ea79b68ec3e06435a1" + integrity sha512-sCc73pFBsl59eDfoQR5OCEZCRv5b0iywadunti6MQIr5lt3XpwxK1Iuzd8XSFO02N9jUifvuZRrt0cY0+NBgTg== + dependencies: + "@ethersproject/bignumber" "^5.0.13" + +"@ethersproject/hash@^5.0.10": + version "5.0.10" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.0.10.tgz#41bf37428e8ddbc229ffd81c47af667174cb491a" + integrity sha512-Tf0bvs6YFhw28LuHnhlDWyr0xfcDxSXdwM4TcskeBbmXVSKLv3bJQEEEBFUcRX0fJuslR3gCVySEaSh7vuMx5w== + dependencies: + "@ethersproject/abstract-signer" "^5.0.10" + "@ethersproject/address" "^5.0.9" + "@ethersproject/bignumber" "^5.0.13" + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/keccak256" "^5.0.7" + "@ethersproject/logger" "^5.0.8" + "@ethersproject/properties" "^5.0.7" + "@ethersproject/strings" "^5.0.8" + "@ethersproject/keccak256@^5.0.3": version "5.0.6" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.0.6.tgz#5b5ba715ef1be86efde5c271f896fa0daf0e1efe" @@ -351,11 +438,26 @@ "@ethersproject/bytes" "^5.0.4" js-sha3 "0.5.7" -"@ethersproject/logger@^5.0.5": +"@ethersproject/keccak256@^5.0.7": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.0.7.tgz#2eedb5e4c160fcdf0079660f8ae362d7855ea943" + integrity sha512-zpUBmofWvx9PGfc7IICobgFQSgNmTOGTGLUxSYqZzY/T+b4y/2o5eqf/GGmD7qnTGzKQ42YlLNo+LeDP2qe55g== + dependencies: + "@ethersproject/bytes" "^5.0.9" + js-sha3 "0.5.7" + +"@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.0.8": version "5.0.8" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.0.8.tgz#135c1903d35c878265f3cbf2b287042c4c20d5d4" integrity sha512-SkJCTaVTnaZ3/ieLF5pVftxGEFX56pTH+f2Slrpv7cU0TNpUZNib84QQdukd++sWUp/S7j5t5NW+WegbXd4U/A== +"@ethersproject/networks@^5.0.7": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.0.7.tgz#8d06e41197b27c2404d89a29ca21f741a01acbfc" + integrity sha512-dI14QATndIcUgcCBL1c5vUr/YsI5cCHLN81rF7PU+yS7Xgp2/Rzbr9+YqpC6NBXHFUASjh6GpKqsVMpufAL0BQ== + dependencies: + "@ethersproject/logger" "^5.0.8" + "@ethersproject/properties@^5.0.3": version "5.0.6" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.0.6.tgz#44d82aaa294816fd63333e7def42426cf0e87b3b" @@ -363,6 +465,46 @@ dependencies: "@ethersproject/logger" "^5.0.5" +"@ethersproject/properties@^5.0.7": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.0.7.tgz#951d11ba592ff90bbe8ec34c5a03a5157e3b3360" + integrity sha512-812H1Rus2vjw0zbasfDI1GLNPDsoyX1pYqiCgaR1BuyKxUTbwcH1B+214l6VGe1v+F6iEVb7WjIwMjKhb4EUsg== + dependencies: + "@ethersproject/logger" "^5.0.8" + +"@ethersproject/providers@^5.0.19": + version "5.0.19" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.0.19.tgz#94c8f1a86755ee4187911fc6250e94b1116c089a" + integrity sha512-G+flo1jK1y/rvQy6b71+Nu7qOlkOKz+XqpgqFMZslkCzGuzQRmk9Qp7Ln4soK8RSyP1e5TCujaRf1H+EZahoaw== + dependencies: + "@ethersproject/abstract-provider" "^5.0.8" + "@ethersproject/abstract-signer" "^5.0.10" + "@ethersproject/address" "^5.0.9" + "@ethersproject/basex" "^5.0.7" + "@ethersproject/bignumber" "^5.0.13" + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/constants" "^5.0.8" + "@ethersproject/hash" "^5.0.10" + "@ethersproject/logger" "^5.0.8" + "@ethersproject/networks" "^5.0.7" + "@ethersproject/properties" "^5.0.7" + "@ethersproject/random" "^5.0.7" + "@ethersproject/rlp" "^5.0.7" + "@ethersproject/sha2" "^5.0.7" + "@ethersproject/strings" "^5.0.8" + "@ethersproject/transactions" "^5.0.9" + "@ethersproject/web" "^5.0.12" + bech32 "1.1.4" + ws "7.2.3" + +"@ethersproject/random@^5.0.7": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.0.7.tgz#e364268ce68bf6d300c36d654e622fd9d26b3a86" + integrity sha512-PxSRWwN3s+FH9AWMZU6AcWJsNQ9KzqKV6NgdeKPtxahdDjCuXxTAuzTZNXNRK+qj+Il351UnweAGd+VuZcOAlQ== + dependencies: + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/logger" "^5.0.8" + "@ethersproject/rlp@^5.0.3": version "5.0.6" resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.0.6.tgz#29f9097348a3c330811997433b7df89ab51cd644" @@ -371,6 +513,23 @@ "@ethersproject/bytes" "^5.0.4" "@ethersproject/logger" "^5.0.5" +"@ethersproject/rlp@^5.0.7": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.0.7.tgz#cfa4fa6415960a435b7814e1a29bdfea657e2b6e" + integrity sha512-ulUTVEuV7PT4jJTPpfhRHK57tkLEDEY9XSYJtrSNHOqdwMvH0z7BM2AKIMq4LVDlnu4YZASdKrkFGEIO712V9w== + dependencies: + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/logger" "^5.0.8" + +"@ethersproject/sha2@^5.0.7": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.0.7.tgz#ef9f18770c9f90a6cfd73840b0c3400910219099" + integrity sha512-MbUqz68hhp5RsaZdqi1eg1rrtiqt5wmhRYqdA7MX8swBkzW2KiLgK+Oh25UcWhUhdi1ImU9qrV6if5j0cC7Bxg== + dependencies: + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/logger" "^5.0.8" + hash.js "1.1.3" + "@ethersproject/signing-key@^5.0.4": version "5.0.7" resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.0.7.tgz#d03bfc5f565efb962bafebf8e6965e70d1c46d31" @@ -381,6 +540,25 @@ "@ethersproject/properties" "^5.0.3" elliptic "6.5.3" +"@ethersproject/signing-key@^5.0.8": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.0.8.tgz#156522e542916b9aa9135527b40c5b6f9235af02" + integrity sha512-YKxQM45eDa6WAD+s3QZPdm1uW1MutzVuyoepdRRVmMJ8qkk7iOiIhUkZwqKLNxKzEJijt/82ycuOREc9WBNAKg== + dependencies: + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/logger" "^5.0.8" + "@ethersproject/properties" "^5.0.7" + elliptic "6.5.3" + +"@ethersproject/strings@^5.0.8": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.0.8.tgz#11a1b0ed1e8417408693789839f0b5f4e323c0c9" + integrity sha512-5IsdXf8tMY8QuHl8vTLnk9ehXDDm6x9FB9S9Og5IA1GYhLe5ZewydXSjlJlsqU2t9HRbfv97OJZV/pX8DVA/Hw== + dependencies: + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/constants" "^5.0.8" + "@ethersproject/logger" "^5.0.8" + "@ethersproject/transactions@^5.0.0-beta.135": version "5.0.8" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.0.8.tgz#3b4d7041e13b957a9c4f131e0aea9dae7b6f5a23" @@ -396,6 +574,32 @@ "@ethersproject/rlp" "^5.0.3" "@ethersproject/signing-key" "^5.0.4" +"@ethersproject/transactions@^5.0.9": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.0.9.tgz#ccfcc1d395b5e3ce7342545fa28bfe5541182fd6" + integrity sha512-0Fu1yhdFBkrbMjenEr+39tmDxuHmaw0pe9Jb18XuKoItj7Z3p7+UzdHLr2S/okvHDHYPbZE5gtANDdQ3ZL1nBA== + dependencies: + "@ethersproject/address" "^5.0.9" + "@ethersproject/bignumber" "^5.0.13" + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/constants" "^5.0.8" + "@ethersproject/keccak256" "^5.0.7" + "@ethersproject/logger" "^5.0.8" + "@ethersproject/properties" "^5.0.7" + "@ethersproject/rlp" "^5.0.7" + "@ethersproject/signing-key" "^5.0.8" + +"@ethersproject/web@^5.0.12": + version "5.0.12" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.0.12.tgz#f123397c107f863c31fce5f31a97c66ec155e755" + integrity sha512-gVxS5iW0bgidZ76kr7LsTxj4uzN5XpCLzvZrLp8TP+4YgxHfCeetFyQkRPgBEAJdNrexdSBayvyJvzGvOq0O8g== + dependencies: + "@ethersproject/base64" "^5.0.7" + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/logger" "^5.0.8" + "@ethersproject/properties" "^5.0.7" + "@ethersproject/strings" "^5.0.8" + "@evocateur/libnpmaccess@^3.1.2": version "3.1.2" resolved "https://registry.yarnpkg.com/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz#ecf7f6ce6b004e9f942b098d92200be4a4b1c845" @@ -2214,6 +2418,11 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" +bech32@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" + integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== + before-after-hook@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" @@ -3445,7 +3654,7 @@ eslint-plugin-prettier@^3.3.1: dependencies: prettier-linter-helpers "^1.0.0" -eslint-plugin-react-hooks@^4.0.8, eslint-plugin-react-hooks@^4.2.0: +eslint-plugin-react-hooks@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556" integrity sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ== @@ -3492,7 +3701,7 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@7.18.0, eslint@^7.18.0: +eslint@7.18.0: version "7.18.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.18.0.tgz#7fdcd2f3715a41fe6295a16234bd69aed2c75e67" integrity sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ== @@ -4302,6 +4511,14 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +hash.js@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" + integrity sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.0" + hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" @@ -8886,6 +9103,11 @@ write-pkg@^3.1.0: sort-keys "^2.0.0" write-json-file "^2.2.0" +ws@7.2.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" + integrity sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ== + ws@^7.2.3: version "7.4.1" resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.1.tgz#a333be02696bd0e54cea0434e21dcc8a9ac294bb" From ff5cb47235b437a5b0502ff8b992cb2c89393c3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Feb 2021 12:51:01 +0400 Subject: [PATCH 4/7] Bump node-notifier from 8.0.0 to 8.0.1 (#76) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix cra-template-safe-app link * Bump node-notifier from 8.0.0 to 8.0.1 Bumps [node-notifier](https://github.com/mikaelbr/node-notifier) from 8.0.0 to 8.0.1. - [Release notes](https://github.com/mikaelbr/node-notifier/releases) - [Changelog](https://github.com/mikaelbr/node-notifier/blob/v8.0.1/CHANGELOG.md) - [Commits](https://github.com/mikaelbr/node-notifier/compare/v8.0.0...v8.0.1) Signed-off-by: dependabot[bot] Co-authored-by: Mikhail Mikheev Co-authored-by: Germán Martínez Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- README.md | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 698a1ea9..44e18d0c 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ You can find more resources on Safe Apps in the [Gnosis Safe Developer Portal](h | Package | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------- | -| [safe-app-cra-template](https://github.com/gnosis/safe-apps-sdk/tree/master/packages/safe-app-cra-template) | CRA template to quickly bootstrap a Safe app | +| [cra-template-safe-app](https://github.com/gnosis/safe-apps-sdk/tree/master/packages/cra-template-safe-app) | CRA template to quickly bootstrap a Safe app | | [safe-apps-react-sdk](https://github.com/gnosis/safe-apps-sdk/tree/master/packages/safe-apps-react-sdk) | A wrapper of safe-apps-sdk with helpful hooks | | [safe-apps-sdk](https://github.com/gnosis/safe-apps-sdk/tree/master/packages/safe-apps-sdk) [![npm version](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-apps-sdk.svg)](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-apps-sdk) | JavaScript SDK | | [safe-apps-ethers-provider](https://github.com/gnosis/safe-apps-sdk/tree/master/packages/safe-apps-ethers-provider) | An ethers.js provider to be used with ethers.js contract instances | diff --git a/yarn.lock b/yarn.lock index f8c2ad16..c5528805 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6415,9 +6415,9 @@ node-modules-regexp@^1.0.0: integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= node-notifier@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.0.tgz#a7eee2d51da6d0f7ff5094bc7108c911240c1620" - integrity sha512-46z7DUmcjoYdaWyXouuFNNfUo6eFa94t23c53c+lG/9Cvauk4a98rAUp9672X5dxGdQmLpPzTxzu8f/OeEPaFA== + version "8.0.1" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.1.tgz#f86e89bbc925f2b068784b31f382afdc6ca56be1" + integrity sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA== dependencies: growly "^1.3.0" is-wsl "^2.2.0" From 3c96c1e0d1d2724c6491c80b981b6623f53e5a0d Mon Sep 17 00:00:00 2001 From: Mikhail Date: Fri, 5 Feb 2021 15:34:07 +0400 Subject: [PATCH 5/7] update dependencies, bump versions --- packages/cra-template-safe-app/template.json | 2 +- packages/safe-apps-ethers-provider/package.json | 4 ++-- packages/safe-apps-react-sdk/package.json | 4 ++-- packages/safe-apps-sdk/package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/cra-template-safe-app/template.json b/packages/cra-template-safe-app/template.json index e2579776..0d7f129b 100644 --- a/packages/cra-template-safe-app/template.json +++ b/packages/cra-template-safe-app/template.json @@ -2,7 +2,7 @@ "package": { "homepage": "./", "dependencies": { - "@gnosis.pm/safe-apps-react-sdk": "1.0.0-beta.1", + "@gnosis.pm/safe-apps-react-sdk": "1.1.0", "@gnosis.pm/safe-react-components": "^0.3.0", "@material-ui/core": "^4.11.0", "@testing-library/jest-dom": "^5.11.4", diff --git a/packages/safe-apps-ethers-provider/package.json b/packages/safe-apps-ethers-provider/package.json index 981a70bc..3f5439d5 100644 --- a/packages/safe-apps-ethers-provider/package.json +++ b/packages/safe-apps-ethers-provider/package.json @@ -1,6 +1,6 @@ { "name": "@gnosis.pm/safe-apps-ethers-provider", - "version": "1.0.0-beta.0", + "version": "0.0.1", "description": "An ethers.js provider wrapper of Safe Apps SDK", "main": "dist/index.js", "typings": "dist/index.d.ts", @@ -24,6 +24,6 @@ "@ethersproject/logger": "^5.0.8", "@ethersproject/properties": "^5.0.7", "@ethersproject/providers": "^5.0.19", - "@gnosis.pm/safe-apps-sdk": "^1.0.3" + "@gnosis.pm/safe-apps-sdk": "^1.1.0" } } diff --git a/packages/safe-apps-react-sdk/package.json b/packages/safe-apps-react-sdk/package.json index 1f698857..51b0a24e 100644 --- a/packages/safe-apps-react-sdk/package.json +++ b/packages/safe-apps-react-sdk/package.json @@ -1,7 +1,7 @@ { "name": "@gnosis.pm/safe-apps-react-sdk", "private": false, - "version": "1.0.1", + "version": "1.1.0", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT", @@ -11,7 +11,7 @@ ], "author": "Gnosis (https://gnosis.io)", "dependencies": { - "@gnosis.pm/safe-apps-sdk": "1.0.3", + "@gnosis.pm/safe-apps-sdk": "1.1.0", "@types/jest": "^26.0.20" }, "peerDependencies": { diff --git a/packages/safe-apps-sdk/package.json b/packages/safe-apps-sdk/package.json index 28657f5d..e715b1db 100644 --- a/packages/safe-apps-sdk/package.json +++ b/packages/safe-apps-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@gnosis.pm/safe-apps-sdk", - "version": "1.0.3", + "version": "1.1.0", "description": "SDK developed to integrate third-party apps with Safe-Multisig app.", "main": "dist/src/index.js", "typings": "dist/src/index.d.ts", From 98a88c94745f53778b942511e70b9791e068ce03 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Fri, 5 Feb 2021 15:35:19 +0400 Subject: [PATCH 6/7] Update cra template version --- packages/cra-template-safe-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cra-template-safe-app/package.json b/packages/cra-template-safe-app/package.json index 567ee89a..5907c166 100644 --- a/packages/cra-template-safe-app/package.json +++ b/packages/cra-template-safe-app/package.json @@ -1,6 +1,6 @@ { "name": "@gnosis.pm/cra-template-safe-app", - "version": "2.0.0", + "version": "2.1.0", "description": "Gnosis Safe App Starter", "author": "Gnosis (https://gnosis.pm)", "license": "MIT", From 50fbcc54f6d7acd72510215546eb2d715d8dd04e Mon Sep 17 00:00:00 2001 From: Mikhail Date: Fri, 5 Feb 2021 16:31:46 +0400 Subject: [PATCH 7/7] fix readme --- packages/safe-apps-ethers-provider/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/safe-apps-ethers-provider/README.md b/packages/safe-apps-ethers-provider/README.md index e645bfe8..4be61c9f 100644 --- a/packages/safe-apps-ethers-provider/README.md +++ b/packages/safe-apps-ethers-provider/README.md @@ -2,7 +2,7 @@ [![npm](https://img.shields.io/npm/v/@gnosis.pm/safe-apps-ethers-provider)](https://www.npmjs.com/package/@gnosis.pm/safe-apps-ethers-provider) -This is an ethers.js provider to use with ethers.js contract instances. +This is an `ethers.js` provider to use with `ethers.js` contract instances. ### How to use