import config from 'config';
+import BigNumber from "bignumber.js/bignumber";
let depositProgram
let profitProgram
let expireBlockHeight
let banker
let gas
+let radio
const GetContractArgs = function() {
if(window.bytom && window.bytom.defaultAccount && window.bytom.defaultAccount.net){
expireBlockHeight = object.expireBlockHeight
banker = object.banker
gas = object.gas
+ radio =BigNumber(object.totalAmountCapital).div(object.totalAmountBill).toNumber()
}
}
dueBlockHeight,
expireBlockHeight,
banker,
- gas
+ gas,
+ radio
};
}
}).then(resp => {
if(resp.length === 0) {
throw 'Empty UTXO info, it might be that the utxo is locked. Please retry after 60s.'
+ }else if(amountBill < 100000000){
+ throw 'Please enter an amount bigger or equal than 100000000.'
}
- const radio = BigNumber( GetContractArgs().totalAmountCapital).div(GetContractArgs().totalAmountBill)
+ const radio = BigNumber( GetContractArgs().radio )
const matchesAmount = radio.multipliedBy(amountBill).toNumber()
const result = matchesUTXO(resp, matchesAmount)
"order":"desc"
}
}).then(resp => {
+ const limit = GetContractArgs().radio * 100000000
if(resp.length === 0) {
throw 'Empty UTXO info, it might be that the utxo is locked. Please retry after 60s.'
+ }else if(amount < limit){
+ throw `Please enter an amount bigger or equal than ${limit}.`
}
const result = matchesUTXO(resp, amount)