Skip to content
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

protocol-kit v2.0 #266

Merged
merged 20 commits into from
Nov 27, 2023
Merged

protocol-kit v2.0 #266

merged 20 commits into from
Nov 27, 2023

Conversation

DaniSomoza
Copy link
Contributor

@DaniSomoza DaniSomoza commented Oct 27, 2023

Protocol Kit v2.0

Changes reflecting the updates here

New packages versions

⚠️ Breaking Changes

api-kit

  • SafeApiKit instantiation
// old:
constructor({ txServiceUrl, ethAdapter }: SafeApiKitConfig)

// new:
constructor({ chainId, txServiceUrl? }: SafeApiKitConfig)
  • '/api' is not added to the txServiceUrl prop
  • Rename type MasterCopyResponse to SafeSingletonResponse
  • Rename method getServiceMasterCopiesInfo() to getServiceSingletonsInfo()

protocol-kit

  • Rename isL1SafeMasterCopy to isL1SafeSingleton
// old:
SafeFactory.create({ ethAdapter, isL1SafeMasterCopy: true })

// new:
SafeFactory.create({ ethAdapter, isL1SafeSingleton: true })
  • EthersAdapter now it's only compatible with ethers v6.
  • createTransaction now only accepts array of transactions
// old:
const safeTransactionData = {
  to: '',
 data: '',
 value: '',
  nonce: '',
  safeTxGas: ''
}
const safeTransaction = protocolKit.createTransaction({ safeTransactionData })

// new:
const safeTransactionData = {
  to: '',
 data: '',
 value: ''
}
const options = {
  nonce: '',
  safeTxGas: ''
}
const safeTransaction = protocolKit.createTransaction({ [safeTransactionData], options })

relay-kit

  • The GelatoRelayPack constructor now includes a mandatory protocolKit parameter as we made it required for any new pack extending the RelayKitBasePack
constructor({ apiKey, protocolKit }: GelatoOptions)
  • We removed the protocolKit parameter from the createTransactionWithHandlePayment(), createTransactionWithTransfer() and executeRelayTransaction() methods in the GelatoRelayPack as we now include it in the constructor

  • Removed the type export interface RelayPack as we use now an abstract class

@github-actions
Copy link

github-actions bot commented Oct 27, 2023

Overall readability score: 70.84 (🔴 -1.15)

File Readability
README.md 64.95 (🟢 +0.61)
v2.md 62.94 (-)
README.md 75.08 (🔴 -0.5)
Web3AuthModalPack.md 60.27 (🟢 +0)
MoneriumPack.md 72.36 (🟢 +0.13)
README.md 77.81 (🟢 +0)
README.md 72.22 (🟢 +1)
v2.md 70.21 (-)
README.md 74.32 (🟢 +2.44)
gelato.md 75.06 (🟢 +0)
v2.md 20.34 (-)
SUMMARY.md 100 (🟢 +0)
View detailed metrics

🟢 - Shows an increase in readability
🔴 - Shows a decrease in readability

File Readability FRE GF ARI CLI DCRS
README.md 64.95 54.73 10.4 10.3 10.55 7.19
  🟢 +0.61 🟢 +0.61 🟢 +0.13 🟢 +0.2 🔴 -0.05 🟢 +0.02
v2.md 62.94 48.6 11.03 9.5 10.72 7.45
  - - - - - -
README.md 75.08 53.07 6.89 8.7 11.57 6.1
  🔴 -0.5 🟢 +0.1 🔴 -0.13 🟢 +0 🔴 -0.05 🔴 -0.07
Web3AuthModalPack.md 60.27 47.89 9.61 11.7 13.04 6.99
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
MoneriumPack.md 72.36 56.15 8.64 9.4 10.08 6.51
  🟢 +0.13 🟢 +0 🟢 +0.04 🟢 +0 🟢 +0 🟢 +0.02
README.md 77.81 73.98 8.24 8.2 8.98 6.97
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
README.md 72.22 57.98 8.59 9.2 10.43 6.61
  🟢 +1 🟢 +0.71 🟢 +0.23 🟢 +0.2 🟢 +0.12 🟢 +0.01
v2.md 70.21 58.89 10.62 7.2 8.57 7.92
  - - - - - -
README.md 74.32 49.62 7.28 9.7 11.18 5.67
  🟢 +2.44 🟢 +0.31 🟢 +0.36 🟢 +0.4 🟢 +0.64 🟢 +0.09
gelato.md 75.06 64 8.63 9 9.51 6.51
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
v2.md 20.34 0 14.74 17.3 19 9.07
  - - - - - -
SUMMARY.md 100 100 6 6 6 4.9
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0

Averages:

  Readability FRE GF ARI CLI DCRS
Average 70.84 62.46 9.14 9.45 10.2 6.97
  🔴 -1.15 🔴 -1.63 🔴 -0.17 🔴 -0.1 🔴 -0.15 🔴 -0.07
View metric targets
Metric Range Ideal score
Flesch Reading Ease 100 (very easy read) to 0 (extremely difficult read) 60
Gunning Fog 6 (very easy read) to 17 (extremely difficult read) 8 or less
Auto. Read. Index 6 (very easy read) to 14 (extremely difficult read) 8 or less
Coleman Liau Index 6 (very easy read) to 17 (extremely difficult read) 8 or less
Dale-Chall Readability 4.9 (very easy read) to 9.9 (extremely difficult read) 6.9 or less

@dasanra dasanra marked this pull request as draft October 27, 2023 11:50
@dasanra dasanra changed the title update ethers docs protocol-kit v2.0 Nov 23, 2023
@dasanra dasanra marked this pull request as ready for review November 23, 2023 15:40
@tanay1337 tanay1337 self-requested a review November 24, 2023 07:52
Copy link
Collaborator

@tanay1337 tanay1337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two additional thoughts:

  • We should probably move the migration docs under the respective reference folders of the kits.
  • You'd need to reference the new pages in summary.md so that they are added by GitBook and displayed on the sidebar.

safe-core-sdk/api-kit/README.md Outdated Show resolved Hide resolved
safe-core-sdk/api-kit/migrating/v2.md Outdated Show resolved Hide resolved
safe-core-sdk/api-kit/migrating/v2.md Outdated Show resolved Hide resolved
safe-core-sdk/api-kit/migrating/v2.md Outdated Show resolved Hide resolved
safe-core-sdk/api-kit/migrating/v2.md Outdated Show resolved Hide resolved
safe-core-sdk/protocol-kit/migrating/v2.md Outdated Show resolved Hide resolved
safe-core-sdk/protocol-kit/migrating/v2.md Outdated Show resolved Hide resolved
safe-core-sdk/relay-kit/migrating/v2.md Outdated Show resolved Hide resolved
safe-core-sdk/relay-kit/migrating/v2.md Outdated Show resolved Hide resolved
safe-core-sdk/relay-kit/migrating/v2.md Outdated Show resolved Hide resolved
@tanay1337 tanay1337 self-requested a review November 24, 2023 10:27
@dasanra dasanra merged commit c9df891 into main Nov 27, 2023
3 of 5 checks passed
@dasanra dasanra deleted the ethers-v6-migration-docs branch November 27, 2023 13:40
louis-md added a commit that referenced this pull request Jan 24, 2024
* Update SUMMARY.md (#251)

* Update SUMMARY.md

* Update SUMMARY.md

* Add GH action for readability (#254)

Co-authored-by: Tanay Pant <tanaypantprotonmail.com>

* Add workflow for style check on PRs (#255)

Co-authored-by: Tanay Pant <tanaypantprotonmail.com>

* Update workflow setting

* Add link check workflow (#257)

* Add link check workflow

* Fix errors

---------

Co-authored-by: Tanay Pant <tanaypantprotonmail.com>

* Remove link check GH action

* Link check workflow (#259)

* Link check workflow

* Test a fix

* Updates

* Fixes

---------

Co-authored-by: Tanay Pant <tanaypantprotonmail.com>

* Add weekly link checker (#260)

* Add weekly link checker

* Minor updates

---------

Co-authored-by: Tanay Pant <tanaypantprotonmail.com>

* Add manual trigger for testing

* Fix conditional for issue creation

* Update conditional for workflow

* Minor updates to the workflow

* Update information architecture (#265)

* Update information architecture

* Update minimum alert level for Vale

* Remove unused files

---------

Co-authored-by: Tanay Pant <tanaypantprotonmail.com>

* Update Safe Apps section (#267)

* Update Safe Docs

* Update README.md

* Add new vocabulary

* Update README.md

* Update get-started.md

* Update get-started.md

* Add new vocab

* Update release.md

* Update release.md

* Add new vocab

* New words

* Update release.md

* Update release.md

* Update safe-apps/release.md

Co-authored-by: Germán Martínez <[email protected]>

* Update safe-apps/release.md

Co-authored-by: Germán Martínez <[email protected]>

* Update safe-apps/release.md

Co-authored-by: Germán Martínez <[email protected]>

---------

Co-authored-by: Tanay Pant <tanaypantprotonmail.com>
Co-authored-by: Germán Martínez <[email protected]>

* Update IA for reference (#268)

* Update IA

* Fixes

* Move files around

* Update SUMMARY.md

---------

Co-authored-by: Tanay Pant <tanaypantprotonmail.com>

* docs: fix typos (#271)

* docs: fix typos

* Update safe-apps/release.md

revert typo walkthroughts

Co-authored-by: Germán Martínez <[email protected]>

* Update safe-core-api/rpc-requirements.md

fix typos

Co-authored-by: Germán Martínez <[email protected]>

* Update safe-core-api/rpc-requirements.md

Co-authored-by: Germán Martínez <[email protected]>

* Update safe-core-api/rpc-requirements.md

Co-authored-by: Germán Martínez <[email protected]>

* Update safe-core-api/rpc-requirements.md

fix typos

Co-authored-by: Germán Martínez <[email protected]>

* Update safe-apps/release.md

fix typo

Co-authored-by: Germán Martínez <[email protected]>

---------

Co-authored-by: Germán Martínez <[email protected]>

* fix: update `@web3auth/*` versions (#270)

* fix: update `@web3auth/*` versions

* fix: revert formatting

* Update README.md (#276)

* Add script to generate Supported Networks pages from safe-deployments repo as a github action (#278)

* Add script to genereate Supported Networks pages from safe-deployments repo as a github action

* Update summary

* Update summary

* Fix typo in supported networks script & re-generate .md files

* Implement requested changes

* Implement requested changes

* Remove unused console.log; fix supported networks index page & block explorers

* Fix some vale errors ("networks's" & "Testnet")

* Re-generate supported networks

* Implement requested changes (wording & correct section)

* Update SUMMARY.md

* Update SUMMARY.md

* Update SUMMARY.md

* Update SUMMARY.md

* Update SUMMARY.md

* Move supported networks .md folder into safe-smart-accounts

* Implement requested changes (create PR on workflow, minor fixes)

* Update vale dictionnary

* Update vale dictionnary

* Remove duplicates in vale dictionnary

* Remove unnecessary steps in github workflow for supported networks

* Remove duplicates in vale dictionnary

* Alphabetize & deduplicate vale dictionnary

* Exclude deprecated block explorer from supported networks page generation

---------

Co-authored-by: Germán Martínez <[email protected]>

* Link checks (#275)

* Fix some link checker errors

* Fix some link checker errors

* Fix some link checker errors

* Add Pimlico to Safe Modules (#279)

* Update modules.md

* Update accept.txt

* Update weekly-link-check.yml (#281)

* Revert "Update weekly-link-check.yml (#281)" (#283)

This reverts commit 4d2f19d.

* Link fixes (#284)

* Update README.md

* Update MoneriumPack.md

* Link checks (#285)

* Fix some link checker errors

* Fix some link checker errors

* Fix some link checker errors

* Fix broken links

* Re-generate .md files

* protocol-kit v2.0 (#266)

* update ethers docs

* add singleton change to api-kit and protocol-kit
update api-kit initialization
update createTransaction use

* update GelatoRelayKit breaking changes

* fix wording recommendations

* highlight ethers.js v6

* add migration guides highlighting the major changes

---------

Co-authored-by: Daniel <[email protected]>

* Switch from gitbook to nextra

* Migrate getting started section

* Migrate assets

* Migrate misc section

* Migrate safe-apps section

* Migrate safe-core-api section

* Migrate safe-core-sdk section

* Migrate safe-smart-account section

* Migrate safe-core-protocol section

* Add index page

* Update generate supported network script

* Fix broken links & vale errors

* Fix vale errors

* Fix vale errors

* Fix vale errors

* Reorder sidebar (#292)

* Update SUMMARY.md

* Update and rename available-services.md to supported-networks.md

* Implement design feedback (color palette, font)

* Add torusscan as a deprecated block explorer in generateSupportedNetworks

* Add footer from safe.global

* Remove Home component; redirect index to first page

* Implement design feedback (navbar background color & backdrop filter)

* Add legacy `safe-core-sdk` migration guide (#291)

* update ethers docs

* add singleton change to api-kit and protocol-kit
update api-kit initialization
update createTransaction use

* Fix linting and typos

* fix: broken links

* update GelatoRelayKit breaking changes

* improve parameter naming

* fix linter reported issue

* fix wording recommendations

* highlight ethers.js v6

* add migration guides highlighting the major changes

* fix typos

* Apply suggestions from code review

Co-authored-by: Tanay Pant <[email protected]>

* add backticks to EthersAdapter

* Apply suggestions from code review

Co-authored-by: Tanay Pant <[email protected]>

* set migrating guides below reference

* add wording suggestions

* Add safe-transaction-service migration guide

* Add migration guide from legacy safe-core-sdk

* Add types changes

* remove auth-kit changes

* fix linting issues

* improve api-kit v2 migration

* Add latest changes

* Add missing type

* fix typo

* Apply suggestions from code review

Co-authored-by: Tanay Pant <[email protected]>

* add migration links

* Update safe-core-sdk/protocol-kit/reference/migrating/v1.md

Co-authored-by: Tanay Pant <[email protected]>

* Reverse migration links order in SUMMARY

---------

Co-authored-by: Daniel Somoza <[email protected]>
Co-authored-by: Tanay Pant <[email protected]>

* Add middleware information for Safe Apps (#293)

* Update get-started.md

* Update accept.txt

* Fix information architecture

* Fix error in code snippet (#295)

* Fix all images &  callouts

* Collapse sidebar menu items

* Add deployment workflow

* Fix deployment workflow

* Fix deployment workflow

* Fix deployment workflow

* docs(auth-kit): Update docs for the new `SafeAuthPack` (#289)

* add protocol-kit v2 updates

* Add SafeAuth information

* Update ethersv6 changes

* Fix deployment workflow

* Fix deployment workflow

* Fix deployment workflow

* fix broken links (#296)

* fix broken links

* fix: link name

* Minor fixes

* chore: Improve auth-kit docs (#298)

* Fix broken links

* Force dark theme

* Fix generate supported networks

* Add avax.boba.network as deprecated block explorers

* Fix generate supported networks (#299)

* Fix generate supported networks

* Generate supported networks .md files

* Edit vocab

* Add toruscan as deprecated block explorer

* Add favicon; fix theme color.

* Cherry pick merged changes from #289

* Cherry pick merged changes from #291

* Cherry pick merged changes from subsequent PRs

* Fix link checker & vale errors

* Add eslint, standard, husky

* Fix lint errors

* Fix pre-push commit hook

* Fix theme import

* Set Google Form for first Safe App review contact (#303)

* Feedback widget design. WIP logic

* Add google analytics

* Move contact-us links in footer

* Rename all files with prefixes

* Add local link checker to prepush hook

* Minor fix

* Fix vale config

* Add missing content from `main`

* Add redirections from gitbook paths

* Fix eslint config

* Remove linkchecker from prepush hook

* Add legacy redirects

* Custom 404 page

* Fix breaking changes in vale v3

* fix: link view inside hint element not showing as expected (#307)

* Restore signature files (#308)

* Restore signatures

* Fix link

* Fix conflicts with signatures

* Update gitignore

* Fix Vale errors

* Accept words with Vale

* Fix vale errors; add vale to lint command.

* Fix build

* Fix redirect link

* Implement requested changes

* Add redirections test

* Fix tsconfig

* Fix typos in redirects

* Fix typo in redirects

* Switch all routes to kebab-case

---------

Co-authored-by: Tanay Pant <[email protected]>
Co-authored-by: Tanay Pant <tanaypantprotonmail.com>
Co-authored-by: Germán Martínez <[email protected]>
Co-authored-by: xiaolou86 <[email protected]>
Co-authored-by: Aaron Cook <[email protected]>
Co-authored-by: Dani Somoza <[email protected]>
Co-authored-by: Daniel <[email protected]>
Co-authored-by: Daniel Somoza <[email protected]>
Co-authored-by: Pran <[email protected]>
Co-authored-by: Yago Pérez Vázquez <[email protected]>
Co-authored-by: Germán Martínez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Ethers v6 Migration] Update Documentation
3 participants