Skip to main content
Deno 2 is finally here 🎉️
Learn more
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://deno.land/x/polkadot@0.2.23/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.
api: DeriveApi

Returns

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

Returns the corresponding AccountIndex.