Skip to content

Commit

Permalink
feat: fix buy fert
Browse files Browse the repository at this point in the history
  • Loading branch information
Space-Bean committed Oct 9, 2024
1 parent fee04a6 commit 4aa9f6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion projects/ui/src/components/Barn/Actions/Buy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -655,13 +655,16 @@ function getSwapOperation(
if (!sellToken) {
throw new Error('No token selected');
}
if (!amountIn || !amountOut) {
if (!amountIn) {
throw new Error('No amounts detected');
}

if (buyToken.equals(sellToken)) {
return { operation, postClaimOperation };
}
if (!amountIn || !amountOut) {
throw new Error('No amounts detected');
}

if (!quoteData) {
throw new Error('No quote data');
Expand Down
4 changes: 4 additions & 0 deletions projects/ui/src/lib/Txn/FarmSteps/barn/BuyFarmStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ export class BuyFertilizerFarmStep extends FarmStep {
setInput();
}

if (wstETHIn && !operation) {
setInput();
}

if (claimOperation) {
this.pushInput({
input: [...claimOperation.getFarm().generators],
Expand Down

0 comments on commit 4aa9f6f

Please sign in to comment.