Conversation
|
Related PR: 5afe/safe-signers#2 |
|
Hi team, just passing by to bring a new integration with Openfort. Keep up the good work! :) |
Update to @openfort/react v1.0.4 APIThe Openfort React SDK has been updated to v1.0.4 with breaking changes. Here are the required updates for this PR: Changes needed in
|
emauja
left a comment
There was a problem hiding this comment.
Openfort React SDK v1.0.4 Update Required
After researching the latest @openfort/react v1.0.4 API, several imports and hooks in this PR need updating:
1. getDefaultConfig moved to subpath import
Since v1.0.0, wagmi utilities are in a separate subpath:
- import { OpenfortProvider, OpenfortButton, useUser, useWallets, useOpenfort, AccountTypeEnum, AuthProvider, getDefaultConfig } from '@openfort/react'
+ import { OpenfortProvider, OpenfortButton, useUser, useOpenfort, AccountTypeEnum, AuthProvider } from '@openfort/react'
+ import { getDefaultConfig } from '@openfort/react/wagmi'
+ import { useEthereumEmbeddedWallet } from '@openfort/react/ethereum'2. useWallets removed — use useEthereumEmbeddedWallet instead
useWallets() no longer exists in v1.0.4. Replace with:
- const { wallets } = useWallets()
+ const evm = useEthereumEmbeddedWallet()3. Update wallet access pattern
- if (isAuthenticated && wallets.length > 0) {
+ if (isAuthenticated && evm.status === 'connected') {
...
- const signer = wallets[0].address
+ const signer = evm.address
}
- }, [isAuthenticated, wallets])
+ }, [isAuthenticated, evm.status])4. Update description text
- hooks like `useUser()` or `useWallets()` that will provide
+ hooks like `useUser()` or `useEthereumEmbeddedWallet()` that will provideThese changes align with the v1.0.0 tree-shaking architecture where wagmi, Ethereum, and Solana utilities are separate subpath exports. The uiConfig prop and client.embeddedWallet.getEthereumProvider() pattern remain correct.
Adds documentation for the Openfort signer integration with Safe SDK.