@morpho-org/blue-sdk 3.0.0-next.4 → 3.0.0-next.5
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.
- package/lib/addresses.d.ts +50 -51
- package/lib/addresses.js +49 -78
- package/lib/chain.d.ts +0 -2
- package/lib/chain.js +0 -12
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/vault/VaultMarketConfig.d.ts +2 -2
- package/package.json +4 -4
package/lib/addresses.d.ts
CHANGED
|
@@ -6,7 +6,48 @@ import type { Address } from "./types.js";
|
|
|
6
6
|
* NB: data might differ from expected onchain native token data
|
|
7
7
|
*/
|
|
8
8
|
export declare const NATIVE_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
9
|
-
export
|
|
9
|
+
export interface ChainAddresses {
|
|
10
|
+
morpho: Address;
|
|
11
|
+
permit2?: Address;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
14
|
+
*/
|
|
15
|
+
bundler?: Address;
|
|
16
|
+
aaveV3OptimizerBundler?: Address;
|
|
17
|
+
aaveV2Bundler?: Address;
|
|
18
|
+
aaveV3Bundler?: Address;
|
|
19
|
+
compoundV3Bundler?: Address;
|
|
20
|
+
compoundV2Bundler?: Address;
|
|
21
|
+
bundler3: {
|
|
22
|
+
bundler3: Address;
|
|
23
|
+
generalAdapter1: Address;
|
|
24
|
+
paraswapAdapter?: Address;
|
|
25
|
+
erc20WrapperAdapter?: Address;
|
|
26
|
+
compoundV2MigrationAdapter?: Address;
|
|
27
|
+
compoundV3MigrationAdapter?: Address;
|
|
28
|
+
aaveV2MigrationAdapter?: Address;
|
|
29
|
+
aaveV3CoreMigrationAdapter?: Address;
|
|
30
|
+
aaveV3PrimeMigrationAdapter?: Address;
|
|
31
|
+
aaveV3EtherFiMigrationAdapter?: Address;
|
|
32
|
+
aaveV3OptimizerMigrationAdapter?: Address;
|
|
33
|
+
};
|
|
34
|
+
adaptiveCurveIrm: Address;
|
|
35
|
+
publicAllocator?: Address;
|
|
36
|
+
metaMorphoFactory?: Address;
|
|
37
|
+
wNative?: Address;
|
|
38
|
+
morphoToken?: Address;
|
|
39
|
+
/**
|
|
40
|
+
* Must implement DAI specific permit (otherwise breaks permit signatures).
|
|
41
|
+
*/
|
|
42
|
+
dai?: Address;
|
|
43
|
+
/**
|
|
44
|
+
* Must implement USDC permit version 2 (otherwise breaks permit signatures).
|
|
45
|
+
*/
|
|
46
|
+
usdc?: Address;
|
|
47
|
+
stEth?: Address;
|
|
48
|
+
wstEth?: Address;
|
|
49
|
+
}
|
|
50
|
+
export declare const addressesRegistry: {
|
|
10
51
|
readonly 1: {
|
|
11
52
|
readonly morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb";
|
|
12
53
|
readonly permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3";
|
|
@@ -37,13 +78,11 @@ export declare const addresses: {
|
|
|
37
78
|
readonly metaMorphoFactory: "0x1897A8997241C1cD4bD0698647e4EB7213535c24";
|
|
38
79
|
readonly wNative: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";
|
|
39
80
|
readonly morphoToken: "0x9994E35Db50125E0DF82e4c2dde62496CE330999";
|
|
40
|
-
readonly aaveV3Optimizer: "0x33333aea097c193e66081E930c33020272b33333";
|
|
41
81
|
readonly dai: "0x6B175474E89094C44Da98b954EedeAC495271d0F";
|
|
42
82
|
readonly sDai: "0x83F20F44975D03b1b09e64809B757c47f942BEeA";
|
|
43
83
|
readonly mkr: "0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2";
|
|
44
84
|
readonly stEth: "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84";
|
|
45
85
|
readonly wstEth: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0";
|
|
46
|
-
readonly cEth: "0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5";
|
|
47
86
|
readonly osEth: "0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38";
|
|
48
87
|
readonly bIB01: "0xCA30c93B02514f86d5C86a6e375E3A330B435Fb5";
|
|
49
88
|
readonly wbIB01: "0xcA2A7068e551d5C4482eb34880b194E4b945712F";
|
|
@@ -142,7 +181,6 @@ export declare const addresses: {
|
|
|
142
181
|
readonly publicAllocator: "0xef9889B4e443DEd35FA0Bd060f2104Cca94e6A43";
|
|
143
182
|
readonly metaMorphoFactory: "0x4DBB3a642a2146d5413750Cca3647086D9ba5F12";
|
|
144
183
|
readonly wNative: "0x4200000000000000000000000000000000000006";
|
|
145
|
-
readonly usdc: "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1";
|
|
146
184
|
};
|
|
147
185
|
readonly 252: {
|
|
148
186
|
readonly morpho: "0xa6030627d724bA78a59aCf43Be7550b4C5a0653b";
|
|
@@ -154,7 +192,6 @@ export declare const addresses: {
|
|
|
154
192
|
readonly publicAllocator: "0x37a888192165fC39884f87c64E2476BfD2C09675";
|
|
155
193
|
readonly metaMorphoFactory: "0x27D4Af0AC9E7FDfA6D0853236f249CC27AE79488";
|
|
156
194
|
readonly wNative: "0xfc00000000000000000000000000000000000006";
|
|
157
|
-
readonly usdc: "0xDcc0F2D8F90FDe85b10aC1c8Ab57dc0AE946A543";
|
|
158
195
|
};
|
|
159
196
|
readonly 534352: {
|
|
160
197
|
readonly morpho: "0x2d012EdbAdc37eDc2BC62791B666f9193FDF5a55";
|
|
@@ -181,47 +218,8 @@ export declare const addresses: {
|
|
|
181
218
|
readonly usdc: "0xF1815bd50389c46847f0Bda824eC8da914045D14";
|
|
182
219
|
};
|
|
183
220
|
};
|
|
184
|
-
export
|
|
185
|
-
|
|
186
|
-
permit2?: Address;
|
|
187
|
-
/**
|
|
188
|
-
* @deprecated All bundles should use Bundler3 instead.
|
|
189
|
-
*/
|
|
190
|
-
bundler?: Address;
|
|
191
|
-
aaveV3OptimizerBundler?: Address;
|
|
192
|
-
aaveV2Bundler?: Address;
|
|
193
|
-
aaveV3Bundler?: Address;
|
|
194
|
-
compoundV3Bundler?: Address;
|
|
195
|
-
compoundV2Bundler?: Address;
|
|
196
|
-
bundler3: {
|
|
197
|
-
bundler3: Address;
|
|
198
|
-
generalAdapter1: Address;
|
|
199
|
-
paraswapAdapter?: Address;
|
|
200
|
-
erc20WrapperAdapter?: Address;
|
|
201
|
-
compoundV2MigrationAdapter?: Address;
|
|
202
|
-
compoundV3MigrationAdapter?: Address;
|
|
203
|
-
aaveV2MigrationAdapter?: Address;
|
|
204
|
-
aaveV3CoreMigrationAdapter?: Address;
|
|
205
|
-
aaveV3PrimeMigrationAdapter?: Address;
|
|
206
|
-
aaveV3EtherFiMigrationAdapter?: Address;
|
|
207
|
-
aaveV3OptimizerMigrationAdapter?: Address;
|
|
208
|
-
};
|
|
209
|
-
adaptiveCurveIrm: Address;
|
|
210
|
-
publicAllocator: Address;
|
|
211
|
-
metaMorphoFactory: Address;
|
|
212
|
-
wNative: Address;
|
|
213
|
-
morphoToken?: Address;
|
|
214
|
-
aaveV3Optimizer?: Address;
|
|
215
|
-
dai?: Address;
|
|
216
|
-
mkr?: Address;
|
|
217
|
-
usdc?: Address;
|
|
218
|
-
stEth?: Address;
|
|
219
|
-
wstEth?: Address;
|
|
220
|
-
cEth?: Address;
|
|
221
|
-
}
|
|
222
|
-
export type AddressLabel = DottedKeys<(typeof addresses)[ChainId]>;
|
|
223
|
-
declare const _default: { [n in ChainId]: ChainAddresses; };
|
|
224
|
-
export default _default;
|
|
221
|
+
export declare const addresses: Record<number, ChainAddresses>;
|
|
222
|
+
export type AddressLabel = DottedKeys<(typeof addressesRegistry)[ChainId]>;
|
|
225
223
|
export declare const getChainAddresses: (chainId: number) => ChainAddresses;
|
|
226
224
|
/**
|
|
227
225
|
* Assumptions:
|
|
@@ -232,23 +230,24 @@ export declare function getUnwrappedToken(wrappedToken: Address, chainId: ChainI
|
|
|
232
230
|
/**
|
|
233
231
|
* The registry of all known ERC20Wrapper tokens.
|
|
234
232
|
*/
|
|
235
|
-
export declare const erc20WrapperTokens: Record<
|
|
233
|
+
export declare const erc20WrapperTokens: Record<number, Set<Address>>;
|
|
236
234
|
/**
|
|
237
235
|
* The registry of all known PermissionedERC20Wrapper with a `hasPermission` getter.
|
|
238
236
|
* All permissioned wrapper tokens are considered ERC20Wrapper and automatically added to the erc20WrapperTokens registry.
|
|
239
237
|
*/
|
|
240
|
-
export declare const permissionedWrapperTokens: Record<
|
|
238
|
+
export declare const permissionedWrapperTokens: Record<number, Set<Address>>;
|
|
241
239
|
/**
|
|
242
240
|
* The registry of all known permissioned wrapped Backed tokens.
|
|
243
241
|
* All permissioned Backed tokens are considered ERC20Wrapper and automatically added to the erc20WrapperTokens registry.
|
|
244
242
|
*/
|
|
245
|
-
export declare const permissionedBackedTokens: Record<
|
|
243
|
+
export declare const permissionedBackedTokens: Record<number, Set<Address>>;
|
|
246
244
|
/**
|
|
247
245
|
* The registry of all known permissioned wrapped tokens that require a Coinbase attestation.
|
|
248
246
|
* All permissioned Coinbase tokens are considered PermissionedERC20Wrapper and automatically added to the permissionedWrapperTokens registry.
|
|
249
247
|
*/
|
|
250
|
-
export declare const permissionedCoinbaseTokens: Record<
|
|
248
|
+
export declare const permissionedCoinbaseTokens: Record<number, Set<Address>>;
|
|
249
|
+
export declare const getPermissionedCoinbaseTokens: (chainId: number) => Set<`0x${string}`>;
|
|
251
250
|
/** /!\ These tokens can not be listed in `erc20WrapperTokens` because the following specs are different:
|
|
252
251
|
* - calling `depositFor` supplies on blue instead of minting wrapped token to the user
|
|
253
252
|
*/
|
|
254
|
-
export declare const convexWrapperTokens: Record<
|
|
253
|
+
export declare const convexWrapperTokens: Record<number, Set<Address>>;
|
package/lib/addresses.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convexWrapperTokens = exports.permissionedCoinbaseTokens = exports.permissionedBackedTokens = exports.permissionedWrapperTokens = exports.erc20WrapperTokens = exports.unwrappedTokensMapping = exports.getChainAddresses = exports.addresses = exports.NATIVE_ADDRESS = void 0;
|
|
3
|
+
exports.convexWrapperTokens = exports.getPermissionedCoinbaseTokens = exports.permissionedCoinbaseTokens = exports.permissionedBackedTokens = exports.permissionedWrapperTokens = exports.erc20WrapperTokens = exports.unwrappedTokensMapping = exports.getChainAddresses = exports.addresses = exports.addressesRegistry = exports.NATIVE_ADDRESS = void 0;
|
|
4
4
|
exports.getUnwrappedToken = getUnwrappedToken;
|
|
5
5
|
const morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
6
6
|
const chain_js_1 = require("./chain.js");
|
|
7
|
+
const errors_js_1 = require("./errors.js");
|
|
7
8
|
/** Address used to replicate an erc20-behaviour for native token.
|
|
8
9
|
*
|
|
9
10
|
* NB: data might differ from expected onchain native token data
|
|
10
11
|
*/
|
|
11
12
|
exports.NATIVE_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
12
|
-
exports.
|
|
13
|
+
exports.addressesRegistry = {
|
|
13
14
|
[chain_js_1.ChainId.EthMainnet]: {
|
|
14
15
|
morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
|
|
15
16
|
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
@@ -40,13 +41,12 @@ exports.addresses = {
|
|
|
40
41
|
metaMorphoFactory: "0x1897A8997241C1cD4bD0698647e4EB7213535c24",
|
|
41
42
|
wNative: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
|
42
43
|
morphoToken: "0x9994E35Db50125E0DF82e4c2dde62496CE330999",
|
|
43
|
-
|
|
44
|
+
// Must implement DAI specific permit (otherwise breaks permit signatures).
|
|
44
45
|
dai: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
|
|
45
46
|
sDai: "0x83F20F44975D03b1b09e64809B757c47f942BEeA",
|
|
46
47
|
mkr: "0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2",
|
|
47
48
|
stEth: "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84",
|
|
48
49
|
wstEth: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
|
|
49
|
-
cEth: "0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5",
|
|
50
50
|
osEth: "0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38",
|
|
51
51
|
bIB01: "0xCA30c93B02514f86d5C86a6e375E3A330B435Fb5",
|
|
52
52
|
// If we want to change the wbIB01 address, we have to check if the new one has simple permit or not.
|
|
@@ -56,6 +56,7 @@ exports.addresses = {
|
|
|
56
56
|
// If we want to change the wbC3M address, we have to check if the new one has simple permit or not.
|
|
57
57
|
// Currently, wbC3M is considered to have simple permit.
|
|
58
58
|
wbC3M: "0x95D7337d43340E2721960Dc402D9b9117f0d81a2",
|
|
59
|
+
// Must implement USDC permit version 2 (otherwise breaks permit signatures).
|
|
59
60
|
usdc: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
60
61
|
usdt: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
|
|
61
62
|
crvUsd: "0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E",
|
|
@@ -94,6 +95,7 @@ exports.addresses = {
|
|
|
94
95
|
publicAllocator: "0xA090dD1a701408Df1d4d0B85b716c87565f90467",
|
|
95
96
|
metaMorphoFactory: "0xFf62A7c278C62eD665133147129245053Bbf5918",
|
|
96
97
|
wNative: "0x4200000000000000000000000000000000000006",
|
|
98
|
+
// Must implement USDC permit version 2 (otherwise breaks permit signatures).
|
|
97
99
|
usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
98
100
|
verUsdc: "0x59aaF835D34b1E3dF2170e4872B785f11E2a964b",
|
|
99
101
|
testUsdc: "0xBC77067f829979812d795d516E523C4033b66409",
|
|
@@ -123,6 +125,7 @@ exports.addresses = {
|
|
|
123
125
|
publicAllocator: "0x769583Af5e9D03589F159EbEC31Cc2c23E8C355E",
|
|
124
126
|
metaMorphoFactory: "0x878988f5f561081deEa117717052164ea1Ef0c82",
|
|
125
127
|
wNative: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
|
|
128
|
+
// Must implement USDC permit version 2 (otherwise breaks permit signatures).
|
|
126
129
|
usdc: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
127
130
|
},
|
|
128
131
|
[chain_js_1.ChainId.OptimismMainnet]: {
|
|
@@ -137,6 +140,7 @@ exports.addresses = {
|
|
|
137
140
|
publicAllocator: "0x0d68a97324E602E02799CD83B42D337207B40658",
|
|
138
141
|
metaMorphoFactory: "0x3Bb6A6A0Bc85b367EFE0A5bAc81c5E52C892839a",
|
|
139
142
|
wNative: "0x4200000000000000000000000000000000000006",
|
|
143
|
+
// Must implement USDC permit version 2 (otherwise breaks permit signatures).
|
|
140
144
|
usdc: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
|
141
145
|
},
|
|
142
146
|
[chain_js_1.ChainId.WorldChainMainnet]: {
|
|
@@ -149,7 +153,6 @@ exports.addresses = {
|
|
|
149
153
|
publicAllocator: "0xef9889B4e443DEd35FA0Bd060f2104Cca94e6A43",
|
|
150
154
|
metaMorphoFactory: "0x4DBB3a642a2146d5413750Cca3647086D9ba5F12",
|
|
151
155
|
wNative: "0x4200000000000000000000000000000000000006",
|
|
152
|
-
usdc: "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1",
|
|
153
156
|
},
|
|
154
157
|
[chain_js_1.ChainId.FraxtalMainnet]: {
|
|
155
158
|
morpho: "0xa6030627d724bA78a59aCf43Be7550b4C5a0653b",
|
|
@@ -161,7 +164,6 @@ exports.addresses = {
|
|
|
161
164
|
publicAllocator: "0x37a888192165fC39884f87c64E2476BfD2C09675",
|
|
162
165
|
metaMorphoFactory: "0x27D4Af0AC9E7FDfA6D0853236f249CC27AE79488",
|
|
163
166
|
wNative: "0xfc00000000000000000000000000000000000006",
|
|
164
|
-
usdc: "0xDcc0F2D8F90FDe85b10aC1c8Ab57dc0AE946A543",
|
|
165
167
|
},
|
|
166
168
|
[chain_js_1.ChainId.ScrollMainnet]: {
|
|
167
169
|
morpho: "0x2d012EdbAdc37eDc2BC62791B666f9193FDF5a55",
|
|
@@ -173,6 +175,7 @@ exports.addresses = {
|
|
|
173
175
|
publicAllocator: "0x8a7f671E45E51dE245649Cf916cA0256FB8a9927",
|
|
174
176
|
metaMorphoFactory: "0x56b65742ade55015e6480959808229Ad6dbc9295",
|
|
175
177
|
wNative: "0x5300000000000000000000000000000000000004",
|
|
178
|
+
// Must implement USDC permit version 2 (otherwise breaks permit signatures).
|
|
176
179
|
usdc: "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4",
|
|
177
180
|
},
|
|
178
181
|
[chain_js_1.ChainId.InkMainnet]: {
|
|
@@ -185,12 +188,16 @@ exports.addresses = {
|
|
|
185
188
|
publicAllocator: "0x85416891752a6B81106c1C2999AE1AF5d8Cd3357",
|
|
186
189
|
metaMorphoFactory: "0xd3f39505d0c48AFED3549D625982FdC38Ea9904b",
|
|
187
190
|
wNative: "0x4200000000000000000000000000000000000006",
|
|
191
|
+
// Must implement USDC permit version 2 (otherwise breaks permit signatures).
|
|
188
192
|
usdc: "0xF1815bd50389c46847f0Bda824eC8da914045D14",
|
|
189
193
|
},
|
|
190
194
|
};
|
|
191
|
-
exports.
|
|
195
|
+
exports.addresses = exports.addressesRegistry;
|
|
192
196
|
const getChainAddresses = (chainId) => {
|
|
193
|
-
|
|
197
|
+
const chainAddresses = exports.addresses[chainId];
|
|
198
|
+
if (chainAddresses == null)
|
|
199
|
+
throw new errors_js_1.UnsupportedChainIdError(chainId);
|
|
200
|
+
return chainAddresses;
|
|
194
201
|
};
|
|
195
202
|
exports.getChainAddresses = getChainAddresses;
|
|
196
203
|
/**
|
|
@@ -199,22 +206,22 @@ exports.getChainAddresses = getChainAddresses;
|
|
|
199
206
|
*/
|
|
200
207
|
exports.unwrappedTokensMapping = {
|
|
201
208
|
[chain_js_1.ChainId.EthMainnet]: {
|
|
202
|
-
[exports.
|
|
203
|
-
[exports.
|
|
204
|
-
[exports.
|
|
205
|
-
[exports.
|
|
206
|
-
[exports.
|
|
207
|
-
[exports.
|
|
208
|
-
[exports.
|
|
209
|
-
[exports.
|
|
210
|
-
[exports.
|
|
211
|
-
[exports.
|
|
212
|
-
[exports.
|
|
209
|
+
[exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].wbIB01]: exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].bIB01,
|
|
210
|
+
[exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].wbC3M]: exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].bC3M,
|
|
211
|
+
[exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].wNative]: exports.NATIVE_ADDRESS,
|
|
212
|
+
[exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].stEth]: exports.NATIVE_ADDRESS,
|
|
213
|
+
[exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].wstEth]: exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].stEth,
|
|
214
|
+
[exports.addressesRegistry[chain_js_1.ChainId.EthMainnet]["stkcvxcrvUSDTWBTCWETH-morpho"]]: exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].crvUSDTWBTCWETH,
|
|
215
|
+
[exports.addressesRegistry[chain_js_1.ChainId.EthMainnet]["stkcvxcrvUSDCWBTCWETH-morpho"]]: exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].crvUSDCWBTCWETH,
|
|
216
|
+
[exports.addressesRegistry[chain_js_1.ChainId.EthMainnet]["stkcvxcrvCRVUSDTBTCWSTETH-morpho"]]: exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].crvCRVUSDTBTCWSTETH,
|
|
217
|
+
[exports.addressesRegistry[chain_js_1.ChainId.EthMainnet]["stkcvxTryLSD-morpho"]]: exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].tryLSD,
|
|
218
|
+
[exports.addressesRegistry[chain_js_1.ChainId.EthMainnet]["stkcvxcrvUSDETHCRV-morpho"]]: exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].crvUSDETHCRV,
|
|
219
|
+
[exports.addressesRegistry[chain_js_1.ChainId.EthMainnet]["stkcvx2BTC-f-morpho"]]: exports.addressesRegistry[chain_js_1.ChainId.EthMainnet]["2BTC-f"],
|
|
213
220
|
},
|
|
214
221
|
[chain_js_1.ChainId.BaseMainnet]: {
|
|
215
|
-
[exports.
|
|
216
|
-
[exports.
|
|
217
|
-
[exports.
|
|
222
|
+
[exports.addressesRegistry[chain_js_1.ChainId.BaseMainnet].wNative]: exports.NATIVE_ADDRESS,
|
|
223
|
+
[exports.addressesRegistry[chain_js_1.ChainId.BaseMainnet].verUsdc]: exports.addressesRegistry[chain_js_1.ChainId.BaseMainnet].usdc,
|
|
224
|
+
[exports.addressesRegistry[chain_js_1.ChainId.BaseMainnet].testUsdc]: exports.addressesRegistry[chain_js_1.ChainId.BaseMainnet].usdc,
|
|
218
225
|
},
|
|
219
226
|
[chain_js_1.ChainId.PolygonMainnet]: {},
|
|
220
227
|
[chain_js_1.ChainId.ArbitrumMainnet]: {},
|
|
@@ -230,31 +237,15 @@ function getUnwrappedToken(wrappedToken, chainId) {
|
|
|
230
237
|
/**
|
|
231
238
|
* The registry of all known ERC20Wrapper tokens.
|
|
232
239
|
*/
|
|
233
|
-
exports.erc20WrapperTokens = {
|
|
234
|
-
[chain_js_1.ChainId.EthMainnet]: new Set(),
|
|
235
|
-
[chain_js_1.ChainId.BaseMainnet]: new Set(),
|
|
236
|
-
[chain_js_1.ChainId.PolygonMainnet]: new Set(),
|
|
237
|
-
[chain_js_1.ChainId.ArbitrumMainnet]: new Set(),
|
|
238
|
-
[chain_js_1.ChainId.OptimismMainnet]: new Set(),
|
|
239
|
-
[chain_js_1.ChainId.WorldChainMainnet]: new Set(),
|
|
240
|
-
[chain_js_1.ChainId.FraxtalMainnet]: new Set(),
|
|
241
|
-
[chain_js_1.ChainId.ScrollMainnet]: new Set(),
|
|
242
|
-
[chain_js_1.ChainId.InkMainnet]: new Set(),
|
|
243
|
-
};
|
|
240
|
+
exports.erc20WrapperTokens = {};
|
|
244
241
|
/**
|
|
245
242
|
* The registry of all known PermissionedERC20Wrapper with a `hasPermission` getter.
|
|
246
243
|
* All permissioned wrapper tokens are considered ERC20Wrapper and automatically added to the erc20WrapperTokens registry.
|
|
247
244
|
*/
|
|
248
245
|
exports.permissionedWrapperTokens = {
|
|
249
|
-
[chain_js_1.ChainId.
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
[chain_js_1.ChainId.ArbitrumMainnet]: new Set(),
|
|
253
|
-
[chain_js_1.ChainId.OptimismMainnet]: new Set(),
|
|
254
|
-
[chain_js_1.ChainId.WorldChainMainnet]: new Set(),
|
|
255
|
-
[chain_js_1.ChainId.FraxtalMainnet]: new Set(),
|
|
256
|
-
[chain_js_1.ChainId.ScrollMainnet]: new Set(),
|
|
257
|
-
[chain_js_1.ChainId.InkMainnet]: new Set(),
|
|
246
|
+
[chain_js_1.ChainId.BaseMainnet]: new Set([
|
|
247
|
+
exports.addressesRegistry[chain_js_1.ChainId.BaseMainnet].testUsdc,
|
|
248
|
+
]),
|
|
258
249
|
};
|
|
259
250
|
/**
|
|
260
251
|
* The registry of all known permissioned wrapped Backed tokens.
|
|
@@ -262,60 +253,40 @@ exports.permissionedWrapperTokens = {
|
|
|
262
253
|
*/
|
|
263
254
|
exports.permissionedBackedTokens = {
|
|
264
255
|
[chain_js_1.ChainId.EthMainnet]: new Set([
|
|
265
|
-
exports.
|
|
266
|
-
exports.
|
|
256
|
+
exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].wbIB01,
|
|
257
|
+
exports.addressesRegistry[chain_js_1.ChainId.EthMainnet].wbC3M,
|
|
267
258
|
]),
|
|
268
|
-
[chain_js_1.ChainId.BaseMainnet]: new Set(),
|
|
269
|
-
[chain_js_1.ChainId.PolygonMainnet]: new Set(),
|
|
270
|
-
[chain_js_1.ChainId.ArbitrumMainnet]: new Set(),
|
|
271
|
-
[chain_js_1.ChainId.OptimismMainnet]: new Set(),
|
|
272
|
-
[chain_js_1.ChainId.WorldChainMainnet]: new Set(),
|
|
273
|
-
[chain_js_1.ChainId.FraxtalMainnet]: new Set(),
|
|
274
|
-
[chain_js_1.ChainId.ScrollMainnet]: new Set(),
|
|
275
|
-
[chain_js_1.ChainId.InkMainnet]: new Set(),
|
|
276
259
|
};
|
|
277
260
|
/**
|
|
278
261
|
* The registry of all known permissioned wrapped tokens that require a Coinbase attestation.
|
|
279
262
|
* All permissioned Coinbase tokens are considered PermissionedERC20Wrapper and automatically added to the permissionedWrapperTokens registry.
|
|
280
263
|
*/
|
|
281
264
|
exports.permissionedCoinbaseTokens = {
|
|
282
|
-
[chain_js_1.ChainId.
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
[chain_js_1.ChainId.ArbitrumMainnet]: new Set(),
|
|
286
|
-
[chain_js_1.ChainId.OptimismMainnet]: new Set(),
|
|
287
|
-
[chain_js_1.ChainId.WorldChainMainnet]: new Set(),
|
|
288
|
-
[chain_js_1.ChainId.FraxtalMainnet]: new Set(),
|
|
289
|
-
[chain_js_1.ChainId.ScrollMainnet]: new Set(),
|
|
290
|
-
[chain_js_1.ChainId.InkMainnet]: new Set(),
|
|
265
|
+
[chain_js_1.ChainId.BaseMainnet]: new Set([
|
|
266
|
+
exports.addressesRegistry[chain_js_1.ChainId.BaseMainnet].verUsdc,
|
|
267
|
+
]),
|
|
291
268
|
};
|
|
269
|
+
const getPermissionedCoinbaseTokens = (chainId) => exports.permissionedCoinbaseTokens[chainId] ?? new Set();
|
|
270
|
+
exports.getPermissionedCoinbaseTokens = getPermissionedCoinbaseTokens;
|
|
292
271
|
(0, morpho_ts_1.entries)(exports.permissionedBackedTokens).forEach(([chainId, tokens]) => {
|
|
293
|
-
tokens.forEach((token) => exports.erc20WrapperTokens[chainId].add(token));
|
|
272
|
+
tokens.forEach((token) => (exports.erc20WrapperTokens[chainId] ??= new Set()).add(token));
|
|
294
273
|
});
|
|
295
274
|
(0, morpho_ts_1.entries)(exports.permissionedCoinbaseTokens).forEach(([chainId, tokens]) => {
|
|
296
|
-
tokens.forEach((token) => exports.permissionedWrapperTokens[chainId].add(token));
|
|
275
|
+
tokens.forEach((token) => (exports.permissionedWrapperTokens[chainId] ??= new Set()).add(token));
|
|
297
276
|
});
|
|
298
277
|
(0, morpho_ts_1.entries)(exports.permissionedWrapperTokens).forEach(([chainId, tokens]) => {
|
|
299
|
-
tokens.forEach((token) => exports.erc20WrapperTokens[chainId].add(token));
|
|
278
|
+
tokens.forEach((token) => (exports.erc20WrapperTokens[chainId] ??= new Set()).add(token));
|
|
300
279
|
});
|
|
301
280
|
/** /!\ These tokens can not be listed in `erc20WrapperTokens` because the following specs are different:
|
|
302
281
|
* - calling `depositFor` supplies on blue instead of minting wrapped token to the user
|
|
303
282
|
*/
|
|
304
283
|
exports.convexWrapperTokens = {
|
|
305
284
|
[chain_js_1.ChainId.EthMainnet]: new Set([
|
|
306
|
-
exports.
|
|
307
|
-
exports.
|
|
308
|
-
exports.
|
|
309
|
-
exports.
|
|
310
|
-
exports.
|
|
311
|
-
exports.
|
|
285
|
+
exports.addressesRegistry[chain_js_1.ChainId.EthMainnet]["stkcvxcrvUSDTWBTCWETH-morpho"],
|
|
286
|
+
exports.addressesRegistry[chain_js_1.ChainId.EthMainnet]["stkcvxcrvUSDCWBTCWETH-morpho"],
|
|
287
|
+
exports.addressesRegistry[chain_js_1.ChainId.EthMainnet]["stkcvxcrvCRVUSDTBTCWSTETH-morpho"],
|
|
288
|
+
exports.addressesRegistry[chain_js_1.ChainId.EthMainnet]["stkcvxTryLSD-morpho"],
|
|
289
|
+
exports.addressesRegistry[chain_js_1.ChainId.EthMainnet]["stkcvxcrvUSDETHCRV-morpho"],
|
|
290
|
+
exports.addressesRegistry[chain_js_1.ChainId.EthMainnet]["stkcvx2BTC-f-morpho"],
|
|
312
291
|
]),
|
|
313
|
-
[chain_js_1.ChainId.BaseMainnet]: new Set(),
|
|
314
|
-
[chain_js_1.ChainId.PolygonMainnet]: new Set(),
|
|
315
|
-
[chain_js_1.ChainId.ArbitrumMainnet]: new Set(),
|
|
316
|
-
[chain_js_1.ChainId.OptimismMainnet]: new Set(),
|
|
317
|
-
[chain_js_1.ChainId.WorldChainMainnet]: new Set(),
|
|
318
|
-
[chain_js_1.ChainId.FraxtalMainnet]: new Set(),
|
|
319
|
-
[chain_js_1.ChainId.ScrollMainnet]: new Set(),
|
|
320
|
-
[chain_js_1.ChainId.InkMainnet]: new Set(),
|
|
321
292
|
};
|
package/lib/chain.d.ts
CHANGED
|
@@ -25,7 +25,5 @@ export declare namespace ChainUtils {
|
|
|
25
25
|
const getExplorerUrl: (chainId: ChainId) => string;
|
|
26
26
|
const getExplorerAddressUrl: (chainId: ChainId, address: string) => string;
|
|
27
27
|
const getExplorerTransactionUrl: (chainId: ChainId, tx: string) => string;
|
|
28
|
-
function isSupported(chainId: number): chainId is ChainId;
|
|
29
|
-
function parseSupportedChainId(candidate: unknown): ChainId;
|
|
30
28
|
const CHAIN_METADATA: Record<ChainId, ChainMetadata>;
|
|
31
29
|
}
|
package/lib/chain.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ChainUtils = exports.ChainId = void 0;
|
|
4
|
-
const errors_js_1 = require("./errors.js");
|
|
5
4
|
var ChainId;
|
|
6
5
|
(function (ChainId) {
|
|
7
6
|
ChainId[ChainId["EthMainnet"] = 1] = "EthMainnet";
|
|
@@ -28,17 +27,6 @@ var ChainUtils;
|
|
|
28
27
|
ChainUtils.getExplorerTransactionUrl = (chainId, tx) => {
|
|
29
28
|
return `${ChainUtils.getExplorerUrl(chainId)}/tx/${tx}`;
|
|
30
29
|
};
|
|
31
|
-
function isSupported(chainId) {
|
|
32
|
-
return Object.values(ChainId).includes(chainId);
|
|
33
|
-
}
|
|
34
|
-
ChainUtils.isSupported = isSupported;
|
|
35
|
-
function parseSupportedChainId(candidate) {
|
|
36
|
-
const chainId = Number.parseInt(candidate); // Force cast to string to silence TS because it works.
|
|
37
|
-
if (!isSupported(chainId))
|
|
38
|
-
throw new errors_js_1.UnsupportedChainIdError(chainId);
|
|
39
|
-
return chainId;
|
|
40
|
-
}
|
|
41
|
-
ChainUtils.parseSupportedChainId = parseSupportedChainId;
|
|
42
30
|
ChainUtils.CHAIN_METADATA = {
|
|
43
31
|
[ChainId.EthMainnet]: {
|
|
44
32
|
name: "Ethereum",
|