Skip to content

Commit

Permalink
docs(position): add deprecated warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Jan 14, 2025
1 parent 240609f commit 56dcf04
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/blue-sdk-ethers/test/e2e/setup.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { createEthersTest } from "@morpho-org/test/vitest/ethers";
import { mainnet } from "viem/chains";

/**
* This test will run on `mainnet` forked at block `19,530,000`.
*/
export const test = createEthersTest(mainnet, {
forkUrl: process.env.MAINNET_RPC_URL,
forkBlockNumber: 19_530_000,
});

/**
* This test will run on `mainnet` forked at block `21,595,000`.
*/
export const test2 = createEthersTest(mainnet, {
forkUrl: process.env.MAINNET_RPC_URL,
forkBlockNumber: 21_595_000,
Expand Down
6 changes: 6 additions & 0 deletions packages/blue-sdk-viem/test/setup.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { createViemTest } from "@morpho-org/test/vitest";
import { mainnet } from "viem/chains";

/**
* This test will run on `mainnet` forked at block `19,530,000`.
*/
export const test = createViemTest(mainnet, {
forkUrl: process.env.MAINNET_RPC_URL,
forkBlockNumber: 19_530_000,
});

/**
* This test will run on `mainnet` forked at block `21,595,000`.
*/
export const test2 = createViemTest(mainnet, {
forkUrl: process.env.MAINNET_RPC_URL,
forkBlockNumber: 21_595_000,
Expand Down
24 changes: 24 additions & 0 deletions packages/blue-sdk/src/position/Position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,34 @@ export class AccrualPosition extends Position implements IAccrualPosition {
return this.market.getBorrowCapacityUsage(this);
}

/**
* Returns the maximum amount of loan assets that can be borrowed given a certain borrow position
* and the reason for the limit.
* Returns `undefined` iff the market's price is undefined.
* @deprecated Use `getBorrowCapacityLimit` instead.
*/
get borrowCapacityLimit() {
return this.market.getBorrowCapacityLimit(this);
}

/**
* Returns the maximum amount of loan assets that can be withdrawn given a certain supply position
* and a balance of loan assets, and the reason for the limit.
*/
get withdrawCapacityLimit() {
return this.market.getWithdrawCapacityLimit(this);
}

/**
* Returns the maximum amount of collateral assets that can be withdrawn given a certain borrow position
* and the reason for the limit.
* Returns `undefined` iff the market's price is undefined.
* @deprecated Use `getWithdrawCollateralCapacityLimit` instead.
*/
get withdrawCollateralCapacityLimit() {
return this.market.getWithdrawCollateralCapacityLimit(this);
}

/**
* Returns a new position derived from this position, whose interest has been accrued up to the given timestamp.
* @param timestamp The timestamp at which to accrue interest. Must be greater than or equal to the market's `lastUpdate`.
Expand Down

0 comments on commit 56dcf04

Please sign in to comment.