v2 Migration

v2 introduces significant improvements including the replacement of `Connex` with improved developer experience

What's Changed in 2.0

Major Breaking Changes

  • Connex Removal: useConnex is replaced with useThor

  • New Contract Interaction Patterns: Introduction of useCallClause and executeMultipleClausesCall

  • Enhanced Transaction Building: New useBuildTransaction hook with improved type safety

  • Improved Type Safety: Better TypeScript support with stricter typing

useCallClause is for reading data from smart contracts with automatic caching and refetching

executeMultipleClausesCall is to execute multiple contract calls in a single batch

Migration Path

Preparation Steps

  1. Create a git branch for migration

  2. Identify all places where useConnex is used (This is the main breaking change and easiest to find)

  3. Run tsc compiler to see all broken references

  4. Fix the compiler errors and migrate incrementally. The new methods provide type-safe returns that will guide you

  5. Verify functionality as you fix each error

  6. Ensure you have adequate test coverage before starting

Getting Help

  • Documentation: Refer to individual migration guide sections

  • GitHub Issues: Report issues

Next Steps

  1. Start with the API Changes guide to update your core dependencies and imports

  2. Review Contract Patterns to understand new interaction methods

  3. Apply Best Practices for optimal performance

  4. Consult Troubleshooting if you encounter issues

Last updated

Was this helpful?