Skip to content

Commit f839f98

Browse files
authored
Merge pull request #317 from ava-labs/dev
Master update
2 parents 9791193 + 208e5e2 commit f839f98

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2155
-2322
lines changed

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ module.exports = {
1515
},
1616
rules: {
1717
'no-console': 'off',
18+
'no-unused-vars': 'off',
19+
'prefer-const': 'off',
1820
'vue/no-unused-components': 'off',
1921
'vue/multiline-html-element-content-newline': 'off',
2022
'no-unreachable': 'off',

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"test": "jest --verbose ./tests"
1919
},
2020
"dependencies": {
21-
"@avalabs/avalanche-wallet-sdk": "0.11.1-beta.3",
21+
"@avalabs/avalanche-wallet-sdk": "0.17.3",
2222
"@avalabs/vue_components": "0.10.0",
2323
"@ethereumjs/common": "2.0.0",
2424
"@ethereumjs/tx": "3.0.0",
@@ -32,7 +32,7 @@
3232
"@ledgerhq/hw-transport-webhid": "^5.51.1",
3333
"@ledgerhq/hw-transport-webusb": "5.22.0",
3434
"@obsidiansystems/hw-app-avalanche": "0.2.2",
35-
"@openzeppelin/contracts": "^4.4.2",
35+
"@openzeppelin/contracts": "4.6.0",
3636
"@types/big.js": "4.0.5",
3737
"@types/create-hash": "1.2.2",
3838
"@types/crypto-js": "^4.0.2",
@@ -44,7 +44,7 @@
4444
"@types/vue-datetime": "1.0.0",
4545
"@zxing/library": "0.15.2",
4646
"abi-decoder": "2.4.0",
47-
"avalanche": "3.10.1",
47+
"avalanche": "3.15.1",
4848
"axios": "0.21.2",
4949
"big.js": "5.2.2",
5050
"bip32": "2.0.5",
@@ -65,7 +65,7 @@
6565
"ethereum-blockies-base64": "1.0.2",
6666
"ethereumjs-tx": "2.1.2",
6767
"ethereumjs-util": "^7.0.7",
68-
"ethers": "^5.3.1",
68+
"ethers": "5.6.8",
6969
"express": "4.17.1",
7070
"hdkey": "2.0.1",
7171
"helmet": "3.23.3",
@@ -109,13 +109,15 @@
109109
"@fortawesome/fontawesome-free": "^5.13.0",
110110
"@types/jest": "^26.0.0",
111111
"@types/randomstring": "^1.1.8",
112+
"@typescript-eslint/eslint-plugin": "4.33.0",
113+
"@typescript-eslint/parser": "4.33.0",
112114
"@vue/cli-plugin-babel": "^4.1.0",
113115
"@vue/cli-plugin-eslint": "^4.1.0",
114116
"@vue/cli-plugin-router": "^4.1.0",
115117
"@vue/cli-plugin-typescript": "^4.3.1",
116118
"@vue/cli-plugin-vuex": "^4.1.0",
117119
"@vue/cli-service": "^4.5.13",
118-
"@vue/eslint-config-typescript": "^4.0.0",
120+
"@vue/eslint-config-typescript": "7.0.0",
119121
"@vue/test-utils": "^1.0.3",
120122
"babel-core": "^7.0.0-bridge.0",
121123
"cypress": "^4.12.1",
@@ -135,7 +137,7 @@
135137
"sass": "^1.24.4",
136138
"sass-loader": "^8.0.2",
137139
"ts-jest": "^26.1.1",
138-
"typescript": "~3.9.5",
140+
"typescript": "4.0.8",
139141
"vue-cli-plugin-vuetify": "^2.0.3",
140142
"vue-jest": "^3.0.5",
141143
"vue-template-compiler": "2.6.12",

src/AVA.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ import { EVMAPI } from 'avalanche/dist/apis/evm'
77

88
// Connect to TestNet by default
99
// Doesn't really matter how we initialize, it will get changed by the network module later
10-
let ip: string = 'bootstrap.ava.network'
11-
let port: number = 21000
12-
let protocol: string = 'https'
13-
let network_id: number = 2
14-
let chain_id: string = 'X'
15-
let bintools: BinTools = BinTools.getInstance()
16-
let ava: Avalanche = new Avalanche(ip, port, protocol, network_id, chain_id)
10+
const ip: string = 'bootstrap.ava.network'
11+
const port: number = 21000
12+
const protocol: string = 'https'
13+
const network_id: number = 2
14+
const chain_id: string = 'X'
15+
const bintools: BinTools = BinTools.getInstance()
16+
const ava: Avalanche = new Avalanche(ip, port, protocol, network_id, chain_id)
1717

18-
let avm: AVMAPI = ava.XChain()
19-
let cChain: EVMAPI = ava.CChain()
20-
let pChain = ava.PChain()
21-
let infoApi: InfoAPI = ava.Info()
22-
let keyChain: AVMKeyChain = avm.keyChain()
18+
const avm: AVMAPI = ava.XChain()
19+
const cChain: EVMAPI = ava.CChain()
20+
const pChain = ava.PChain()
21+
const infoApi: InfoAPI = ava.Info()
22+
const keyChain: AVMKeyChain = avm.keyChain()
2323

2424
function isValidAddress(addr: string) {
2525
try {
26-
let res = bintools.stringToAddress(addr)
26+
const res = bintools.stringToAddress(addr)
2727
return true
2828
} catch (err) {
2929
return false

src/components/SidePanels/History/ViewTypes/ImportExport.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default class ImportExport extends Vue {
3131
}
3232
3333
get destinationChainId() {
34-
let outs = this.transaction.outputs
34+
let outs = this.transaction.outputs || []
3535
3636
for (var i = 0; i < outs.length; i++) {
3737
let out = outs[i]

src/components/SidePanels/TxHistoryRow.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ export default class TxHistoryRow extends Vue {
6060
}
6161
6262
get hasMultisig() {
63-
return this.transaction.outputs.filter((utxo) => utxo.addresses.length > 1).length > 0
63+
return (
64+
this.transaction.outputs?.filter((utxo) => utxo.addresses.length > 1).length > 0 ||
65+
false
66+
)
6467
}
6568
6669
get memo(): string | null {

src/components/misc/AvaxInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<script lang="ts">
3232
import 'reflect-metadata'
3333
import { Vue, Component, Prop, Model } from 'vue-property-decorator'
34-
import { Utils, Big } from '@avalabs/avalanche-wallet-sdk'
34+
import { Big, bnToBig } from '@avalabs/avalanche-wallet-sdk'
3535
//@ts-ignore
3636
import { BigNumInput } from '@avalabs/vue_components'
3737
import { BN } from 'avalanche'
@@ -65,7 +65,7 @@ export default class AvaxInput extends Vue {
6565
6666
get amountUSD(): Big {
6767
let usdPrice = this.priceDict.usd
68-
let amount = Utils.bnToBig(this.amount, 9)
68+
let amount = bnToBig(this.amount, 9)
6969
let usdBig = amount.times(usdPrice)
7070
return usdBig
7171
}

src/components/misc/NftPayloadView/blacklist.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const URLBLacklist = [`avax-reward.su`]
55
* @param url
66
*/
77
export function isUrlBanned(url: string) {
8-
for (var i = 0; i < URLBLacklist.length; i++) {
8+
for (let i = 0; i < URLBLacklist.length; i++) {
99
if (url.includes(URLBLacklist[i])) {
1010
return true
1111
}

src/components/misc/ValidatorList/FilterSettings.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export default class FilterSettings extends Vue {
115115
availableSpace = 25
116116
activeFilter: null | ValidatorListFilter = null
117117
count = 0
118-
timeout: NodeJS.Timeout | null = null
118+
timeout: ReturnType<typeof setTimeout> | null = null
119119
120120
@Prop() validators!: ValidatorListItem[]
121121
@Watch('validators')

src/components/modals/ExportCsvModal.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,14 @@ export default class ExportCsvModal extends Vue {
106106
generateCSVData() {
107107
let myAddresses = this.pAddressesStripped
108108
109+
// Sort tx by stake end time
110+
const txsSorted = this.stakingTxs.sort((a, b) => {
111+
return b.validatorEnd - a.validatorEnd
112+
})
113+
109114
let rows: CsvRowStakingData[] = []
110-
for (var i = 0; i < this.stakingTxs.length; i++) {
111-
let tx = this.stakingTxs[i]
115+
for (var i = 0; i < txsSorted.length; i++) {
116+
let tx = txsSorted[i]
112117
113118
let type = tx.type
114119
let isRewarded = tx.rewarded
@@ -171,6 +176,7 @@ export default class ExportCsvModal extends Vue {
171176
nodeID: nodeID,
172177
isRewardOwner: isRewardOwner,
173178
isInputOwner: isInputOwner,
179+
rewardDateUnix: tx.validatorEnd,
174180
})
175181
} else {
176182
// Skip if user did not want validation rewards
@@ -189,6 +195,7 @@ export default class ExportCsvModal extends Vue {
189195
nodeID: nodeID,
190196
isRewardOwner: isRewardOwner,
191197
isInputOwner: isInputOwner,
198+
rewardDateUnix: tx.validatorEnd,
192199
})
193200
}
194201
}
@@ -201,6 +208,7 @@ export default class ExportCsvModal extends Vue {
201208
'Stake Start Date',
202209
'Stake Duration',
203210
'Reward Date',
211+
'Reward Timestamp (UNIX)',
204212
'AVAX Price at Reward Date',
205213
'Reward Received (AVAX)',
206214
'Reward Received (USD)',

src/components/modals/LedgerBlock.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { LEDGER_EXCHANGE_TIMEOUT } from '../../store/modules/ledger/types'
4444
})
4545
export default class LedgerBlock extends Vue {
4646
duration: number = LEDGER_EXCHANGE_TIMEOUT / 1000
47-
intervalId: NodeJS.Timeout | null = null
47+
intervalId: ReturnType<typeof setTimeout> | null = null
4848
4949
open() {
5050
// @ts-ignore

0 commit comments

Comments
 (0)