h-agent-swap 1.1.1 → 1.1.3

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.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "agent-swap",
5
5
  "main": "src/index.js",
6
6
  "files": [
package/src/agent-swap.js CHANGED
@@ -317,6 +317,15 @@ class AgentSwap extends HI {
317
317
  return signature
318
318
  }
319
319
 
320
+ async rewardAmount({ token,amount }) {
321
+ let symbol = new HERC20({
322
+ ...this.network,
323
+ contract:token
324
+ })
325
+ let result = await symbol.transfer(this.contract,amount)
326
+ return result
327
+ }
328
+
320
329
 
321
330
 
322
331
  async withdrawal({ signType, token, amount, sign, deadline = 0 }) {
@@ -81,6 +81,10 @@ class SwapRouter extends HI {
81
81
  let Token1 = new HERC20({ ...this.network, contract: token1 })
82
82
  await Token0.tradeApprove(this.contract,amount0)
83
83
  await Token1.tradeApprove(this.contract,amount1)
84
+
85
+ amount0 = await Token0.toAmount(amount0)
86
+ amount1 = await Token1.toAmount(amount1)
87
+
84
88
  let result = await this.manage("addLiquidity", [
85
89
  token0,
86
90
  token1,