Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dry-yaks-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openfort/react-native": patch
---

fix: include DELEGATED_ACCOUNT in embedded wallet list filter
8 changes: 6 additions & 2 deletions src/hooks/wallet/useEmbeddedEthereumWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ export function useEmbeddedEthereumWallet(options: UseEmbeddedEthereumWalletOpti
const accounts = await client.embeddedWallet.list({
limit: 100,
chainType: ChainTypeEnum.EVM,
accountType: walletConfig?.accountType === AccountTypeEnum.EOA ? undefined : AccountTypeEnum.SMART_ACCOUNT,
accountType:
walletConfig?.accountType === AccountTypeEnum.EOA ||
walletConfig?.accountType === AccountTypeEnum.DELEGATED_ACCOUNT
? undefined
: walletConfig?.accountType || AccountTypeEnum.SMART_ACCOUNT,
})
// Filter for Ethereum accounts only
setEmbeddedAccounts(accounts)
Expand Down Expand Up @@ -350,7 +354,7 @@ export function useEmbeddedEthereumWallet(options: UseEmbeddedEthereumWalletOpti

// Build recovery params
const recoveryParams = await buildRecoveryParams({ ...createOptions, userId: user?.id }, walletConfig)
const accountType = createOptions?.accountType || walletConfig?.accountType || AccountTypeEnum.SMART_ACCOUNT
const accountType = createOptions?.accountType || walletConfig?.accountType || AccountTypeEnum.EOA
// Create embedded wallet
const embeddedAccount = await client.embeddedWallet.create({
chainId: accountType === AccountTypeEnum.EOA ? undefined : chainId,
Expand Down
Loading