Skip to content

Commit

Permalink
Merge pull request #147 from CudoVentures/cudos-dev
Browse files Browse the repository at this point in the history
Cudos dev
  • Loading branch information
mlukanova authored Feb 16, 2023
2 parents 47ca8b4 + ae4c239 commit 251d727
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# LOCAL
VITE_APP_LOCAL_CAPTCHA_SITE_KEY=''
VITE_APP_LOCAL_FAUCET_URL=''
VITE_APP_LOCAL_FAUCET_ADDRESS=''
VITE_APP_LOCAL_BRIDGE_URL=''
VITE_APP_LOCAL_GRAPHQL_URL=''
Expand All @@ -11,8 +12,23 @@ VITE_APP_LOCAL_STAKING_URL=''
VITE_APP_LOCAL_CHAIN_NAME=''
VITE_APP_LOCAL_CHAIN_ID=''

# DEV
VITE_APP_DEV_CAPTCHA_SITE_KEY=''
VITE_APP_DEV_FAUCET_URL=''
VITE_APP_DEV_FAUCET_ADDRESS=''
VITE_APP_DEV_BRIDGE_URL=''
VITE_APP_DEV_GRAPHQL_URL=''
VITE_APP_DEV_GRAPHQL_WS=''
VITE_APP_DEV_RPC=''
VITE_APP_DEV_API=''
VITE_APP_DEV_EXPLORER_URL=''
VITE_APP_DEV_STAKING_URL=''
VITE_APP_DEV_CHAIN_NAME=''
VITE_APP_DEV_CHAIN_ID=''

# PRIVATE
VITE_APP_PRIVATE_CAPTCHA_SITE_KEY=''
VITE_APP_PRIVATE_FAUCET_URL=''
VITE_APP_PRIVATE_FAUCET_ADDRESS=''
VITE_APP_PRIVATE_BRIDGE_URL=''
VITE_APP_PRIVATE_GRAPHQL_URL=''
Expand All @@ -26,6 +42,7 @@ VITE_APP_PRIVATE_CHAIN_ID=''

# PUBLIC
VITE_APP_PUBLIC_CAPTCHA_SITE_KEY=''
VITE_APP_PUBLIC_FAUCET_URL=''
VITE_APP_PUBLIC_FAUCET_ADDRESS=''
VITE_APP_PUBLIC_BRIDGE_URL=''
VITE_APP_PUBLIC_GRAPHQL_UR=''
Expand Down
4 changes: 2 additions & 2 deletions src/api/getFaucetTokens.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import axios from 'axios'

const getFaucetTokens = async (faucetAddress: string, data: {
const getFaucetTokens = async (faucedUrl: string, data: {
address: string
coins: Array<string>
captchaResponse: string
}) => {
return axios.post(faucetAddress, data)
return axios.post(faucedUrl, data)
}

export default getFaucetTokens
2 changes: 1 addition & 1 deletion src/containers/Faucet/components/Form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const Form = () => {
handleModal({ open: true, status: ModalStatus.LOADING })

const response = await getFaucetTokens(
CHAIN_DETAILS.FAUCET_ADDRESS[chosenNetwork as keyof typeof CHAIN_DETAILS.FAUCET_ADDRESS],
CHAIN_DETAILS.FAUCET_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.FAUCET_URL],
data
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ import { CHAIN_DETAILS } from 'utils/constants'
import { COLORS_DARK_THEME } from 'theme/colors'
import Markdown from 'components/Markdown'
import { styles } from '../../../styles'
import { Fragment } from 'react'

interface Change {
key: string;
value: string;
subspace: string;
}

const ProposalInformation = () => {
const { overview } = useSelector((state: RootState) => state.proposalDetails)
Expand All @@ -29,7 +36,6 @@ const ProposalInformation = () => {
)
}

console.log(overview.description)
return (
<Card>
<Box sx={{ position: 'relative' }}>
Expand Down Expand Up @@ -190,6 +196,35 @@ const ProposalInformation = () => {
</Box>
</Box>
</Box>
<Box sx={{ display: 'grid', margin: '20px 0px 10px 50px' }}>
<Typography fontSize={14} sx={{ gridColumn: 1, gridRow: 1 }}>
Changes
</Typography>
<Typography variant='subtitle2' color={'text.secondary'} sx={{ gridColumn: 2, gridRow: 2 }} >
Subspace
</Typography>
<Typography variant='subtitle2' color={'text.secondary'} sx={{ gridColumn: 3, gridRow: 2 }} >
Key
</Typography>
<Typography variant='subtitle2' color={'text.secondary'} sx={{ gridColumn: 4, gridRow: 2 }} >
Value
</Typography>
{overview.content.changes?.map((item: Change, idx: number) => {
return (
<Fragment>
<Typography variant='subtitle2' sx={{ gridColumn: 2, gridRow: idx + 3 }} >
{item.subspace}
</Typography>
<Typography variant='subtitle2' sx={{ gridColumn: 3, gridRow: idx + 3 }} >
{item.key}
</Typography>
<Typography variant='subtitle2' sx={{ gridColumn: 4, gridRow: idx + 3 }} >
{item.value}
</Typography>
</Fragment>
)
})}
</Box>
<Divider
sx={{
width: '92%',
Expand Down
87 changes: 85 additions & 2 deletions src/ledgers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ const colors = {
cosmwasm: '#212c6f',
gravity: '#469990',
cudosNft: '#ff1493',
cudosAdmin: '#535da8'
cudosAdmin: '#535da8',
marketplace: '#BA0086',
addressbook: '#FF720C'
}

export const defaultMessages = {
Expand Down Expand Up @@ -440,7 +442,88 @@ export const defaultMessages = {
typeUrl: 'gravity.v1.MsgValsetUpdatedClaim',
color: colors.gravity,
displayName: 'Valset Updated Claim'
}
},
// ========================
// marketplace
// ========================
'/cudoventures.cudosnode.marketplace.MsgRemoveAdmin': {
typeUrl: 'cudoventures.cudosnode.marketplace.MsgRemoveAdmin',
color: colors.marketplace,
displayName: 'Remove Marketplace Admin'
},
'/cudoventures.cudosnode.marketplace.MsgBuyNft': {
typeUrl: 'cudoventures.cudosnode.marketplace.MsgBuyNft',
color: colors.marketplace,
displayName: 'Buy NFT'
},
'/cudoventures.cudosnode.marketplace.MsgUpdateRoyalties': {
typeUrl: 'cudoventures.cudosnode.marketplace.MsgUpdateRoyalties',
color: colors.marketplace,
displayName: 'Update NFT Royalties'
},
'/cudoventures.cudosnode.marketplace.MsgUpdatePrice': {
typeUrl: 'cudoventures.cudosnode.marketplace.MsgUpdatePrice',
color: colors.marketplace,
displayName: 'Update NFT Price'
},
'/cudoventures.cudosnode.marketplace.MsgRemoveNft': {
typeUrl: 'cudoventures.cudosnode.marketplace.MsgRemoveNft',
color: colors.marketplace,
displayName: 'Remove NFT from Sale'
},
'/cudoventures.cudosnode.marketplace.MsgPublishNft': {
typeUrl: 'cudoventures.cudosnode.marketplace.MsgPublishNft',
color: colors.marketplace,
displayName: 'Publish NFT for Sale'
},
'/cudoventures.cudosnode.marketplace.MsgMintNft': {
typeUrl: 'cudoventures.cudosnode.marketplace.MsgMintNft',
color: colors.marketplace,
displayName: 'Mint NFT'
},
'/cudoventures.cudosnode.marketplace.MsgAddAdmin': {
typeUrl: 'cudoventures.cudosnode.marketplace.MsgAddAdmin',
color: colors.marketplace,
displayName: 'Add Marketplace Admin'
},
'/cudoventures.cudosnode.marketplace.MsgUnverifyCollection': {
typeUrl: 'cudoventures.cudosnode.marketplace.MsgUnverifyCollection',
color: colors.marketplace,
displayName: 'Unverify NFT Collection'
},
'/cudoventures.cudosnode.marketplace.MsgVerifyCollection': {
typeUrl: 'cudoventures.cudosnode.marketplace.MsgVerifyCollection',
color: colors.marketplace,
displayName: 'Verify NFT Collection'
},
'/cudoventures.cudosnode.marketplace.MsgPublishCollection': {
typeUrl: 'cudoventures.cudosnode.marketplace.MsgPublishCollection',
color: colors.marketplace,
displayName: 'Publish NFT Collection'
},
'/cudoventures.cudosnode.marketplace.MsgCreateCollection': {
typeUrl: 'cudoventures.cudosnode.marketplace.MsgCreateCollection',
color: colors.marketplace,
displayName: 'Create NFT Collection'
},
// ========================
// addressbook
// ========================
'/cudoventures.cudosnode.addressbook.MsgDeleteAddress': {
typeUrl: 'cudoventures.cudosnode.addressbook.MsgDeleteAddress',
color: colors.addressbook,
displayName: 'Delete address'
},
'/cudoventures.cudosnode.addressbook.MsgUpdateAddress': {
typeUrl: 'cudoventures.cudosnode.addressbook.MsgUpdateAddress',
color: colors.addressbook,
displayName: 'Update address'
},
'/cudoventures.cudosnode.addressbook.MsgCreateAddress': {
typeUrl: 'cudoventures.cudosnode.addressbook.MsgCreateAddress',
color: colors.addressbook,
displayName: 'Create address'
},
}

export const unknownMessage = {
Expand Down
2 changes: 2 additions & 0 deletions src/store/proposalDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export type VoteDetails = {
proposer: string
content: {
['@type']: string
changes: any[]
title: string
description: string
}
Expand All @@ -41,6 +42,7 @@ export const initialState: ProposalDetailsState = {
proposer: '',
content: {
'@type': '',
changes: [],
title: '',
description: ''
},
Expand Down
22 changes: 22 additions & 0 deletions src/utils/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,84 @@ export const CHAIN_DETAILS = {
DEFAULT_NETWORK: import.meta.env.VITE_APP_DEFAULT_NETWORK || process.env.VITE_APP_DEFAULT_NETWORK || "",
CAPTCHA_SITE_KEY: {
LOCAL: import.meta.env.VITE_APP_LOCAL_CAPTCHA_SITE_KEY || process.env.VITE_APP_LOCAL_CAPTCHA_SITE_KEY || "",
DEV: import.meta.env.VITE_APP_DEV_CAPTCHA_SITE_KEY || process.env.VITE_APP_DEV_CAPTCHA_SITE_KEY || "",
PRIVATE: import.meta.env.VITE_APP_PRIVATE_CAPTCHA_SITE_KEY || process.env.VITE_APP_PRIVATE_CAPTCHA_SITE_KEY || "",
PUBLIC: import.meta.env.VITE_APP_PUBLIC_CAPTCHA_SITE_KEY || process.env.VITE_APP_PUBLIC_CAPTCHA_SITE_KEY || "",
MAINNET: ''
},
FAUCET_URL: {
LOCAL: import.meta.env.VITE_APP_LOCAL_FAUCET_URL || process.env.VITE_APP_LOCAL_FAUCET_URL || "",
DEV: import.meta.env.VITE_APP_DEV_FAUCET_URL || process.env.VITE_APP_DEV_FAUCET_URL || "",
PRIVATE: import.meta.env.VITE_APP_PRIVATE_FAUCET_URL || process.env.VITE_APP_PRIVATE_FAUCET_URL || "",
PUBLIC: import.meta.env.VITE_APP_PUBLIC_FAUCET_URL || process.env.VITE_APP_PUBLIC_FAUCET_URL || "",
MAINNET: ''
},
FAUCET_ADDRESS: {
LOCAL: import.meta.env.VITE_APP_LOCAL_FAUCET_ADDRESS || process.env.VITE_APP_LOCAL_FAUCET_ADDRESS || "",
DEV: import.meta.env.VITE_APP_DEV_FAUCET_ADDRESS || process.env.VITE_APP_DEV_FAUCET_ADDRESS || "",
PRIVATE: import.meta.env.VITE_APP_PRIVATE_FAUCET_ADDRESS || process.env.VITE_APP_PRIVATE_FAUCET_ADDRESS || "",
PUBLIC: import.meta.env.VITE_APP_PUBLIC_FAUCET_ADDRESS || process.env.VITE_APP_PUBLIC_FAUCET_ADDRESS || "",
MAINNET: ''
},
BRIDGE_URL: {
LOCAL: import.meta.env.VITE_APP_LOCAL_BRIDGE_URL || process.env.VITE_APP_LOCAL_BRIDGE_URL || "",
DEV: import.meta.env.VITE_APP_DEV_BRIDGE_URL || process.env.VITE_APP_DEV_BRIDGE_URL || "",
PRIVATE: import.meta.env.VITE_APP_PRIVATE_BRIDGE_URL || process.env.VITE_APP_PRIVATE_BRIDGE_URL || "",
PUBLIC: import.meta.env.VITE_APP_PUBLIC_BRIDGE_URL || process.env.VITE_APP_PUBLIC_BRIDGE_URL || "",
MAINNET: import.meta.env.VITE_APP_MAINNET_BRIDGE_URL || process.env.VITE_APP_MAINNET_BRIDGE_URL || "",
},
GRAPHQL_URL: {
LOCAL: import.meta.env.VITE_APP_LOCAL_GRAPHQL_URL || process.env.VITE_APP_LOCAL_GRAPHQL_URL || "",
DEV: import.meta.env.VITE_APP_DEV_GRAPHQL_URL || process.env.VITE_APP_DEV_GRAPHQL_URL || "",
PRIVATE: import.meta.env.VITE_APP_PRIVATE_GRAPHQL_URL || process.env.VITE_APP_PRIVATE_GRAPHQL_URL || "",
PUBLIC: import.meta.env.VITE_APP_PUBLIC_GRAPHQL_URL || process.env.VITE_APP_PUBLIC_GRAPHQL_URL || "",
MAINNET: import.meta.env.VITE_APP_MAINNET_GRAPHQL_URL || process.env.VITE_APP_MAINNET_GRAPHQL_URL || ""
},
GRAPHQL_WS: {
LOCAL: import.meta.env.VITE_APP_LOCAL_GRAPHQL_WS || process.env.VITE_APP_LOCAL_GRAPHQL_WS || "",
DEV: import.meta.env.VITE_APP_DEV_GRAPHQL_WS || process.env.VITE_APP_DEV_GRAPHQL_WS || "",
PRIVATE: import.meta.env.VITE_APP_PRIVATE_GRAPHQL_WS || process.env.VITE_APP_PRIVATE_GRAPHQL_WS || "",
PUBLIC: import.meta.env.VITE_APP_PUBLIC_GRAPHQL_WS || process.env.VITE_APP_PUBLIC_GRAPHQL_WS || "",
MAINNET: import.meta.env.VITE_APP_MAINNET_GRAPHQL_WS || process.env.VITE_APP_MAINNET_GRAPHQL_WS || ""
},
RPC_ADDRESS: {
LOCAL: import.meta.env.VITE_APP_LOCAL_RPC || process.env.VITE_APP_LOCAL_RPC || "",
DEV: import.meta.env.VITE_APP_DEV_RPC || process.env.VITE_APP_DEV_RPC || "",
PRIVATE: import.meta.env.VITE_APP_PRIVATE_RPC || process.env.VITE_APP_PRIVATE_RPC || "",
PUBLIC: import.meta.env.VITE_APP_PUBLIC_RPC || process.env.VITE_APP_PUBLIC_RPC || "",
MAINNET: import.meta.env.VITE_APP_MAINNET_RPC || process.env.VITE_APP_MAINNET_RPC || ""
},
API_ADDRESS: {
LOCAL: import.meta.env.VITE_APP_LOCAL_API || process.env.VITE_APP_LOCAL_API || "",
DEV: import.meta.env.VITE_APP_DEV_API || process.env.VITE_APP_DEV_API || "",
PRIVATE: import.meta.env.VITE_APP_PRIVATE_API || process.env.VITE_APP_PRIVATE_API || "",
PUBLIC: import.meta.env.VITE_APP_PUBLIC_API || process.env.VITE_APP_PUBLIC_API || "",
MAINNET: import.meta.env.VITE_APP_MAINNET_API || process.env.VITE_APP_MAINNET_API || ""
},
STAKING_URL: {
LOCAL: import.meta.env.VITE_APP_LOCAL_STAKING_URL || process.env.VITE_APP_LOCAL_STAKING_URL || "",
DEV: import.meta.env.VITE_APP_DEV_STAKING_URL || process.env.VITE_APP_DEV_STAKING_URL || "",
PRIVATE: import.meta.env.VITE_APP_PRIVATE_STAKING_URL || process.env.VITE_APP_PRIVATE_STAKING_URL || "",
PUBLIC: import.meta.env.VITE_APP_PUBLIC_STAKING_URL || process.env.VITE_APP_PUBLIC_STAKING_URL || "",
MAINNET: import.meta.env.VITE_APP_MAINNET_STAKING_URL || process.env.VITE_APP_MAINNET_STAKING_URL || ""
},
EXPLORER_URL: {
LOCAL: import.meta.env.VITE_APP_LOCAL_EXPLORER_URL || process.env.VITE_APP_LOCAL_EXPLORER_URL || "",
DEV: import.meta.env.VITE_APP_DEV_EXPLORER_URL || process.env.VITE_APP_DEV_EXPLORER_URL || "",
PRIVATE: import.meta.env.VITE_APP_PRIVATE_EXPLORER_URL || process.env.VITE_APP_PRIVATE_EXPLORER_URL || "",
PUBLIC: import.meta.env.VITE_APP_PUBLIC_EXPLORER_URL || process.env.VITE_APP_PUBLIC_EXPLORER_URL || "",
MAINNET: import.meta.env.VITE_APP_MAINNET_EXPLORER_URL || process.env.VITE_APP_MAINNET_EXPLORER_URL || ""
},
CHAIN_NAME: {
LOCAL: import.meta.env.VITE_APP_LOCAL_CHAIN_NAME || process.env.VITE_APP_LOCAL_CHAIN_NAME || "",
DEV: import.meta.env.VITE_APP_DEV_CHAIN_NAME || process.env.VITE_APP_DEV_CHAIN_NAME || "",
PRIVATE: import.meta.env.VITE_APP_PRIVATE_CHAIN_NAME || process.env.VITE_APP_PRIVATE_CHAIN_NAME || "",
PUBLIC: import.meta.env.VITE_APP_PUBLIC_CHAIN_NAME || process.env.VITE_APP_PUBLIC_CHAIN_NAME || "",
MAINNET: import.meta.env.VITE_APP_MAINNET_CHAIN_NAME || process.env.VITE_APP_MAINNET_CHAIN_NAME || ""
},
CHAIN_ID: {
LOCAL: import.meta.env.VITE_APP_LOCAL_CHAIN_ID || process.env.VITE_APP_LOCAL_CHAIN_ID || "",
DEV: import.meta.env.VITE_APP_DEV_CHAIN_ID || process.env.VITE_APP_DEV_CHAIN_ID || "",
PRIVATE: import.meta.env.VITE_APP_PRIVATE_CHAIN_ID || process.env.VITE_APP_PRIVATE_CHAIN_ID || "",
PUBLIC: import.meta.env.VITE_APP_PUBLIC_CHAIN_ID || process.env.VITE_APP_PUBLIC_CHAIN_ID || "",
MAINNET: import.meta.env.VITE_APP_MAINNET_CHAIN_ID || process.env.VITE_APP_MAINNET_CHAIN_ID || ""
Expand All @@ -72,6 +90,10 @@ export const CHAIN_DETAILS = {
ALIAS_NAME: 'Local Testnet',
SHORT_NAMES: ['local']
},
DEV: {
ALIAS_NAME: 'DEV Environment',
SHORT_NAMES: ['cudos-dev-test-network', 'dev-network']
},
PRIVATE: {
ALIAS_NAME: 'Private Testnet',
SHORT_NAMES: ['private', 'dev-test']
Expand Down

0 comments on commit 251d727

Please sign in to comment.