• R/O
  • HTTP
  • SSH
  • HTTPS

Byone: Commit

Bytom Wallet for Chrome


Commit MetaInfo

Revision3170b2a15d8454f77fabfe3799156517a7f20aee (tree)
Time2020-09-25 15:40:50
AuthorZhiting Lin <zhiting.fly@gmai...>
CommiterGitHub

Log Message

Merge pull request #15 from movnetwork/dev

Dev

Change Summary

Incremental Difference

--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
11 {
22 "name": "Byone",
3- "version": "3.0.1",
3+ "version": "3.0.2",
44 "lockfileVersion": 1,
55 "requires": true,
66 "dependencies": {
@@ -10423,9 +10423,9 @@
1042310423 "integrity": "sha512-GAAG8QAFVp7BFeQlNaThpTbimq3+HypBPNwdkCkHZZeVaD5zmXXfhp357dcUJXHXTZjSln0PvP6wiwLZXkFTwg=="
1042410424 },
1042510425 "vuescroll": {
10426- "version": "4.14.0",
10427- "resolved": "https://registry.npmjs.org/vuescroll/-/vuescroll-4.14.0.tgz",
10428- "integrity": "sha512-BQQcU0u9uRpmBTPoqgGcRD//g7/XUJzPxdEXupX4XSW0J+GZyUThjN0+cvvJlQyl/FmduMF6qF3JvKEfpNClQA=="
10426+ "version": "4.16.1",
10427+ "resolved": "https://registry.npmjs.org/vuescroll/-/vuescroll-4.16.1.tgz",
10428+ "integrity": "sha512-7fRsG2Yw5Z07LUz/IIu9barpmYiN9q+ZTC+CrVamvCbmsxyhz8mU1OuYFbfORysaUskioNMxTGDo+HOzeDfSyQ=="
1042910429 },
1043010430 "vuex": {
1043110431 "version": "3.1.1",
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
11 {
22 "name": "Byone",
33 "description": "Bytom Chrome Extension Wallet",
4- "version": "3.0.2",
4+ "version": "3.0.3",
55 "author": "zhiting.fly@8btc.com",
66 "license": "MIT",
77 "private": true,
@@ -34,7 +34,7 @@
3434 "vue-loading-overlay": "^3.0.1",
3535 "vue-router": "^3.0.2",
3636 "vuelidate": "^0.7.5",
37- "vuescroll": "^4.14.0",
37+ "vuescroll": "^4.16.1",
3838 "vuex": "^3.1.1"
3939 },
4040 "browserslist": [
--- a/src/manifest.js
+++ b/src/manifest.js
@@ -2,7 +2,7 @@ module.exports = {
22 manifest_version: 2,
33 name: 'Byone',
44 description: 'Bytom Wallet Chrome extension.',
5- version: '3.0.2',
5+ version: '3.0.3',
66 author: 'Bytom frontend, zhitinglin',
77 web_accessible_resources: ['js/inject.js'],
88 browser_action: {
--- a/src/models/transaction.js
+++ b/src/models/transaction.js
@@ -138,8 +138,9 @@ transaction.transfer = function(transaction, password, address, context) {
138138 let retPromise = new Promise((resolve, reject) => {
139139
140140 const {to, asset, amount, confirmations} = transaction
141+ const _to = to.trim()
141142 bytom.transaction
142- .buildPayment(address, to, asset, amount.toString(), confirmations)
143+ .buildPayment(address, _to, asset, amount.toString(), confirmations)
143144 .then(result => {
144145 return Promise.all(result.map( (data) =>
145146 signSubmit( data, password, address, context)))
--- a/src/views/assetList.vue
+++ b/src/views/assetList.vue
@@ -5,7 +5,8 @@
55
66 .transactions {
77 font-size: 15px;
8- height: 340px;
8+ height: 345px;
9+ overflow: hidden;
910 }
1011
1112 .value{
@@ -16,7 +17,6 @@ font-size: 15px;
1617 color: rgba(0, 0, 0, 0.36);
1718 }
1819
19-
2020 .no-record{
2121 display: block;
2222 }
@@ -117,37 +117,37 @@ font-size: 15px;
117117 <div :class="{'color-black': (type==='transfer_out') }" @click="changeType('transfer_out')" >{{ $t('common.transfer_out') }}</div>
118118 </section>
119119
120- <section class="transactions">
121- <div class="transactions" v-if="transactions.length != 0">
120+ <section>
121+ <section class="transactions" v-if="transactions.length != 0">
122122 <vue-scroll ref="vs" @handle-scroll="handleScroll">
123- <ul class="list">
124- <li class="list-item" v-for="(transaction, index) in transactions" :key="index" >
125- <a :href="blockmeta(transaction.hash)" target="_blank">
126- <div>
127- <div class="font-bold">
128- {{transaction.type}}
129- </div>
130- <div class="addr color-grey" >{{transaction.address}}</div>
123+ <ul class="list">
124+ <li class="list-item" v-for="(transaction, index) in transactions" :key="index" >
125+ <a :href="blockmeta(transaction.hash)" target="_blank">
126+ <div>
127+ <div class="font-bold">
128+ {{transaction.type}}
129+ </div>
130+ <div class="addr color-grey" >{{transaction.address}}</div>
131131
132- </div>
133- <div class="text-align-right">
134- <div class="value">{{transaction.direct}}{{transaction.val}} {{currentAsset.asset.symbol}}</div>
135-
136- <div class="addr color-red" v-if="!transaction.status">
137- {{ $t('listAsset.fail') }}
138- </div>
139- <div class="addr color-grey" v-else-if="transaction.hasOwnProperty('blockTimestamp')">
140- {{transaction.submissionTimestamp | moment}}
141132 </div>
142- <div class="addr color-grey" v-else>
143- {{ $t('main.unconfirmed') }}
133+ <div class="text-align-right">
134+ <div class="value">{{transaction.direct}}{{transaction.val}} {{currentAsset.asset.symbol}}</div>
135+
136+ <div class="addr color-red" v-if="!transaction.status">
137+ {{ $t('listAsset.fail') }}
138+ </div>
139+ <div class="addr color-grey" v-else-if="transaction.hasOwnProperty('blockTimestamp')">
140+ {{transaction.submissionTimestamp | moment}}
141+ </div>
142+ <div class="addr color-grey" v-else>
143+ {{ $t('main.unconfirmed') }}
144+ </div>
144145 </div>
145- </div>
146- </a>
147- </li>
148- </ul>
146+ </a>
147+ </li>
148+ </ul>
149149 </vue-scroll>
150- </div>
150+ </section>
151151 <div v-else>
152152 <div class="bg-emptytx"></div>
153153 <div>
@@ -199,21 +199,21 @@ export default {
199199 this.enterActive = EnterActive
200200 this.leaveActive = LeaveActive
201201 },
202- 'currentAccount.balances'() {
203- if(this.$refs['vs']){
204- this.$refs['vs'].scrollTo(
205- {
206- y: 0
207- },
208- 500,
209- 'easeInQuad'
210- );
211- }
212- this.start = 0
213- this.refreshTransactions( this.start, limit, this.type).then(transactions => {
214- this.transactions = transactions
215- });
216- },
202+ // 'currentAccount.balances'() {
203+ // if(this.$refs['vs']){
204+ // this.$refs['vs'].scrollTo(
205+ // {
206+ // y: 0
207+ // },
208+ // 500,
209+ // 'easeInQuad'
210+ // );
211+ // }
212+ // this.start = 0
213+ // this.refreshTransactions( this.start, limit, this.type).then(transactions => {
214+ // this.transactions = transactions
215+ // });
216+ // },
217217 type(newVale){
218218 if(this.$refs['vs']){
219219 this.$refs['vs'].scrollTo(
@@ -244,6 +244,7 @@ export default {
244244 'listVote'
245245 ]),
246246 ...mapGetters([
247+ 'language',
247248 'currentAccount',
248249 'currency',
249250 'netType'
@@ -300,8 +301,8 @@ export default {
300301 return;
301302 }
302303
303- if ( (vertical.process == 1) && (this.transactions.length == (this.start+1)*limit) ) {
304- this.start += limit;
304+ if ( (vertical.process == 1) && (this.transactions.length == (this.start+limit)) ) {
305+ this.start = this.start + limit;
305306 this.refreshTransactions( this.start, limit, this.type).then(transactions => {
306307 transactions.forEach(transaction => {
307308 this.transactions.push(transaction);
@@ -376,6 +377,16 @@ export default {
376377
377378 if(transaction.types.includes('in_crosschain')){
378379 transaction.address = `${this.currentAsset.asset.symbol} ${this.$t("listAsset.main")}`
380+ }else if(transaction.types.includes('vote')){
381+ const pubKey = transaction.outputs.find( i => i.type ==='vote').vote
382+ const item = this.listVote[pubKey]
383+ transaction.address = item? (((this.language ==='zh' || this.language ==='cn')? (item.name ==='-'? null: item.name):item.nameEn)||address.short(item.pubKey)):'-'
384+ transaction.type = this.$t("common.vote")
385+ }else if(transaction.types.includes('veto')){
386+ const pubKey = transaction.inputs.find( i => i.type ==='veto').vote
387+ const item = this.listVote[pubKey]
388+ transaction.address = item? (((this.language ==='zh' || this.language ==='cn')? (item.name ==='-'? null: item.name):item.nameEn)||address.short(item.pubKey)):'-'
389+ transaction.type = this.$t("common.veto")
379390 }
380391 transaction.val = val ;
381392
@@ -401,12 +412,12 @@ export default {
401412 this.refreshTransactions( this.start, limit, this.type).then(transactions => {
402413 this.transactions = transactions
403414 });
404- if(this.listVote.length == 0 && this.netType === 'vapor'){
415+ if(Object.keys(this.listVote).length == 0 && this.netType === 'vapor'){
405416 query.chainStatus().then(resp => {
406417 if(resp){
407- const votes = resp.consensusNodes.map( (item, index) => {
408- item.rank = index+1;
409- return item
418+ const votes = {}
419+ resp.consensusNodes.map( (item) => {
420+ votes[item.pubKey] = item
410421 });
411422 this[Actions.SET_LIST_VOTE](votes)
412423 }
--- a/src/views/bapp.vue
+++ b/src/views/bapp.vue
@@ -37,7 +37,7 @@
3737 <div class="title">{{bapp.title}}</div>
3838 <div class="description">{{bapp.description}}</div>
3939 </div>
40- <img :src="require(`@/assets/img/bapp/${bapp.icon}`)" :alt="bapp.icon" v-on:error="onImgError($event, bapp.icon)"/>
40+ <img :src="src(bapp.icon)" :alt="bapp.icon" v-on:error="onImgError($event, bapp.icon)"/>
4141
4242 </a>
4343
@@ -68,17 +68,24 @@ export default {
6868 }else{
6969 list = list.map((l , index)=> Object.assign(l, this.jsonData['en'][index]))
7070 }
71-
7271 return list;
7372 },
7473 },
7574 methods: {
75+ src: function(name){
76+ try {
77+ const src = require(`@/assets/img/bapp/${name}`)
78+ return src
79+ } catch (ex) {
80+ return `${bappImgUrl}${name}`
81+ }
82+ },
7683 onImgError: function(event, name) {
7784 event.target.src = `${bappImgUrl}${name}`
7885 }
7986 },
8087 mounted() {
81- // Todo: update to production before publish
88+ // Todo: update to production before publish
8289 fetch(bappRequestUrl)
8390 .then(response => response.json())
8491 .then(json => {
--- a/src/views/home.vue
+++ b/src/views/home.vue
@@ -74,7 +74,7 @@
7474 padding: 12px 0 16px 0px;
7575 font-weight: 600;
7676 }
77-.transactions {
77+.assets {
7878 font-size: 15px;
7979 overflow: auto;
8080 flex-grow: 1;
@@ -302,7 +302,7 @@ input:checked + .slider:before {
302302 <section v-if="address!=undefined" class="transaction-title">
303303 <h3 class="color-black">{{ $t('main.asset') }}</h3>
304304 </section>
305- <section class="transactions">
305+ <section class="assets">
306306 <div v-if=" balances && balances.length > 0">
307307 <ul class="list">
308308 <li class="list-item" v-for="(balance, index) in balances" :key="index" @click="assetOpen(balance)">
--- a/src/views/prompts/bappPrompt.vue
+++ b/src/views/prompts/bappPrompt.vue
@@ -634,6 +634,13 @@
634634 types = _.union(inputType, outputType, types);
635635
636636 const remove = ['spend','control'];
637+ if(inputs[0].amount ===outputs[0].amount){
638+ const isVeto = inputs.find(o => o.type ==='veto')
639+ const isVote = outputs.find(o => o.type ==='vote')
640+ if(isVeto || isVote){
641+ remove.push('transfer')
642+ }
643+ }
637644 types = removeFromArray(types, remove);
638645 types = types.map(ty => this.$t(`common.${ty}`)).join(', ');
639646
--- a/src/views/sendTransaction/transfer.vue
+++ b/src/views/sendTransaction/transfer.vue
@@ -428,6 +428,7 @@ export default {
428428 });
429429
430430 this.transaction.asset = this.selectAsset.assetId;
431+ this.transaction.to = this.transaction.to.trim();
431432 transaction.transfer(this.transaction, password, this.address, this).then(result => {
432433 loader.hide();
433434 this.$router.push('/')
--- a/updates.xml
+++ b/updates.xml
@@ -1,6 +1,6 @@
11 <?xml version='1.0' encoding='UTF-8'?>
22 <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
33 <app appid='gnooapainaenaagmljnopepbheiaaaok'>
4- <updatecheck codebase='http://localhost:8000/chrome-ext.crx' version='3.0.2' prodversionmin='64.0.3242' />
4+ <updatecheck codebase='http://localhost:8000/chrome-ext.crx' version='3.0.3' prodversionmin='64.0.3242' />
55 </app>
66 </gupdate>
\ No newline at end of file
Show on old repository browser