h-agent-swap 1.1.5 → 1.1.6

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.5",
3
+ "version": "1.1.6",
4
4
  "description": "agent-swap",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -108,6 +108,14 @@ class SwapRouter extends HI {
108
108
  // amount0 = await Token0.toAmount(amount0)
109
109
  // amount1 = await Token1.toAmount(amount1)
110
110
 
111
+ let factory = new SwapFactory({
112
+ ...this.network,
113
+ contract:this.factory
114
+ })
115
+ let pair = await factory.getPair({ token0,token1 })
116
+ let token = new HERC20({ ...this.network, contract: pair })
117
+ await token.tradeApprove(this.contract,liquidity)
118
+
111
119
  let result = await this.manage("removeLiquidity", [
112
120
  token0,
113
121
  token1,