Skip to content

Commit

Permalink
Merge pull request #1394 from crypto-com/dev
Browse files Browse the repository at this point in the history
 Internal Release v1.4.5
  • Loading branch information
crypto-matto authored Oct 25, 2023
2 parents 9adc9b4 + cf298e0 commit c53f4e5
Show file tree
Hide file tree
Showing 45 changed files with 391 additions and 414 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
*Unreleased*

*Released*
## [v1.4.5] - 2023-10-24
### Additions
- Rebranding of Cronos POS Chain
- Security enhancement & package dependencies bump
## [v1.4.4] - 2023-09-21
### Additions
- Security enhancement on DApp Browser
Expand Down
10 changes: 10 additions & 0 deletions electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ function createWindow() {
// Open default browser when direct to external
win.webContents.on('new-window', function (e, url) {
e.preventDefault();
if (!isValidURL(url)) {
return;
}
require('electron').shell.openExternal(url);
});

Expand Down Expand Up @@ -200,6 +203,13 @@ app.on('web-contents-created', (event, contents) => {
event.preventDefault();
}
})

// bolcks 301/302 redirect if the url is not valid
contents.on('will-redirect', (event, url) => {
if (!isValidURL(url)) {
event.preventDefault();
}
})
}
})

Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chain-desktop-wallet",
"version": "1.4.4",
"version": "1.4.5",
"description": "Crypto.com DeFi Desktop Wallet App",
"repository": "github:crypto-com/chain-desktop-wallet",
"author": "Crypto.com <contact@crypto.com>",
Expand All @@ -9,7 +9,7 @@
"main": "build/electron/main.js",
"private": true,
"scripts": {
"run-audit": "yarn audit-ci --high -a 1005059",
"run-audit": "yarn audit-ci --high -a 1005059 1094228 1094439",
"start": "node scripts/start.js",
"build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 && yarn clean-builds && node scripts/build.js",
"test": "node scripts/test.js --watchAll=false",
Expand Down Expand Up @@ -120,7 +120,6 @@
"@types/chai-as-promised": "7.1.3",
"@types/crypto-js": "4.0.1",
"@types/d3": "7.4.0",
"@types/electron": "1.6.10",
"@types/electron-devtools-installer": "2.2.0",
"@types/jest": "26.0.16",
"@types/jsdom": "16.2.10",
Expand Down Expand Up @@ -392,6 +391,8 @@
"@sideway/formula": "3.0.1",
"cookiejar": "2.1.4",
"decode-uri-component": "0.2.2",
"word-wrap": "1.2.4"
"word-wrap": "1.2.4",
"@babel/traverse": "7.23.2",
"get-func-name": "2.0.0"
}
}
8 changes: 4 additions & 4 deletions src/components/AssetIcon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const ICON_CRO_TENDERMINT = './assets/icon-cronos-tendermint.svg';
export const ICON_CRO_EVM = './assets/icon-cronos-evm.svg';
export const ICON_ETH_EVM = './assets/icon-eth-evm.svg';
export const ICON_ATOM_TENDERMINT = './assets/icon-atom-tendermint.svg';
export const ICON_BRIDGE_CRYPTO_ORG = './assets/icon-bridge-crypto-org.svg';
export const ICON_BRIDGE_CRONOS_TENDERMINT = './assets/icon-bridge-crypto-org.svg';
export const ICON_BRIDGE_CRONOS = './assets/icon-bridge-cronos.svg';
export const ICON_BRIDGE_COSMOSHUB = './assets/icon-atom-tendermint.svg';

Expand Down Expand Up @@ -42,11 +42,11 @@ export const AssetIcon = (props: { asset: UserAsset }) => {

export const BridgeIcon = (props: { bridgeValue: string | undefined }) => {
const { bridgeValue } = props;
let icon = ICON_BRIDGE_CRYPTO_ORG;
let icon = ICON_BRIDGE_CRONOS_TENDERMINT;

switch (bridgeValue) {
case 'CRYPTO_ORG':
icon = ICON_BRIDGE_CRYPTO_ORG;
case 'CRONOS_TENDERMINT':
icon = ICON_BRIDGE_CRONOS_TENDERMINT;
break;
case 'CRONOS':
icon = ICON_BRIDGE_CRONOS;
Expand Down
6 changes: 3 additions & 3 deletions src/components/LedgerNotification/LedgerNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function ledgerNotification(wallet: Wallet, asset: UserAsset) {
const ledgerAddress = await device.getAddress(
addressIndex,
addressprefix,
asset.config?.tendermintNetwork?.chainName ?? SupportedChainName.CRYPTO_ORG,
asset.config?.tendermintNetwork?.chainName ?? SupportedChainName.CRONOS_TENDERMINT,
derivationPathStandard ?? DerivationPathStandard.BIP44,
true,
);
Expand Down Expand Up @@ -99,7 +99,7 @@ export function ledgerNotification(wallet: Wallet, asset: UserAsset) {
{i18n.t('receive.notification.ledgerConnect.description')}
<br /> -{' '}
<a
href="https://crypto.org/docs/wallets/ledger_desktop_wallet.html#ledger-connection-troubleshoot"
href="https://cronos-pos.org/docs/wallets/ledger_desktop_wallet.html#ledger-connection-troubleshoot"
target="_blank"
rel="noreferrer"
>
Expand Down Expand Up @@ -245,7 +245,7 @@ export function ledgerNotificationWithoutCheck(
{i18n.t('receive.notification.ledgerConnect.description')}
<br /> -{' '}
<a
href="https://crypto.org/docs/wallets/ledger_desktop_wallet.html#ledger-connection-troubleshoot"
href="https://cronos-pos.org/docs/wallets/ledger_desktop_wallet.html#ledger-connection-troubleshoot"
target="_blank"
rel="noreferrer"
>
Expand Down
8 changes: 4 additions & 4 deletions src/config/StaticAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const CRONOS_TENDERMINT_ASSET = (walletConfig: WalletConfig) => {
defaultNodeUrl: isTestnet
? 'https://rpc-c5.crypto.org'
: 'https://rpc.mainnet.crypto.org',
chainName: SupportedChainName.CRYPTO_ORG,
chainName: SupportedChainName.CRONOS_TENDERMINT,
chainId: isTestnet ? 'testnet-croeseid-5' : MainNetConfig.network.chainId,
addressPrefix: isTestnet ? 'tcro' : 'cro',
validatorPubKeyPrefix: isTestnet ? 'tcrocnclconspub' : 'crocnclconspub',
Expand All @@ -102,10 +102,10 @@ export const CRONOS_TENDERMINT_ASSET = (walletConfig: WalletConfig) => {
return {
balance: '0',
description:
'Cronos (CRO) is the native token of the Crypto.org Chain. The Crypto.org Chain was created to build a network of cryptocurrency projects, and develop merchants’ ability to accept crypto as a form of payment. The Crypto.org Chain is a high performing native blockchain solution, which will make the transaction flows between crypto users and merchants accepting crypto seamless, cost-efficient and secure.\\r\\n\\r\\nBusinesses can use Crypto.org pay Checkout and/or Invoice to enable customers to complete checkout and pay for goods and services with cryptocurrencies using the Crypto.org Wallet App. Businesses receive all their payments instantly in CRO or stable coins, or in fiat.',
'Cronos (CRO) is the native token of the Cronos POS Chain. The Cronos POS Chain was created to build a network of cryptocurrency projects, and develop merchants’ ability to accept crypto as a form of payment. The Cronos POS Chain is a high performing native blockchain solution, which will make the transaction flows between crypto users and merchants accepting crypto seamless, cost-efficient and secure.\\r\\n\\r\\nBusinesses can use Cronos POS pay Checkout and/or Invoice to enable customers to complete checkout and pay for goods and services with cryptocurrencies using the Crypto.org Wallet App. Businesses receive all their payments instantly in CRO or stable coins, or in fiat.',
icon_url: ICON_CRO_TENDERMINT,
identifier: getRandomId(),
name: SupportedChainName.CRYPTO_ORG,
name: SupportedChainName.CRONOS_TENDERMINT,
symbol: isTestnet ? TestNetCroeseid5Config.network.coin.croDenom.toString().toUpperCase() : MainNetConfig.network.coin.croDenom.toString().toUpperCase(),
mainnetSymbol: 'CRO', // This is to be used solely for markets data since testnet market prices is always non existent
stakedBalance: '0',
Expand Down Expand Up @@ -273,7 +273,7 @@ export const getDefaultUserAssetConfig = (asset: UserAsset | undefined, session:
switch (`${assetType}-${name}`) {
case `${UserAssetType.TENDERMINT}-${SupportedChainName.COSMOS_HUB}`:
return ATOM_TENDERMINT_ASSET(config);
case `${UserAssetType.TENDERMINT}-${SupportedChainName.CRYPTO_ORG}`:
case `${UserAssetType.TENDERMINT}-${SupportedChainName.CRONOS_TENDERMINT}`:
return CRONOS_TENDERMINT_ASSET(config);
case `${UserAssetType.EVM}-${SupportedChainName.CRONOS}`:
return CRONOS_EVM_ASSET(config);
Expand Down
62 changes: 31 additions & 31 deletions src/config/StaticConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { CroNetwork } from '@crypto-org-chain/chain-jslib/lib/dist/core/cro';
export const INTERCOM_APP_ID = 'yrt83fbd';

export const APP_DB_NAMESPACE = 'data-store';
export const MARKET_API_BASE_URL = 'https://crypto.org/api';
export const MARKET_API_BASE_URL = 'https://cronos-pos.org/api';
export const COINBASE_TICKER_API_BASE_URL = 'https://api.coinbase.com/v2/';
export const CRYPTO_COM_PRICE_API_BASE_URL = {
V1: 'https://price-api.crypto.com/price/v1/',
V2: 'https://price-api.crypto.com/price/v2/',
};
export const NV_GRAPHQL_API_ENDPOINT = 'https://crypto.com/nft-api/graphql';
export const IPFS_MIDDLEWARE_SERVER_UPLOAD_ENDPOINT =
'https://crypto.org/ipfs-middleware-server/uploads';
'https://cronos-pos.org/ipfs-middleware-server/uploads';
export const NCW_NFT_MIDDLEWARE_SERVER_ENDPOINT =
'https://cronos.org/ncw-quandra-api-middleware-server';
export const DEFAULT_CLIENT_MEMO = 'client:chain-desktop-app';
Expand Down Expand Up @@ -221,7 +221,7 @@ SUPPORTED_CURRENCY.set('BRL', { value: 'BRL', label: 'BRL - R$', symbol: 'R$' })
SUPPORTED_CURRENCY.set('TRY', { value: 'TRY', label: 'TRY - ₺', symbol: '₺' });

export enum SupportedChainName {
CRYPTO_ORG = 'Crypto.org Chain',
CRONOS_TENDERMINT = 'Cronos POS Chain',
CRONOS = 'Cronos Chain',
COSMOS_HUB = 'Cosmos Hub Chain',
ETHEREUM = 'Ethereum Chain',
Expand Down Expand Up @@ -315,7 +315,7 @@ export const NFT_WRAPPED_ETH_DENOM_SCHEMA = {
properties: {
isExternal: {
type: 'boolean',
description: 'Describes whether the NFT is external or internal to the Crypto.org chain',
description: 'Describes whether the NFT is external or internal to the Cronos POS Chain',
},
network: {
type: 'string',
Expand All @@ -338,13 +338,13 @@ const TestNetConfig: WalletConfig = {
name: NetworkName.TESTNET,
derivationPath: 'm/44\'/1\'/0\'/0/0',
explorer: {
baseUrl: 'https://crypto.org/explorer/croeseid',
tx: 'https://crypto.org/explorer/croeseid/tx',
address: 'https://crypto.org/explorer/croeseid/account',
validator: 'https://crypto.org/explorer/croeseid/validator',
baseUrl: 'https://cronos-pos.org/explorer/croeseid',
tx: 'https://cronos-pos.org/explorer/croeseid/tx',
address: 'https://cronos-pos.org/explorer/croeseid/account',
validator: 'https://cronos-pos.org/explorer/croeseid/validator',
},
explorerUrl: 'https://crypto.org/explorer/croeseid',
indexingUrl: 'https://crypto.org/explorer/croeseid/api/v1/',
explorerUrl: 'https://cronos-pos.org/explorer/croeseid',
indexingUrl: 'https://cronos-pos.org/explorer/croeseid/api/v1/',
nodeUrl: CroNetwork.Testnet.defaultNodeUrl,
network: CroNetwork.Testnet,
disableDefaultClientMemo: false,
Expand Down Expand Up @@ -395,13 +395,13 @@ export const TestNetCroeseid4Config: WalletConfig = {
name: NetworkName.TESTNET,
derivationPath: 'm/44\'/1\'/0\'/0/0',
explorer: {
baseUrl: 'https://crypto.org/explorer/croeseid4',
tx: 'https://crypto.org/explorer/croeseid4/tx',
address: 'https://crypto.org/explorer/croeseid4/account',
validator: 'https://crypto.org/explorer/croeseid4/validator',
baseUrl: 'https://cronos-pos.org/explorer/croeseid4',
tx: 'https://cronos-pos.org/explorer/croeseid4/tx',
address: 'https://cronos-pos.org/explorer/croeseid4/account',
validator: 'https://cronos-pos.org/explorer/croeseid4/validator',
},
explorerUrl: 'https://crypto.org/explorer/croeseid4',
indexingUrl: 'https://crypto.org/explorer/croeseid4/api/v1/',
explorerUrl: 'https://cronos-pos.org/explorer/croeseid4',
indexingUrl: 'https://cronos-pos.org/explorer/croeseid4/api/v1/',
nodeUrl: TestnetCroeseid4.defaultNodeUrl,
network: TestnetCroeseid4,
disableDefaultClientMemo: false,
Expand All @@ -413,7 +413,7 @@ export const TestNetCroeseid4Config: WalletConfig = {
},
tendermintNetwork: {
...TestnetCroeseid4,
chainName: SupportedChainName.CRYPTO_ORG,
chainName: SupportedChainName.CRONOS_TENDERMINT,
node: {
clientUrl: 'https://rpc-testnet-croeseid-4.crypto.org',
proxyUrl: 'https://rest-testnet-croeseid-4.crypto.org',
Expand All @@ -427,13 +427,13 @@ export const TestNetCroeseid5Config: WalletConfig = {
name: NetworkName.TESTNET,
derivationPath: 'm/44\'/1\'/0\'/0/0',
explorer: {
baseUrl: 'https://crypto.org/explorer/croeseid5',
tx: 'https://crypto.org/explorer/croeseid5/tx',
address: 'https://crypto.org/explorer/croeseid5/account',
validator: 'https://crypto.org/explorer/croeseid5/validator',
baseUrl: 'https://cronos-pos.org/explorer/croeseid5',
tx: 'https://cronos-pos.org/explorer/croeseid5/tx',
address: 'https://cronos-pos.org/explorer/croeseid5/account',
validator: 'https://cronos-pos.org/explorer/croeseid5/validator',
},
explorerUrl: 'https://crypto.org/explorer/croeseid5',
indexingUrl: 'https://crypto.org/explorer/croeseid5/api/v1/',
explorerUrl: 'https://cronos-pos.org/explorer/croeseid5',
indexingUrl: 'https://cronos-pos.org/explorer/croeseid5/api/v1/',
nodeUrl: TestnetCroeseid5.defaultNodeUrl,
network: TestnetCroeseid5,
disableDefaultClientMemo: false,
Expand All @@ -445,7 +445,7 @@ export const TestNetCroeseid5Config: WalletConfig = {
},
tendermintNetwork: {
...TestnetCroeseid5,
chainName: SupportedChainName.CRYPTO_ORG,
chainName: SupportedChainName.CRONOS_TENDERMINT,
node: {
clientUrl: 'https://rpc-c5.crypto.org',
proxyUrl: 'https://rest-c5.crypto.org'
Expand All @@ -459,13 +459,13 @@ export const MainNetConfig: WalletConfig = {
derivationPath: 'm/44\'/394\'/0\'/0/0',
nodeUrl: 'https://rpc.mainnet.crypto.org',
explorer: {
baseUrl: 'https://crypto.org/explorer',
tx: 'https://crypto.org/explorer/tx',
address: 'https://crypto.org/explorer/account',
validator: 'https://crypto.org/explorer/validator',
baseUrl: 'https://cronos-pos.org/explorer/',
tx: 'https://cronos-pos.org/explorer/tx',
address: 'https://cronos-pos.org/explorer/account',
validator: 'https://cronos-pos.org/explorer/validator',
},
explorerUrl: 'https://crypto.org/explorer',
indexingUrl: 'https://crypto.org/explorer/api/v1/',
explorerUrl: 'https://cronos-pos.org/explorer',
indexingUrl: 'https://cronos-pos.org/explorer/api/v1/',
network: {
...CroNetwork.Mainnet,
defaultNodeUrl: 'https://rpc.mainnet.crypto.org',
Expand All @@ -481,7 +481,7 @@ export const MainNetConfig: WalletConfig = {
tendermintNetwork: {
...CroNetwork.Mainnet,
defaultNodeUrl: 'https://rpc.mainnet.crypto.org',
chainName: SupportedChainName.CRYPTO_ORG,
chainName: SupportedChainName.CRONOS_TENDERMINT,
rpcUrl: 'https://rpc.mainnet.crypto.org',
node: {
clientUrl: 'https://rpc.mainnet.crypto.org',
Expand Down
4 changes: 2 additions & 2 deletions src/config/whitelist_tokens_20220602.json
Original file line number Diff line number Diff line change
Expand Up @@ -11277,7 +11277,7 @@
"blockchain_symbol": "CRO",
"trading_symbol": "CRO",
"code": "CRO",
"explorer": "https://crypto.org/explorer/tx/",
"explorer": "https://cronos-pos.org/explorer/tx/",
"is_erc20": false,
"gas_limit": 500000,
"token_decimal_value": "1000000",
Expand All @@ -11291,7 +11291,7 @@
"denom": "basecro",
"parent": "cro-asset",
"chain": "cro",
"balance_explorer_url": "https://crypto.org/explorer/account/",
"balance_explorer_url": "https://cronos-pos.org/explorer/account/",
"enabled": true,
"is_new": false,
"withdrawal_eta": ["6 secs"],
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useLedgerStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const useLedgerStatus = (props: Props) => {
useEffect(() => {
const checkIsLedgerConnected = () => {
if (assetType === UserAssetType.TENDERMINT || assetType === UserAssetType.IBC) {
if(chainName === SupportedChainName.CRYPTO_ORG) {
if(chainName === SupportedChainName.CRONOS_TENDERMINT) {
setIsLedgerConnected(ledgerConnectedApp === LedgerConnectedApp.CRYPTO_ORG);
} else if(chainName === SupportedChainName.COSMOS_HUB) {
setIsLedgerConnected(ledgerConnectedApp === LedgerConnectedApp.COSMOS);
Expand Down
4 changes: 2 additions & 2 deletions src/language/ar-AE.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"general.walletconnect.disconnect": "قطع الاتصال",
"general.walletconnect.connect.desc6": "يمكنك الآن الوصول إلى DApp على متصفح الويب الخاص بك",
"general.walletconnect.connect.desc7": "عنوان المحفظة",
"welcome.slogan": "محفظة سطح مكتب عامة وopen-source على سلسلة Crypto.org.",
"welcome.slogan": "محفظة سطح مكتب عامة وopen-source على سلسلة Cronos POS.",
"welcome.button": "للبدء",
"welcome.block": "هذا المنتج غير متوفر حاليا في بلدك أو منطقتك.",
"signup.title": "تم إنشاء كلمة مرور التطبيق بنجاح",
Expand Down Expand Up @@ -476,7 +476,7 @@
"governance.modal1.label3": "تصويت",
"governance.modal2.instructions.part2.discord": "Discord",
"nft.title": "معلوماتي",
"nft.description": "نظرة عامة على مجموعة NFT الخاصة بك على Crypto.org Chain & Cronos Chain.",
"nft.description": "نظرة عامة على مجموعة NFT الخاصة بك على Cronos POS Chain & Cronos Chain.",
"nft.tab1": "مجموعة NFT",
"nft.tab3": "تلقي NFT",
"nft.fileUploadValidator.error1": "مطلوب تحميل الملفات",
Expand Down
Loading

0 comments on commit c53f4e5

Please sign in to comment.