@glowlabs-org/utils 0.2.8 → 0.2.10

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.
@@ -619,27 +619,42 @@ function ControlRouter(baseUrl) {
619
619
  throw new Error(parseApiError$1(error));
620
620
  }
621
621
  };
622
- const fetchMintedEvents = async () => {
622
+ const fetchGlwPrice = async () => {
623
623
  try {
624
- const data = await request(`/events/minted?page=1&limit=50`);
624
+ const data = await request(`/price/glw`);
625
+ return data.currentPriceUsdc;
626
+ }
627
+ catch (error) {
628
+ throw new Error(parseApiError$1(error));
629
+ }
630
+ };
631
+ // Build pagination query helper
632
+ const buildPaginationQuery = (page, limit) => {
633
+ const p = page ?? 1;
634
+ const l = limit ?? 50;
635
+ return `?page=${p}&limit=${l}`;
636
+ };
637
+ const fetchMintedEvents = async (page, limit) => {
638
+ try {
639
+ const data = await request(`/events/minted${buildPaginationQuery(page, limit)}`);
625
640
  return data.events ?? [];
626
641
  }
627
642
  catch (error) {
628
643
  throw new Error(parseApiError$1(error));
629
644
  }
630
645
  };
631
- const fetchStakeEvents = async () => {
646
+ const fetchStakeEvents = async (page, limit) => {
632
647
  try {
633
- const data = await request(`/events/stake?page=1&limit=50`);
648
+ const data = await request(`/events/stake${buildPaginationQuery(page, limit)}`);
634
649
  return data.events ?? [];
635
650
  }
636
651
  catch (error) {
637
652
  throw new Error(parseApiError$1(error));
638
653
  }
639
654
  };
640
- const fetchPendingTransfers = async () => {
655
+ const fetchPendingTransfers = async (page, limit) => {
641
656
  try {
642
- const data = await request(`/transfers/pending?page=1&limit=50`);
657
+ const data = await request(`/transfers/pending${buildPaginationQuery(page, limit)}`);
643
658
  return data.transfers ?? [];
644
659
  }
645
660
  catch (error) {
@@ -654,9 +669,9 @@ function ControlRouter(baseUrl) {
654
669
  throw new Error(parseApiError$1(error));
655
670
  }
656
671
  };
657
- const fetchFailedOperations = async () => {
672
+ const fetchFailedOperations = async (page, limit) => {
658
673
  try {
659
- const data = await request(`/operations/failed?page=1&limit=50`);
674
+ const data = await request(`/operations/failed${buildPaginationQuery(page, limit)}`);
660
675
  return data.operations ?? [];
661
676
  }
662
677
  catch (error) {
@@ -761,6 +776,7 @@ function ControlRouter(baseUrl) {
761
776
  // Queries
762
777
  fetchGctlBalance,
763
778
  fetchGctlPrice,
779
+ fetchGlwPrice,
764
780
  fetchMintedEvents,
765
781
  fetchStakeEvents,
766
782
  fetchPendingTransfers,
@@ -787,6 +803,676 @@ function ControlRouter(baseUrl) {
787
803
  };
788
804
  }
789
805
 
806
+ // Region metadata for kickstarter campaigns
807
+ const regionMetadata = {
808
+ // US States
809
+ "US-AL": {
810
+ code: "US-AL",
811
+ name: "Alabama",
812
+ description: "The Heart of Dixie is ready for solar transformation",
813
+ isUs: true,
814
+ flag: "🇺🇸",
815
+ },
816
+ "US-AK": {
817
+ code: "US-AK",
818
+ name: "Alaska",
819
+ description: "The Last Frontier embracing renewable energy",
820
+ isUs: true,
821
+ flag: "🇺🇸",
822
+ },
823
+ "US-AZ": {
824
+ code: "US-AZ",
825
+ name: "Arizona",
826
+ description: "The Grand Canyon State with abundant sunshine",
827
+ isUs: true,
828
+ flag: "🇺🇸",
829
+ },
830
+ "US-AR": {
831
+ code: "US-AR",
832
+ name: "Arkansas",
833
+ description: "The Natural State going solar",
834
+ isUs: true,
835
+ flag: "🇺🇸",
836
+ },
837
+ "US-CA": {
838
+ code: "US-CA",
839
+ name: "California",
840
+ description: "The Golden State leading solar innovation",
841
+ isUs: true,
842
+ flag: "🇺🇸",
843
+ },
844
+ "US-CO": {
845
+ code: "US-CO",
846
+ name: "Colorado",
847
+ description: "The Centennial State with high-altitude solar potential",
848
+ isUs: true,
849
+ flag: "🇺🇸",
850
+ },
851
+ "US-CT": {
852
+ code: "US-CT",
853
+ name: "Connecticut",
854
+ description: "The Constitution State embracing clean energy",
855
+ isUs: true,
856
+ flag: "🇺🇸",
857
+ },
858
+ "US-DE": {
859
+ code: "US-DE",
860
+ name: "Delaware",
861
+ description: "The First State to go solar",
862
+ isUs: true,
863
+ flag: "🇺🇸",
864
+ },
865
+ "US-FL": {
866
+ code: "US-FL",
867
+ name: "Florida",
868
+ description: "The Sunshine State living up to its name",
869
+ isUs: true,
870
+ flag: "🇺🇸",
871
+ },
872
+ "US-GA": {
873
+ code: "US-GA",
874
+ name: "Georgia",
875
+ description: "The Peach State harvesting solar energy",
876
+ isUs: true,
877
+ flag: "🇺🇸",
878
+ },
879
+ "US-HI": {
880
+ code: "US-HI",
881
+ name: "Hawaii",
882
+ description: "The Aloha State with year-round solar potential",
883
+ isUs: true,
884
+ flag: "🇺🇸",
885
+ },
886
+ "US-ID": {
887
+ code: "US-ID",
888
+ name: "Idaho",
889
+ description: "The Gem State shining with solar power",
890
+ isUs: true,
891
+ flag: "🇺🇸",
892
+ },
893
+ "US-IL": {
894
+ code: "US-IL",
895
+ name: "Illinois",
896
+ description: "The Prairie State powering up with solar",
897
+ isUs: true,
898
+ flag: "🇺🇸",
899
+ },
900
+ "US-IN": {
901
+ code: "US-IN",
902
+ name: "Indiana",
903
+ description: "The Hoosier State joining the solar revolution",
904
+ isUs: true,
905
+ flag: "🇺🇸",
906
+ },
907
+ "US-IA": {
908
+ code: "US-IA",
909
+ name: "Iowa",
910
+ description: "The Hawkeye State expanding beyond wind to solar",
911
+ isUs: true,
912
+ flag: "🇺🇸",
913
+ },
914
+ "US-KS": {
915
+ code: "US-KS",
916
+ name: "Kansas",
917
+ description: "The Sunflower State growing solar energy",
918
+ isUs: true,
919
+ flag: "🇺🇸",
920
+ },
921
+ "US-KY": {
922
+ code: "US-KY",
923
+ name: "Kentucky",
924
+ description: "The Bluegrass State transitioning to clean energy",
925
+ isUs: true,
926
+ flag: "🇺🇸",
927
+ },
928
+ "US-LA": {
929
+ code: "US-LA",
930
+ name: "Louisiana",
931
+ description: "The Pelican State soaring with solar",
932
+ isUs: true,
933
+ flag: "🇺🇸",
934
+ },
935
+ "US-ME": {
936
+ code: "US-ME",
937
+ name: "Maine",
938
+ description: "The Pine Tree State branching into solar",
939
+ isUs: true,
940
+ flag: "🇺🇸",
941
+ },
942
+ "US-MD": {
943
+ code: "US-MD",
944
+ name: "Maryland",
945
+ description: "The Old Line State drawing new energy lines",
946
+ isUs: true,
947
+ flag: "🇺🇸",
948
+ },
949
+ "US-MA": {
950
+ code: "US-MA",
951
+ name: "Massachusetts",
952
+ description: "The Bay State leading in solar innovation",
953
+ isUs: true,
954
+ flag: "🇺🇸",
955
+ },
956
+ "US-MI": {
957
+ code: "US-MI",
958
+ name: "Michigan",
959
+ description: "The Great Lakes State harnessing solar power",
960
+ isUs: true,
961
+ flag: "🇺🇸",
962
+ },
963
+ "US-MN": {
964
+ code: "US-MN",
965
+ name: "Minnesota",
966
+ description: "The North Star State guiding solar adoption",
967
+ isUs: true,
968
+ flag: "🇺🇸",
969
+ },
970
+ "US-MS": {
971
+ code: "US-MS",
972
+ name: "Mississippi",
973
+ description: "The Magnolia State blooming with solar energy",
974
+ isUs: true,
975
+ flag: "🇺🇸",
976
+ },
977
+ "US-MO": {
978
+ code: "US-MO",
979
+ name: "Missouri",
980
+ description: "The Show-Me State showing solar leadership",
981
+ isUs: true,
982
+ flag: "🇺🇸",
983
+ },
984
+ "US-MT": {
985
+ code: "US-MT",
986
+ name: "Montana",
987
+ description: "Big Sky Country with big solar potential",
988
+ isUs: true,
989
+ flag: "🇺🇸",
990
+ },
991
+ "US-NE": {
992
+ code: "US-NE",
993
+ name: "Nebraska",
994
+ description: "The Cornhusker State cultivating solar power",
995
+ isUs: true,
996
+ flag: "🇺🇸",
997
+ },
998
+ "US-NV": {
999
+ code: "US-NV",
1000
+ name: "Nevada",
1001
+ description: "The Silver State striking solar gold",
1002
+ isUs: true,
1003
+ flag: "🇺🇸",
1004
+ },
1005
+ "US-NH": {
1006
+ code: "US-NH",
1007
+ name: "New Hampshire",
1008
+ description: "The Granite State building solid solar foundation",
1009
+ isUs: true,
1010
+ flag: "🇺🇸",
1011
+ },
1012
+ "US-NJ": {
1013
+ code: "US-NJ",
1014
+ name: "New Jersey",
1015
+ description: "The Garden State growing solar gardens",
1016
+ isUs: true,
1017
+ flag: "🇺🇸",
1018
+ },
1019
+ "US-NM": {
1020
+ code: "US-NM",
1021
+ name: "New Mexico",
1022
+ description: "The Land of Enchantment enchanted by solar",
1023
+ isUs: true,
1024
+ flag: "🇺🇸",
1025
+ },
1026
+ "US-NY": {
1027
+ code: "US-NY",
1028
+ name: "New York",
1029
+ description: "The Empire State building a solar empire",
1030
+ isUs: true,
1031
+ flag: "🇺🇸",
1032
+ },
1033
+ "US-NC": {
1034
+ code: "US-NC",
1035
+ name: "North Carolina",
1036
+ description: "The Tar Heel State stepping into solar",
1037
+ isUs: true,
1038
+ flag: "🇺🇸",
1039
+ },
1040
+ "US-ND": {
1041
+ code: "US-ND",
1042
+ name: "North Dakota",
1043
+ description: "The Peace Garden State cultivating solar peace",
1044
+ isUs: true,
1045
+ flag: "🇺🇸",
1046
+ },
1047
+ "US-OH": {
1048
+ code: "US-OH",
1049
+ name: "Ohio",
1050
+ description: "The Buckeye State branching into solar",
1051
+ isUs: true,
1052
+ flag: "🇺🇸",
1053
+ },
1054
+ "US-OK": {
1055
+ code: "US-OK",
1056
+ name: "Oklahoma",
1057
+ description: "The Sooner State adopting solar sooner",
1058
+ isUs: true,
1059
+ flag: "🇺🇸",
1060
+ },
1061
+ "US-OR": {
1062
+ code: "US-OR",
1063
+ name: "Oregon",
1064
+ description: "The Beaver State building solar dams",
1065
+ isUs: true,
1066
+ flag: "🇺🇸",
1067
+ },
1068
+ "US-PA": {
1069
+ code: "US-PA",
1070
+ name: "Pennsylvania",
1071
+ description: "The Keystone State unlocking solar potential",
1072
+ isUs: true,
1073
+ flag: "🇺🇸",
1074
+ },
1075
+ "US-RI": {
1076
+ code: "US-RI",
1077
+ name: "Rhode Island",
1078
+ description: "The Ocean State riding the solar wave",
1079
+ isUs: true,
1080
+ flag: "🇺🇸",
1081
+ },
1082
+ "US-SC": {
1083
+ code: "US-SC",
1084
+ name: "South Carolina",
1085
+ description: "The Palmetto State basking in solar",
1086
+ isUs: true,
1087
+ flag: "🇺🇸",
1088
+ },
1089
+ "US-SD": {
1090
+ code: "US-SD",
1091
+ name: "South Dakota",
1092
+ description: "Mount Rushmore State carving out solar future",
1093
+ isUs: true,
1094
+ flag: "🇺🇸",
1095
+ },
1096
+ "US-TN": {
1097
+ code: "US-TN",
1098
+ name: "Tennessee",
1099
+ description: "The Volunteer State volunteering for solar",
1100
+ isUs: true,
1101
+ flag: "🇺🇸",
1102
+ },
1103
+ "US-TX": {
1104
+ code: "US-TX",
1105
+ name: "Texas",
1106
+ description: "The Lone Star State shining with solar power",
1107
+ isUs: true,
1108
+ flag: "🇺🇸",
1109
+ },
1110
+ "US-UT": {
1111
+ code: "US-UT",
1112
+ name: "Utah",
1113
+ description: "The Beehive State buzzing with solar activity",
1114
+ isUs: true,
1115
+ flag: "🇺🇸",
1116
+ },
1117
+ "US-VT": {
1118
+ code: "US-VT",
1119
+ name: "Vermont",
1120
+ description: "The Green Mountain State going greener",
1121
+ isUs: true,
1122
+ flag: "🇺🇸",
1123
+ },
1124
+ "US-VA": {
1125
+ code: "US-VA",
1126
+ name: "Virginia",
1127
+ description: "The Old Dominion embracing new energy",
1128
+ isUs: true,
1129
+ flag: "🇺🇸",
1130
+ },
1131
+ "US-WA": {
1132
+ code: "US-WA",
1133
+ name: "Washington",
1134
+ description: "The Evergreen State staying green with solar",
1135
+ isUs: true,
1136
+ flag: "🇺🇸",
1137
+ },
1138
+ "US-WV": {
1139
+ code: "US-WV",
1140
+ name: "West Virginia",
1141
+ description: "The Mountain State reaching new heights",
1142
+ isUs: true,
1143
+ flag: "🇺🇸",
1144
+ },
1145
+ "US-WI": {
1146
+ code: "US-WI",
1147
+ name: "Wisconsin",
1148
+ description: "The Badger State digging into solar",
1149
+ isUs: true,
1150
+ flag: "🇺🇸",
1151
+ },
1152
+ "US-WY": {
1153
+ code: "US-WY",
1154
+ name: "Wyoming",
1155
+ description: "The Equality State equalizing energy access",
1156
+ isUs: true,
1157
+ flag: "🇺🇸",
1158
+ },
1159
+ // Countries
1160
+ CA: {
1161
+ code: "CA",
1162
+ name: "Canada",
1163
+ description: "The Great White North embracing solar energy",
1164
+ isUs: false,
1165
+ flag: "🇨🇦",
1166
+ },
1167
+ MX: {
1168
+ code: "MX",
1169
+ name: "Mexico",
1170
+ description: "Abundant sunshine powering the future",
1171
+ isUs: false,
1172
+ flag: "🇲🇽",
1173
+ },
1174
+ BR: {
1175
+ code: "BR",
1176
+ name: "Brazil",
1177
+ description: "The largest South American market for solar",
1178
+ isUs: false,
1179
+ flag: "🇧🇷",
1180
+ },
1181
+ AR: {
1182
+ code: "AR",
1183
+ name: "Argentina",
1184
+ description: "Pampas and sunshine creating energy independence",
1185
+ isUs: false,
1186
+ flag: "🇦🇷",
1187
+ },
1188
+ CL: {
1189
+ code: "CL",
1190
+ name: "Chile",
1191
+ description: "The Atacama Desert's solar potential unleashed",
1192
+ isUs: false,
1193
+ flag: "🇨🇱",
1194
+ },
1195
+ CO: {
1196
+ code: "CO",
1197
+ name: "Colombia",
1198
+ description: "Equatorial sunshine year-round",
1199
+ isUs: false,
1200
+ flag: "🇨🇴",
1201
+ },
1202
+ PE: {
1203
+ code: "PE",
1204
+ name: "Peru",
1205
+ description: "From the Andes to the Amazon with solar",
1206
+ isUs: false,
1207
+ flag: "🇵🇪",
1208
+ },
1209
+ GB: {
1210
+ code: "GB",
1211
+ name: "United Kingdom",
1212
+ description: "Leading Europe's renewable transition",
1213
+ isUs: false,
1214
+ flag: "🇬🇧",
1215
+ },
1216
+ FR: {
1217
+ code: "FR",
1218
+ name: "France",
1219
+ description: "La République embracing solar liberté",
1220
+ isUs: false,
1221
+ flag: "🇫🇷",
1222
+ },
1223
+ DE: {
1224
+ code: "DE",
1225
+ name: "Germany",
1226
+ description: "Engineering excellence in solar deployment",
1227
+ isUs: false,
1228
+ flag: "🇩🇪",
1229
+ },
1230
+ IT: {
1231
+ code: "IT",
1232
+ name: "Italy",
1233
+ description: "Mediterranean sunshine powering the boot",
1234
+ isUs: false,
1235
+ flag: "🇮🇹",
1236
+ },
1237
+ ES: {
1238
+ code: "ES",
1239
+ name: "Spain",
1240
+ description: "Iberian peninsula's solar powerhouse",
1241
+ isUs: false,
1242
+ flag: "🇪🇸",
1243
+ },
1244
+ PT: {
1245
+ code: "PT",
1246
+ name: "Portugal",
1247
+ description: "Atlantic coast harnessing solar waves",
1248
+ isUs: false,
1249
+ flag: "🇵🇹",
1250
+ },
1251
+ NL: {
1252
+ code: "NL",
1253
+ name: "Netherlands",
1254
+ description: "Low lands, high solar ambitions",
1255
+ isUs: false,
1256
+ flag: "🇳🇱",
1257
+ },
1258
+ BE: {
1259
+ code: "BE",
1260
+ name: "Belgium",
1261
+ description: "The heart of Europe goes solar",
1262
+ isUs: false,
1263
+ flag: "🇧🇪",
1264
+ },
1265
+ CH: {
1266
+ code: "CH",
1267
+ name: "Switzerland",
1268
+ description: "Alpine heights capturing pure sunlight",
1269
+ isUs: false,
1270
+ flag: "🇨🇭",
1271
+ },
1272
+ AT: {
1273
+ code: "AT",
1274
+ name: "Austria",
1275
+ description: "Mountain valleys filled with solar panels",
1276
+ isUs: false,
1277
+ flag: "🇦🇹",
1278
+ },
1279
+ SE: {
1280
+ code: "SE",
1281
+ name: "Sweden",
1282
+ description: "Nordic innovation in solar technology",
1283
+ isUs: false,
1284
+ flag: "🇸🇪",
1285
+ },
1286
+ NO: {
1287
+ code: "NO",
1288
+ name: "Norway",
1289
+ description: "Fjords reflecting solar possibilities",
1290
+ isUs: false,
1291
+ flag: "🇳🇴",
1292
+ },
1293
+ DK: {
1294
+ code: "DK",
1295
+ name: "Denmark",
1296
+ description: "Viking spirit conquering solar frontiers",
1297
+ isUs: false,
1298
+ flag: "🇩🇰",
1299
+ },
1300
+ FI: {
1301
+ code: "FI",
1302
+ name: "Finland",
1303
+ description: "Land of midnight sun going solar",
1304
+ isUs: false,
1305
+ flag: "🇫🇮",
1306
+ },
1307
+ PL: {
1308
+ code: "PL",
1309
+ name: "Poland",
1310
+ description: "Central Europe's emerging solar market",
1311
+ isUs: false,
1312
+ flag: "🇵🇱",
1313
+ },
1314
+ CZ: {
1315
+ code: "CZ",
1316
+ name: "Czech Republic",
1317
+ description: "Bohemian innovation in renewable energy",
1318
+ isUs: false,
1319
+ flag: "🇨🇿",
1320
+ },
1321
+ GR: {
1322
+ code: "GR",
1323
+ name: "Greece",
1324
+ description: "Aegean sunshine powering ancient lands",
1325
+ isUs: false,
1326
+ flag: "🇬🇷",
1327
+ },
1328
+ TR: {
1329
+ code: "TR",
1330
+ name: "Turkey",
1331
+ description: "Bridge between continents powered by sun",
1332
+ isUs: false,
1333
+ flag: "🇹🇷",
1334
+ },
1335
+ IN: {
1336
+ code: "IN",
1337
+ name: "India",
1338
+ description: "World's fastest growing solar market",
1339
+ isUs: false,
1340
+ flag: "🇮🇳",
1341
+ },
1342
+ CN: {
1343
+ code: "CN",
1344
+ name: "China",
1345
+ description: "Global solar manufacturing leader",
1346
+ isUs: false,
1347
+ flag: "🇨🇳",
1348
+ },
1349
+ JP: {
1350
+ code: "JP",
1351
+ name: "Japan",
1352
+ description: "Rising sun powering technological innovation",
1353
+ isUs: false,
1354
+ flag: "🇯🇵",
1355
+ },
1356
+ KR: {
1357
+ code: "KR",
1358
+ name: "South Korea",
1359
+ description: "High-tech nation embracing green energy",
1360
+ isUs: false,
1361
+ flag: "🇰🇷",
1362
+ },
1363
+ AU: {
1364
+ code: "AU",
1365
+ name: "Australia",
1366
+ description: "Outback sunshine creating energy abundance",
1367
+ isUs: false,
1368
+ flag: "🇦🇺",
1369
+ },
1370
+ NZ: {
1371
+ code: "NZ",
1372
+ name: "New Zealand",
1373
+ description: "Clean, green Aotearoa",
1374
+ isUs: false,
1375
+ flag: "🇳🇿",
1376
+ },
1377
+ ZA: {
1378
+ code: "ZA",
1379
+ name: "South Africa",
1380
+ description: "African sunshine lighting the continent",
1381
+ isUs: false,
1382
+ flag: "🇿🇦",
1383
+ },
1384
+ EG: {
1385
+ code: "EG",
1386
+ name: "Egypt",
1387
+ description: "Desert sun powering ancient civilizations",
1388
+ isUs: false,
1389
+ flag: "🇪🇬",
1390
+ },
1391
+ NG: {
1392
+ code: "NG",
1393
+ name: "Nigeria",
1394
+ description: "West Africa's solar giant awakening",
1395
+ isUs: false,
1396
+ flag: "🇳🇬",
1397
+ },
1398
+ KE: {
1399
+ code: "KE",
1400
+ name: "Kenya",
1401
+ description: "East African solar innovation hub",
1402
+ isUs: false,
1403
+ flag: "🇰🇪",
1404
+ },
1405
+ MA: {
1406
+ code: "MA",
1407
+ name: "Morocco",
1408
+ description: "Saharan edge harnessing desert power",
1409
+ isUs: false,
1410
+ flag: "🇲🇦",
1411
+ },
1412
+ SA: {
1413
+ code: "SA",
1414
+ name: "Saudi Arabia",
1415
+ description: "Oil kingdom transitioning to solar",
1416
+ isUs: false,
1417
+ flag: "🇸🇦",
1418
+ },
1419
+ AE: {
1420
+ code: "AE",
1421
+ name: "United Arab Emirates",
1422
+ description: "Desert emirates building solar oases",
1423
+ isUs: false,
1424
+ flag: "🇦🇪",
1425
+ },
1426
+ IL: {
1427
+ code: "IL",
1428
+ name: "Israel",
1429
+ description: "Innovation nation powered by sunshine",
1430
+ isUs: false,
1431
+ flag: "🇮🇱",
1432
+ },
1433
+ SG: {
1434
+ code: "SG",
1435
+ name: "Singapore",
1436
+ description: "City-state maximizing rooftop solar",
1437
+ isUs: false,
1438
+ flag: "🇸🇬",
1439
+ },
1440
+ ID: {
1441
+ code: "ID",
1442
+ name: "Indonesia",
1443
+ description: "Archipelago nation harnessing tropical sun",
1444
+ isUs: false,
1445
+ flag: "🇮🇩",
1446
+ },
1447
+ TH: {
1448
+ code: "TH",
1449
+ name: "Thailand",
1450
+ description: "Land of smiles powered by solar",
1451
+ isUs: false,
1452
+ flag: "🇹🇭",
1453
+ },
1454
+ VN: {
1455
+ code: "VN",
1456
+ name: "Vietnam",
1457
+ description: "Southeast Asian solar manufacturing hub",
1458
+ isUs: false,
1459
+ flag: "🇻🇳",
1460
+ },
1461
+ PH: {
1462
+ code: "PH",
1463
+ name: "Philippines",
1464
+ description: "7,000 islands unified by solar power",
1465
+ isUs: false,
1466
+ flag: "🇵🇭",
1467
+ },
1468
+ };
1469
+ // Helper to get all regions as array
1470
+ const allRegions = Object.values(regionMetadata);
1471
+ // Helper to get US states
1472
+ const usStates = allRegions.filter((r) => r.isUs);
1473
+ // Helper to get countries
1474
+ const countries = allRegions.filter((r) => !r.isUs);
1475
+
790
1476
  // ---------------------------------------------------------------------------
791
1477
  // Helpers
792
1478
  // ---------------------------------------------------------------------------
@@ -867,9 +1553,6 @@ function RegionRouter(baseUrl) {
867
1553
  // -------------------------------------------------------------------------
868
1554
  // Helpers (derived)
869
1555
  // -------------------------------------------------------------------------
870
- // NOTE: regionMetadata is imported lazily to avoid circular deps at load time.
871
- // eslint-disable-next-line @typescript-eslint/no-var-requires
872
- const { regionMetadata } = require("@/lib/region-metadata");
873
1556
  const getRegionByCode = (code) => {
874
1557
  const metadata = regionMetadata[code];
875
1558
  if (!metadata)
@@ -930,6 +1613,10 @@ exports.HUB_URL = HUB_URL;
930
1613
  exports.MAX_WEIGHT = MAX_WEIGHT;
931
1614
  exports.RegionRouter = RegionRouter;
932
1615
  exports.USDG_WEIGHT_DECIMAL_PRECISION = USDG_WEIGHT_DECIMAL_PRECISION;
1616
+ exports.allRegions = allRegions;
1617
+ exports.countries = countries;
933
1618
  exports.getAddresses = getAddresses;
1619
+ exports.regionMetadata = regionMetadata;
1620
+ exports.usStates = usStates;
934
1621
  exports.useForwarder = useForwarder;
935
- //# sourceMappingURL=region-router-6Tfi1vcZ.js.map
1622
+ //# sourceMappingURL=region-router-CzrD4tSu.js.map