@curvefi/llamalend-api 2.0.5 → 2.0.6

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.
@@ -50,4 +50,9 @@ jobs:
50
50
  cache: npm
51
51
  - run: npm ci
52
52
  - run: npm run build
53
- - run: npm publish
53
+ - name: Publish main as latest
54
+ if: github.ref_name == 'main'
55
+ run: npm publish --tag latest
56
+ - name: Publish v1 branch as legacy
57
+ if: github.ref_name == 'v1'
58
+ run: npm publish --tag legacy
@@ -187,6 +187,7 @@ export declare class MintMarketTemplate {
187
187
  stablecoin: string;
188
188
  collateral: string;
189
189
  }>>;
190
+ oracleAddress: (() => Promise<string>) & memoize.Memoized<() => Promise<string>>;
190
191
  oraclePrice(): Promise<string>;
191
192
  oraclePriceBand(): Promise<number>;
192
193
  price(): Promise<string>;
@@ -106,6 +106,12 @@ export class MintMarketTemplate {
106
106
  promise: true,
107
107
  maxAge: 60 * 1000, // 1m
108
108
  });
109
+ this.oracleAddress = memoize(() => __awaiter(this, void 0, void 0, function* () {
110
+ const _address = yield this.llamalend.contracts[this.address].contract.price_oracle_contract(this.llamalend.constantOptions);
111
+ return _address;
112
+ }), {
113
+ promise: true,
114
+ });
109
115
  this.basePrice = memoize(() => __awaiter(this, void 0, void 0, function* () {
110
116
  const _price = yield this.llamalend.contracts[this.address].contract.get_base_price(this.llamalend.constantOptions);
111
117
  return formatUnits(_price);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/llamalend-api",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "JavaScript library for Curve Lending",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",
@@ -592,6 +592,14 @@ export class MintMarketTemplate {
592
592
  return res
593
593
  }
594
594
 
595
+ public oracleAddress = memoize(async (): Promise<string> => {
596
+ const _address = await this.llamalend.contracts[this.address].contract.price_oracle_contract(this.llamalend.constantOptions) as string;
597
+ return _address;
598
+ },
599
+ {
600
+ promise: true,
601
+ });
602
+
595
603
  public async oraclePrice(): Promise<string> {
596
604
  const _price = await this.llamalend.contracts[this.address].contract.price_oracle(this.llamalend.constantOptions) as bigint;
597
605
  return formatUnits(_price);