Skip to content

Commit

Permalink
upgrade the triplets (viem,wagmi rainbowkit) (#48)
Browse files Browse the repository at this point in the history
* upgrade the triplets (viem,wagmi rainbowkit)
valora now included so now custom is needed
add a few good wallets to the suggested list (injected aka browsers is reccommended to always be included, safe and brave only show up in the context of their environemtns)

* not needed (in rainbowkit now)
  • Loading branch information
aaronmgdr authored Sep 17, 2024
1 parent 1ea4a2a commit 6ef712d
Show file tree
Hide file tree
Showing 6 changed files with 349 additions and 327 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@metamask/jazzicon": "https://github.com/jmrossy/jazzicon#7a8df28974b4e81129bfbe3cab76308b889032a6",
"@metamask/post-message-stream": "6.1.2",
"@metamask/providers": "10.2.1",
"@rainbow-me/rainbowkit": "2.1.1",
"@rainbow-me/rainbowkit": "2.1.6",
"@tanstack/react-query": "^5.28.9",
"@tanstack/react-table": "^8.15.0",
"@vercel/analytics": "^1.3.0",
Expand All @@ -35,8 +35,8 @@
"react-dom": "^18.2.0",
"react-minimal-pie-chart": "^8.4.0",
"react-toastify": "^10.0.5",
"viem": "2.12.1",
"wagmi": "2.9.6",
"viem": "2.21.8",
"wagmi": "2.12.12",
"yaml": "^2.4.2",
"zod": "^3.23.8"
},
Expand Down
Binary file removed public/logos/valora.jpg
Binary file not shown.
12 changes: 9 additions & 3 deletions src/config/wagmi.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import { RainbowKitProvider, connectorsForWallets, lightTheme } from '@rainbow-me/rainbowkit';
import '@rainbow-me/rainbowkit/styles.css';
import {
braveWallet,
injectedWallet,
metaMaskWallet,
omniWallet,
rainbowWallet,
safeWallet,
trustWallet,
valoraWallet,
walletConnectWallet,
} from '@rainbow-me/rainbowkit/wallets';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { useState } from 'react';
import 'react-toastify/dist/ReactToastify.css';
import { config, fornoRpcUrl, infuraRpcUrl } from 'src/config/config';
import { valora } from 'src/config/wallets';
import { Color } from 'src/styles/Color';
import { fallback } from 'viem';
import { celo } from 'viem/chains';
Expand All @@ -22,12 +25,15 @@ const connectors = connectorsForWallets(
{
groupName: 'Recommended for Celo',
wallets: [
valoraWallet,
metaMaskWallet,
walletConnectWallet,
valora,
rainbowWallet,
omniWallet,
trustWallet,
braveWallet,
safeWallet,
walletConnectWallet,
injectedWallet,
],
},
],
Expand Down
32 changes: 0 additions & 32 deletions src/config/wallets.ts

This file was deleted.

5 changes: 4 additions & 1 deletion src/features/validators/useGroupRewardHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ async function fetchValidatorGroupRewardHistory(
// Estimates are sufficient for this purpose
// The alternative is to query for each block's details to get the timestamp
// but that was causing problems for Infura. Batch requests also did not work.
function estimateBlockTimestamp(blockNumber: number, latestBlock: Block) {
function estimateBlockTimestamp(
blockNumber: number,
latestBlock: Pick<Block, 'number' | 'timestamp'>,
) {
const latestNumber = Number(latestBlock.number);
const latestTimestamp = Number(latestBlock.timestamp) * 1000;
const timeDifference = (latestNumber - blockNumber) * AVG_BLOCK_TIMES_MS;
Expand Down
Loading

0 comments on commit 6ef712d

Please sign in to comment.