h-agent-swap 1.9.8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "h-agent-swap",
3
- "version": "1.9.8",
3
+ "version": "2.0.0",
4
4
  "description": "agent-swap",
5
5
  "main": "src/index.js",
6
6
  "files": [
package/src/agent-swap.js CHANGED
@@ -366,8 +366,10 @@ class AgentSwap extends HI {
366
366
  } else {
367
367
  inAmount = await this.computeAmount({ amount,path,side,point,format:true })
368
368
  outAmount = await OToken.toAmount(amount)
369
+ inputAmount = await IToken.toAmount(amount)
369
370
  }
370
371
  let user = this.web3.eth.defaultAccount
372
+ console.log([inToken,outToken,path,inputAmount,outAmount,user])
371
373
  let result = await this.SC.methods.fundRead(inToken,outToken,path,inputAmount,outAmount,user).call()
372
374
  console.log(result)
373
375
 
@@ -378,7 +380,7 @@ class AgentSwap extends HI {
378
380
  result.backAmount = toSmall(result.group.backAmount,decimals)
379
381
  result.buyAmount = toSmall(result.group.buyAmount,decimals)
380
382
  result.change = toSmall(result.group.change,decimals)
381
- result.win = parseInt(result.group.win) == 1
383
+ result.win = result.group.win
382
384
 
383
385
  result.feeRate = division(result.config.feeRate,this.pointMax)
384
386
  result.reward = division(result.config.reward,this.pointMax)