Add ledger support for Mythos (#1969)

* Add ledger support for Mythos

* Fix linting issues

* Remove Mythos from prevLedgerRecord

* allow mythos ss58

* ss58 Exceptions list

---------

Co-authored-by: Valentin Fernandez <tinchofernandez8@gmail.com>
This commit is contained in:
José Molina Colmenero
2025-08-04 14:50:37 -03:00
committed by GitHub
co-authored by Valentin Fernandez
parent 5a04d67bb2
commit 0afe1144d1
4 changed files with 9 additions and 1 deletions
+4 -1
View File
@@ -15,7 +15,7 @@ export function encodeAddress (key: string | Uint8Array, ss58Format: Prefix = de
// decode it, this means we can re-encode an address
const u8a = decodeAddress(key);
if ((ss58Format < 0) || (ss58Format > 16383) || [46, 47].includes(ss58Format)) {
if ((ss58Format < 0) || (ss58Format > 16383 && !ss58Exceptions.includes(ss58Format)) || [46, 47].includes(ss58Format)) {
throw new Error('Out of range ss58Format specified');
} else if (!defaults.allowedDecodedLengths.includes(u8a.length)) {
throw new Error(`Expected a valid key to convert, with length ${defaults.allowedDecodedLengths.join(', ')}`);
@@ -38,3 +38,6 @@ export function encodeAddress (key: string | Uint8Array, ss58Format: Prefix = de
)
);
}
// Exceptions like 29972 (Mythos chain) which uses Ethereum style account (not ss58 Encoded)
const ss58Exceptions = [29972];