{
"name": "Byone",
"description": "Bytom Chrome Extension Wallet",
- "version": "2.1.2",
+ "version": "2.1.3",
"author": "zhiting.fly@8btc.com",
"license": "MIT",
"private": true,
manifest_version: 2,
name: 'Byone',
description: 'Bytom Wallet Chrome extension, Bystore officially changed to Byone.',
- version: '2.1.2',
+ version: '2.1.3',
author: 'Bytom frontend, zhitinglin',
web_accessible_resources: ['js/inject.js', 'wasm/main.wasm'],
browser_action: {
import Bytom from 'bytom-js-sdk'
var networks = {
- testnetvapor: 'http://app.bycoin.io:3020/api/v1/vapor/',
- testnet: 'http://app.bycoin.io:3020/api/v1/btm/',
- mainnet: 'https://bcapi.bystack.com/api/v1/btm/',
- mainnetvapor: 'https://bcapi.bystack.com/api/v1/vapor/'
+ mainnet: 'https://bcapi.bystack.com/api/v2/btm/',
+ mainnetvapor: 'https://bcapi.bystack.com/api/v2/vapor/'
}
var bytom = new Bytom(networks, chrome.runtime.getURL('wasm/main.wasm'))
</div>
<div class="topbar-middle">
<div v-if="currentAsset!=undefined" class="amount color-white">
- <div v-if="currentAsset.symbol!=='-'">
+ <div v-if="currentAsset.symbol!=='Asset'">
<div class="symbol">
{{currentAsset.symbol}}
</div>
if (Number(balanceObject[0].amount) > 0) {
transaction.direct = "+";
const resultAddr = inputAddresses.pop()
- transaction.address = resultAddr.includes(' ')?resultAddr:address.short(resultAddr);
+ transaction.address = (resultAddr && resultAddr.includes(' '))?resultAddr:address.short(resultAddr);
} else {
transaction.direct = "-";
const resultAddr = outputAddresses.pop()
- transaction.address = resultAddr.includes(' ')?resultAddr:address.short(resultAddr);
+ transaction.address = (resultAddr && resultAddr.includes(' '))?resultAddr:address.short(resultAddr);
}
transaction.val = Num.formatNue(val, this.currentAsset.decimals) ;
<div class="value">{{ itemBalance(asset) }}</div>
<div class="addr color-grey">{{ formatCurrency(asset[ currency ]) }}</div>
</div>
- <div v-if="asset.symbol!== '-'">
+ <div v-if="asset.symbol!== 'Asset'">
<div class="uppercase">
{{asset.symbol}}
</div>
Asset
</div>
- <div class="addr color-grey uppercase">{{shortAddress(asset.asset)}}</div>
+ <div class="addr color-grey uppercase">{{ shortAddress(asset.asset) }}</div>
</div>
</li>
<div class="value">{{ itemBalance(asset) }}</div>
<div class="addr color-grey">{{ formatCurrency(asset[ currency ]) }}</div>
</div>
- <div v-if="asset.symbol!== '-'">
+ <div v-if="asset.symbol!== 'Asset'">
<div class="uppercase">
{{asset.symbol}}
</div>
this.transaction.to = address
transaction.build(this.account.guid, address, this.transaction.asset, Num.convertToNue(this.transaction.amount,this.selectAsset.decimals), this.transaction.confirmations).then(result => {
loader.hide();
- this.transaction.fee = Number(result.fee / 100000000);
+ if(!this.transaction.fee){
+ this.transaction.fee = Number( _.sumBy(result, 'fee') / 100000000);
+ }
this.$router.push({ name: 'transfer-confirm', params: { account: this.account, transaction: this.transaction, rawData: result,assetAlias: this.selectAsset.symbol, type: this.$route.query.type } })
}).catch(error => {
loader.hide();
this.transaction.to = address
transaction.buildCrossChain(this.account.guid, address, this.transaction.asset, Num.convertToNue(this.transaction.amount,this.selectAsset.decimals), this.transaction.confirmations).then(result => {
loader.hide();
- this.transaction.fee = Number(result.fee / 100000000);
+ if(!this.transaction.fee){
+ this.transaction.fee = Number( _.sumBy(result, 'fee') / 100000000);
+ }
this.$router.push({ name: 'transfer-confirm', params: { account: this.account, transaction: this.transaction, rawData: result, assetAlias: this.selectAsset.symbol, type: this.$route.query.type } })
}).catch(error => {
loader.hide();
onCancel: this.onCancel
});
+ account.setupNet(`${this.net}`);
if(this.netType === 'vapor'){
- account.setupNet(`${this.net}`);
account.create(this.formItem.accAlias, null, this.formItem.passwd1).then((resp) => {
account.setupNet(`${this.net}vapor`);
return account.copy(resp.guid).then((currentRespAccount)=>{
],
networks: [
{ label: this.$t('main.mainNet'), value: "mainnet" },
- { label: this.$t('main.testNet'), value: "testnet" },
],
selected: { label: "中文", value: "cn" },
hashVersion: "",
case 'mainnet':
network = this.networks[0]
break;
- case 'testnet':
- network = this.networks[1]
- break;
}
this.setupNetwork(network);
}
this.transaction.to = vote
transaction.buildVeto(this.currentAccount.guid, vote, Num.convertToNue(this.transaction.amount,8), this.transaction.confirmations).then(result => {
loader.hide();
- this.transaction.fee = Number(result.fee / 100000000);
+ if(!this.transaction.fee){
+ this.transaction.fee = Number( _.sumBy(result, 'fee') / 100000000);
+ }
this.$router.push({ name: 'vote-confirm', params: { account: this.currentAccount, transaction: this.transaction, assetAlias: 'BTM',rawData: result} })
}).catch(error => {
loader.hide();
this.transaction.to = vote
transaction.buildVote(this.currentAccount.guid, vote, Num.convertToNue(this.transaction.amount,8), this.transaction.confirmations).then(result => {
loader.hide();
- this.transaction.fee = Number(result.fee / 100000000);
+ if(!this.transaction.fee){
+ this.transaction.fee = Number( _.sumBy(result, 'fee') / 100000000);
+ }
this.$router.push({ name: 'vote-confirm', params: { account: this.currentAccount, transaction: this.transaction,assetAlias: 'BTM', rawData: result} })
}).catch(error => {
loader.hide();
onCancel: this.onCancel
});
- // rawData, password
- transaction.transfer(this.account.guid, this.rawData, this.password)
- .then(ret => {
- loader.hide();
- if(this.$route.params.type == 'popup'){
- LocalStream.send({method:'transfer',action:'success', message:ret});
- window.close();
- }
- this.$dialog.show({
- type: 'success',
- body: this.$t("transfer.success")
- });
- this.$router.push('/')
- if(this.transaction.type === 'toVapor'){
- account.setupNet(`${this.net}vapor`)
- }
- })
- .catch(error => {
- loader.hide();
- this.$dialog.show({
- body: getLang(error.message, this.language)
- });
- });
+ Promise.all(this.rawData.map( (rawdata) => transaction.transfer(this.account.guid, rawdata, this.password)))
+ .then(ret => {
+ loader.hide();
+ if(this.$route.params.type == 'popup'){
+ LocalStream.send({method:'transfer',action:'success', message:ret[ret.length-1]});
+ window.close();
+ }
+ this.$dialog.show({
+ type: 'success',
+ body: this.$t("transfer.success")
+ });
+ this.$router.push('/')
+ if(this.transaction.type === 'toVapor'){
+ account.setupNet(`${this.net}vapor`)
+ }
+ })
+ .catch(error => {
+ loader.hide();
+ this.$dialog.show({
+ body: getLang(error.message, this.language)
+ });
+ });
}
}, mounted() {
let params = this.$route.params;
import * as Actions from '@/store/constants';
let mainNet = null;
-let testNet = null;
export default {
name: "",
data() {
},
mounted() {
mainNet = { label: this.$t('main.mainNet'), value: "mainnet" };
- testNet = { label: this.$t('main.testNet'), value: "testnet" };
- this.nets = [mainNet, testNet];
+ this.nets = [mainNet];
if (this.net != undefined) {
if (this.net == "mainnet") {
this.selected = mainNet;
- } else if (this.net == "testnet") {
- this.selected = testNet;
}
} else {
this.selected = mainNet;
}
- account.setupNet(`${this.selected}`);
+ account.setupNet(`${this.selected.value}`);
this.i18n = getLanguage(this.language);
}
};
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='gnooapainaenaagmljnopepbheiaaaok'>
- <updatecheck codebase='http://localhost:8000/chrome-ext.crx' version='2.1.2' />
+ <updatecheck codebase='http://localhost:8000/chrome-ext.crx' version='2.1.3' />
</app>
</gupdate>
\ No newline at end of file