Skip to content

Commit

Permalink
fix: wethIsEth in nested handlers (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
agualis authored Aug 30, 2024
1 parent edd4e5e commit d10b72c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export class NestedAddLiquidityHandler implements AddLiquidityHandler {
slippagePercent,
queryOutput,
relayerApprovalSignature,
humanAmountsIn,
}: NestedBuildAddLiquidityInput): Promise<TransactionConfig> {
const addLiquidity = new AddLiquidityNested()

Expand All @@ -63,7 +64,7 @@ export class NestedAddLiquidityHandler implements AddLiquidityHandler {
slippage: Slippage.fromPercentage(`${Number(slippagePercent)}`),
accountAddress: account,
relayerApprovalSignature,
wethIsEth: false, // assuming we don't want to use the native asset over the wrapped native asset for now.
wethIsEth: this.helpers.isNativeAssetIn(humanAmountsIn),
})

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function _useRemoveLiquidity(urlTxHash?: Hash) {
const chain = pool.chain
const nativeAsset = getNativeAssetToken(chain)
const wNativeAsset = getWrappedNativeAssetToken(chain)
const includesWrappedNativeAsset: boolean = pool.poolTokens.some(token =>
const includesWrappedNativeAsset: boolean = getPoolTokens().some(token =>
isWrappedNativeAsset(token.address as Address, chain)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class NestedProportionalRemoveLiquidityHandler implements RemoveLiquidity
account,
slippagePercent,
queryOutput,
wethIsEth,
relayerApprovalSignature,
}: NestedProportionalQueryRemoveLiquidityInput): Promise<TransactionConfig> {
const removeLiquidity = new RemoveLiquidityNested()
Expand All @@ -65,7 +66,7 @@ export class NestedProportionalRemoveLiquidityHandler implements RemoveLiquidity
slippage: Slippage.fromPercentage(`${Number(slippagePercent)}`),
accountAddress: account,
relayerApprovalSignature,
wethIsEth: false, // assuming we don't want to use the native asset over the wrapped native asset for now.
wethIsEth,
})

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class NestedSingleTokenRemoveLiquidityHandler implements RemoveLiquidityH
slippagePercent,
queryOutput,
relayerApprovalSignature,
wethIsEth,
}: NestedSingleTokenQueryRemoveLiquidityInput): Promise<TransactionConfig> {
const removeLiquidity = new RemoveLiquidityNested()

Expand All @@ -77,7 +78,7 @@ export class NestedSingleTokenRemoveLiquidityHandler implements RemoveLiquidityH
slippage: Slippage.fromPercentage(`${Number(slippagePercent)}`),
accountAddress: account,
relayerApprovalSignature,
wethIsEth: false, // assuming we don't want to use the native asset over the wrapped native asset for now.
wethIsEth,
})

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function useRemoveLiquidityBuildCallDataQuery({
poolId: pool.id,
humanBptIn: debouncedHumanBptIn,
tokenOut: singleTokenOutAddress, // only required by SingleToken removal
wethIsEth, // only required by SingleToken removal
wethIsEth,
}

const queryKey = removeLiquidityKeys.buildCallData(params)
Expand Down

0 comments on commit d10b72c

Please sign in to comment.