impermax-sdk 2.1.57 → 2.1.59
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.
- package/lib/offchain/offchainAPRHelper.js +1 -0
- package/lib/onchain/account/lendingPool/nftlp/onchainAccountNftlp.d.ts +4 -2
- package/lib/onchain/account/lendingPool/nftlp/onchainAccountNftlp.js +3 -2
- package/lib/onchain/account/lendingPool/onchainAccountCollateralV3.d.ts +3 -0
- package/lib/onchain/account/lendingPool/onchainAccountCollateralV3.js +2 -0
- package/lib/onchain/account/lendingPool/onchainAccountLendingPoolV3.d.ts +0 -1
- package/lib/onchain/account/lendingPool/onchainAccountLendingPoolV3.js +1 -2
- package/lib/onchain/impermaxFactory/lendingPool/nftlp/onchainNftlp.d.ts +14 -8
- package/lib/onchain/impermaxFactory/lendingPool/nftlp/onchainNftlp.js +28 -4
- package/lib/onchain/impermaxFactory/lendingPool/nftlp/onchainNftlpUniswapV3.d.ts +8 -9
- package/lib/onchain/impermaxFactory/lendingPool/nftlp/onchainNftlpUniswapV3.js +5 -13
- package/lib/onchain/impermaxFactory/lendingPool/onchainCollateralV3.d.ts +3 -0
- package/lib/onchain/impermaxFactory/lendingPool/onchainCollateralV3.js +4 -0
- package/lib/onchain/impermaxFactory/lendingPool/onchainLendingPoolV3.d.ts +0 -1
- package/lib/onchain/impermaxFactory/lendingPool/onchainLendingPoolV3.js +1 -4
- package/lib/onchain/interactions/lendingPool/nftlp/onchainInteractionsNftlp.d.ts +4 -2
- package/lib/onchain/interactions/lendingPool/nftlp/onchainInteractionsNftlp.js +3 -2
- package/lib/onchain/interactions/lendingPool/onchainInteractionsCollateralV3.d.ts +3 -0
- package/lib/onchain/interactions/lendingPool/onchainInteractionsCollateralV3.js +2 -0
- package/lib/onchain/interactions/lendingPool/onchainInteractionsLendingPoolV3.d.ts +0 -1
- package/lib/onchain/interactions/lendingPool/onchainInteractionsLendingPoolV3.js +1 -2
- package/package.json +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import OnchainAccountLendingPoolV3 from "../onchainAccountLendingPoolV3";
|
|
2
|
+
import { OnchainAccountCollateralV3 } from "../index";
|
|
2
3
|
export default abstract class OnchainAccountNftlp {
|
|
3
|
-
protected readonly
|
|
4
|
+
protected readonly collateral: OnchainAccountCollateralV3;
|
|
4
5
|
protected cache: {};
|
|
5
|
-
constructor(
|
|
6
|
+
constructor(collateral: OnchainAccountCollateralV3);
|
|
7
|
+
getLendingPool: () => OnchainAccountLendingPoolV3;
|
|
6
8
|
cleanCache(): void;
|
|
7
9
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
class OnchainAccountNftlp {
|
|
4
|
-
constructor(
|
|
4
|
+
constructor(collateral) {
|
|
5
5
|
this.cache = {};
|
|
6
|
-
this.
|
|
6
|
+
this.getLendingPool = () => this.collateral.getLendingPool();
|
|
7
|
+
this.collateral = collateral;
|
|
7
8
|
}
|
|
8
9
|
cleanCache() {
|
|
9
10
|
this.cache = {};
|
|
@@ -3,13 +3,16 @@ import OnchainAccountCollateral from "./onchainAccountCollateral";
|
|
|
3
3
|
import { OnchainCollateralV3 } from "../../impermaxFactory/lendingPool";
|
|
4
4
|
import OnchainAccountLendingPoolV3 from "./onchainAccountLendingPoolV3";
|
|
5
5
|
import { OnchainInteractionsCollateralV3 } from "../../interactions/lendingPool";
|
|
6
|
+
import OnchainAccountNftlp from "./nftlp";
|
|
6
7
|
export default class OnchainAccountCollateralV3 extends OnchainAccountCollateral {
|
|
7
8
|
protected readonly lendingPool: OnchainAccountLendingPoolV3;
|
|
8
9
|
protected readonly collateral: OnchainCollateralV3;
|
|
10
|
+
protected readonly nftlp: OnchainAccountNftlp;
|
|
9
11
|
protected collateralCache: {};
|
|
10
12
|
constructor(lendingPool: OnchainAccountLendingPoolV3);
|
|
11
13
|
getLendingPool: () => OnchainAccountLendingPoolV3;
|
|
12
14
|
getCollateral: () => OnchainCollateralV3;
|
|
15
|
+
getNftlp: () => OnchainAccountNftlp;
|
|
13
16
|
getAccount: () => import("..").default;
|
|
14
17
|
getInteractionsCollateral(): OnchainInteractionsCollateralV3;
|
|
15
18
|
getOffchainAccountCollateral(): Promise<OffchainAccountCollateral>;
|
|
@@ -19,9 +19,11 @@ class OnchainAccountCollateralV3 extends onchainAccountCollateral_1.default {
|
|
|
19
19
|
this.collateralCache = {};
|
|
20
20
|
this.getLendingPool = () => this.lendingPool;
|
|
21
21
|
this.getCollateral = () => this.collateral;
|
|
22
|
+
this.getNftlp = () => this.nftlp;
|
|
22
23
|
this.getAccount = () => this.lendingPool.getAccount();
|
|
23
24
|
this.lendingPool = lendingPool;
|
|
24
25
|
this.collateral = lendingPool.getLendingPool().getCollateral();
|
|
26
|
+
this.nftlp = lendingPool.getLendingPool().getNftlp().getNewAccountNftlpObject(this);
|
|
25
27
|
}
|
|
26
28
|
getInteractionsCollateral() {
|
|
27
29
|
return this.lendingPool.getInteractionsLendingPool().getCollateral();
|
|
@@ -13,7 +13,6 @@ export default class OnchainAccountLendingPoolV3 extends OnchainAccountLendingPo
|
|
|
13
13
|
[Borrowable.A]: OnchainAccountBorrowableV3;
|
|
14
14
|
[Borrowable.B]: OnchainAccountBorrowableV3;
|
|
15
15
|
};
|
|
16
|
-
protected readonly nftlp: OnchainAccountNftlp;
|
|
17
16
|
constructor(account: OnchainAccount, lendingPool: OnchainLendingPoolV3);
|
|
18
17
|
protected getNewCollateralObject(): OnchainAccountCollateralV3;
|
|
19
18
|
protected getNewBorrowableObject(borrowable: Borrowable): OnchainAccountBorrowableV3;
|
|
@@ -16,8 +16,7 @@ class OnchainAccountLendingPoolV3 extends onchainAccountLendingPool_1.default {
|
|
|
16
16
|
this.getBorrowableA = () => this.getBorrowable(types_1.Borrowable.A);
|
|
17
17
|
this.getBorrowableB = () => this.getBorrowable(types_1.Borrowable.B);
|
|
18
18
|
this.getCollateral = () => this.collateral;
|
|
19
|
-
this.getNftlp = () => this.
|
|
20
|
-
this.nftlp = lendingPool.getNftlp().getNewAccountNftlpObject(this);
|
|
19
|
+
this.getNftlp = () => this.collateral.getNftlp();
|
|
21
20
|
}
|
|
22
21
|
getNewCollateralObject() {
|
|
23
22
|
return new onchainAccountCollateralV3_1.default(this);
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import OnchainLendingPoolV3 from "../onchainLendingPoolV3";
|
|
2
2
|
import { Contract } from "../../../onchainTypes";
|
|
3
|
-
import {
|
|
3
|
+
import { OnchainAccountCollateralV3 } from "../../../account/lendingPool";
|
|
4
4
|
import OnchainAccountNftlp from "../../../account/lendingPool/nftlp";
|
|
5
|
-
import {
|
|
5
|
+
import { OnchainInteractionsCollateralV3 } from "../../../interactions/lendingPool";
|
|
6
6
|
import OnchainInteractionsNftlp from "../../../interactions/lendingPool/nftlp";
|
|
7
|
+
import OnchainCollateralV3 from "../onchainCollateralV3";
|
|
7
8
|
export default abstract class OnchainNftlp {
|
|
8
|
-
protected readonly
|
|
9
|
+
protected readonly collateral: OnchainCollateralV3;
|
|
9
10
|
protected cache: {
|
|
10
11
|
nftlp?: Contract;
|
|
12
|
+
marketPrice?: Promise<number>;
|
|
13
|
+
oraclePrice?: Promise<number>;
|
|
11
14
|
};
|
|
12
|
-
abstract getNewAccountNftlpObject(
|
|
13
|
-
abstract getNewInteractionsNftlpObject(
|
|
14
|
-
constructor(
|
|
15
|
+
abstract getNewAccountNftlpObject(accountCollateral: OnchainAccountCollateralV3): OnchainAccountNftlp;
|
|
16
|
+
abstract getNewInteractionsNftlpObject(interactionsCollateral: OnchainInteractionsCollateralV3): OnchainInteractionsNftlp;
|
|
17
|
+
constructor(collateral: OnchainCollateralV3);
|
|
15
18
|
cleanCache(): void;
|
|
19
|
+
getLendingPool: () => OnchainLendingPoolV3;
|
|
16
20
|
protected getContractHelper: () => import("../../..").OnchainContractsHelper;
|
|
17
21
|
getNftlpAddress: () => string;
|
|
18
22
|
protected abstract initializeNftlp(): Contract;
|
|
19
23
|
getNftlp(): any;
|
|
20
|
-
abstract
|
|
21
|
-
|
|
24
|
+
protected abstract initializeMarketPrice(): Promise<number>;
|
|
25
|
+
getMarketPrice(): Promise<number>;
|
|
26
|
+
protected abstract initializeOraclePrice(): Promise<number>;
|
|
27
|
+
getOraclePrice(): Promise<number>;
|
|
22
28
|
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
class OnchainNftlp {
|
|
4
|
-
constructor(
|
|
13
|
+
constructor(collateral) {
|
|
5
14
|
this.cache = {};
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
15
|
+
this.getLendingPool = () => this.collateral.getLendingPool();
|
|
16
|
+
this.getContractHelper = () => this.getLendingPool().getImpermaxFactory().getOnchain().getContractHelper();
|
|
17
|
+
this.getNftlpAddress = () => this.getLendingPool().getId();
|
|
18
|
+
this.collateral = collateral;
|
|
9
19
|
}
|
|
10
20
|
cleanCache() {
|
|
11
21
|
this.cache = {};
|
|
@@ -15,5 +25,19 @@ class OnchainNftlp {
|
|
|
15
25
|
this.cache.nftlp = this.initializeNftlp();
|
|
16
26
|
return this.cache.nftlp;
|
|
17
27
|
}
|
|
28
|
+
getMarketPrice() {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
if (!this.cache.marketPrice)
|
|
31
|
+
this.cache.marketPrice = this.initializeMarketPrice();
|
|
32
|
+
return this.cache.marketPrice;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
getOraclePrice() {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
if (!this.cache.oraclePrice)
|
|
38
|
+
this.cache.oraclePrice = this.initializeOraclePrice();
|
|
39
|
+
return this.cache.oraclePrice;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
18
42
|
}
|
|
19
43
|
exports.default = OnchainNftlp;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import OnchainNftlp from "./onchainNftlp";
|
|
2
2
|
import { Contract } from "../../../onchainTypes";
|
|
3
|
-
import {
|
|
3
|
+
import { OnchainAccountCollateralV3 } from "../../../account/lendingPool";
|
|
4
4
|
import { OnchainAccountNftlpUniswapV3 } from "../../../account/lendingPool/nftlp";
|
|
5
5
|
import { OnchainInteractionsNftlpUniswapV3 } from "../../../interactions/lendingPool/nftlp";
|
|
6
|
-
import {
|
|
6
|
+
import { OnchainInteractionsCollateralV3 } from "../../../interactions/lendingPool";
|
|
7
7
|
export default class OnchainNftlpUniswapV3 extends OnchainNftlp {
|
|
8
8
|
protected cache: {
|
|
9
9
|
nftlp?: Contract;
|
|
@@ -13,12 +13,11 @@ export default class OnchainNftlpUniswapV3 extends OnchainNftlp {
|
|
|
13
13
|
marketPrice?: Promise<number>;
|
|
14
14
|
oraclePrice?: Promise<number>;
|
|
15
15
|
};
|
|
16
|
-
getNewAccountNftlpObject(
|
|
17
|
-
getNewInteractionsNftlpObject(
|
|
18
|
-
initializeNftlp(): any;
|
|
19
|
-
initializeUniswapV3Pool(fee: number): Promise<Contract | null>;
|
|
16
|
+
getNewAccountNftlpObject(accountCollateral: OnchainAccountCollateralV3): OnchainAccountNftlpUniswapV3;
|
|
17
|
+
getNewInteractionsNftlpObject(interactionsCollateral: OnchainInteractionsCollateralV3): OnchainInteractionsNftlpUniswapV3;
|
|
18
|
+
protected initializeNftlp(): any;
|
|
19
|
+
protected initializeUniswapV3Pool(fee: number): Promise<Contract | null>;
|
|
20
20
|
getUniswapV3Pool(fee: number): Promise<any>;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
getOraclePrice(): Promise<number>;
|
|
21
|
+
protected initializeMarketPrice(): Promise<number>;
|
|
22
|
+
protected initializeOraclePrice(): Promise<number>;
|
|
24
23
|
}
|
|
@@ -26,11 +26,11 @@ class OnchainNftlpUniswapV3 extends onchainNftlp_1.default {
|
|
|
26
26
|
super(...arguments);
|
|
27
27
|
this.cache = {};
|
|
28
28
|
}
|
|
29
|
-
getNewAccountNftlpObject(
|
|
30
|
-
return new nftlp_1.OnchainAccountNftlpUniswapV3(
|
|
29
|
+
getNewAccountNftlpObject(accountCollateral) {
|
|
30
|
+
return new nftlp_1.OnchainAccountNftlpUniswapV3(accountCollateral);
|
|
31
31
|
}
|
|
32
|
-
getNewInteractionsNftlpObject(
|
|
33
|
-
return new nftlp_2.OnchainInteractionsNftlpUniswapV3(
|
|
32
|
+
getNewInteractionsNftlpObject(interactionsCollateral) {
|
|
33
|
+
return new nftlp_2.OnchainInteractionsNftlpUniswapV3(interactionsCollateral);
|
|
34
34
|
}
|
|
35
35
|
initializeNftlp() {
|
|
36
36
|
return this.getContractHelper().newNftlpUniV3(this.getNftlpAddress());
|
|
@@ -56,7 +56,7 @@ class OnchainNftlpUniswapV3 extends onchainNftlp_1.default {
|
|
|
56
56
|
return this.cache.uniswapV3Pools[fee];
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
initializeMarketPrice() {
|
|
60
60
|
return __awaiter(this, void 0, void 0, function* () {
|
|
61
61
|
let priceCumulative = 0;
|
|
62
62
|
let liquidityCumulative = 0;
|
|
@@ -72,19 +72,11 @@ class OnchainNftlpUniswapV3 extends onchainNftlp_1.default {
|
|
|
72
72
|
return priceCumulative / liquidityCumulative;
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
;
|
|
76
75
|
initializeOraclePrice() {
|
|
77
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
77
|
const nftlp = yield this.getNftlp();
|
|
79
78
|
return Math.pow((nftlp.methods.oraclePriceSqrtX96().call() / Math.pow(2, 96)), 2);
|
|
80
79
|
});
|
|
81
80
|
}
|
|
82
|
-
getOraclePrice() {
|
|
83
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
-
if (!this.cache.oraclePrice)
|
|
85
|
-
this.cache.oraclePrice = this.initializeOraclePrice();
|
|
86
|
-
return this.cache.oraclePrice;
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
81
|
}
|
|
90
82
|
exports.default = OnchainNftlpUniswapV3;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import OffchainCollateral from '../../../offchain/lendingPool/offchainCollateral';
|
|
2
2
|
import OnchainCollateral from "./onchainCollateral";
|
|
3
3
|
import OnchainLendingPoolV3 from "./onchainLendingPoolV3";
|
|
4
|
+
import OnchainNftlp from "./nftlp";
|
|
4
5
|
export default class OnchainCollateralV3 extends OnchainCollateral {
|
|
5
6
|
protected readonly lendingPool: OnchainLendingPoolV3;
|
|
7
|
+
protected readonly nftlp: OnchainNftlp;
|
|
6
8
|
protected collateralCache: {};
|
|
7
9
|
constructor(lendingPool: OnchainLendingPoolV3);
|
|
8
10
|
getLendingPool: () => OnchainLendingPoolV3;
|
|
11
|
+
getNftlp: () => OnchainNftlp;
|
|
9
12
|
cleanCache(): void;
|
|
10
13
|
private getContractHelper;
|
|
11
14
|
getCollateralAddress: () => Promise<string>;
|
|
@@ -13,15 +13,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const onchainCollateral_1 = __importDefault(require("./onchainCollateral"));
|
|
16
|
+
const nftlp_1 = require("./nftlp");
|
|
16
17
|
class OnchainCollateralV3 extends onchainCollateral_1.default {
|
|
17
18
|
constructor(lendingPool) {
|
|
18
19
|
super();
|
|
19
20
|
this.collateralCache = {};
|
|
20
21
|
this.getLendingPool = () => this.lendingPool;
|
|
22
|
+
this.getNftlp = () => this.nftlp;
|
|
21
23
|
// shortcuts
|
|
22
24
|
this.getContractHelper = () => this.lendingPool.getImpermaxFactory().getOnchain().getContractHelper();
|
|
23
25
|
this.getCollateralAddress = () => __awaiter(this, void 0, void 0, function* () { return this.lendingPool.getCollateralAddress(); });
|
|
24
26
|
this.lendingPool = lendingPool;
|
|
27
|
+
// TODO use the offchain object to get the type of nftlp
|
|
28
|
+
this.nftlp = new nftlp_1.OnchainNftlpUniswapV3(this);
|
|
25
29
|
}
|
|
26
30
|
cleanCache() {
|
|
27
31
|
this.collateralCache = {};
|
|
@@ -17,7 +17,6 @@ export default class OnchainLendingPoolV3 extends OnchainLendingPool {
|
|
|
17
17
|
[Borrowable.A]: OnchainBorrowableV3;
|
|
18
18
|
[Borrowable.B]: OnchainBorrowableV3;
|
|
19
19
|
};
|
|
20
|
-
protected readonly nftlp: OnchainNftlp;
|
|
21
20
|
protected cache: {
|
|
22
21
|
lendingPoolAddresses?: Promise<{
|
|
23
22
|
collateral: Address;
|
|
@@ -9,7 +9,6 @@ const lendingPool_1 = require("../../account/lendingPool");
|
|
|
9
9
|
const onchainCollateralV3_1 = __importDefault(require("./onchainCollateralV3"));
|
|
10
10
|
const onchainBorrowableV3_1 = __importDefault(require("./onchainBorrowableV3"));
|
|
11
11
|
const lendingPool_2 = require("../../interactions/lendingPool");
|
|
12
|
-
const nftlp_1 = require("./nftlp");
|
|
13
12
|
class OnchainLendingPoolV3 extends onchainLendingPool_1.default {
|
|
14
13
|
constructor(impermaxFactory, id) {
|
|
15
14
|
super(impermaxFactory, id);
|
|
@@ -19,9 +18,7 @@ class OnchainLendingPoolV3 extends onchainLendingPool_1.default {
|
|
|
19
18
|
this.getBorrowableA = () => this.getBorrowable(types_1.Borrowable.A);
|
|
20
19
|
this.getBorrowableB = () => this.getBorrowable(types_1.Borrowable.B);
|
|
21
20
|
this.getCollateral = () => this.collateral;
|
|
22
|
-
this.getNftlp = () => this.
|
|
23
|
-
// TODO use the offchain object to get the type of nftlp
|
|
24
|
-
this.nftlp = new nftlp_1.OnchainNftlpUniswapV3(this);
|
|
21
|
+
this.getNftlp = () => this.collateral.getNftlp();
|
|
25
22
|
}
|
|
26
23
|
getNewCollateralObject() {
|
|
27
24
|
return new onchainCollateralV3_1.default(this);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import OnchainInteractionsLendingPoolV3 from "../onchainInteractionsLendingPoolV3";
|
|
2
|
+
import { OnchainInteractionsCollateralV3 } from "../index";
|
|
2
3
|
export default abstract class OnchainInteractionsNftlp {
|
|
3
|
-
protected readonly
|
|
4
|
+
protected readonly collateral: OnchainInteractionsCollateralV3;
|
|
4
5
|
protected cache: {};
|
|
5
|
-
constructor(
|
|
6
|
+
constructor(collateral: OnchainInteractionsCollateralV3);
|
|
7
|
+
getLendingPool: () => OnchainInteractionsLendingPoolV3;
|
|
6
8
|
cleanCache(): void;
|
|
7
9
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
class OnchainInteractionsNftlp {
|
|
4
|
-
constructor(
|
|
4
|
+
constructor(collateral) {
|
|
5
5
|
this.cache = {};
|
|
6
|
-
this.
|
|
6
|
+
this.getLendingPool = () => this.collateral.getLendingPool();
|
|
7
|
+
this.collateral = collateral;
|
|
7
8
|
}
|
|
8
9
|
cleanCache() {
|
|
9
10
|
this.cache = {};
|
|
@@ -2,12 +2,15 @@ import OnchainInteractionsCollateral from "./onchainInteractionsCollateral";
|
|
|
2
2
|
import { OnchainCollateralV3 } from "../../impermaxFactory/lendingPool";
|
|
3
3
|
import { OnchainAccountCollateralV3 } from "../../account/lendingPool";
|
|
4
4
|
import OnchainInteractionsLendingPoolV3 from "./onchainInteractionsLendingPoolV3";
|
|
5
|
+
import OnchainInteractionsNftlp from "./nftlp";
|
|
5
6
|
export default class OnchainInteractionsCollateralV3 extends OnchainInteractionsCollateral {
|
|
6
7
|
protected readonly lendingPool: OnchainInteractionsLendingPoolV3;
|
|
7
8
|
protected readonly collateral: OnchainCollateralV3;
|
|
9
|
+
protected readonly nftlp: OnchainInteractionsNftlp;
|
|
8
10
|
constructor(interactionsLendingPool: OnchainInteractionsLendingPoolV3);
|
|
9
11
|
getLendingPool: () => OnchainInteractionsLendingPoolV3;
|
|
10
12
|
getCollateral: () => OnchainCollateralV3;
|
|
13
|
+
getNftlp: () => OnchainInteractionsNftlp;
|
|
11
14
|
getInteractions: () => import("..").default;
|
|
12
15
|
getAccountCollateral(): OnchainAccountCollateralV3;
|
|
13
16
|
}
|
|
@@ -9,9 +9,11 @@ class OnchainInteractionsCollateralV3 extends onchainInteractionsCollateral_1.de
|
|
|
9
9
|
super();
|
|
10
10
|
this.getLendingPool = () => this.lendingPool;
|
|
11
11
|
this.getCollateral = () => this.collateral;
|
|
12
|
+
this.getNftlp = () => this.nftlp;
|
|
12
13
|
this.getInteractions = () => this.lendingPool.getInteractions();
|
|
13
14
|
this.lendingPool = interactionsLendingPool;
|
|
14
15
|
this.collateral = interactionsLendingPool.getLendingPool().getCollateral();
|
|
16
|
+
this.nftlp = interactionsLendingPool.getLendingPool().getNftlp().getNewInteractionsNftlpObject(this);
|
|
15
17
|
}
|
|
16
18
|
getAccountCollateral() {
|
|
17
19
|
return this.lendingPool.getAccountLendingPool().getCollateral();
|
|
@@ -13,7 +13,6 @@ export default class OnchainInteractionsLendingPoolV3 extends OnchainInteraction
|
|
|
13
13
|
[Borrowable.A]: OnchainInteractionsBorrowableV3;
|
|
14
14
|
[Borrowable.B]: OnchainInteractionsBorrowableV3;
|
|
15
15
|
};
|
|
16
|
-
protected readonly nftlp: OnchainInteractionsNftlp;
|
|
17
16
|
constructor(interactions: OnchainInteractions, lendingPool: OnchainLendingPoolV3);
|
|
18
17
|
protected getNewCollateralObject(): OnchainInteractionsCollateralV3;
|
|
19
18
|
protected getNewBorrowableObject(borrowable: Borrowable): OnchainInteractionsBorrowableV3;
|
|
@@ -16,8 +16,7 @@ class OnchainInteractionsLendingPoolV3 extends onchainInteractionsLendingPool_1.
|
|
|
16
16
|
this.getBorrowableA = () => this.getBorrowable(types_1.Borrowable.A);
|
|
17
17
|
this.getBorrowableB = () => this.getBorrowable(types_1.Borrowable.B);
|
|
18
18
|
this.getCollateral = () => this.collateral;
|
|
19
|
-
this.getNftlp = () => this.
|
|
20
|
-
this.nftlp = lendingPool.getNftlp().getNewInteractionsNftlpObject(this);
|
|
19
|
+
this.getNftlp = () => this.collateral.getNftlp();
|
|
21
20
|
}
|
|
22
21
|
getNewCollateralObject() {
|
|
23
22
|
return new onchainInteractionsCollateralV3_1.default(this);
|