-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use new registry * convert webpack config to .ts * grpc form refactors * Make todo clearer
- Loading branch information
Showing
17 changed files
with
338 additions
and
237 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 @@ | ||
CHAIN_ID=penumbra-testnet-deimos-6 | ||
IDB_VERSION=34 | ||
MINIFRONT_URL=https://app.testnet.penumbra.zone | ||
PRAX=lkpmkhpnhknhmibgnmmhdhgdilepfghe |
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 +1,2 @@ | ||
bin | ||
auto-login.ts |
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,33 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import { ChainRegistryClient, Registry, Rpc } from '@penumbra-labs/registry'; | ||
import { getChainIdWithFallback } from './chain-id'; | ||
|
||
const getRegistry = async (): Promise<Registry> => { | ||
const chainId = await getChainIdWithFallback(); | ||
const registryClient = new ChainRegistryClient(); | ||
return registryClient.get(chainId); | ||
}; | ||
|
||
export const useRegistry = () => { | ||
return useQuery({ | ||
queryKey: ['registry'], | ||
queryFn: async (): Promise<Registry> => { | ||
const chainId = await getChainIdWithFallback(); | ||
const registryClient = new ChainRegistryClient(); | ||
return registryClient.get(chainId); | ||
}, | ||
staleTime: Infinity, | ||
}); | ||
}; | ||
|
||
export const useRpcEndpoints = () => { | ||
return useQuery({ | ||
queryKey: ['rpcEndpoints'], | ||
queryFn: async (): Promise<Rpc[]> => { | ||
const { rpcs } = await getRegistry(); | ||
return rpcs; | ||
}, | ||
staleTime: Infinity, | ||
retry: 1, | ||
}); | ||
}; |
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 was deleted.
Oops, something went wrong.
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 @@ | ||
import { register } from 'node:module'; | ||
import { pathToFileURL } from 'node:url'; | ||
|
||
register('ts-node/esm', pathToFileURL('./')); |
Oops, something went wrong.