-
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: Add cancel recovery feature in burner wallet flow
- Loading branch information
Showing
6 changed files
with
157 additions
and
90 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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { createContext, useContext, useState, ReactNode } from "react"; | ||
Check failure on line 1 in src/context/BurnerAccountContext.tsx GitHub Actions / eslint
|
||
import "viem/window"; | ||
|
||
interface BurnerAccountContextType { | ||
burnerAccountClient: any; // Replace 'any' with the actual type if known | ||
Check failure on line 5 in src/context/BurnerAccountContext.tsx GitHub Actions / eslint
|
||
setBurnerAccountClient: (client: any) => void; // Adjust the type as necessary | ||
Check failure on line 6 in src/context/BurnerAccountContext.tsx GitHub Actions / eslint
|
||
} | ||
|
||
const BurnerAccountContext = createContext<BurnerAccountContextType | null>( | ||
null | ||
); | ||
|
||
export const BurnerAccountProvider: React.FC<{ children: ReactNode }> = ({ | ||
children, | ||
}) => { | ||
const [burnerAccountClient, setBurnerAccountClient] = useState<any>(null); // Adjust type as needed | ||
Check failure on line 16 in src/context/BurnerAccountContext.tsx GitHub Actions / eslint
|
||
|
||
return ( | ||
<BurnerAccountContext.Provider | ||
value={{ burnerAccountClient, setBurnerAccountClient }} | ||
> | ||
{children} | ||
</BurnerAccountContext.Provider> | ||
); | ||
}; | ||
|
||
export const useBurnerAccount = () => { | ||
Check warning on line 27 in src/context/BurnerAccountContext.tsx GitHub Actions / eslint
|
||
const context = useContext(BurnerAccountContext); | ||
if (!context) { | ||
throw new Error( | ||
"useBurnerAccount must be used within a BurnerAccountProvider" | ||
); | ||
} | ||
return context; | ||
}; |
Oops, something went wrong.