@bze/bze-ui-kit 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -678,11 +678,28 @@ var formatTimeRemaining = (targetDate) => {
678
678
  if (minutes > 0) parts.push(`${minutes}m`);
679
679
  return parts.join(" ") || "Now";
680
680
  };
681
- var formatTimeRemainingFromEpochs = (epochs) => {
682
- if (epochs.lte(0)) {
681
+ function formatTimeRemainingFromEpochs(endEpoch, currentEpoch) {
682
+ let epochDiff;
683
+ if (currentEpoch !== void 0) {
684
+ const endBN = toBigNumber(endEpoch);
685
+ const currentBN = toBigNumber(currentEpoch);
686
+ epochDiff = endBN.minus(currentBN);
687
+ if (epochDiff.lte(0)) {
688
+ return "Ended";
689
+ }
690
+ const hoursRemaining = epochDiff.toNumber();
691
+ const daysRemaining = Math.floor(hoursRemaining / 24);
692
+ const hoursRemainder = hoursRemaining % 24;
693
+ if (daysRemaining > 0) {
694
+ return `${daysRemaining}d ${hoursRemainder}h`;
695
+ }
696
+ return `${hoursRemainder}h`;
697
+ }
698
+ epochDiff = toBigNumber(endEpoch);
699
+ if (epochDiff.lte(0)) {
683
700
  return "Now";
684
701
  }
685
- const totalSeconds = epochs.multipliedBy(60).toNumber();
702
+ const totalSeconds = epochDiff.multipliedBy(60).toNumber();
686
703
  const days = Math.floor(totalSeconds / (60 * 60 * 24));
687
704
  const hours = Math.floor(totalSeconds % (60 * 60 * 24) / (60 * 60));
688
705
  const minutes = Math.floor(totalSeconds % (60 * 60) / 60);
@@ -691,7 +708,7 @@ var formatTimeRemainingFromEpochs = (epochs) => {
691
708
  if (hours > 0) parts.push(`${hours}h`);
692
709
  if (minutes > 0) parts.push(`${minutes}m`);
693
710
  return parts.join(" ") || "Now";
694
- };
711
+ }
695
712
 
696
713
  // src/utils/functions.ts
697
714
  async function sleep(ms) {
@@ -975,6 +992,207 @@ var getPageRequestWithLimit = (limit) => {
975
992
  // src/query/burner.ts
976
993
  import { bze as bze2 } from "@bze/bzejs";
977
994
  import { PageRequest as PageRequest2 } from "@bze/bzejs/cosmos/base/query/v1beta1/pagination";
995
+
996
+ // src/constants/endpoints.ts
997
+ function getRestURL() {
998
+ return process.env.NEXT_PUBLIC_REST_URL || "";
999
+ }
1000
+ function getRpcURL() {
1001
+ return process.env.NEXT_PUBLIC_RPC_URL || "";
1002
+ }
1003
+ function getArchwayRpcURL() {
1004
+ return process.env.NEXT_PUBLIC_RPC_URL_ARCHWAY || "";
1005
+ }
1006
+ function getOsmosisRpcUrl() {
1007
+ return process.env.NEXT_PUBLIC_RPC_URL_OSMOSIS || "";
1008
+ }
1009
+ function getNobleRpcUrl() {
1010
+ return process.env.NEXT_PUBLIC_RPC_URL_NOBLE || "";
1011
+ }
1012
+ function getJackalRpcUrl() {
1013
+ return process.env.NEXT_PUBLIC_RPC_URL_JACKAL || "";
1014
+ }
1015
+ function getOmniFlixRpcUrl() {
1016
+ return process.env.NEXT_PUBLIC_RPC_URL_FLIX || "";
1017
+ }
1018
+ function getAtomOneRpcUrl() {
1019
+ return process.env.NEXT_PUBLIC_RPC_URL_ATOMONE || "";
1020
+ }
1021
+ function getArchwayRestURL() {
1022
+ return process.env.NEXT_PUBLIC_REST_URL_ARCHWAY || "";
1023
+ }
1024
+ function getOsmosisRestURL() {
1025
+ return process.env.NEXT_PUBLIC_REST_URL_OSMOSIS || "";
1026
+ }
1027
+ function getNobleRestURL() {
1028
+ return process.env.NEXT_PUBLIC_REST_URL_NOBLE || "";
1029
+ }
1030
+ function getJackalRestURL() {
1031
+ return process.env.NEXT_PUBLIC_REST_URL_JACKAL || "";
1032
+ }
1033
+ function getOmniFlixRestURL() {
1034
+ return process.env.NEXT_PUBLIC_REST_URL_FLIX || "";
1035
+ }
1036
+ function getAtomOneRestURL() {
1037
+ return process.env.NEXT_PUBLIC_REST_URL_ATOMONE || "";
1038
+ }
1039
+ var getAggregatorHost = () => {
1040
+ var _a2;
1041
+ return (_a2 = process.env.NEXT_PUBLIC_AGG_API_HOST) != null ? _a2 : "https://getbze.com";
1042
+ };
1043
+
1044
+ // src/query/module.ts
1045
+ var MODULE_ADDRESS_KEY = "auth:module:address:";
1046
+ var MODULE_ADDRESS_CACHE_TTL = 60 * 60 * 48;
1047
+ function getHardcodedBurnerAddress() {
1048
+ return "bze1v7uw4xhrcv0vk7qp8jf9lu3hm5d8uu5yjp5qun";
1049
+ }
1050
+ function getHardcodedRaffleAddress() {
1051
+ return "bze18hsqalgwlzqavrrkfnxmrjmygwyjy8senx5tgs";
1052
+ }
1053
+ function getHardcodedLockAddress() {
1054
+ return "bze1pc5zjcvhx3e8l305zjl72grytfa30r5mdypmw4";
1055
+ }
1056
+ function getBurnerModuleAddress() {
1057
+ return getHardcodedBurnerAddress();
1058
+ }
1059
+ function getRaffleModuleAddress() {
1060
+ return getHardcodedRaffleAddress();
1061
+ }
1062
+ async function getModuleAddress(module) {
1063
+ var _a2;
1064
+ try {
1065
+ const cacheKey = `${MODULE_ADDRESS_KEY}${module}`;
1066
+ const localData = getFromLocalStorage(cacheKey);
1067
+ if (null !== localData) {
1068
+ return localData;
1069
+ }
1070
+ const url = getRestURL();
1071
+ const response = await fetch(`${url}/cosmos/auth/v1beta1/module_accounts/${module}`);
1072
+ if (!response.ok) {
1073
+ return "";
1074
+ }
1075
+ const parsed = await response.json();
1076
+ const addy = (_a2 = parsed.account.base_account) == null ? void 0 : _a2.address;
1077
+ if (addy === void 0) {
1078
+ return "";
1079
+ }
1080
+ setInLocalStorage(cacheKey, addy, MODULE_ADDRESS_CACHE_TTL);
1081
+ return addy;
1082
+ } catch (e) {
1083
+ console.error(e);
1084
+ return "";
1085
+ }
1086
+ }
1087
+
1088
+ // src/query/bank.ts
1089
+ async function getAddressBalances(address) {
1090
+ try {
1091
+ const client = await getRestClient();
1092
+ const response = await client.cosmos.bank.v1beta1.spendableBalances({ address });
1093
+ return response.balances;
1094
+ } catch (e) {
1095
+ console.error("failed to get balances", e);
1096
+ return [];
1097
+ }
1098
+ }
1099
+ async function getLockedBalances() {
1100
+ try {
1101
+ const lockerAddress = getLockerAddress();
1102
+ if (!lockerAddress) {
1103
+ console.warn("Locker address not configured");
1104
+ return [];
1105
+ }
1106
+ return await getAddressBalances(lockerAddress);
1107
+ } catch (e) {
1108
+ console.error("failed to get locked balances", e);
1109
+ return [];
1110
+ }
1111
+ }
1112
+
1113
+ // src/query/epoch.ts
1114
+ var EPOCH_HOUR = "hour";
1115
+ var EPOCH_DAY = "day";
1116
+ var EPOCH_WEEK = "week";
1117
+ var EPOCHS_INFO_CACHE_KEY = "epochs:info";
1118
+ var EPOCHS_INFO_CACHE_TTL = 60 * 60;
1119
+ async function getEpochsInfo() {
1120
+ try {
1121
+ const cachedData = getFromLocalStorage(EPOCHS_INFO_CACHE_KEY);
1122
+ let shouldFetchFromEndpoint = false;
1123
+ if (cachedData !== null) {
1124
+ const cached = JSON.parse(cachedData);
1125
+ const now = (/* @__PURE__ */ new Date()).getTime();
1126
+ for (const epoch of cached.epochs) {
1127
+ if (epoch.current_epoch_start_time) {
1128
+ const startTime = new Date(epoch.current_epoch_start_time).getTime();
1129
+ const duration = getEpochDurationByIdentifier(epoch.identifier);
1130
+ const epochEndTime = startTime + duration - 15 * 1e3;
1131
+ if (now >= epochEndTime) {
1132
+ shouldFetchFromEndpoint = true;
1133
+ break;
1134
+ }
1135
+ }
1136
+ }
1137
+ if (!shouldFetchFromEndpoint) {
1138
+ return cached;
1139
+ }
1140
+ }
1141
+ const client = await getRestClient();
1142
+ const response = await client.bze.epochs.epochInfos();
1143
+ setInLocalStorage(EPOCHS_INFO_CACHE_KEY, JSON.stringify(response), EPOCHS_INFO_CACHE_TTL);
1144
+ return response;
1145
+ } catch (e) {
1146
+ console.error(e);
1147
+ return { epochs: [] };
1148
+ }
1149
+ }
1150
+ async function getCurrentEpoch(identifier) {
1151
+ const all = await getEpochsInfo();
1152
+ return all.epochs.find((item) => item.identifier === identifier);
1153
+ }
1154
+ async function getHourEpochInfo() {
1155
+ return getCurrentEpoch(EPOCH_HOUR);
1156
+ }
1157
+ async function getWeekEpochInfo() {
1158
+ return getCurrentEpoch(EPOCH_WEEK);
1159
+ }
1160
+ async function getCurrentWeekEpochEndTime() {
1161
+ return getPeriodicEpochEndTime(EPOCH_WEEK);
1162
+ }
1163
+ async function getPeriodicWeekEpochEndTime(modWeek = 1) {
1164
+ return getPeriodicEpochEndTime(EPOCH_WEEK, modWeek);
1165
+ }
1166
+ async function getPeriodicEpochEndTime(identifier, mod = 1) {
1167
+ const epoch = await getCurrentEpoch(identifier);
1168
+ if (!epoch || !epoch.current_epoch_start_time) {
1169
+ return void 0;
1170
+ }
1171
+ const current = toBigNumber(epoch.current_epoch);
1172
+ let remainingEpochs = mod - current.toNumber() % mod;
1173
+ if (remainingEpochs === mod) {
1174
+ remainingEpochs = 0;
1175
+ }
1176
+ const startAt = new Date(epoch.current_epoch_start_time);
1177
+ const duration = getEpochDurationByIdentifier(identifier);
1178
+ startAt.setTime(startAt.getTime() + duration + duration * remainingEpochs);
1179
+ return startAt;
1180
+ }
1181
+ function getEpochDurationByIdentifier(identifier) {
1182
+ const hourMs = 60 * 60 * 1e3;
1183
+ switch (identifier) {
1184
+ case EPOCH_HOUR:
1185
+ return hourMs;
1186
+ case EPOCH_DAY:
1187
+ return hourMs * 24;
1188
+ case EPOCH_WEEK:
1189
+ return hourMs * 24 * 7;
1190
+ default:
1191
+ return hourMs;
1192
+ }
1193
+ }
1194
+
1195
+ // src/query/burner.ts
978
1196
  var BURNED_KEY = "burner:all_burned_coins";
979
1197
  var LOCAL_CACHE_TTL = 60 * 60 * 4;
980
1198
  var { fromPartial: QueryAllBurnedCoinsRequestFromPartial } = bze2.burner.QueryAllBurnedCoinsRequest;
@@ -1020,6 +1238,33 @@ async function getAllBurnedCoins() {
1020
1238
  };
1021
1239
  }
1022
1240
  }
1241
+ var BURN_EPOCH_COUNT = 4;
1242
+ async function getNextBurning() {
1243
+ const address = getBurnerModuleAddress();
1244
+ if (address === "") {
1245
+ return void 0;
1246
+ }
1247
+ const balances = await getAddressBalances(address);
1248
+ if (balances.length === 0) {
1249
+ return void 0;
1250
+ }
1251
+ const timeFromEpoch = await getBurningTimeFromEpoch();
1252
+ if (!timeFromEpoch) {
1253
+ return void 0;
1254
+ }
1255
+ return {
1256
+ coins: balances,
1257
+ date: timeFromEpoch
1258
+ };
1259
+ }
1260
+ async function getBurningTimeFromEpoch() {
1261
+ const params = await getBurnerParams();
1262
+ let defaultBurningMod = BURN_EPOCH_COUNT;
1263
+ if (params) {
1264
+ defaultBurningMod = toBigNumber(params.periodic_burning_weeks).toNumber();
1265
+ }
1266
+ return await getPeriodicWeekEpochEndTime(defaultBurningMod);
1267
+ }
1023
1268
 
1024
1269
  // src/utils/validation.ts
1025
1270
  function isValidUrl(urlString) {
@@ -1140,54 +1385,6 @@ var isPoolSupportedByValidator = (baseDenom, quoteDenom) => {
1140
1385
  return supportedDenoms.includes(baseDenom) || supportedDenoms.includes(quoteDenom);
1141
1386
  };
1142
1387
 
1143
- // src/constants/endpoints.ts
1144
- function getRestURL() {
1145
- return process.env.NEXT_PUBLIC_REST_URL || "";
1146
- }
1147
- function getRpcURL() {
1148
- return process.env.NEXT_PUBLIC_RPC_URL || "";
1149
- }
1150
- function getArchwayRpcURL() {
1151
- return process.env.NEXT_PUBLIC_RPC_URL_ARCHWAY || "";
1152
- }
1153
- function getOsmosisRpcUrl() {
1154
- return process.env.NEXT_PUBLIC_RPC_URL_OSMOSIS || "";
1155
- }
1156
- function getNobleRpcUrl() {
1157
- return process.env.NEXT_PUBLIC_RPC_URL_NOBLE || "";
1158
- }
1159
- function getJackalRpcUrl() {
1160
- return process.env.NEXT_PUBLIC_RPC_URL_JACKAL || "";
1161
- }
1162
- function getOmniFlixRpcUrl() {
1163
- return process.env.NEXT_PUBLIC_RPC_URL_FLIX || "";
1164
- }
1165
- function getAtomOneRpcUrl() {
1166
- return process.env.NEXT_PUBLIC_RPC_URL_ATOMONE || "";
1167
- }
1168
- function getArchwayRestURL() {
1169
- return process.env.NEXT_PUBLIC_REST_URL_ARCHWAY || "";
1170
- }
1171
- function getOsmosisRestURL() {
1172
- return process.env.NEXT_PUBLIC_REST_URL_OSMOSIS || "";
1173
- }
1174
- function getNobleRestURL() {
1175
- return process.env.NEXT_PUBLIC_REST_URL_NOBLE || "";
1176
- }
1177
- function getJackalRestURL() {
1178
- return process.env.NEXT_PUBLIC_REST_URL_JACKAL || "";
1179
- }
1180
- function getOmniFlixRestURL() {
1181
- return process.env.NEXT_PUBLIC_REST_URL_FLIX || "";
1182
- }
1183
- function getAtomOneRestURL() {
1184
- return process.env.NEXT_PUBLIC_REST_URL_ATOMONE || "";
1185
- }
1186
- var getAggregatorHost = () => {
1187
- var _a2;
1188
- return (_a2 = process.env.NEXT_PUBLIC_AGG_API_HOST) != null ? _a2 : "https://getbze.com";
1189
- };
1190
-
1191
1388
  // src/constants/market.ts
1192
1389
  var EXCLUDED_MARKETS = {
1193
1390
  "factory/bze1f0qgels0eu96ev6a67znu70q7rquy9eragn8nw/ucorey/factory/bze13gzq40che93tgfm9kzmkpjamah5nj0j73pyhqk/uvdl": true,
@@ -2001,111 +2198,125 @@ async function keplrSuggestChain(chainId) {
2001
2198
  return await ((_a2 = window.keplr) == null ? void 0 : _a2.experimentalSuggestChain(await getKeplrChainInfo(chainId)));
2002
2199
  }
2003
2200
 
2004
- // src/query/bank.ts
2005
- async function getAddressBalances(address) {
2201
+ // src/query/block.ts
2202
+ var FAILOVER_BLOCKTIMES = {
2203
+ "9334084": "2023-12-07T14:30:55.034845214Z",
2204
+ "4423602": "2023-01-18T07:51:31.391193017Z",
2205
+ "4827583": "2023-02-14T03:34:27.791387761Z",
2206
+ "5149043": "2023-03-07T11:41:10.455072975Z",
2207
+ "10855457": "2024-03-17T19:41:34.031980836Z"
2208
+ };
2209
+ var BLOCK_KEY = "tendermint:block:";
2210
+ async function getBlockDetailsByHeight(height) {
2006
2211
  try {
2212
+ const cacheKey = `${BLOCK_KEY}${height}`;
2213
+ const localData = getFromLocalStorage(cacheKey);
2214
+ if (null !== localData) {
2215
+ const parsed = JSON.parse(localData);
2216
+ if (parsed) {
2217
+ return parsed;
2218
+ }
2219
+ }
2007
2220
  const client = await getRestClient();
2008
- const response = await client.cosmos.bank.v1beta1.spendableBalances({ address });
2009
- return response.balances;
2221
+ const response = await client.cosmos.base.tendermint.v1beta1.getBlockByHeight({ height: BigInt(height.toFixed(0)) });
2222
+ setInLocalStorage(cacheKey, JSON.stringify(response), 0);
2223
+ return response;
2010
2224
  } catch (e) {
2011
- console.error("failed to get balances", e);
2012
- return [];
2225
+ console.error(e);
2226
+ return {};
2013
2227
  }
2014
2228
  }
2015
- async function getLockedBalances() {
2016
- try {
2017
- const lockerAddress = getLockerAddress();
2018
- if (!lockerAddress) {
2019
- console.warn("Locker address not configured");
2020
- return [];
2229
+ async function getBlockTimeByHeight(height) {
2230
+ var _a2, _b2;
2231
+ const details = await getBlockDetailsByHeight(height);
2232
+ if (details.block_id === void 0) {
2233
+ if (height.toFixed(0) in FAILOVER_BLOCKTIMES) {
2234
+ return new Date(FAILOVER_BLOCKTIMES[height.toFixed(0)]);
2021
2235
  }
2022
- return await getAddressBalances(lockerAddress);
2023
- } catch (e) {
2024
- console.error("failed to get locked balances", e);
2025
- return [];
2026
2236
  }
2237
+ return (_b2 = (_a2 = details.block) == null ? void 0 : _a2.header) == null ? void 0 : _b2.time;
2027
2238
  }
2028
-
2029
- // src/query/epoch.ts
2030
- var EPOCH_HOUR = "hour";
2031
- var EPOCH_DAY = "day";
2032
- var EPOCH_WEEK = "week";
2033
- var EPOCHS_INFO_CACHE_KEY = "epochs:info";
2034
- var EPOCHS_INFO_CACHE_TTL = 60 * 60;
2035
- async function getEpochsInfo() {
2239
+ async function getBlockResults(height) {
2240
+ const settings = getSettings();
2241
+ const rpcUrl = settings.endpoints.rpcEndpoint.replace("wss", "https");
2242
+ const url = `${rpcUrl}/block_results?height=${height}`;
2036
2243
  try {
2037
- const cachedData = getFromLocalStorage(EPOCHS_INFO_CACHE_KEY);
2038
- let shouldFetchFromEndpoint = false;
2039
- if (cachedData !== null) {
2040
- const cached = JSON.parse(cachedData);
2041
- const now = (/* @__PURE__ */ new Date()).getTime();
2042
- for (const epoch of cached.epochs) {
2043
- if (epoch.current_epoch_start_time) {
2044
- const startTime = new Date(epoch.current_epoch_start_time).getTime();
2045
- const duration = getEpochDurationByIdentifier(epoch.identifier);
2046
- const epochEndTime = startTime + duration - 15 * 1e3;
2047
- if (now >= epochEndTime) {
2048
- shouldFetchFromEndpoint = true;
2049
- break;
2050
- }
2051
- }
2052
- }
2053
- if (!shouldFetchFromEndpoint) {
2054
- return cached;
2244
+ const response = await fetch(url, {
2245
+ method: "GET",
2246
+ headers: {
2247
+ "Content-Type": "application/json"
2055
2248
  }
2249
+ });
2250
+ if (!response.ok) {
2251
+ console.log("not ok response from RPC: ", response);
2252
+ return void 0;
2056
2253
  }
2254
+ return await response.json();
2255
+ } catch (error) {
2256
+ console.error("Failed to fetch block results:", error);
2257
+ throw error;
2258
+ }
2259
+ }
2260
+
2261
+ // src/query/raffle.ts
2262
+ async function getRaffles() {
2263
+ try {
2057
2264
  const client = await getRestClient();
2058
- const response = await client.bze.epochs.epochInfos();
2059
- setInLocalStorage(EPOCHS_INFO_CACHE_KEY, JSON.stringify(response), EPOCHS_INFO_CACHE_TTL);
2060
- return response;
2265
+ const response = await client.bze.burner.raffles();
2266
+ return response.list;
2061
2267
  } catch (e) {
2062
2268
  console.error(e);
2063
- return { epochs: [] };
2269
+ return [];
2064
2270
  }
2065
2271
  }
2066
- async function getCurrentEpoch(identifier) {
2067
- const all = await getEpochsInfo();
2068
- return all.epochs.find((item) => item.identifier === identifier);
2069
- }
2070
- async function getHourEpochInfo() {
2071
- return getCurrentEpoch(EPOCH_HOUR);
2072
- }
2073
- async function getWeekEpochInfo() {
2074
- return getCurrentEpoch(EPOCH_WEEK);
2075
- }
2076
- async function getCurrentWeekEpochEndTime() {
2077
- return getPeriodicEpochEndTime(EPOCH_WEEK);
2078
- }
2079
- async function getPeriodicWeekEpochEndTime(modWeek = 1) {
2080
- return getPeriodicEpochEndTime(EPOCH_WEEK, modWeek);
2272
+ async function getRaffleWinners(denom) {
2273
+ try {
2274
+ const client = await getRestClient();
2275
+ const response = await client.bze.burner.raffleWinners({ denom });
2276
+ return response.list;
2277
+ } catch (e) {
2278
+ console.error(e);
2279
+ return [];
2280
+ }
2081
2281
  }
2082
- async function getPeriodicEpochEndTime(identifier, mod = 1) {
2083
- const epoch = await getCurrentEpoch(identifier);
2084
- if (!epoch || !epoch.current_epoch_start_time) {
2282
+ async function checkAddressWonRaffle(address, denom, height) {
2283
+ var _a2;
2284
+ const response = {
2285
+ hasWon: false,
2286
+ amount: "0",
2287
+ denom,
2288
+ address
2289
+ };
2290
+ if (address == "" || height <= 0) {
2085
2291
  return void 0;
2086
2292
  }
2087
- const current = toBigNumber(epoch.current_epoch);
2088
- let remainingEpochs = mod - current.toNumber() % mod;
2089
- if (remainingEpochs === mod) {
2090
- remainingEpochs = 0;
2293
+ const blockResults = await getBlockResults(height);
2294
+ if (!blockResults) {
2295
+ return void 0;
2091
2296
  }
2092
- const startAt = new Date(epoch.current_epoch_start_time);
2093
- const duration = getEpochDurationByIdentifier(identifier);
2094
- startAt.setTime(startAt.getTime() + duration + duration * remainingEpochs);
2095
- return startAt;
2096
- }
2097
- function getEpochDurationByIdentifier(identifier) {
2098
- const hourMs = 60 * 60 * 1e3;
2099
- switch (identifier) {
2100
- case EPOCH_HOUR:
2101
- return hourMs;
2102
- case EPOCH_DAY:
2103
- return hourMs * 24;
2104
- case EPOCH_WEEK:
2105
- return hourMs * 24 * 7;
2106
- default:
2107
- return hourMs;
2297
+ if (!((_a2 = blockResults.result) == null ? void 0 : _a2.finalize_block_events)) {
2298
+ return void 0;
2299
+ }
2300
+ if (blockResults.result.finalize_block_events.length === 0) {
2301
+ return void 0;
2302
+ }
2303
+ const raffleEvents = blockResults.result.finalize_block_events.filter((ev) => ev.type.includes("Raffle"));
2304
+ if (!raffleEvents || raffleEvents.length === 0) {
2305
+ return void 0;
2306
+ }
2307
+ for (let i = 0; i < raffleEvents.length; i++) {
2308
+ const ev = raffleEvents[i];
2309
+ const converted = mapEventAttributes(ev.attributes);
2310
+ if ("participant" in converted && ev.type.includes("RaffleLostEvent") && converted["participant"] === address) {
2311
+ return response;
2312
+ }
2313
+ if ("winner" in converted && ev.type.includes("RaffleWinnerEvent") && converted["winner"] === address && converted["denom"] === denom) {
2314
+ response.hasWon = true;
2315
+ response.amount = converted["amount"];
2316
+ return response;
2317
+ }
2108
2318
  }
2319
+ return response;
2109
2320
  }
2110
2321
 
2111
2322
  // src/query/factory.ts
@@ -4736,6 +4947,7 @@ export {
4736
4947
  canDepositFromIBC,
4737
4948
  canSendToIBC,
4738
4949
  cancelDebounce,
4950
+ checkAddressWonRaffle,
4739
4951
  convertToWebSocketUrl,
4740
4952
  counterpartyChainForChannel,
4741
4953
  createMarketId,
@@ -4772,6 +4984,10 @@ export {
4772
4984
  getAtomOneRestURL,
4773
4985
  getAtomOneRpcUrl,
4774
4986
  getBZEUSDPrice,
4987
+ getBlockDetailsByHeight,
4988
+ getBlockResults,
4989
+ getBlockTimeByHeight,
4990
+ getBurnerModuleAddress,
4775
4991
  getBurnerParams,
4776
4992
  getBurnerParamsWithClient,
4777
4993
  getChainAddressPrefix,
@@ -4795,6 +5011,7 @@ export {
4795
5011
  getEpochsInfo,
4796
5012
  getFactoryDenomAdminAddress,
4797
5013
  getFromLocalStorage,
5014
+ getHardcodedLockAddress,
4798
5015
  getHashIBCTrace,
4799
5016
  getHourEpochInfo,
4800
5017
  getIBCAssetList,
@@ -4817,6 +5034,8 @@ export {
4817
5034
  getMarketSellOrders,
4818
5035
  getMarkets,
4819
5036
  getMinAmount,
5037
+ getModuleAddress,
5038
+ getNextBurning,
4820
5039
  getNoOfIntervalsNeeded,
4821
5040
  getNobleRestURL,
4822
5041
  getNobleRpcUrl,
@@ -4828,6 +5047,9 @@ export {
4828
5047
  getPendingUnlockParticipants,
4829
5048
  getPeriodicEpochEndTime,
4830
5049
  getPeriodicWeekEpochEndTime,
5050
+ getRaffleModuleAddress,
5051
+ getRaffleWinners,
5052
+ getRaffles,
4831
5053
  getRestClient,
4832
5054
  getRestURL,
4833
5055
  getRpcURL,