Skip to content

Commit

Permalink
fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
SrikanthSoparla committed Aug 5, 2024
2 parents f9a9716 + b0c6d1c commit 85cd475
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 79 deletions.
47 changes: 27 additions & 20 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
<!DOCTYPE html>
<html lang="en">

<head>
<title>Fetch | OmniFlix inSync</title>
<meta charset="utf-8">
<meta content="#000000" name="theme-color">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="yes" name="mobile-web-app-capable">
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport'/>
<meta content="OmniFlix, OmniFlix Network, OmniFlix for Communities, OmniFlix insync, omniflix, Cosmos DAOs, Cosmos SDK DAO, Decentralized Autonomous Organizations, web3, cosmos, blockchain, tendermint, staking app, FLIX, Fetch staking, Fetch proposals, Fetch voting, Fetch OmniFlix inSync, Fetch inSync, Fetch, FET, FET staking, Fetch multi-send, Fetch multisend, FET multi-send, FET multisend, Fetch multisig, FET multisig"
name="keywords">
<meta content="Fetch | OmniFlix inSync (for Communities) is a solution for sovereign communities and blockchain networks (built with the Cosmos SDK) to participate in activities such as staking of voting power and voting on governance proposals."
name="description">
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<meta
content="OmniFlix, OmniFlix Network, OmniFlix for Communities, OmniFlix insync, omniflix, Cosmos DAOs, Cosmos SDK DAO, Decentralized Autonomous Organizations, web3, cosmos, blockchain, tendermint, staking app, FLIX, Fetch staking, Fetch proposals, Fetch voting, Fetch OmniFlix inSync, Fetch inSync, Fetch, FET, FET staking, Fetch multi-send, Fetch multisend, FET multi-send, FET multisend, Fetch multisig, FET multisig"
name="keywords">
<meta
content="Fetch | OmniFlix inSync (for Communities) is a solution for sovereign communities and blockchain networks (built with the Cosmos SDK) to participate in activities such as staking of voting power and voting on governance proposals."
name="description">
<meta content="Fetch | OmniFlix inSync" property="og:site_name">
<meta content="https://fetch.omniflix.co" property="og:url">
<meta content="https://fetch.omniflix.co" property="al:web:url">
<meta content="https://fetch.omniflix.co/assets/logos/og_image.png" property="og:image">
<meta content="1280" property="og:image:width"/>
<meta content="720" property="og:image:height"/>
<meta content="Fetch | OmniFlix inSync" property="og:image:alt"/>
<meta content="1280" property="og:image:width" />
<meta content="720" property="og:image:height" />
<meta content="Fetch | OmniFlix inSync" property="og:image:alt" />
<meta content="Fetch | OmniFlix inSync" property="og:title">
<meta content="Fetch | OmniFlix inSync (for Communities) is a solution for sovereign communities and blockchain networks (built with the Cosmos SDK) to participate in activities such as staking of voting power and voting on governance proposals."
property="og:description"/>
<meta content="website" property="og:type"/>
<meta
content="Fetch | OmniFlix inSync (for Communities) is a solution for sovereign communities and blockchain networks (built with the Cosmos SDK) to participate in activities such as staking of voting power and voting on governance proposals."
property="og:description" />
<meta content="website" property="og:type" />

<meta content="summary_large_image" property="twitter:card"/>
<meta content="summary_large_image" property="twitter:card" />

<!-- Twitter open-graph tags -->
<meta content="summary_large_image" name="twitter:card">
<meta content="Fetch | OmniFlix inSync" name="twitter:image:alt">
<meta content="Fetch | OmniFlix inSync" name="twitter:title">
<meta content="Fetch | OmniFlix inSync (for Communities) is a solution for sovereign communities and blockchain networks (built with the Cosmos SDK) to participate in activities such as staking of voting power and voting on governance proposals."
name="twitter:description">
<meta
content="Fetch | OmniFlix inSync (for Communities) is a solution for sovereign communities and blockchain networks (built with the Cosmos SDK) to participate in activities such as staking of voting power and voting on governance proposals."
name="twitter:description">
<meta content="https://fetch.omniflix.co/assets/logos/og_image.png" name="twitter:image">

<link href="/manifest.json" rel="manifest">
Expand All @@ -39,14 +44,16 @@

<link href="https://fonts.gstatic.com" rel="preconnect">
<link href="https://fonts.googleapis.com/css2?family=Blinker:wght@100;200;300;400;600;700;800;900&display=swap"
rel="stylesheet">
rel="stylesheet">
</head>

<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<noscript>
You need to enable JavaScript to run this app.
</noscript>

<div id="root"></div>
<div id="root"></div>

</body>
</html>

</html>
8 changes: 4 additions & 4 deletions src/actions/accounts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const getDelegations = (address) => (dispatch) => {
},
})
.then((res) => {
dispatch(fetchDelegationsSuccess(res.data && res.data.result));
dispatch(fetchDelegationsSuccess(res.data && res.data.delegation_responses));
})
.catch((error) => {
dispatch(fetchDelegationsError(
Expand Down Expand Up @@ -107,7 +107,7 @@ export const getBalance = (address) => (dispatch) => {
},
})
.then((res) => {
dispatch(fetchBalanceSuccess(res.data && res.data.result));
dispatch(fetchBalanceSuccess(res.data && res.data.balances));
})
.catch((error) => {
dispatch(fetchBalanceError(
Expand Down Expand Up @@ -203,7 +203,7 @@ export const getUnBondingDelegations = (address) => (dispatch) => {
},
})
.then((res) => {
dispatch(fetchUnBondingDelegationsSuccess(res.data && res.data.result));
dispatch(fetchUnBondingDelegationsSuccess(res.data && res.data.unbonding_responses));
})
.catch((error) => {
dispatch(fetchUnBondingDelegationsError(
Expand Down Expand Up @@ -252,7 +252,7 @@ export const fetchRewards = (address) => (dispatch) => {
},
})
.then((res) => {
dispatch(fetchRewardsSuccess(res.data && res.data.result));
dispatch(fetchRewardsSuccess(res.data));
})
.catch((error) => {
dispatch(fetchRewardsError(
Expand Down
6 changes: 3 additions & 3 deletions src/actions/stake.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const getValidators = (cb) => (dispatch) => {
},
})
.then((res) => {
dispatch(fetchValidatorsSuccess(res.data && res.data.result));
dispatch(fetchValidatorsSuccess(res.data && res.data.validators));
cb(res.data && res.data.result);
})
.catch((error) => {
Expand Down Expand Up @@ -182,7 +182,7 @@ export const getValidatorDetails = (address, cb) => (dispatch) => {
},
})
.then((res) => {
dispatch(fetchValidatorSuccess(res.data && res.data.result));
dispatch(fetchValidatorSuccess(res.data && res.data.validators));
cb(res.data && res.data.result);
})
.catch((error) => {
Expand Down Expand Up @@ -226,7 +226,7 @@ export const getDelegatedValidatorsDetails = (address) => (dispatch) => {
},
})
.then((res) => {
dispatch(fetchDelegatedValidatorsSuccess(res.data && res.data.result));
dispatch(fetchDelegatedValidatorsSuccess(res.data && res.data.validators));
})
.catch((error) => {
dispatch(fetchDelegatedValidatorsError(
Expand Down
4 changes: 2 additions & 2 deletions src/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const config = {
RPC_URL: 'https://rpc-fetchhub.fetch.ai',
REST_URL: 'https://rest-fetchhub.fetch.ai',
RPC_URL: 'https://fetch-rpc.polkachu.com',
REST_URL: 'https://fetch-api.polkachu.com',
EXPLORER_URL: 'https://explore-fetchhub.fetch.ai',
STAKING_URL: 'https://fetch.omniflix.co/stake',
NETWORK_NAME: 'Fetch',
Expand Down
24 changes: 12 additions & 12 deletions src/constants/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import { config } from '../config';
export const REST_URL = config.REST_URL;
export const RPC_URL = config.RPC_URL;

export const urlFetchDelegations = (address) => `${REST_URL}/staking/delegators/${address}/delegations`;
export const urlFetchBalance = (address) => `${REST_URL}/bank/balances/${address}`;
export const urlFetchVestingBalance = (address) => `${REST_URL}/auth/accounts/${address}`;
export const urlFetchUnBondingDelegations = (address) => `${REST_URL}/staking/delegators/${address}/unbonding_delegations`;
export const urlFetchDelegations = (address) => `${REST_URL}/cosmos/staking/v1beta1/delegations/${address}`;
export const urlFetchBalance = (address) => `${REST_URL}/cosmos/bank/v1beta1/balances/${address}`;
export const urlFetchVestingBalance = (address) => `${REST_URL}/cosmos/auth/v1beta1/accounts/${address}`;
export const urlFetchUnBondingDelegations = (address) => `${REST_URL}/cosmos/staking/v1beta1/delegators/${address}/unbonding_delegations`;

export const urlFetchRewards = (address) => `${REST_URL}/distribution/delegators/${address}/rewards`;
export const urlFetchVoteDetails = (proposalId, address) => `${REST_URL}/gov/proposals/${proposalId}/votes/${address}`;
export const urlFetchRewards = (address) => `${REST_URL}/cosmos/distribution/v1beta1/delegators/${address}/rewards`;
export const urlFetchVoteDetails = (proposalId, address) => `${REST_URL}/cosmos/gov/v1beta1/proposals/${proposalId}/votes/${address}`;

export const VALIDATORS_LIST_URL = `${REST_URL}/staking/validators`;
export const getValidatorURL = (address) => `${REST_URL}/staking/validators/${address}`;
export const VALIDATORS_LIST_URL = `${REST_URL}/cosmos/staking/v1beta1/validators?pagination.limit=1000`;
export const getValidatorURL = (address) => `${REST_URL}/cosmos/staking/v1beta1/validators/${address}`;
export const PROPOSALS_LIST_URL = `${REST_URL}/cosmos/gov/v1beta1/proposals?pagination.limit=1000`;
export const getDelegatedValidatorsURL = (address) => `${REST_URL}/staking/delegators/${address}/validators`;
export const urlFetchProposalVotes = (id) => `${REST_URL}/gov/proposals/${id}/votes`;
export const urlFetchTallyDetails = (id) => `${REST_URL}/gov/proposals/${id}/tally`;
export const urlFetchProposalDetails = (id) => `${REST_URL}/txs?message.module=governance&submit_proposal.proposal_id=${id}`;
export const getDelegatedValidatorsURL = (address) => `${REST_URL}/cosmos/staking/v1beta1/delegators/${address}/validators`;
export const urlFetchProposalVotes = (id) => `${REST_URL}/cosmos/gov/v1beta1/proposals/${id}/votes`;
export const urlFetchTallyDetails = (id) => `${REST_URL}/cosmos/gov/v1beta1/proposals/${id}/tally`;
export const urlFetchProposalDetails = (id) => `${REST_URL}/cosmos/tx/v1beta1/txs?events=submit_proposal.proposal_id=${id}`;

export const validatorImageURL = (id) => `https://keybase.io/_/api/1.0/user/lookup.json?fields=pictures&key_suffix=${id}`;
4 changes: 2 additions & 2 deletions src/containers/Home/ClaimDialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const ClaimDialog = (props) => {
msgs: [],
fee: {
amount: [{
amount: String(gasValue * config.GAS_PRICE_STEP_AVERAGE),
amount: String(gasValue * config.GAS_PRICE_STEP_HIGH),
denom: config.COIN_MINIMAL_DENOM,
}],
gas: String(gasValue),
Expand Down Expand Up @@ -99,7 +99,7 @@ const ClaimDialog = (props) => {
},
fee: {
amount: [{
amount: String(gas.claim_reward * config.GAS_PRICE_STEP_AVERAGE),
amount: String(gas.claim_reward * config.GAS_PRICE_STEP_HIGH),
denom: config.COIN_MINIMAL_DENOM,
}],
gas: String(gas.claim_reward),
Expand Down
12 changes: 10 additions & 2 deletions src/containers/NavBar/ConnectDialog/KeplrConnectButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import variables from '../../../utils/variables';
const KeplrConnectButton = (props) => {
const [inProgress, setInProgress] = useState(false);

const initKeplr = () => {
const initKeplr = (second) => {
setInProgress(true);
initializeChain((error, addressList) => {
setInProgress(false);
Expand Down Expand Up @@ -50,14 +50,22 @@ const KeplrConnectButton = (props) => {
localStorage.setItem('of_co_address', encode(addressList[0] && addressList[0].address));
localStorage.setItem('of_co_wallet', 'keplr');
});

if (second) {
return;
}

setTimeout(() => {
initKeplr(true);
}, 5000);
};

return (
<Button
className="disconnect_button"
disabled={inProgress}
variant="contained"
onClick={initKeplr}>
onClick={() => initKeplr(false)}>
<img alt="logo" src={keplrIcon}/>
{inProgress ? variables[props.lang].connecting + '...' : variables[props.lang].keplr}
</Button>
Expand Down
11 changes: 3 additions & 8 deletions src/containers/NavBar/ConnectDialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import ConnectButton from './KeplrConnectButton';
import CosmostationConnectButton from './CosmostationConnectButton';
import GetAppRoundedIcon from '@material-ui/icons/GetAppRounded';
import insync from '../../../assets/insync.png';
import poweredBy from '../../../assets/powered_by.jpeg';
import './index.css';
import { config } from '../../../config';

const LightTooltip = withStyles((theme) => ({
tooltip: {
Expand Down Expand Up @@ -45,7 +45,7 @@ const ConnectDialog = (props) => {
</IconButton>
</LightTooltip>
</div>
<div className="button_div">
{config.COSMOSTAION && <div className="button_div">
<CosmostationConnectButton proposalTab={props.proposalTab} stake={props.stake}/>
<LightTooltip title="Download the Cosmostation Extension">
<IconButton
Expand All @@ -54,13 +54,8 @@ const ConnectDialog = (props) => {
<GetAppRoundedIcon/>
</IconButton>
</LightTooltip>
</div>
</div>}
</div>
<a className="powered_by" href="https://linktr.ee/notionaldao" rel="noopener noreferrer" target="_blank">
API/RPC powered by
<img alt="notional" src={poweredBy}/>
Notional
</a>
</DialogContent>
</Dialog>
);
Expand Down
11 changes: 5 additions & 6 deletions src/containers/Proposals/Cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@ const Cards = (props) => {
if (key === proposal.proposal_id) {
if (props.proposalDetails[key] &&
props.proposalDetails[key][0] &&
props.proposalDetails[key][0].tx &&
props.proposalDetails[key][0].tx.value &&
props.proposalDetails[key][0].tx.value.msg[0] &&
props.proposalDetails[key][0].tx.value.msg[0].value &&
props.proposalDetails[key][0].tx.value.msg[0].value.proposer) {
proposer = props.proposalDetails[key][0].tx.value.msg[0].value.proposer;
props.proposalDetails[key][0].body &&
props.proposalDetails[key][0].body.messages &&
props.proposalDetails[key][0].body.messages.length &&
props.proposalDetails[key][0].body.messages[0].proposer) {
proposer = props.proposalDetails[key][0].body.messages[0].proposer;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/containers/Proposals/ProposalDialog/Voting.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Voting = (props) => {
}],
fee: {
amount: [{
amount: String(gas.vote * config.GAS_PRICE_STEP_AVERAGE),
amount: String(gas.vote * config.GAS_PRICE_STEP_HIGH),
denom: config.COIN_MINIMAL_DENOM,
}],
gas: String(gas.vote),
Expand Down
17 changes: 10 additions & 7 deletions src/containers/Proposals/ProposalDialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ class ProposalDialog extends Component {
if (this.props.proposal && key === this.props.proposal.proposal_id) {
if (this.props.proposalDetails[key] &&
this.props.proposalDetails[key][0] &&
this.props.proposalDetails[key][0].tx &&
this.props.proposalDetails[key][0].tx.value &&
this.props.proposalDetails[key][0].tx.value.msg[0] &&
this.props.proposalDetails[key][0].tx.value.msg[0].value &&
this.props.proposalDetails[key][0].tx.value.msg[0].value.proposer) {
proposer = this.props.proposalDetails[key][0].tx.value.msg[0].value.proposer;
this.props.proposalDetails[key][0].body &&
this.props.proposalDetails[key][0].body.messages &&
this.props.proposalDetails[key][0].body.messages.length &&
this.props.proposalDetails[key][0].body.messages[0] &&
this.props.proposalDetails[key][0].body.messages[0].proposer) {
proposer = this.props.proposalDetails[key][0].body.messages[0].proposer;
}
}

Expand Down Expand Up @@ -227,7 +227,10 @@ class ProposalDialog extends Component {
<div className="pds3l_c">
<p className="pds3l_c1">Type</p>
<p className="pds3l_c2 type">{this.props.proposal && this.props.proposal.content &&
this.props.proposal.content.type}</p>
this.props.proposal.content.type
? this.props.proposal.content.type
: this.props.proposal && this.props.proposal.content && this.props.proposal.content['@type']
? this.props.proposal.content['@type'] : null}</p>
</div>
</div>
{this.props.proposal && (this.props.proposal.status === 2 ||
Expand Down
6 changes: 3 additions & 3 deletions src/containers/Proposals/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const Proposals = (props) => {

setActive(value);
setFilter(value === null ? 2
: value === 2 ? 3
: value === 3 ? 2
: value === 4 ? 4 : null);
: value === 2 ? 'PROPOSAL_STATUS_PASSED'
: value === 3 ? 'PROPOSAL_STATUS_VOTING_PERIOD'
: value === 4 ? 'PROPOSAL_STATUS_REJECTED' : null);
};
const filteredProposals = filter ? props.proposals.filter((item) => item.status === filter) : props.proposals;

Expand Down
2 changes: 1 addition & 1 deletion src/containers/Stake/DelegateDialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const DelegateDialog = (props) => {
},
fee: {
amount: [{
amount: String(gasValue * config.GAS_PRICE_STEP_AVERAGE),
amount: String(gasValue * config.GAS_PRICE_STEP_HIGH),
denom: config.COIN_MINIMAL_DENOM,
}],
gas: String(gasValue),
Expand Down
Loading

0 comments on commit 85cd475

Please sign in to comment.