Skip to content

Commit 171c620

Browse files
authored
Merge pull request #318 from invariant-labs/update-mainnet-token-list
update mainnet token list
2 parents c50c86d + 63ed933 commit 171c620

File tree

12 files changed

+217
-169
lines changed

12 files changed

+217
-169
lines changed

package-lock.json

Lines changed: 68 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@
1212
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
1313
"preview": "vite preview",
1414
"storybook": "storybook dev -p 6006",
15-
"build-storybook": "export NODE_OPTIONS=--max-old-space-size=8192 && storybook build"
15+
"build-storybook": "export NODE_OPTIONS=--max-old-space-size=8192 && storybook build",
16+
"update-mainnet-list": "node ./src/fetchMainnetList.js"
1617
},
1718
"dependencies": {
1819
"@emotion/react": "^11.11.4",
1920
"@emotion/styled": "^11.11.5",
2021
"@invariant-labs/a0-sdk": "^0.2.27",
2122
"@mui/icons-material": "^5.15.15",
2223
"@mui/material": "^5.15.15",
23-
"@nightlylabs/wallet-selector-polkadot": "^0.2.5",
24+
"@nightlylabs/wallet-selector-polkadot": "^0.2.6",
2425
"@nivo/bar": "^0.87.0",
2526
"@nivo/line": "^0.86.0",
2627
"@polkadot/api": "^10.11.2",

src/components/Header/Header.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,17 @@ export const Header: React.FC<IHeader> = ({
164164

165165
<Grid container item className={classes.buttons} wrap='nowrap'>
166166
<Grid container className={classes.leftButtons}>
167-
<Box sx={{ display: { xs: 'none', md: 'block' } }}>
168-
<Button
169-
className={buttonStyles.classes.headerButton}
170-
variant='contained'
171-
sx={{ '& .MuiButton-label': buttonStyles.classes.label }}
172-
onClick={onFaucet}>
173-
Faucet
174-
</Button>
175-
</Box>
167+
{typeOfNetwork === Network.Testnet ? (
168+
<Box sx={{ display: { xs: 'none', md: 'block' } }}>
169+
<Button
170+
className={buttonStyles.classes.headerButton}
171+
variant='contained'
172+
sx={{ '& .MuiButton-label': buttonStyles.classes.label }}
173+
onClick={onFaucet}>
174+
Faucet
175+
</Button>
176+
</Box>
177+
) : null}
176178
<Box sx={{ display: { xs: 'none', md: 'block' } }}>
177179
<SelectRPCButton
178180
rpc={rpc}

src/components/Inputs/DepositAmountInput/style.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const useStyles = makeStyles<{ isSelected: boolean }>()((theme: Theme, {
9696
backgroundColor: `${colors.invariant.Error}40`
9797
},
9898
currencyIcon: {
99-
minWidth: 20,
99+
width: 20,
100100
height: 20,
101101
marginRight: 8,
102102
borderRadius: '100%'

src/components/NewPosition/style.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const useStyles = makeStyles()(theme => {
88
maxWidth: '100%'
99
},
1010
headerContainer: {
11-
columnGap: 24
11+
columnGap: 24,
12+
height: 46
1213
},
1314
back: {
1415
height: 24,

src/fetchMainnetList.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import fs from 'fs'
2+
import axios from 'axios'
3+
4+
const run = async () => {
5+
const tokensObject = (await axios.get('https://api.psplist.xyz/tokens')).data
6+
7+
const tokensList = {}
8+
tokensObject.forEach(({ symbol, contractAddress, decimals, name, logoURI, description }) => {
9+
tokensList[contractAddress] = {
10+
symbol,
11+
address: contractAddress,
12+
decimals,
13+
name,
14+
logoURI: `https://api.psplist.xyz/tokens/${contractAddress}/logo`
15+
}
16+
})
17+
18+
fs.writeFileSync('./src/store/consts/tokenLists/mainnet.json', JSON.stringify(tokensList))
19+
console.log('Tokens list updated!')
20+
}
21+
22+
run()

0 commit comments

Comments
 (0)