Skip to content

Commit

Permalink
[FEAT] Matic support
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielbazan7 committed Oct 3, 2022
1 parent b99d793 commit cb30308
Show file tree
Hide file tree
Showing 10 changed files with 523 additions and 9 deletions.
11 changes: 11 additions & 0 deletions assets/img/currencies/matic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/currencies/png/MATIC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
121 changes: 119 additions & 2 deletions src/constants/SupportedCurrencyOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import WbtcIcon from '../../assets/img/currencies/wbtc.svg';
import ShibIcon from '../../assets/img/currencies/shib.svg';
import ApeIcon from '../../assets/img/currencies/ape.svg';
import EurocIcon from '../../assets/img/currencies/euroc.svg';
import MaticIcon from '../../assets/img/currencies/matic.svg';
import {ImageSourcePropType} from 'react-native';
import {orderBy} from 'lodash';

Expand All @@ -37,6 +38,7 @@ export const CurrencyListIcons: {
btc: props => <BtcIcon {...props} />,
bch: props => <BchIcon {...props} />,
eth: props => <EthIcon {...props} />,
matic: props => <MaticIcon {...props} />,
doge: props => <DogeIcon {...props} />,
ltc: props => <LtcIcon {...props} />,
xrp: props => <XrpIcon {...props} />,
Expand All @@ -49,6 +51,13 @@ export const CurrencyListIcons: {
shib_e: props => <ShibIcon {...props} />,
ape_e: props => <ApeIcon {...props} />,
euroc_e: props => <EurocIcon {...props} />,
usdc_m: props => <UsdcIcon {...props} />,
busd_m: props => <BusdIcon {...props} />,
dai_m: props => <DaiIcon {...props} />,
wbtc_m: props => <WbtcIcon {...props} />,
shib_m: props => <ShibIcon {...props} />,
ape_m: props => <ApeIcon {...props} />,
matic_m: props => <MaticIcon {...props} />,
};

export const SupportedUtxoCurrencyOptions: Array<SupportedCurrencyOption> = [
Expand Down Expand Up @@ -83,15 +92,15 @@ export const SupportedUtxoCurrencyOptions: Array<SupportedCurrencyOption> = [
id: Math.random().toString(),
img: CurrencyListIcons.ltc,
currencyName: 'Litecoin',
priority: 5,
priority: 6,
currencyAbbreviation: 'ltc',
hasMultisig: true,
imgSrc: require('../../assets/img/currencies/png/LTC.png'),
},
{
id: Math.random().toString(),
img: CurrencyListIcons.xrp,
priority: 6,
priority: 7,
currencyName: 'XRP',
currencyAbbreviation: 'xrp',
imgSrc: require('../../assets/img/currencies/png/XRP.png'),
Expand All @@ -108,6 +117,15 @@ export const SupportedEvmCurrencyOptions: Array<SupportedCurrencyOption> = [
hasMultisig: false,
imgSrc: require('../../assets/img/currencies/png/ETH.png'),
},
{
id: Math.random().toString(),
img: CurrencyListIcons.matic,
priority: 5,
currencyName: 'Matic',
currencyAbbreviation: 'matic',
hasMultisig: false,
imgSrc: require('../../assets/img/currencies/png/MATIC.png'),
},
];

export const SupportedTokenOptions: Array<SupportedCurrencyOption> = [
Expand Down Expand Up @@ -210,6 +228,105 @@ export const SupportedTokenOptions: Array<SupportedCurrencyOption> = [
badgeSrc: require('../../assets/img/currencies/png/ETH.png'),
badgeUri: CurrencyListIcons.eth,
},
{
id: Math.random().toString(),
img: CurrencyListIcons.usdc_m,
currencyName: 'USD Coin (PoS)',
currencyAbbreviation: 'usdc',
chain: 'matic',
isToken: true,
imgSrc: require('../../assets/img/currencies/png/USDC.png'),
badgeSrc: require('../../assets/img/currencies/png/MATIC.png'),
badgeUri: CurrencyListIcons.matic,
},
{
id: Math.random().toString(),
img: CurrencyListIcons.ape_m,
currencyName: 'ApeCoin (PoS)',
currencyAbbreviation: 'ape',
chain: 'matic',
isToken: true,
imgSrc: require('../../assets/img/currencies/png/APE.png'),
badgeSrc: require('../../assets/img/currencies/png/MATIC.png'),
badgeUri: CurrencyListIcons.matic,
},
{
id: Math.random().toString(),
img: CurrencyListIcons.euroc_m,
currencyName: 'Euro Coin',
currencyAbbreviation: 'euroc',
chain: 'matic',
isToken: true,
imgSrc: require('../../assets/img/currencies/png/EUROC.png'),
badgeSrc: require('../../assets/img/currencies/png/MATIC.png'),
badgeUri: CurrencyListIcons.matic,
},
{
id: Math.random().toString(),
img: CurrencyListIcons.shib_m,
currencyName: 'SHIBA INU (PoS)',
currencyAbbreviation: 'shib',
chain: 'matic',
isToken: true,
imgSrc: require('../../assets/img/currencies/png/SHIB.png'),
badgeSrc: require('../../assets/img/currencies/png/MATIC.png'),
badgeUri: CurrencyListIcons.matic,
},
{
id: Math.random().toString(),
img: CurrencyListIcons.gusd_m,
currencyName: 'Gemini Dollar',
currencyAbbreviation: 'gusd',
chain: 'matic',
isToken: true,
imgSrc: require('../../assets/img/currencies/png/GUSD.png'),
badgeSrc: require('../../assets/img/currencies/png/MATIC.png'),
badgeUri: CurrencyListIcons.matic,
},
{
id: Math.random().toString(),
img: CurrencyListIcons.busd_m,
currencyName: 'binance-usd',
currencyAbbreviation: 'busd',
chain: 'matic',
isToken: true,
imgSrc: require('../../assets/img/currencies/png/BUSD.png'),
badgeSrc: require('../../assets/img/currencies/png/MATIC.png'),
badgeUri: CurrencyListIcons.matic,
},
{
id: Math.random().toString(),
img: CurrencyListIcons.dai_m,
currencyName: '(PoS) Dai Stablecoin',
currencyAbbreviation: 'dai',
chain: 'matic',
isToken: true,
imgSrc: require('../../assets/img/currencies/png/DAI.png'),
badgeSrc: require('../../assets/img/currencies/png/MATIC.png'),
badgeUri: CurrencyListIcons.matic,
},
{
id: Math.random().toString(),
img: CurrencyListIcons.wbtc_m,
currencyName: '(PoS) Wrapped BTC',
currencyAbbreviation: 'wbtc',
chain: 'matic',
isToken: true,
imgSrc: require('../../assets/img/currencies/png/WBTC.png'),
badgeSrc: require('../../assets/img/currencies/png/MATIC.png'),
badgeUri: CurrencyListIcons.matic,
},
{
id: Math.random().toString(),
img: CurrencyListIcons.wbtc_m,
currencyName: 'Matic Token',
currencyAbbreviation: 'matic',
chain: 'matic',
isToken: true,
imgSrc: require('../../assets/img/currencies/png/MATIC.png'),
badgeSrc: require('../../assets/img/currencies/png/MATIC.png'),
badgeUri: CurrencyListIcons.matic,
},
];

export const SupportedCoinsOptions: Array<SupportedCurrencyOption> = orderBy(
Expand Down
6 changes: 6 additions & 0 deletions src/constants/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,21 @@ export const TWO_FACTOR_EMAIL_POLL_TIMEOUT = 1000 * 60 * 5;

export const EVM_BLOCKCHAIN_NETWORK = {
eth: 'ethereum',
matic: 'polygon-pos',
};

export const EVM_BLOCKCHAIN_ID: {[key in string]: number} = {
eth: 1,
matic: 137,
};

export const EVM_BLOCKCHAIN_EXPLORERS: {[key in string]: any} = {
eth: {
[Network.mainnet]: 'etherscan.io/',
[Network.testnet]: 'kovan.etherscan.io/',
},
matic: {
[Network.mainnet]: 'polygonscan.com/',
[Network.testnet]: 'mumbai.polygonscan.com/',
},
};
Loading

0 comments on commit cb30308

Please sign in to comment.