@morpho-org/blue-sdk 3.0.0-next.7 → 3.0.0-next.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Market, type MaxBorrowOptions, type MaxPositionCapacities, type MaxWithdrawCollateralOptions } from "../market/index.js";
|
|
1
|
+
import { type IMarket, Market, type MaxBorrowOptions, type MaxPositionCapacities, type MaxWithdrawCollateralOptions } from "../market/index.js";
|
|
2
2
|
import type { Address, BigIntish, MarketId } from "../types.js";
|
|
3
3
|
export interface IPosition {
|
|
4
4
|
user: Address;
|
|
@@ -37,7 +37,7 @@ export declare class AccrualPosition extends Position implements IAccrualPositio
|
|
|
37
37
|
* The market on which this position is held.
|
|
38
38
|
*/
|
|
39
39
|
readonly market: Market;
|
|
40
|
-
constructor(position: IAccrualPosition, market:
|
|
40
|
+
constructor(position: IAccrualPosition, market: IMarket);
|
|
41
41
|
get supplyAssets(): bigint;
|
|
42
42
|
get borrowAssets(): bigint;
|
|
43
43
|
/**
|
package/lib/position/Position.js
CHANGED
|
@@ -40,8 +40,9 @@ class AccrualPosition extends Position {
|
|
|
40
40
|
*/
|
|
41
41
|
market;
|
|
42
42
|
constructor(position, market) {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
const _market = new index_js_1.Market(market);
|
|
44
|
+
super({ ...position, marketId: _market.id });
|
|
45
|
+
this.market = _market;
|
|
45
46
|
}
|
|
46
47
|
get supplyAssets() {
|
|
47
48
|
return this.market.toSupplyAssets(this.supplyShares);
|