fix: use dynamic SS58 prefix in referral/KYC address encoding

Replace hardcoded SS58 prefix 42 with api.registry.chainSS58 ?? 42
for robustness in getPendingApprovalsForReferrer, getReferralInfo,
and getMyReferrals functions.
This commit is contained in:
2026-02-28 01:59:04 +03:00
parent 99bc85f42e
commit 5bdc80e3ed
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -790,7 +790,8 @@ export async function getPendingApprovalsForReferrer(
let referrerSS58 = '';
try {
if (appData.referrer) {
referrerSS58 = encodeAddress(appData.referrer as string, 42);
const ss58Prefix = api.registry.chainSS58 ?? 42;
referrerSS58 = encodeAddress(appData.referrer as string, ss58Prefix);
}
} catch {
referrerSS58 = appData.referrer?.toString() ?? '';