-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #189 from valefar-on-discord/main
Material v4-v5 upgrade and wagyu refactor
- Loading branch information
Showing
178 changed files
with
4,374 additions
and
21,996 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.vscode/ | ||
node_modules/ | ||
dist/ | ||
.pnp.* | ||
|
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,4 @@ | ||
const tailwindcss = require('tailwindcss'); | ||
module.exports = { | ||
plugins: [tailwindcss], | ||
}; |
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,64 @@ | ||
import { Dispatch, SetStateAction, createContext, useState } from "react"; | ||
|
||
interface BTECContextType { | ||
btecCredentials: string; | ||
setBTECCredentials: Dispatch<SetStateAction<string>>; | ||
btecIndices: string; | ||
setBTECIndices: Dispatch<SetStateAction<string>>; | ||
folderLocation: string; | ||
setFolderLocation: Dispatch<SetStateAction<string>>; | ||
index: number; | ||
setIndex: Dispatch<SetStateAction<number>>; | ||
mnemonic: string; | ||
setMnemonic: Dispatch<SetStateAction<string>>; | ||
withdrawalAddress: string; | ||
setWithdrawalAddress: Dispatch<SetStateAction<string>>; | ||
} | ||
|
||
export const BTECContext = createContext<BTECContextType>({ | ||
btecCredentials: "", | ||
setBTECCredentials: () => {}, | ||
btecIndices: "", | ||
setBTECIndices: () => {}, | ||
folderLocation: "", | ||
setFolderLocation: () => {}, | ||
index: 0, | ||
setIndex: () => {}, | ||
mnemonic: "", | ||
setMnemonic: () => {}, | ||
withdrawalAddress: "", | ||
setWithdrawalAddress: () => {}, | ||
}); | ||
|
||
/** | ||
* Context for making the withdrawal credentials change | ||
*/ | ||
const BTECContextWrapper = ({ children }: { children: React.ReactNode}) => { | ||
const [btecIndices, setBTECIndices] = useState<string>(""); | ||
const [btecCredentials, setBTECCredentials] = useState<string>(""); | ||
const [folderLocation, setFolderLocation] = useState<string>(""); | ||
const [index, setIndex] = useState<number>(0); | ||
const [mnemonic, setMnemonic] = useState<string>(""); | ||
const [withdrawalAddress, setWithdrawalAddress] = useState<string>(""); | ||
|
||
return ( | ||
<BTECContext.Provider value={{ | ||
btecCredentials, | ||
setBTECCredentials, | ||
btecIndices, | ||
setBTECIndices, | ||
folderLocation, | ||
setFolderLocation, | ||
index, | ||
setIndex, | ||
mnemonic, | ||
setMnemonic, | ||
withdrawalAddress, | ||
setWithdrawalAddress, | ||
}}> | ||
{children} | ||
</BTECContext.Provider> | ||
); | ||
}; | ||
|
||
export default BTECContextWrapper; |
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,28 @@ | ||
import { Dispatch, SetStateAction, createContext, useState } from "react"; | ||
|
||
import { Network } from "./types"; | ||
|
||
interface GlobalContextType { | ||
network: Network; | ||
setNetwork: Dispatch<SetStateAction<Network>>; | ||
} | ||
|
||
export const GlobalContext = createContext<GlobalContextType>({ | ||
network: Network.MAINNET, | ||
setNetwork: () => {}, | ||
}); | ||
|
||
/** | ||
* Global context for the network which is used across the application | ||
*/ | ||
const GlobalContextWrapper = ({ children }: { children: React.ReactNode}) => { | ||
const [network, setNetwork] = useState<Network>(Network.MAINNET); | ||
|
||
return ( | ||
<GlobalContext.Provider value={{ network, setNetwork }}> | ||
{children} | ||
</GlobalContext.Provider> | ||
); | ||
}; | ||
|
||
export default GlobalContextWrapper; |
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,64 @@ | ||
import { Dispatch, SetStateAction, createContext, useState } from "react"; | ||
|
||
interface KeyCreationContextType { | ||
folderLocation: string; | ||
setFolderLocation: Dispatch<SetStateAction<string>>; | ||
index: number; | ||
setIndex: Dispatch<SetStateAction<number>>; | ||
mnemonic: string; | ||
setMnemonic: Dispatch<SetStateAction<string>>; | ||
numberOfKeys: number; | ||
setNumberOfKeys: Dispatch<SetStateAction<number>>; | ||
password: string; | ||
setPassword: Dispatch<SetStateAction<string>>; | ||
withdrawalAddress: string; | ||
setWithdrawalAddress: Dispatch<SetStateAction<string>>; | ||
} | ||
|
||
export const KeyCreationContext = createContext<KeyCreationContextType>({ | ||
folderLocation: "", | ||
setFolderLocation: () => {}, | ||
index: 0, | ||
setIndex: () => {}, | ||
mnemonic: "", | ||
setMnemonic: () => {}, | ||
numberOfKeys: 1, | ||
setNumberOfKeys: () => {}, | ||
password: "", | ||
setPassword: () => {}, | ||
withdrawalAddress: "", | ||
setWithdrawalAddress: () => {}, | ||
}); | ||
|
||
/** | ||
* Context for generating a validator key for both using an existing mnemonic or a new one | ||
*/ | ||
const KeyCreationContextWrapper = ({ children }: { children: React.ReactNode}) => { | ||
const [folderLocation, setFolderLocation] = useState<string>(""); | ||
const [index, setIndex] = useState<number>(0); | ||
const [mnemonic, setMnemonic] = useState<string>(""); | ||
const [numberOfKeys, setNumberOfKeys] = useState<number>(1); | ||
const [password, setPassword] = useState<string>(""); | ||
const [withdrawalAddress, setWithdrawalAddress] = useState<string>(""); | ||
|
||
return ( | ||
<KeyCreationContext.Provider value={{ | ||
folderLocation, | ||
setFolderLocation, | ||
index, | ||
setIndex, | ||
mnemonic, | ||
setMnemonic, | ||
numberOfKeys, | ||
setNumberOfKeys, | ||
password, | ||
setPassword, | ||
withdrawalAddress, | ||
setWithdrawalAddress, | ||
}}> | ||
{children} | ||
</KeyCreationContext.Provider> | ||
); | ||
}; | ||
|
||
export default KeyCreationContextWrapper; |
Oops, something went wrong.