import account from "@/models/account";
import add from "@/utils/address";
import { camelize, removeFromArray } from "@/utils/utils";
- import bytomjslib from 'bytomjs-lib'
+ // import bytomjslib from 'bytomjs-lib'
import BigNumber from "bignumber.js"
export default {
}
}, mounted() {
this.prompt = window.data || apis.extension.getBackgroundPage().notification || null;
+ console.log('mounted')
console.log(this.prompt)
const params = this.prompt.data
}
case "signTransaction":{
const param = data[0] || data
-
const _tx = camelize(param)
const rawTransaction = _tx.rawTransaction
- const tx = this.netType === 'vapor'?
- bytomjslib.vapor.Transaction.decodeRawTransaction(rawTransaction):
- bytomjslib.bytom.Transaction.decodeRawTransaction(rawTransaction)
-
+ // const tx = this.netType === 'vapor'?
+ // bytomjslib.vapor.Transaction.decodeRawTransaction(rawTransaction):
+ // bytomjslib.bytom.Transaction.decodeRawTransaction(rawTransaction)
+ const tx = _tx.tx
this.transaction.fee = tx.fee/100000000
this.transaction.input = tx.inputs
this.transaction.output = tx.outputs
const asset = _.union(inputAsset, outputAsset)
let that = this;
- let types = ["transfer"]
+ let types = ["transfer", "vote"]
const promise =
asset
.map((assetId) => {
types = removeFromArray(types, remove);
types = types.map(ty => this.$t(`common.${ty}`)).join(', ');
- this.transaction.types = types
+ // this.transaction.types = types
+ this.transaction.types = tx.types.map(ty => this.$t(`common.${ty}`)).join(', ');
Promise.all(promise).then(function(output) {
that.transaction.amounts = output
import { camelize, removeFromArray } from "@/utils/utils";
import { decimalsMap } from "@/utils/constants"
import BigNumber from "bignumber.js"
-import bytomjslib from 'bytomjs-lib'
+// import bytomjslib from 'bytomjs-lib'
export default {
this.currentAccount.address
account.setupNet(`${this.net}${this.netType}`)
-
- const tx = this.netType === 'vapor'?
- bytomjslib.vapor.Transaction.decodeRawTransaction(rawTransaction):
- bytomjslib.bytom.Transaction.decodeRawTransaction(rawTransaction)
+ const tx = _tx.tx
+ // const tx = this.netType === 'vapor'?
+ // bytomjslib.vapor.Transaction.decodeRawTransaction(rawTransaction):
+ // bytomjslib.bytom.Transaction.decodeRawTransaction(rawTransaction)
this.transaction.fee = tx.fee/100000000
this.transaction.input = tx.inputs
this.transaction.output = tx.outputs