UNPKG

1.87 kBTypeScriptView Raw
1/// <reference types="bn.js" />
2import type { Registry } from '@polkadot/types-codec/types';
3import type { BN } from '@polkadot/util';
4import type { HexString } from '@polkadot/util/types';
5import { AbstractBase } from '@polkadot/types-codec';
6import { GenericAccountIndex } from '../generic/AccountIndex.js';
7import { GenericEthereumAccountId } from './AccountId.js';
8type AnyAddress = bigint | BN | GenericEthereumLookupSource | GenericEthereumAccountId | GenericAccountIndex | number[] | Uint8Array | number | string;
9export declare const ACCOUNT_ID_PREFIX: Uint8Array;
10/**
11 * @name GenericEthereumLookupSource
12 * @description
13 * A wrapper around an EthereumAccountId and/or AccountIndex that is encoded with a prefix.
14 * Since we are dealing with underlying publicKeys (or shorter encoded addresses),
15 * we extend from Base with an AccountId/AccountIndex wrapper. Basically the Address
16 * is encoded as `[ <prefix-byte>, ...publicKey/...bytes ]` as per spec
17 */
18export declare class GenericEthereumLookupSource extends AbstractBase<GenericEthereumAccountId | GenericAccountIndex> {
19 constructor(registry: Registry, value?: AnyAddress);
20 /**
21 * @description The length of the value when encoded as a Uint8Array
22 */
23 get encodedLength(): number;
24 /**
25 * @description The length of the raw value, either AccountIndex or AccountId
26 */
27 protected get _rawLength(): number;
28 /**
29 * @description Returns a hex string representation of the value
30 */
31 toHex(): HexString;
32 /**
33 * @description Returns the base runtime type name for this instance
34 */
35 toRawType(): string;
36 /**
37 * @description Encodes the value as a Uint8Array as per the SCALE specifications
38 * @param isBare true when the value has none of the type-specific prefixes (internal)
39 */
40 toU8a(isBare?: boolean): Uint8Array;
41}
42export {};