-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update burner wallet flow with swapOwner flow
- Loading branch information
Showing
3 changed files
with
50 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
import { useAccount } from "wagmi"; | ||
|
||
/** | ||
* Retrieves the safe account address. If a burner wallet configuration is found in local storage, | ||
* it returns the burner wallet address. Otherwise, it returns the current user's account address. | ||
* @returns {string | undefined} The burner wallet address if present in local storage, | ||
* or the current user's account address. | ||
*/ | ||
export const useGetSafeAccountAddress = (): string | undefined => { | ||
const { address } = useAccount(); | ||
const burnerWalletConfig = localStorage.getItem("burnerWalletConfig"); | ||
|
||
if (burnerWalletConfig) { | ||
return JSON.parse(burnerWalletConfig).burnerWalletAddress; | ||
} | ||
|
||
return address; | ||
}; |