h-agent-swap 1.1.6 → 1.2.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 +1 -1
- package/src/agent-swap.js +1 -1
- package/src/swap-router.js +3 -1
package/package.json
CHANGED
package/src/agent-swap.js
CHANGED
|
@@ -340,7 +340,7 @@ class AgentSwap extends HI {
|
|
|
340
340
|
console.log([
|
|
341
341
|
signType, token, amount, deadline, sign
|
|
342
342
|
])
|
|
343
|
-
let parmas = await this.buildTx("
|
|
343
|
+
let parmas = await this.buildTx("withdrawal", [
|
|
344
344
|
signType, token, amount, deadline, sign
|
|
345
345
|
])
|
|
346
346
|
let result = parmas && await this.broadTx(parmas)
|
package/src/swap-router.js
CHANGED
|
@@ -114,7 +114,9 @@ class SwapRouter extends HI {
|
|
|
114
114
|
})
|
|
115
115
|
let pair = await factory.getPair({ token0,token1 })
|
|
116
116
|
let token = new HERC20({ ...this.network, contract: pair })
|
|
117
|
-
|
|
117
|
+
|
|
118
|
+
let liquidityAmount = await token.fromAmount(liquidity)
|
|
119
|
+
await token.tradeApprove(this.contract,liquidityAmount)
|
|
118
120
|
|
|
119
121
|
let result = await this.manage("removeLiquidity", [
|
|
120
122
|
token0,
|