Skip to content

Commit

Permalink
fix: MATIC rename to POL.
Browse files Browse the repository at this point in the history
  • Loading branch information
web3max committed Sep 24, 2024
1 parent fbd6f22 commit bd8887e
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wallet-bridge",
"private": false,
"version": "1.0.0-beta.12",
"version": "1.0.0-beta.13",
"main": "./dist/wallet-bridge.umd.js",
"module": "./dist/wallet-bridge.es.js",
"types": "./dist/index.d.ts",
Expand Down
22 changes: 11 additions & 11 deletions src/lib/constant/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,49 +20,49 @@ export enum CoinType {
trx = '195',
ckb = '309',
bsc = '9006',
matic = '966',
pol = '966',
}

export const CoinTypeToChainIdMap: Record<string, number | string> = {
[CoinType.eth]: ChainId.eth,
[CoinType.bsc]: ChainId.bsc,
[CoinType.matic]: ChainId.polygon,
[CoinType.pol]: ChainId.polygon,
[CoinType.trx]: ChainId.tron,
[CoinType.btc]: ChainId.btc,
}

export const CoinTypeToTestNetChainIdMap: Record<string, number | string> = {
[CoinType.eth]: ChainId.ethHolesky,
[CoinType.bsc]: ChainId.bscTestnet,
[CoinType.matic]: ChainId.polygonAmoy,
[CoinType.pol]: ChainId.polygonAmoy,
[CoinType.trx]: ChainId.tronNile,
[CoinType.btc]: ChainId.btcTestnet,
}

export const CoinTypeToTorusHostMap: Record<string, string> = {
[CoinType.eth]: 'mainnet',
[CoinType.bsc]: 'bsc_mainnet',
[CoinType.matic]: 'matic',
[CoinType.pol]: 'pol',
}

export const CoinTypeToTorusHostTestNetMap: Record<string, string> = {
[CoinType.eth]: 'holesky',
[CoinType.bsc]: 'bsc_testnet',
[CoinType.matic]: 'amoy',
[CoinType.pol]: 'amoy',
}

export const ChainIdToCoinTypeMap: Record<string, CoinType> = {
[ChainId.eth]: CoinType.eth,
[ChainId.bsc]: CoinType.bsc,
[ChainId.polygon]: CoinType.matic,
[ChainId.polygon]: CoinType.pol,
[ChainId.tron]: CoinType.trx,
[ChainId.btc]: CoinType.btc,
}

export const ChainIdToCoinTypeTestNetMap: Record<string, CoinType> = {
[ChainId.ethHolesky]: CoinType.eth,
[ChainId.bscTestnet]: CoinType.bsc,
[ChainId.polygonAmoy]: CoinType.matic,
[ChainId.polygonAmoy]: CoinType.pol,
[ChainId.tronNile]: CoinType.trx,
[ChainId.btcTestnet]: CoinType.btc,
}
Expand Down Expand Up @@ -149,11 +149,11 @@ export const BSC: IMainChain = {

export const Polygon: IMainChain = {
name: CustomChain.polygon,
symbol: 'MATIC',
coinType: CoinType.matic,
symbol: 'POL',
coinType: CoinType.pol,
decimals: 18,
icon: 'polygon',
tokenId: 'polygon_matic',
tokenId: 'polygon_pol',
explorerTrx: 'https://polygonscan.com/tx/',
testExplorerTrx: 'https://amoy.polygonscan.com/tx/',
}
Expand Down Expand Up @@ -183,7 +183,7 @@ export const BTC: IMainChain = {
export const CoinTypeToChainMap: Record<string, IMainChain> = {
[CoinType.eth]: ETH,
[CoinType.bsc]: BSC,
[CoinType.matic]: Polygon,
[CoinType.pol]: Polygon,
[CoinType.trx]: TRON,
[CoinType.doge]: DOGE,
[CoinType.btc]: BTC,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/ui/LoggedIn/LoggedIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const LoggedIn = ({ transitionRef, transitionStyle }: SwapChildProps) =>
[CoinType.eth]: <img className="inline-flex size-[68px]" src={EthIcon} alt="ETH" />,
[CoinType.bsc]: <img className="inline-flex size-[68px]" src={BscIcon} alt="BSC" />,
// eslint-disable-next-line lingui/no-unlocalized-strings
[CoinType.matic]: <img className="inline-flex size-[68px]" src={PolygonIcon} alt="Polygon" />,
[CoinType.pol]: <img className="inline-flex size-[68px]" src={PolygonIcon} alt="Polygon" />,
// eslint-disable-next-line lingui/no-unlocalized-strings
[CoinType.trx]: <img className="inline-flex size-[68px]" src={TronIcon} alt="Tron" />,
// eslint-disable-next-line lingui/no-unlocalized-strings
Expand All @@ -72,7 +72,7 @@ export const LoggedIn = ({ transitionRef, transitionStyle }: SwapChildProps) =>
[CoinType.ckb]: <img className="absolute top-0 w-full-4px rounded-t-[32px]" src={DeviceBg} alt="" />,
[CoinType.eth]: <img className="absolute top-0 w-full-4px rounded-t-[32px]" src={EthBg} alt="" />,
[CoinType.bsc]: <img className="absolute top-0 w-full-4px rounded-t-[32px]" src={BscBg} alt="" />,
[CoinType.matic]: <img className="absolute top-0 w-full-4px rounded-t-[32px]" src={PolygonBg} alt="" />,
[CoinType.pol]: <img className="absolute top-0 w-full-4px rounded-t-[32px]" src={PolygonBg} alt="" />,
[CoinType.trx]: <img className="absolute top-0 w-full-4px rounded-t-[32px]" src={TronBg} alt="" />,
[CoinType.doge]: <img className="absolute top-0 w-full-4px rounded-t-[32px]" src={DogeBg} alt="" />,
[CoinType.btc]: <img className="absolute top-0 w-full-4px rounded-t-[32px]" src={BtcBg} alt="" />,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ui/Login/ChainList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const polygon: IChain = {
// eslint-disable-next-line lingui/no-unlocalized-strings
icon: <img className="size-10" src={PolygonIcon} alt="Polygon" />,
name: CustomChain.polygon,
coinType: CoinType.matic,
coinType: CoinType.pol,
}

const tron: IChain = {
Expand Down
18 changes: 9 additions & 9 deletions src/lib/ui/Login/WalletList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const WalletList = ({ transitionRef, transitionStyle }: SwapChildProps) =
// eslint-disable-next-line lingui/no-unlocalized-strings
icon: <img className="size-10" src={WalletConnectIcon} alt="WalletConnect" />,
name: CustomWallet.walletConnect,
supportList: [CoinType.eth, CoinType.bsc, CoinType.matic],
supportList: [CoinType.eth, CoinType.bsc, CoinType.pol],
},
{
icon: <img className="size-10" src={ImTokenIcon} alt="imToken" />,
Expand Down Expand Up @@ -72,7 +72,7 @@ export const WalletList = ({ transitionRef, transitionStyle }: SwapChildProps) =
list.unshift({
icon: <img className="size-10" src={connector.icon} alt={connector.name} />,
name: connector.name,
supportList: [CoinType.eth, CoinType.bsc, CoinType.matic],
supportList: [CoinType.eth, CoinType.bsc, CoinType.pol],
})
}
})
Expand All @@ -82,24 +82,24 @@ export const WalletList = ({ transitionRef, transitionStyle }: SwapChildProps) =
// eslint-disable-next-line lingui/no-unlocalized-strings
icon: <img className="size-10" src={WalletConnectIcon} alt="WalletConnect" />,
name: CustomWallet.walletConnect,
supportList: [CoinType.eth, CoinType.bsc, CoinType.matic],
supportList: [CoinType.eth, CoinType.bsc, CoinType.pol],
},
{
// eslint-disable-next-line lingui/no-unlocalized-strings
icon: <img className="size-10" src={MetaMaskIcon} alt="MetaMask" />,
name: CustomWallet.metaMask,
supportList: [CoinType.eth, CoinType.bsc, CoinType.matic],
supportList: [CoinType.eth, CoinType.bsc, CoinType.pol],
},
{
// eslint-disable-next-line lingui/no-unlocalized-strings
icon: <img className="size-10" src={TrustWalletIcon} alt="TrustWallet" />,
name: CustomWallet.trustWallet,
supportList: [CoinType.eth, CoinType.bsc, CoinType.matic],
supportList: [CoinType.eth, CoinType.bsc, CoinType.pol],
},
{
icon: <img className="size-10" src={ImTokenIcon} alt="imToken" />,
name: CustomWallet.imToken,
supportList: [CoinType.eth, CoinType.bsc, CoinType.matic, CoinType.trx],
supportList: [CoinType.eth, CoinType.bsc, CoinType.pol, CoinType.trx],
},
// {
// icon: <img className="size-10" src={UnisatIcon} alt="Unisat" />,
Expand All @@ -110,18 +110,18 @@ export const WalletList = ({ transitionRef, transitionStyle }: SwapChildProps) =
// eslint-disable-next-line lingui/no-unlocalized-strings
icon: <img className="size-10" src={TokenPocketIcon} alt="TokenPocket" />,
name: CustomWallet.tokenPocket,
supportList: [CoinType.eth, CoinType.bsc, CoinType.matic, CoinType.trx, CoinType.doge],
supportList: [CoinType.eth, CoinType.bsc, CoinType.pol, CoinType.trx, CoinType.doge],
},
{
// eslint-disable-next-line lingui/no-unlocalized-strings
icon: <img className="size-10" src={OneKeyIcon} alt="OneKey" />,
name: CustomWallet.oneKey,
supportList: [CoinType.eth, CoinType.bsc, CoinType.matic],
supportList: [CoinType.eth, CoinType.bsc, CoinType.pol],
},
// {
// icon: <img className="h-10 w-10" src={ITokenIcon} alt="iToken" />,
// name: CustomWallet.iToken,
// supportList: [CoinType.eth, CoinType.bsc, CoinType.matic],
// supportList: [CoinType.eth, CoinType.bsc, CoinType.pol],
// },
{
// eslint-disable-next-line lingui/no-unlocalized-strings
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wallets/WalletContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export class WalletContext {
chainId: this.chainId as number,
networkName: 'Amoy Test Network',
blockExplorer: 'https://amoy.polygonscan.com',
ticker: 'Matic',
ticker: 'POL',
tickerName: 'Polygon',
}
: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class TorusEventListener extends WalletEventListener {
? t`Please switch your wallet to the BSC Testnet before connecting`
: t`Please switch your wallet to the BSC main network before connecting`
break
case CoinType.matic:
case CoinType.pol:
message = isTestNet
? t`Please switch your wallet to the Polygon Testnet before connecting`
: t`Please switch your wallet to the Polygon Mainnet before connecting`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class WalletConnectEventListener extends WalletEventListener {
? t`Please switch your wallet to the BSC Testnet before connecting`
: t`Please switch your wallet to the BSC main network before connecting`
break
case CoinType.matic:
case CoinType.pol:
message = isTestNet
? t`Please switch your wallet to the Polygon Testnet before connecting`
: t`Please switch your wallet to the Polygon Mainnet before connecting`
Expand Down

0 comments on commit bd8887e

Please sign in to comment.