Skip to content

Commit

Permalink
Merge pull request #2872 from MyEtherWallet/bug/aug
Browse files Browse the repository at this point in the history
Bug/aug
  • Loading branch information
gamalielhere committed Mar 3, 2021
2 parents a11e45a + 1ec664a commit 76737cb
Show file tree
Hide file tree
Showing 16 changed files with 71 additions and 44 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### Release v5.7.22

### Bug

* Fix token loading issue [#2871](https://github.com/MyEtherWallet/MyEtherWallet/pull/2871)
* Fix coolwallet bug when accessing for first time [#2863](https://github.com/MyEtherWallet/MyEtherWallet/pull/2863)

### Release v5.7.21
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2015 - 2020 MyEtherWallet
Copyright (c) 2015 - 2021 MyEtherWallet

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,24 @@ To find out how to disclose a vulnerability visit [hackerone.com/myetherwallet](

## Getting started

1. Make sure you have NodeJS newer than version 8, but older than version 12, and NPM version 6 or greater.
1. Make sure you have NodeJS >= 10, but older than version 12, and NPM version 6 or greater.
2. Open terminal
3. Clone the repo: `git clone git@github.com:MyEtherWallet/MyEtherWallet.git`
4. run `npm i` to install node packages.
5. run `npm run build`. If instructed to edit `package.json` to use newly released versions of dependencies, do so and then run `npm update` and `npm run build` again. After this step succeeds, you can stop and use the offline version by opening the index file from the dist folder with your preferred browser.
6. start with `npm start`. If instructed to edit `package.json` for newly updated dependencies, see previous step.
7. If `npm start` fails and above the error message it states 'new update found' then the package.json version of the indicated packages needs to be updated to match the versions shown in the notice.
8. App should be running in `https://localhost:8080`
4. run `npm i` to install node packages.
5. run `npm run start:ci`
6. App should be running in `https://localhost:8080`

## Developers

1. Open terminal
2. Clone the repo: `git clone git@github.com:MyEtherWallet/MyEtherWallet.git`
3. run `git checkout develop`
4. run `npm i` to install node packages.
5. run `npm run build`. You can also use the offline version by opening the index file from the dist folder with your preferred browser
6. start `npm run dev`
7. App should be running in `https://localhost:8080`
5. run `npm run start:ci`
6. App should be running in `https://localhost:8080`

You can also use the offline version by running `npm run build` then opening the index file from the dist folder with your preferred browser


Can't start due to an update found:
Update the package in the `package.json` as told by the terminal error you see.
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "myetherwallet",
"version": "5.7.21",
"version": "5.7.22",
"description": "Client side ethereum wallet",
"scripts": {
"build:offline": "WEBPACK_INTEGRITY=false npm run build:hash",
Expand Down Expand Up @@ -38,7 +38,7 @@
"@coolwallets/wallet": "0.2.0-beta.1",
"@sentry/browser": "6.1.0",
"@sentry/integrations": "6.1.0",
"@unstoppabledomains/resolution": "1.19.0",
"@unstoppabledomains/resolution": "1.20.0",
"apollo-cache-inmemory": "1.6.6",
"apollo-client": "2.6.10",
"apollo-link-ws": "1.0.20",
Expand Down
60 changes: 42 additions & 18 deletions src/layouts/InterfaceLayout/InterfaceLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -593,25 +593,49 @@ export default {
) {
try {
getAddressTokens(this.account.address).then(res => {
const tokens = this.network.type.tokens;
const apiTokens = res.data.getOwnersERC20Tokens.owners;
const token = this.network.type.tokens.map(tok => {
const found = apiTokens.find(apiT => {
const parsedApiTokens = apiTokens.map(apiT => {
const newT = Object.assign(
{},
{ balance: apiT.balance },
{ address: apiT.tokenInfo.contract },
apiT.tokenInfo
);
newT['balance'] = BigNumber(newT.balance)
.div(BigNumber(10).pow(newT.decimals))
.toFixed();
delete newT['contract'];
return newT;
});
parsedApiTokens.forEach(apiT => {
const found = tokens.findIndex(tokT => {
return (
apiT.tokenInfo.contract.toLowerCase() ===
tok.address.toLowerCase()
tokT.address.toLowerCase() === apiT.address.toLowerCase()
);
});
if (found) {
tok['balance'] = BigNumber(found.balance)
.div(BigNumber(10).pow(tok.decimals))
.toFixed();
if (found !== -1) {
tokens[found]['balance'] = apiT.balance;
} else {
apiT.logo = {
src: '',
width: '',
height: '',
ipfs_hash: ''
};
tokens.push(apiT);
}
});
tokens.map(tok => {
if (!tok.balance) {
tok['balance'] = 0;
}
return tok;
});
resolve(token);
resolve(tokens);
});
} catch (e) {
resolve(this.network.type.tokens);
Expand All @@ -629,14 +653,6 @@ export default {
this.fetchTokens().then(res => {
let tokens = res;
tokens = tokens
.sort((a, b) => {
if (a.name.toUpperCase() < b.name.toUpperCase()) {
return -1;
} else if (a.name.toUpperCase() > b.name.toUpperCase()) {
return 1;
}
return 0;
})
.map(token => {
const convertedToken = {
address: token.address,
Expand All @@ -652,6 +668,14 @@ export default {
convertedToken['logo'] = token.logo;
}
return convertedToken;
})
.sort((a, b) => {
if (a.name.toUpperCase() < b.name.toUpperCase()) {
return -1;
} else if (a.name.toUpperCase() > b.name.toUpperCase()) {
return 1;
}
return 0;
});
resolve(tokens.sort(sortByBalance));
});
Expand Down
2 changes: 1 addition & 1 deletion src/translations/access-wallet/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"modal": {
"title": "Access by Software",
"purchase-text": "Purchase a hardware wallet for the highest security when accessing your crypto.",
"purchase-link": "Purchase a hardware wallet...."
"purchase-link": "Purchase a hardware wallet"
}
},
"metamask": {
Expand Down
2 changes: 1 addition & 1 deletion src/translations/access-wallet/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"modal": {
"title": "Access by Software",
"purchase-text": "Purchase a hardware wallet for the highest security when accessing your crypto.",
"purchase-link": "Purchase a hardware wallet...."
"purchase-link": "Purchase a hardware wallet"
}
},
"metamask": {
Expand Down
2 changes: 1 addition & 1 deletion src/translations/access-wallet/ja_JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"modal": {
"title": "Access by Software",
"purchase-text": "Purchase a hardware wallet for the highest security when accessing your crypto.",
"purchase-link": "Purchase a hardware wallet...."
"purchase-link": "Purchase a hardware wallet"
}
},
"metamask": {
Expand Down
2 changes: 1 addition & 1 deletion src/translations/access-wallet/ko_KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"modal": {
"title": "Access by Software",
"purchase-text": "Purchase a hardware wallet for the highest security when accessing your crypto.",
"purchase-link": "Purchase a hardware wallet...."
"purchase-link": "Purchase a hardware wallet"
}
},
"metamask": {
Expand Down
2 changes: 1 addition & 1 deletion src/translations/footer/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"team": "Team",
"feedback": "Feedback",
"privacy": "Privacy",
"copyright": "© 2020 MyEtherWallet. All Rights reserved.",
"copyright": "© 2021 MyEtherWallet. All Rights reserved.",
"pricing-p": "Pricing taken from",
"advanced": "Advanced",
"send-offline": "Send Offline Helper",
Expand Down
2 changes: 1 addition & 1 deletion src/translations/footer/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"team": "Team",
"feedback": "Feedback",
"privacy": "Privacy",
"copyright": "© 2020 MyEtherWallet. All Rights reserved.",
"copyright": "© 2021 MyEtherWallet. All Rights reserved.",
"pricing-p": "Pricing taken from",
"advanced": "Advanced",
"send-offline": "Send Offline Helper",
Expand Down
2 changes: 1 addition & 1 deletion src/translations/footer/ja_JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"team": "Team",
"feedback": "Feedback",
"privacy": "Privacy",
"copyright": "© 2020 MyEtherWallet. All Rights reserved.",
"copyright": "© 2021 MyEtherWallet. All Rights reserved.",
"pricing-p": "Pricing taken from",
"advanced": "Advanced",
"send-offline": "Send Offline Helper",
Expand Down
2 changes: 1 addition & 1 deletion src/translations/footer/ko_KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"team": "Team",
"feedback": "Feedback",
"privacy": "Privacy",
"copyright": "© 2020 MyEtherWallet. All Rights reserved.",
"copyright": "© 2021 MyEtherWallet. All Rights reserved.",
"pricing-p": "Pricing taken from",
"advanced": "Advanced",
"send-offline": "Send Offline Helper",
Expand Down
2 changes: 1 addition & 1 deletion src/translations/footer/ru_RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"team": "Команда",
"feedback": "Отзывы",
"privacy": "Конфиденциальность",
"copyright": "© 2020 MyEtherWallet. Все права защищены.",
"copyright": "© 2021 MyEtherWallet. Все права защищены.",
"pricing-p": "Расценки взяты из",
"advanced": "Расширенные параметры",
"send-offline": "Помощник для оффлайн транзакций",
Expand Down
2 changes: 1 addition & 1 deletion src/translations/footer/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"team": "Team",
"feedback": "Feedback",
"privacy": "Privacy",
"copyright": "© 2020 MyEtherWallet. All Rights reserved.",
"copyright": "© 2021 MyEtherWallet. All Rights reserved.",
"pricing-p": "Pricing taken from",
"advanced": "Advanced",
"send-offline": "Send Offline Helper",
Expand Down

1 comment on commit 76737cb

@mew-bot
Copy link
Collaborator

@mew-bot mew-bot commented on 76737cb Mar 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.