@morpho-org/blue-sdk 3.0.0-next.0 → 3.0.0-next.2

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,3 +1,4 @@
1
+ import { type DottedKeys } from "@morpho-org/morpho-ts";
1
2
  import { ChainId } from "./chain.js";
2
3
  import type { Address } from "./types.js";
3
4
  /** Address used to replicate an erc20-behaviour for native token.
@@ -9,7 +10,23 @@ export declare const addresses: {
9
10
  readonly 1: {
10
11
  readonly morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb";
11
12
  readonly permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3";
13
+ /**
14
+ * @deprecated All bundles should use Bundler3 instead.
15
+ */
12
16
  readonly bundler: "0x4095F064B8d3c3548A3bebfd0Bbfd04750E30077";
17
+ readonly bundler3: {
18
+ readonly bundler3: "0x6566194141eefa99Af43Bb5Aa71460Ca2Dc90245";
19
+ readonly generalAdapter1: "0x4A6c312ec70E8747a587EE860a0353cd42Be0aE0";
20
+ readonly paraswapAdapter: "0x03b5259Bd204BfD4A616E5B79b0B786d90c6C38f";
21
+ readonly erc20WrapperAdapter: "0xf83D17dFE160597b19e4FdD8ea61A23e9a87F962";
22
+ readonly compoundV2MigrationAdapter: "0x9B89c07f480Df1945279031b5fC6fF241b8f1101";
23
+ readonly compoundV3MigrationAdapter: "0xdBa5bdE29eA030Bfa6A608592dFcA1D02CB26773";
24
+ readonly aaveV2MigrationAdapter: "0x40288815C399709dFC0875A384B637fFe387961B";
25
+ readonly aaveV3CoreMigrationAdapter: "0xb09e40EbE31b738fbf20289270a397118707D475";
26
+ readonly aaveV3PrimeMigrationAdapter: "0x2CC8d502a65824B4cF9A58DB03490bA024BDB806";
27
+ readonly aaveV3EtherFiMigrationAdapter: "0x4011dc6581fA05F9B0c7A12AdCd676e2b1a59ca3";
28
+ readonly aaveV3OptimizerMigrationAdapter: "0x9e2ea2d5785598a163D569D795f286F5C55ad972";
29
+ };
13
30
  readonly aaveV3OptimizerBundler: "0x16F38d2E764E7BeBF625a8E995b34968226D2F9c";
14
31
  readonly aaveV2Bundler: "0xb3dCc75DB379925edFd3007511A8CE0cB4aa8e76";
15
32
  readonly aaveV3Bundler: "0x98ccB155E86bb478d514a827d16f58c6912f9BDC";
@@ -20,11 +37,13 @@ export declare const addresses: {
20
37
  readonly metaMorphoFactory: "0xA9c3D3a366466Fa809d1Ae982Fb2c46E5fC41101";
21
38
  readonly wNative: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";
22
39
  readonly morphoToken: "0x9994E35Db50125E0DF82e4c2dde62496CE330999";
40
+ readonly aaveV3Optimizer: "0x33333aea097c193e66081E930c33020272b33333";
23
41
  readonly dai: "0x6B175474E89094C44Da98b954EedeAC495271d0F";
24
42
  readonly sDai: "0x83F20F44975D03b1b09e64809B757c47f942BEeA";
25
43
  readonly mkr: "0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2";
26
44
  readonly stEth: "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84";
27
45
  readonly wstEth: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0";
46
+ readonly cEth: "0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5";
28
47
  readonly osEth: "0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38";
29
48
  readonly bIB01: "0xCA30c93B02514f86d5C86a6e375E3A330B435Fb5";
30
49
  readonly wbIB01: "0xcA2A7068e551d5C4482eb34880b194E4b945712F";
@@ -49,7 +68,18 @@ export declare const addresses: {
49
68
  readonly 8453: {
50
69
  readonly morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb";
51
70
  readonly permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3";
71
+ /**
72
+ * @deprecated All bundles should use Bundler3 instead.
73
+ */
52
74
  readonly bundler: "0x23055618898e202386e6c13955a58D3C68200BFB";
75
+ readonly bundler3: {
76
+ readonly bundler3: "0x6BFd8137e702540E7A42B74178A4a49Ba43920C4";
77
+ readonly generalAdapter1: "0xb98c948CFA24072e58935BC004a8A7b376AE746A";
78
+ readonly paraswapAdapter: "0x6abE8ABd0275E5564ed1336F0243A52C32562F71";
79
+ readonly erc20WrapperAdapter: "0xdeEf55F0A7366cC3Baf5E04313269389Fe17E9AE";
80
+ readonly compoundV3MigrationAdapter: "0x85D4812Ef92c040d4270eD8547b6835e41FbbB70";
81
+ readonly aaveV3CoreMigrationAdapter: "0xb27Aa2a964eAd5ed661D86974b37e4fB995b36f5";
82
+ };
53
83
  readonly compoundV2Bundler: "0x123f3167a416cA19365dE03a65e0AF3532af7223";
54
84
  readonly aaveV3Bundler: "0xcAe2929baBc60Be34818EaA5F40bF69265677108";
55
85
  readonly compoundV3Bundler: "0x1f8076e2EB6f10b12e6886f30D4909A91969F7dA";
@@ -61,28 +91,74 @@ export declare const addresses: {
61
91
  readonly verUsdc: "0x59aaF835D34b1E3dF2170e4872B785f11E2a964b";
62
92
  readonly testUsdc: "0xBC77067f829979812d795d516E523C4033b66409";
63
93
  };
94
+ readonly 42161: {
95
+ readonly morpho: "0x6c247b1F6182318877311737BaC0844bAa518F5e";
96
+ readonly bundler3: {
97
+ readonly bundler3: "0x1FA4431bC113D308beE1d46B0e98Cb805FB48C13";
98
+ readonly generalAdapter1: "0x9954aFB60BB5A222714c478ac86990F221788B88";
99
+ readonly paraswapAdapter: "0xAA5c30C1482c189cA0d56057D3ac4dD7Af1e4726";
100
+ };
101
+ readonly permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3";
102
+ readonly adaptiveCurveIrm: "0x66F30587FB8D4206918deb78ecA7d5eBbafD06DA";
103
+ readonly publicAllocator: "0x769583Af5e9D03589F159EbEC31Cc2c23E8C355E";
104
+ readonly metaMorphoFactory: "0x878988f5f561081deEa117717052164ea1Ef0c82";
105
+ readonly wNative: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1";
106
+ readonly usdc: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831";
107
+ };
108
+ readonly 10: {
109
+ readonly morpho: "0xce95AfbB8EA029495c66020883F87aaE8864AF92";
110
+ readonly bundler3: {
111
+ readonly bundler3: "0xFBCd3C258feB131D8E038F2A3a670A7bE0507C05";
112
+ readonly generalAdapter1: "0x79481C87f24A3C4332442A2E9faaf675e5F141f0";
113
+ readonly paraswapAdapter: "0x31F539f4Ed14fA1fd18781e93f6739249692aDC5";
114
+ };
115
+ readonly permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3";
116
+ readonly adaptiveCurveIrm: "0x8cD70A8F399428456b29546BC5dBe10ab6a06ef6";
117
+ readonly publicAllocator: "0x0d68a97324E602E02799CD83B42D337207B40658";
118
+ readonly metaMorphoFactory: "0x3Bb6A6A0Bc85b367EFE0A5bAc81c5E52C892839a";
119
+ readonly wNative: "0x4200000000000000000000000000000000000006";
120
+ readonly usdc: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85";
121
+ };
64
122
  };
65
123
  export interface ChainAddresses {
66
124
  morpho: Address;
67
125
  permit2: Address;
68
- bundler: Address;
126
+ /**
127
+ * @deprecated All bundles should use Bundler3 instead.
128
+ */
129
+ bundler?: Address;
69
130
  aaveV3OptimizerBundler?: Address;
70
131
  aaveV2Bundler?: Address;
71
132
  aaveV3Bundler?: Address;
72
133
  compoundV3Bundler?: Address;
73
134
  compoundV2Bundler?: Address;
135
+ bundler3: {
136
+ bundler3: Address;
137
+ generalAdapter1: Address;
138
+ paraswapAdapter: Address;
139
+ erc20WrapperAdapter?: Address;
140
+ compoundV2MigrationAdapter?: Address;
141
+ compoundV3MigrationAdapter?: Address;
142
+ aaveV2MigrationAdapter?: Address;
143
+ aaveV3CoreMigrationAdapter?: Address;
144
+ aaveV3PrimeMigrationAdapter?: Address;
145
+ aaveV3EtherFiMigrationAdapter?: Address;
146
+ aaveV3OptimizerMigrationAdapter?: Address;
147
+ };
74
148
  adaptiveCurveIrm: Address;
75
149
  publicAllocator: Address;
76
150
  metaMorphoFactory: Address;
77
151
  wNative: Address;
78
152
  morphoToken?: Address;
153
+ aaveV3Optimizer?: Address;
79
154
  dai?: Address;
80
155
  mkr?: Address;
81
156
  usdc?: Address;
82
157
  stEth?: Address;
83
158
  wstEth?: Address;
159
+ cEth?: Address;
84
160
  }
85
- export type AddressLabel = keyof (typeof addresses)[ChainId];
161
+ export type AddressLabel = DottedKeys<(typeof addresses)[ChainId]>;
86
162
  declare const _default: { [n in ChainId]: ChainAddresses; };
87
163
  export default _default;
88
164
  export declare const getChainAddresses: (chainId: number) => ChainAddresses;
package/lib/addresses.js CHANGED
@@ -13,7 +13,23 @@ exports.addresses = {
13
13
  [chain_js_1.ChainId.EthMainnet]: {
14
14
  morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
15
15
  permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
16
+ /**
17
+ * @deprecated All bundles should use Bundler3 instead.
18
+ */
16
19
  bundler: "0x4095F064B8d3c3548A3bebfd0Bbfd04750E30077",
20
+ bundler3: {
21
+ bundler3: "0x6566194141eefa99Af43Bb5Aa71460Ca2Dc90245",
22
+ generalAdapter1: "0x4A6c312ec70E8747a587EE860a0353cd42Be0aE0",
23
+ paraswapAdapter: "0x03b5259Bd204BfD4A616E5B79b0B786d90c6C38f",
24
+ erc20WrapperAdapter: "0xf83D17dFE160597b19e4FdD8ea61A23e9a87F962",
25
+ compoundV2MigrationAdapter: "0x9B89c07f480Df1945279031b5fC6fF241b8f1101",
26
+ compoundV3MigrationAdapter: "0xdBa5bdE29eA030Bfa6A608592dFcA1D02CB26773",
27
+ aaveV2MigrationAdapter: "0x40288815C399709dFC0875A384B637fFe387961B",
28
+ aaveV3CoreMigrationAdapter: "0xb09e40EbE31b738fbf20289270a397118707D475",
29
+ aaveV3PrimeMigrationAdapter: "0x2CC8d502a65824B4cF9A58DB03490bA024BDB806",
30
+ aaveV3EtherFiMigrationAdapter: "0x4011dc6581fA05F9B0c7A12AdCd676e2b1a59ca3",
31
+ aaveV3OptimizerMigrationAdapter: "0x9e2ea2d5785598a163D569D795f286F5C55ad972",
32
+ },
17
33
  aaveV3OptimizerBundler: "0x16F38d2E764E7BeBF625a8E995b34968226D2F9c",
18
34
  aaveV2Bundler: "0xb3dCc75DB379925edFd3007511A8CE0cB4aa8e76",
19
35
  aaveV3Bundler: "0x98ccB155E86bb478d514a827d16f58c6912f9BDC",
@@ -24,11 +40,13 @@ exports.addresses = {
24
40
  metaMorphoFactory: "0xA9c3D3a366466Fa809d1Ae982Fb2c46E5fC41101",
25
41
  wNative: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
26
42
  morphoToken: "0x9994E35Db50125E0DF82e4c2dde62496CE330999",
43
+ aaveV3Optimizer: "0x33333aea097c193e66081E930c33020272b33333",
27
44
  dai: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
28
45
  sDai: "0x83F20F44975D03b1b09e64809B757c47f942BEeA",
29
46
  mkr: "0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2",
30
47
  stEth: "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84",
31
48
  wstEth: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
49
+ cEth: "0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5",
32
50
  osEth: "0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38",
33
51
  bIB01: "0xCA30c93B02514f86d5C86a6e375E3A330B435Fb5",
34
52
  // If we want to change the wbIB01 address, we have to check if the new one has simple permit or not.
@@ -57,7 +75,18 @@ exports.addresses = {
57
75
  [chain_js_1.ChainId.BaseMainnet]: {
58
76
  morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
59
77
  permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
78
+ /**
79
+ * @deprecated All bundles should use Bundler3 instead.
80
+ */
60
81
  bundler: "0x23055618898e202386e6c13955a58D3C68200BFB",
82
+ bundler3: {
83
+ bundler3: "0x6BFd8137e702540E7A42B74178A4a49Ba43920C4",
84
+ generalAdapter1: "0xb98c948CFA24072e58935BC004a8A7b376AE746A",
85
+ paraswapAdapter: "0x6abE8ABd0275E5564ed1336F0243A52C32562F71",
86
+ erc20WrapperAdapter: "0xdeEf55F0A7366cC3Baf5E04313269389Fe17E9AE",
87
+ compoundV3MigrationAdapter: "0x85D4812Ef92c040d4270eD8547b6835e41FbbB70",
88
+ aaveV3CoreMigrationAdapter: "0xb27Aa2a964eAd5ed661D86974b37e4fB995b36f5",
89
+ },
61
90
  compoundV2Bundler: "0x123f3167a416cA19365dE03a65e0AF3532af7223",
62
91
  aaveV3Bundler: "0xcAe2929baBc60Be34818EaA5F40bF69265677108",
63
92
  compoundV3Bundler: "0x1f8076e2EB6f10b12e6886f30D4909A91969F7dA",
@@ -69,6 +98,34 @@ exports.addresses = {
69
98
  verUsdc: "0x59aaF835D34b1E3dF2170e4872B785f11E2a964b",
70
99
  testUsdc: "0xBC77067f829979812d795d516E523C4033b66409",
71
100
  },
101
+ [chain_js_1.ChainId.ArbitrumMainnet]: {
102
+ morpho: "0x6c247b1F6182318877311737BaC0844bAa518F5e",
103
+ bundler3: {
104
+ bundler3: "0x1FA4431bC113D308beE1d46B0e98Cb805FB48C13",
105
+ generalAdapter1: "0x9954aFB60BB5A222714c478ac86990F221788B88",
106
+ paraswapAdapter: "0xAA5c30C1482c189cA0d56057D3ac4dD7Af1e4726",
107
+ },
108
+ permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
109
+ adaptiveCurveIrm: "0x66F30587FB8D4206918deb78ecA7d5eBbafD06DA",
110
+ publicAllocator: "0x769583Af5e9D03589F159EbEC31Cc2c23E8C355E",
111
+ metaMorphoFactory: "0x878988f5f561081deEa117717052164ea1Ef0c82",
112
+ wNative: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
113
+ usdc: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
114
+ },
115
+ [chain_js_1.ChainId.OptimismMainnet]: {
116
+ morpho: "0xce95AfbB8EA029495c66020883F87aaE8864AF92",
117
+ bundler3: {
118
+ bundler3: "0xFBCd3C258feB131D8E038F2A3a670A7bE0507C05",
119
+ generalAdapter1: "0x79481C87f24A3C4332442A2E9faaf675e5F141f0",
120
+ paraswapAdapter: "0x31F539f4Ed14fA1fd18781e93f6739249692aDC5",
121
+ },
122
+ permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
123
+ adaptiveCurveIrm: "0x8cD70A8F399428456b29546BC5dBe10ab6a06ef6",
124
+ publicAllocator: "0x0d68a97324E602E02799CD83B42D337207B40658",
125
+ metaMorphoFactory: "0x3Bb6A6A0Bc85b367EFE0A5bAc81c5E52C892839a",
126
+ wNative: "0x4200000000000000000000000000000000000006",
127
+ usdc: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
128
+ },
72
129
  };
73
130
  exports.default = exports.addresses;
74
131
  const getChainAddresses = (chainId) => {
@@ -98,6 +155,8 @@ exports.unwrappedTokensMapping = {
98
155
  [exports.addresses[chain_js_1.ChainId.BaseMainnet].verUsdc]: exports.addresses[chain_js_1.ChainId.BaseMainnet].usdc,
99
156
  [exports.addresses[chain_js_1.ChainId.BaseMainnet].testUsdc]: exports.addresses[chain_js_1.ChainId.BaseMainnet].usdc,
100
157
  },
158
+ [chain_js_1.ChainId.ArbitrumMainnet]: {},
159
+ [chain_js_1.ChainId.OptimismMainnet]: {},
101
160
  };
102
161
  function getUnwrappedToken(wrappedToken, chainId) {
103
162
  return exports.unwrappedTokensMapping[chainId][wrappedToken];
@@ -108,6 +167,8 @@ function getUnwrappedToken(wrappedToken, chainId) {
108
167
  exports.erc20WrapperTokens = {
109
168
  [chain_js_1.ChainId.EthMainnet]: new Set(),
110
169
  [chain_js_1.ChainId.BaseMainnet]: new Set(),
170
+ [chain_js_1.ChainId.ArbitrumMainnet]: new Set(),
171
+ [chain_js_1.ChainId.OptimismMainnet]: new Set(),
111
172
  };
112
173
  /**
113
174
  * The registry of all known PermissionedERC20Wrapper with a `hasPermission` getter.
@@ -116,6 +177,8 @@ exports.erc20WrapperTokens = {
116
177
  exports.permissionedWrapperTokens = {
117
178
  [chain_js_1.ChainId.EthMainnet]: new Set(),
118
179
  [chain_js_1.ChainId.BaseMainnet]: new Set([exports.addresses[chain_js_1.ChainId.BaseMainnet].testUsdc]),
180
+ [chain_js_1.ChainId.ArbitrumMainnet]: new Set(),
181
+ [chain_js_1.ChainId.OptimismMainnet]: new Set(),
119
182
  };
120
183
  /**
121
184
  * The registry of all known permissioned wrapped Backed tokens.
@@ -127,6 +190,8 @@ exports.permissionedBackedTokens = {
127
190
  exports.addresses[chain_js_1.ChainId.EthMainnet].wbC3M,
128
191
  ]),
129
192
  [chain_js_1.ChainId.BaseMainnet]: new Set(),
193
+ [chain_js_1.ChainId.ArbitrumMainnet]: new Set(),
194
+ [chain_js_1.ChainId.OptimismMainnet]: new Set(),
130
195
  };
131
196
  /**
132
197
  * The registry of all known permissioned wrapped tokens that require a Coinbase attestation.
@@ -135,6 +200,8 @@ exports.permissionedBackedTokens = {
135
200
  exports.permissionedCoinbaseTokens = {
136
201
  [chain_js_1.ChainId.EthMainnet]: new Set(),
137
202
  [chain_js_1.ChainId.BaseMainnet]: new Set([exports.addresses[chain_js_1.ChainId.BaseMainnet].verUsdc]),
203
+ [chain_js_1.ChainId.ArbitrumMainnet]: new Set(),
204
+ [chain_js_1.ChainId.OptimismMainnet]: new Set(),
138
205
  };
139
206
  (0, morpho_ts_1.entries)(exports.permissionedBackedTokens).forEach(([chainId, tokens]) => {
140
207
  tokens.forEach((token) => exports.erc20WrapperTokens[chainId].add(token));
@@ -158,4 +225,6 @@ exports.convexWrapperTokens = {
158
225
  exports.addresses[chain_js_1.ChainId.EthMainnet]["stkcvx2BTC-f-morpho"],
159
226
  ]),
160
227
  [chain_js_1.ChainId.BaseMainnet]: new Set(),
228
+ [chain_js_1.ChainId.ArbitrumMainnet]: new Set(),
229
+ [chain_js_1.ChainId.OptimismMainnet]: new Set(),
161
230
  };
package/lib/chain.d.ts CHANGED
@@ -1,21 +1,19 @@
1
1
  export declare enum ChainId {
2
2
  EthMainnet = 1,
3
- BaseMainnet = 8453
3
+ BaseMainnet = 8453,
4
+ ArbitrumMainnet = 42161,
5
+ OptimismMainnet = 10
4
6
  }
5
7
  export interface ChainMetadata {
6
8
  readonly name: string;
7
9
  readonly id: ChainId;
8
- readonly defaultRpcUrl: string;
9
10
  readonly explorerUrl: string;
10
11
  readonly nativeCurrency: {
11
12
  readonly name: string;
12
13
  readonly symbol: string;
13
14
  readonly decimals: number;
14
15
  };
15
- readonly isTestnet: boolean;
16
- readonly shortName: string;
17
16
  readonly identifier: string;
18
- readonly logoSrc: string;
19
17
  }
20
18
  export declare namespace ChainUtils {
21
19
  const toHexChainId: (chainId: ChainId) => string;
@@ -24,6 +22,5 @@ export declare namespace ChainUtils {
24
22
  const getExplorerTransactionUrl: (chainId: ChainId, tx: string) => string;
25
23
  function isSupported(chainId: number): chainId is ChainId;
26
24
  function parseSupportedChainId(candidate: unknown): ChainId;
27
- const BLUE_AVAILABLE_CHAINS: [ChainId, ...ChainId[]];
28
25
  const CHAIN_METADATA: Record<ChainId, ChainMetadata>;
29
26
  }
package/lib/chain.js CHANGED
@@ -6,28 +6,8 @@ var ChainId;
6
6
  (function (ChainId) {
7
7
  ChainId[ChainId["EthMainnet"] = 1] = "EthMainnet";
8
8
  ChainId[ChainId["BaseMainnet"] = 8453] = "BaseMainnet";
9
- // EthGoerliTestnet = 5,
10
- // PolygonMainnet = 137,
11
- // MumbaiTestnet = 80001,
12
- // OptimismMainnet = 10,
13
- // BscMainnet = 56,
14
- // ArbitrumMainnet = 42161,
15
- // ArbitrumTestnet = 421611,
16
- // GnosisChain = 100,
17
- // FantomMainnet = 250,
18
- // FantomTestnet = 4002,
19
- // HarmonyMainnet = 128,
20
- // HarmonyTestnet = 1666600000,
21
- // BscTestnet = 97,
22
- // OptimismTestnet = 69,
23
- // EthRopstenTestnet = 3,
24
- // EthRinkebyTestnet = 4,
25
- // EthKovanTestnet = 42,
26
- // GnosisChainTestnet = 10200,
27
- // AvalancheMainnet = 43114,
28
- // AvalancheFujiTestnet = 43113,
29
- // MoonbaseAlphaTestnet = 1287,
30
- // BaseGoerliTestnet = 84531,
9
+ ChainId[ChainId["ArbitrumMainnet"] = 42161] = "ArbitrumMainnet";
10
+ ChainId[ChainId["OptimismMainnet"] = 10] = "OptimismMainnet";
31
11
  })(ChainId || (exports.ChainId = ChainId = {}));
32
12
  var ChainUtils;
33
13
  (function (ChainUtils) {
@@ -44,7 +24,7 @@ var ChainUtils;
44
24
  return `${ChainUtils.getExplorerUrl(chainId)}/tx/${tx}`;
45
25
  };
46
26
  function isSupported(chainId) {
47
- return ChainUtils.BLUE_AVAILABLE_CHAINS.includes(chainId);
27
+ return Object.values(ChainId).includes(chainId);
48
28
  }
49
29
  ChainUtils.isSupported = isSupported;
50
30
  function parseSupportedChainId(candidate) {
@@ -54,236 +34,34 @@ var ChainUtils;
54
34
  return chainId;
55
35
  }
56
36
  ChainUtils.parseSupportedChainId = parseSupportedChainId;
57
- ChainUtils.BLUE_AVAILABLE_CHAINS = [
58
- ChainId.EthMainnet,
59
- ChainId.BaseMainnet,
60
- ];
61
37
  ChainUtils.CHAIN_METADATA = {
62
38
  [ChainId.EthMainnet]: {
63
39
  name: "Ethereum",
64
40
  id: ChainId.EthMainnet,
65
41
  nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
66
- defaultRpcUrl: "https://mainnet.infura.io/V3/84842078b09946638c03157f83405213",
67
42
  explorerUrl: "https://etherscan.io",
68
- isTestnet: false,
69
- shortName: "ETH",
70
- logoSrc: "https://cdn.morpho.org/assets/chains/eth.svg",
71
43
  identifier: "mainnet",
72
44
  },
73
45
  [ChainId.BaseMainnet]: {
74
46
  name: "Base",
75
47
  id: ChainId.BaseMainnet,
76
48
  nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
77
- defaultRpcUrl: "https://rpc.baseprotocol.org",
78
49
  explorerUrl: "https://basescan.org",
79
- isTestnet: false,
80
- shortName: "Base",
81
- logoSrc: "https://cdn.morpho.org/assets/chains/base.png",
82
50
  identifier: "base",
83
51
  },
84
- // [ChainId.EthGoerliTestnet]: {
85
- // name: "Ethereum Goerli Testnet",
86
- // id: ChainId.EthGoerliTestnet,
87
- // nativeCurrency: { name: "Goerli Ether", symbol: "ETH", decimals: 18 },
88
- // defaultRpcUrl:
89
- // "https://goerli.infura.io/V3/84842078b09946638c03157f83405213",
90
- // explorerUrl: "https://goerli.etherscan.io",
91
- // isTestnet: true,
92
- // shortName: "Goerli",
93
- // logoSrc: "https://cdn.morpho.org/assets/chains/eth.svg",
94
- // identifier: "goerli",
95
- // },
96
- // [ChainId.PolygonMainnet]: {
97
- // name: "Polygon Mainnet",
98
- // id: ChainId.PolygonMainnet,
99
- // nativeCurrency: { name: "MATIC", symbol: "MATIC", decimals: 18n },
100
- // defaultRpcUrl: "https://rpc-mainnet.maticvigil.com",
101
- // explorerUrl: "https://polygonscan.com",
102
- // isTestnet: false,
103
- // shortName: "Polygon",
104
- // },
105
- // [ChainId.MumbaiTestnet]: {
106
- // name: "Mumbai Testnet",
107
- // id: ChainId.MumbaiTestnet,
108
- // nativeCurrency: { name: "MATIC", symbol: "MATIC", decimals: 18n },
109
- // defaultRpcUrl: "https://rpc-mumbai.maticvigil.com",
110
- // explorerUrl: "https://mumbai.polygonscan.com",
111
- // isTestnet: true,
112
- // shortName: "Mumbai",
113
- // },
114
- /* see https://chainid.network/chains.json */
115
- // [ChainId.PolygonMainnet]: {
116
- // name: "Polygon Mainnet",
117
- // id: ChainId.PolygonMainnet,
118
- // nativeCurrency: { name: "MATIC", symbol: "MATIC", decimals: 18n },
119
- // defaultRpcUrl: "https://rpc-mainnet.maticvigil.com",
120
- // explorerUrl: "https://polygonscan.com",
121
- // isTestnet: false,
122
- // shortName: "Polygon",
123
- // },
124
- // [ChainId.MumbaiTestnet]: {
125
- // name: "Mumbai Testnet",
126
- // id: ChainId.MumbaiTestnet,
127
- // nativeCurrency: { name: "MATIC", symbol: "MATIC", decimals: 18n },
128
- // defaultRpcUrl: "https://rpc-mumbai.maticvigil.com",
129
- // explorerUrl: "https://mumbai.polygonscan.com",
130
- // isTestnet: true,
131
- // shortName: "Mumbai",
132
- // },
133
- // [ChainId.OptimismMainnet]: {
134
- // name: "Optimism Mainnet",
135
- // id: ChainId.OptimismMainnet,
136
- // baseCurrency: "ETH",
137
- // defaultRpcUrl: "https://mainnet.optimism.io",
138
- // explorerUrl: "https://optimistic.etherscan.io",
139
- // isTestnet: false,
140
- // },
141
- // [ChainId.BscMainnet]: {
142
- // name: "Binance Smart Chain Mainnet",
143
- // id: ChainId.BscMainnet,
144
- // baseCurrency: "BNB",
145
- // defaultRpcUrl: "https://bsc-dataseed.binance.org",
146
- // explorerUrl: "https://bscscan.com",
147
- // isTestnet: false,
148
- // },
149
- // [ChainId.ArbitrumMainnet]: {
150
- // name: "Arbitrum Mainnet",
151
- // id: ChainId.ArbitrumMainnet,
152
- // baseCurrency: "ETH",
153
- // defaultRpcUrl: "https://arb1.arbitrum.io/rpc",
154
- // explorerUrl: "https://arbiscan.io",
155
- // isTestnet: false,
156
- // },
157
- // [ChainId.ArbitrumTestnet]: {
158
- // name: "Arbitrum Testnet",
159
- // id: ChainId.ArbitrumTestnet,
160
- // baseCurrency: "ETH",
161
- // defaultRpcUrl: "https://rinkeby.arbitrum.io/rpc",
162
- // explorerUrl: "https://rinkeby-explorer.arbitrum.io",
163
- // isTestnet: true,
164
- // },
165
- // [ChainId.GnosisChain]: {
166
- // name: "Gnosis Chain",
167
- // id: ChainId.GnosisChain,
168
- // baseCurrency: "XDAI",
169
- // defaultRpcUrl: "https://rpc.xdaichain.com",
170
- // explorerUrl: "https://gnosis.blockscout.com",
171
- // isTestnet: false,
172
- // },
173
- // [ChainId.FantomMainnet]: {
174
- // name: "Fantom Mainnet",
175
- // id: ChainId.FantomMainnet,
176
- // baseCurrency: "FTM",
177
- // defaultRpcUrl: "https://rpcapi.fantom.network",
178
- // explorerUrl: "https://ftmscan.com",
179
- // isTestnet: false,
180
- // },
181
- // [ChainId.FantomTestnet]: {
182
- // name: "Fantom Testnet",
183
- // id: ChainId.FantomTestnet,
184
- // baseCurrency: "FTM",
185
- // defaultRpcUrl: "https://rpc.testnet.fantom.network",
186
- // explorerUrl: "https://explorer.testnet.fantom.network",
187
- // isTestnet: true,
188
- // },
189
- // [ChainId.HarmonyMainnet]: {
190
- // name: "Harmony Mainnet",
191
- // id: ChainId.HarmonyMainnet,
192
- // baseCurrency: "ONE",
193
- // defaultRpcUrl: "https://api.harmony.one",
194
- // explorerUrl: "https://explorer.harmony.one",
195
- // isTestnet: false,
196
- // },
197
- // [ChainId.HarmonyTestnet]: {
198
- // name: "Harmony Testnet",
199
- // id: ChainId.HarmonyTestnet,
200
- // baseCurrency: "ONE",
201
- // defaultRpcUrl: "https://api.s0.b.hmny.io",
202
- // explorerUrl: "https://explorer.testnet.harmony.one",
203
- // isTestnet: true,
204
- // },
205
- // [ChainId.BscTestnet]: {
206
- // name: "Binance Smart Chain Testnet",
207
- // id: ChainId.BscTestnet,
208
- // baseCurrency: "BNB",
209
- // defaultRpcUrl: "https://data-seed-prebsc-1-s1.binance.org:8545",
210
- // explorerUrl: "https://testnet.bscscan.com",
211
- // isTestnet: true,
212
- // },
213
- // [ChainId.OptimismTestnet]: {
214
- // name: "Optimism Testnet",
215
- // id: ChainId.OptimismTestnet,
216
- // baseCurrency: "ETH",
217
- // defaultRpcUrl: "https://kovan.optimism.io",
218
- // explorerUrl: "https://kovan-optimistic.etherscan.io",
219
- // isTestnet: true,
220
- // },
221
- // [ChainId.EthRopstenTestnet]: {
222
- // name: "Ethereum Ropsten Testnet",
223
- // id: ChainId.EthRopstenTestnet,
224
- // baseCurrency: "ETH",
225
- // defaultRpcUrl:
226
- // "https://ropsten.infura.io/V4/84842078b09946638c03157f83405213",
227
- // explorerUrl: "https://ropsten.etherscan.io",
228
- // isTestnet: true,
229
- // },
230
- // [ChainId.EthRinkebyTestnet]: {
231
- // name: "Ethereum Rinkeby Testnet",
232
- // id: ChainId.EthRinkebyTestnet,
233
- // baseCurrency: "ETH",
234
- // defaultRpcUrl:
235
- // "https://rinkeby.infura.io/V4/84842078b09946638c03157f83405213",
236
- // explorerUrl: "https://rinkeby.etherscan.io",
237
- // isTestnet: true,
238
- // },
239
- // [ChainId.EthKovanTestnet]: {
240
- // name: "Ethereum Kovan Testnet",
241
- // id: ChainId.EthKovanTestnet,
242
- // baseCurrency: "ETH",
243
- // defaultRpcUrl:
244
- // "https://kovan.infura.io/V4/84842078b09946638c03157f83405213",
245
- // explorerUrl: "https://kovan.etherscan.io",
246
- // isTestnet: true,
247
- // },
248
- // [ChainId.BaseGoerliTestnet]: {
249
- // name: "Base Goerli Testnet",
250
- // id: ChainId.BaseGoerliTestnet,
251
- // baseCurrency: "ETH",
252
- // defaultRpcUrl: "https://rpc-goerli.baseprotocol.org",
253
- // explorerUrl: "https://goerli.basescan.org",
254
- // isTestnet: true,
255
- // },
256
- // [ChainId.GnosisChainTestnet]: {
257
- // name: "Gnosis Chain Testnet",
258
- // id: ChainId.GnosisChainTestnet,
259
- // baseCurrency: "XDAI",
260
- // defaultRpcUrl: "https://rpc.chiado.gnosis.gateway.fm",
261
- // explorerUrl: "https://gnosis-chiado.blockscout.com/",
262
- // isTestnet: true,
263
- // },
264
- // [ChainId.AvalancheMainnet]: {
265
- // name: "Avalanche Mainnet",
266
- // id: ChainId.AvalancheMainnet,
267
- // baseCurrency: "AVAX",
268
- // defaultRpcUrl: "https://api.avax.network/ext/bc/C/rpc",
269
- // explorerUrl: "https://cchain.explorer.avax.network",
270
- // isTestnet: false,
271
- // },
272
- // [ChainId.AvalancheFujiTestnet]: {
273
- // name: "Avalanche Fuji Testnet",
274
- // id: ChainId.AvalancheFujiTestnet,
275
- // baseCurrency: "AVAX",
276
- // defaultRpcUrl: "https://api.avax-test.network/ext/bc/C/rpc",
277
- // explorerUrl: "https://cchain.explorer.avax-test.network",
278
- // isTestnet: true,
279
- // },
280
- // [ChainId.MoonbaseAlphaTestnet]: {
281
- // name: "Moonbase Alpha Testnet",
282
- // id: ChainId.MoonbaseAlphaTestnet,
283
- // baseCurrency: "DEV",
284
- // defaultRpcUrl: "https://rpc.testnet.moonbeam.network",
285
- // explorerUrl: "https://moonbase-blockscout.testnet.moonbeam.network",
286
- // isTestnet: true,
287
- // },
52
+ [ChainId.ArbitrumMainnet]: {
53
+ name: "Arbitrum Mainnet",
54
+ id: ChainId.ArbitrumMainnet,
55
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
56
+ explorerUrl: "https://arbiscan.io",
57
+ identifier: "arbitrum",
58
+ },
59
+ [ChainId.OptimismMainnet]: {
60
+ name: "Optimism Mainnet",
61
+ id: ChainId.OptimismMainnet,
62
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
63
+ explorerUrl: "https://optimistic.etherscan.io",
64
+ identifier: "optimism",
65
+ },
288
66
  };
289
67
  })(ChainUtils || (exports.ChainUtils = ChainUtils = {}));
@@ -1,5 +1,5 @@
1
1
  import type { Address, BigIntish } from "../types.js";
2
- export declare const ERC20_ALLOWANCE_RECIPIENTS: readonly ["morpho", "permit2", "bundler"];
2
+ export declare const ERC20_ALLOWANCE_RECIPIENTS: readonly ["morpho", "permit2", "bundler3.generalAdapter1"];
3
3
  export type Erc20AllowanceRecipient = (typeof ERC20_ALLOWANCE_RECIPIENTS)[number];
4
4
  export interface Permit2Allowance {
5
5
  amount: bigint;
@@ -5,7 +5,7 @@ const morpho_ts_1 = require("@morpho-org/morpho-ts");
5
5
  exports.ERC20_ALLOWANCE_RECIPIENTS = [
6
6
  "morpho",
7
7
  "permit2",
8
- "bundler",
8
+ "bundler3.generalAdapter1",
9
9
  ];
10
10
  class Holding {
11
11
  /**
@@ -6,6 +6,7 @@ export type RoundingDirection = "Up" | "Down";
6
6
  */
7
7
  export declare namespace MathLib {
8
8
  const WAD = 1000000000000000000n;
9
+ const RAY = 1000000000000000000000000000n;
9
10
  const MAX_UINT_256: bigint;
10
11
  const MAX_UINT_160: bigint;
11
12
  const MAX_UINT_128: bigint;
@@ -93,4 +94,9 @@ export declare namespace MathLib {
93
94
  * @param n The exponent
94
95
  */
95
96
  function wTaylorCompounded(x: BigIntish, n: BigIntish): bigint;
97
+ /**
98
+ * Converts a WAD-based quantity to a RAY-based quantity.
99
+ * @param x The WAD-based quantity.
100
+ */
101
+ function wToRay(x: BigIntish): bigint;
96
102
  }
@@ -8,6 +8,7 @@ exports.MathLib = void 0;
8
8
  var MathLib;
9
9
  (function (MathLib) {
10
10
  MathLib.WAD = 1000000000000000000n;
11
+ MathLib.RAY = 1000000000000000000000000000n;
11
12
  MathLib.MAX_UINT_256 = maxUint(256);
12
13
  MathLib.MAX_UINT_160 = maxUint(160);
13
14
  MathLib.MAX_UINT_128 = maxUint(128);
@@ -159,4 +160,12 @@ var MathLib;
159
160
  return firstTerm + secondTerm + thirdTerm;
160
161
  }
161
162
  MathLib.wTaylorCompounded = wTaylorCompounded;
163
+ /**
164
+ * Converts a WAD-based quantity to a RAY-based quantity.
165
+ * @param x The WAD-based quantity.
166
+ */
167
+ function wToRay(x) {
168
+ return BigInt(x) * 1000000000n;
169
+ }
170
+ MathLib.wToRay = wToRay;
162
171
  })(MathLib || (exports.MathLib = MathLib = {}));
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": "3.0.0-next.0",
4
+ "version": "3.0.0-next.2",
5
5
  "author": "Morpho Association <contact@morpho.org>",
6
6
  "contributors": [
7
7
  "Rubilmax <rmilon@gmail.com>"