@morpho-org/blue-sdk 6.2.0 → 6.3.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.
@@ -1,600 +1,2 @@
1
- /** Supported EIP-155 chain ids with Morpho Blue deployments or registry metadata. */
2
- export declare enum ChainId {
3
- EthMainnet = 1,
4
- BaseMainnet = 8453,
5
- PolygonMainnet = 137,
6
- ArbitrumMainnet = 42161,
7
- OptimismMainnet = 10,
8
- WorldChainMainnet = 480,
9
- FraxtalMainnet = 252,
10
- ScrollMainnet = 534352,
11
- InkMainnet = 57073,
12
- Unichain = 130,
13
- SonicMainnet = 146,
14
- HemiMainnet = 43111,
15
- ModeMainnet = 34443,
16
- CornMainnet = 21000000,
17
- PlumeMainnet = 98866,
18
- CampMainnet = 123420001114,
19
- KatanaMainnet = 747474,
20
- EtherlinkMainnet = 42793,
21
- TacMainnet = 239,
22
- LiskMainnet = 1135,
23
- HyperliquidMainnet = 999,
24
- SeiMainnet = 1329,
25
- ZeroGMainnet = 16661,
26
- LineaMainnet = 59144,
27
- MonadMainnet = 143,
28
- StableMainnet = 988,
29
- CronosMainnet = 25,
30
- CeloMainnet = 42220,
31
- AbstractMainnet = 2741,
32
- BitlayerMainnet = 200901,
33
- BscMainnet = 56,
34
- SoneiumMainnet = 1868,
35
- TempoMainnet = 4217,
36
- EdenMainnet = 714,
37
- PharosMainnet = 1672,
38
- GensynMainnet = 685689,
39
- FlareMainnet = 14,
40
- XdcMainnet = 50,
41
- KaiaMainnet = 8217,
42
- ArcMainnet = 5042,
43
- MorphMainnet = 2818,
44
- MegaEthMainnet = 4326
45
- }
46
- /** Explorer, native currency, and identifier metadata for a supported chain. */
47
- export interface ChainMetadata {
48
- readonly name: string;
49
- readonly id: ChainId;
50
- readonly explorerUrl: string;
51
- readonly nativeCurrency: {
52
- readonly name: string;
53
- readonly symbol: string;
54
- readonly decimals: number;
55
- };
56
- readonly identifier: string;
57
- /** Whether eth_getBalance returns a reliable value. Defaults to true. */
58
- readonly hasReliableNativeBalance?: boolean;
59
- }
60
- /** Chain metadata helpers and registries. */
61
- export declare namespace ChainUtils {
62
- /**
63
- * Returns whether native token balances are reliable on a chain.
64
- *
65
- * @param chainId - The EIP-155 chain id to inspect.
66
- * @returns `false` only for chains whose metadata marks native balances as unreliable.
67
- * @example
68
- * ```ts
69
- * import { ChainId, ChainUtils } from "@morpho-org/blue-sdk";
70
- *
71
- * const reliable = ChainUtils.hasReliableNativeBalance(ChainId.EthMainnet);
72
- * // reliable === true
73
- * ```
74
- */
75
- const hasReliableNativeBalance: (chainId: number) => boolean;
76
- /**
77
- * Converts a supported chain id to its hexadecimal JSON-RPC form.
78
- *
79
- * @param chainId - The supported chain id.
80
- * @returns The chain id as a `0x`-prefixed hexadecimal string.
81
- * @example
82
- * ```ts
83
- * import { ChainId, ChainUtils } from "@morpho-org/blue-sdk";
84
- *
85
- * const hexChainId = ChainUtils.toHexChainId(ChainId.EthMainnet);
86
- * // hexChainId === "0x1"
87
- * ```
88
- */
89
- const toHexChainId: (chainId: ChainId) => string;
90
- /**
91
- * Returns the block explorer base URL for a supported chain.
92
- *
93
- * @param chainId - The supported chain id.
94
- * @returns The chain's configured block explorer base URL.
95
- * @example
96
- * ```ts
97
- * import { ChainId, ChainUtils } from "@morpho-org/blue-sdk";
98
- *
99
- * const explorerUrl = ChainUtils.getExplorerUrl(ChainId.EthMainnet);
100
- * // explorerUrl === "https://etherscan.io"
101
- * ```
102
- */
103
- const getExplorerUrl: (chainId: ChainId) => string;
104
- /**
105
- * Returns a block explorer address URL for a supported chain.
106
- *
107
- * @param chainId - The supported chain id.
108
- * @param address - The address to link to.
109
- * @returns The block explorer URL for `address`.
110
- * @example
111
- * ```ts
112
- * import { ChainId, ChainUtils, NATIVE_ADDRESS } from "@morpho-org/blue-sdk";
113
- *
114
- * const url = ChainUtils.getExplorerAddressUrl(ChainId.EthMainnet, NATIVE_ADDRESS);
115
- * // url satisfies string
116
- * ```
117
- */
118
- const getExplorerAddressUrl: (chainId: ChainId, address: string) => string;
119
- /**
120
- * Returns a block explorer transaction URL for a supported chain.
121
- *
122
- * @param chainId - The supported chain id.
123
- * @param tx - The transaction hash to link to.
124
- * @returns The block explorer URL for `tx`.
125
- * @example
126
- * ```ts
127
- * import { ChainId, ChainUtils } from "@morpho-org/blue-sdk";
128
- *
129
- * const url = ChainUtils.getExplorerTransactionUrl(ChainId.EthMainnet, "0xabc");
130
- * // url satisfies string
131
- * ```
132
- */
133
- const getExplorerTransactionUrl: (chainId: ChainId, tx: string) => string;
134
- /** Metadata for each supported chain, keyed by `ChainId`. */
135
- const CHAIN_METADATA: {
136
- 1: {
137
- name: string;
138
- id: ChainId.EthMainnet;
139
- nativeCurrency: {
140
- name: string;
141
- symbol: string;
142
- decimals: number;
143
- };
144
- explorerUrl: string;
145
- identifier: string;
146
- };
147
- 8453: {
148
- name: string;
149
- id: ChainId.BaseMainnet;
150
- nativeCurrency: {
151
- name: string;
152
- symbol: string;
153
- decimals: number;
154
- };
155
- explorerUrl: string;
156
- identifier: string;
157
- };
158
- 137: {
159
- name: string;
160
- id: ChainId.PolygonMainnet;
161
- nativeCurrency: {
162
- name: string;
163
- symbol: string;
164
- decimals: number;
165
- };
166
- explorerUrl: string;
167
- identifier: string;
168
- };
169
- 42161: {
170
- name: string;
171
- id: ChainId.ArbitrumMainnet;
172
- nativeCurrency: {
173
- name: string;
174
- symbol: string;
175
- decimals: number;
176
- };
177
- explorerUrl: string;
178
- identifier: string;
179
- };
180
- 10: {
181
- name: string;
182
- id: ChainId.OptimismMainnet;
183
- nativeCurrency: {
184
- name: string;
185
- symbol: string;
186
- decimals: number;
187
- };
188
- explorerUrl: string;
189
- identifier: string;
190
- };
191
- 480: {
192
- name: string;
193
- id: ChainId.WorldChainMainnet;
194
- nativeCurrency: {
195
- name: string;
196
- symbol: string;
197
- decimals: number;
198
- };
199
- explorerUrl: string;
200
- identifier: string;
201
- };
202
- 252: {
203
- name: string;
204
- id: ChainId.FraxtalMainnet;
205
- nativeCurrency: {
206
- name: string;
207
- symbol: string;
208
- decimals: number;
209
- };
210
- explorerUrl: string;
211
- identifier: string;
212
- };
213
- 534352: {
214
- name: string;
215
- id: ChainId.ScrollMainnet;
216
- nativeCurrency: {
217
- name: string;
218
- symbol: string;
219
- decimals: number;
220
- };
221
- explorerUrl: string;
222
- identifier: string;
223
- };
224
- 57073: {
225
- name: string;
226
- id: ChainId.InkMainnet;
227
- nativeCurrency: {
228
- name: string;
229
- symbol: string;
230
- decimals: number;
231
- };
232
- explorerUrl: string;
233
- identifier: string;
234
- };
235
- 130: {
236
- name: string;
237
- id: ChainId.Unichain;
238
- nativeCurrency: {
239
- name: string;
240
- symbol: string;
241
- decimals: number;
242
- };
243
- explorerUrl: string;
244
- identifier: string;
245
- };
246
- 146: {
247
- name: string;
248
- id: ChainId.SonicMainnet;
249
- nativeCurrency: {
250
- name: string;
251
- symbol: string;
252
- decimals: number;
253
- };
254
- explorerUrl: string;
255
- identifier: string;
256
- };
257
- 43111: {
258
- name: string;
259
- id: ChainId.HemiMainnet;
260
- nativeCurrency: {
261
- name: string;
262
- symbol: string;
263
- decimals: number;
264
- };
265
- explorerUrl: string;
266
- identifier: string;
267
- };
268
- 34443: {
269
- name: string;
270
- id: ChainId.ModeMainnet;
271
- nativeCurrency: {
272
- name: string;
273
- symbol: string;
274
- decimals: number;
275
- };
276
- explorerUrl: string;
277
- identifier: string;
278
- };
279
- 21000000: {
280
- name: string;
281
- id: ChainId.CornMainnet;
282
- nativeCurrency: {
283
- name: string;
284
- symbol: string;
285
- decimals: number;
286
- };
287
- explorerUrl: string;
288
- identifier: string;
289
- };
290
- 98866: {
291
- name: string;
292
- id: ChainId.PlumeMainnet;
293
- nativeCurrency: {
294
- name: string;
295
- symbol: string;
296
- decimals: number;
297
- };
298
- explorerUrl: string;
299
- identifier: string;
300
- };
301
- 123420001114: {
302
- name: string;
303
- id: ChainId.CampMainnet;
304
- nativeCurrency: {
305
- name: string;
306
- symbol: string;
307
- decimals: number;
308
- };
309
- explorerUrl: string;
310
- identifier: string;
311
- };
312
- 747474: {
313
- name: string;
314
- id: ChainId.KatanaMainnet;
315
- nativeCurrency: {
316
- name: string;
317
- symbol: string;
318
- decimals: number;
319
- };
320
- explorerUrl: string;
321
- identifier: string;
322
- };
323
- 42793: {
324
- name: string;
325
- id: ChainId.EtherlinkMainnet;
326
- nativeCurrency: {
327
- name: string;
328
- symbol: string;
329
- decimals: number;
330
- };
331
- explorerUrl: string;
332
- identifier: string;
333
- };
334
- 239: {
335
- name: string;
336
- id: ChainId.TacMainnet;
337
- nativeCurrency: {
338
- name: string;
339
- symbol: string;
340
- decimals: number;
341
- };
342
- explorerUrl: string;
343
- identifier: string;
344
- };
345
- 1135: {
346
- name: string;
347
- id: ChainId.LiskMainnet;
348
- nativeCurrency: {
349
- name: string;
350
- symbol: string;
351
- decimals: number;
352
- };
353
- explorerUrl: string;
354
- identifier: string;
355
- };
356
- 999: {
357
- name: string;
358
- id: ChainId.HyperliquidMainnet;
359
- nativeCurrency: {
360
- name: string;
361
- symbol: string;
362
- decimals: number;
363
- };
364
- explorerUrl: string;
365
- identifier: string;
366
- };
367
- 1329: {
368
- name: string;
369
- id: ChainId.SeiMainnet;
370
- nativeCurrency: {
371
- name: string;
372
- symbol: string;
373
- decimals: number;
374
- };
375
- explorerUrl: string;
376
- identifier: string;
377
- };
378
- 16661: {
379
- name: string;
380
- id: ChainId.ZeroGMainnet;
381
- nativeCurrency: {
382
- name: string;
383
- symbol: string;
384
- decimals: number;
385
- };
386
- explorerUrl: string;
387
- identifier: string;
388
- };
389
- 59144: {
390
- name: string;
391
- id: ChainId.LineaMainnet;
392
- nativeCurrency: {
393
- name: string;
394
- symbol: string;
395
- decimals: number;
396
- };
397
- explorerUrl: string;
398
- identifier: string;
399
- };
400
- 143: {
401
- name: string;
402
- id: ChainId.MonadMainnet;
403
- nativeCurrency: {
404
- name: string;
405
- symbol: string;
406
- decimals: number;
407
- };
408
- explorerUrl: string;
409
- identifier: string;
410
- };
411
- 988: {
412
- name: string;
413
- id: ChainId.StableMainnet;
414
- nativeCurrency: {
415
- name: string;
416
- symbol: string;
417
- decimals: number;
418
- };
419
- explorerUrl: string;
420
- identifier: string;
421
- };
422
- 25: {
423
- name: string;
424
- id: ChainId.CronosMainnet;
425
- nativeCurrency: {
426
- name: string;
427
- symbol: string;
428
- decimals: number;
429
- };
430
- explorerUrl: string;
431
- identifier: string;
432
- };
433
- 42220: {
434
- name: string;
435
- id: ChainId.CeloMainnet;
436
- nativeCurrency: {
437
- name: string;
438
- symbol: string;
439
- decimals: number;
440
- };
441
- explorerUrl: string;
442
- identifier: string;
443
- };
444
- 2741: {
445
- name: string;
446
- id: ChainId.AbstractMainnet;
447
- nativeCurrency: {
448
- name: string;
449
- symbol: string;
450
- decimals: number;
451
- };
452
- explorerUrl: string;
453
- identifier: string;
454
- };
455
- 200901: {
456
- name: string;
457
- id: ChainId.BitlayerMainnet;
458
- nativeCurrency: {
459
- name: string;
460
- symbol: string;
461
- decimals: number;
462
- };
463
- explorerUrl: string;
464
- identifier: string;
465
- };
466
- 56: {
467
- name: string;
468
- id: ChainId.BscMainnet;
469
- nativeCurrency: {
470
- name: string;
471
- symbol: string;
472
- decimals: number;
473
- };
474
- explorerUrl: string;
475
- identifier: string;
476
- };
477
- 1868: {
478
- name: string;
479
- id: ChainId.SoneiumMainnet;
480
- nativeCurrency: {
481
- name: string;
482
- symbol: string;
483
- decimals: number;
484
- };
485
- explorerUrl: string;
486
- identifier: string;
487
- };
488
- 4217: {
489
- name: string;
490
- id: ChainId.TempoMainnet;
491
- nativeCurrency: {
492
- name: string;
493
- symbol: string;
494
- decimals: number;
495
- };
496
- explorerUrl: string;
497
- identifier: string;
498
- hasReliableNativeBalance: false;
499
- };
500
- 714: {
501
- name: string;
502
- id: ChainId.EdenMainnet;
503
- nativeCurrency: {
504
- name: string;
505
- symbol: string;
506
- decimals: number;
507
- };
508
- explorerUrl: string;
509
- identifier: string;
510
- };
511
- 1672: {
512
- name: string;
513
- id: ChainId.PharosMainnet;
514
- nativeCurrency: {
515
- name: string;
516
- symbol: string;
517
- decimals: number;
518
- };
519
- explorerUrl: string;
520
- identifier: string;
521
- };
522
- 685689: {
523
- name: string;
524
- id: ChainId.GensynMainnet;
525
- nativeCurrency: {
526
- name: string;
527
- symbol: string;
528
- decimals: number;
529
- };
530
- explorerUrl: string;
531
- identifier: string;
532
- };
533
- 14: {
534
- name: string;
535
- id: ChainId.FlareMainnet;
536
- nativeCurrency: {
537
- name: string;
538
- symbol: string;
539
- decimals: number;
540
- };
541
- explorerUrl: string;
542
- identifier: string;
543
- };
544
- 50: {
545
- name: string;
546
- id: ChainId.XdcMainnet;
547
- nativeCurrency: {
548
- name: string;
549
- symbol: string;
550
- decimals: number;
551
- };
552
- explorerUrl: string;
553
- identifier: string;
554
- };
555
- 8217: {
556
- name: string;
557
- id: ChainId.KaiaMainnet;
558
- nativeCurrency: {
559
- name: string;
560
- symbol: string;
561
- decimals: number;
562
- };
563
- explorerUrl: string;
564
- identifier: string;
565
- };
566
- 5042: {
567
- name: string;
568
- id: ChainId.ArcMainnet;
569
- nativeCurrency: {
570
- name: string;
571
- symbol: string;
572
- decimals: number;
573
- };
574
- explorerUrl: string;
575
- identifier: string;
576
- };
577
- 2818: {
578
- name: string;
579
- id: ChainId.MorphMainnet;
580
- nativeCurrency: {
581
- name: string;
582
- symbol: string;
583
- decimals: number;
584
- };
585
- explorerUrl: string;
586
- identifier: string;
587
- };
588
- 4326: {
589
- name: string;
590
- id: ChainId.MegaEthMainnet;
591
- nativeCurrency: {
592
- name: string;
593
- symbol: string;
594
- decimals: number;
595
- };
596
- explorerUrl: string;
597
- identifier: string;
598
- };
599
- };
600
- }
1
+ export type { ChainMetadata } from "@morpho-org/morpho-ts";
2
+ export { ChainId, ChainUtils } from "@morpho-org/morpho-ts";