@gearbox-protocol/deploy-tools 5.24.8 → 5.24.9

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.
Files changed (2) hide show
  1. package/dist/index.mjs +65 -29
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -366906,13 +366906,56 @@ function withPublicNode(chain, subdomain) {
366906
366906
  });
366907
366907
  }
366908
366908
  var chains = {
366909
- Mainnet: withPublicNode(mainnet, "ethereum-rpc"),
366910
- Arbitrum: withPublicNode(arbitrum, "arbitrum-one-rpc"),
366911
- Optimism: withPublicNode(optimism, "optimism-rpc"),
366912
- Base: withPublicNode(base, "base-rpc"),
366909
+ Mainnet: withPublicNode(
366910
+ {
366911
+ ...mainnet,
366912
+ network: "Mainnet",
366913
+ defaultMarketConfigurators: {
366914
+ "0x354fe9f450F60b8547f88BE042E4A45b46128a06": "Chaos Labs"
366915
+ },
366916
+ isPublic: true
366917
+ },
366918
+ "ethereum-rpc"
366919
+ ),
366920
+ Arbitrum: withPublicNode(
366921
+ {
366922
+ ...arbitrum,
366923
+ network: "Arbitrum",
366924
+ defaultMarketConfigurators: {
366925
+ "0x354fe9f450F60b8547f88BE042E4A45b46128a06": "Chaos Labs"
366926
+ },
366927
+ isPublic: true
366928
+ },
366929
+ "arbitrum-one-rpc"
366930
+ ),
366931
+ Optimism: withPublicNode(
366932
+ {
366933
+ ...optimism,
366934
+ network: "Optimism",
366935
+ defaultMarketConfigurators: {
366936
+ "0x2a15969CE5320868eb609680751cF8896DD92De5": "Chaos Labs"
366937
+ },
366938
+ isPublic: true
366939
+ },
366940
+ "optimism-rpc"
366941
+ ),
366942
+ Base: withPublicNode(
366943
+ {
366944
+ ...base,
366945
+ network: "Base",
366946
+ defaultMarketConfigurators: {},
366947
+ isPublic: true
366948
+ },
366949
+ "base-rpc"
366950
+ ),
366913
366951
  Sonic: withPublicNode(
366914
366952
  defineChain({
366915
366953
  ...sonic,
366954
+ network: "Sonic",
366955
+ defaultMarketConfigurators: {
366956
+ "0x8FFDd1F1433674516f83645a768E8900A2A5D076": "Chaos Labs"
366957
+ },
366958
+ isPublic: true,
366916
366959
  blockExplorers: {
366917
366960
  default: {
366918
366961
  name: "Sonic Explorer",
@@ -366924,13 +366967,6 @@ var chains = {
366924
366967
  "sonic-rpc"
366925
366968
  )
366926
366969
  };
366927
- var CHAINS_BY_ID = {
366928
- [mainnet.id]: "Mainnet",
366929
- [arbitrum.id]: "Arbitrum",
366930
- [optimism.id]: "Optimism",
366931
- [base.id]: "Base",
366932
- [sonic.id]: "Sonic"
366933
- };
366934
366970
  function getChain(chainIdOrNetworkType) {
366935
366971
  const network = typeof chainIdOrNetworkType === "string" ? chainIdOrNetworkType : getNetworkType(Number(chainIdOrNetworkType));
366936
366972
  const chain = chains[network];
@@ -366940,11 +366976,12 @@ function getChain(chainIdOrNetworkType) {
366940
366976
  return chain;
366941
366977
  }
366942
366978
  function getNetworkType(chainId) {
366943
- const chainType = CHAINS_BY_ID[chainId];
366944
- if (chainType) {
366945
- return chainType;
366979
+ for (const [network, chain] of TypedObjectUtils.entries(chains)) {
366980
+ if (chain.id === Number(chainId)) {
366981
+ return network;
366982
+ }
366946
366983
  }
366947
- throw new Error("Unsupported network");
366984
+ throw new Error(`Unsupported network with chainId ${chainId}`);
366948
366985
  }
366949
366986
 
366950
366987
  // ../../node_modules/@gearbox-protocol/sdk/dist/esm/abi/iERC20.js
@@ -368806,9 +368843,6 @@ function createAdapter(sdk, args) {
368806
368843
  );
368807
368844
  }
368808
368845
  }
368809
- sdk.logger?.warn(
368810
- `no class found for ${adapterType} v${args.baseParams.version}, falling back to placeholder`
368811
- );
368812
368846
  return new PlaceholderAdapterContract(sdk, args);
368813
368847
  }
368814
368848
 
@@ -385413,7 +385447,7 @@ var PriceFeedRegister = class extends SDKConstruct {
385413
385447
  const redstonePFs = [];
385414
385448
  const latestUpdate = {
385415
385449
  redstone: [],
385416
- timestamp: Date.now()
385450
+ timestamp: Math.floor(Date.now() / 1e3)
385417
385451
  };
385418
385452
  for (const pf of updateables) {
385419
385453
  if (isRedstone(pf)) {
@@ -385528,6 +385562,7 @@ function rawTxToMulticallPriceUpdate(tx) {
385528
385562
  }
385529
385563
 
385530
385564
  // ../../node_modules/@gearbox-protocol/sdk/dist/esm/sdk/market/oracle/PriceOracleBaseContract.js
385565
+ var ZERO_PRICE_FEED = stringToHex("PRICE_FEED::ZERO", { size: 32 });
385531
385566
  var PriceOracleBaseContract = class extends BaseContract {
385532
385567
  /**
385533
385568
  * Underlying token of market to which this price oracle belongs
@@ -385731,12 +385766,13 @@ var PriceOracleBaseContract = class extends BaseContract {
385731
385766
  (n) => n.baseParams.addr === priceFeed
385732
385767
  );
385733
385768
  const price = node?.answer?.price;
385769
+ const priceFeedType = node?.baseParams.contractType;
385734
385770
  if (reserve) {
385735
385771
  this.reservePriceFeeds.upsert(token, ref);
385736
385772
  if (price !== void 0) {
385737
385773
  this.reservePrices.upsert(token, price);
385738
385774
  }
385739
- if (!price) {
385775
+ if (!price && priceFeedType !== ZERO_PRICE_FEED) {
385740
385776
  this.logger?.warn(
385741
385777
  node ?? {},
385742
385778
  `answer not found for reserve price feed ${this.labelAddress(priceFeed)}`
@@ -385747,7 +385783,7 @@ var PriceOracleBaseContract = class extends BaseContract {
385747
385783
  if (price !== void 0) {
385748
385784
  this.mainPrices.upsert(token, price);
385749
385785
  }
385750
- if (!price) {
385786
+ if (!price && priceFeedType !== ZERO_PRICE_FEED) {
385751
385787
  this.logger?.warn(
385752
385788
  node ?? {},
385753
385789
  `answer not found for main price feed ${this.labelAddress(priceFeed)}`
@@ -389689,7 +389725,7 @@ var GearboxSDK = class _GearboxSDK {
389689
389725
  blockNumber,
389690
389726
  redstoneHistoricTimestamp,
389691
389727
  ignoreUpdateablePrices,
389692
- marketConfigurators
389728
+ marketConfigurators: mcs
389693
389729
  } = options;
389694
389730
  let { networkType, addressProvider, chainId } = options;
389695
389731
  const attachClient = createPublicClient({
@@ -389704,12 +389740,13 @@ var GearboxSDK = class _GearboxSDK {
389704
389740
  if (!addressProvider) {
389705
389741
  addressProvider = ADDRESS_PROVIDER_V310;
389706
389742
  }
389743
+ const marketConfigurators = mcs ?? TypedObjectUtils.keys(chains[networkType].defaultMarketConfigurators);
389707
389744
  const provider = new Provider({
389708
389745
  ...options,
389709
389746
  chainId,
389710
389747
  networkType
389711
389748
  });
389712
- logger2?.debug(
389749
+ logger2?.info(
389713
389750
  { networkType, chainId, addressProvider, marketConfigurators },
389714
389751
  "attaching gearbox sdk"
389715
389752
  );
@@ -389763,13 +389800,12 @@ var GearboxSDK = class _GearboxSDK {
389763
389800
  if (redstoneGateways?.length) {
389764
389801
  this.priceFeeds.redstoneUpdater.gateways = redstoneGateways;
389765
389802
  }
389766
- this.logger?.info(
389803
+ this.logger?.debug(
389767
389804
  {
389768
- addressProvider,
389769
- blockNumber: block.number,
389805
+ number: block.number,
389770
389806
  timestamp: block.timestamp
389771
389807
  },
389772
- "attaching"
389808
+ "attach block"
389773
389809
  );
389774
389810
  this.#addressProvider = await createAddressProvider(this, addressProvider);
389775
389811
  this.logger?.debug(
@@ -419095,7 +419131,7 @@ function getRenderer(opts) {
419095
419131
  var package_default = {
419096
419132
  name: "@gearbox-protocol/deploy-tools",
419097
419133
  description: "Gearbox deploy tools",
419098
- version: "5.24.8",
419134
+ version: "5.24.9",
419099
419135
  homepage: "https://gearbox.fi",
419100
419136
  keywords: [
419101
419137
  "gearbox"
@@ -419138,7 +419174,7 @@ var package_default = {
419138
419174
  "@gearbox-protocol/deploy-tools-node": "0.0.0",
419139
419175
  "@gearbox-protocol/deploy-tools-shared": "0.0.0",
419140
419176
  "@gearbox-protocol/deploy-tools-types": "0.0.0",
419141
- "@gearbox-protocol/sdk": "3.0.0-vfour.324",
419177
+ "@gearbox-protocol/sdk": "3.0.0-vfour.326",
419142
419178
  "@gearbox-protocol/sdk-gov": "^2.36.6",
419143
419179
  "@types/lodash-es": "^4.17.12",
419144
419180
  "@types/node": "^22.13.10",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/deploy-tools",
3
3
  "description": "Gearbox deploy tools",
4
- "version": "5.24.8",
4
+ "version": "5.24.9",
5
5
  "homepage": "https://gearbox.fi",
6
6
  "keywords": [
7
7
  "gearbox"
@@ -44,7 +44,7 @@
44
44
  "@gearbox-protocol/deploy-tools-node": "0.0.0",
45
45
  "@gearbox-protocol/deploy-tools-shared": "0.0.0",
46
46
  "@gearbox-protocol/deploy-tools-types": "0.0.0",
47
- "@gearbox-protocol/sdk": "3.0.0-vfour.324",
47
+ "@gearbox-protocol/sdk": "3.0.0-vfour.326",
48
48
  "@gearbox-protocol/sdk-gov": "^2.36.6",
49
49
  "@types/lodash-es": "^4.17.12",
50
50
  "@types/node": "^22.13.10",