impermax-sdk 2.1.429 → 2.1.431

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,7 +1,7 @@
1
1
  import OffchainCollateralV3 from "../offchainCollateralV3";
2
2
  import OffchainAccountCollateralV3 from "../../account/lendingPool/offchainAccountCollateralV3";
3
3
  import OffchainAccountNftlp from "../../account/lendingPool/nftlp/offchainAccountNftlp";
4
- import { Extension } from "../../../config/types";
4
+ import { Extension, Address } from "../../../config/types";
5
5
  import { NftlpData } from "../../offchainTypes";
6
6
  export default abstract class OffchainNftlp {
7
7
  protected readonly collateral: OffchainCollateralV3;
@@ -21,4 +21,5 @@ export default abstract class OffchainNftlp {
21
21
  getMarketPrice(): Promise<number>;
22
22
  getOraclePrice(): Promise<number>;
23
23
  cleanCache(): void;
24
+ getOracleAddress(): Promise<Address>;
24
25
  }
@@ -24,5 +24,9 @@ class OffchainNftlp {
24
24
  cleanCache() {
25
25
  this.cache = {};
26
26
  }
27
+ async getOracleAddress() {
28
+ const data = await this.getNftlpData();
29
+ return data.factory.oracle;
30
+ }
27
31
  }
28
32
  exports.default = OffchainNftlp;
@@ -133,6 +133,10 @@ export interface V2UserData {
133
133
  [key in PoolTokenType]?: BorrowPosition;
134
134
  }>;
135
135
  }
136
+ export interface NftlpFactory {
137
+ allNftlpsLength: string;
138
+ oracle: Address;
139
+ }
136
140
  export interface UniswapV3PoolData {
137
141
  liquidity: string;
138
142
  fee: string;
@@ -144,11 +148,13 @@ export interface NftlpUniswapV3Data {
144
148
  dex: Extension;
145
149
  id: Address;
146
150
  dexFactory: Address;
151
+ factory: NftlpFactory;
147
152
  uniswapV3Pools: UniswapV3PoolData[];
148
153
  }
149
154
  export interface NftlpUniswapV2Data {
150
155
  dex: Extension;
151
156
  id: Address;
157
+ factory: NftlpFactory;
152
158
  dexFactory: Address;
153
159
  }
154
160
  export type NftlpData = NftlpUniswapV3Data | NftlpUniswapV2Data;
@@ -422,6 +422,9 @@ class PonderQueryBuilder {
422
422
  items {
423
423
  id
424
424
  dexFactory
425
+ factory {
426
+ oracle
427
+ }
425
428
  uniswapV3Pools {
426
429
  items {
427
430
  liquidity
@@ -299,6 +299,9 @@ class TheGraphQueryBuilder {
299
299
  nftlps(first: 1000) {
300
300
  id
301
301
  dexFactory
302
+ factory {
303
+ oracle
304
+ }
302
305
  uniswapV3Pools {
303
306
  liquidity
304
307
  fee
@@ -558,7 +561,31 @@ class TheGraphQueryBuilder {
558
561
  }`;
559
562
  }
560
563
  borrowersListQueryV3() {
561
- return (0, graphql_tag_1.default) `{}`;
564
+ return (0, graphql_tag_1.default) `{
565
+ positions(first: 1000) {
566
+ id
567
+ tokenId
568
+ user {
569
+ id
570
+ }
571
+ lendingPool {
572
+ id
573
+ nftlp {
574
+ factory
575
+ }
576
+ }
577
+ borrowPositions {
578
+ id
579
+ borrowBalance
580
+ borrowable {
581
+ underlying {
582
+ id
583
+ }
584
+ }
585
+ }
586
+ }
587
+ _meta { block { number } }
588
+ }`;
562
589
  }
563
590
  }
564
591
  exports.TheGraphQueryBuilder = TheGraphQueryBuilder;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.429",
3
+ "version": "2.1.431",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",