mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-06-13 00:51:02 +00:00
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:
@@ -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() ?? '';
|
||||
|
||||
Reference in New Issue
Block a user