fix(web): use separate args for StorageDoubleMap inbox/sendCount queries

messaging.inbox and messaging.sendCount are StorageDoubleMaps keyed by
(era, address). Passing [era, address] as a single array produced empty
results; split into two arguments so the API constructs the correct
storage key.
This commit is contained in:
2026-03-04 03:32:41 +03:00
parent 568fd069cf
commit 1f51f08c06
+2 -2
View File
@@ -53,7 +53,7 @@ export async function getInbox(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const messaging = (api.query as any).messaging;
if (!messaging?.inbox) return [];
const result = await messaging.inbox([era, address]);
const result = await messaging.inbox(era, address);
if (result.isEmpty || result.length === 0) return [];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -76,7 +76,7 @@ export async function getSendCount(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const messaging = (api.query as any).messaging;
if (!messaging?.sendCount) return 0;
const count = await messaging.sendCount([era, address]);
const count = await messaging.sendCount(era, address);
return count.toNumber();
}