Skip to content

Commit

Permalink
Merge pull request #496 from tzConnectBerlin/release/0.7.0
Browse files Browse the repository at this point in the history
Release/0.7.0
  • Loading branch information
shekhar-shubhendu authored Aug 24, 2021
2 parents 54a1b35 + e77ea53 commit 15563b3
Show file tree
Hide file tree
Showing 82 changed files with 2,319 additions and 844 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
REACT_APP_APP_NAME=Prediction Market
REACT_APP_MARKET_CONTRACT=KT18sHKbZtXhXtnf6ZrHEW9VgEe2eCvRr2CS
REACT_APP_MARKET_CONTRACT=KT1B5Jg8unLXy2kvLGDEfvbcca3hQ29d8WhF
REACT_APP_FA12_CONTRACT=KT1NRh99x6eY5Kh1DoXGmjm88aG7Te9J9pY8
REACT_APP_FA12_SYMBOL=PMM
REACT_APP_IPFS_POST_API=https://ipfs.newby.org/
REACT_APP_IPFS_GET_API=https://tzconnect.mypinata.cloud/ipfs/
REACT_APP_NETWORK_TYPE=GRANADANET
REACT_APP_RPC_URL=https://granadanet.smartpy.io
REACT_APP_RPC_PORT=443
REACT_APP_GRAPHQL_API=https://kt1lybgnsg2gymfchavcxunjecqy59ujrwbf.tzconnect.berlin/graphql
REACT_APP_GRAPHQL_API=https://bigly.newby.org/graphql
REACT_APP_SENTRY_DSN=
4 changes: 2 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import { QueryClientProvider, QueryClient } from 'react-query';
import { ThemeProvider } from '@material-ui/core';
import { Global } from '@emotion/react';
import { GlobalStyle } from '../src/assets/styles/style';
import { lightTheme as theme } from '../src/theme';
import { GlobalStyle } from '../src/styles/style';
import { lightTheme as theme } from '../src/styles/theme';
import '../src/i18n';

const queryClient = new QueryClient();
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ In the project directory, you can run:
- `yarn format` to run prettier
- `yarn analyze` to build and create a the source/dependency graph

---

## Environment variables

`.env.example` file is the example `.env` file and can be used to initialize base `.env` file required by the project.
Expand All @@ -30,8 +28,12 @@ The app uses below environment variables:
- REACT_APP_FA12_SYMBOL: FA1.2 token symbol
- REACT_APP_IPFS_POST_API: API used for [IPFS Pinning](https://github.com/tzConnectBerlin/ipfs-pinning-service)
- REACT_APP_IPFS_GET_API: IPFS Gateway URL used to fetch IPFS data.
- REACT_APP_NETWORK_TYPE: Tezos network to use. (default: FLORENCENET)
- REACT_APP_RPC_URL: Tezos node rpc url (default: https://florencenet.smartpy.com)
- REACT_APP_NETWORK_TYPE: Tezos network to use. (default: GRANADANET)
- REACT_APP_RPC_URL: Tezos node rpc url (default: https://granadanet.smartpy.io)
- REACT_APP_RPC_PORT: Tezos node rpc port (default: 443)
- REACT_APP_GRAPHQL_API: [Indexer](https://github.com/tzConnectBerlin/storage-sql) service Postgraphile URL.
- REACT_APP_SENTRY_DSN: Sentry DSN if you want to enable logging via sentry

## Assumptions

- Currently, we are not fetching contract metadata for FA1.2 contract and the project assumes that the decimals used by the FA1.2 contract is **6**
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prediction-market-ui",
"version": "0.6.1",
"version": "0.7.0",
"private": false,
"license": "MIT",
"dependencies": {
Expand All @@ -9,16 +9,16 @@
"@date-io/date-fns": "2.x",
"@emotion/react": "^11.4.0",
"@emotion/styled": "^11.3.0",
"@material-ui/core": "5.0.0-beta.3",
"@material-ui/data-grid": "^4.0.0-alpha.35",
"@material-ui/core": "5.0.0-beta.4",
"@material-ui/data-grid": "^4.0.0-alpha.37",
"@material-ui/icons": "5.0.0-beta.1",
"@material-ui/lab": "5.0.0-alpha.42",
"@material-ui/styles": "5.0.0-beta.3",
"@nivo/core": "0.73.0",
"@nivo/line": "0.73.0",
"@sentry/integrations": "^6.10.0",
"@sentry/react": "^6.10.0",
"@sentry/tracing": "^6.10.0",
"@sentry/integrations": "^6.11.0",
"@sentry/react": "^6.11.0",
"@sentry/tracing": "^6.11.0",
"@storybook/react": "^6.3.6",
"@taquito/beacon-wallet": "10.1.0",
"@taquito/michelson-encoder": "10.1.0",
Expand Down Expand Up @@ -49,11 +49,11 @@
"react-helmet-async": "^1.0.9",
"react-i18next": "^11.11.4",
"react-icons": "^4.2.0",
"react-query": "^3.19.1",
"react-query": "^3.21.0",
"react-router-dom": "^5.2.0",
"react-toast-notifications": "^2.5.1",
"yup": "^0.32.9",
"zustand": "^3.5.7"
"zustand": "^3.5.9"
},
"scripts": {
"start": "node scripts/start.js",
Expand Down Expand Up @@ -91,10 +91,10 @@
"@commitlint/config-conventional": "^13.1.0",
"@emotion/jest": "^11.3.0",
"@pmmmwh/react-refresh-webpack-plugin": "0.4.3",
"@storybook/addon-actions": "^6.3.6",
"@storybook/addon-essentials": "^6.3.6",
"@storybook/addon-links": "^6.3.6",
"@storybook/node-logger": "^6.3.6",
"@storybook/addon-actions": "^6.3.7",
"@storybook/addon-essentials": "^6.3.7",
"@storybook/addon-links": "^6.3.7",
"@storybook/node-logger": "^6.3.7",
"@svgr/webpack": "5.5.0",
"@testing-library/dom": "^8.1.0",
"@testing-library/jest-dom": "^5.14.1",
Expand Down
File renamed without changes
27 changes: 23 additions & 4 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@
"No": "No",
"executionDeadline": "Execution deadline",
"price": "Price",
"value": "Value",
"totalValue": "Total Value",
"currentPosition": "Current Position",
"expectedPosition": "Expected Position",
"onlyTokenHolders": "Only token holders can sell.",
"withdrawValue": "Withdrawn Value",
"expectedAdjustedPosition": "Expected Adjusted Position",
"quantity": "Quantity",
"amount": "Amount",
"token": "Token",
"yesTokens": "Yes Tokens",
"noTokens": "No Tokens",
"outcome": "Outcome",
"resolution": "Resolution",
"resolvedOn": "Resolved on",
Expand Down Expand Up @@ -93,6 +95,9 @@
"sell": "Sell",
"addLiquidity": "Add Liquidity",
"removeLiquidity": "Remove Liquidity",
"liquidityTokens": "Liquidity Tokens",
"addTez": "Add Tez",
"stakeInPool": "Stake in Pool",
"closed": "Closed",
"open": "Open",
"active": "Active",
Expand All @@ -102,7 +107,7 @@
"txSubmitted": "Transaction Submitted",
"createMarketSuccess": "Your market should be live in a couple of minutes.",
"txFailed": "Transaction Failed",
"volume": "Liquidity",
"liquidity": "Liquidity",
"deadLine": "Deadline",
"maxSlippage": "Max Slippage",
"mins": "mins",
Expand All @@ -114,6 +119,11 @@
"expectedPrice": "Expected price",
"refreshPrices": "Refresh Prices",
"maxAmount": "Max. Amount",
"currentPosition": "Current Position",
"adjustedBalance": "Expected Adjusted Balance",
"adjustedStake": "Expected Adjusted Stake",
"expectedBalance": "Expected Balance",
"expectedStake": "Expected Stake",
"footerText": "This application is for informational and educational purposes only. No entity takes custody of anyone's money or cryptocurrency, extracts profits, hosts or manages markets. This user interface displays existing markets on the Tezos blockchain and allows for interaction with relevant smart contacts.",
"footerTextSecond": "From then on the market operates in a standard way–each token will pay out to one or zero coins,depending upon which way events transpire. A 5% fee on winnings rewards participants in the investment phase, and those who have contributed liquidity to the market during its operation.",
"resolutionDetails": "Resolution Details and Background",
Expand All @@ -123,5 +133,14 @@
"closeAuction": "Pre-trading has reached its expected end date.",
"openMarketToTrade": "Open Market to Trading",
"closeMarket": "Close Market",
"requiredField": "* Required fields"
"requiredField": "* Required fields",
"tradingPosition": "Trading Position",
"liquidityPosition": "Liquidity Position",
"totalPositions": "Total Value",
"yourPositions": "Your Positions",
"probability": "Probability",
"contribution": "Contribution",
"insufficientTokens": "Insufficient {{token}} Tokens",
"minQuantity": "Minimum allowed quantity is {{quantity}}",
"invalidAddress": "Invalid Address"
}
8 changes: 8 additions & 0 deletions public/locales/en/create-market.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,13 @@
"label": "Pre-Trading Phase",
"subtitle": "Users can provide liquidity to the market during this phase, setting the number of yes and no tokens in the pool by selecting a specific probability of the market resolving to yes. As the market creator, you are the initial liquidity provider for your market."
}
},
"validations": {
"minCharacters": "Min. {{min}} characters required.",
"maxCharacters": "Max. {{max}} characters allowed.",
"maxTicker": "Max. ticker size {{max}}.",
"initialContribution": "Initial Contribution must be minimum {{initialContrib}}.",
"minAllowed": "Min. allowed {{min}}.",
"maxAllowed": "Min. allowed {{max}}."
}
}
3 changes: 2 additions & 1 deletion public/locales/en/portfolio.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"total": "Total Value",
"trading": "Trading Positions",
"liquidity": "Liquidity Positions",
"rewards": "Accumulated Rewards"
"rewards": "Accumulated Rewards",
"resolved": "RESOLVED: {{status}}"
}
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
32 changes: 19 additions & 13 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,49 @@ import { ReactQueryDevtools } from 'react-query/devtools';
import { ThemeProvider } from '@material-ui/core';
import { Global } from '@emotion/react';
import { WalletProvider } from '@tezos-contrib/react-wallet-provider';
import { GlobalStyle } from './assets/styles/style';
import { lightTheme } from './theme';
import { GlobalStyle } from './styles/style';
import { lightTheme } from './styles/theme';
import { AppRouter } from './router';
import { initTezos, initMarketContract, initFA12Contract } from './contracts/Market';
import {
RPC_URL,
RPC_PORT,
MARKET_ADDRESS,
FA12_CONTRACT,
NETWORK,
APP_NAME,
} from './utils/globals';
import { RPC_URL, RPC_PORT, MARKET_ADDRESS, FA12_CONTRACT, NETWORK, APP_NAME } from './globals';
import { Loading } from './design-system/atoms/Loading';
import { tzStatsBlockExplorer } from './utils/TzStatsBlockExplorer';
import { useStore } from './store/store';
import { getSavedSettings } from './utils/misc';
import { SettingValues } from './interfaces';

const queryClient = new QueryClient({
defaultOptions: {
queries: { refetchInterval: 1000 * 30, staleTime: 1000 * 30 },
},
});

const defaultSettings: SettingValues = {
deadline: 30,
maxSlippage: 5,
};

const App: React.FC = () => {
const [theme] = React.useState(lightTheme);
const { setSettings } = useStore();

useEffect(() => {
initTezos(RPC_URL, RPC_PORT);
initMarketContract(MARKET_ADDRESS);
initFA12Contract(FA12_CONTRACT);
const settings = getSavedSettings();
setSettings(
settings?.maxSlippage ?? defaultSettings.maxSlippage,
settings?.deadline ?? defaultSettings.deadline,
);
}, []);

return (
<Suspense fallback={<Loading />}>
<HelmetProvider>
<QueryClientProvider client={queryClient}>
<LocalizationProvider dateAdapter={DateFnsUtils}>
<Global styles={GlobalStyle(theme)} />
<ThemeProvider theme={theme}>
<Global styles={GlobalStyle(lightTheme)} />
<ThemeProvider theme={lightTheme}>
<ToastProvider placement="bottom-right">
<WalletProvider
name={APP_NAME}
Expand Down
Loading

1 comment on commit 15563b3

@vercel
Copy link

@vercel vercel bot commented on 15563b3 Aug 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.