@gearbox-protocol/sdk 3.0.0-vfour.245 → 3.0.0-vfour.247

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.
@@ -2292,30 +2292,16 @@ var SDKExample = class {
2292
2292
  timeout: 48e4,
2293
2293
  addressProvider,
2294
2294
  logger: this.#logger,
2295
- ignoreUpdateablePrices: true,
2295
+ ignoreUpdateablePrices: false,
2296
2296
  marketConfigurators
2297
2297
  });
2298
+ this.#logger?.info("attached sdk");
2298
2299
  try {
2299
2300
  await this.#sdk.marketRegister.loadZappers();
2300
2301
  } catch (e) {
2301
2302
  this.#logger?.error(`failed to load zappers: ${e}`);
2302
2303
  }
2303
2304
  await this.#safeMigrateFaucet(addressProvider);
2304
- const puTx = await this.#sdk.priceFeeds.getUpdatePriceFeedsTx(marketConfigurators);
2305
- const updater = viem.createWalletClient({
2306
- account: accounts.privateKeyToAccount(
2307
- "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
2308
- // well-known anvil private key
2309
- ),
2310
- transport: viem.http(anvilUrl)
2311
- });
2312
- const publicClient = viem.createPublicClient({
2313
- transport: viem.http(anvilUrl)
2314
- });
2315
- const hash = await sdk.sendRawTx(updater, { tx: puTx });
2316
- await publicClient.waitForTransactionReceipt({ hash });
2317
- await this.#sdk.marketRegister.loadMarkets(marketConfigurators, true);
2318
- this.#logger?.info("attached sdk");
2319
2305
  await Promise.allSettled(
2320
2306
  this.#sdk.marketRegister.marketConfigurators.map(
2321
2307
  (m) => m.loadCuratorName()
@@ -2393,6 +2379,7 @@ var SDKExample = class {
2393
2379
  address: owner,
2394
2380
  value: viem.parseEther("100")
2395
2381
  });
2382
+ await anvil.setBlockTimestampInterval({ interval: 0 });
2396
2383
  const hash = await anvil.writeContract({
2397
2384
  chain: anvil.chain,
2398
2385
  account: owner,
@@ -2402,6 +2389,7 @@ var SDKExample = class {
2402
2389
  args: [viem.stringToHex("FAUCET", { size: 32 }), faucetAddr, true]
2403
2390
  });
2404
2391
  const receipt = await anvil.waitForTransactionReceipt({ hash });
2392
+ await anvil.removeBlockTimestampInterval();
2405
2393
  await anvil.stopImpersonatingAccount({ address: owner });
2406
2394
  if (receipt.status === "reverted") {
2407
2395
  throw new Error("faucet migration reverted");
@@ -69712,7 +69712,6 @@ var PoolData_Legacy = class _PoolData_Legacy {
69712
69712
  quotas;
69713
69713
  zappers;
69714
69714
  totalSupply;
69715
- supplyAPY7D;
69716
69715
  depositAPY;
69717
69716
  borrowAPY;
69718
69717
  interestModel;
@@ -69783,7 +69782,6 @@ var PoolData_Legacy = class _PoolData_Legacy {
69783
69782
  this.borrowAPY = rayToNumber(
69784
69783
  payload.baseInterestRate * PERCENTAGE_DECIMALS
69785
69784
  );
69786
- this.supplyAPY7D = extra.supplyAPY7D;
69787
69785
  this.interestModel = {
69788
69786
  interestModel: payload.lirm.interestModel.toLowerCase(),
69789
69787
  U_1: toBigInt(payload.lirm.U_1),
@@ -99630,7 +99630,6 @@ interface PoolDataPayload {
99630
99630
  interface PoolDataExtraPayload {
99631
99631
  stakedDieselToken: Array<Address>;
99632
99632
  stakedDieselToken_old: Array<Address>;
99633
- supplyAPY7D: number | undefined;
99634
99633
  }
99635
99634
  interface LinearModel {
99636
99635
  interestModel: Address;
@@ -100671,7 +100670,6 @@ declare class PoolData_Legacy {
100671
100670
  tokenOut: Address;
100672
100671
  }>>;
100673
100672
  readonly totalSupply: bigint;
100674
- readonly supplyAPY7D: number | undefined;
100675
100673
  readonly depositAPY: number;
100676
100674
  readonly borrowAPY: number;
100677
100675
  readonly interestModel: LinearModel;
@@ -1,4 +1,4 @@
1
- import { createTestClient, publicActions, walletActions, toHex, parseEventLogs, isAddress, parseEther, createWalletClient, http, createPublicClient, stringToHex } from 'viem';
1
+ import { createTestClient, publicActions, walletActions, toHex, parseEventLogs, isAddress, parseEther, stringToHex } from 'viem';
2
2
  import { privateKeyToAccount, generatePrivateKey } from 'viem/accounts';
3
3
  import { SDKConstruct, childLogger, AddressMap, sendRawTx, iCreditFacadeV300Abi, PERCENTAGE_FACTOR, formatBN, ierc20Abi, iPoolV300Abi, ADDRESS_0X0, MAX_UINT256, iDegenNftv2Abi, AP_PRICE_FEED_COMPRESSOR, iPriceFeedCompressorAbi, rawTxToMulticallPriceUpdate, GearboxSDK, json_stringify, iAddressProviderV300Abi, ADDRESS_PROVIDER, iAddressProviderV310Abi, WAD } from '../sdk/index.mjs';
4
4
  import { writeFile, readFile } from 'node:fs/promises';
@@ -2290,30 +2290,16 @@ var SDKExample = class {
2290
2290
  timeout: 48e4,
2291
2291
  addressProvider,
2292
2292
  logger: this.#logger,
2293
- ignoreUpdateablePrices: true,
2293
+ ignoreUpdateablePrices: false,
2294
2294
  marketConfigurators
2295
2295
  });
2296
+ this.#logger?.info("attached sdk");
2296
2297
  try {
2297
2298
  await this.#sdk.marketRegister.loadZappers();
2298
2299
  } catch (e) {
2299
2300
  this.#logger?.error(`failed to load zappers: ${e}`);
2300
2301
  }
2301
2302
  await this.#safeMigrateFaucet(addressProvider);
2302
- const puTx = await this.#sdk.priceFeeds.getUpdatePriceFeedsTx(marketConfigurators);
2303
- const updater = createWalletClient({
2304
- account: privateKeyToAccount(
2305
- "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
2306
- // well-known anvil private key
2307
- ),
2308
- transport: http(anvilUrl)
2309
- });
2310
- const publicClient = createPublicClient({
2311
- transport: http(anvilUrl)
2312
- });
2313
- const hash = await sendRawTx(updater, { tx: puTx });
2314
- await publicClient.waitForTransactionReceipt({ hash });
2315
- await this.#sdk.marketRegister.loadMarkets(marketConfigurators, true);
2316
- this.#logger?.info("attached sdk");
2317
2303
  await Promise.allSettled(
2318
2304
  this.#sdk.marketRegister.marketConfigurators.map(
2319
2305
  (m) => m.loadCuratorName()
@@ -2391,6 +2377,7 @@ var SDKExample = class {
2391
2377
  address: owner,
2392
2378
  value: parseEther("100")
2393
2379
  });
2380
+ await anvil.setBlockTimestampInterval({ interval: 0 });
2394
2381
  const hash = await anvil.writeContract({
2395
2382
  chain: anvil.chain,
2396
2383
  account: owner,
@@ -2400,6 +2387,7 @@ var SDKExample = class {
2400
2387
  args: [stringToHex("FAUCET", { size: 32 }), faucetAddr, true]
2401
2388
  });
2402
2389
  const receipt = await anvil.waitForTransactionReceipt({ hash });
2390
+ await anvil.removeBlockTimestampInterval();
2403
2391
  await anvil.stopImpersonatingAccount({ address: owner });
2404
2392
  if (receipt.status === "reverted") {
2405
2393
  throw new Error("faucet migration reverted");
@@ -99630,7 +99630,6 @@ interface PoolDataPayload {
99630
99630
  interface PoolDataExtraPayload {
99631
99631
  stakedDieselToken: Array<Address>;
99632
99632
  stakedDieselToken_old: Array<Address>;
99633
- supplyAPY7D: number | undefined;
99634
99633
  }
99635
99634
  interface LinearModel {
99636
99635
  interestModel: Address;
@@ -100671,7 +100670,6 @@ declare class PoolData_Legacy {
100671
100670
  tokenOut: Address;
100672
100671
  }>>;
100673
100672
  readonly totalSupply: bigint;
100674
- readonly supplyAPY7D: number | undefined;
100675
100673
  readonly depositAPY: number;
100676
100674
  readonly borrowAPY: number;
100677
100675
  readonly interestModel: LinearModel;
@@ -69705,7 +69705,6 @@ var PoolData_Legacy = class _PoolData_Legacy {
69705
69705
  quotas;
69706
69706
  zappers;
69707
69707
  totalSupply;
69708
- supplyAPY7D;
69709
69708
  depositAPY;
69710
69709
  borrowAPY;
69711
69710
  interestModel;
@@ -69776,7 +69775,6 @@ var PoolData_Legacy = class _PoolData_Legacy {
69776
69775
  this.borrowAPY = rayToNumber(
69777
69776
  payload.baseInterestRate * PERCENTAGE_DECIMALS
69778
69777
  );
69779
- this.supplyAPY7D = extra.supplyAPY7D;
69780
69778
  this.interestModel = {
69781
69779
  interestModel: payload.lirm.interestModel.toLowerCase(),
69782
69780
  U_1: toBigInt(payload.lirm.U_1),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "3.0.0-vfour.245",
3
+ "version": "3.0.0-vfour.247",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.cjs",