Skip to content

Commit 1bf4438

Browse files
committed
chore: remove unused code
1 parent 64f9d5d commit 1bf4438

File tree

12 files changed

+29
-169
lines changed

12 files changed

+29
-169
lines changed

.eslintrc.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,24 @@ module.exports = {
2828
'security/detect-object-injection': 'off',
2929
'require-atomic-updates': 'off',
3030
'no-prototype-builtins': 'off',
31-
"no-irregular-whitespace": ["error", { "skipComments": true, "skipTemplates": true, "skipStrings": true, "skipRegExps": true }],
31+
'no-irregular-whitespace': [
32+
'error',
33+
{
34+
skipComments: true,
35+
skipTemplates: true,
36+
skipStrings: true,
37+
skipRegExps: true
38+
}
39+
],
3240
'vue/custom-event-name-casing': 'off',
33-
41+
'vue/no-unused-properties': [
42+
'error',
43+
{
44+
groups: ['props', 'data', 'computed', 'methods', 'setup'],
45+
deepData: false,
46+
ignorePublicMembers: false
47+
}
48+
]
3449
},
3550
parserOptions: {
3651
parser: 'babel-eslint'

src/dapps/staked-dapp/components/StakedStatus.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ export default {
292292
data() {
293293
return {
294294
iconETHNavy: iconETHNavy,
295-
timer: [],
296295
expanded: 0,
297296
STATUS_TYPES: STATUS_TYPES
298297
};

src/modules/access-wallet/software/components/AccessWalletMnemonic.vue

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,6 @@ export default {
444444
},
445445
data() {
446446
return {
447-
/* Apollo */
448-
getEthBalance: '',
449447
/* Stepper Items */
450448
step: 1,
451449
stepperItems: [
@@ -661,18 +659,6 @@ export default {
661659
},
662660
methods: {
663661
...mapActions('global', ['addCustomPath']),
664-
/**
665-
* Method that launches new tab to an explorer with address clicked
666-
* Used in STEP 3, Address Row
667-
*/
668-
launchExplorrer(addr) {
669-
// eslint-disable-next-line
670-
window.open(
671-
this.network.type.blockExplorerAddr.replace('[[address]]', addr),
672-
'_blank'
673-
);
674-
},
675-
676662
/**
677663
* Async method that gets accounts according to the pagination
678664
* Used in STEP 2 and 3

src/modules/balance/ModuleBalanceCard.vue

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -237,28 +237,9 @@ export default {
237237
*/
238238
nonChainTokensCount() {
239239
return this.tokensList.length - 1;
240-
},
241-
/**
242-
* NOTE: implemnt this once we have support on different languages
243-
* Margin exhist if symbol is displayed on the right
244-
*/
245-
hasMargin() {
246-
return !this.isTestNetwork;
247240
}
248241
},
249242
methods: {
250-
animateBlockie() {
251-
const el = document.querySelector('.blockie-img');
252-
if (el) {
253-
el.style.transform = 'scale(0)';
254-
anime({
255-
targets: el,
256-
keyframes: [{ scale: 0 }, { scale: 3 }, { scale: 1 }],
257-
delay: 1500,
258-
duration: 2000
259-
});
260-
}
261-
},
262243
animateMewCard() {
263244
const el = document.querySelector('.mew-card');
264245
if (el) {

src/modules/balance/ModuleTokens.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export default {
6666
},
6767
data() {
6868
return {
69-
tokensDataLoading: true,
7069
tableHeaders: [
7170
{
7271
text: 'Token',

src/modules/confirmation/ModuleConfirmation.vue

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,6 @@ export default {
393393
}, BigNumber(0));
394394
return hexToNumberString(batchGasPrice);
395395
},
396-
nonce() {
397-
return hexToNumber(this.tx.nonce);
398-
},
399396
txFee() {
400397
const parsedTxFee = BigNumber(toWei(this.gasPrice, 'gwei'))
401398
.times(this.gasLimit)
@@ -416,14 +413,6 @@ export default {
416413
}
417414
return '0';
418415
},
419-
isSoftwareWallet() {
420-
return (
421-
!this.instance.isHardware &&
422-
(this.instance.identifier === WALLET_TYPES.KEYSTORE ||
423-
this.instance.identifier === WALLET_TYPES.PRIV_KEY ||
424-
this.instance.identifier === WALLET_TYPES.MNEMONIC)
425-
);
426-
},
427416
disableBtn() {
428417
if (this.error !== '') return true;
429418
if (!this.signing) return true;

src/modules/confirmation/components/ConfirmationSendTransactionDetails.vue

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ export default {
4949
type: String,
5050
default: ''
5151
},
52-
data: {
53-
type: String,
54-
default: ''
55-
},
5652
network: {
5753
type: Object,
5854
default: () => {}
@@ -73,10 +69,6 @@ export default {
7369
type: Number,
7470
default: 0
7571
},
76-
toTxData: {
77-
type: Object,
78-
default: () => {}
79-
},
8072
toDetails: {
8173
type: Object,
8274
default: () => {}

src/modules/confirmation/handlers/parseTokenData.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ function parseTokensData(data, to) {
3434
: value.toString();
3535
tokenData.tokenSymbol = token ? token.symbol : 'Unidentified Token';
3636
}
37-
3837
return tokenData;
3938
}
4039

src/modules/notifications/ModuleNotifications.vue

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ export default {
142142
{ label: 'Out', val: NOTIFICATION_TYPES.OUT },
143143
{ label: 'Swap', val: NOTIFICATION_TYPES.SWAP }
144144
],
145-
page: null,
146145
openNotifications: false
147146
};
148147
},
@@ -154,9 +153,6 @@ export default {
154153
]),
155154
...mapGetters('global', ['network', 'isEthNetwork']),
156155
...mapState('wallet', ['address', 'web3']),
157-
hasNotifications() {
158-
return this.allNotifications.length > 0;
159-
},
160156
loading() {
161157
return this.$apollo.loading;
162158
},
@@ -211,18 +207,6 @@ export default {
211207
})
212208
.sort(this.sortByDate);
213209
},
214-
/**
215-
* Formatted swap notifications
216-
*/
217-
formattedSwapNotifications() {
218-
return this.swapNotifications
219-
.map(notification => {
220-
const newObj = formatNotification(notification, this.network);
221-
newObj.checkSwapStatus(this.swapper);
222-
return newObj;
223-
})
224-
.sort(this.sortByDate);
225-
},
226210
/**
227211
* Formatted incoming tx notifications
228212
*/

src/modules/swap/ModuleSwap.vue

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ import SwapBtn from '@/views/components-wallet/TheSwapBtn';
255255
import AppButtonBalance from '@/core/components/AppButtonBalance';
256256
import AppUserMsgBlock from '@/core/components/AppUserMsgBlock';
257257
import ModuleAddressBook from '@/modules/address-book/ModuleAddressBook';
258-
import SwapIcon from '@/assets/images/icons/icon-swap.svg';
259258
import SwapProvidersList from './components/SwapProvidersList.vue';
260259
import Swapper from './handlers/handlerSwap';
261260
import AppNetworkFee from '@/core/components/AppNetworkFee.vue';
@@ -266,7 +265,6 @@ import Notification, {
266265
NOTIFICATION_STATUS
267266
} from '@/modules/notifications/handlers/handlerNotification';
268267
import BigNumber from 'bignumber.js';
269-
import { EventBus } from '@/core/plugins/eventBus';
270268
import { Toast, ERROR } from '@/modules/toast/handler/handlerToast';
271269
import { MAIN_TOKEN_ADDRESS } from '@/core/helpers/common';
272270
import { TRENDING_LIST } from './handlers/configs/configTrendingTokens';
@@ -288,10 +286,6 @@ export default {
288286
type: String,
289287
default: MAIN_TOKEN_ADDRESS
290288
},
291-
toToken: {
292-
type: String,
293-
default: ''
294-
},
295289
amount: {
296290
type: String,
297291
default: '0'
@@ -320,7 +314,6 @@ export default {
320314
selectedProvider: '',
321315
totalFees: ''
322316
},
323-
wrappedBtc: ['renBTC', 'wBTC', 'PBTC'],
324317
swapper: null,
325318
toTokenType: {},
326319
fromTokenType: {},
@@ -344,10 +337,8 @@ export default {
344337
'Transaction fee is automatically calculated. If you want to customize the Transaction fee, you can do it here.'
345338
}
346339
],
347-
swapIcon: SwapIcon,
348340
isLoadingProviders: false,
349341
addressValue: {},
350-
gasPriceModal: false,
351342
selectedProvider: {},
352343
localGasPrice: '0',
353344
localGasType: 'economy'
@@ -439,25 +430,6 @@ export default {
439430
const ethToken = this.contractToToken(MAIN_TOKEN_ADDRESS);
440431
return ethToken;
441432
},
442-
/**
443-
* Switches displayed balance
444-
* depending on selected currency balance
445-
*/
446-
selectedBalance() {
447-
if (
448-
_.isEmpty(this.fromTokenType) ||
449-
this.fromTokenType.symbol === this.network.type.currencyName
450-
) {
451-
return this.balanceInETH;
452-
}
453-
454-
const token = this.tokensList.find(item => {
455-
return item.symbol === this.fromTokenType.symbol;
456-
});
457-
return token
458-
? this.getTokenBalance(token.balance, token.decimals).toFixed()
459-
: this.balanceInETH;
460-
},
461433
/**
462434
* checks whether both token fields are empty
463435
*/
@@ -587,19 +559,6 @@ export default {
587559
];
588560
return returnableTokens;
589561
},
590-
/**
591-
* @returns boolean to hide providers
592-
* checks whether the provider is the only option,
593-
* the provider selected is chaangelly,
594-
* and there's an amount error
595-
*/
596-
hideProviders() {
597-
const hasError = this.amountErrorMessage !== '';
598-
const onlyOption = this.availableQuotes.length === 1;
599-
const isChangelly = this.selectedProvider.provider === 'changelly';
600-
601-
return !(hasError && onlyOption && isChangelly);
602-
},
603562
/**
604563
* @returns object of other tokens
605564
* to swap from
@@ -680,16 +639,6 @@ export default {
680639
: balanceAfterFees.isNeg();
681640
return isNotEnoughEth;
682641
},
683-
/**
684-
* Checks whether the swap is to BTC
685-
*/
686-
isToBtc() {
687-
return (
688-
(this.fromTokenType.symbol === this.network.type.currencyName ||
689-
this.fromTokenType?.isEth) &&
690-
this.toTokenType.symbol === 'BTC'
691-
);
692-
},
693642
showToAddress() {
694643
if (typeof this.toTokenType?.isEth === 'undefined') return false;
695644
return !this.toTokenType?.isEth;
@@ -708,39 +657,13 @@ export default {
708657
}
709658
return new BigNumber(0);
710659
},
711-
/**
712-
* @return string for the available balance
713-
* Used in hint for the From token amount
714-
* Amount is rounded
715-
*/
716-
availableBalanceHint() {
717-
if (!this.initialLoad && this.fromTokenType.name) {
718-
return `${this.availableBalance.toFixed()} ${
719-
this.fromTokenType.symbol
720-
}`;
721-
}
722-
return '';
723-
},
724-
725660
/**
726661
* Determines whether or not to show swap fee panel
727662
* Fee is shown if provider was selected and no errors are passed
728663
*/
729664
showSwapFee() {
730665
return this.step >= 2 && this.availableBalance.gt(0);
731666
},
732-
733-
/**
734-
* Return true Input Amount Error or input is empty
735-
* Used to determine whether or not to fetch provider's list and show transaction fee
736-
*/
737-
hasAmountErrors() {
738-
return (
739-
!this.tokenInValue ||
740-
this.amountErrorMessage !== '' ||
741-
this.tokenInValue === ''
742-
);
743-
},
744667
/**
745668
* Method validates input for the From token amount against user input
746669
* Used to show error messages for the amount input component
@@ -927,9 +850,6 @@ export default {
927850
this.setSwapTokens(tokens);
928851
}
929852
},
930-
openGasPriceModal() {
931-
this.gasPriceModal = true;
932-
},
933853
setDefaults() {
934854
setTimeout(() => {
935855
this.fromTokenType = this.getDefaultFromToken();
@@ -1134,19 +1054,6 @@ export default {
11341054
this.feeError = `Not enough ${this.network.type.name} to cover network fee. Select a different provider${buyMoreStr}`;
11351055
}
11361056
},
1137-
openSettings() {
1138-
EventBus.$emit('toggleSettings');
1139-
this.gasPriceModal = false;
1140-
},
1141-
closeGasPrice() {
1142-
this.gasPriceModal = false;
1143-
},
1144-
setWrappedBtc(symbol) {
1145-
const foundToken = this.toTokens.find(
1146-
item => item.symbol.toLowerCase() === symbol.toLowerCase()
1147-
);
1148-
this.setToToken(foundToken);
1149-
},
11501057
handleLocalGasPrice(e) {
11511058
this.localGasPrice = e.gasPrice;
11521059
if (this.currentTrade) this.currentTrade.gasPrice = this.localGasPrice;

0 commit comments

Comments
 (0)