-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(): added mutation and hooks * support erc7412 * fix(NodeStateButton) * feat(queries): increased staletime * feat(support-non-erc7412) * fix(deps)
- Loading branch information
1 parent
e77163c
commit e2b8877
Showing
16 changed files
with
234 additions
and
285 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,2 +1,3 @@ | ||
NEXT_PUBLIC_WC_PROJECT_ID=xxx | ||
NEXT_PUBLIC_INFURA_KEY=xxx | ||
INFURA_KEY=xxx | ||
PYTH_MAINNET_ENDPOINT=https://hermes.pyth.network/ | ||
PYTH_TESTNET_ENDPOINT=https://hermes.pyth.network/ |
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,36 @@ | ||
import { Button, Spinner, Toast } from '@chakra-ui/react'; | ||
import { useIsConnected } from '@snx-v3/useBlockchain'; | ||
import { nodesState } from '../state/nodes'; | ||
import { useRecoilState } from 'recoil'; | ||
import { useRegisterAllNodes } from '../mutations/useRegisterAllNodes'; | ||
|
||
export function RegisterAllNodesButton() { | ||
const isWalletConnected = useIsConnected(); | ||
const [nodes] = useRecoilState(nodesState); | ||
const { mutateAsync, isPending } = useRegisterAllNodes(); | ||
|
||
if (isPending) return <Spinner alignSelf="center" mr="4" colorScheme="cyan" />; | ||
|
||
return ( | ||
<Button | ||
variant="outline" | ||
colorScheme="gray" | ||
mr="4" | ||
isDisabled={!isWalletConnected || nodes.length === 0} | ||
onClick={async () => { | ||
if (nodes.every((node) => node.isRegistered)) { | ||
Toast({ | ||
title: 'All nodes are already registered', | ||
status: 'info', | ||
duration: 9000, | ||
isClosable: true, | ||
}); | ||
} else { | ||
await mutateAsync(); | ||
} | ||
}} | ||
> | ||
Register All Nodes | ||
</Button> | ||
); | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.