• R/O
  • HTTP
  • SSH
  • HTTPS

Byone: Commit

Bytom Wallet for Chrome


Commit MetaInfo

Révisione474e026f20d57f2846329328f59f459ada3393b (tree)
l'heure2019-09-10 10:42:02
AuteurZhiting Lin <zlin035@uott...>
CommiterZhiting Lin

Message de Log

update teh cross chain transaction

Change Summary

Modification

--- 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, Bystore officially changed to Byone.',
5- version: '2.0.1',
5+ version: '2.1.0',
66 author: 'Bytom frontend, zhitinglin',
77 web_accessible_resources: ['js/inject.js', 'wasm/main.wasm'],
88 browser_action: {
--- a/src/models/bytom.js
+++ b/src/models/bytom.js
@@ -2,9 +2,9 @@ import Bytom from 'bytom-js-sdk'
22
33 var networks = {
44 testnetvapor: 'http://52.82.55.145:3000/api/v1/vapor/',
5- testnetbytom: 'http://52.82.55.145:3000/api/v1/btm/',
6- solonetbytom: 'http://app.bycoin.io:3060/api/v1/btm/',
7- mainnetbytom: 'https://api.bycoin.im:8000/api/v1/btm/',
5+ testnet: 'http://52.82.55.145:3000/api/v1/btm/',
6+ solonet: 'http://app.bycoin.io:3060/api/v1/btm/',
7+ mainnet: 'https://api.bycoin.im:8000/api/v1/btm/',
88 mainnetvapor: 'https://api.bycoin.im:8000/api/v1/vapor/'
99 }
1010
--- a/src/store/actions.js
+++ b/src/store/actions.js
@@ -33,7 +33,7 @@ export const actions = {
3333 return new Promise(async (resolve, reject) => {
3434 const bytom = Bytom.fromJson(state.bytom);
3535 bytom.settings.network = 'mainnet';
36- account.setupNet('mainnetbytom')
36+ account.setupNet('mainnet')
3737 account.list().then(accounts => {
3838 bytom.accountList = accounts;
3939 if (accounts.length > 0) {
@@ -43,8 +43,9 @@ export const actions = {
4343 }
4444
4545 bytom.settings.login = true
46- bytom.settings.netType = 'bytom'
47- dispatch(Actions.UPDATE_STORED_BYTOM, bytom).then(_bytom => {
46+ bytom.settings.currency = "in_cny"
47+ bytom.settings.netType = ''
48+ dispatch(Actions.UPDATE_STORED_BYTOM, bytom).then(_bytom => {
4849 dispatch(Actions.SET_BYTOM, Bytom.fromJson(_bytom));
4950 resolve();
5051 })
@@ -57,7 +58,7 @@ export const actions = {
5758 return new Promise(async (resolve, reject) => {
5859 const bytom = Bytom.fromJson(state.bytom);
5960 bytom.settings.network = network;
60- account.setupNet(`${network}bytom`)
61+ account.setupNet(`${network}`)
6162 account.list().then(accounts => {
6263 bytom.accountList = accounts;
6364 if (accounts.length > 0) {
@@ -65,7 +66,8 @@ export const actions = {
6566 }
6667
6768 bytom.settings.login = true
68- bytom.settings.netType = 'bytom'
69+ bytom.settings.currency = "in_cny"
70+ bytom.settings.netType = ''
6971 dispatch(Actions.UPDATE_STORED_BYTOM, bytom).then(_bytom => {
7072 dispatch(Actions.SET_BYTOM, Bytom.fromJson(_bytom));
7173 resolve();
--- a/src/views/assetList.vue
+++ b/src/views/assetList.vue
@@ -282,6 +282,8 @@ export default {
282282 transaction.type = 'vote'
283283 }else if(_.find(transaction.outputs, function(o) { return o.type =='crosschain_output'; })){
284284 transaction.type = 'crossChain'
285+ }else if(_.find(transaction.inputs, function(o) { return o.type =='crosschain_input'; })){
286+ transaction.type = 'crossChain'
285287 }
286288
287289 if(balanceObject.length ===1 ){
--- a/src/views/home.vue
+++ b/src/views/home.vue
@@ -149,7 +149,7 @@
149149 </a>
150150 </div>
151151 <div class="topbar-middle bg-secondary">
152- <select class="network-select" :value="netType" @change="netTypeToggle">
152+ <select class="network-select" :value="netType||'bytom'" @change="netTypeToggle">
153153 <option value="bytom">{{ $t('main.bytom') }} {{net}}</option>
154154 <option value="vapor">{{ $t('main.vapor') }} {{net}}</option>
155155 </select>
@@ -228,10 +228,29 @@
228228 </ul>
229229 </div>
230230 <div v-else>
231- <div class="bg-emptytx"></div>
232- <div>
233- <span class="color-lightgrey center-text no-record">{{$t('main.noAssetRecord')}}</span>
234- </div>
231+ <ul class="list">
232+ <li class="list-item" v-for="(asset, index) in defaultBalances" :key="index" @click="assetOpen(asset)">
233+ <div class="float-right text-align-right">
234+ <div class="value">{{ itemBalance(asset) }}</div>
235+ <div class="addr color-grey">{{ formatCurrency(asset[ currency ]) }}</div>
236+ </div>
237+ <div v-if="asset.symbol">
238+ <div class="uppercase">
239+ {{asset.symbol}}
240+ </div>
241+
242+ <div class="addr color-grey">{{asset.name}}</div>
243+ </div>
244+ <div v-else>
245+ <div>
246+ Asset
247+ </div>
248+
249+ <div class="addr color-grey uppercase">{{shortAddress(asset.asset)}}</div>
250+ </div>
251+
252+ </li>
253+ </ul>
235254 </div>
236255 </div>
237256 <div v-else>
@@ -277,6 +296,19 @@ export default {
277296 limit: 10,
278297 enterActive: EnterActive,
279298 leaveActive: LeaveActive,
299+ defaultBalances: [
300+ {
301+ alias: "btm",
302+ asset: BTM,
303+ name: "Bytom",
304+ symbol: "BTM",
305+ balance: 0,
306+ decimals: 8,
307+ in_btc: "0",
308+ in_cny: "0",
309+ in_usd: "0"
310+ }
311+ ],
280312 };
281313 },
282314 watch: {
@@ -370,7 +402,7 @@ export default {
370402 account.setupNet(`${this.net}${this.netType}`);
371403 },
372404 netTypeToggle: function (event) {
373- const newNetType = event.target.value
405+ const newNetType = event.target.value ==='bytom'? '' :event.target.value;
374406 if( newNetType !== this.netType){
375407 const bytom = this.bytom.clone();
376408
--- a/src/views/sendTransaction/crossChainTransaction.vue
+++ b/src/views/sendTransaction/crossChainTransaction.vue
@@ -339,7 +339,7 @@ export default {
339339 if(this.transaction.type === 'toVapor'){
340340 transaction.chainStatus().then((resp)=>{
341341 const address = resp.federation_address
342- account.setupNet(`${this.net}bytom`)
342+ account.setupNet(`${this.net}`)
343343 this.transaction.to = address
344344 transaction.build(this.account.guid, address, this.transaction.asset, Num.convertToNue(this.transaction.amount,this.selectAsset.decimals), this.transaction.confirmations).then(result => {
345345 loader.hide();
--- a/src/views/sideMenu/menuCreation.vue
+++ b/src/views/sideMenu/menuCreation.vue
@@ -106,22 +106,8 @@ export default {
106106 onCancel: this.onCancel
107107 });
108108
109- if(this.netType === 'bytom'){
110- account.create(this.formItem.accAlias, null, this.formItem.passwd1).then(account => {
111- this[Actions.CREATE_NEW_BYTOM_ACCOUNT](account).then(()=>{
112- loader.hide();
113- this.$router.push('/');
114- })
115-
116- }).catch(err => {
117- console.log(err);
118- loader.hide();
119- this.$dialog.show({
120- body: err.message
121- });
122- });
123- }else if(this.netType === 'vapor'){
124- account.setupNet(`${this.net}bytom`);
109+ if(this.netType === 'vapor'){
110+ account.setupNet(`${this.net}`);
125111 account.create(this.formItem.accAlias, null, this.formItem.passwd1).then((resp) => {
126112 account.setupNet(`${this.net}vapor`);
127113 return account.copy(resp.guid).then((currentRespAccount)=>{
@@ -137,6 +123,20 @@ export default {
137123 body: err.message
138124 });
139125 });
126+ }else{
127+ account.create(this.formItem.accAlias, null, this.formItem.passwd1).then(account => {
128+ this[Actions.CREATE_NEW_BYTOM_ACCOUNT](account).then(()=>{
129+ loader.hide();
130+ this.$router.push('/');
131+ })
132+
133+ }).catch(err => {
134+ console.log(err);
135+ loader.hide();
136+ this.$dialog.show({
137+ body: err.message
138+ });
139+ });
140140 }
141141 },
142142 ...mapActions([
--- a/src/views/sideMenu/menuSettings.vue
+++ b/src/views/sideMenu/menuSettings.vue
@@ -119,7 +119,7 @@ export default {
119119 if (bytom.settings.network != val.value) {
120120 bytom.settings.network = val.value;
121121 this.network = val;
122- account.setupNet(`${val.value}bytom`);
122+ account.setupNet(`${val.value}`);
123123
124124 bytom.currentAccount = {}
125125 account.list()
--- a/src/views/welcome/creation.vue
+++ b/src/views/welcome/creation.vue
@@ -328,7 +328,7 @@ export default {
328328 },
329329 watch: {
330330 selected: function (value) {
331- account.setupNet(`${value.value}bytom`);
331+ account.setupNet(`${value.value}`);
332332 }
333333 },
334334 mounted() {
@@ -352,7 +352,7 @@ export default {
352352 } else {
353353 this.selected = mainNet;
354354 }
355- account.setupNet(`${this.selected}bytom`);
355+ account.setupNet(`${this.selected}`);
356356 this.i18n = getLanguage(this.language);
357357 }
358358 };
Afficher sur ancien navigateur de dépôt.