Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gnosis Safe Apps v1.5.0 #39

Merged
merged 7 commits into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if: (branch = master) OR (branch = development) OR (tag IS present)
language: node_js
node_js: '12'
before_install:
- yarn install
- yarn install --network-concurrency 1
# Needed to deploy pull request and releases
- pip install awscli --upgrade --user
cache:
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ headers: {
},
```

## Environments
These apps are deployed in the following environments
* When the code is merged into development: https://safe-apps.dev.gnosisdev.com
* When the code is merged into master: https://safe-apps.staging.gnosisdev.com
* When the code is released: https://apps.gnosis-safe.io

## License

Expand Down
26 changes: 26 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* config-overrides.js */

module.exports = {
// The function to use to create a webpack dev server configuration when running the development
// server with 'npm run start' or 'yarn start'.
// Example: set the dev server to use a specific certificate in https.
devServer: function(configFunction) {
// Return the replacement function for create-react-app to use to generate the Webpack
// Development Server config. "configFunction" is the function that would normally have
// been used to generate the Webpack Development server config - you can use it to create
// a starting configuration to then modify instead of having to create a config from scratch.
return function(proxy, allowedHost) {
// Create the default config by calling configFunction with the proxy/allowedHost parameters
const config = configFunction(proxy, allowedHost);

config.headers = {
"Access-Control-Allow-Origin": "\*",
"Access-Control-Allow-Methods": "GET",
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
};

// Return your customised Webpack Development Server config.
return config;
};
},
}
23 changes: 15 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,34 @@
"private": true,
"dependencies": {
"@apollo/react-hooks": "^3.1.3",
"@gnosis.pm/safe-apps-sdk": "^0.1.1",
"@gnosis.pm/safe-react-components": "^0.1.3",
"@gnosis.pm/safe-apps-sdk": "0.4.0",
"@gnosis.pm/safe-react-components": "https://github.com/gnosis/safe-react-components.git#be51ca5",
"@material-ui/core": "^4.9.0",
"@rmeissner/safe-apps-react-sdk": "^0.3.4",
dasanra marked this conversation as resolved.
Show resolved Hide resolved
"@walletconnect/client": "^1.1.0",
"apollo-boost": "^0.4.7",
"axios": "^0.19.2",
"big-number-input": "^1.0.2",
"big.js": "^5.2.2",
"date-fns": "^2.16.1",
"graphql": "^14.6.0",
"jsqr": "^1.3.1",
"lodash": "^4.17.15",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.4.1",
"styled-components": "^5.0.0",
"styled-components": "^5.2.0",
"web3": "^1.2.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-scripts eject",
"storybook": "start-storybook -p 9009 -s public --docs",
"build-storybook": "build-storybook -s public --docs"
"build-storybook": "build-storybook -s public --docs",
"ipfs-deploy": "yarn build && npx ipfs-deploy build --pinner pinata --no-open"
},
"eslintConfig": {
"extends": "react-app"
Expand Down Expand Up @@ -54,14 +59,16 @@
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"@types/big.js": "^4.0.5",
"@types/date-fns": "^2.6.0",
"@types/jest": "^24.0.0",
"@types/lodash": "^4.14.154",
"@types/node": "^12.0.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
"@types/react-router-dom": "^5.1.3",
"@types/styled-components": "^4.4.2",
"react-app-rewired": "^2.1.6",
"react-docgen-typescript-loader": "^3.7.1",
"typescript": "~3.7.2"
"typescript": "^4.0.2"
}
}
Binary file removed public/testing/gnosis.png
Binary file not shown.
5 changes: 0 additions & 5 deletions public/testing/manifest.json

This file was deleted.

6 changes: 6 additions & 0 deletions public/walletConnect/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"short_name": "WalletConnect",
"name": "WalletConnect",
"description": "Allows your Gnosis Safe Multisig to connect to dapps via WalletConnect.",
"iconPath": "walletConnect.jpg"
}
Binary file added public/walletConnect/walletConnect.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 14 additions & 9 deletions src/apps/Compound/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ export type TokenItem = {
export const web3Provider = process.env.REACT_APP_WEB3_PROVIDER_URL || "";

export const getTokenList = (network: Networks): Array<TokenItem> => {
if (network !== "rinkeby" && network !== "mainnet") {
throw Error(`Not supported Network ${network}`);
}

const tokensByNetwork = tokens[network];

if (!tokensByNetwork) {
throw Error(`No token configuration for ${network}`);
}
Expand All @@ -34,63 +39,63 @@ export const getTokenList = (network: Networks): Array<TokenItem> => {
iconUrl: daiIcon,
decimals: 18,
tokenAddr: tokensByNetwork.DAI,
cTokenAddr: tokensByNetwork.cDAI
cTokenAddr: tokensByNetwork.cDAI,
},
{
id: "BAT",
label: "BAT",
iconUrl: batIcon,
decimals: 18,
tokenAddr: tokensByNetwork.BAT,
cTokenAddr: tokensByNetwork.cBAT
cTokenAddr: tokensByNetwork.cBAT,
},
{
id: "ETH",
label: "ETH",
iconUrl: ethIcon,
decimals: 18,
tokenAddr: tokensByNetwork.ETH,
cTokenAddr: tokensByNetwork.cETH
cTokenAddr: tokensByNetwork.cETH,
},
{
id: "REP",
label: "REP",
iconUrl: repIcon,
decimals: 18,
tokenAddr: tokensByNetwork.REP,
cTokenAddr: tokensByNetwork.cREP
cTokenAddr: tokensByNetwork.cREP,
},
{
id: "USDC",
label: "USDC",
iconUrl: usdcIcon,
decimals: 6,
tokenAddr: tokensByNetwork.USDC,
cTokenAddr: tokensByNetwork.cUSDC
cTokenAddr: tokensByNetwork.cUSDC,
},
{
id: "USDT",
label: "USDT",
iconUrl: usdtIcon,
decimals: 6,
tokenAddr: tokensByNetwork.USDT,
cTokenAddr: tokensByNetwork.cUSDT
cTokenAddr: tokensByNetwork.cUSDT,
},
{
id: "WBTC",
label: "WBTC",
iconUrl: wbtcIcon,
decimals: 8,
tokenAddr: tokensByNetwork.WBTC,
cTokenAddr: tokensByNetwork.cWBTC
cTokenAddr: tokensByNetwork.cWBTC,
},
{
id: "ZRX",
label: "ZRX",
iconUrl: zrxIcon,
decimals: 18,
tokenAddr: tokensByNetwork.ZRX,
cTokenAddr: tokensByNetwork.cZRX
}
cTokenAddr: tokensByNetwork.cZRX,
},
];
};
3 changes: 2 additions & 1 deletion src/apps/Compound/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const CompoundWidget = () => {
useEffect(() => {
appsSdk.addListeners({
onSafeInfo: setSafeInfo,
onTransactionConfirmation: () => {},
});

return () => appsSdk.removeListeners();
Expand Down Expand Up @@ -278,7 +279,7 @@ const CompoundWidget = () => {
const txs = [
{
to: selectedToken.cTokenAddr,
value: 0,
value: "0",
data: cTokenInstance.methods
.redeemUnderlying(supplyParameter)
.encodeABI(),
Expand Down
7 changes: 6 additions & 1 deletion src/apps/Compound/tokensTransfers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const rinkeby =
"https://api.thegraph.com/subgraphs/name/protofire/token-registry-rinkeby";
const mainnet =
"https://api.thegraph.com/subgraphs/name/protofire/token-registry";
const subgraphUri: { [key in Networks]: string } = {

const subgraphUri: { [key in "mainnet" | "rinkeby"]: string } = {
rinkeby,
mainnet,
};
Expand Down Expand Up @@ -137,6 +138,10 @@ export async function getTokenInteractions(
tokenAddr: string,
cTokenAddr: string
) {
if (network !== "rinkeby" && network !== "mainnet") {
return [];
}

const client = new ApolloClient({
uri: subgraphUri[network],
});
Expand Down
28 changes: 0 additions & 28 deletions src/apps/Testing/index.tsx

This file was deleted.

Loading