Skip to main content
Module

x/polkadot/api-derive/accounts/idToIndex.ts>idToIndex

Package publishing for deno.land/x/polkadot
Latest
function idToIndex
import { idToIndex } from "https://deno.land/x/polkadot@0.2.45/api-derive/accounts/idToIndex.ts";

Examples

const ALICE = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
api.derive.accounts.idToIndex(ALICE, (accountIndex) => {
  console.log(`The AccountIndex of ${ALICE} is ${accountIndex}`);
});

Parameters

instanceId: string
  • An accounts Id in different formats.

Returns

(accountId: AccountId | string) => Observable<AccountIndex | undefined>

Returns the corresponding AccountIndex.