Module

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

Package publishing for deno.land/x/polkadot
Go to Latest
function idToIndex
import { idToIndex } from "https://dotland.deno.dev/x/polkadot@0.2.38/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.