Skip to content

Commit ea5bc45

Browse files
committedMar 3, 2025·
cosmos v46 updates.
2 parents f526b44 + b0c6d1c commit ea5bc45

File tree

13 files changed

+58
-57
lines changed

13 files changed

+58
-57
lines changed
 

‎src/actions/accounts/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const getDelegations = (address) => (dispatch) => {
6565
},
6666
})
6767
.then((res) => {
68-
dispatch(fetchDelegationsSuccess(res.data && res.data.result));
68+
dispatch(fetchDelegationsSuccess(res.data && res.data.delegation_responses));
6969
})
7070
.catch((error) => {
7171
dispatch(fetchDelegationsError(
@@ -107,7 +107,7 @@ export const getBalance = (address) => (dispatch) => {
107107
},
108108
})
109109
.then((res) => {
110-
dispatch(fetchBalanceSuccess(res.data && res.data.result));
110+
dispatch(fetchBalanceSuccess(res.data && res.data.balances));
111111
})
112112
.catch((error) => {
113113
dispatch(fetchBalanceError(
@@ -203,7 +203,7 @@ export const getUnBondingDelegations = (address) => (dispatch) => {
203203
},
204204
})
205205
.then((res) => {
206-
dispatch(fetchUnBondingDelegationsSuccess(res.data && res.data.result));
206+
dispatch(fetchUnBondingDelegationsSuccess(res.data && res.data.unbonding_responses));
207207
})
208208
.catch((error) => {
209209
dispatch(fetchUnBondingDelegationsError(
@@ -252,7 +252,7 @@ export const fetchRewards = (address) => (dispatch) => {
252252
},
253253
})
254254
.then((res) => {
255-
dispatch(fetchRewardsSuccess(res.data && res.data.result));
255+
dispatch(fetchRewardsSuccess(res.data));
256256
})
257257
.catch((error) => {
258258
dispatch(fetchRewardsError(

‎src/actions/stake.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const getValidators = (cb) => (dispatch) => {
5959
},
6060
})
6161
.then((res) => {
62-
dispatch(fetchValidatorsSuccess(res.data && res.data.result));
62+
dispatch(fetchValidatorsSuccess(res.data && res.data.validators));
6363
cb(res.data && res.data.result);
6464
})
6565
.catch((error) => {
@@ -182,7 +182,7 @@ export const getValidatorDetails = (address, cb) => (dispatch) => {
182182
},
183183
})
184184
.then((res) => {
185-
dispatch(fetchValidatorSuccess(res.data && res.data.result));
185+
dispatch(fetchValidatorSuccess(res.data && res.data.validators));
186186
cb(res.data && res.data.result);
187187
})
188188
.catch((error) => {
@@ -226,7 +226,7 @@ export const getDelegatedValidatorsDetails = (address) => (dispatch) => {
226226
},
227227
})
228228
.then((res) => {
229-
dispatch(fetchDelegatedValidatorsSuccess(res.data && res.data.result));
229+
dispatch(fetchDelegatedValidatorsSuccess(res.data && res.data.validators));
230230
})
231231
.catch((error) => {
232232
dispatch(fetchDelegatedValidatorsError(

‎src/config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const config = {
2-
RPC_URL: 'https://rpc-osmosis-ia.cosmosia.notional.ventures',
3-
REST_URL: 'https://api-osmosis-ia.cosmosia.notional.ventures',
2+
RPC_URL: 'https://rpc.osmosis.zone',
3+
REST_URL: 'https://lcd.osmosis.zone',
44
EXPLORER_URL: 'https://www.mintscan.io/osmosis',
55
STAKING_URL: 'https://osmosis.omniflix.co/stake',
66
NETWORK_NAME: 'Osmosis',

‎src/constants/url.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ import { config } from '../config';
33
export const REST_URL = config.REST_URL;
44
export const RPC_URL = config.RPC_URL;
55

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

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

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

2222
export const validatorImageURL = (id) => `https://keybase.io/_/api/1.0/user/lookup.json?fields=pictures&key_suffix=${id}`;

‎src/containers/Home/ClaimDialog/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const ClaimDialog = (props) => {
3333
msgs: [],
3434
fee: {
3535
amount: [{
36-
amount: String(gasValue * config.GAS_PRICE_STEP_AVERAGE),
36+
amount: String(gasValue * config.GAS_PRICE_STEP_HIGH),
3737
denom: config.COIN_MINIMAL_DENOM,
3838
}],
3939
gas: String(gasValue),
@@ -99,7 +99,7 @@ const ClaimDialog = (props) => {
9999
},
100100
fee: {
101101
amount: [{
102-
amount: String(gas.claim_reward * config.GAS_PRICE_STEP_AVERAGE),
102+
amount: String(gas.claim_reward * config.GAS_PRICE_STEP_HIGH),
103103
denom: config.COIN_MINIMAL_DENOM,
104104
}],
105105
gas: String(gas.claim_reward),

‎src/containers/NavBar/ConnectDialog/index.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import ConnectButton from './KeplrConnectButton';
99
import CosmostationConnectButton from './CosmostationConnectButton';
1010
import GetAppRoundedIcon from '@material-ui/icons/GetAppRounded';
1111
import insync from '../../../assets/insync.png';
12-
import poweredBy from '../../../assets/powered_by.jpeg';
1312
import './index.css';
13+
import { config } from '../../../config';
1414

1515
const LightTooltip = withStyles((theme) => ({
1616
tooltip: {
@@ -45,7 +45,7 @@ const ConnectDialog = (props) => {
4545
</IconButton>
4646
</LightTooltip>
4747
</div>
48-
<div className="button_div">
48+
{config.COSMOSTAION && <div className="button_div">
4949
<CosmostationConnectButton proposalTab={props.proposalTab} stake={props.stake}/>
5050
<LightTooltip title="Download the Cosmostation Extension">
5151
<IconButton
@@ -54,13 +54,8 @@ const ConnectDialog = (props) => {
5454
<GetAppRoundedIcon/>
5555
</IconButton>
5656
</LightTooltip>
57-
</div>
57+
</div>}
5858
</div>
59-
<a className="powered_by" href="https://linktr.ee/notionaldao" rel="noopener noreferrer" target="_blank">
60-
API/RPC powered by
61-
<img alt="notional" src={poweredBy}/>
62-
Notional
63-
</a>
6459
</DialogContent>
6560
</Dialog>
6661
);

‎src/containers/Proposals/Cards.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,11 @@ const Cards = (props) => {
7070
if (key === proposal.proposal_id) {
7171
if (props.proposalDetails[key] &&
7272
props.proposalDetails[key][0] &&
73-
props.proposalDetails[key][0].tx &&
74-
props.proposalDetails[key][0].tx.value &&
75-
props.proposalDetails[key][0].tx.value.msg[0] &&
76-
props.proposalDetails[key][0].tx.value.msg[0].value &&
77-
props.proposalDetails[key][0].tx.value.msg[0].value.proposer) {
78-
proposer = props.proposalDetails[key][0].tx.value.msg[0].value.proposer;
73+
props.proposalDetails[key][0].body &&
74+
props.proposalDetails[key][0].body.messages &&
75+
props.proposalDetails[key][0].body.messages.length &&
76+
props.proposalDetails[key][0].body.messages[0].proposer) {
77+
proposer = props.proposalDetails[key][0].body.messages[0].proposer;
7978
}
8079
}
8180

‎src/containers/Proposals/ProposalDialog/Voting.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const Voting = (props) => {
5555
}],
5656
fee: {
5757
amount: [{
58-
amount: String(gas.vote * config.GAS_PRICE_STEP_AVERAGE),
58+
amount: String(gas.vote * config.GAS_PRICE_STEP_HIGH),
5959
denom: config.COIN_MINIMAL_DENOM,
6060
}],
6161
gas: String(gas.vote),

‎src/containers/Proposals/ProposalDialog/index.js

+11-8
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ class ProposalDialog extends Component {
108108
if (this.props.proposal && key === this.props.proposal.proposal_id) {
109109
if (this.props.proposalDetails[key] &&
110110
this.props.proposalDetails[key][0] &&
111-
this.props.proposalDetails[key][0].tx &&
112-
this.props.proposalDetails[key][0].tx.value &&
113-
this.props.proposalDetails[key][0].tx.value.msg[0] &&
114-
this.props.proposalDetails[key][0].tx.value.msg[0].value &&
115-
this.props.proposalDetails[key][0].tx.value.msg[0].value.proposer) {
116-
proposer = this.props.proposalDetails[key][0].tx.value.msg[0].value.proposer;
111+
this.props.proposalDetails[key][0].body &&
112+
this.props.proposalDetails[key][0].body.messages &&
113+
this.props.proposalDetails[key][0].body.messages.length &&
114+
this.props.proposalDetails[key][0].body.messages[0] &&
115+
this.props.proposalDetails[key][0].body.messages[0].proposer) {
116+
proposer = this.props.proposalDetails[key][0].body.messages[0].proposer;
117117
}
118118
}
119119

@@ -205,7 +205,7 @@ class ProposalDialog extends Component {
205205
<p className="pds3l_c1">Voting Status</p>
206206
<div className={ClassNames('pds3l_c2 vote_details',
207207
this.props.proposal && (this.props.proposal.status === 2 ||
208-
this.props.proposal.status === 'PROPOSAL_STATUS_VOTING_PERIOD') ? 'vote_in_progress' : '')}>
208+
this.props.proposal.status === 'PROPOSAL_STATUS_VOTING_PERIOD') ? 'vote_in_progress' : '')}>
209209
<div className="yes">
210210
<span/>
211211
<p>YES ({this.VoteCalculation('yes')})</p>
@@ -227,7 +227,10 @@ class ProposalDialog extends Component {
227227
<div className="pds3l_c">
228228
<p className="pds3l_c1">Type</p>
229229
<p className="pds3l_c2 type">{this.props.proposal && this.props.proposal.content &&
230-
this.props.proposal.content.type}</p>
230+
this.props.proposal.content.type
231+
? this.props.proposal.content.type
232+
: this.props.proposal && this.props.proposal.content && this.props.proposal.content['@type']
233+
? this.props.proposal.content['@type'] : null}</p>
231234
</div>
232235
</div>
233236
{this.props.proposal && (this.props.proposal.status === 2 ||

‎src/containers/Proposals/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ const Proposals = (props) => {
2222

2323
setActive(value);
2424
setFilter(value === null ? 2
25-
: value === 2 ? 3
26-
: value === 3 ? 2
27-
: value === 4 ? 4 : null);
25+
: value === 2 ? 'PROPOSAL_STATUS_PASSED'
26+
: value === 3 ? 'PROPOSAL_STATUS_VOTING_PERIOD'
27+
: value === 4 ? 'PROPOSAL_STATUS_REJECTED' : null);
2828
};
2929
const filteredProposals = filter ? props.proposals.filter((item) => item.status === filter) : props.proposals;
3030

‎src/containers/Stake/DelegateDialog/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const DelegateDialog = (props) => {
4848
},
4949
fee: {
5050
amount: [{
51-
amount: String(gasValue * config.GAS_PRICE_STEP_AVERAGE),
51+
amount: String(gasValue * config.GAS_PRICE_STEP_HIGH),
5252
denom: config.COIN_MINIMAL_DENOM,
5353
}],
5454
gas: String(gasValue),

‎src/containers/Stake/Table.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,16 @@ class Table extends Component {
6666
customBodyRender: (value) => (
6767
<div
6868
className={classNames('status', value.jailed ? 'red_status' : '')}
69-
title={value.status === 1 ? 'unbonded'
70-
: value.status === 2 ? 'unbonding'
71-
: value.status === 3 ? 'active' : ''}>
72-
{value.status === 1 ? 'unbonded'
73-
: value.status === 2 ? 'unbonding'
74-
: value.status === 3 ? 'active' : ''}
69+
title={value.status === 'BOND_STATUS_UNBONDED' ? 'unbonded'
70+
: value.status === 'BOND_STATUS_UNBONDING' ? 'unbonding'
71+
: value.status === 'BOND_STATUS_BONDED' ? 'active'
72+
: value.status === 'BOND_STATUS_UNSPECIFIED' ? 'invalid'
73+
: ''}>
74+
{value.status === 'BOND_STATUS_UNBONDED' ? 'unbonded'
75+
: value.status === 'BOND_STATUS_UNBONDING' ? 'unbonding'
76+
: value.status === 'BOND_STATUS_BONDED' ? 'active'
77+
: value.status === 'BOND_STATUS_UNSPECIFIED' ? 'invalid'
78+
: ''}
7579
</div>
7680
),
7781
},

‎src/helper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const chainConfig = {
2424
coinGeckoId,
2525
},
2626
bip44: {
27-
coinType: 118,
27+
coinType: config.COIN_TYPE,
2828
},
2929
bech32Config: {
3030
bech32PrefixAccAddr: `${prefix}`,

0 commit comments

Comments
 (0)
Please sign in to comment.