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 +1 -1
- package/src/swap-router.js +8 -0
package/package.json
CHANGED
package/src/swap-router.js
CHANGED
|
@@ -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,
|