@metamask-previews/assets-controllers 104.3.0-preview-8daaa5a40 → 105.0.0-preview-d8ff44d
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/CHANGELOG.md +15 -1
- package/dist/selectors/token-selectors.d.cts +0 -36
- package/dist/selectors/token-selectors.d.cts.map +1 -1
- package/dist/selectors/token-selectors.d.mts +0 -36
- package/dist/selectors/token-selectors.d.mts.map +1 -1
- package/dist/token-prices-service/codefi-v2.cjs +3 -4
- package/dist/token-prices-service/codefi-v2.cjs.map +1 -1
- package/dist/token-prices-service/codefi-v2.d.cts +4 -3
- package/dist/token-prices-service/codefi-v2.d.cts.map +1 -1
- package/dist/token-prices-service/codefi-v2.d.mts +4 -3
- package/dist/token-prices-service/codefi-v2.d.mts.map +1 -1
- package/dist/token-prices-service/codefi-v2.mjs +3 -4
- package/dist/token-prices-service/codefi-v2.mjs.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
|
+
- Add ZetaChain network support (`7000`/`0x1b58`) ([#8627](https://github.com/MetaMask/core/pull/8627))
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Bump `@metamask/messenger` from `^1.1.1` to `^1.2.0` ([#8632](https://github.com/MetaMask/core/pull/8632))
|
|
17
|
+
- Bump `@metamask/keyring-controller` from `^25.2.0` to `^25.3.0` ([#8634](https://github.com/MetaMask/core/pull/8634))
|
|
18
|
+
- Bump `@metamask/network-controller` from `^30.0.1` to `^30.1.0` ([#8636](https://github.com/MetaMask/core/pull/8636))
|
|
19
|
+
- Modify `SPOT_PRICES_SUPPORT_INFO` entries for Tempo chains (`0x1079` and `0xa5bf`) ([#8638](https://github.com/MetaMask/core/pull/8638))
|
|
20
|
+
|
|
21
|
+
## [105.0.0]
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
12
25
|
- Expose missing public `CurrencyRateController` methods through its messenger ([#8561](https://github.com/MetaMask/core/pull/8561))
|
|
13
26
|
- The following actions are now available:
|
|
14
27
|
- `CurrencyRateController:setCurrentCurrency`
|
|
@@ -2971,7 +2984,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
2971
2984
|
|
|
2972
2985
|
- Use Ethers for AssetsContractController ([#845](https://github.com/MetaMask/core/pull/845))
|
|
2973
2986
|
|
|
2974
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@
|
|
2987
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@105.0.0...HEAD
|
|
2988
|
+
[105.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@104.3.0...@metamask/assets-controllers@105.0.0
|
|
2975
2989
|
[104.3.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@104.2.0...@metamask/assets-controllers@104.3.0
|
|
2976
2990
|
[104.2.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@104.1.0...@metamask/assets-controllers@104.2.0
|
|
2977
2991
|
[104.1.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@104.0.0...@metamask/assets-controllers@104.1.0
|
|
@@ -175,9 +175,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
175
175
|
type: string;
|
|
176
176
|
};
|
|
177
177
|
snap?: {
|
|
178
|
-
name: string;
|
|
179
178
|
id: string;
|
|
180
|
-
enabled: boolean;
|
|
181
179
|
} | undefined;
|
|
182
180
|
nameLastUpdatedAt?: number | undefined;
|
|
183
181
|
lastSelected?: number | undefined;
|
|
@@ -222,9 +220,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
222
220
|
type: string;
|
|
223
221
|
};
|
|
224
222
|
snap?: {
|
|
225
|
-
name: string;
|
|
226
223
|
id: string;
|
|
227
|
-
enabled: boolean;
|
|
228
224
|
} | undefined;
|
|
229
225
|
nameLastUpdatedAt?: number | undefined;
|
|
230
226
|
lastSelected?: number | undefined;
|
|
@@ -278,9 +274,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
278
274
|
type: string;
|
|
279
275
|
};
|
|
280
276
|
snap?: {
|
|
281
|
-
name: string;
|
|
282
277
|
id: string;
|
|
283
|
-
enabled: boolean;
|
|
284
278
|
} | undefined;
|
|
285
279
|
nameLastUpdatedAt?: number | undefined;
|
|
286
280
|
lastSelected?: number | undefined;
|
|
@@ -427,9 +421,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
427
421
|
type: string;
|
|
428
422
|
};
|
|
429
423
|
snap?: {
|
|
430
|
-
name: string;
|
|
431
424
|
id: string;
|
|
432
|
-
enabled: boolean;
|
|
433
425
|
} | undefined;
|
|
434
426
|
nameLastUpdatedAt?: number | undefined;
|
|
435
427
|
lastSelected?: number | undefined;
|
|
@@ -474,9 +466,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
474
466
|
type: string;
|
|
475
467
|
};
|
|
476
468
|
snap?: {
|
|
477
|
-
name: string;
|
|
478
469
|
id: string;
|
|
479
|
-
enabled: boolean;
|
|
480
470
|
} | undefined;
|
|
481
471
|
nameLastUpdatedAt?: number | undefined;
|
|
482
472
|
lastSelected?: number | undefined;
|
|
@@ -530,9 +520,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
530
520
|
type: string;
|
|
531
521
|
};
|
|
532
522
|
snap?: {
|
|
533
|
-
name: string;
|
|
534
523
|
id: string;
|
|
535
|
-
enabled: boolean;
|
|
536
524
|
} | undefined;
|
|
537
525
|
nameLastUpdatedAt?: number | undefined;
|
|
538
526
|
lastSelected?: number | undefined;
|
|
@@ -654,9 +642,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
654
642
|
type: string;
|
|
655
643
|
};
|
|
656
644
|
snap?: {
|
|
657
|
-
name: string;
|
|
658
645
|
id: string;
|
|
659
|
-
enabled: boolean;
|
|
660
646
|
} | undefined;
|
|
661
647
|
nameLastUpdatedAt?: number | undefined;
|
|
662
648
|
lastSelected?: number | undefined;
|
|
@@ -701,9 +687,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
701
687
|
type: string;
|
|
702
688
|
};
|
|
703
689
|
snap?: {
|
|
704
|
-
name: string;
|
|
705
690
|
id: string;
|
|
706
|
-
enabled: boolean;
|
|
707
691
|
} | undefined;
|
|
708
692
|
nameLastUpdatedAt?: number | undefined;
|
|
709
693
|
lastSelected?: number | undefined;
|
|
@@ -757,9 +741,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
757
741
|
type: string;
|
|
758
742
|
};
|
|
759
743
|
snap?: {
|
|
760
|
-
name: string;
|
|
761
744
|
id: string;
|
|
762
|
-
enabled: boolean;
|
|
763
745
|
} | undefined;
|
|
764
746
|
nameLastUpdatedAt?: number | undefined;
|
|
765
747
|
lastSelected?: number | undefined;
|
|
@@ -910,9 +892,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
910
892
|
type: string;
|
|
911
893
|
};
|
|
912
894
|
snap?: {
|
|
913
|
-
name: string;
|
|
914
895
|
id: string;
|
|
915
|
-
enabled: boolean;
|
|
916
896
|
} | undefined;
|
|
917
897
|
nameLastUpdatedAt?: number | undefined;
|
|
918
898
|
lastSelected?: number | undefined;
|
|
@@ -957,9 +937,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
957
937
|
type: string;
|
|
958
938
|
};
|
|
959
939
|
snap?: {
|
|
960
|
-
name: string;
|
|
961
940
|
id: string;
|
|
962
|
-
enabled: boolean;
|
|
963
941
|
} | undefined;
|
|
964
942
|
nameLastUpdatedAt?: number | undefined;
|
|
965
943
|
lastSelected?: number | undefined;
|
|
@@ -1013,9 +991,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
1013
991
|
type: string;
|
|
1014
992
|
};
|
|
1015
993
|
snap?: {
|
|
1016
|
-
name: string;
|
|
1017
994
|
id: string;
|
|
1018
|
-
enabled: boolean;
|
|
1019
995
|
} | undefined;
|
|
1020
996
|
nameLastUpdatedAt?: number | undefined;
|
|
1021
997
|
lastSelected?: number | undefined;
|
|
@@ -1162,9 +1138,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
1162
1138
|
type: string;
|
|
1163
1139
|
};
|
|
1164
1140
|
snap?: {
|
|
1165
|
-
name: string;
|
|
1166
1141
|
id: string;
|
|
1167
|
-
enabled: boolean;
|
|
1168
1142
|
} | undefined;
|
|
1169
1143
|
nameLastUpdatedAt?: number | undefined;
|
|
1170
1144
|
lastSelected?: number | undefined;
|
|
@@ -1209,9 +1183,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
1209
1183
|
type: string;
|
|
1210
1184
|
};
|
|
1211
1185
|
snap?: {
|
|
1212
|
-
name: string;
|
|
1213
1186
|
id: string;
|
|
1214
|
-
enabled: boolean;
|
|
1215
1187
|
} | undefined;
|
|
1216
1188
|
nameLastUpdatedAt?: number | undefined;
|
|
1217
1189
|
lastSelected?: number | undefined;
|
|
@@ -1265,9 +1237,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
1265
1237
|
type: string;
|
|
1266
1238
|
};
|
|
1267
1239
|
snap?: {
|
|
1268
|
-
name: string;
|
|
1269
1240
|
id: string;
|
|
1270
|
-
enabled: boolean;
|
|
1271
1241
|
} | undefined;
|
|
1272
1242
|
nameLastUpdatedAt?: number | undefined;
|
|
1273
1243
|
lastSelected?: number | undefined;
|
|
@@ -1389,9 +1359,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
1389
1359
|
type: string;
|
|
1390
1360
|
};
|
|
1391
1361
|
snap?: {
|
|
1392
|
-
name: string;
|
|
1393
1362
|
id: string;
|
|
1394
|
-
enabled: boolean;
|
|
1395
1363
|
} | undefined;
|
|
1396
1364
|
nameLastUpdatedAt?: number | undefined;
|
|
1397
1365
|
lastSelected?: number | undefined;
|
|
@@ -1436,9 +1404,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
1436
1404
|
type: string;
|
|
1437
1405
|
};
|
|
1438
1406
|
snap?: {
|
|
1439
|
-
name: string;
|
|
1440
1407
|
id: string;
|
|
1441
|
-
enabled: boolean;
|
|
1442
1408
|
} | undefined;
|
|
1443
1409
|
nameLastUpdatedAt?: number | undefined;
|
|
1444
1410
|
lastSelected?: number | undefined;
|
|
@@ -1492,9 +1458,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
1492
1458
|
type: string;
|
|
1493
1459
|
};
|
|
1494
1460
|
snap?: {
|
|
1495
|
-
name: string;
|
|
1496
1461
|
id: string;
|
|
1497
|
-
enabled: boolean;
|
|
1498
1462
|
} | undefined;
|
|
1499
1463
|
nameLastUpdatedAt?: number | undefined;
|
|
1500
1464
|
lastSelected?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-selectors.d.cts","sourceRoot":"","sources":["../../src/selectors/token-selectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAC5D,OAAO,KAAK,EAAE,0BAA0B,EAAE,0CAA0C;AACpF,OAAO,KAAK,EAAE,uBAAuB,EAAE,sCAAsC;AAG7E,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,qCAAqC;AAEjE,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAC3C,OAAO,EAAkB,cAAc,EAAE,iBAAiB;AAC1D,OAAO,EAAE,YAAY,EAAE,0BAA0B;AAGjD,OAAO,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B,eAAe,CAAC,MAAM,CAAC;+BAClB,MAAM;;;;;;;oCAFD,cAAc;0BACxB,eAAe,CAAC,MAAM,CAAC;+BAClB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAhBR,GAAG,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;mKAiZf,2BAA2B;;;;;;;;CAoBtC,CAAC"}
|
|
@@ -175,9 +175,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
175
175
|
type: string;
|
|
176
176
|
};
|
|
177
177
|
snap?: {
|
|
178
|
-
name: string;
|
|
179
178
|
id: string;
|
|
180
|
-
enabled: boolean;
|
|
181
179
|
} | undefined;
|
|
182
180
|
nameLastUpdatedAt?: number | undefined;
|
|
183
181
|
lastSelected?: number | undefined;
|
|
@@ -222,9 +220,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
222
220
|
type: string;
|
|
223
221
|
};
|
|
224
222
|
snap?: {
|
|
225
|
-
name: string;
|
|
226
223
|
id: string;
|
|
227
|
-
enabled: boolean;
|
|
228
224
|
} | undefined;
|
|
229
225
|
nameLastUpdatedAt?: number | undefined;
|
|
230
226
|
lastSelected?: number | undefined;
|
|
@@ -278,9 +274,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
278
274
|
type: string;
|
|
279
275
|
};
|
|
280
276
|
snap?: {
|
|
281
|
-
name: string;
|
|
282
277
|
id: string;
|
|
283
|
-
enabled: boolean;
|
|
284
278
|
} | undefined;
|
|
285
279
|
nameLastUpdatedAt?: number | undefined;
|
|
286
280
|
lastSelected?: number | undefined;
|
|
@@ -427,9 +421,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
427
421
|
type: string;
|
|
428
422
|
};
|
|
429
423
|
snap?: {
|
|
430
|
-
name: string;
|
|
431
424
|
id: string;
|
|
432
|
-
enabled: boolean;
|
|
433
425
|
} | undefined;
|
|
434
426
|
nameLastUpdatedAt?: number | undefined;
|
|
435
427
|
lastSelected?: number | undefined;
|
|
@@ -474,9 +466,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
474
466
|
type: string;
|
|
475
467
|
};
|
|
476
468
|
snap?: {
|
|
477
|
-
name: string;
|
|
478
469
|
id: string;
|
|
479
|
-
enabled: boolean;
|
|
480
470
|
} | undefined;
|
|
481
471
|
nameLastUpdatedAt?: number | undefined;
|
|
482
472
|
lastSelected?: number | undefined;
|
|
@@ -530,9 +520,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
530
520
|
type: string;
|
|
531
521
|
};
|
|
532
522
|
snap?: {
|
|
533
|
-
name: string;
|
|
534
523
|
id: string;
|
|
535
|
-
enabled: boolean;
|
|
536
524
|
} | undefined;
|
|
537
525
|
nameLastUpdatedAt?: number | undefined;
|
|
538
526
|
lastSelected?: number | undefined;
|
|
@@ -654,9 +642,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
654
642
|
type: string;
|
|
655
643
|
};
|
|
656
644
|
snap?: {
|
|
657
|
-
name: string;
|
|
658
645
|
id: string;
|
|
659
|
-
enabled: boolean;
|
|
660
646
|
} | undefined;
|
|
661
647
|
nameLastUpdatedAt?: number | undefined;
|
|
662
648
|
lastSelected?: number | undefined;
|
|
@@ -701,9 +687,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
701
687
|
type: string;
|
|
702
688
|
};
|
|
703
689
|
snap?: {
|
|
704
|
-
name: string;
|
|
705
690
|
id: string;
|
|
706
|
-
enabled: boolean;
|
|
707
691
|
} | undefined;
|
|
708
692
|
nameLastUpdatedAt?: number | undefined;
|
|
709
693
|
lastSelected?: number | undefined;
|
|
@@ -757,9 +741,7 @@ export declare const selectAllAssets: ((state: AssetListState) => AssetsByAccoun
|
|
|
757
741
|
type: string;
|
|
758
742
|
};
|
|
759
743
|
snap?: {
|
|
760
|
-
name: string;
|
|
761
744
|
id: string;
|
|
762
|
-
enabled: boolean;
|
|
763
745
|
} | undefined;
|
|
764
746
|
nameLastUpdatedAt?: number | undefined;
|
|
765
747
|
lastSelected?: number | undefined;
|
|
@@ -910,9 +892,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
910
892
|
type: string;
|
|
911
893
|
};
|
|
912
894
|
snap?: {
|
|
913
|
-
name: string;
|
|
914
895
|
id: string;
|
|
915
|
-
enabled: boolean;
|
|
916
896
|
} | undefined;
|
|
917
897
|
nameLastUpdatedAt?: number | undefined;
|
|
918
898
|
lastSelected?: number | undefined;
|
|
@@ -957,9 +937,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
957
937
|
type: string;
|
|
958
938
|
};
|
|
959
939
|
snap?: {
|
|
960
|
-
name: string;
|
|
961
940
|
id: string;
|
|
962
|
-
enabled: boolean;
|
|
963
941
|
} | undefined;
|
|
964
942
|
nameLastUpdatedAt?: number | undefined;
|
|
965
943
|
lastSelected?: number | undefined;
|
|
@@ -1013,9 +991,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
1013
991
|
type: string;
|
|
1014
992
|
};
|
|
1015
993
|
snap?: {
|
|
1016
|
-
name: string;
|
|
1017
994
|
id: string;
|
|
1018
|
-
enabled: boolean;
|
|
1019
995
|
} | undefined;
|
|
1020
996
|
nameLastUpdatedAt?: number | undefined;
|
|
1021
997
|
lastSelected?: number | undefined;
|
|
@@ -1162,9 +1138,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
1162
1138
|
type: string;
|
|
1163
1139
|
};
|
|
1164
1140
|
snap?: {
|
|
1165
|
-
name: string;
|
|
1166
1141
|
id: string;
|
|
1167
|
-
enabled: boolean;
|
|
1168
1142
|
} | undefined;
|
|
1169
1143
|
nameLastUpdatedAt?: number | undefined;
|
|
1170
1144
|
lastSelected?: number | undefined;
|
|
@@ -1209,9 +1183,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
1209
1183
|
type: string;
|
|
1210
1184
|
};
|
|
1211
1185
|
snap?: {
|
|
1212
|
-
name: string;
|
|
1213
1186
|
id: string;
|
|
1214
|
-
enabled: boolean;
|
|
1215
1187
|
} | undefined;
|
|
1216
1188
|
nameLastUpdatedAt?: number | undefined;
|
|
1217
1189
|
lastSelected?: number | undefined;
|
|
@@ -1265,9 +1237,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
1265
1237
|
type: string;
|
|
1266
1238
|
};
|
|
1267
1239
|
snap?: {
|
|
1268
|
-
name: string;
|
|
1269
1240
|
id: string;
|
|
1270
|
-
enabled: boolean;
|
|
1271
1241
|
} | undefined;
|
|
1272
1242
|
nameLastUpdatedAt?: number | undefined;
|
|
1273
1243
|
lastSelected?: number | undefined;
|
|
@@ -1389,9 +1359,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
1389
1359
|
type: string;
|
|
1390
1360
|
};
|
|
1391
1361
|
snap?: {
|
|
1392
|
-
name: string;
|
|
1393
1362
|
id: string;
|
|
1394
|
-
enabled: boolean;
|
|
1395
1363
|
} | undefined;
|
|
1396
1364
|
nameLastUpdatedAt?: number | undefined;
|
|
1397
1365
|
lastSelected?: number | undefined;
|
|
@@ -1436,9 +1404,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
1436
1404
|
type: string;
|
|
1437
1405
|
};
|
|
1438
1406
|
snap?: {
|
|
1439
|
-
name: string;
|
|
1440
1407
|
id: string;
|
|
1441
|
-
enabled: boolean;
|
|
1442
1408
|
} | undefined;
|
|
1443
1409
|
nameLastUpdatedAt?: number | undefined;
|
|
1444
1410
|
lastSelected?: number | undefined;
|
|
@@ -1492,9 +1458,7 @@ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState
|
|
|
1492
1458
|
type: string;
|
|
1493
1459
|
};
|
|
1494
1460
|
snap?: {
|
|
1495
|
-
name: string;
|
|
1496
1461
|
id: string;
|
|
1497
|
-
enabled: boolean;
|
|
1498
1462
|
} | undefined;
|
|
1499
1463
|
nameLastUpdatedAt?: number | undefined;
|
|
1500
1464
|
lastSelected?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-selectors.d.mts","sourceRoot":"","sources":["../../src/selectors/token-selectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAC5D,OAAO,KAAK,EAAE,0BAA0B,EAAE,0CAA0C;AACpF,OAAO,KAAK,EAAE,uBAAuB,EAAE,sCAAsC;AAG7E,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,qCAAqC;AAEjE,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAC3C,OAAO,EAAkB,cAAc,EAAE,iBAAiB;AAC1D,OAAO,EAAE,YAAY,EAAE,0BAA0B;AAGjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,sCAAkC;AACnE,OAAO,KAAK,EAAE,+BAA+B,EAAE,gDAAsC;AACrF,OAAO,KAAK,EAAE,oCAAoC,EAAE,qDAA2C;AAC/F,OAAO,KAAK,EAAE,iCAAiC,EAAE,kDAAwC;AAEzF,OAAO,KAAK,EAAE,4BAA4B,EAAE,uCAAmC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,yBAAyB,EAAE,oCAAgC;AAChF,OAAO,KAAK,EAAE,qBAAqB,EAAE,gCAA4B;AAOjE,eAAO,MAAM,aAAa;;;;;;;;;;CAUhB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAC5B,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAErD,eAAO,MAAM,qBAAqB,+BAEA,CAAC;AAEnC,eAAO,MAAM,yBAAyB,EAAE,WAAW,CAAC,kBAAkB,CAC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;oCAFD,cAAc;0BACxB,eAAe,CAAC,MAAM,CAAC;+BAClB,MAAM;;;;;;;oCAFD,cAAc;0BACxB,eAAe,CAAC,MAAM,CAAC;+BAClB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAFD,cAAc;sBACxB,eAAe,CAAC,MAAM,CAAC;2BAClB,MAAM;;yBAhBR,GAAG,GAAG,IAAI;;;;;;;gCAcH,cAAc;sBACxB,eAAe,CAAC,MAAM,CAAC;2BAClB,MAAM;;yBAhBR,GAAG,GAAG,IAAI;;;;;;;;;;;;gCAcH,cAAc;sBACxB,eAAe,CAAC,MAAM,CAAC;2BAClB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAFD,cAAc;0BACxB,eAAe,CAAC,MAAM,CAAC;+BAClB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAFD,cAAc;0BACxB,eAAe,CAAC,MAAM,CAAC;+BAClB,MAAM;;;;;;;oCAFD,cAAc;0BACxB,eAAe,CAAC,MAAM,CAAC;+BAClB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAhBR,GAAG,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;mKAiZf,2BAA2B;;;;;;;;CAoBtC,CAAC"}
|
|
@@ -219,8 +219,6 @@ const chainIdToNativeTokenAddress = {
|
|
|
219
219
|
'0x64': '0xe91d153e0b41518a2ce8dd3d7944fa863463a97d', // Gnosis
|
|
220
220
|
'0x1e': '0x542fda317318ebf1d3deaf76e0b632741a7e677d', // Rootstock Mainnet - Native symbol: RBTC
|
|
221
221
|
'0x3dc': '0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0
|
|
222
|
-
'0x1079': '0x20c0000000000000000000000000000000000000', // Tempo Mainnet - Pseudo-Native symbol: pathUSD
|
|
223
|
-
'0xa5bf': '0x20c0000000000000000000000000000000000000', // Tempo Moderato Testnet - Pseudo-Native symbol: pathUSD
|
|
224
222
|
};
|
|
225
223
|
/**
|
|
226
224
|
* Returns the address that should be used to query the price api for the
|
|
@@ -273,7 +271,7 @@ exports.SPOT_PRICES_SUPPORT_INFO = {
|
|
|
273
271
|
'0x74c': 'eip155:1868/erc20:0x0000000000000000000000000000000000000000', // Soneium - Native symbol: ETH
|
|
274
272
|
'0xa729': 'eip155:42793/erc20:0x0000000000000000000000000000000000000000', // Etherlink - Native symbol: XTZ (Tezos L2)
|
|
275
273
|
'0xab5': 'eip155:2741/erc20:0x0000000000000000000000000000000000000000', // Abstract - Native symbol: ETH
|
|
276
|
-
'0x1079': 'eip155:4217/
|
|
274
|
+
'0x1079': 'eip155:4217/slip44:60', // Tempo Mainnet - No native asset
|
|
277
275
|
'0x10e6': 'eip155:4326/erc20:0x0000000000000000000000000000000000000000', // MegaETH Mainnet - Native symbol: ETH
|
|
278
276
|
'0x1388': 'eip155:5000/erc20:0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Mantle - Native symbol: MNT
|
|
279
277
|
'0x2105': 'eip155:8453/slip44:60', // Base - Native symbol: ETH
|
|
@@ -286,7 +284,7 @@ exports.SPOT_PRICES_SUPPORT_INFO = {
|
|
|
286
284
|
'0xa516': 'eip155:42262/slip44:474', // Oasis Emerald - Native symbol: ROSE
|
|
287
285
|
'0xa867': 'eip155:43111/erc20:0x0000000000000000000000000000000000000000', // Hemi - Native symbol: ETH
|
|
288
286
|
'0xa86a': 'eip155:43114/slip44:9005', // Avalanche C-Chain - Native symbol: AVAX
|
|
289
|
-
'0xa5bf': 'eip155:42431/
|
|
287
|
+
'0xa5bf': 'eip155:42431/slip44:60', // Tempo Testnet Moderato - No native asset
|
|
290
288
|
'0xe708': 'eip155:59144/slip44:60', // Linea Mainnet - Native symbol: ETH
|
|
291
289
|
'0xed88': 'eip155:60808/erc20:0x0000000000000000000000000000000000000000', // BOB - Native symbol: ETH
|
|
292
290
|
'0x138de': 'eip155:80094/erc20:0x0000000000000000000000000000000000000000', // Berachain - Native symbol: Bera',
|
|
@@ -304,6 +302,7 @@ exports.SPOT_PRICES_SUPPORT_INFO = {
|
|
|
304
302
|
'0xdef1': 'eip155:57073/slip44:60', // Ink Mainnet - Native symbol: ETH
|
|
305
303
|
'0x3dc': 'eip155:988/erc20:0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0
|
|
306
304
|
'0xf043a': 'eip155:984122/slip44:984122', // Forma - Native symbol: TIA (Celestia)
|
|
305
|
+
'0x1b58': 'eip155:7000/slip44:7000', // ZetaChain - Native symbol: ZETA
|
|
307
306
|
};
|
|
308
307
|
/**
|
|
309
308
|
* The list of chain IDs that can be supplied in the URL for the `/spot-prices`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codefi-v2.cjs","sourceRoot":"","sources":["../../src/token-prices-service/codefi-v2.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iEAOoC;AAGpC,2CAKyB;AAYzB;;;;GAIG;AACU,QAAA,6BAA6B,GAAG;IAC3C,UAAU;IACV,KAAK;IACL,QAAQ;IACR,KAAK;IACL,WAAW;IACX,KAAK;IACL,eAAe;IACf,KAAK;IACL,eAAe;IACf,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,KAAK;IACL,SAAS;IACT,KAAK;IACL,YAAY;IACZ,MAAM;IACN,WAAW;IACX,KAAK;IACL,gBAAgB;IAChB,KAAK;IACL,YAAY;IACZ,KAAK;IACL,8BAA8B;IAC9B,KAAK;IACL,iBAAiB;IACjB,KAAK;IACL,oBAAoB;IACpB,KAAK;IACL,mBAAmB;IACnB,KAAK;IACL,iBAAiB;IACjB,KAAK;IACL,mBAAmB;IACnB,KAAK;IACL,cAAc;IACd,KAAK;IACL,kBAAkB;IAClB,KAAK;IACL,cAAc;IACd,KAAK;I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C;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,yBAAyB;QAC7B,OAAO,wBAAwB,EAAE,CAAC;IACpC,CAAC;CACF;AA3YD,gEA2YC","sourcesContent":["import {\n createServicePolicy,\n DEFAULT_CIRCUIT_BREAK_DURATION,\n DEFAULT_DEGRADED_THRESHOLD,\n DEFAULT_MAX_CONSECUTIVE_FAILURES,\n DEFAULT_MAX_RETRIES,\n handleFetch,\n} from '@metamask/controller-utils';\nimport type { ServicePolicy } from '@metamask/controller-utils';\nimport type { CaipAssetType, Hex } from '@metamask/utils';\nimport {\n hexToNumber,\n KnownCaipNamespace,\n numberToHex,\n toCaipChainId,\n} from '@metamask/utils';\n\nimport type { MarketDataDetails } from '../TokenRatesController';\nimport type {\n AbstractTokenPricesService,\n EvmAssetAddressWithChain,\n EvmAssetWithId,\n EvmAssetWithMarketData,\n ExchangeRatesByCurrency,\n NativeAssetIdentifiersMap,\n} from './abstract-token-prices-service';\n\n/**\n * The list of currencies that can be supplied as the `vsCurrency` parameter to\n * the `/spot-prices` endpoint, in lowercase form.\n * This is the fallback list used when the API is unavailable.\n */\nexport const SUPPORTED_CURRENCIES_FALLBACK = [\n // Bitcoin\n 'btc',\n // Ether\n 'eth',\n // Litecoin\n 'ltc',\n // Bitcoin Cash\n 'bch',\n // Binance Coin\n 'bnb',\n // EOS\n 'eos',\n // XRP\n 'xrp',\n // Lumens\n 'xlm',\n // Chainlink\n 'link',\n // Polkadot\n 'dot',\n // Yearn.finance\n 'yfi',\n // US Dollar\n 'usd',\n // United Arab Emirates Dirham\n 'aed',\n // Argentine Peso\n 'ars',\n // Australian Dollar\n 'aud',\n // Bangladeshi Taka\n 'bdt',\n // Bahraini Dinar\n 'bhd',\n // Bermudian Dollar\n 'bmd',\n // Brazil Real\n 'brl',\n // Canadian Dollar\n 'cad',\n // Swiss Franc\n 'chf',\n // Chilean Peso\n 'clp',\n // Chinese Yuan\n 'cny',\n // Czech Koruna\n 'czk',\n // Danish Krone\n 'dkk',\n // Euro\n 'eur',\n // British Pound Sterling\n 'gbp',\n // Georgian Lari\n 'gel',\n // Hong Kong Dollar\n 'hkd',\n // Hungarian Forint\n 'huf',\n // Indonesian Rupiah\n 'idr',\n // Israeli New Shekel\n 'ils',\n // Indian Rupee\n 'inr',\n // Japanese Yen\n 'jpy',\n // South Korean Won\n 'krw',\n // Kuwaiti Dinar\n 'kwd',\n // Sri Lankan Rupee\n 'lkr',\n // Burmese Kyat\n 'mmk',\n // Mexican Peso\n 'mxn',\n // Malaysian Ringgit\n 'myr',\n // Monad\n 'mon',\n // Nigerian Naira\n 'ngn',\n // Norwegian Krone\n 'nok',\n // New Zealand Dollar\n 'nzd',\n // Philippine Peso\n 'php',\n // Pakistani Rupee\n 'pkr',\n // Polish Zloty\n 'pln',\n // Russian Ruble\n 'rub',\n // Saudi Riyal\n 'sar',\n // Swedish Krona\n 'sek',\n // Singapore Dollar\n 'sgd',\n // Thai Baht\n 'thb',\n // Turkish Lira\n 'try',\n // New Taiwan Dollar\n 'twd',\n // Ukrainian hryvnia\n 'uah',\n // Venezuelan bolívar fuerte\n 'vef',\n // Vietnamese đồng\n 'vnd',\n // South African Rand\n 'zar',\n // IMF Special Drawing Rights\n 'xdr',\n // Silver - Troy Ounce\n 'xag',\n // Gold - Troy Ounce\n 'xau',\n // Bits\n 'bits',\n // Satoshi\n 'sats',\n // Colombian Peso\n 'cop',\n // Kenyan Shilling\n 'kes',\n // Romanian Leu\n 'ron',\n // Dominican Peso\n 'dop',\n // Costa Rican Colón\n 'crc',\n // Honduran Lempira\n 'hnl',\n // Zambian Kwacha\n 'zmw',\n // Salvadoran Colón\n 'svc',\n // Bosnia-Herzegovina Convertible Mark\n 'bam',\n // Peruvian Sol\n 'pen',\n // Guatemalan Quetzal\n 'gtq',\n // Lebanese Pound\n 'lbp',\n // Armenian Dram\n 'amd',\n // Solana\n 'sol',\n // Sei\n 'sei',\n // Sonic\n 'sonic',\n // Tron\n 'trx',\n // Taiko\n 'taiko',\n // Pepu\n 'pepu',\n // Polygon\n 'pol',\n // Mantle\n 'mnt',\n // Onomy\n 'nom',\n // Avalanche\n 'avax',\n // Apechain\n 'ape',\n] as const;\n\n/**\n * @deprecated Use `getSupportedCurrencies()` or `fetchSupportedCurrencies()` instead.\n * This is an alias for backward compatibility.\n */\nexport const SUPPORTED_CURRENCIES = SUPPORTED_CURRENCIES_FALLBACK;\n\n/**\n * Represents the zero address, commonly used as a placeholder in blockchain transactions.\n * In the context of fetching market data, the zero address is utilized to retrieve information\n * specifically for native currencies. This allows for a standardized approach to query market\n * data for blockchain-native assets without a specific contract address.\n */\nexport const ZERO_ADDRESS: Hex =\n '0x0000000000000000000000000000000000000000' as const;\n\n/**\n * A mapping from chain id to the address of the chain's native token.\n * Only for chains whose native tokens have a specific address.\n */\nconst chainIdToNativeTokenAddress: Record<Hex, Hex> = {\n '0x89': '0x0000000000000000000000000000000000001010', // Polygon\n '0x440': '0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Metis Andromeda\n '0x1388': '0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Mantle\n '0x64': '0xe91d153e0b41518a2ce8dd3d7944fa863463a97d', // Gnosis\n '0x1e': '0x542fda317318ebf1d3deaf76e0b632741a7e677d', // Rootstock Mainnet - Native symbol: RBTC\n '0x3dc': '0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0\n '0x1079': '0x20c0000000000000000000000000000000000000', // Tempo Mainnet - Pseudo-Native symbol: pathUSD\n '0xa5bf': '0x20c0000000000000000000000000000000000000', // Tempo Moderato Testnet - Pseudo-Native symbol: pathUSD\n};\n\n/**\n * Returns the address that should be used to query the price api for the\n * chain's native token. On most chains, this is signified by the zero address.\n * But on some chains, the native token has a specific address.\n *\n * @param chainId - The hexadecimal chain id.\n * @returns The address of the chain's native token.\n */\nexport const getNativeTokenAddress = (chainId: Hex): Hex =>\n chainIdToNativeTokenAddress[chainId] ?? ZERO_ADDRESS;\n\n// Source: https://github.com/consensys-vertical-apps/va-mmcx-price-api/blob/main/src/constants/slip44.ts\n// We can only support PricesAPI V3 for EVM chains that have a CAIP-19 native asset mapping.\nexport const SPOT_PRICES_SUPPORT_INFO = {\n '0x1': 'eip155:1/slip44:60', // Ethereum Mainnet - Native symbol: ETH\n '0xa': 'eip155:10/slip44:60', // OP Mainnet - Native symbol: ETH\n '0x19': 'eip155:25/slip44:394', // Cronos Mainnet - Native symbol: CRO\n '0x1e': 'eip155:30/slip44:137', // Rootstock Mainnet - Native symbol: RBTC\n '0x2a': 'eip155:42/erc20:0x0000000000000000000000000000000000000000', // Lukso - native symbol: LYX\n '0x32': 'eip155:50/erc20:0x0000000000000000000000000000000000000000', // xdc-network - native symbol: XDC\n '0x38': 'eip155:56/slip44:714', // BNB Smart Chain Mainnet - Native symbol: BNB\n '0x39': 'eip155:57/slip44:57', // Syscoin Mainnet - Native symbol: SYS\n '0x52': 'eip155:82/slip44:18000', // Meter Mainnet - Native symbol: MTR\n '0x58': 'eip155:88/slip44:889', // TomoChain - Native symbol: TOMO\n '0x64': 'eip155:100/slip44:700', // Gnosis (formerly xDAI Chain) - Native symbol: xDAI\n '0x6a': 'eip155:106/slip44:5655640', // Velas EVM Mainnet - Native symbol: VLX\n '0x7a': 'eip155:122/erc20:0x0000000000000000000000000000000000000000', // Fuse Mainnet - Native symbol: FUSE\n '0x80': 'eip155:128/slip44:1010', // Huobi ECO Chain Mainnet - Native symbol: HT\n '0x89': 'eip155:137/slip44:966', // Polygon Mainnet - Native symbol: POL\n '0x8f': 'eip155:143/slip44:268435779', // Monad Mainnet - Native symbol: MON\n '0x92': 'eip155:146/slip44:10007', // Sonic Mainnet - Native symbol: S\n '0xc4': 'eip155:196/erc20:0x0000000000000000000000000000000000000000', // X Layer Mainnet - Native symbol: OKB\n '0xe8': 'eip155:232/erc20:0x0000000000000000000000000000000000000000', // Lens Mainnet - Native symbol: GHO\n '0xfa': 'eip155:250/slip44:1007', // Fantom Opera - Native symbol: FTM\n '0xfc': 'eip155:252/erc20:0x0000000000000000000000000000000000000000', // Fraxtal - native symbol: FRAX\n '0x10b3e': 'eip155:68414/erc20:0x0000000000000000000000000000000000000000', // MapleStory Universe - no slip44\n '0x120': 'eip155:288/slip44:60', // Boba Network (Ethereum L2) - Native symbol: ETH\n '0x141': 'eip155:321/slip44:641', // KCC Mainnet - Native symbol: KCS\n '0x144': 'eip155:324/slip44:60', // zkSync Era Mainnet (Ethereum L2) - Native symbol: ETH\n '0x150': 'eip155:336/slip44:809', // Shiden - Native symbol: SDN\n '0x169': 'eip155:361/slip44:589', // Theta Mainnet - Native symbol: TFUEL\n '0x2eb': 'eip155:747/slip44:539', // Flow evm - Native symbol: Flow\n '0x3e7': 'eip155:999/slip44:2457', // HyperEVM - Native symbol: HYPE\n '0x440': 'eip155:1088/erc20:0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Metis Andromeda Mainnet (Ethereum L2) - Native symbol: METIS\n '0x44d': 'eip155:1101/slip44:60', // Polygon zkEVM mainnet - Native symbol: ETH\n '0x504': 'eip155:1284/slip44:1284', // Moonbeam - Native symbol: GLMR\n '0x505': 'eip155:1285/slip44:1285', // Moonriver - Native symbol: MOVR\n '0x531': 'eip155:1329/slip44:19000118', // Sei Mainnet - Native symbol: SEI\n '0x6f0': 'eip155:1776/slip44:22000119', // Injective Mainnet - Native symbol: INJ\n '0x74c': 'eip155:1868/erc20:0x0000000000000000000000000000000000000000', // Soneium - Native symbol: ETH\n '0xa729': 'eip155:42793/erc20:0x0000000000000000000000000000000000000000', // Etherlink - Native symbol: XTZ (Tezos L2)\n '0xab5': 'eip155:2741/erc20:0x0000000000000000000000000000000000000000', // Abstract - Native symbol: ETH\n '0x1079': 'eip155:4217/erc20:0x20c0000000000000000000000000000000000000', // Tempo Mainnet - Pseudo-Native symbol: pathUSD\n '0x10e6': 'eip155:4326/erc20:0x0000000000000000000000000000000000000000', // MegaETH Mainnet - Native symbol: ETH\n '0x1388': 'eip155:5000/erc20:0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Mantle - Native symbol: MNT\n '0x2105': 'eip155:8453/slip44:60', // Base - Native symbol: ETH\n '0x2611': 'eip155:9745/erc20:0x0000000000000000000000000000000000000000', // Plasma mainnet - native symbol: XPL\n '0x2710': 'eip155:10000/slip44:145', // Smart Bitcoin Cash - Native symbol: BCH\n '0x8173': 'eip155:33139/erc20:0x0000000000000000000000000000000000000000', // Apechain Mainnet - Native symbol: APE\n '0xa3c3': 'eip155:41923/erc20:0x0000000000000000000000000000000000000000', // EDU Chain - Native symbol: EDU\n '0xa4b1': 'eip155:42161/slip44:60', // Arbitrum One - Native symbol: ETH\n '0xa4ec': 'eip155:42220/slip44:52752', // Celo Mainnet - Native symbol: CELO\n '0xa516': 'eip155:42262/slip44:474', // Oasis Emerald - Native symbol: ROSE\n '0xa867': 'eip155:43111/erc20:0x0000000000000000000000000000000000000000', // Hemi - Native symbol: ETH\n '0xa86a': 'eip155:43114/slip44:9005', // Avalanche C-Chain - Native symbol: AVAX\n '0xa5bf': 'eip155:42431/erc20:0x20c0000000000000000000000000000000000000', // Tempo Testnet Moderato - Pseudo-Native symbol: pathUSD\n '0xe708': 'eip155:59144/slip44:60', // Linea Mainnet - Native symbol: ETH\n '0xed88': 'eip155:60808/erc20:0x0000000000000000000000000000000000000000', // BOB - Native symbol: ETH\n '0x138de': 'eip155:80094/erc20:0x0000000000000000000000000000000000000000', // Berachain - Native symbol: Bera',\n '0x13c31': 'eip155:81457/slip44:60', // Blast Mainnet - Native symbol: ETH\n '0x15b38': 'eip155:88888/erc20:0x0000000000000000000000000000000000000000', // Chiliz Chain - Native symbol: CHZ\n '0x17dcd': 'eip155:97741/erc20:0x0000000000000000000000000000000000000000', // Pepe Unchained Mainnet - Native symbol: PEPU\n '0x18232': 'eip155:98866/erc20:0x0000000000000000000000000000000000000000', // Plume Mainnet - Narive symbol: Plume\n '0x28c58': 'eip155:167000/slip44:60', // Taiko Mainnet - Native symbol: ETH\n '0x518af': 'eip155:333999/slip44:1997', // Polis Mainnet - Native symbol: POLIS\n '0x82750': 'eip155:534352/slip44:60', // Scroll Mainnet - Native symbol: ETH\n '0xb67d2': 'eip155:747474/erc20:0x0000000000000000000000000000000000000000', // katana - Native symbol: ETH\n '0x15f900': 'eip155:1440000/erc20:0x0000000000000000000000000000000000000000', // xrpl-evm - native symbol: XRP\n '0x4e454152': 'eip155:1313161554/slip44:60', // Aurora Mainnet (Ethereum L2 on NEAR) - Native symbol: ETH\n '0x63564c40': 'eip155:1666600000/slip44:1023', // Harmony Mainnet Shard 0 - Native symbol: ONE\n '0xdef1': 'eip155:57073/slip44:60', // Ink Mainnet - Native symbol: ETH\n '0x3dc': 'eip155:988/erc20:0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0\n '0xf043a': 'eip155:984122/slip44:984122', // Forma - Native symbol: TIA (Celestia)\n} as const;\n\n// MISSING CHAINS WITH NO NATIVE ASSET PRICES\n// '0x42': 'eip155:66/slip44:996', // OKXChain Mainnet - Native symbol: OKT\n// '0x46': 'eip155:70/slip44:1170', // Hoo Smart Chain - Native symbol: HOO\n// '0x926': 'eip155:2342/erc20:0x0000000000000000000000000000000000000000', // Omnia Chain - Native symbol: OMNIA\n// '0x407b': 'eip155:16507/erc20:0x0000000000000000000000000000000000000000', // Genesys Mainnet - Native symbol: GSYS\n\n/**\n * A currency that can be supplied as the `vsCurrency` parameter to\n * the `/spot-prices` endpoint. Covers both uppercase and lowercase versions.\n */\ntype SupportedCurrency =\n | (typeof SUPPORTED_CURRENCIES_FALLBACK)[number]\n | Uppercase<(typeof SUPPORTED_CURRENCIES_FALLBACK)[number]>;\n\n/**\n * The list of chain IDs that can be supplied in the URL for the `/spot-prices`\n * endpoint, but in hexadecimal form (for consistency with how we represent\n * chain IDs in other places).\n *\n * @see Used by {@link CodefiTokenPricesServiceV2} to validate that a given chain ID is supported by V2 of the Codefi Price API.\n */\nexport const SUPPORTED_CHAIN_IDS = Object.keys(\n SPOT_PRICES_SUPPORT_INFO,\n) as (keyof typeof SPOT_PRICES_SUPPORT_INFO)[];\n\n/**\n * A chain ID that can be supplied in the URL for the `/spot-prices` endpoint,\n * but in hexadecimal form (for consistency with how we represent chain IDs in\n * other places).\n */\ntype SupportedChainId = (typeof SUPPORTED_CHAIN_IDS)[number];\n\nconst BASE_URL_V1 = 'https://price.api.cx.metamask.io/v1';\n\nconst BASE_URL_V2 = 'https://price.api.cx.metamask.io/v2';\n\nconst BASE_URL_V3 = 'https://price.api.cx.metamask.io/v3';\n\n/**\n * Response type for the /v2/supportedNetworks endpoint.\n */\ntype SupportedNetworksResponse = {\n fullSupport: string[];\n partialSupport: {\n spotPricesV2: string[];\n spotPricesV3: string[];\n };\n};\n\n/**\n * In-memory store for the last successfully fetched supported networks.\n */\nlet lastFetchedSupportedNetworks: SupportedNetworksResponse | null = null;\n\n/**\n * In-flight promise to prevent concurrent requests to the supported networks endpoint.\n */\nlet runningSupportedNetworksRequest: Promise<SupportedNetworksResponse> | null =\n null;\n\n/**\n * Converts a CAIP-2 chain ID (e.g., 'eip155:1') to a hex chain ID (e.g., '0x1').\n *\n * @param caipChainId - The CAIP-2 chain ID string.\n * @returns The hex chain ID or null if not an EIP-155 chain.\n */\nfunction caipChainIdToHex(caipChainId: string): Hex | null {\n const match = caipChainId.match(/^eip155:(\\d+)$/u);\n if (!match) {\n return null;\n }\n return numberToHex(parseInt(match[1], 10));\n}\n\n/**\n * Executes the actual fetch to the supported networks endpoint.\n * Handles errors internally by falling back to the hardcoded list,\n * and clears the in-flight promise when done.\n *\n * @returns The supported networks response.\n */\nasync function executeSupportedNetworksFetch(): Promise<SupportedNetworksResponse> {\n try {\n const url = `${BASE_URL_V2}/supportedNetworks`;\n const response = await handleFetch(url, {\n headers: { 'Cache-Control': 'no-cache' },\n });\n\n if (\n response &&\n typeof response === 'object' &&\n 'fullSupport' in response &&\n 'partialSupport' in response\n ) {\n lastFetchedSupportedNetworks = response as SupportedNetworksResponse;\n return lastFetchedSupportedNetworks;\n }\n\n // Invalid response format, fall back to hardcoded list\n return getSupportedNetworksFallback();\n } catch {\n // On any error, fall back to the hardcoded list\n return getSupportedNetworksFallback();\n } finally {\n // Clear the in-flight promise once the request completes\n runningSupportedNetworksRequest = null;\n }\n}\n\n/**\n * Fetches the list of supported networks from the API.\n * Falls back to the hardcoded list if the fetch fails.\n * Deduplicates concurrent requests by returning the same promise if a fetch is already in progress.\n *\n * @returns The supported networks response.\n */\nexport async function fetchSupportedNetworks(): Promise<SupportedNetworksResponse> {\n // If a fetch is already in progress, return the same promise\n if (runningSupportedNetworksRequest) {\n return runningSupportedNetworksRequest;\n }\n\n // Start a new fetch and cache the promise\n runningSupportedNetworksRequest = executeSupportedNetworksFetch();\n\n return runningSupportedNetworksRequest;\n}\n\n/**\n * Synchronously gets the list of supported networks.\n * Returns the last fetched value if available, otherwise returns the fallback list.\n *\n * @returns The supported networks response.\n */\nexport function getSupportedNetworks(): SupportedNetworksResponse {\n if (lastFetchedSupportedNetworks !== null) {\n return lastFetchedSupportedNetworks;\n }\n return getSupportedNetworksFallback();\n}\n\n/**\n * Generates a fallback supported networks response from the hardcoded SPOT_PRICES_SUPPORT_INFO.\n *\n * @returns A SupportedNetworksResponse derived from hardcoded data.\n */\nfunction getSupportedNetworksFallback(): SupportedNetworksResponse {\n const caipChainIds = Object.keys(SPOT_PRICES_SUPPORT_INFO).map((hexChainId) =>\n toCaipChainId(\n KnownCaipNamespace.Eip155,\n hexToNumber(hexChainId as Hex).toString(),\n ),\n );\n\n return {\n fullSupport: caipChainIds.slice(0, 11), // First 11 chains as \"full support\"\n partialSupport: {\n spotPricesV2: caipChainIds,\n spotPricesV3: caipChainIds,\n },\n };\n}\n\n/**\n * Resets the supported networks cache.\n * This is primarily intended for testing purposes.\n */\nexport function resetSupportedNetworksCache(): void {\n lastFetchedSupportedNetworks = null;\n runningSupportedNetworksRequest = null;\n}\n\n/**\n * Gets the list of supported chain IDs for spot prices v3 as hex values.\n *\n * @returns Array of hex chain IDs supported by spot prices v3.\n */\nfunction getSupportedChainIdsV3AsHex(): Hex[] {\n const supportedNetworks = getSupportedNetworks();\n const allV3Chains = [\n ...supportedNetworks.fullSupport,\n ...supportedNetworks.partialSupport.spotPricesV3,\n ];\n\n return allV3Chains\n .map(caipChainIdToHex)\n .filter((hexChainId): hexChainId is Hex => hexChainId !== null);\n}\n\n/**\n * In-memory store for the last successfully fetched supported currencies.\n */\nlet lastFetchedCurrencies: string[] | null = null;\n\n/**\n * Fetches the list of supported currencies from the API.\n * Falls back to the hardcoded list if the fetch fails.\n *\n * @returns The list of supported currencies in lowercase.\n */\nexport async function fetchSupportedCurrencies(): Promise<string[]> {\n try {\n const url = `${BASE_URL_V1}/supportedVsCurrencies`;\n const response = await handleFetch(url, {\n headers: { 'Cache-Control': 'no-cache' },\n });\n\n if (Array.isArray(response)) {\n const currencies = response.map((currency: string) =>\n currency.toLowerCase(),\n );\n lastFetchedCurrencies = currencies;\n return currencies;\n }\n\n // Invalid response format, fall back to hardcoded list\n return [...SUPPORTED_CURRENCIES_FALLBACK];\n } catch {\n // On any error, fall back to the hardcoded list\n return [...SUPPORTED_CURRENCIES_FALLBACK];\n }\n}\n\n/**\n * Synchronously gets the list of supported currencies.\n * Returns the last fetched value if available, otherwise returns the fallback list.\n *\n * @returns The list of supported currencies in lowercase.\n */\nexport function getSupportedCurrencies(): readonly string[] {\n if (lastFetchedCurrencies !== null) {\n return lastFetchedCurrencies;\n }\n return SUPPORTED_CURRENCIES_FALLBACK;\n}\n\n/**\n * Resets the supported currencies cache.\n * This is primarily intended for testing purposes.\n */\nexport function resetSupportedCurrenciesCache(): void {\n lastFetchedCurrencies = null;\n}\n\n/**\n * This version of the token prices service uses V2 of the Codefi Price API to\n * fetch token prices.\n */\nexport class CodefiTokenPricesServiceV2 implements AbstractTokenPricesService<\n SupportedChainId,\n SupportedCurrency\n> {\n readonly #policy: ServicePolicy;\n\n /**\n * Map of CAIP-2 chain IDs to their native asset identifiers.\n * Updated via setNativeAssetIdentifiers().\n */\n #nativeAssetIdentifiers: NativeAssetIdentifiersMap = {};\n\n /**\n * Construct a Codefi Token Price Service.\n *\n * @param args - The arguments.\n * @param args.degradedThreshold - The length of time (in milliseconds)\n * that governs when the service is regarded as degraded (affecting when\n * `onDegraded` is called). Defaults to 5 seconds.\n * @param args.retries - Number of retry attempts for each fetch request.\n * @param args.maximumConsecutiveFailures - The maximum number of consecutive\n * failures allowed before breaking the circuit and pausing further updates.\n * @param args.circuitBreakDuration - The amount of time to wait when the\n * circuit breaks from too many consecutive failures.\n */\n constructor(args?: {\n degradedThreshold?: number;\n retries?: number;\n maximumConsecutiveFailures?: number;\n circuitBreakDuration?: number;\n });\n\n /**\n * Construct a Codefi Token Price Service.\n *\n * @deprecated This signature is deprecated; please use the `onBreak` and\n * `onDegraded` methods instead.\n * @param args - The arguments.\n * @param args.degradedThreshold - The length of time (in milliseconds)\n * that governs when the service is regarded as degraded (affecting when\n * `onDegraded` is called). Defaults to 5 seconds.\n * @param args.retries - Number of retry attempts for each fetch request.\n * @param args.maximumConsecutiveFailures - The maximum number of consecutive\n * failures allowed before breaking the circuit and pausing further updates.\n * @param args.onBreak - Callback for when the circuit breaks, useful\n * for capturing metrics about network failures.\n * @param args.onDegraded - Callback for when the API responds successfully\n * but takes too long to respond (5 seconds or more).\n * @param args.circuitBreakDuration - The amount of time to wait when the\n * circuit breaks from too many consecutive failures.\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n constructor(args?: {\n degradedThreshold?: number;\n retries?: number;\n maximumConsecutiveFailures?: number;\n onBreak?: () => void;\n onDegraded?: () => void;\n circuitBreakDuration?: number;\n });\n\n constructor({\n degradedThreshold = DEFAULT_DEGRADED_THRESHOLD,\n retries = DEFAULT_MAX_RETRIES,\n maximumConsecutiveFailures = DEFAULT_MAX_CONSECUTIVE_FAILURES,\n onBreak,\n onDegraded,\n circuitBreakDuration = DEFAULT_CIRCUIT_BREAK_DURATION,\n }: {\n degradedThreshold?: number;\n retries?: number;\n maximumConsecutiveFailures?: number;\n onBreak?: () => void;\n onDegraded?: () => void;\n circuitBreakDuration?: number;\n } = {}) {\n this.#policy = createServicePolicy({\n maxRetries: retries,\n maxConsecutiveFailures: maximumConsecutiveFailures,\n circuitBreakDuration,\n degradedThreshold,\n });\n if (onBreak) {\n this.#policy.onBreak(onBreak);\n }\n if (onDegraded) {\n this.#policy.onDegraded(onDegraded);\n }\n }\n\n /**\n * Listens for when the request to the API fails too many times in a row.\n *\n * @param args - The same arguments that {@link ServicePolicy.onBreak}\n * takes.\n * @returns What {@link ServicePolicy.onBreak} returns.\n */\n onBreak(\n ...args: Parameters<ServicePolicy['onBreak']>\n ): ReturnType<ServicePolicy['onBreak']> {\n return this.#policy.onBreak(...args);\n }\n\n /**\n * Listens for when the API is degraded.\n *\n * @param args - The same arguments that {@link ServicePolicy.onDegraded}\n * takes.\n * @returns What {@link ServicePolicy.onDegraded} returns.\n */\n onDegraded(\n ...args: Parameters<ServicePolicy['onDegraded']>\n ): ReturnType<ServicePolicy['onDegraded']> {\n return this.#policy.onDegraded(...args);\n }\n\n /**\n * Sets the native asset identifiers map for resolving native token CAIP-19 IDs.\n * This should be called with data from NetworkEnablementController.state.nativeAssetIdentifiers.\n *\n * @param nativeAssetIdentifiers - Map of CAIP-2 chain IDs to native asset identifiers.\n */\n setNativeAssetIdentifiers(\n nativeAssetIdentifiers: NativeAssetIdentifiersMap,\n ): void {\n this.#nativeAssetIdentifiers = nativeAssetIdentifiers;\n }\n\n /**\n * Updates the supported networks cache by fetching from the API.\n * This should be called periodically to keep the supported networks list fresh.\n *\n * @returns The updated supported networks response.\n */\n async updateSupportedNetworks(): Promise<SupportedNetworksResponse> {\n return fetchSupportedNetworks();\n }\n\n /**\n * Retrieves prices in the given currency for the tokens identified by the\n * given addresses which are expected to live on the given chain.\n *\n * @param args - The arguments to function.\n * @param args.assets - The assets to get prices for.\n * @param args.currency - The desired currency of the token prices.\n * @returns The prices for the requested tokens.\n */\n async fetchTokenPrices({\n assets,\n currency,\n }: {\n assets: EvmAssetAddressWithChain<SupportedChainId>[];\n currency: SupportedCurrency;\n }): Promise<EvmAssetWithMarketData<SupportedChainId, SupportedCurrency>[]> {\n // Refresh supported networks in background (non-blocking)\n // This ensures the list stays fresh during normal polling\n // Note: fetchSupportedNetworks handles errors internally and always resolves\n if (!lastFetchedSupportedNetworks) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n fetchSupportedNetworks();\n }\n\n // Get dynamically fetched supported chain IDs for V3\n const supportedChainIdsV3 = getSupportedChainIdsV3AsHex();\n\n const assetsWithIds: EvmAssetWithId<SupportedChainId>[] = assets\n // Filter out assets that are not supported by V3 of the Price API.\n .filter((asset) => supportedChainIdsV3.includes(asset.chainId))\n .map((asset) => {\n const caipChainId = toCaipChainId(\n KnownCaipNamespace.Eip155,\n hexToNumber(asset.chainId).toString(),\n );\n\n const nativeAddress = getNativeTokenAddress(asset.chainId);\n const isNativeToken =\n nativeAddress.toLowerCase() === asset.tokenAddress.toLowerCase();\n\n let assetId: string | undefined;\n if (isNativeToken) {\n // For native tokens, use hardcoded SPOT_PRICES_SUPPORT_INFO when defined,\n // otherwise use nativeAssetIdentifiers from NetworkEnablementController by default.\n assetId =\n SPOT_PRICES_SUPPORT_INFO[asset.chainId] ??\n this.#nativeAssetIdentifiers[caipChainId];\n } else {\n // For ERC20 tokens, construct the CAIP-19 ID dynamically\n assetId = `${caipChainId}/erc20:${asset.tokenAddress.toLowerCase()}`;\n }\n\n if (!assetId) {\n return undefined;\n }\n\n return {\n ...asset,\n assetId: assetId as CaipAssetType,\n };\n })\n .filter(\n (asset): asset is EvmAssetWithId<SupportedChainId> =>\n asset !== undefined,\n );\n\n if (assetsWithIds.length === 0) {\n return [];\n }\n\n const url = new URL(`${BASE_URL_V3}/spot-prices`);\n url.searchParams.append(\n 'assetIds',\n assetsWithIds.map((asset) => asset.assetId).join(','),\n );\n url.searchParams.append('vsCurrency', currency);\n url.searchParams.append('includeMarketData', 'true');\n\n const addressCryptoDataMap: {\n [assetId: CaipAssetType]: Omit<\n MarketDataDetails,\n 'currency' | 'tokenAddress'\n >;\n } = await this.#policy.execute(() =>\n handleFetch(url, { headers: { 'Cache-Control': 'no-cache' } }),\n );\n\n return assetsWithIds\n .map((assetWithId) => {\n const marketData = addressCryptoDataMap[assetWithId.assetId];\n\n if (!marketData) {\n return undefined;\n }\n\n return {\n ...marketData,\n ...assetWithId,\n currency,\n };\n })\n .filter((entry): entry is NonNullable<typeof entry> => Boolean(entry));\n }\n\n /**\n * Retrieves exchange rates in the given base currency.\n *\n * @param args - The arguments to this function.\n * @param args.baseCurrency - The desired base currency of the exchange rates.\n * @param args.includeUsdRate - Whether to include the USD rate in the response.\n * @param args.cryptocurrencies - The cryptocurrencies to get exchange rates for.\n * @returns The exchange rates for the requested base currency.\n */\n async fetchExchangeRates({\n baseCurrency,\n includeUsdRate,\n cryptocurrencies,\n }: {\n baseCurrency: SupportedCurrency;\n includeUsdRate: boolean;\n cryptocurrencies: string[];\n }): Promise<ExchangeRatesByCurrency<SupportedCurrency>> {\n // Refresh supported currencies in background (non-blocking)\n // This ensures the list stays fresh during normal polling\n // Note: fetchSupportedCurrencies handles errors internally and always resolves\n if (!lastFetchedCurrencies) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n fetchSupportedCurrencies();\n }\n\n const url = new URL(`${BASE_URL_V1}/exchange-rates`);\n url.searchParams.append('baseCurrency', baseCurrency);\n\n const urlUsd = new URL(`${BASE_URL_V1}/exchange-rates`);\n urlUsd.searchParams.append('baseCurrency', 'usd');\n\n const [exchangeRatesResult, exchangeRatesResultUsd] =\n await Promise.allSettled([\n this.#policy.execute(() =>\n handleFetch(url, { headers: { 'Cache-Control': 'no-cache' } }),\n ),\n ...(includeUsdRate && baseCurrency.toLowerCase() !== 'usd'\n ? [\n this.#policy.execute(() =>\n handleFetch(urlUsd, {\n headers: { 'Cache-Control': 'no-cache' },\n }),\n ),\n ]\n : []),\n ]);\n\n // Handle resolved/rejected\n const exchangeRates =\n exchangeRatesResult.status === 'fulfilled'\n ? exchangeRatesResult.value\n : {};\n const exchangeRatesUsd =\n exchangeRatesResultUsd?.status === 'fulfilled'\n ? exchangeRatesResultUsd.value\n : {};\n\n if (exchangeRatesResult.status === 'rejected') {\n throw new Error('Failed to fetch');\n }\n\n const filteredExchangeRates = cryptocurrencies.reduce((acc, key) => {\n if (exchangeRates[key.toLowerCase() as SupportedCurrency]) {\n acc[key.toLowerCase() as SupportedCurrency] =\n exchangeRates[key.toLowerCase() as SupportedCurrency];\n }\n return acc;\n }, {} as ExchangeRatesByCurrency<SupportedCurrency>);\n\n if (Object.keys(filteredExchangeRates).length === 0) {\n throw new Error(\n 'None of the cryptocurrencies are supported by price api',\n );\n }\n\n const filteredUsdExchangeRates = cryptocurrencies.reduce((acc, key) => {\n if (exchangeRatesUsd[key.toLowerCase() as SupportedCurrency]) {\n acc[key.toLowerCase() as SupportedCurrency] =\n exchangeRatesUsd[key.toLowerCase() as SupportedCurrency];\n }\n return acc;\n }, {} as ExchangeRatesByCurrency<SupportedCurrency>);\n\n if (baseCurrency.toLowerCase() === 'usd') {\n Object.keys(filteredExchangeRates).forEach((key) => {\n filteredExchangeRates[key as SupportedCurrency] = {\n ...filteredExchangeRates[key as SupportedCurrency],\n usd: filteredExchangeRates[key as SupportedCurrency]?.value,\n };\n });\n return filteredExchangeRates;\n }\n if (!includeUsdRate) {\n return filteredExchangeRates;\n }\n\n const merged = Object.keys(filteredExchangeRates).reduce((acc, key) => {\n acc[key as SupportedCurrency] = {\n ...filteredExchangeRates[key as SupportedCurrency],\n ...(filteredUsdExchangeRates[key as SupportedCurrency]?.value\n ? { usd: filteredUsdExchangeRates[key as SupportedCurrency]?.value }\n : {}),\n };\n return acc;\n }, {} as ExchangeRatesByCurrency<SupportedCurrency>);\n\n return merged;\n }\n\n /**\n * Type guard for whether the API can return token prices for the given chain\n * ID.\n *\n * @param chainId - The chain ID to check.\n * @returns True if the API supports the chain ID, false otherwise.\n */\n validateChainIdSupported(chainId: unknown): chainId is SupportedChainId {\n // Use dynamically fetched supported networks\n const supportedChainIds = getSupportedChainIdsV3AsHex();\n // Also include the hardcoded fallback list for backwards compatibility\n const allSupportedChainIds: readonly string[] = [\n ...new Set([...supportedChainIds, ...SUPPORTED_CHAIN_IDS]),\n ];\n return (\n typeof chainId === 'string' && allSupportedChainIds.includes(chainId)\n );\n }\n\n /**\n * Type guard for whether the API can return token prices in the given\n * currency.\n *\n * @param currency - The currency to check. If a string, can be either\n * lowercase or uppercase.\n * @returns True if the API supports the currency, false otherwise.\n */\n validateCurrencySupported(currency: unknown): currency is SupportedCurrency {\n const supportedCurrencies = getSupportedCurrencies();\n return (\n typeof currency === 'string' &&\n supportedCurrencies.includes(currency.toLowerCase())\n );\n }\n\n /**\n * Fetches the list of supported currencies from the API.\n *\n * @returns The list of supported currencies.\n */\n async updateSupportedCurrencies(): Promise<string[]> {\n return fetchSupportedCurrencies();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"codefi-v2.cjs","sourceRoot":"","sources":["../../src/token-prices-service/codefi-v2.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iEAOoC;AAGpC,2CAKyB;AAYzB;;;;GAIG;AACU,QAAA,6BAA6B,GAAG;IAC3C,UAAU;IACV,KAAK;IACL,QAAQ;IACR,KAAK;IACL,WAAW;IACX,KAAK;IACL,eAAe;IACf,KAAK;IACL,eAAe;IACf,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,KAAK;IACL,SAAS;IACT,KAAK;IACL,YAAY;IACZ,MAAM;IACN,WAAW;IACX,KAAK;IACL,gBAAgB;IAChB,KAAK;IACL,YAAY;IACZ,KAAK;IACL,8BAA8B;IAC9B,KAAK;IACL,iBAAiB;IACjB,KAAK;IACL,oBAAoB;IACpB,KAAK;IACL,mBAAmB;IACnB,KAAK;IACL,iBAAiB;IACjB,KAAK;IACL,mBAAmB;IACnB,KAAK;IACL,cAAc;IACd,KAAK;I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,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,yBAAyB;QAC7B,OAAO,wBAAwB,EAAE,CAAC;IACpC,CAAC;CACF;AA3YD,gEA2YC","sourcesContent":["import {\n createServicePolicy,\n DEFAULT_CIRCUIT_BREAK_DURATION,\n DEFAULT_DEGRADED_THRESHOLD,\n DEFAULT_MAX_CONSECUTIVE_FAILURES,\n DEFAULT_MAX_RETRIES,\n handleFetch,\n} from '@metamask/controller-utils';\nimport type { ServicePolicy } from '@metamask/controller-utils';\nimport type { CaipAssetType, Hex } from '@metamask/utils';\nimport {\n hexToNumber,\n KnownCaipNamespace,\n numberToHex,\n toCaipChainId,\n} from '@metamask/utils';\n\nimport type { MarketDataDetails } from '../TokenRatesController';\nimport type {\n AbstractTokenPricesService,\n EvmAssetAddressWithChain,\n EvmAssetWithId,\n EvmAssetWithMarketData,\n ExchangeRatesByCurrency,\n NativeAssetIdentifiersMap,\n} from './abstract-token-prices-service';\n\n/**\n * The list of currencies that can be supplied as the `vsCurrency` parameter to\n * the `/spot-prices` endpoint, in lowercase form.\n * This is the fallback list used when the API is unavailable.\n */\nexport const SUPPORTED_CURRENCIES_FALLBACK = [\n // Bitcoin\n 'btc',\n // Ether\n 'eth',\n // Litecoin\n 'ltc',\n // Bitcoin Cash\n 'bch',\n // Binance Coin\n 'bnb',\n // EOS\n 'eos',\n // XRP\n 'xrp',\n // Lumens\n 'xlm',\n // Chainlink\n 'link',\n // Polkadot\n 'dot',\n // Yearn.finance\n 'yfi',\n // US Dollar\n 'usd',\n // United Arab Emirates Dirham\n 'aed',\n // Argentine Peso\n 'ars',\n // Australian Dollar\n 'aud',\n // Bangladeshi Taka\n 'bdt',\n // Bahraini Dinar\n 'bhd',\n // Bermudian Dollar\n 'bmd',\n // Brazil Real\n 'brl',\n // Canadian Dollar\n 'cad',\n // Swiss Franc\n 'chf',\n // Chilean Peso\n 'clp',\n // Chinese Yuan\n 'cny',\n // Czech Koruna\n 'czk',\n // Danish Krone\n 'dkk',\n // Euro\n 'eur',\n // British Pound Sterling\n 'gbp',\n // Georgian Lari\n 'gel',\n // Hong Kong Dollar\n 'hkd',\n // Hungarian Forint\n 'huf',\n // Indonesian Rupiah\n 'idr',\n // Israeli New Shekel\n 'ils',\n // Indian Rupee\n 'inr',\n // Japanese Yen\n 'jpy',\n // South Korean Won\n 'krw',\n // Kuwaiti Dinar\n 'kwd',\n // Sri Lankan Rupee\n 'lkr',\n // Burmese Kyat\n 'mmk',\n // Mexican Peso\n 'mxn',\n // Malaysian Ringgit\n 'myr',\n // Monad\n 'mon',\n // Nigerian Naira\n 'ngn',\n // Norwegian Krone\n 'nok',\n // New Zealand Dollar\n 'nzd',\n // Philippine Peso\n 'php',\n // Pakistani Rupee\n 'pkr',\n // Polish Zloty\n 'pln',\n // Russian Ruble\n 'rub',\n // Saudi Riyal\n 'sar',\n // Swedish Krona\n 'sek',\n // Singapore Dollar\n 'sgd',\n // Thai Baht\n 'thb',\n // Turkish Lira\n 'try',\n // New Taiwan Dollar\n 'twd',\n // Ukrainian hryvnia\n 'uah',\n // Venezuelan bolívar fuerte\n 'vef',\n // Vietnamese đồng\n 'vnd',\n // South African Rand\n 'zar',\n // IMF Special Drawing Rights\n 'xdr',\n // Silver - Troy Ounce\n 'xag',\n // Gold - Troy Ounce\n 'xau',\n // Bits\n 'bits',\n // Satoshi\n 'sats',\n // Colombian Peso\n 'cop',\n // Kenyan Shilling\n 'kes',\n // Romanian Leu\n 'ron',\n // Dominican Peso\n 'dop',\n // Costa Rican Colón\n 'crc',\n // Honduran Lempira\n 'hnl',\n // Zambian Kwacha\n 'zmw',\n // Salvadoran Colón\n 'svc',\n // Bosnia-Herzegovina Convertible Mark\n 'bam',\n // Peruvian Sol\n 'pen',\n // Guatemalan Quetzal\n 'gtq',\n // Lebanese Pound\n 'lbp',\n // Armenian Dram\n 'amd',\n // Solana\n 'sol',\n // Sei\n 'sei',\n // Sonic\n 'sonic',\n // Tron\n 'trx',\n // Taiko\n 'taiko',\n // Pepu\n 'pepu',\n // Polygon\n 'pol',\n // Mantle\n 'mnt',\n // Onomy\n 'nom',\n // Avalanche\n 'avax',\n // Apechain\n 'ape',\n] as const;\n\n/**\n * @deprecated Use `getSupportedCurrencies()` or `fetchSupportedCurrencies()` instead.\n * This is an alias for backward compatibility.\n */\nexport const SUPPORTED_CURRENCIES = SUPPORTED_CURRENCIES_FALLBACK;\n\n/**\n * Represents the zero address, commonly used as a placeholder in blockchain transactions.\n * In the context of fetching market data, the zero address is utilized to retrieve information\n * specifically for native currencies. This allows for a standardized approach to query market\n * data for blockchain-native assets without a specific contract address.\n */\nexport const ZERO_ADDRESS: Hex =\n '0x0000000000000000000000000000000000000000' as const;\n\n/**\n * A mapping from chain id to the address of the chain's native token.\n * Only for chains whose native tokens have a specific address.\n */\nconst chainIdToNativeTokenAddress: Record<Hex, Hex> = {\n '0x89': '0x0000000000000000000000000000000000001010', // Polygon\n '0x440': '0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Metis Andromeda\n '0x1388': '0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Mantle\n '0x64': '0xe91d153e0b41518a2ce8dd3d7944fa863463a97d', // Gnosis\n '0x1e': '0x542fda317318ebf1d3deaf76e0b632741a7e677d', // Rootstock Mainnet - Native symbol: RBTC\n '0x3dc': '0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0\n};\n\n/**\n * Returns the address that should be used to query the price api for the\n * chain's native token. On most chains, this is signified by the zero address.\n * But on some chains, the native token has a specific address.\n *\n * @param chainId - The hexadecimal chain id.\n * @returns The address of the chain's native token.\n */\nexport const getNativeTokenAddress = (chainId: Hex): Hex =>\n chainIdToNativeTokenAddress[chainId] ?? ZERO_ADDRESS;\n\n// Source: https://github.com/consensys-vertical-apps/va-mmcx-price-api/blob/main/src/constants/slip44.ts\n// We can only support PricesAPI V3 for EVM chains that have a CAIP-19 native asset mapping.\nexport const SPOT_PRICES_SUPPORT_INFO = {\n '0x1': 'eip155:1/slip44:60', // Ethereum Mainnet - Native symbol: ETH\n '0xa': 'eip155:10/slip44:60', // OP Mainnet - Native symbol: ETH\n '0x19': 'eip155:25/slip44:394', // Cronos Mainnet - Native symbol: CRO\n '0x1e': 'eip155:30/slip44:137', // Rootstock Mainnet - Native symbol: RBTC\n '0x2a': 'eip155:42/erc20:0x0000000000000000000000000000000000000000', // Lukso - native symbol: LYX\n '0x32': 'eip155:50/erc20:0x0000000000000000000000000000000000000000', // xdc-network - native symbol: XDC\n '0x38': 'eip155:56/slip44:714', // BNB Smart Chain Mainnet - Native symbol: BNB\n '0x39': 'eip155:57/slip44:57', // Syscoin Mainnet - Native symbol: SYS\n '0x52': 'eip155:82/slip44:18000', // Meter Mainnet - Native symbol: MTR\n '0x58': 'eip155:88/slip44:889', // TomoChain - Native symbol: TOMO\n '0x64': 'eip155:100/slip44:700', // Gnosis (formerly xDAI Chain) - Native symbol: xDAI\n '0x6a': 'eip155:106/slip44:5655640', // Velas EVM Mainnet - Native symbol: VLX\n '0x7a': 'eip155:122/erc20:0x0000000000000000000000000000000000000000', // Fuse Mainnet - Native symbol: FUSE\n '0x80': 'eip155:128/slip44:1010', // Huobi ECO Chain Mainnet - Native symbol: HT\n '0x89': 'eip155:137/slip44:966', // Polygon Mainnet - Native symbol: POL\n '0x8f': 'eip155:143/slip44:268435779', // Monad Mainnet - Native symbol: MON\n '0x92': 'eip155:146/slip44:10007', // Sonic Mainnet - Native symbol: S\n '0xc4': 'eip155:196/erc20:0x0000000000000000000000000000000000000000', // X Layer Mainnet - Native symbol: OKB\n '0xe8': 'eip155:232/erc20:0x0000000000000000000000000000000000000000', // Lens Mainnet - Native symbol: GHO\n '0xfa': 'eip155:250/slip44:1007', // Fantom Opera - Native symbol: FTM\n '0xfc': 'eip155:252/erc20:0x0000000000000000000000000000000000000000', // Fraxtal - native symbol: FRAX\n '0x10b3e': 'eip155:68414/erc20:0x0000000000000000000000000000000000000000', // MapleStory Universe - no slip44\n '0x120': 'eip155:288/slip44:60', // Boba Network (Ethereum L2) - Native symbol: ETH\n '0x141': 'eip155:321/slip44:641', // KCC Mainnet - Native symbol: KCS\n '0x144': 'eip155:324/slip44:60', // zkSync Era Mainnet (Ethereum L2) - Native symbol: ETH\n '0x150': 'eip155:336/slip44:809', // Shiden - Native symbol: SDN\n '0x169': 'eip155:361/slip44:589', // Theta Mainnet - Native symbol: TFUEL\n '0x2eb': 'eip155:747/slip44:539', // Flow evm - Native symbol: Flow\n '0x3e7': 'eip155:999/slip44:2457', // HyperEVM - Native symbol: HYPE\n '0x440': 'eip155:1088/erc20:0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Metis Andromeda Mainnet (Ethereum L2) - Native symbol: METIS\n '0x44d': 'eip155:1101/slip44:60', // Polygon zkEVM mainnet - Native symbol: ETH\n '0x504': 'eip155:1284/slip44:1284', // Moonbeam - Native symbol: GLMR\n '0x505': 'eip155:1285/slip44:1285', // Moonriver - Native symbol: MOVR\n '0x531': 'eip155:1329/slip44:19000118', // Sei Mainnet - Native symbol: SEI\n '0x6f0': 'eip155:1776/slip44:22000119', // Injective Mainnet - Native symbol: INJ\n '0x74c': 'eip155:1868/erc20:0x0000000000000000000000000000000000000000', // Soneium - Native symbol: ETH\n '0xa729': 'eip155:42793/erc20:0x0000000000000000000000000000000000000000', // Etherlink - Native symbol: XTZ (Tezos L2)\n '0xab5': 'eip155:2741/erc20:0x0000000000000000000000000000000000000000', // Abstract - Native symbol: ETH\n '0x1079': 'eip155:4217/slip44:60', // Tempo Mainnet - No native asset\n '0x10e6': 'eip155:4326/erc20:0x0000000000000000000000000000000000000000', // MegaETH Mainnet - Native symbol: ETH\n '0x1388': 'eip155:5000/erc20:0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Mantle - Native symbol: MNT\n '0x2105': 'eip155:8453/slip44:60', // Base - Native symbol: ETH\n '0x2611': 'eip155:9745/erc20:0x0000000000000000000000000000000000000000', // Plasma mainnet - native symbol: XPL\n '0x2710': 'eip155:10000/slip44:145', // Smart Bitcoin Cash - Native symbol: BCH\n '0x8173': 'eip155:33139/erc20:0x0000000000000000000000000000000000000000', // Apechain Mainnet - Native symbol: APE\n '0xa3c3': 'eip155:41923/erc20:0x0000000000000000000000000000000000000000', // EDU Chain - Native symbol: EDU\n '0xa4b1': 'eip155:42161/slip44:60', // Arbitrum One - Native symbol: ETH\n '0xa4ec': 'eip155:42220/slip44:52752', // Celo Mainnet - Native symbol: CELO\n '0xa516': 'eip155:42262/slip44:474', // Oasis Emerald - Native symbol: ROSE\n '0xa867': 'eip155:43111/erc20:0x0000000000000000000000000000000000000000', // Hemi - Native symbol: ETH\n '0xa86a': 'eip155:43114/slip44:9005', // Avalanche C-Chain - Native symbol: AVAX\n '0xa5bf': 'eip155:42431/slip44:60', // Tempo Testnet Moderato - No native asset\n '0xe708': 'eip155:59144/slip44:60', // Linea Mainnet - Native symbol: ETH\n '0xed88': 'eip155:60808/erc20:0x0000000000000000000000000000000000000000', // BOB - Native symbol: ETH\n '0x138de': 'eip155:80094/erc20:0x0000000000000000000000000000000000000000', // Berachain - Native symbol: Bera',\n '0x13c31': 'eip155:81457/slip44:60', // Blast Mainnet - Native symbol: ETH\n '0x15b38': 'eip155:88888/erc20:0x0000000000000000000000000000000000000000', // Chiliz Chain - Native symbol: CHZ\n '0x17dcd': 'eip155:97741/erc20:0x0000000000000000000000000000000000000000', // Pepe Unchained Mainnet - Native symbol: PEPU\n '0x18232': 'eip155:98866/erc20:0x0000000000000000000000000000000000000000', // Plume Mainnet - Narive symbol: Plume\n '0x28c58': 'eip155:167000/slip44:60', // Taiko Mainnet - Native symbol: ETH\n '0x518af': 'eip155:333999/slip44:1997', // Polis Mainnet - Native symbol: POLIS\n '0x82750': 'eip155:534352/slip44:60', // Scroll Mainnet - Native symbol: ETH\n '0xb67d2': 'eip155:747474/erc20:0x0000000000000000000000000000000000000000', // katana - Native symbol: ETH\n '0x15f900': 'eip155:1440000/erc20:0x0000000000000000000000000000000000000000', // xrpl-evm - native symbol: XRP\n '0x4e454152': 'eip155:1313161554/slip44:60', // Aurora Mainnet (Ethereum L2 on NEAR) - Native symbol: ETH\n '0x63564c40': 'eip155:1666600000/slip44:1023', // Harmony Mainnet Shard 0 - Native symbol: ONE\n '0xdef1': 'eip155:57073/slip44:60', // Ink Mainnet - Native symbol: ETH\n '0x3dc': 'eip155:988/erc20:0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0\n '0xf043a': 'eip155:984122/slip44:984122', // Forma - Native symbol: TIA (Celestia)\n '0x1b58': 'eip155:7000/slip44:7000', // ZetaChain - Native symbol: ZETA\n} as const;\n\n// MISSING CHAINS WITH NO NATIVE ASSET PRICES\n// '0x42': 'eip155:66/slip44:996', // OKXChain Mainnet - Native symbol: OKT\n// '0x46': 'eip155:70/slip44:1170', // Hoo Smart Chain - Native symbol: HOO\n// '0x926': 'eip155:2342/erc20:0x0000000000000000000000000000000000000000', // Omnia Chain - Native symbol: OMNIA\n// '0x407b': 'eip155:16507/erc20:0x0000000000000000000000000000000000000000', // Genesys Mainnet - Native symbol: GSYS\n\n/**\n * A currency that can be supplied as the `vsCurrency` parameter to\n * the `/spot-prices` endpoint. Covers both uppercase and lowercase versions.\n */\ntype SupportedCurrency =\n | (typeof SUPPORTED_CURRENCIES_FALLBACK)[number]\n | Uppercase<(typeof SUPPORTED_CURRENCIES_FALLBACK)[number]>;\n\n/**\n * The list of chain IDs that can be supplied in the URL for the `/spot-prices`\n * endpoint, but in hexadecimal form (for consistency with how we represent\n * chain IDs in other places).\n *\n * @see Used by {@link CodefiTokenPricesServiceV2} to validate that a given chain ID is supported by V2 of the Codefi Price API.\n */\nexport const SUPPORTED_CHAIN_IDS = Object.keys(\n SPOT_PRICES_SUPPORT_INFO,\n) as (keyof typeof SPOT_PRICES_SUPPORT_INFO)[];\n\n/**\n * A chain ID that can be supplied in the URL for the `/spot-prices` endpoint,\n * but in hexadecimal form (for consistency with how we represent chain IDs in\n * other places).\n */\ntype SupportedChainId = (typeof SUPPORTED_CHAIN_IDS)[number];\n\nconst BASE_URL_V1 = 'https://price.api.cx.metamask.io/v1';\n\nconst BASE_URL_V2 = 'https://price.api.cx.metamask.io/v2';\n\nconst BASE_URL_V3 = 'https://price.api.cx.metamask.io/v3';\n\n/**\n * Response type for the /v2/supportedNetworks endpoint.\n */\ntype SupportedNetworksResponse = {\n fullSupport: string[];\n partialSupport: {\n spotPricesV2: string[];\n spotPricesV3: string[];\n };\n};\n\n/**\n * In-memory store for the last successfully fetched supported networks.\n */\nlet lastFetchedSupportedNetworks: SupportedNetworksResponse | null = null;\n\n/**\n * In-flight promise to prevent concurrent requests to the supported networks endpoint.\n */\nlet runningSupportedNetworksRequest: Promise<SupportedNetworksResponse> | null =\n null;\n\n/**\n * Converts a CAIP-2 chain ID (e.g., 'eip155:1') to a hex chain ID (e.g., '0x1').\n *\n * @param caipChainId - The CAIP-2 chain ID string.\n * @returns The hex chain ID or null if not an EIP-155 chain.\n */\nfunction caipChainIdToHex(caipChainId: string): Hex | null {\n const match = caipChainId.match(/^eip155:(\\d+)$/u);\n if (!match) {\n return null;\n }\n return numberToHex(parseInt(match[1], 10));\n}\n\n/**\n * Executes the actual fetch to the supported networks endpoint.\n * Handles errors internally by falling back to the hardcoded list,\n * and clears the in-flight promise when done.\n *\n * @returns The supported networks response.\n */\nasync function executeSupportedNetworksFetch(): Promise<SupportedNetworksResponse> {\n try {\n const url = `${BASE_URL_V2}/supportedNetworks`;\n const response = await handleFetch(url, {\n headers: { 'Cache-Control': 'no-cache' },\n });\n\n if (\n response &&\n typeof response === 'object' &&\n 'fullSupport' in response &&\n 'partialSupport' in response\n ) {\n lastFetchedSupportedNetworks = response as SupportedNetworksResponse;\n return lastFetchedSupportedNetworks;\n }\n\n // Invalid response format, fall back to hardcoded list\n return getSupportedNetworksFallback();\n } catch {\n // On any error, fall back to the hardcoded list\n return getSupportedNetworksFallback();\n } finally {\n // Clear the in-flight promise once the request completes\n runningSupportedNetworksRequest = null;\n }\n}\n\n/**\n * Fetches the list of supported networks from the API.\n * Falls back to the hardcoded list if the fetch fails.\n * Deduplicates concurrent requests by returning the same promise if a fetch is already in progress.\n *\n * @returns The supported networks response.\n */\nexport async function fetchSupportedNetworks(): Promise<SupportedNetworksResponse> {\n // If a fetch is already in progress, return the same promise\n if (runningSupportedNetworksRequest) {\n return runningSupportedNetworksRequest;\n }\n\n // Start a new fetch and cache the promise\n runningSupportedNetworksRequest = executeSupportedNetworksFetch();\n\n return runningSupportedNetworksRequest;\n}\n\n/**\n * Synchronously gets the list of supported networks.\n * Returns the last fetched value if available, otherwise returns the fallback list.\n *\n * @returns The supported networks response.\n */\nexport function getSupportedNetworks(): SupportedNetworksResponse {\n if (lastFetchedSupportedNetworks !== null) {\n return lastFetchedSupportedNetworks;\n }\n return getSupportedNetworksFallback();\n}\n\n/**\n * Generates a fallback supported networks response from the hardcoded SPOT_PRICES_SUPPORT_INFO.\n *\n * @returns A SupportedNetworksResponse derived from hardcoded data.\n */\nfunction getSupportedNetworksFallback(): SupportedNetworksResponse {\n const caipChainIds = Object.keys(SPOT_PRICES_SUPPORT_INFO).map((hexChainId) =>\n toCaipChainId(\n KnownCaipNamespace.Eip155,\n hexToNumber(hexChainId as Hex).toString(),\n ),\n );\n\n return {\n fullSupport: caipChainIds.slice(0, 11), // First 11 chains as \"full support\"\n partialSupport: {\n spotPricesV2: caipChainIds,\n spotPricesV3: caipChainIds,\n },\n };\n}\n\n/**\n * Resets the supported networks cache.\n * This is primarily intended for testing purposes.\n */\nexport function resetSupportedNetworksCache(): void {\n lastFetchedSupportedNetworks = null;\n runningSupportedNetworksRequest = null;\n}\n\n/**\n * Gets the list of supported chain IDs for spot prices v3 as hex values.\n *\n * @returns Array of hex chain IDs supported by spot prices v3.\n */\nfunction getSupportedChainIdsV3AsHex(): Hex[] {\n const supportedNetworks = getSupportedNetworks();\n const allV3Chains = [\n ...supportedNetworks.fullSupport,\n ...supportedNetworks.partialSupport.spotPricesV3,\n ];\n\n return allV3Chains\n .map(caipChainIdToHex)\n .filter((hexChainId): hexChainId is Hex => hexChainId !== null);\n}\n\n/**\n * In-memory store for the last successfully fetched supported currencies.\n */\nlet lastFetchedCurrencies: string[] | null = null;\n\n/**\n * Fetches the list of supported currencies from the API.\n * Falls back to the hardcoded list if the fetch fails.\n *\n * @returns The list of supported currencies in lowercase.\n */\nexport async function fetchSupportedCurrencies(): Promise<string[]> {\n try {\n const url = `${BASE_URL_V1}/supportedVsCurrencies`;\n const response = await handleFetch(url, {\n headers: { 'Cache-Control': 'no-cache' },\n });\n\n if (Array.isArray(response)) {\n const currencies = response.map((currency: string) =>\n currency.toLowerCase(),\n );\n lastFetchedCurrencies = currencies;\n return currencies;\n }\n\n // Invalid response format, fall back to hardcoded list\n return [...SUPPORTED_CURRENCIES_FALLBACK];\n } catch {\n // On any error, fall back to the hardcoded list\n return [...SUPPORTED_CURRENCIES_FALLBACK];\n }\n}\n\n/**\n * Synchronously gets the list of supported currencies.\n * Returns the last fetched value if available, otherwise returns the fallback list.\n *\n * @returns The list of supported currencies in lowercase.\n */\nexport function getSupportedCurrencies(): readonly string[] {\n if (lastFetchedCurrencies !== null) {\n return lastFetchedCurrencies;\n }\n return SUPPORTED_CURRENCIES_FALLBACK;\n}\n\n/**\n * Resets the supported currencies cache.\n * This is primarily intended for testing purposes.\n */\nexport function resetSupportedCurrenciesCache(): void {\n lastFetchedCurrencies = null;\n}\n\n/**\n * This version of the token prices service uses V2 of the Codefi Price API to\n * fetch token prices.\n */\nexport class CodefiTokenPricesServiceV2 implements AbstractTokenPricesService<\n SupportedChainId,\n SupportedCurrency\n> {\n readonly #policy: ServicePolicy;\n\n /**\n * Map of CAIP-2 chain IDs to their native asset identifiers.\n * Updated via setNativeAssetIdentifiers().\n */\n #nativeAssetIdentifiers: NativeAssetIdentifiersMap = {};\n\n /**\n * Construct a Codefi Token Price Service.\n *\n * @param args - The arguments.\n * @param args.degradedThreshold - The length of time (in milliseconds)\n * that governs when the service is regarded as degraded (affecting when\n * `onDegraded` is called). Defaults to 5 seconds.\n * @param args.retries - Number of retry attempts for each fetch request.\n * @param args.maximumConsecutiveFailures - The maximum number of consecutive\n * failures allowed before breaking the circuit and pausing further updates.\n * @param args.circuitBreakDuration - The amount of time to wait when the\n * circuit breaks from too many consecutive failures.\n */\n constructor(args?: {\n degradedThreshold?: number;\n retries?: number;\n maximumConsecutiveFailures?: number;\n circuitBreakDuration?: number;\n });\n\n /**\n * Construct a Codefi Token Price Service.\n *\n * @deprecated This signature is deprecated; please use the `onBreak` and\n * `onDegraded` methods instead.\n * @param args - The arguments.\n * @param args.degradedThreshold - The length of time (in milliseconds)\n * that governs when the service is regarded as degraded (affecting when\n * `onDegraded` is called). Defaults to 5 seconds.\n * @param args.retries - Number of retry attempts for each fetch request.\n * @param args.maximumConsecutiveFailures - The maximum number of consecutive\n * failures allowed before breaking the circuit and pausing further updates.\n * @param args.onBreak - Callback for when the circuit breaks, useful\n * for capturing metrics about network failures.\n * @param args.onDegraded - Callback for when the API responds successfully\n * but takes too long to respond (5 seconds or more).\n * @param args.circuitBreakDuration - The amount of time to wait when the\n * circuit breaks from too many consecutive failures.\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n constructor(args?: {\n degradedThreshold?: number;\n retries?: number;\n maximumConsecutiveFailures?: number;\n onBreak?: () => void;\n onDegraded?: () => void;\n circuitBreakDuration?: number;\n });\n\n constructor({\n degradedThreshold = DEFAULT_DEGRADED_THRESHOLD,\n retries = DEFAULT_MAX_RETRIES,\n maximumConsecutiveFailures = DEFAULT_MAX_CONSECUTIVE_FAILURES,\n onBreak,\n onDegraded,\n circuitBreakDuration = DEFAULT_CIRCUIT_BREAK_DURATION,\n }: {\n degradedThreshold?: number;\n retries?: number;\n maximumConsecutiveFailures?: number;\n onBreak?: () => void;\n onDegraded?: () => void;\n circuitBreakDuration?: number;\n } = {}) {\n this.#policy = createServicePolicy({\n maxRetries: retries,\n maxConsecutiveFailures: maximumConsecutiveFailures,\n circuitBreakDuration,\n degradedThreshold,\n });\n if (onBreak) {\n this.#policy.onBreak(onBreak);\n }\n if (onDegraded) {\n this.#policy.onDegraded(onDegraded);\n }\n }\n\n /**\n * Listens for when the request to the API fails too many times in a row.\n *\n * @param args - The same arguments that {@link ServicePolicy.onBreak}\n * takes.\n * @returns What {@link ServicePolicy.onBreak} returns.\n */\n onBreak(\n ...args: Parameters<ServicePolicy['onBreak']>\n ): ReturnType<ServicePolicy['onBreak']> {\n return this.#policy.onBreak(...args);\n }\n\n /**\n * Listens for when the API is degraded.\n *\n * @param args - The same arguments that {@link ServicePolicy.onDegraded}\n * takes.\n * @returns What {@link ServicePolicy.onDegraded} returns.\n */\n onDegraded(\n ...args: Parameters<ServicePolicy['onDegraded']>\n ): ReturnType<ServicePolicy['onDegraded']> {\n return this.#policy.onDegraded(...args);\n }\n\n /**\n * Sets the native asset identifiers map for resolving native token CAIP-19 IDs.\n * This should be called with data from NetworkEnablementController.state.nativeAssetIdentifiers.\n *\n * @param nativeAssetIdentifiers - Map of CAIP-2 chain IDs to native asset identifiers.\n */\n setNativeAssetIdentifiers(\n nativeAssetIdentifiers: NativeAssetIdentifiersMap,\n ): void {\n this.#nativeAssetIdentifiers = nativeAssetIdentifiers;\n }\n\n /**\n * Updates the supported networks cache by fetching from the API.\n * This should be called periodically to keep the supported networks list fresh.\n *\n * @returns The updated supported networks response.\n */\n async updateSupportedNetworks(): Promise<SupportedNetworksResponse> {\n return fetchSupportedNetworks();\n }\n\n /**\n * Retrieves prices in the given currency for the tokens identified by the\n * given addresses which are expected to live on the given chain.\n *\n * @param args - The arguments to function.\n * @param args.assets - The assets to get prices for.\n * @param args.currency - The desired currency of the token prices.\n * @returns The prices for the requested tokens.\n */\n async fetchTokenPrices({\n assets,\n currency,\n }: {\n assets: EvmAssetAddressWithChain<SupportedChainId>[];\n currency: SupportedCurrency;\n }): Promise<EvmAssetWithMarketData<SupportedChainId, SupportedCurrency>[]> {\n // Refresh supported networks in background (non-blocking)\n // This ensures the list stays fresh during normal polling\n // Note: fetchSupportedNetworks handles errors internally and always resolves\n if (!lastFetchedSupportedNetworks) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n fetchSupportedNetworks();\n }\n\n // Get dynamically fetched supported chain IDs for V3\n const supportedChainIdsV3 = getSupportedChainIdsV3AsHex();\n\n const assetsWithIds: EvmAssetWithId<SupportedChainId>[] = assets\n // Filter out assets that are not supported by V3 of the Price API.\n .filter((asset) => supportedChainIdsV3.includes(asset.chainId))\n .map((asset) => {\n const caipChainId = toCaipChainId(\n KnownCaipNamespace.Eip155,\n hexToNumber(asset.chainId).toString(),\n );\n\n const nativeAddress = getNativeTokenAddress(asset.chainId);\n const isNativeToken =\n nativeAddress.toLowerCase() === asset.tokenAddress.toLowerCase();\n\n let assetId: string | undefined;\n if (isNativeToken) {\n // For native tokens, use hardcoded SPOT_PRICES_SUPPORT_INFO when defined,\n // otherwise use nativeAssetIdentifiers from NetworkEnablementController by default.\n assetId =\n SPOT_PRICES_SUPPORT_INFO[asset.chainId] ??\n this.#nativeAssetIdentifiers[caipChainId];\n } else {\n // For ERC20 tokens, construct the CAIP-19 ID dynamically\n assetId = `${caipChainId}/erc20:${asset.tokenAddress.toLowerCase()}`;\n }\n\n if (!assetId) {\n return undefined;\n }\n\n return {\n ...asset,\n assetId: assetId as CaipAssetType,\n };\n })\n .filter(\n (asset): asset is EvmAssetWithId<SupportedChainId> =>\n asset !== undefined,\n );\n\n if (assetsWithIds.length === 0) {\n return [];\n }\n\n const url = new URL(`${BASE_URL_V3}/spot-prices`);\n url.searchParams.append(\n 'assetIds',\n assetsWithIds.map((asset) => asset.assetId).join(','),\n );\n url.searchParams.append('vsCurrency', currency);\n url.searchParams.append('includeMarketData', 'true');\n\n const addressCryptoDataMap: {\n [assetId: CaipAssetType]: Omit<\n MarketDataDetails,\n 'currency' | 'tokenAddress'\n >;\n } = await this.#policy.execute(() =>\n handleFetch(url, { headers: { 'Cache-Control': 'no-cache' } }),\n );\n\n return assetsWithIds\n .map((assetWithId) => {\n const marketData = addressCryptoDataMap[assetWithId.assetId];\n\n if (!marketData) {\n return undefined;\n }\n\n return {\n ...marketData,\n ...assetWithId,\n currency,\n };\n })\n .filter((entry): entry is NonNullable<typeof entry> => Boolean(entry));\n }\n\n /**\n * Retrieves exchange rates in the given base currency.\n *\n * @param args - The arguments to this function.\n * @param args.baseCurrency - The desired base currency of the exchange rates.\n * @param args.includeUsdRate - Whether to include the USD rate in the response.\n * @param args.cryptocurrencies - The cryptocurrencies to get exchange rates for.\n * @returns The exchange rates for the requested base currency.\n */\n async fetchExchangeRates({\n baseCurrency,\n includeUsdRate,\n cryptocurrencies,\n }: {\n baseCurrency: SupportedCurrency;\n includeUsdRate: boolean;\n cryptocurrencies: string[];\n }): Promise<ExchangeRatesByCurrency<SupportedCurrency>> {\n // Refresh supported currencies in background (non-blocking)\n // This ensures the list stays fresh during normal polling\n // Note: fetchSupportedCurrencies handles errors internally and always resolves\n if (!lastFetchedCurrencies) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n fetchSupportedCurrencies();\n }\n\n const url = new URL(`${BASE_URL_V1}/exchange-rates`);\n url.searchParams.append('baseCurrency', baseCurrency);\n\n const urlUsd = new URL(`${BASE_URL_V1}/exchange-rates`);\n urlUsd.searchParams.append('baseCurrency', 'usd');\n\n const [exchangeRatesResult, exchangeRatesResultUsd] =\n await Promise.allSettled([\n this.#policy.execute(() =>\n handleFetch(url, { headers: { 'Cache-Control': 'no-cache' } }),\n ),\n ...(includeUsdRate && baseCurrency.toLowerCase() !== 'usd'\n ? [\n this.#policy.execute(() =>\n handleFetch(urlUsd, {\n headers: { 'Cache-Control': 'no-cache' },\n }),\n ),\n ]\n : []),\n ]);\n\n // Handle resolved/rejected\n const exchangeRates =\n exchangeRatesResult.status === 'fulfilled'\n ? exchangeRatesResult.value\n : {};\n const exchangeRatesUsd =\n exchangeRatesResultUsd?.status === 'fulfilled'\n ? exchangeRatesResultUsd.value\n : {};\n\n if (exchangeRatesResult.status === 'rejected') {\n throw new Error('Failed to fetch');\n }\n\n const filteredExchangeRates = cryptocurrencies.reduce((acc, key) => {\n if (exchangeRates[key.toLowerCase() as SupportedCurrency]) {\n acc[key.toLowerCase() as SupportedCurrency] =\n exchangeRates[key.toLowerCase() as SupportedCurrency];\n }\n return acc;\n }, {} as ExchangeRatesByCurrency<SupportedCurrency>);\n\n if (Object.keys(filteredExchangeRates).length === 0) {\n throw new Error(\n 'None of the cryptocurrencies are supported by price api',\n );\n }\n\n const filteredUsdExchangeRates = cryptocurrencies.reduce((acc, key) => {\n if (exchangeRatesUsd[key.toLowerCase() as SupportedCurrency]) {\n acc[key.toLowerCase() as SupportedCurrency] =\n exchangeRatesUsd[key.toLowerCase() as SupportedCurrency];\n }\n return acc;\n }, {} as ExchangeRatesByCurrency<SupportedCurrency>);\n\n if (baseCurrency.toLowerCase() === 'usd') {\n Object.keys(filteredExchangeRates).forEach((key) => {\n filteredExchangeRates[key as SupportedCurrency] = {\n ...filteredExchangeRates[key as SupportedCurrency],\n usd: filteredExchangeRates[key as SupportedCurrency]?.value,\n };\n });\n return filteredExchangeRates;\n }\n if (!includeUsdRate) {\n return filteredExchangeRates;\n }\n\n const merged = Object.keys(filteredExchangeRates).reduce((acc, key) => {\n acc[key as SupportedCurrency] = {\n ...filteredExchangeRates[key as SupportedCurrency],\n ...(filteredUsdExchangeRates[key as SupportedCurrency]?.value\n ? { usd: filteredUsdExchangeRates[key as SupportedCurrency]?.value }\n : {}),\n };\n return acc;\n }, {} as ExchangeRatesByCurrency<SupportedCurrency>);\n\n return merged;\n }\n\n /**\n * Type guard for whether the API can return token prices for the given chain\n * ID.\n *\n * @param chainId - The chain ID to check.\n * @returns True if the API supports the chain ID, false otherwise.\n */\n validateChainIdSupported(chainId: unknown): chainId is SupportedChainId {\n // Use dynamically fetched supported networks\n const supportedChainIds = getSupportedChainIdsV3AsHex();\n // Also include the hardcoded fallback list for backwards compatibility\n const allSupportedChainIds: readonly string[] = [\n ...new Set([...supportedChainIds, ...SUPPORTED_CHAIN_IDS]),\n ];\n return (\n typeof chainId === 'string' && allSupportedChainIds.includes(chainId)\n );\n }\n\n /**\n * Type guard for whether the API can return token prices in the given\n * currency.\n *\n * @param currency - The currency to check. If a string, can be either\n * lowercase or uppercase.\n * @returns True if the API supports the currency, false otherwise.\n */\n validateCurrencySupported(currency: unknown): currency is SupportedCurrency {\n const supportedCurrencies = getSupportedCurrencies();\n return (\n typeof currency === 'string' &&\n supportedCurrencies.includes(currency.toLowerCase())\n );\n }\n\n /**\n * Fetches the list of supported currencies from the API.\n *\n * @returns The list of supported currencies.\n */\n async updateSupportedCurrencies(): Promise<string[]> {\n return fetchSupportedCurrencies();\n }\n}\n"]}
|
|
@@ -67,7 +67,7 @@ export declare const SPOT_PRICES_SUPPORT_INFO: {
|
|
|
67
67
|
readonly '0x74c': "eip155:1868/erc20:0x0000000000000000000000000000000000000000";
|
|
68
68
|
readonly '0xa729': "eip155:42793/erc20:0x0000000000000000000000000000000000000000";
|
|
69
69
|
readonly '0xab5': "eip155:2741/erc20:0x0000000000000000000000000000000000000000";
|
|
70
|
-
readonly '0x1079': "eip155:4217/
|
|
70
|
+
readonly '0x1079': "eip155:4217/slip44:60";
|
|
71
71
|
readonly '0x10e6': "eip155:4326/erc20:0x0000000000000000000000000000000000000000";
|
|
72
72
|
readonly '0x1388': "eip155:5000/erc20:0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000";
|
|
73
73
|
readonly '0x2105': "eip155:8453/slip44:60";
|
|
@@ -80,7 +80,7 @@ export declare const SPOT_PRICES_SUPPORT_INFO: {
|
|
|
80
80
|
readonly '0xa516': "eip155:42262/slip44:474";
|
|
81
81
|
readonly '0xa867': "eip155:43111/erc20:0x0000000000000000000000000000000000000000";
|
|
82
82
|
readonly '0xa86a': "eip155:43114/slip44:9005";
|
|
83
|
-
readonly '0xa5bf': "eip155:42431/
|
|
83
|
+
readonly '0xa5bf': "eip155:42431/slip44:60";
|
|
84
84
|
readonly '0xe708': "eip155:59144/slip44:60";
|
|
85
85
|
readonly '0xed88': "eip155:60808/erc20:0x0000000000000000000000000000000000000000";
|
|
86
86
|
readonly '0x138de': "eip155:80094/erc20:0x0000000000000000000000000000000000000000";
|
|
@@ -98,6 +98,7 @@ export declare const SPOT_PRICES_SUPPORT_INFO: {
|
|
|
98
98
|
readonly '0xdef1': "eip155:57073/slip44:60";
|
|
99
99
|
readonly '0x3dc': "eip155:988/erc20:0x779ded0c9e1022225f8e0630b35a9b54be713736";
|
|
100
100
|
readonly '0xf043a': "eip155:984122/slip44:984122";
|
|
101
|
+
readonly '0x1b58': "eip155:7000/slip44:7000";
|
|
101
102
|
};
|
|
102
103
|
/**
|
|
103
104
|
* A currency that can be supplied as the `vsCurrency` parameter to
|
|
@@ -111,7 +112,7 @@ type SupportedCurrency = (typeof SUPPORTED_CURRENCIES_FALLBACK)[number] | Upperc
|
|
|
111
112
|
*
|
|
112
113
|
* @see Used by {@link CodefiTokenPricesServiceV2} to validate that a given chain ID is supported by V2 of the Codefi Price API.
|
|
113
114
|
*/
|
|
114
|
-
export declare const SUPPORTED_CHAIN_IDS: ("0x1" | "0x89" | "0x38" | "0x2105" | "0xa" | "0xa4b1" | "0x82750" | "0x531" | "0x8f" | "0x3e7" | "0x2a" | "0x44d" | "0x64" | "0xa86a" | "0xfa" | "0x504" | "0x505" | "0x63564c40" | "0x19" | "0x7a" | "0x120" | "0x4e454152" | "0x80" | "0x440" | "0x1e" | "0xa516" | "0xa4ec" | "0x141" | "0x6a" | "0x1388" | "0xe708" | "0x39" | "0x52" | "0x15b38" | "0xa729" | "0x144" | "0xfc" | "0x28c58" | "0xc4" | "0xed88" | "0x2eb" | "0x6f0" | "0xa867" | "0x2611" | "0x15f900" | "0x74c" | "0xa3c3" | "0xab5" | "0x138de" | "0x8173" | "0xb67d2" | "0xe8" | "0x18232" | "0x32" | "0x10e6" | "0x10b3e" | "0xdef1" | "0x3dc" | "0xa5bf" | "0x1079" | "0x58" | "0x92" | "0x150" | "0x169" | "0x2710" | "0x13c31" | "0x17dcd" | "0x518af" | "0xf043a")[];
|
|
115
|
+
export declare const SUPPORTED_CHAIN_IDS: ("0x1" | "0x89" | "0x38" | "0x2105" | "0xa" | "0xa4b1" | "0x82750" | "0x531" | "0x8f" | "0x3e7" | "0x2a" | "0x44d" | "0x64" | "0xa86a" | "0xfa" | "0x504" | "0x505" | "0x63564c40" | "0x19" | "0x7a" | "0x120" | "0x4e454152" | "0x80" | "0x440" | "0x1e" | "0xa516" | "0xa4ec" | "0x141" | "0x6a" | "0x1388" | "0xe708" | "0x39" | "0x52" | "0x15b38" | "0xa729" | "0x1b58" | "0x144" | "0xfc" | "0x28c58" | "0xc4" | "0xed88" | "0x2eb" | "0x6f0" | "0xa867" | "0x2611" | "0x15f900" | "0x74c" | "0xa3c3" | "0xab5" | "0x138de" | "0x8173" | "0xb67d2" | "0xe8" | "0x18232" | "0x32" | "0x10e6" | "0x10b3e" | "0xdef1" | "0x3dc" | "0xa5bf" | "0x1079" | "0x58" | "0x92" | "0x150" | "0x169" | "0x2710" | "0x13c31" | "0x17dcd" | "0x518af" | "0xf043a")[];
|
|
115
116
|
/**
|
|
116
117
|
* A chain ID that can be supplied in the URL for the `/spot-prices` endpoint,
|
|
117
118
|
* but in hexadecimal form (for consistency with how we represent chain IDs in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codefi-v2.d.cts","sourceRoot":"","sources":["../../src/token-prices-service/codefi-v2.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,mCAAmC;AAChE,OAAO,KAAK,EAAiB,GAAG,EAAE,wBAAwB;AAS1D,OAAO,KAAK,EACV,0BAA0B,EAC1B,wBAAwB,EAExB,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EAC1B,4CAAwC;AAEzC;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,qnBA+KhC,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,oBAA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YAAY,CAAC,CAAC,GAC/C,UAAU,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IAI1C;;;;;OAKG;IACH,yBAAyB,CACvB,sBAAsB,EAAE,yBAAyB,GAChD,IAAI;IAIP;;;;;OAKG;IACG,uBAAuB,IAAI,OAAO,CAAC,yBAAyB,CAAC;IAInE;;;;;;;;OAQG;IACG,gBAAgB,CAAC,EACrB,MAAM,EACN,QAAQ,GACT,EAAE;QACD,MAAM,EAAE,wBAAwB,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACrD,QAAQ,EAAE,iBAAiB,CAAC;KAC7B,GAAG,OAAO,CAAC,sBAAsB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,EAAE,CAAC;IAyF1E;;;;;;;;OAQG;IACG,kBAAkB,CAAC,EACvB,YAAY,EACZ,cAAc,EACd,gBAAgB,GACjB,EAAE;QACD,YAAY,EAAE,iBAAiB,CAAC;QAChC,cAAc,EAAE,OAAO,CAAC;QACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;KAC5B,GAAG,OAAO,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;IA6FvD;;;;;;OAMG;IACH,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,gBAAgB;IAYvE;;;;;;;OAOG;IACH,yBAAyB,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,iBAAiB;IAQ3E;;;;OAIG;IACG,yBAAyB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAGrD"}
|
|
@@ -67,7 +67,7 @@ export declare const SPOT_PRICES_SUPPORT_INFO: {
|
|
|
67
67
|
readonly '0x74c': "eip155:1868/erc20:0x0000000000000000000000000000000000000000";
|
|
68
68
|
readonly '0xa729': "eip155:42793/erc20:0x0000000000000000000000000000000000000000";
|
|
69
69
|
readonly '0xab5': "eip155:2741/erc20:0x0000000000000000000000000000000000000000";
|
|
70
|
-
readonly '0x1079': "eip155:4217/
|
|
70
|
+
readonly '0x1079': "eip155:4217/slip44:60";
|
|
71
71
|
readonly '0x10e6': "eip155:4326/erc20:0x0000000000000000000000000000000000000000";
|
|
72
72
|
readonly '0x1388': "eip155:5000/erc20:0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000";
|
|
73
73
|
readonly '0x2105': "eip155:8453/slip44:60";
|
|
@@ -80,7 +80,7 @@ export declare const SPOT_PRICES_SUPPORT_INFO: {
|
|
|
80
80
|
readonly '0xa516': "eip155:42262/slip44:474";
|
|
81
81
|
readonly '0xa867': "eip155:43111/erc20:0x0000000000000000000000000000000000000000";
|
|
82
82
|
readonly '0xa86a': "eip155:43114/slip44:9005";
|
|
83
|
-
readonly '0xa5bf': "eip155:42431/
|
|
83
|
+
readonly '0xa5bf': "eip155:42431/slip44:60";
|
|
84
84
|
readonly '0xe708': "eip155:59144/slip44:60";
|
|
85
85
|
readonly '0xed88': "eip155:60808/erc20:0x0000000000000000000000000000000000000000";
|
|
86
86
|
readonly '0x138de': "eip155:80094/erc20:0x0000000000000000000000000000000000000000";
|
|
@@ -98,6 +98,7 @@ export declare const SPOT_PRICES_SUPPORT_INFO: {
|
|
|
98
98
|
readonly '0xdef1': "eip155:57073/slip44:60";
|
|
99
99
|
readonly '0x3dc': "eip155:988/erc20:0x779ded0c9e1022225f8e0630b35a9b54be713736";
|
|
100
100
|
readonly '0xf043a': "eip155:984122/slip44:984122";
|
|
101
|
+
readonly '0x1b58': "eip155:7000/slip44:7000";
|
|
101
102
|
};
|
|
102
103
|
/**
|
|
103
104
|
* A currency that can be supplied as the `vsCurrency` parameter to
|
|
@@ -111,7 +112,7 @@ type SupportedCurrency = (typeof SUPPORTED_CURRENCIES_FALLBACK)[number] | Upperc
|
|
|
111
112
|
*
|
|
112
113
|
* @see Used by {@link CodefiTokenPricesServiceV2} to validate that a given chain ID is supported by V2 of the Codefi Price API.
|
|
113
114
|
*/
|
|
114
|
-
export declare const SUPPORTED_CHAIN_IDS: ("0x1" | "0x89" | "0x38" | "0x2105" | "0xa" | "0xa4b1" | "0x82750" | "0x531" | "0x8f" | "0x3e7" | "0x2a" | "0x44d" | "0x64" | "0xa86a" | "0xfa" | "0x504" | "0x505" | "0x63564c40" | "0x19" | "0x7a" | "0x120" | "0x4e454152" | "0x80" | "0x440" | "0x1e" | "0xa516" | "0xa4ec" | "0x141" | "0x6a" | "0x1388" | "0xe708" | "0x39" | "0x52" | "0x15b38" | "0xa729" | "0x144" | "0xfc" | "0x28c58" | "0xc4" | "0xed88" | "0x2eb" | "0x6f0" | "0xa867" | "0x2611" | "0x15f900" | "0x74c" | "0xa3c3" | "0xab5" | "0x138de" | "0x8173" | "0xb67d2" | "0xe8" | "0x18232" | "0x32" | "0x10e6" | "0x10b3e" | "0xdef1" | "0x3dc" | "0xa5bf" | "0x1079" | "0x58" | "0x92" | "0x150" | "0x169" | "0x2710" | "0x13c31" | "0x17dcd" | "0x518af" | "0xf043a")[];
|
|
115
|
+
export declare const SUPPORTED_CHAIN_IDS: ("0x1" | "0x89" | "0x38" | "0x2105" | "0xa" | "0xa4b1" | "0x82750" | "0x531" | "0x8f" | "0x3e7" | "0x2a" | "0x44d" | "0x64" | "0xa86a" | "0xfa" | "0x504" | "0x505" | "0x63564c40" | "0x19" | "0x7a" | "0x120" | "0x4e454152" | "0x80" | "0x440" | "0x1e" | "0xa516" | "0xa4ec" | "0x141" | "0x6a" | "0x1388" | "0xe708" | "0x39" | "0x52" | "0x15b38" | "0xa729" | "0x1b58" | "0x144" | "0xfc" | "0x28c58" | "0xc4" | "0xed88" | "0x2eb" | "0x6f0" | "0xa867" | "0x2611" | "0x15f900" | "0x74c" | "0xa3c3" | "0xab5" | "0x138de" | "0x8173" | "0xb67d2" | "0xe8" | "0x18232" | "0x32" | "0x10e6" | "0x10b3e" | "0xdef1" | "0x3dc" | "0xa5bf" | "0x1079" | "0x58" | "0x92" | "0x150" | "0x169" | "0x2710" | "0x13c31" | "0x17dcd" | "0x518af" | "0xf043a")[];
|
|
115
116
|
/**
|
|
116
117
|
* A chain ID that can be supplied in the URL for the `/spot-prices` endpoint,
|
|
117
118
|
* but in hexadecimal form (for consistency with how we represent chain IDs in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codefi-v2.d.mts","sourceRoot":"","sources":["../../src/token-prices-service/codefi-v2.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,mCAAmC;AAChE,OAAO,KAAK,EAAiB,GAAG,EAAE,wBAAwB;AAS1D,OAAO,KAAK,EACV,0BAA0B,EAC1B,wBAAwB,EAExB,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EAC1B,4CAAwC;AAEzC;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,qnBA+KhC,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,oBAAoB,qnBAAgC,CAAC;AAElE;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,GAC4B,CAAC;
|
|
1
|
+
{"version":3,"file":"codefi-v2.d.mts","sourceRoot":"","sources":["../../src/token-prices-service/codefi-v2.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,mCAAmC;AAChE,OAAO,KAAK,EAAiB,GAAG,EAAE,wBAAwB;AAS1D,OAAO,KAAK,EACV,0BAA0B,EAC1B,wBAAwB,EAExB,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EAC1B,4CAAwC;AAEzC;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,qnBA+KhC,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,oBAAoB,qnBAAgC,CAAC;AAElE;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,GAC4B,CAAC;AAexD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,YAAa,GAAG,KAAG,GACC,CAAC;AAIvD,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuE3B,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C,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,gBAAgB;IAYvE;;;;;;;OAOG;IACH,yBAAyB,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,iBAAiB;IAQ3E;;;;OAIG;IACG,yBAAyB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAGrD"}
|
|
@@ -216,8 +216,6 @@ const chainIdToNativeTokenAddress = {
|
|
|
216
216
|
'0x64': '0xe91d153e0b41518a2ce8dd3d7944fa863463a97d', // Gnosis
|
|
217
217
|
'0x1e': '0x542fda317318ebf1d3deaf76e0b632741a7e677d', // Rootstock Mainnet - Native symbol: RBTC
|
|
218
218
|
'0x3dc': '0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0
|
|
219
|
-
'0x1079': '0x20c0000000000000000000000000000000000000', // Tempo Mainnet - Pseudo-Native symbol: pathUSD
|
|
220
|
-
'0xa5bf': '0x20c0000000000000000000000000000000000000', // Tempo Moderato Testnet - Pseudo-Native symbol: pathUSD
|
|
221
219
|
};
|
|
222
220
|
/**
|
|
223
221
|
* Returns the address that should be used to query the price api for the
|
|
@@ -269,7 +267,7 @@ export const SPOT_PRICES_SUPPORT_INFO = {
|
|
|
269
267
|
'0x74c': 'eip155:1868/erc20:0x0000000000000000000000000000000000000000', // Soneium - Native symbol: ETH
|
|
270
268
|
'0xa729': 'eip155:42793/erc20:0x0000000000000000000000000000000000000000', // Etherlink - Native symbol: XTZ (Tezos L2)
|
|
271
269
|
'0xab5': 'eip155:2741/erc20:0x0000000000000000000000000000000000000000', // Abstract - Native symbol: ETH
|
|
272
|
-
'0x1079': 'eip155:4217/
|
|
270
|
+
'0x1079': 'eip155:4217/slip44:60', // Tempo Mainnet - No native asset
|
|
273
271
|
'0x10e6': 'eip155:4326/erc20:0x0000000000000000000000000000000000000000', // MegaETH Mainnet - Native symbol: ETH
|
|
274
272
|
'0x1388': 'eip155:5000/erc20:0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Mantle - Native symbol: MNT
|
|
275
273
|
'0x2105': 'eip155:8453/slip44:60', // Base - Native symbol: ETH
|
|
@@ -282,7 +280,7 @@ export const SPOT_PRICES_SUPPORT_INFO = {
|
|
|
282
280
|
'0xa516': 'eip155:42262/slip44:474', // Oasis Emerald - Native symbol: ROSE
|
|
283
281
|
'0xa867': 'eip155:43111/erc20:0x0000000000000000000000000000000000000000', // Hemi - Native symbol: ETH
|
|
284
282
|
'0xa86a': 'eip155:43114/slip44:9005', // Avalanche C-Chain - Native symbol: AVAX
|
|
285
|
-
'0xa5bf': 'eip155:42431/
|
|
283
|
+
'0xa5bf': 'eip155:42431/slip44:60', // Tempo Testnet Moderato - No native asset
|
|
286
284
|
'0xe708': 'eip155:59144/slip44:60', // Linea Mainnet - Native symbol: ETH
|
|
287
285
|
'0xed88': 'eip155:60808/erc20:0x0000000000000000000000000000000000000000', // BOB - Native symbol: ETH
|
|
288
286
|
'0x138de': 'eip155:80094/erc20:0x0000000000000000000000000000000000000000', // Berachain - Native symbol: Bera',
|
|
@@ -300,6 +298,7 @@ export const SPOT_PRICES_SUPPORT_INFO = {
|
|
|
300
298
|
'0xdef1': 'eip155:57073/slip44:60', // Ink Mainnet - Native symbol: ETH
|
|
301
299
|
'0x3dc': 'eip155:988/erc20:0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0
|
|
302
300
|
'0xf043a': 'eip155:984122/slip44:984122', // Forma - Native symbol: TIA (Celestia)
|
|
301
|
+
'0x1b58': 'eip155:7000/slip44:7000', // ZetaChain - Native symbol: ZETA
|
|
303
302
|
};
|
|
304
303
|
/**
|
|
305
304
|
* The list of chain IDs that can be supplied in the URL for the `/spot-prices`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codefi-v2.mjs","sourceRoot":"","sources":["../../src/token-prices-service/codefi-v2.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAC9B,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AErD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;OAMG;IACH,wBAAwB,CAAC,OAAgB;QACvC,6CAA6C;QAC7C,MAAM,iBAAiB,GAAG,2BAA2B,EAAE,CAAC;QACxD,uEAAuE;QACvE,MAAM,oBAAoB,GAAsB;YAC9C,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,iBAAiB,EAAE,GAAG,mBAAmB,CAAC,CAAC;SAC3D,CAAC;QACF,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ,IAAI,oBAAoB,CAAC,QAAQ,CAAC,OAAO,CAAC,CACtE,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,yBAAyB,CAAC,QAAiB;QACzC,MAAM,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;QACrD,OAAO,CACL,OAAO,QAAQ,KAAK,QAAQ;YAC5B,mBAAmB,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CACrD,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,yBAAyB;QAC7B,OAAO,wBAAwB,EAAE,CAAC;IACpC,CAAC;CACF","sourcesContent":["import {\n createServicePolicy,\n DEFAULT_CIRCUIT_BREAK_DURATION,\n DEFAULT_DEGRADED_THRESHOLD,\n DEFAULT_MAX_CONSECUTIVE_FAILURES,\n DEFAULT_MAX_RETRIES,\n handleFetch,\n} from '@metamask/controller-utils';\nimport type { ServicePolicy } from '@metamask/controller-utils';\nimport type { CaipAssetType, Hex } from '@metamask/utils';\nimport {\n hexToNumber,\n KnownCaipNamespace,\n numberToHex,\n toCaipChainId,\n} from '@metamask/utils';\n\nimport type { MarketDataDetails } from '../TokenRatesController';\nimport type {\n AbstractTokenPricesService,\n EvmAssetAddressWithChain,\n EvmAssetWithId,\n EvmAssetWithMarketData,\n ExchangeRatesByCurrency,\n NativeAssetIdentifiersMap,\n} from './abstract-token-prices-service';\n\n/**\n * The list of currencies that can be supplied as the `vsCurrency` parameter to\n * the `/spot-prices` endpoint, in lowercase form.\n * This is the fallback list used when the API is unavailable.\n */\nexport const SUPPORTED_CURRENCIES_FALLBACK = [\n // Bitcoin\n 'btc',\n // Ether\n 'eth',\n // Litecoin\n 'ltc',\n // Bitcoin Cash\n 'bch',\n // Binance Coin\n 'bnb',\n // EOS\n 'eos',\n // XRP\n 'xrp',\n // Lumens\n 'xlm',\n // Chainlink\n 'link',\n // Polkadot\n 'dot',\n // Yearn.finance\n 'yfi',\n // US Dollar\n 'usd',\n // United Arab Emirates Dirham\n 'aed',\n // Argentine Peso\n 'ars',\n // Australian Dollar\n 'aud',\n // Bangladeshi Taka\n 'bdt',\n // Bahraini Dinar\n 'bhd',\n // Bermudian Dollar\n 'bmd',\n // Brazil Real\n 'brl',\n // Canadian Dollar\n 'cad',\n // Swiss Franc\n 'chf',\n // Chilean Peso\n 'clp',\n // Chinese Yuan\n 'cny',\n // Czech Koruna\n 'czk',\n // Danish Krone\n 'dkk',\n // Euro\n 'eur',\n // British Pound Sterling\n 'gbp',\n // Georgian Lari\n 'gel',\n // Hong Kong Dollar\n 'hkd',\n // Hungarian Forint\n 'huf',\n // Indonesian Rupiah\n 'idr',\n // Israeli New Shekel\n 'ils',\n // Indian Rupee\n 'inr',\n // Japanese Yen\n 'jpy',\n // South Korean Won\n 'krw',\n // Kuwaiti Dinar\n 'kwd',\n // Sri Lankan Rupee\n 'lkr',\n // Burmese Kyat\n 'mmk',\n // Mexican Peso\n 'mxn',\n // Malaysian Ringgit\n 'myr',\n // Monad\n 'mon',\n // Nigerian Naira\n 'ngn',\n // Norwegian Krone\n 'nok',\n // New Zealand Dollar\n 'nzd',\n // Philippine Peso\n 'php',\n // Pakistani Rupee\n 'pkr',\n // Polish Zloty\n 'pln',\n // Russian Ruble\n 'rub',\n // Saudi Riyal\n 'sar',\n // Swedish Krona\n 'sek',\n // Singapore Dollar\n 'sgd',\n // Thai Baht\n 'thb',\n // Turkish Lira\n 'try',\n // New Taiwan Dollar\n 'twd',\n // Ukrainian hryvnia\n 'uah',\n // Venezuelan bolívar fuerte\n 'vef',\n // Vietnamese đồng\n 'vnd',\n // South African Rand\n 'zar',\n // IMF Special Drawing Rights\n 'xdr',\n // Silver - Troy Ounce\n 'xag',\n // Gold - Troy Ounce\n 'xau',\n // Bits\n 'bits',\n // Satoshi\n 'sats',\n // Colombian Peso\n 'cop',\n // Kenyan Shilling\n 'kes',\n // Romanian Leu\n 'ron',\n // Dominican Peso\n 'dop',\n // Costa Rican Colón\n 'crc',\n // Honduran Lempira\n 'hnl',\n // Zambian Kwacha\n 'zmw',\n // Salvadoran Colón\n 'svc',\n // Bosnia-Herzegovina Convertible Mark\n 'bam',\n // Peruvian Sol\n 'pen',\n // Guatemalan Quetzal\n 'gtq',\n // Lebanese Pound\n 'lbp',\n // Armenian Dram\n 'amd',\n // Solana\n 'sol',\n // Sei\n 'sei',\n // Sonic\n 'sonic',\n // Tron\n 'trx',\n // Taiko\n 'taiko',\n // Pepu\n 'pepu',\n // Polygon\n 'pol',\n // Mantle\n 'mnt',\n // Onomy\n 'nom',\n // Avalanche\n 'avax',\n // Apechain\n 'ape',\n] as const;\n\n/**\n * @deprecated Use `getSupportedCurrencies()` or `fetchSupportedCurrencies()` instead.\n * This is an alias for backward compatibility.\n */\nexport const SUPPORTED_CURRENCIES = SUPPORTED_CURRENCIES_FALLBACK;\n\n/**\n * Represents the zero address, commonly used as a placeholder in blockchain transactions.\n * In the context of fetching market data, the zero address is utilized to retrieve information\n * specifically for native currencies. This allows for a standardized approach to query market\n * data for blockchain-native assets without a specific contract address.\n */\nexport const ZERO_ADDRESS: Hex =\n '0x0000000000000000000000000000000000000000' as const;\n\n/**\n * A mapping from chain id to the address of the chain's native token.\n * Only for chains whose native tokens have a specific address.\n */\nconst chainIdToNativeTokenAddress: Record<Hex, Hex> = {\n '0x89': '0x0000000000000000000000000000000000001010', // Polygon\n '0x440': '0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Metis Andromeda\n '0x1388': '0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Mantle\n '0x64': '0xe91d153e0b41518a2ce8dd3d7944fa863463a97d', // Gnosis\n '0x1e': '0x542fda317318ebf1d3deaf76e0b632741a7e677d', // Rootstock Mainnet - Native symbol: RBTC\n '0x3dc': '0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0\n '0x1079': '0x20c0000000000000000000000000000000000000', // Tempo Mainnet - Pseudo-Native symbol: pathUSD\n '0xa5bf': '0x20c0000000000000000000000000000000000000', // Tempo Moderato Testnet - Pseudo-Native symbol: pathUSD\n};\n\n/**\n * Returns the address that should be used to query the price api for the\n * chain's native token. On most chains, this is signified by the zero address.\n * But on some chains, the native token has a specific address.\n *\n * @param chainId - The hexadecimal chain id.\n * @returns The address of the chain's native token.\n */\nexport const getNativeTokenAddress = (chainId: Hex): Hex =>\n chainIdToNativeTokenAddress[chainId] ?? ZERO_ADDRESS;\n\n// Source: https://github.com/consensys-vertical-apps/va-mmcx-price-api/blob/main/src/constants/slip44.ts\n// We can only support PricesAPI V3 for EVM chains that have a CAIP-19 native asset mapping.\nexport const SPOT_PRICES_SUPPORT_INFO = {\n '0x1': 'eip155:1/slip44:60', // Ethereum Mainnet - Native symbol: ETH\n '0xa': 'eip155:10/slip44:60', // OP Mainnet - Native symbol: ETH\n '0x19': 'eip155:25/slip44:394', // Cronos Mainnet - Native symbol: CRO\n '0x1e': 'eip155:30/slip44:137', // Rootstock Mainnet - Native symbol: RBTC\n '0x2a': 'eip155:42/erc20:0x0000000000000000000000000000000000000000', // Lukso - native symbol: LYX\n '0x32': 'eip155:50/erc20:0x0000000000000000000000000000000000000000', // xdc-network - native symbol: XDC\n '0x38': 'eip155:56/slip44:714', // BNB Smart Chain Mainnet - Native symbol: BNB\n '0x39': 'eip155:57/slip44:57', // Syscoin Mainnet - Native symbol: SYS\n '0x52': 'eip155:82/slip44:18000', // Meter Mainnet - Native symbol: MTR\n '0x58': 'eip155:88/slip44:889', // TomoChain - Native symbol: TOMO\n '0x64': 'eip155:100/slip44:700', // Gnosis (formerly xDAI Chain) - Native symbol: xDAI\n '0x6a': 'eip155:106/slip44:5655640', // Velas EVM Mainnet - Native symbol: VLX\n '0x7a': 'eip155:122/erc20:0x0000000000000000000000000000000000000000', // Fuse Mainnet - Native symbol: FUSE\n '0x80': 'eip155:128/slip44:1010', // Huobi ECO Chain Mainnet - Native symbol: HT\n '0x89': 'eip155:137/slip44:966', // Polygon Mainnet - Native symbol: POL\n '0x8f': 'eip155:143/slip44:268435779', // Monad Mainnet - Native symbol: MON\n '0x92': 'eip155:146/slip44:10007', // Sonic Mainnet - Native symbol: S\n '0xc4': 'eip155:196/erc20:0x0000000000000000000000000000000000000000', // X Layer Mainnet - Native symbol: OKB\n '0xe8': 'eip155:232/erc20:0x0000000000000000000000000000000000000000', // Lens Mainnet - Native symbol: GHO\n '0xfa': 'eip155:250/slip44:1007', // Fantom Opera - Native symbol: FTM\n '0xfc': 'eip155:252/erc20:0x0000000000000000000000000000000000000000', // Fraxtal - native symbol: FRAX\n '0x10b3e': 'eip155:68414/erc20:0x0000000000000000000000000000000000000000', // MapleStory Universe - no slip44\n '0x120': 'eip155:288/slip44:60', // Boba Network (Ethereum L2) - Native symbol: ETH\n '0x141': 'eip155:321/slip44:641', // KCC Mainnet - Native symbol: KCS\n '0x144': 'eip155:324/slip44:60', // zkSync Era Mainnet (Ethereum L2) - Native symbol: ETH\n '0x150': 'eip155:336/slip44:809', // Shiden - Native symbol: SDN\n '0x169': 'eip155:361/slip44:589', // Theta Mainnet - Native symbol: TFUEL\n '0x2eb': 'eip155:747/slip44:539', // Flow evm - Native symbol: Flow\n '0x3e7': 'eip155:999/slip44:2457', // HyperEVM - Native symbol: HYPE\n '0x440': 'eip155:1088/erc20:0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Metis Andromeda Mainnet (Ethereum L2) - Native symbol: METIS\n '0x44d': 'eip155:1101/slip44:60', // Polygon zkEVM mainnet - Native symbol: ETH\n '0x504': 'eip155:1284/slip44:1284', // Moonbeam - Native symbol: GLMR\n '0x505': 'eip155:1285/slip44:1285', // Moonriver - Native symbol: MOVR\n '0x531': 'eip155:1329/slip44:19000118', // Sei Mainnet - Native symbol: SEI\n '0x6f0': 'eip155:1776/slip44:22000119', // Injective Mainnet - Native symbol: INJ\n '0x74c': 'eip155:1868/erc20:0x0000000000000000000000000000000000000000', // Soneium - Native symbol: ETH\n '0xa729': 'eip155:42793/erc20:0x0000000000000000000000000000000000000000', // Etherlink - Native symbol: XTZ (Tezos L2)\n '0xab5': 'eip155:2741/erc20:0x0000000000000000000000000000000000000000', // Abstract - Native symbol: ETH\n '0x1079': 'eip155:4217/erc20:0x20c0000000000000000000000000000000000000', // Tempo Mainnet - Pseudo-Native symbol: pathUSD\n '0x10e6': 'eip155:4326/erc20:0x0000000000000000000000000000000000000000', // MegaETH Mainnet - Native symbol: ETH\n '0x1388': 'eip155:5000/erc20:0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Mantle - Native symbol: MNT\n '0x2105': 'eip155:8453/slip44:60', // Base - Native symbol: ETH\n '0x2611': 'eip155:9745/erc20:0x0000000000000000000000000000000000000000', // Plasma mainnet - native symbol: XPL\n '0x2710': 'eip155:10000/slip44:145', // Smart Bitcoin Cash - Native symbol: BCH\n '0x8173': 'eip155:33139/erc20:0x0000000000000000000000000000000000000000', // Apechain Mainnet - Native symbol: APE\n '0xa3c3': 'eip155:41923/erc20:0x0000000000000000000000000000000000000000', // EDU Chain - Native symbol: EDU\n '0xa4b1': 'eip155:42161/slip44:60', // Arbitrum One - Native symbol: ETH\n '0xa4ec': 'eip155:42220/slip44:52752', // Celo Mainnet - Native symbol: CELO\n '0xa516': 'eip155:42262/slip44:474', // Oasis Emerald - Native symbol: ROSE\n '0xa867': 'eip155:43111/erc20:0x0000000000000000000000000000000000000000', // Hemi - Native symbol: ETH\n '0xa86a': 'eip155:43114/slip44:9005', // Avalanche C-Chain - Native symbol: AVAX\n '0xa5bf': 'eip155:42431/erc20:0x20c0000000000000000000000000000000000000', // Tempo Testnet Moderato - Pseudo-Native symbol: pathUSD\n '0xe708': 'eip155:59144/slip44:60', // Linea Mainnet - Native symbol: ETH\n '0xed88': 'eip155:60808/erc20:0x0000000000000000000000000000000000000000', // BOB - Native symbol: ETH\n '0x138de': 'eip155:80094/erc20:0x0000000000000000000000000000000000000000', // Berachain - Native symbol: Bera',\n '0x13c31': 'eip155:81457/slip44:60', // Blast Mainnet - Native symbol: ETH\n '0x15b38': 'eip155:88888/erc20:0x0000000000000000000000000000000000000000', // Chiliz Chain - Native symbol: CHZ\n '0x17dcd': 'eip155:97741/erc20:0x0000000000000000000000000000000000000000', // Pepe Unchained Mainnet - Native symbol: PEPU\n '0x18232': 'eip155:98866/erc20:0x0000000000000000000000000000000000000000', // Plume Mainnet - Narive symbol: Plume\n '0x28c58': 'eip155:167000/slip44:60', // Taiko Mainnet - Native symbol: ETH\n '0x518af': 'eip155:333999/slip44:1997', // Polis Mainnet - Native symbol: POLIS\n '0x82750': 'eip155:534352/slip44:60', // Scroll Mainnet - Native symbol: ETH\n '0xb67d2': 'eip155:747474/erc20:0x0000000000000000000000000000000000000000', // katana - Native symbol: ETH\n '0x15f900': 'eip155:1440000/erc20:0x0000000000000000000000000000000000000000', // xrpl-evm - native symbol: XRP\n '0x4e454152': 'eip155:1313161554/slip44:60', // Aurora Mainnet (Ethereum L2 on NEAR) - Native symbol: ETH\n '0x63564c40': 'eip155:1666600000/slip44:1023', // Harmony Mainnet Shard 0 - Native symbol: ONE\n '0xdef1': 'eip155:57073/slip44:60', // Ink Mainnet - Native symbol: ETH\n '0x3dc': 'eip155:988/erc20:0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0\n '0xf043a': 'eip155:984122/slip44:984122', // Forma - Native symbol: TIA (Celestia)\n} as const;\n\n// MISSING CHAINS WITH NO NATIVE ASSET PRICES\n// '0x42': 'eip155:66/slip44:996', // OKXChain Mainnet - Native symbol: OKT\n// '0x46': 'eip155:70/slip44:1170', // Hoo Smart Chain - Native symbol: HOO\n// '0x926': 'eip155:2342/erc20:0x0000000000000000000000000000000000000000', // Omnia Chain - Native symbol: OMNIA\n// '0x407b': 'eip155:16507/erc20:0x0000000000000000000000000000000000000000', // Genesys Mainnet - Native symbol: GSYS\n\n/**\n * A currency that can be supplied as the `vsCurrency` parameter to\n * the `/spot-prices` endpoint. Covers both uppercase and lowercase versions.\n */\ntype SupportedCurrency =\n | (typeof SUPPORTED_CURRENCIES_FALLBACK)[number]\n | Uppercase<(typeof SUPPORTED_CURRENCIES_FALLBACK)[number]>;\n\n/**\n * The list of chain IDs that can be supplied in the URL for the `/spot-prices`\n * endpoint, but in hexadecimal form (for consistency with how we represent\n * chain IDs in other places).\n *\n * @see Used by {@link CodefiTokenPricesServiceV2} to validate that a given chain ID is supported by V2 of the Codefi Price API.\n */\nexport const SUPPORTED_CHAIN_IDS = Object.keys(\n SPOT_PRICES_SUPPORT_INFO,\n) as (keyof typeof SPOT_PRICES_SUPPORT_INFO)[];\n\n/**\n * A chain ID that can be supplied in the URL for the `/spot-prices` endpoint,\n * but in hexadecimal form (for consistency with how we represent chain IDs in\n * other places).\n */\ntype SupportedChainId = (typeof SUPPORTED_CHAIN_IDS)[number];\n\nconst BASE_URL_V1 = 'https://price.api.cx.metamask.io/v1';\n\nconst BASE_URL_V2 = 'https://price.api.cx.metamask.io/v2';\n\nconst BASE_URL_V3 = 'https://price.api.cx.metamask.io/v3';\n\n/**\n * Response type for the /v2/supportedNetworks endpoint.\n */\ntype SupportedNetworksResponse = {\n fullSupport: string[];\n partialSupport: {\n spotPricesV2: string[];\n spotPricesV3: string[];\n };\n};\n\n/**\n * In-memory store for the last successfully fetched supported networks.\n */\nlet lastFetchedSupportedNetworks: SupportedNetworksResponse | null = null;\n\n/**\n * In-flight promise to prevent concurrent requests to the supported networks endpoint.\n */\nlet runningSupportedNetworksRequest: Promise<SupportedNetworksResponse> | null =\n null;\n\n/**\n * Converts a CAIP-2 chain ID (e.g., 'eip155:1') to a hex chain ID (e.g., '0x1').\n *\n * @param caipChainId - The CAIP-2 chain ID string.\n * @returns The hex chain ID or null if not an EIP-155 chain.\n */\nfunction caipChainIdToHex(caipChainId: string): Hex | null {\n const match = caipChainId.match(/^eip155:(\\d+)$/u);\n if (!match) {\n return null;\n }\n return numberToHex(parseInt(match[1], 10));\n}\n\n/**\n * Executes the actual fetch to the supported networks endpoint.\n * Handles errors internally by falling back to the hardcoded list,\n * and clears the in-flight promise when done.\n *\n * @returns The supported networks response.\n */\nasync function executeSupportedNetworksFetch(): Promise<SupportedNetworksResponse> {\n try {\n const url = `${BASE_URL_V2}/supportedNetworks`;\n const response = await handleFetch(url, {\n headers: { 'Cache-Control': 'no-cache' },\n });\n\n if (\n response &&\n typeof response === 'object' &&\n 'fullSupport' in response &&\n 'partialSupport' in response\n ) {\n lastFetchedSupportedNetworks = response as SupportedNetworksResponse;\n return lastFetchedSupportedNetworks;\n }\n\n // Invalid response format, fall back to hardcoded list\n return getSupportedNetworksFallback();\n } catch {\n // On any error, fall back to the hardcoded list\n return getSupportedNetworksFallback();\n } finally {\n // Clear the in-flight promise once the request completes\n runningSupportedNetworksRequest = null;\n }\n}\n\n/**\n * Fetches the list of supported networks from the API.\n * Falls back to the hardcoded list if the fetch fails.\n * Deduplicates concurrent requests by returning the same promise if a fetch is already in progress.\n *\n * @returns The supported networks response.\n */\nexport async function fetchSupportedNetworks(): Promise<SupportedNetworksResponse> {\n // If a fetch is already in progress, return the same promise\n if (runningSupportedNetworksRequest) {\n return runningSupportedNetworksRequest;\n }\n\n // Start a new fetch and cache the promise\n runningSupportedNetworksRequest = executeSupportedNetworksFetch();\n\n return runningSupportedNetworksRequest;\n}\n\n/**\n * Synchronously gets the list of supported networks.\n * Returns the last fetched value if available, otherwise returns the fallback list.\n *\n * @returns The supported networks response.\n */\nexport function getSupportedNetworks(): SupportedNetworksResponse {\n if (lastFetchedSupportedNetworks !== null) {\n return lastFetchedSupportedNetworks;\n }\n return getSupportedNetworksFallback();\n}\n\n/**\n * Generates a fallback supported networks response from the hardcoded SPOT_PRICES_SUPPORT_INFO.\n *\n * @returns A SupportedNetworksResponse derived from hardcoded data.\n */\nfunction getSupportedNetworksFallback(): SupportedNetworksResponse {\n const caipChainIds = Object.keys(SPOT_PRICES_SUPPORT_INFO).map((hexChainId) =>\n toCaipChainId(\n KnownCaipNamespace.Eip155,\n hexToNumber(hexChainId as Hex).toString(),\n ),\n );\n\n return {\n fullSupport: caipChainIds.slice(0, 11), // First 11 chains as \"full support\"\n partialSupport: {\n spotPricesV2: caipChainIds,\n spotPricesV3: caipChainIds,\n },\n };\n}\n\n/**\n * Resets the supported networks cache.\n * This is primarily intended for testing purposes.\n */\nexport function resetSupportedNetworksCache(): void {\n lastFetchedSupportedNetworks = null;\n runningSupportedNetworksRequest = null;\n}\n\n/**\n * Gets the list of supported chain IDs for spot prices v3 as hex values.\n *\n * @returns Array of hex chain IDs supported by spot prices v3.\n */\nfunction getSupportedChainIdsV3AsHex(): Hex[] {\n const supportedNetworks = getSupportedNetworks();\n const allV3Chains = [\n ...supportedNetworks.fullSupport,\n ...supportedNetworks.partialSupport.spotPricesV3,\n ];\n\n return allV3Chains\n .map(caipChainIdToHex)\n .filter((hexChainId): hexChainId is Hex => hexChainId !== null);\n}\n\n/**\n * In-memory store for the last successfully fetched supported currencies.\n */\nlet lastFetchedCurrencies: string[] | null = null;\n\n/**\n * Fetches the list of supported currencies from the API.\n * Falls back to the hardcoded list if the fetch fails.\n *\n * @returns The list of supported currencies in lowercase.\n */\nexport async function fetchSupportedCurrencies(): Promise<string[]> {\n try {\n const url = `${BASE_URL_V1}/supportedVsCurrencies`;\n const response = await handleFetch(url, {\n headers: { 'Cache-Control': 'no-cache' },\n });\n\n if (Array.isArray(response)) {\n const currencies = response.map((currency: string) =>\n currency.toLowerCase(),\n );\n lastFetchedCurrencies = currencies;\n return currencies;\n }\n\n // Invalid response format, fall back to hardcoded list\n return [...SUPPORTED_CURRENCIES_FALLBACK];\n } catch {\n // On any error, fall back to the hardcoded list\n return [...SUPPORTED_CURRENCIES_FALLBACK];\n }\n}\n\n/**\n * Synchronously gets the list of supported currencies.\n * Returns the last fetched value if available, otherwise returns the fallback list.\n *\n * @returns The list of supported currencies in lowercase.\n */\nexport function getSupportedCurrencies(): readonly string[] {\n if (lastFetchedCurrencies !== null) {\n return lastFetchedCurrencies;\n }\n return SUPPORTED_CURRENCIES_FALLBACK;\n}\n\n/**\n * Resets the supported currencies cache.\n * This is primarily intended for testing purposes.\n */\nexport function resetSupportedCurrenciesCache(): void {\n lastFetchedCurrencies = null;\n}\n\n/**\n * This version of the token prices service uses V2 of the Codefi Price API to\n * fetch token prices.\n */\nexport class CodefiTokenPricesServiceV2 implements AbstractTokenPricesService<\n SupportedChainId,\n SupportedCurrency\n> {\n readonly #policy: ServicePolicy;\n\n /**\n * Map of CAIP-2 chain IDs to their native asset identifiers.\n * Updated via setNativeAssetIdentifiers().\n */\n #nativeAssetIdentifiers: NativeAssetIdentifiersMap = {};\n\n /**\n * Construct a Codefi Token Price Service.\n *\n * @param args - The arguments.\n * @param args.degradedThreshold - The length of time (in milliseconds)\n * that governs when the service is regarded as degraded (affecting when\n * `onDegraded` is called). Defaults to 5 seconds.\n * @param args.retries - Number of retry attempts for each fetch request.\n * @param args.maximumConsecutiveFailures - The maximum number of consecutive\n * failures allowed before breaking the circuit and pausing further updates.\n * @param args.circuitBreakDuration - The amount of time to wait when the\n * circuit breaks from too many consecutive failures.\n */\n constructor(args?: {\n degradedThreshold?: number;\n retries?: number;\n maximumConsecutiveFailures?: number;\n circuitBreakDuration?: number;\n });\n\n /**\n * Construct a Codefi Token Price Service.\n *\n * @deprecated This signature is deprecated; please use the `onBreak` and\n * `onDegraded` methods instead.\n * @param args - The arguments.\n * @param args.degradedThreshold - The length of time (in milliseconds)\n * that governs when the service is regarded as degraded (affecting when\n * `onDegraded` is called). Defaults to 5 seconds.\n * @param args.retries - Number of retry attempts for each fetch request.\n * @param args.maximumConsecutiveFailures - The maximum number of consecutive\n * failures allowed before breaking the circuit and pausing further updates.\n * @param args.onBreak - Callback for when the circuit breaks, useful\n * for capturing metrics about network failures.\n * @param args.onDegraded - Callback for when the API responds successfully\n * but takes too long to respond (5 seconds or more).\n * @param args.circuitBreakDuration - The amount of time to wait when the\n * circuit breaks from too many consecutive failures.\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n constructor(args?: {\n degradedThreshold?: number;\n retries?: number;\n maximumConsecutiveFailures?: number;\n onBreak?: () => void;\n onDegraded?: () => void;\n circuitBreakDuration?: number;\n });\n\n constructor({\n degradedThreshold = DEFAULT_DEGRADED_THRESHOLD,\n retries = DEFAULT_MAX_RETRIES,\n maximumConsecutiveFailures = DEFAULT_MAX_CONSECUTIVE_FAILURES,\n onBreak,\n onDegraded,\n circuitBreakDuration = DEFAULT_CIRCUIT_BREAK_DURATION,\n }: {\n degradedThreshold?: number;\n retries?: number;\n maximumConsecutiveFailures?: number;\n onBreak?: () => void;\n onDegraded?: () => void;\n circuitBreakDuration?: number;\n } = {}) {\n this.#policy = createServicePolicy({\n maxRetries: retries,\n maxConsecutiveFailures: maximumConsecutiveFailures,\n circuitBreakDuration,\n degradedThreshold,\n });\n if (onBreak) {\n this.#policy.onBreak(onBreak);\n }\n if (onDegraded) {\n this.#policy.onDegraded(onDegraded);\n }\n }\n\n /**\n * Listens for when the request to the API fails too many times in a row.\n *\n * @param args - The same arguments that {@link ServicePolicy.onBreak}\n * takes.\n * @returns What {@link ServicePolicy.onBreak} returns.\n */\n onBreak(\n ...args: Parameters<ServicePolicy['onBreak']>\n ): ReturnType<ServicePolicy['onBreak']> {\n return this.#policy.onBreak(...args);\n }\n\n /**\n * Listens for when the API is degraded.\n *\n * @param args - The same arguments that {@link ServicePolicy.onDegraded}\n * takes.\n * @returns What {@link ServicePolicy.onDegraded} returns.\n */\n onDegraded(\n ...args: Parameters<ServicePolicy['onDegraded']>\n ): ReturnType<ServicePolicy['onDegraded']> {\n return this.#policy.onDegraded(...args);\n }\n\n /**\n * Sets the native asset identifiers map for resolving native token CAIP-19 IDs.\n * This should be called with data from NetworkEnablementController.state.nativeAssetIdentifiers.\n *\n * @param nativeAssetIdentifiers - Map of CAIP-2 chain IDs to native asset identifiers.\n */\n setNativeAssetIdentifiers(\n nativeAssetIdentifiers: NativeAssetIdentifiersMap,\n ): void {\n this.#nativeAssetIdentifiers = nativeAssetIdentifiers;\n }\n\n /**\n * Updates the supported networks cache by fetching from the API.\n * This should be called periodically to keep the supported networks list fresh.\n *\n * @returns The updated supported networks response.\n */\n async updateSupportedNetworks(): Promise<SupportedNetworksResponse> {\n return fetchSupportedNetworks();\n }\n\n /**\n * Retrieves prices in the given currency for the tokens identified by the\n * given addresses which are expected to live on the given chain.\n *\n * @param args - The arguments to function.\n * @param args.assets - The assets to get prices for.\n * @param args.currency - The desired currency of the token prices.\n * @returns The prices for the requested tokens.\n */\n async fetchTokenPrices({\n assets,\n currency,\n }: {\n assets: EvmAssetAddressWithChain<SupportedChainId>[];\n currency: SupportedCurrency;\n }): Promise<EvmAssetWithMarketData<SupportedChainId, SupportedCurrency>[]> {\n // Refresh supported networks in background (non-blocking)\n // This ensures the list stays fresh during normal polling\n // Note: fetchSupportedNetworks handles errors internally and always resolves\n if (!lastFetchedSupportedNetworks) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n fetchSupportedNetworks();\n }\n\n // Get dynamically fetched supported chain IDs for V3\n const supportedChainIdsV3 = getSupportedChainIdsV3AsHex();\n\n const assetsWithIds: EvmAssetWithId<SupportedChainId>[] = assets\n // Filter out assets that are not supported by V3 of the Price API.\n .filter((asset) => supportedChainIdsV3.includes(asset.chainId))\n .map((asset) => {\n const caipChainId = toCaipChainId(\n KnownCaipNamespace.Eip155,\n hexToNumber(asset.chainId).toString(),\n );\n\n const nativeAddress = getNativeTokenAddress(asset.chainId);\n const isNativeToken =\n nativeAddress.toLowerCase() === asset.tokenAddress.toLowerCase();\n\n let assetId: string | undefined;\n if (isNativeToken) {\n // For native tokens, use hardcoded SPOT_PRICES_SUPPORT_INFO when defined,\n // otherwise use nativeAssetIdentifiers from NetworkEnablementController by default.\n assetId =\n SPOT_PRICES_SUPPORT_INFO[asset.chainId] ??\n this.#nativeAssetIdentifiers[caipChainId];\n } else {\n // For ERC20 tokens, construct the CAIP-19 ID dynamically\n assetId = `${caipChainId}/erc20:${asset.tokenAddress.toLowerCase()}`;\n }\n\n if (!assetId) {\n return undefined;\n }\n\n return {\n ...asset,\n assetId: assetId as CaipAssetType,\n };\n })\n .filter(\n (asset): asset is EvmAssetWithId<SupportedChainId> =>\n asset !== undefined,\n );\n\n if (assetsWithIds.length === 0) {\n return [];\n }\n\n const url = new URL(`${BASE_URL_V3}/spot-prices`);\n url.searchParams.append(\n 'assetIds',\n assetsWithIds.map((asset) => asset.assetId).join(','),\n );\n url.searchParams.append('vsCurrency', currency);\n url.searchParams.append('includeMarketData', 'true');\n\n const addressCryptoDataMap: {\n [assetId: CaipAssetType]: Omit<\n MarketDataDetails,\n 'currency' | 'tokenAddress'\n >;\n } = await this.#policy.execute(() =>\n handleFetch(url, { headers: { 'Cache-Control': 'no-cache' } }),\n );\n\n return assetsWithIds\n .map((assetWithId) => {\n const marketData = addressCryptoDataMap[assetWithId.assetId];\n\n if (!marketData) {\n return undefined;\n }\n\n return {\n ...marketData,\n ...assetWithId,\n currency,\n };\n })\n .filter((entry): entry is NonNullable<typeof entry> => Boolean(entry));\n }\n\n /**\n * Retrieves exchange rates in the given base currency.\n *\n * @param args - The arguments to this function.\n * @param args.baseCurrency - The desired base currency of the exchange rates.\n * @param args.includeUsdRate - Whether to include the USD rate in the response.\n * @param args.cryptocurrencies - The cryptocurrencies to get exchange rates for.\n * @returns The exchange rates for the requested base currency.\n */\n async fetchExchangeRates({\n baseCurrency,\n includeUsdRate,\n cryptocurrencies,\n }: {\n baseCurrency: SupportedCurrency;\n includeUsdRate: boolean;\n cryptocurrencies: string[];\n }): Promise<ExchangeRatesByCurrency<SupportedCurrency>> {\n // Refresh supported currencies in background (non-blocking)\n // This ensures the list stays fresh during normal polling\n // Note: fetchSupportedCurrencies handles errors internally and always resolves\n if (!lastFetchedCurrencies) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n fetchSupportedCurrencies();\n }\n\n const url = new URL(`${BASE_URL_V1}/exchange-rates`);\n url.searchParams.append('baseCurrency', baseCurrency);\n\n const urlUsd = new URL(`${BASE_URL_V1}/exchange-rates`);\n urlUsd.searchParams.append('baseCurrency', 'usd');\n\n const [exchangeRatesResult, exchangeRatesResultUsd] =\n await Promise.allSettled([\n this.#policy.execute(() =>\n handleFetch(url, { headers: { 'Cache-Control': 'no-cache' } }),\n ),\n ...(includeUsdRate && baseCurrency.toLowerCase() !== 'usd'\n ? [\n this.#policy.execute(() =>\n handleFetch(urlUsd, {\n headers: { 'Cache-Control': 'no-cache' },\n }),\n ),\n ]\n : []),\n ]);\n\n // Handle resolved/rejected\n const exchangeRates =\n exchangeRatesResult.status === 'fulfilled'\n ? exchangeRatesResult.value\n : {};\n const exchangeRatesUsd =\n exchangeRatesResultUsd?.status === 'fulfilled'\n ? exchangeRatesResultUsd.value\n : {};\n\n if (exchangeRatesResult.status === 'rejected') {\n throw new Error('Failed to fetch');\n }\n\n const filteredExchangeRates = cryptocurrencies.reduce((acc, key) => {\n if (exchangeRates[key.toLowerCase() as SupportedCurrency]) {\n acc[key.toLowerCase() as SupportedCurrency] =\n exchangeRates[key.toLowerCase() as SupportedCurrency];\n }\n return acc;\n }, {} as ExchangeRatesByCurrency<SupportedCurrency>);\n\n if (Object.keys(filteredExchangeRates).length === 0) {\n throw new Error(\n 'None of the cryptocurrencies are supported by price api',\n );\n }\n\n const filteredUsdExchangeRates = cryptocurrencies.reduce((acc, key) => {\n if (exchangeRatesUsd[key.toLowerCase() as SupportedCurrency]) {\n acc[key.toLowerCase() as SupportedCurrency] =\n exchangeRatesUsd[key.toLowerCase() as SupportedCurrency];\n }\n return acc;\n }, {} as ExchangeRatesByCurrency<SupportedCurrency>);\n\n if (baseCurrency.toLowerCase() === 'usd') {\n Object.keys(filteredExchangeRates).forEach((key) => {\n filteredExchangeRates[key as SupportedCurrency] = {\n ...filteredExchangeRates[key as SupportedCurrency],\n usd: filteredExchangeRates[key as SupportedCurrency]?.value,\n };\n });\n return filteredExchangeRates;\n }\n if (!includeUsdRate) {\n return filteredExchangeRates;\n }\n\n const merged = Object.keys(filteredExchangeRates).reduce((acc, key) => {\n acc[key as SupportedCurrency] = {\n ...filteredExchangeRates[key as SupportedCurrency],\n ...(filteredUsdExchangeRates[key as SupportedCurrency]?.value\n ? { usd: filteredUsdExchangeRates[key as SupportedCurrency]?.value }\n : {}),\n };\n return acc;\n }, {} as ExchangeRatesByCurrency<SupportedCurrency>);\n\n return merged;\n }\n\n /**\n * Type guard for whether the API can return token prices for the given chain\n * ID.\n *\n * @param chainId - The chain ID to check.\n * @returns True if the API supports the chain ID, false otherwise.\n */\n validateChainIdSupported(chainId: unknown): chainId is SupportedChainId {\n // Use dynamically fetched supported networks\n const supportedChainIds = getSupportedChainIdsV3AsHex();\n // Also include the hardcoded fallback list for backwards compatibility\n const allSupportedChainIds: readonly string[] = [\n ...new Set([...supportedChainIds, ...SUPPORTED_CHAIN_IDS]),\n ];\n return (\n typeof chainId === 'string' && allSupportedChainIds.includes(chainId)\n );\n }\n\n /**\n * Type guard for whether the API can return token prices in the given\n * currency.\n *\n * @param currency - The currency to check. If a string, can be either\n * lowercase or uppercase.\n * @returns True if the API supports the currency, false otherwise.\n */\n validateCurrencySupported(currency: unknown): currency is SupportedCurrency {\n const supportedCurrencies = getSupportedCurrencies();\n return (\n typeof currency === 'string' &&\n supportedCurrencies.includes(currency.toLowerCase())\n );\n }\n\n /**\n * Fetches the list of supported currencies from the API.\n *\n * @returns The list of supported currencies.\n */\n async updateSupportedCurrencies(): Promise<string[]> {\n return fetchSupportedCurrencies();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"codefi-v2.mjs","sourceRoot":"","sources":["../../src/token-prices-service/codefi-v2.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAC9B,0BAA0B,EAC1B,gCAAgC,EAChC,mBAAmB,EACnB,WAAW,EACZ,mCAAmC;AAGpC,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,aAAa,EACd,wBAAwB;AAYzB;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,UAAU;IACV,KAAK;IACL,QAAQ;IACR,KAAK;IACL,WAAW;IACX,KAAK;IACL,eAAe;IACf,KAAK;IACL,eAAe;IACf,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,KAAK;IACL,SAAS;IACT,KAAK;IACL,YAAY;IACZ,MAAM;IACN,WAAW;IACX,KAAK;IACL,gBAAgB;IAChB,KAAK;IACL,YAAY;IACZ,KAAK;IACL,8BAA8B;IAC9B,KAAK;IACL,iBAAiB;IACjB,KAAK;IACL,oBAAoB;IACpB,KAAK;IACL,mBAAmB;IACnB,KAAK;IACL,iBAAiB;IACjB,KAAK;IACL,mBAAmB;IACnB,KAAK;IACL,cAAc;IACd,KAAK;IACL,kBAAkB;IAClB,KAAK;IACL,cAAc;IACd,KAAK;IACL,eAAe;IACf,KAAK;IACL,eAAe;IACf,KAAK;IACL,eAAe;IACf,KAAK;IACL,eAAe;IACf,KAAK;IACL,OAAO;IACP,KAAK;IACL,yBAAyB;IACzB,KAAK;IACL,gBAAgB;IAChB,KAAK;IACL,mBAAmB;IACnB,KAAK;IACL,mBAAmB;IACnB,KAAK;IACL,oBAAoB;IACpB,KAAK;IACL,qBAAqB;IACrB,KAAK;IACL,eAAe;IACf,KAAK;IACL,eAAe;IACf,KAAK;IACL,mBAAmB;IACnB,KAAK;IACL,gBAAgB;IAChB,KAAK;IACL,mBAAmB;IACnB,KAAK;IACL,eAAe;IACf,KAAK;IACL,eAAe;IACf,KAAK;IACL,oBAAoB;I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ACR,CAAC;YACF,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAgD,CAAC,CAAC;QAErD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;OAMG;IACH,wBAAwB,CAAC,OAAgB;QACvC,6CAA6C;QAC7C,MAAM,iBAAiB,GAAG,2BAA2B,EAAE,CAAC;QACxD,uEAAuE;QACvE,MAAM,oBAAoB,GAAsB;YAC9C,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,iBAAiB,EAAE,GAAG,mBAAmB,CAAC,CAAC;SAC3D,CAAC;QACF,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ,IAAI,oBAAoB,CAAC,QAAQ,CAAC,OAAO,CAAC,CACtE,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,yBAAyB,CAAC,QAAiB;QACzC,MAAM,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;QACrD,OAAO,CACL,OAAO,QAAQ,KAAK,QAAQ;YAC5B,mBAAmB,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CACrD,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,yBAAyB;QAC7B,OAAO,wBAAwB,EAAE,CAAC;IACpC,CAAC;CACF","sourcesContent":["import {\n createServicePolicy,\n DEFAULT_CIRCUIT_BREAK_DURATION,\n DEFAULT_DEGRADED_THRESHOLD,\n DEFAULT_MAX_CONSECUTIVE_FAILURES,\n DEFAULT_MAX_RETRIES,\n handleFetch,\n} from '@metamask/controller-utils';\nimport type { ServicePolicy } from '@metamask/controller-utils';\nimport type { CaipAssetType, Hex } from '@metamask/utils';\nimport {\n hexToNumber,\n KnownCaipNamespace,\n numberToHex,\n toCaipChainId,\n} from '@metamask/utils';\n\nimport type { MarketDataDetails } from '../TokenRatesController';\nimport type {\n AbstractTokenPricesService,\n EvmAssetAddressWithChain,\n EvmAssetWithId,\n EvmAssetWithMarketData,\n ExchangeRatesByCurrency,\n NativeAssetIdentifiersMap,\n} from './abstract-token-prices-service';\n\n/**\n * The list of currencies that can be supplied as the `vsCurrency` parameter to\n * the `/spot-prices` endpoint, in lowercase form.\n * This is the fallback list used when the API is unavailable.\n */\nexport const SUPPORTED_CURRENCIES_FALLBACK = [\n // Bitcoin\n 'btc',\n // Ether\n 'eth',\n // Litecoin\n 'ltc',\n // Bitcoin Cash\n 'bch',\n // Binance Coin\n 'bnb',\n // EOS\n 'eos',\n // XRP\n 'xrp',\n // Lumens\n 'xlm',\n // Chainlink\n 'link',\n // Polkadot\n 'dot',\n // Yearn.finance\n 'yfi',\n // US Dollar\n 'usd',\n // United Arab Emirates Dirham\n 'aed',\n // Argentine Peso\n 'ars',\n // Australian Dollar\n 'aud',\n // Bangladeshi Taka\n 'bdt',\n // Bahraini Dinar\n 'bhd',\n // Bermudian Dollar\n 'bmd',\n // Brazil Real\n 'brl',\n // Canadian Dollar\n 'cad',\n // Swiss Franc\n 'chf',\n // Chilean Peso\n 'clp',\n // Chinese Yuan\n 'cny',\n // Czech Koruna\n 'czk',\n // Danish Krone\n 'dkk',\n // Euro\n 'eur',\n // British Pound Sterling\n 'gbp',\n // Georgian Lari\n 'gel',\n // Hong Kong Dollar\n 'hkd',\n // Hungarian Forint\n 'huf',\n // Indonesian Rupiah\n 'idr',\n // Israeli New Shekel\n 'ils',\n // Indian Rupee\n 'inr',\n // Japanese Yen\n 'jpy',\n // South Korean Won\n 'krw',\n // Kuwaiti Dinar\n 'kwd',\n // Sri Lankan Rupee\n 'lkr',\n // Burmese Kyat\n 'mmk',\n // Mexican Peso\n 'mxn',\n // Malaysian Ringgit\n 'myr',\n // Monad\n 'mon',\n // Nigerian Naira\n 'ngn',\n // Norwegian Krone\n 'nok',\n // New Zealand Dollar\n 'nzd',\n // Philippine Peso\n 'php',\n // Pakistani Rupee\n 'pkr',\n // Polish Zloty\n 'pln',\n // Russian Ruble\n 'rub',\n // Saudi Riyal\n 'sar',\n // Swedish Krona\n 'sek',\n // Singapore Dollar\n 'sgd',\n // Thai Baht\n 'thb',\n // Turkish Lira\n 'try',\n // New Taiwan Dollar\n 'twd',\n // Ukrainian hryvnia\n 'uah',\n // Venezuelan bolívar fuerte\n 'vef',\n // Vietnamese đồng\n 'vnd',\n // South African Rand\n 'zar',\n // IMF Special Drawing Rights\n 'xdr',\n // Silver - Troy Ounce\n 'xag',\n // Gold - Troy Ounce\n 'xau',\n // Bits\n 'bits',\n // Satoshi\n 'sats',\n // Colombian Peso\n 'cop',\n // Kenyan Shilling\n 'kes',\n // Romanian Leu\n 'ron',\n // Dominican Peso\n 'dop',\n // Costa Rican Colón\n 'crc',\n // Honduran Lempira\n 'hnl',\n // Zambian Kwacha\n 'zmw',\n // Salvadoran Colón\n 'svc',\n // Bosnia-Herzegovina Convertible Mark\n 'bam',\n // Peruvian Sol\n 'pen',\n // Guatemalan Quetzal\n 'gtq',\n // Lebanese Pound\n 'lbp',\n // Armenian Dram\n 'amd',\n // Solana\n 'sol',\n // Sei\n 'sei',\n // Sonic\n 'sonic',\n // Tron\n 'trx',\n // Taiko\n 'taiko',\n // Pepu\n 'pepu',\n // Polygon\n 'pol',\n // Mantle\n 'mnt',\n // Onomy\n 'nom',\n // Avalanche\n 'avax',\n // Apechain\n 'ape',\n] as const;\n\n/**\n * @deprecated Use `getSupportedCurrencies()` or `fetchSupportedCurrencies()` instead.\n * This is an alias for backward compatibility.\n */\nexport const SUPPORTED_CURRENCIES = SUPPORTED_CURRENCIES_FALLBACK;\n\n/**\n * Represents the zero address, commonly used as a placeholder in blockchain transactions.\n * In the context of fetching market data, the zero address is utilized to retrieve information\n * specifically for native currencies. This allows for a standardized approach to query market\n * data for blockchain-native assets without a specific contract address.\n */\nexport const ZERO_ADDRESS: Hex =\n '0x0000000000000000000000000000000000000000' as const;\n\n/**\n * A mapping from chain id to the address of the chain's native token.\n * Only for chains whose native tokens have a specific address.\n */\nconst chainIdToNativeTokenAddress: Record<Hex, Hex> = {\n '0x89': '0x0000000000000000000000000000000000001010', // Polygon\n '0x440': '0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Metis Andromeda\n '0x1388': '0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Mantle\n '0x64': '0xe91d153e0b41518a2ce8dd3d7944fa863463a97d', // Gnosis\n '0x1e': '0x542fda317318ebf1d3deaf76e0b632741a7e677d', // Rootstock Mainnet - Native symbol: RBTC\n '0x3dc': '0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0\n};\n\n/**\n * Returns the address that should be used to query the price api for the\n * chain's native token. On most chains, this is signified by the zero address.\n * But on some chains, the native token has a specific address.\n *\n * @param chainId - The hexadecimal chain id.\n * @returns The address of the chain's native token.\n */\nexport const getNativeTokenAddress = (chainId: Hex): Hex =>\n chainIdToNativeTokenAddress[chainId] ?? ZERO_ADDRESS;\n\n// Source: https://github.com/consensys-vertical-apps/va-mmcx-price-api/blob/main/src/constants/slip44.ts\n// We can only support PricesAPI V3 for EVM chains that have a CAIP-19 native asset mapping.\nexport const SPOT_PRICES_SUPPORT_INFO = {\n '0x1': 'eip155:1/slip44:60', // Ethereum Mainnet - Native symbol: ETH\n '0xa': 'eip155:10/slip44:60', // OP Mainnet - Native symbol: ETH\n '0x19': 'eip155:25/slip44:394', // Cronos Mainnet - Native symbol: CRO\n '0x1e': 'eip155:30/slip44:137', // Rootstock Mainnet - Native symbol: RBTC\n '0x2a': 'eip155:42/erc20:0x0000000000000000000000000000000000000000', // Lukso - native symbol: LYX\n '0x32': 'eip155:50/erc20:0x0000000000000000000000000000000000000000', // xdc-network - native symbol: XDC\n '0x38': 'eip155:56/slip44:714', // BNB Smart Chain Mainnet - Native symbol: BNB\n '0x39': 'eip155:57/slip44:57', // Syscoin Mainnet - Native symbol: SYS\n '0x52': 'eip155:82/slip44:18000', // Meter Mainnet - Native symbol: MTR\n '0x58': 'eip155:88/slip44:889', // TomoChain - Native symbol: TOMO\n '0x64': 'eip155:100/slip44:700', // Gnosis (formerly xDAI Chain) - Native symbol: xDAI\n '0x6a': 'eip155:106/slip44:5655640', // Velas EVM Mainnet - Native symbol: VLX\n '0x7a': 'eip155:122/erc20:0x0000000000000000000000000000000000000000', // Fuse Mainnet - Native symbol: FUSE\n '0x80': 'eip155:128/slip44:1010', // Huobi ECO Chain Mainnet - Native symbol: HT\n '0x89': 'eip155:137/slip44:966', // Polygon Mainnet - Native symbol: POL\n '0x8f': 'eip155:143/slip44:268435779', // Monad Mainnet - Native symbol: MON\n '0x92': 'eip155:146/slip44:10007', // Sonic Mainnet - Native symbol: S\n '0xc4': 'eip155:196/erc20:0x0000000000000000000000000000000000000000', // X Layer Mainnet - Native symbol: OKB\n '0xe8': 'eip155:232/erc20:0x0000000000000000000000000000000000000000', // Lens Mainnet - Native symbol: GHO\n '0xfa': 'eip155:250/slip44:1007', // Fantom Opera - Native symbol: FTM\n '0xfc': 'eip155:252/erc20:0x0000000000000000000000000000000000000000', // Fraxtal - native symbol: FRAX\n '0x10b3e': 'eip155:68414/erc20:0x0000000000000000000000000000000000000000', // MapleStory Universe - no slip44\n '0x120': 'eip155:288/slip44:60', // Boba Network (Ethereum L2) - Native symbol: ETH\n '0x141': 'eip155:321/slip44:641', // KCC Mainnet - Native symbol: KCS\n '0x144': 'eip155:324/slip44:60', // zkSync Era Mainnet (Ethereum L2) - Native symbol: ETH\n '0x150': 'eip155:336/slip44:809', // Shiden - Native symbol: SDN\n '0x169': 'eip155:361/slip44:589', // Theta Mainnet - Native symbol: TFUEL\n '0x2eb': 'eip155:747/slip44:539', // Flow evm - Native symbol: Flow\n '0x3e7': 'eip155:999/slip44:2457', // HyperEVM - Native symbol: HYPE\n '0x440': 'eip155:1088/erc20:0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Metis Andromeda Mainnet (Ethereum L2) - Native symbol: METIS\n '0x44d': 'eip155:1101/slip44:60', // Polygon zkEVM mainnet - Native symbol: ETH\n '0x504': 'eip155:1284/slip44:1284', // Moonbeam - Native symbol: GLMR\n '0x505': 'eip155:1285/slip44:1285', // Moonriver - Native symbol: MOVR\n '0x531': 'eip155:1329/slip44:19000118', // Sei Mainnet - Native symbol: SEI\n '0x6f0': 'eip155:1776/slip44:22000119', // Injective Mainnet - Native symbol: INJ\n '0x74c': 'eip155:1868/erc20:0x0000000000000000000000000000000000000000', // Soneium - Native symbol: ETH\n '0xa729': 'eip155:42793/erc20:0x0000000000000000000000000000000000000000', // Etherlink - Native symbol: XTZ (Tezos L2)\n '0xab5': 'eip155:2741/erc20:0x0000000000000000000000000000000000000000', // Abstract - Native symbol: ETH\n '0x1079': 'eip155:4217/slip44:60', // Tempo Mainnet - No native asset\n '0x10e6': 'eip155:4326/erc20:0x0000000000000000000000000000000000000000', // MegaETH Mainnet - Native symbol: ETH\n '0x1388': 'eip155:5000/erc20:0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Mantle - Native symbol: MNT\n '0x2105': 'eip155:8453/slip44:60', // Base - Native symbol: ETH\n '0x2611': 'eip155:9745/erc20:0x0000000000000000000000000000000000000000', // Plasma mainnet - native symbol: XPL\n '0x2710': 'eip155:10000/slip44:145', // Smart Bitcoin Cash - Native symbol: BCH\n '0x8173': 'eip155:33139/erc20:0x0000000000000000000000000000000000000000', // Apechain Mainnet - Native symbol: APE\n '0xa3c3': 'eip155:41923/erc20:0x0000000000000000000000000000000000000000', // EDU Chain - Native symbol: EDU\n '0xa4b1': 'eip155:42161/slip44:60', // Arbitrum One - Native symbol: ETH\n '0xa4ec': 'eip155:42220/slip44:52752', // Celo Mainnet - Native symbol: CELO\n '0xa516': 'eip155:42262/slip44:474', // Oasis Emerald - Native symbol: ROSE\n '0xa867': 'eip155:43111/erc20:0x0000000000000000000000000000000000000000', // Hemi - Native symbol: ETH\n '0xa86a': 'eip155:43114/slip44:9005', // Avalanche C-Chain - Native symbol: AVAX\n '0xa5bf': 'eip155:42431/slip44:60', // Tempo Testnet Moderato - No native asset\n '0xe708': 'eip155:59144/slip44:60', // Linea Mainnet - Native symbol: ETH\n '0xed88': 'eip155:60808/erc20:0x0000000000000000000000000000000000000000', // BOB - Native symbol: ETH\n '0x138de': 'eip155:80094/erc20:0x0000000000000000000000000000000000000000', // Berachain - Native symbol: Bera',\n '0x13c31': 'eip155:81457/slip44:60', // Blast Mainnet - Native symbol: ETH\n '0x15b38': 'eip155:88888/erc20:0x0000000000000000000000000000000000000000', // Chiliz Chain - Native symbol: CHZ\n '0x17dcd': 'eip155:97741/erc20:0x0000000000000000000000000000000000000000', // Pepe Unchained Mainnet - Native symbol: PEPU\n '0x18232': 'eip155:98866/erc20:0x0000000000000000000000000000000000000000', // Plume Mainnet - Narive symbol: Plume\n '0x28c58': 'eip155:167000/slip44:60', // Taiko Mainnet - Native symbol: ETH\n '0x518af': 'eip155:333999/slip44:1997', // Polis Mainnet - Native symbol: POLIS\n '0x82750': 'eip155:534352/slip44:60', // Scroll Mainnet - Native symbol: ETH\n '0xb67d2': 'eip155:747474/erc20:0x0000000000000000000000000000000000000000', // katana - Native symbol: ETH\n '0x15f900': 'eip155:1440000/erc20:0x0000000000000000000000000000000000000000', // xrpl-evm - native symbol: XRP\n '0x4e454152': 'eip155:1313161554/slip44:60', // Aurora Mainnet (Ethereum L2 on NEAR) - Native symbol: ETH\n '0x63564c40': 'eip155:1666600000/slip44:1023', // Harmony Mainnet Shard 0 - Native symbol: ONE\n '0xdef1': 'eip155:57073/slip44:60', // Ink Mainnet - Native symbol: ETH\n '0x3dc': 'eip155:988/erc20:0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0\n '0xf043a': 'eip155:984122/slip44:984122', // Forma - Native symbol: TIA (Celestia)\n '0x1b58': 'eip155:7000/slip44:7000', // ZetaChain - Native symbol: ZETA\n} as const;\n\n// MISSING CHAINS WITH NO NATIVE ASSET PRICES\n// '0x42': 'eip155:66/slip44:996', // OKXChain Mainnet - Native symbol: OKT\n// '0x46': 'eip155:70/slip44:1170', // Hoo Smart Chain - Native symbol: HOO\n// '0x926': 'eip155:2342/erc20:0x0000000000000000000000000000000000000000', // Omnia Chain - Native symbol: OMNIA\n// '0x407b': 'eip155:16507/erc20:0x0000000000000000000000000000000000000000', // Genesys Mainnet - Native symbol: GSYS\n\n/**\n * A currency that can be supplied as the `vsCurrency` parameter to\n * the `/spot-prices` endpoint. Covers both uppercase and lowercase versions.\n */\ntype SupportedCurrency =\n | (typeof SUPPORTED_CURRENCIES_FALLBACK)[number]\n | Uppercase<(typeof SUPPORTED_CURRENCIES_FALLBACK)[number]>;\n\n/**\n * The list of chain IDs that can be supplied in the URL for the `/spot-prices`\n * endpoint, but in hexadecimal form (for consistency with how we represent\n * chain IDs in other places).\n *\n * @see Used by {@link CodefiTokenPricesServiceV2} to validate that a given chain ID is supported by V2 of the Codefi Price API.\n */\nexport const SUPPORTED_CHAIN_IDS = Object.keys(\n SPOT_PRICES_SUPPORT_INFO,\n) as (keyof typeof SPOT_PRICES_SUPPORT_INFO)[];\n\n/**\n * A chain ID that can be supplied in the URL for the `/spot-prices` endpoint,\n * but in hexadecimal form (for consistency with how we represent chain IDs in\n * other places).\n */\ntype SupportedChainId = (typeof SUPPORTED_CHAIN_IDS)[number];\n\nconst BASE_URL_V1 = 'https://price.api.cx.metamask.io/v1';\n\nconst BASE_URL_V2 = 'https://price.api.cx.metamask.io/v2';\n\nconst BASE_URL_V3 = 'https://price.api.cx.metamask.io/v3';\n\n/**\n * Response type for the /v2/supportedNetworks endpoint.\n */\ntype SupportedNetworksResponse = {\n fullSupport: string[];\n partialSupport: {\n spotPricesV2: string[];\n spotPricesV3: string[];\n };\n};\n\n/**\n * In-memory store for the last successfully fetched supported networks.\n */\nlet lastFetchedSupportedNetworks: SupportedNetworksResponse | null = null;\n\n/**\n * In-flight promise to prevent concurrent requests to the supported networks endpoint.\n */\nlet runningSupportedNetworksRequest: Promise<SupportedNetworksResponse> | null =\n null;\n\n/**\n * Converts a CAIP-2 chain ID (e.g., 'eip155:1') to a hex chain ID (e.g., '0x1').\n *\n * @param caipChainId - The CAIP-2 chain ID string.\n * @returns The hex chain ID or null if not an EIP-155 chain.\n */\nfunction caipChainIdToHex(caipChainId: string): Hex | null {\n const match = caipChainId.match(/^eip155:(\\d+)$/u);\n if (!match) {\n return null;\n }\n return numberToHex(parseInt(match[1], 10));\n}\n\n/**\n * Executes the actual fetch to the supported networks endpoint.\n * Handles errors internally by falling back to the hardcoded list,\n * and clears the in-flight promise when done.\n *\n * @returns The supported networks response.\n */\nasync function executeSupportedNetworksFetch(): Promise<SupportedNetworksResponse> {\n try {\n const url = `${BASE_URL_V2}/supportedNetworks`;\n const response = await handleFetch(url, {\n headers: { 'Cache-Control': 'no-cache' },\n });\n\n if (\n response &&\n typeof response === 'object' &&\n 'fullSupport' in response &&\n 'partialSupport' in response\n ) {\n lastFetchedSupportedNetworks = response as SupportedNetworksResponse;\n return lastFetchedSupportedNetworks;\n }\n\n // Invalid response format, fall back to hardcoded list\n return getSupportedNetworksFallback();\n } catch {\n // On any error, fall back to the hardcoded list\n return getSupportedNetworksFallback();\n } finally {\n // Clear the in-flight promise once the request completes\n runningSupportedNetworksRequest = null;\n }\n}\n\n/**\n * Fetches the list of supported networks from the API.\n * Falls back to the hardcoded list if the fetch fails.\n * Deduplicates concurrent requests by returning the same promise if a fetch is already in progress.\n *\n * @returns The supported networks response.\n */\nexport async function fetchSupportedNetworks(): Promise<SupportedNetworksResponse> {\n // If a fetch is already in progress, return the same promise\n if (runningSupportedNetworksRequest) {\n return runningSupportedNetworksRequest;\n }\n\n // Start a new fetch and cache the promise\n runningSupportedNetworksRequest = executeSupportedNetworksFetch();\n\n return runningSupportedNetworksRequest;\n}\n\n/**\n * Synchronously gets the list of supported networks.\n * Returns the last fetched value if available, otherwise returns the fallback list.\n *\n * @returns The supported networks response.\n */\nexport function getSupportedNetworks(): SupportedNetworksResponse {\n if (lastFetchedSupportedNetworks !== null) {\n return lastFetchedSupportedNetworks;\n }\n return getSupportedNetworksFallback();\n}\n\n/**\n * Generates a fallback supported networks response from the hardcoded SPOT_PRICES_SUPPORT_INFO.\n *\n * @returns A SupportedNetworksResponse derived from hardcoded data.\n */\nfunction getSupportedNetworksFallback(): SupportedNetworksResponse {\n const caipChainIds = Object.keys(SPOT_PRICES_SUPPORT_INFO).map((hexChainId) =>\n toCaipChainId(\n KnownCaipNamespace.Eip155,\n hexToNumber(hexChainId as Hex).toString(),\n ),\n );\n\n return {\n fullSupport: caipChainIds.slice(0, 11), // First 11 chains as \"full support\"\n partialSupport: {\n spotPricesV2: caipChainIds,\n spotPricesV3: caipChainIds,\n },\n };\n}\n\n/**\n * Resets the supported networks cache.\n * This is primarily intended for testing purposes.\n */\nexport function resetSupportedNetworksCache(): void {\n lastFetchedSupportedNetworks = null;\n runningSupportedNetworksRequest = null;\n}\n\n/**\n * Gets the list of supported chain IDs for spot prices v3 as hex values.\n *\n * @returns Array of hex chain IDs supported by spot prices v3.\n */\nfunction getSupportedChainIdsV3AsHex(): Hex[] {\n const supportedNetworks = getSupportedNetworks();\n const allV3Chains = [\n ...supportedNetworks.fullSupport,\n ...supportedNetworks.partialSupport.spotPricesV3,\n ];\n\n return allV3Chains\n .map(caipChainIdToHex)\n .filter((hexChainId): hexChainId is Hex => hexChainId !== null);\n}\n\n/**\n * In-memory store for the last successfully fetched supported currencies.\n */\nlet lastFetchedCurrencies: string[] | null = null;\n\n/**\n * Fetches the list of supported currencies from the API.\n * Falls back to the hardcoded list if the fetch fails.\n *\n * @returns The list of supported currencies in lowercase.\n */\nexport async function fetchSupportedCurrencies(): Promise<string[]> {\n try {\n const url = `${BASE_URL_V1}/supportedVsCurrencies`;\n const response = await handleFetch(url, {\n headers: { 'Cache-Control': 'no-cache' },\n });\n\n if (Array.isArray(response)) {\n const currencies = response.map((currency: string) =>\n currency.toLowerCase(),\n );\n lastFetchedCurrencies = currencies;\n return currencies;\n }\n\n // Invalid response format, fall back to hardcoded list\n return [...SUPPORTED_CURRENCIES_FALLBACK];\n } catch {\n // On any error, fall back to the hardcoded list\n return [...SUPPORTED_CURRENCIES_FALLBACK];\n }\n}\n\n/**\n * Synchronously gets the list of supported currencies.\n * Returns the last fetched value if available, otherwise returns the fallback list.\n *\n * @returns The list of supported currencies in lowercase.\n */\nexport function getSupportedCurrencies(): readonly string[] {\n if (lastFetchedCurrencies !== null) {\n return lastFetchedCurrencies;\n }\n return SUPPORTED_CURRENCIES_FALLBACK;\n}\n\n/**\n * Resets the supported currencies cache.\n * This is primarily intended for testing purposes.\n */\nexport function resetSupportedCurrenciesCache(): void {\n lastFetchedCurrencies = null;\n}\n\n/**\n * This version of the token prices service uses V2 of the Codefi Price API to\n * fetch token prices.\n */\nexport class CodefiTokenPricesServiceV2 implements AbstractTokenPricesService<\n SupportedChainId,\n SupportedCurrency\n> {\n readonly #policy: ServicePolicy;\n\n /**\n * Map of CAIP-2 chain IDs to their native asset identifiers.\n * Updated via setNativeAssetIdentifiers().\n */\n #nativeAssetIdentifiers: NativeAssetIdentifiersMap = {};\n\n /**\n * Construct a Codefi Token Price Service.\n *\n * @param args - The arguments.\n * @param args.degradedThreshold - The length of time (in milliseconds)\n * that governs when the service is regarded as degraded (affecting when\n * `onDegraded` is called). Defaults to 5 seconds.\n * @param args.retries - Number of retry attempts for each fetch request.\n * @param args.maximumConsecutiveFailures - The maximum number of consecutive\n * failures allowed before breaking the circuit and pausing further updates.\n * @param args.circuitBreakDuration - The amount of time to wait when the\n * circuit breaks from too many consecutive failures.\n */\n constructor(args?: {\n degradedThreshold?: number;\n retries?: number;\n maximumConsecutiveFailures?: number;\n circuitBreakDuration?: number;\n });\n\n /**\n * Construct a Codefi Token Price Service.\n *\n * @deprecated This signature is deprecated; please use the `onBreak` and\n * `onDegraded` methods instead.\n * @param args - The arguments.\n * @param args.degradedThreshold - The length of time (in milliseconds)\n * that governs when the service is regarded as degraded (affecting when\n * `onDegraded` is called). Defaults to 5 seconds.\n * @param args.retries - Number of retry attempts for each fetch request.\n * @param args.maximumConsecutiveFailures - The maximum number of consecutive\n * failures allowed before breaking the circuit and pausing further updates.\n * @param args.onBreak - Callback for when the circuit breaks, useful\n * for capturing metrics about network failures.\n * @param args.onDegraded - Callback for when the API responds successfully\n * but takes too long to respond (5 seconds or more).\n * @param args.circuitBreakDuration - The amount of time to wait when the\n * circuit breaks from too many consecutive failures.\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n constructor(args?: {\n degradedThreshold?: number;\n retries?: number;\n maximumConsecutiveFailures?: number;\n onBreak?: () => void;\n onDegraded?: () => void;\n circuitBreakDuration?: number;\n });\n\n constructor({\n degradedThreshold = DEFAULT_DEGRADED_THRESHOLD,\n retries = DEFAULT_MAX_RETRIES,\n maximumConsecutiveFailures = DEFAULT_MAX_CONSECUTIVE_FAILURES,\n onBreak,\n onDegraded,\n circuitBreakDuration = DEFAULT_CIRCUIT_BREAK_DURATION,\n }: {\n degradedThreshold?: number;\n retries?: number;\n maximumConsecutiveFailures?: number;\n onBreak?: () => void;\n onDegraded?: () => void;\n circuitBreakDuration?: number;\n } = {}) {\n this.#policy = createServicePolicy({\n maxRetries: retries,\n maxConsecutiveFailures: maximumConsecutiveFailures,\n circuitBreakDuration,\n degradedThreshold,\n });\n if (onBreak) {\n this.#policy.onBreak(onBreak);\n }\n if (onDegraded) {\n this.#policy.onDegraded(onDegraded);\n }\n }\n\n /**\n * Listens for when the request to the API fails too many times in a row.\n *\n * @param args - The same arguments that {@link ServicePolicy.onBreak}\n * takes.\n * @returns What {@link ServicePolicy.onBreak} returns.\n */\n onBreak(\n ...args: Parameters<ServicePolicy['onBreak']>\n ): ReturnType<ServicePolicy['onBreak']> {\n return this.#policy.onBreak(...args);\n }\n\n /**\n * Listens for when the API is degraded.\n *\n * @param args - The same arguments that {@link ServicePolicy.onDegraded}\n * takes.\n * @returns What {@link ServicePolicy.onDegraded} returns.\n */\n onDegraded(\n ...args: Parameters<ServicePolicy['onDegraded']>\n ): ReturnType<ServicePolicy['onDegraded']> {\n return this.#policy.onDegraded(...args);\n }\n\n /**\n * Sets the native asset identifiers map for resolving native token CAIP-19 IDs.\n * This should be called with data from NetworkEnablementController.state.nativeAssetIdentifiers.\n *\n * @param nativeAssetIdentifiers - Map of CAIP-2 chain IDs to native asset identifiers.\n */\n setNativeAssetIdentifiers(\n nativeAssetIdentifiers: NativeAssetIdentifiersMap,\n ): void {\n this.#nativeAssetIdentifiers = nativeAssetIdentifiers;\n }\n\n /**\n * Updates the supported networks cache by fetching from the API.\n * This should be called periodically to keep the supported networks list fresh.\n *\n * @returns The updated supported networks response.\n */\n async updateSupportedNetworks(): Promise<SupportedNetworksResponse> {\n return fetchSupportedNetworks();\n }\n\n /**\n * Retrieves prices in the given currency for the tokens identified by the\n * given addresses which are expected to live on the given chain.\n *\n * @param args - The arguments to function.\n * @param args.assets - The assets to get prices for.\n * @param args.currency - The desired currency of the token prices.\n * @returns The prices for the requested tokens.\n */\n async fetchTokenPrices({\n assets,\n currency,\n }: {\n assets: EvmAssetAddressWithChain<SupportedChainId>[];\n currency: SupportedCurrency;\n }): Promise<EvmAssetWithMarketData<SupportedChainId, SupportedCurrency>[]> {\n // Refresh supported networks in background (non-blocking)\n // This ensures the list stays fresh during normal polling\n // Note: fetchSupportedNetworks handles errors internally and always resolves\n if (!lastFetchedSupportedNetworks) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n fetchSupportedNetworks();\n }\n\n // Get dynamically fetched supported chain IDs for V3\n const supportedChainIdsV3 = getSupportedChainIdsV3AsHex();\n\n const assetsWithIds: EvmAssetWithId<SupportedChainId>[] = assets\n // Filter out assets that are not supported by V3 of the Price API.\n .filter((asset) => supportedChainIdsV3.includes(asset.chainId))\n .map((asset) => {\n const caipChainId = toCaipChainId(\n KnownCaipNamespace.Eip155,\n hexToNumber(asset.chainId).toString(),\n );\n\n const nativeAddress = getNativeTokenAddress(asset.chainId);\n const isNativeToken =\n nativeAddress.toLowerCase() === asset.tokenAddress.toLowerCase();\n\n let assetId: string | undefined;\n if (isNativeToken) {\n // For native tokens, use hardcoded SPOT_PRICES_SUPPORT_INFO when defined,\n // otherwise use nativeAssetIdentifiers from NetworkEnablementController by default.\n assetId =\n SPOT_PRICES_SUPPORT_INFO[asset.chainId] ??\n this.#nativeAssetIdentifiers[caipChainId];\n } else {\n // For ERC20 tokens, construct the CAIP-19 ID dynamically\n assetId = `${caipChainId}/erc20:${asset.tokenAddress.toLowerCase()}`;\n }\n\n if (!assetId) {\n return undefined;\n }\n\n return {\n ...asset,\n assetId: assetId as CaipAssetType,\n };\n })\n .filter(\n (asset): asset is EvmAssetWithId<SupportedChainId> =>\n asset !== undefined,\n );\n\n if (assetsWithIds.length === 0) {\n return [];\n }\n\n const url = new URL(`${BASE_URL_V3}/spot-prices`);\n url.searchParams.append(\n 'assetIds',\n assetsWithIds.map((asset) => asset.assetId).join(','),\n );\n url.searchParams.append('vsCurrency', currency);\n url.searchParams.append('includeMarketData', 'true');\n\n const addressCryptoDataMap: {\n [assetId: CaipAssetType]: Omit<\n MarketDataDetails,\n 'currency' | 'tokenAddress'\n >;\n } = await this.#policy.execute(() =>\n handleFetch(url, { headers: { 'Cache-Control': 'no-cache' } }),\n );\n\n return assetsWithIds\n .map((assetWithId) => {\n const marketData = addressCryptoDataMap[assetWithId.assetId];\n\n if (!marketData) {\n return undefined;\n }\n\n return {\n ...marketData,\n ...assetWithId,\n currency,\n };\n })\n .filter((entry): entry is NonNullable<typeof entry> => Boolean(entry));\n }\n\n /**\n * Retrieves exchange rates in the given base currency.\n *\n * @param args - The arguments to this function.\n * @param args.baseCurrency - The desired base currency of the exchange rates.\n * @param args.includeUsdRate - Whether to include the USD rate in the response.\n * @param args.cryptocurrencies - The cryptocurrencies to get exchange rates for.\n * @returns The exchange rates for the requested base currency.\n */\n async fetchExchangeRates({\n baseCurrency,\n includeUsdRate,\n cryptocurrencies,\n }: {\n baseCurrency: SupportedCurrency;\n includeUsdRate: boolean;\n cryptocurrencies: string[];\n }): Promise<ExchangeRatesByCurrency<SupportedCurrency>> {\n // Refresh supported currencies in background (non-blocking)\n // This ensures the list stays fresh during normal polling\n // Note: fetchSupportedCurrencies handles errors internally and always resolves\n if (!lastFetchedCurrencies) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n fetchSupportedCurrencies();\n }\n\n const url = new URL(`${BASE_URL_V1}/exchange-rates`);\n url.searchParams.append('baseCurrency', baseCurrency);\n\n const urlUsd = new URL(`${BASE_URL_V1}/exchange-rates`);\n urlUsd.searchParams.append('baseCurrency', 'usd');\n\n const [exchangeRatesResult, exchangeRatesResultUsd] =\n await Promise.allSettled([\n this.#policy.execute(() =>\n handleFetch(url, { headers: { 'Cache-Control': 'no-cache' } }),\n ),\n ...(includeUsdRate && baseCurrency.toLowerCase() !== 'usd'\n ? [\n this.#policy.execute(() =>\n handleFetch(urlUsd, {\n headers: { 'Cache-Control': 'no-cache' },\n }),\n ),\n ]\n : []),\n ]);\n\n // Handle resolved/rejected\n const exchangeRates =\n exchangeRatesResult.status === 'fulfilled'\n ? exchangeRatesResult.value\n : {};\n const exchangeRatesUsd =\n exchangeRatesResultUsd?.status === 'fulfilled'\n ? exchangeRatesResultUsd.value\n : {};\n\n if (exchangeRatesResult.status === 'rejected') {\n throw new Error('Failed to fetch');\n }\n\n const filteredExchangeRates = cryptocurrencies.reduce((acc, key) => {\n if (exchangeRates[key.toLowerCase() as SupportedCurrency]) {\n acc[key.toLowerCase() as SupportedCurrency] =\n exchangeRates[key.toLowerCase() as SupportedCurrency];\n }\n return acc;\n }, {} as ExchangeRatesByCurrency<SupportedCurrency>);\n\n if (Object.keys(filteredExchangeRates).length === 0) {\n throw new Error(\n 'None of the cryptocurrencies are supported by price api',\n );\n }\n\n const filteredUsdExchangeRates = cryptocurrencies.reduce((acc, key) => {\n if (exchangeRatesUsd[key.toLowerCase() as SupportedCurrency]) {\n acc[key.toLowerCase() as SupportedCurrency] =\n exchangeRatesUsd[key.toLowerCase() as SupportedCurrency];\n }\n return acc;\n }, {} as ExchangeRatesByCurrency<SupportedCurrency>);\n\n if (baseCurrency.toLowerCase() === 'usd') {\n Object.keys(filteredExchangeRates).forEach((key) => {\n filteredExchangeRates[key as SupportedCurrency] = {\n ...filteredExchangeRates[key as SupportedCurrency],\n usd: filteredExchangeRates[key as SupportedCurrency]?.value,\n };\n });\n return filteredExchangeRates;\n }\n if (!includeUsdRate) {\n return filteredExchangeRates;\n }\n\n const merged = Object.keys(filteredExchangeRates).reduce((acc, key) => {\n acc[key as SupportedCurrency] = {\n ...filteredExchangeRates[key as SupportedCurrency],\n ...(filteredUsdExchangeRates[key as SupportedCurrency]?.value\n ? { usd: filteredUsdExchangeRates[key as SupportedCurrency]?.value }\n : {}),\n };\n return acc;\n }, {} as ExchangeRatesByCurrency<SupportedCurrency>);\n\n return merged;\n }\n\n /**\n * Type guard for whether the API can return token prices for the given chain\n * ID.\n *\n * @param chainId - The chain ID to check.\n * @returns True if the API supports the chain ID, false otherwise.\n */\n validateChainIdSupported(chainId: unknown): chainId is SupportedChainId {\n // Use dynamically fetched supported networks\n const supportedChainIds = getSupportedChainIdsV3AsHex();\n // Also include the hardcoded fallback list for backwards compatibility\n const allSupportedChainIds: readonly string[] = [\n ...new Set([...supportedChainIds, ...SUPPORTED_CHAIN_IDS]),\n ];\n return (\n typeof chainId === 'string' && allSupportedChainIds.includes(chainId)\n );\n }\n\n /**\n * Type guard for whether the API can return token prices in the given\n * currency.\n *\n * @param currency - The currency to check. If a string, can be either\n * lowercase or uppercase.\n * @returns True if the API supports the currency, false otherwise.\n */\n validateCurrencySupported(currency: unknown): currency is SupportedCurrency {\n const supportedCurrencies = getSupportedCurrencies();\n return (\n typeof currency === 'string' &&\n supportedCurrencies.includes(currency.toLowerCase())\n );\n }\n\n /**\n * Fetches the list of supported currencies from the API.\n *\n * @returns The list of supported currencies.\n */\n async updateSupportedCurrencies(): Promise<string[]> {\n return fetchSupportedCurrencies();\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/assets-controllers",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "105.0.0-preview-d8ff44d",
|
|
4
4
|
"description": "Controllers which manage interactions involving ERC-20, ERC-721, and ERC-1155 tokens (including NFTs)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ethereum",
|
|
@@ -69,11 +69,11 @@
|
|
|
69
69
|
"@metamask/core-backend": "^6.2.1",
|
|
70
70
|
"@metamask/eth-query": "^4.0.0",
|
|
71
71
|
"@metamask/keyring-api": "^23.0.1",
|
|
72
|
-
"@metamask/keyring-controller": "^25.
|
|
73
|
-
"@metamask/messenger": "^1.
|
|
72
|
+
"@metamask/keyring-controller": "^25.3.0",
|
|
73
|
+
"@metamask/messenger": "^1.2.0",
|
|
74
74
|
"@metamask/metamask-eth-abis": "^3.1.1",
|
|
75
75
|
"@metamask/multichain-account-service": "^8.0.1",
|
|
76
|
-
"@metamask/network-controller": "^30.0
|
|
76
|
+
"@metamask/network-controller": "^30.1.0",
|
|
77
77
|
"@metamask/network-enablement-controller": "^5.0.2",
|
|
78
78
|
"@metamask/permission-controller": "^12.3.0",
|
|
79
79
|
"@metamask/phishing-controller": "^17.1.1",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"@metamask/account-api": "^1.0.3",
|
|
105
105
|
"@metamask/auto-changelog": "^6.1.0",
|
|
106
106
|
"@metamask/ethjs-provider-http": "^0.3.0",
|
|
107
|
-
"@metamask/keyring-internal-api": "^
|
|
107
|
+
"@metamask/keyring-internal-api": "^11.0.0",
|
|
108
108
|
"@metamask/keyring-snap-client": "^9.0.1",
|
|
109
109
|
"@metamask/providers": "^22.1.0",
|
|
110
110
|
"@ts-bridge/cli": "^0.6.4",
|