diff --git a/packages/api-derive/src/accounts/accountId.ts b/packages/api-derive/src/accounts/accountId.ts index 11d9fcba87ba..c20be2833c2e 100644 --- a/packages/api-derive/src/accounts/accountId.ts +++ b/packages/api-derive/src/accounts/accountId.ts @@ -24,7 +24,7 @@ export function accountId (instanceId: string, api: DeriveApi): (address?: Addre : decodeAddress((address || '').toString()); if (decoded.length > 8) { - return of(api.registry.createType('AccountId', decoded)); + return of(api.registry.createType(decoded.length === 20 ? 'AccountId20' : 'AccountId', decoded)); } const accountIndex = api.registry.createType('AccountIndex', decoded); diff --git a/packages/api-derive/src/accounts/idAndIndex.ts b/packages/api-derive/src/accounts/idAndIndex.ts index 6da98fbfab91..f9ec5454e7ba 100644 --- a/packages/api-derive/src/accounts/idAndIndex.ts +++ b/packages/api-derive/src/accounts/idAndIndex.ts @@ -34,7 +34,7 @@ export function idAndIndex (instanceId: string, api: DeriveApi): (address?: Addr : decodeAddress((address || '').toString()); if (decoded.length > 8) { - const accountId = api.registry.createType('AccountId', decoded); + const accountId = api.registry.createType(decoded.length === 20 ? 'AccountId20' : 'AccountId', decoded); return api.derive.accounts.idToIndex(accountId).pipe( map((accountIndex): AccountIdAndIndex => [accountId, accountIndex])