@morpho-org/blue-sdk 4.7.0 → 4.8.1

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.
@@ -392,6 +392,19 @@ declare const _addressesRegistry: {
392
392
  readonly wNative: "0x4200000000000000000000000000000000000006";
393
393
  readonly usdc: "0xF242275d3a6527d877f2c927a82D9b057609cc71";
394
394
  };
395
+ readonly 999: {
396
+ readonly morpho: "0x68e37dE8d93d3496ae143F2E900490f6280C57cD";
397
+ readonly bundler3: {
398
+ readonly bundler3: "0xa3F50477AfA601C771874260A3B34B40e244Fa0e";
399
+ readonly generalAdapter1: "0xD7F48aDE56613E8605863832B7B8A1985B934aE4";
400
+ };
401
+ readonly adaptiveCurveIrm: "0xD4a426F010986dCad727e8dd6eed44cA4A9b7483";
402
+ readonly publicAllocator: "0x517505be22D9068687334e69ae7a02fC77edf4Fc";
403
+ readonly metaMorphoFactory: "0xec051b19d654C48c357dC974376DeB6272f24e53";
404
+ readonly chainlinkOracleFactory: "0xeb476f124FaD625178759d13557A72394A6f9aF5";
405
+ readonly preLiquidationFactory: "0x1b6782Ac7A859503cE953FBf4736311CC335B8f0";
406
+ readonly wNative: "0x5555555555555555555555555555555555555555";
407
+ };
395
408
  };
396
409
  export type AddressLabel = DottedKeys<(typeof _addressesRegistry)[ChainId]>;
397
410
  export declare const getChainAddresses: (chainId: number) => ChainAddresses;
@@ -763,6 +776,19 @@ export declare let addressesRegistry: {
763
776
  readonly wNative: "0x4200000000000000000000000000000000000006";
764
777
  readonly usdc: "0xF242275d3a6527d877f2c927a82D9b057609cc71";
765
778
  };
779
+ readonly 999: {
780
+ readonly morpho: "0x68e37dE8d93d3496ae143F2E900490f6280C57cD";
781
+ readonly bundler3: {
782
+ readonly bundler3: "0xa3F50477AfA601C771874260A3B34B40e244Fa0e";
783
+ readonly generalAdapter1: "0xD7F48aDE56613E8605863832B7B8A1985B934aE4";
784
+ };
785
+ readonly adaptiveCurveIrm: "0xD4a426F010986dCad727e8dd6eed44cA4A9b7483";
786
+ readonly publicAllocator: "0x517505be22D9068687334e69ae7a02fC77edf4Fc";
787
+ readonly metaMorphoFactory: "0xec051b19d654C48c357dC974376DeB6272f24e53";
788
+ readonly chainlinkOracleFactory: "0xeb476f124FaD625178759d13557A72394A6f9aF5";
789
+ readonly preLiquidationFactory: "0x1b6782Ac7A859503cE953FBf4736311CC335B8f0";
790
+ readonly wNative: "0x5555555555555555555555555555555555555555";
791
+ };
766
792
  };
767
793
  export declare let addresses: Record<number, ChainAddresses>;
768
794
  export declare let unwrappedTokensMapping: Record<number, Record<`0x${string}`, `0x${string}`>>;
package/lib/addresses.js CHANGED
@@ -375,6 +375,19 @@ const _addressesRegistry = {
375
375
  // Must implement USDC permit version 2 (otherwise breaks permit signatures).
376
376
  usdc: "0xF242275d3a6527d877f2c927a82D9b057609cc71",
377
377
  },
378
+ [chain_js_1.ChainId.HyperliquidMainnet]: {
379
+ morpho: "0x68e37dE8d93d3496ae143F2E900490f6280C57cD",
380
+ bundler3: {
381
+ bundler3: "0xa3F50477AfA601C771874260A3B34B40e244Fa0e",
382
+ generalAdapter1: "0xD7F48aDE56613E8605863832B7B8A1985B934aE4",
383
+ },
384
+ adaptiveCurveIrm: "0xD4a426F010986dCad727e8dd6eed44cA4A9b7483",
385
+ publicAllocator: "0x517505be22D9068687334e69ae7a02fC77edf4Fc",
386
+ metaMorphoFactory: "0xec051b19d654C48c357dC974376DeB6272f24e53",
387
+ chainlinkOracleFactory: "0xeb476f124FaD625178759d13557A72394A6f9aF5",
388
+ preLiquidationFactory: "0x1b6782Ac7A859503cE953FBf4736311CC335B8f0",
389
+ wNative: "0x5555555555555555555555555555555555555555",
390
+ },
378
391
  };
379
392
  const getChainAddresses = (chainId) => {
380
393
  const chainAddresses = exports.addresses[chainId];
@@ -457,6 +470,9 @@ const _unwrappedTokensMapping = {
457
470
  [chain_js_1.ChainId.LiskMainnet]: {
458
471
  [_addressesRegistry[chain_js_1.ChainId.LiskMainnet].wNative]: exports.NATIVE_ADDRESS,
459
472
  },
473
+ [chain_js_1.ChainId.HyperliquidMainnet]: {
474
+ [_addressesRegistry[chain_js_1.ChainId.HyperliquidMainnet].wNative]: exports.NATIVE_ADDRESS,
475
+ },
460
476
  };
461
477
  function getUnwrappedToken(wrappedToken, chainId) {
462
478
  return exports.unwrappedTokensMapping[chainId]?.[wrappedToken];
package/lib/chain.d.ts CHANGED
@@ -18,7 +18,8 @@ export declare enum ChainId {
18
18
  KatanaMainnet = 747474,
19
19
  EtherlinkMainnet = 42793,
20
20
  TacMainnet = 239,
21
- LiskMainnet = 1135
21
+ LiskMainnet = 1135,
22
+ HyperliquidMainnet = 999
22
23
  }
23
24
  export interface ChainMetadata {
24
25
  readonly name: string;
package/lib/chain.js CHANGED
@@ -23,6 +23,7 @@ var ChainId;
23
23
  ChainId[ChainId["EtherlinkMainnet"] = 42793] = "EtherlinkMainnet";
24
24
  ChainId[ChainId["TacMainnet"] = 239] = "TacMainnet";
25
25
  ChainId[ChainId["LiskMainnet"] = 1135] = "LiskMainnet";
26
+ ChainId[ChainId["HyperliquidMainnet"] = 999] = "HyperliquidMainnet";
26
27
  })(ChainId || (exports.ChainId = ChainId = {}));
27
28
  var ChainUtils;
28
29
  (function (ChainUtils) {
@@ -179,5 +180,12 @@ var ChainUtils;
179
180
  explorerUrl: "https://blockscout.lisk.com",
180
181
  identifier: "lisk",
181
182
  },
183
+ [ChainId.HyperliquidMainnet]: {
184
+ name: "Hyperliquid",
185
+ id: ChainId.HyperliquidMainnet,
186
+ nativeCurrency: { name: "Hype", symbol: "HYPE", decimals: 18 },
187
+ explorerUrl: "https://hyperevmscan.io",
188
+ identifier: "hyperliquid",
189
+ },
182
190
  };
183
191
  })(ChainUtils || (exports.ChainUtils = ChainUtils = {}));
@@ -18,6 +18,6 @@ export declare class VaultToken extends WrappedToken implements IVaultToken {
18
18
  */
19
19
  totalAssets: bigint;
20
20
  constructor(config: IVaultConfig, { totalAssets, totalSupply }: IVaultToken);
21
- protected _wrap(amount: bigint, rounding?: RoundingDirection): bigint;
22
- protected _unwrap(amount: bigint, rounding?: RoundingDirection): bigint;
21
+ protected _wrap(amount: bigint, rounding: RoundingDirection): bigint;
22
+ protected _unwrap(amount: bigint, rounding: RoundingDirection): bigint;
23
23
  }
@@ -95,10 +95,10 @@ class Vault extends index_js_3.VaultToken {
95
95
  get totalInterest() {
96
96
  return index_js_2.MathLib.zeroFloorSub(this.totalAssets, this.lastTotalAssets);
97
97
  }
98
- toAssets(shares, rounding) {
98
+ toAssets(shares, rounding = "Down") {
99
99
  return this._unwrap(shares, rounding);
100
100
  }
101
- toShares(assets, rounding) {
101
+ toShares(assets, rounding = "Up") {
102
102
  return this._wrap(assets, rounding);
103
103
  }
104
104
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@morpho-org/blue-sdk",
3
3
  "description": "Framework-agnostic package that defines Morpho-related entity classes (such as `Market`, `Token`, `Vault`).",
4
- "version": "4.7.0",
4
+ "version": "4.8.1",
5
5
  "author": "Morpho Association <contact@morpho.org>",
6
6
  "contributors": [
7
7
  "Rubilmax <rmilon@gmail.com>"