import { idToIndex } from "https://deno.land/x/polkadot@0.2.12/api-derive/accounts/index.ts";
Examples
const ALICE = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
api.derive.accounts.idToIndex(ALICE, (accountIndex) => {
console.log(`The AccountIndex of ${ALICE} is ${accountIndex}`);
});
Parameters
api: DeriveApi
Returns
(accountId: AccountId | string) => Observable<AccountIndex | undefined>
Returns the corresponding AccountIndex.