Skip to content

Commit

Permalink
fix(lending-pools): Move calculateWithdrawReturn and calculateDeposit…
Browse files Browse the repository at this point in the history
…Return outside of AddLiquidity and Remove liquidity
  • Loading branch information
gulcinuras committed Jan 11, 2024
1 parent 8fe9c5c commit 84080f8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 31 deletions.
34 changes: 6 additions & 28 deletions dist/folks-lending-pools/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import algosdk from "algosdk";
import * as AddLiquidity from "./add-liquidity";
import * as RemoveLiquidity from "./remove-liquidity";
import { getFolksWrapperAppOptInRequiredAssetIDs } from "./add-liquidity/utils";
import { FolksLendingPool } from "./types";
/**
Expand All @@ -14,34 +16,10 @@ declare function calculateWithdrawReturn(withdrawAmount: number, depositInterest
*/
export declare function fetchFolksLendingPool(algod: algosdk.Algodv2, appId: number): Promise<FolksLendingPool>;
export declare const LendingPool: {
AddLiquidity: {
calculateDepositReturn: typeof calculateDepositReturn;
generateTxns({ client, network, poolAddress, poolTokenId, lendingManagerId, asset1In, asset2In, initiatorAddr }: {
client: algosdk.Algodv2;
network: import("..").SupportedNetwork;
poolAddress: string;
poolTokenId: number;
lendingManagerId: number;
asset1In: import("./types").FolksLendingAssetInfo;
asset2In: import("./types").FolksLendingAssetInfo;
initiatorAddr: string;
}): Promise<import("..").SignerTransaction[]>;
getAddLiquidityTotalFee(wrapperAppOptInRequiredAssetIdCount?: number | undefined): number;
};
RemoveLiquidity: {
calculateWithdrawReturn: typeof calculateWithdrawReturn;
generateTxns({ client, pool, poolTokenIn, initiatorAddr, asset1Out, asset2Out, lendingManagerId, network }: {
client: algosdk.Algodv2;
pool: Pick<import("..").V2PoolInfo, "account" | "poolTokenID">;
poolTokenIn: number | bigint;
initiatorAddr: string;
asset1Out: Omit<import("./types").FolksLendingAssetInfo, "amount">;
asset2Out: Omit<import("./types").FolksLendingAssetInfo, "amount">;
lendingManagerId: number;
network: import("..").SupportedNetwork;
}): Promise<import("..").SignerTransaction[]>;
getRemoveLiquidityTotalFee(): number;
};
AddLiquidity: typeof AddLiquidity;
RemoveLiquidity: typeof RemoveLiquidity;
calculateWithdrawReturn: typeof calculateWithdrawReturn;
calculateDepositReturn: typeof calculateDepositReturn;
getFolksWrapperAppOptInRequiredAssetIDs: typeof getFolksWrapperAppOptInRequiredAssetIDs;
};
export {};
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/folks-lending-pools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ export async function fetchFolksLendingPool(
}

export const LendingPool = {
AddLiquidity: {...AddLiquidity, calculateDepositReturn},
RemoveLiquidity: {...RemoveLiquidity, calculateWithdrawReturn},
AddLiquidity,
RemoveLiquidity,
calculateWithdrawReturn,
calculateDepositReturn,
getFolksWrapperAppOptInRequiredAssetIDs
};

0 comments on commit 84080f8

Please sign in to comment.