diff --git a/package.json b/package.json index f592e84..633ef98 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/lib/constant/chain.ts b/src/lib/constant/chain.ts index 8ab7c44..902d55c 100644 --- a/src/lib/constant/chain.ts +++ b/src/lib/constant/chain.ts @@ -20,13 +20,13 @@ export enum CoinType { trx = '195', ckb = '309', bsc = '9006', - matic = '966', + pol = '966', } export const CoinTypeToChainIdMap: Record = { [CoinType.eth]: ChainId.eth, [CoinType.bsc]: ChainId.bsc, - [CoinType.matic]: ChainId.polygon, + [CoinType.pol]: ChainId.polygon, [CoinType.trx]: ChainId.tron, [CoinType.btc]: ChainId.btc, } @@ -34,7 +34,7 @@ export const CoinTypeToChainIdMap: Record = { export const CoinTypeToTestNetChainIdMap: Record = { [CoinType.eth]: ChainId.ethHolesky, [CoinType.bsc]: ChainId.bscTestnet, - [CoinType.matic]: ChainId.polygonAmoy, + [CoinType.pol]: ChainId.polygonAmoy, [CoinType.trx]: ChainId.tronNile, [CoinType.btc]: ChainId.btcTestnet, } @@ -42,19 +42,19 @@ export const CoinTypeToTestNetChainIdMap: Record = { export const CoinTypeToTorusHostMap: Record = { [CoinType.eth]: 'mainnet', [CoinType.bsc]: 'bsc_mainnet', - [CoinType.matic]: 'matic', + [CoinType.pol]: 'pol', } export const CoinTypeToTorusHostTestNetMap: Record = { [CoinType.eth]: 'holesky', [CoinType.bsc]: 'bsc_testnet', - [CoinType.matic]: 'amoy', + [CoinType.pol]: 'amoy', } export const ChainIdToCoinTypeMap: Record = { [ChainId.eth]: CoinType.eth, [ChainId.bsc]: CoinType.bsc, - [ChainId.polygon]: CoinType.matic, + [ChainId.polygon]: CoinType.pol, [ChainId.tron]: CoinType.trx, [ChainId.btc]: CoinType.btc, } @@ -62,7 +62,7 @@ export const ChainIdToCoinTypeMap: Record = { export const ChainIdToCoinTypeTestNetMap: Record = { [ChainId.ethHolesky]: CoinType.eth, [ChainId.bscTestnet]: CoinType.bsc, - [ChainId.polygonAmoy]: CoinType.matic, + [ChainId.polygonAmoy]: CoinType.pol, [ChainId.tronNile]: CoinType.trx, [ChainId.btcTestnet]: CoinType.btc, } @@ -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/', } @@ -183,7 +183,7 @@ export const BTC: IMainChain = { export const CoinTypeToChainMap: Record = { [CoinType.eth]: ETH, [CoinType.bsc]: BSC, - [CoinType.matic]: Polygon, + [CoinType.pol]: Polygon, [CoinType.trx]: TRON, [CoinType.doge]: DOGE, [CoinType.btc]: BTC, diff --git a/src/lib/ui/LoggedIn/LoggedIn.tsx b/src/lib/ui/LoggedIn/LoggedIn.tsx index 0eac1fe..ad8b5f2 100644 --- a/src/lib/ui/LoggedIn/LoggedIn.tsx +++ b/src/lib/ui/LoggedIn/LoggedIn.tsx @@ -60,7 +60,7 @@ export const LoggedIn = ({ transitionRef, transitionStyle }: SwapChildProps) => [CoinType.eth]: ETH, [CoinType.bsc]: BSC, // eslint-disable-next-line lingui/no-unlocalized-strings - [CoinType.matic]: Polygon, + [CoinType.pol]: Polygon, // eslint-disable-next-line lingui/no-unlocalized-strings [CoinType.trx]: Tron, // eslint-disable-next-line lingui/no-unlocalized-strings @@ -72,7 +72,7 @@ export const LoggedIn = ({ transitionRef, transitionStyle }: SwapChildProps) => [CoinType.ckb]: , [CoinType.eth]: , [CoinType.bsc]: , - [CoinType.matic]: , + [CoinType.pol]: , [CoinType.trx]: , [CoinType.doge]: , [CoinType.btc]: , diff --git a/src/lib/ui/Login/ChainList.tsx b/src/lib/ui/Login/ChainList.tsx index d60a479..e6e4ff2 100644 --- a/src/lib/ui/Login/ChainList.tsx +++ b/src/lib/ui/Login/ChainList.tsx @@ -39,7 +39,7 @@ const polygon: IChain = { // eslint-disable-next-line lingui/no-unlocalized-strings icon: Polygon, name: CustomChain.polygon, - coinType: CoinType.matic, + coinType: CoinType.pol, } const tron: IChain = { diff --git a/src/lib/ui/Login/WalletList.tsx b/src/lib/ui/Login/WalletList.tsx index 3da9515..e1704de 100644 --- a/src/lib/ui/Login/WalletList.tsx +++ b/src/lib/ui/Login/WalletList.tsx @@ -40,7 +40,7 @@ export const WalletList = ({ transitionRef, transitionStyle }: SwapChildProps) = // eslint-disable-next-line lingui/no-unlocalized-strings icon: WalletConnect, name: CustomWallet.walletConnect, - supportList: [CoinType.eth, CoinType.bsc, CoinType.matic], + supportList: [CoinType.eth, CoinType.bsc, CoinType.pol], }, { icon: imToken, @@ -72,7 +72,7 @@ export const WalletList = ({ transitionRef, transitionStyle }: SwapChildProps) = list.unshift({ icon: {connector.name}, name: connector.name, - supportList: [CoinType.eth, CoinType.bsc, CoinType.matic], + supportList: [CoinType.eth, CoinType.bsc, CoinType.pol], }) } }) @@ -82,24 +82,24 @@ export const WalletList = ({ transitionRef, transitionStyle }: SwapChildProps) = // eslint-disable-next-line lingui/no-unlocalized-strings icon: 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: 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: TrustWallet, name: CustomWallet.trustWallet, - supportList: [CoinType.eth, CoinType.bsc, CoinType.matic], + supportList: [CoinType.eth, CoinType.bsc, CoinType.pol], }, { icon: imToken, name: CustomWallet.imToken, - supportList: [CoinType.eth, CoinType.bsc, CoinType.matic, CoinType.trx], + supportList: [CoinType.eth, CoinType.bsc, CoinType.pol, CoinType.trx], }, // { // icon: Unisat, @@ -110,18 +110,18 @@ export const WalletList = ({ transitionRef, transitionStyle }: SwapChildProps) = // eslint-disable-next-line lingui/no-unlocalized-strings icon: 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: OneKey, name: CustomWallet.oneKey, - supportList: [CoinType.eth, CoinType.bsc, CoinType.matic], + supportList: [CoinType.eth, CoinType.bsc, CoinType.pol], }, // { // icon: 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 diff --git a/src/lib/wallets/WalletContext.ts b/src/lib/wallets/WalletContext.ts index dbf7733..02cf3f4 100644 --- a/src/lib/wallets/WalletContext.ts +++ b/src/lib/wallets/WalletContext.ts @@ -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', } : { diff --git a/src/lib/wallets/WalletEventListenerHandler/TorusEventListener.ts b/src/lib/wallets/WalletEventListenerHandler/TorusEventListener.ts index d288d93..dcc0c17 100644 --- a/src/lib/wallets/WalletEventListenerHandler/TorusEventListener.ts +++ b/src/lib/wallets/WalletEventListenerHandler/TorusEventListener.ts @@ -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` diff --git a/src/lib/wallets/WalletEventListenerHandler/WalletConnectEventListener.ts b/src/lib/wallets/WalletEventListenerHandler/WalletConnectEventListener.ts index 6ee76e6..163f7c1 100644 --- a/src/lib/wallets/WalletEventListenerHandler/WalletConnectEventListener.ts +++ b/src/lib/wallets/WalletEventListenerHandler/WalletConnectEventListener.ts @@ -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`