Skip to content

Commit

Permalink
Merge pull request #17 from superfluid-finance/update-deps
Browse files Browse the repository at this point in the history
update deps & remove unnecessary ones
  • Loading branch information
d10r authored Feb 22, 2024
2 parents 2f2cc2c + e513280 commit f2d238e
Show file tree
Hide file tree
Showing 6 changed files with 1,442 additions and 1,216 deletions.
33 changes: 12 additions & 21 deletions toga-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,25 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@apollo/client": "^3.7.15",
"@rainbow-me/rainbowkit": "^1.0.2",
"@safe-global/safe-apps-sdk": "^7.11.0",
"@safe-global/safe-apps-web3modal": "^19.0.2",
"@apollo/client": "^3.9.5",
"@rainbow-me/rainbowkit": "^1.3.6",
"@superfluid-finance/metadata": "^1.1.28",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@walletconnect/ethereum-provider": "^2.8.1",
"@walletconnect/modal": "^2.4.7",
"dotenv": "^16.3.1",
"ethers": "^5.5.2",
"graphql": "^16.0.1",
"ethers": "^5.7.2",
"graphql": "^16.8.1",
"lodash": "^4.17.21",
"memoizee": "^0.4.15",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "^5.0.1",
"react-select": "^5.2.1",
"react-table": "^7.7.0",
"styled-components": "^5.3.3",
"viem": "^1.1.1",
"wagmi": "^1.3.9",
"web3modal": "^1.9.12"
"react-select": "^5.8.0",
"react-table": "^7.8.0",
"styled-components": "^5.3.11",
"viem": "^1.21.4",
"wagmi": "^1.4.13"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11"
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"dotenv": "^16.4.5"
},
"scripts": {
"start": "react-scripts start",
Expand All @@ -39,8 +31,7 @@
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
"react-app"
]
},
"browserslist": {
Expand Down
91 changes: 42 additions & 49 deletions toga-dashboard/src/components/wallet/getAppWallets.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,43 @@
import { connectorsForWallets } from '@rainbow-me/rainbowkit';
import {
connectorsForWallets,
} from "@rainbow-me/rainbowkit";
import {
metaMaskWallet,
braveWallet,
walletConnectWallet,
coinbaseWallet,
rainbowWallet,
} from "@rainbow-me/rainbowkit/wallets";
import gnosisSafe from "./gnosisSafeWalletConnector/gnosisSafe";
import mockConnector from "./mockConnector/mockConnector";
import { namedInjectedWallet } from "./namedInjectedWallet/namedInjectedWallet";

// Inspired by: https://github.com/rainbow-me/rainbowkit/blob/main/packages/rainbowkit/src/wallets/getDefaultWallets.ts
export const getAppWallets = ({
appName,
chains,
projectId,
}) => {
const needsMock =
typeof window !== "undefined" &&
typeof (window).mockSigner !== "undefined";

const wallets = [
{
groupName: "Popular",
wallets: [
namedInjectedWallet({ chains, shimDisconnect: true }),
gnosisSafe({ chains, projectId}),
braveWallet({ chains, shimDisconnect: true }),
metaMaskWallet({
chains,
shimDisconnect: true,
projectId: projectId
}),
walletConnectWallet({ chains, projectId, showQrModal: true }),
coinbaseWallet({ appName, chains }),
rainbowWallet( { chains, projectId }),
...(needsMock ? [mockConnector({ chains })] : []),
],
},
];

return {
connectors: connectorsForWallets(wallets),
wallets,
};
};

metaMaskWallet,
braveWallet,
walletConnectWallet,
coinbaseWallet,
rainbowWallet,
} from '@rainbow-me/rainbowkit/wallets';
import gnosisSafe from './gnosisSafeWalletConnector/gnosisSafe';
import mockConnector from './mockConnector/mockConnector';
import { namedInjectedWallet } from './namedInjectedWallet/namedInjectedWallet';

// Inspired by: https://github.com/rainbow-me/rainbowkit/blob/main/packages/rainbowkit/src/wallets/getDefaultWallets.ts
export const getAppWallets = ({ appName, chains, projectId }) => {
const needsMock =
typeof window !== 'undefined' &&
typeof window.mockSigner !== 'undefined';

const wallets = [
{
groupName: 'Popular',
wallets: [
namedInjectedWallet({ chains, shimDisconnect: true }),
gnosisSafe({ chains, projectId }),
braveWallet({ chains, shimDisconnect: true }),
metaMaskWallet({
chains,
shimDisconnect: true,
projectId: projectId,
}),
walletConnectWallet({ chains, projectId, showQrModal: true }),
coinbaseWallet({ appName, chains }),
rainbowWallet({ chains, projectId }),
...(needsMock ? [mockConnector({ chains })] : []),
],
},
];

return {
connectors: connectorsForWallets(wallets)(),
wallets,
};
};
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import { SafeConnector } from "@wagmi/connectors/safe";
import { SafeConnector } from 'wagmi/connectors/safe';

const gnosisSafe = ({ chains }) => {
return {
id: "gnosis-safe",
name: "Gnosis Safe",
shortName: "Gnosis Safe",
iconUrl: "/icons/ecosystem/gnosis_safe_2019_logo_rgb_sponsor_darkblue.svg",
iconBackground: "#008168",
createConnector: () => ({
connector: new SafeConnector({
chains,
options: {
allowedDomains: [/gnosis-safe.io$/, /app.safe.global$/],
debug: false,
},
}),
}),
};
return {
id: 'gnosis-safe',
name: 'Gnosis Safe',
shortName: 'Gnosis Safe',
iconUrl:
'/icons/ecosystem/gnosis_safe_2019_logo_rgb_sponsor_darkblue.svg',
iconBackground: '#008168',
createConnector: () => ({
connector: new SafeConnector({
chains,
options: {
allowedDomains: [/gnosis-safe.io$/, /app.safe.global$/],
debug: false,
},
}),
}),
};
};

export default gnosisSafe;
11 changes: 7 additions & 4 deletions toga-dashboard/src/constants/networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ export const UNSUPPORTED = { name: 'Unsupported network' };

export const NETWORK_LIST = sfMeta.networks
.map((n) => {
const wagmiChain = Object.values(wagmiChains).find(item => item.id === n.chainId);
const wagmiChain = Object.values(wagmiChains).find(
(item) => item.id === n.chainId,
);
return {
...n,
...wagmiChain,
rpcUrls: { // merge wagmi provided rpc url's with superfluid's
rpcUrls: {
// merge wagmi provided rpc url's with superfluid's
...wagmiChain.rpcUrls,
superfluid: `https://rpc-endpoints.superfluid.dev/${n.name}`
superfluid: `https://rpc-endpoints.superfluid.dev/${n.name}`,
},
subgraphUrl: `https://${n.name}.subgraph.x.superfluid.dev`
subgraphUrl: `https://${n.name}.subgraph.x.superfluid.dev`,
};
})
.filter((n) => n.contractsV1.toga !== undefined);
Expand Down
5 changes: 0 additions & 5 deletions toga-dashboard/src/setupTests.js

This file was deleted.

Loading

0 comments on commit f2d238e

Please sign in to comment.