Skip to content

Commit

Permalink
fix: gas limit
Browse files Browse the repository at this point in the history
  • Loading branch information
viet-nv committed Jan 6, 2025
1 parent 7db2e81 commit fb92fc1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"@kyberswap/ks-sdk-classic": "^1.0.3",
"@kyberswap/ks-sdk-core": "1.1.7",
"@kyberswap/ks-sdk-elastic": "^1.1.2",
"@kyberswap/liquidity-widgets": "1.1.0",
"@kyberswap/zap-migration-widgets": "1.0.0",
"@kyberswap/liquidity-widgets": "1.1.1",
"@kyberswap/zap-migration-widgets": "1.0.1",
"@kyberswap/oauth2": "1.0.2",
"@lingui/macro": "^4.6.0",
"@lingui/react": "^4.6.0",
Expand Down
3 changes: 3 additions & 0 deletions src/pages/Earns/useLiquidityWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ const useLiquidityWidget = () => {
onOpenZapMigration: handleOpenZapMigrationWidget,
onSubmitTx: async (txData: { from: string; to: string; data: string; value: string; gasLimit: string }) => {
try {
console.log('txData', txData)
if (!library) throw new Error('Library is not ready!')
const gas = await library.estimateGas(txData)
console.log(gas)
const res = await library?.getSigner().sendTransaction(txData)
if (!res) throw new Error('Transaction failed')
return res.hash
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3765,10 +3765,10 @@
tiny-invariant "^1.1.0"
tiny-warning "^1.0.3"

"@kyberswap/liquidity-widgets@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@kyberswap/liquidity-widgets/-/liquidity-widgets-1.1.0.tgz#4d498247fa24ee2c3b987d1e356a45782bee4cae"
integrity sha512-x0HP60neiaVuAUFarghGpbJcY5TVEGMRqRWaznp/UPn9i+xRfy01bl+8RhltyPmNt3tHfhDIqVhdWnJPS8REZg==
"@kyberswap/liquidity-widgets@1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@kyberswap/liquidity-widgets/-/liquidity-widgets-1.1.1.tgz#3550132c3a86214eac8582d0c1a61fd65391e5e0"
integrity sha512-MY2otLHQ7tNXP8GtYtiY5XjtY9h+JJDqUXex/8pK1junakSAfETW+vyyp22pK/R6uerX9+rT7rhyGJ7zRlO1XQ==
dependencies:
"@popperjs/core" "^2.11.8"
"@radix-ui/react-accordion" "^1.2.1"
Expand All @@ -3794,10 +3794,10 @@
axios "1.2.1"
client-oauth2 "^4.3.3"

"@kyberswap/zap-migration-widgets@1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@kyberswap/zap-migration-widgets/-/zap-migration-widgets-1.0.0.tgz#2824ed0b52884dfc80abc7792386ea38db25986a"
integrity sha512-27Q9EEgfk6HopaBbWKahPXjfPUfhFrpLRDYqTllk71PvclC4xiqMu3nXRD+yyUyNjNBqVNiQyFn0otDQXDHNEw==
"@kyberswap/zap-migration-widgets@1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@kyberswap/zap-migration-widgets/-/zap-migration-widgets-1.0.1.tgz#8cf887ea0b976d810aa85919aa8b1b46a62448ae"
integrity sha512-G0gQnu++czi+fbcuKs/XqB9TJIKf1xEv7klwKmV6GO5twCLuZxdKeKukVLSL7rEpsdjERP1zgiFeKrCN/W7Xmg==
dependencies:
"@popperjs/core" "^2.11.8"
react-popper "^2.3.0"
Expand Down

0 comments on commit fb92fc1

Please sign in to comment.