UNPKG

2.24 kBTypeScriptView Raw
1import type { AnyJson, AnyTuple, AnyU8a, ArgsDef, Codec, IMethod, Registry } from '@polkadot/types-codec/types';
2import type { FunctionMetadataLatest } from '../interfaces/metadata/index.js';
3import type { CallBase } from '../types/index.js';
4import { Struct, U8aFixed } from '@polkadot/types-codec';
5/**
6 * @name GenericCallIndex
7 * @description
8 * A wrapper around the `[sectionIndex, methodIndex]` value that uniquely identifies a method
9 */
10export declare class GenericCallIndex extends U8aFixed {
11 constructor(registry: Registry, value?: AnyU8a);
12 /**
13 * @description Converts the value in a best-fit primitive form
14 */
15 toPrimitive(): string;
16}
17/**
18 * @name GenericCall
19 * @description
20 * Extrinsic function descriptor
21 */
22export declare class GenericCall<A extends AnyTuple = AnyTuple> extends Struct implements CallBase<A> {
23 protected _meta: FunctionMetadataLatest;
24 constructor(registry: Registry, value: unknown, meta?: FunctionMetadataLatest);
25 /**
26 * @description The arguments for the function call
27 */
28 get args(): A;
29 /**
30 * @description The argument definitions
31 */
32 get argsDef(): ArgsDef;
33 /**
34 * @description The argument entries
35 */
36 get argsEntries(): [string, Codec][];
37 /**
38 * @description The encoded `[sectionIndex, methodIndex]` identifier
39 */
40 get callIndex(): Uint8Array;
41 /**
42 * @description The encoded data
43 */
44 get data(): Uint8Array;
45 /**
46 * @description The [[FunctionMetadata]]
47 */
48 get meta(): FunctionMetadataLatest;
49 /**
50 * @description Returns the name of the method
51 */
52 get method(): string;
53 /**
54 * @description Returns the module containing the method
55 */
56 get section(): string;
57 /**
58 * @description Checks if the source matches this in type
59 */
60 is(other: IMethod<AnyTuple>): other is IMethod<A>;
61 /**
62 * @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
63 */
64 toHuman(isExpanded?: boolean, disableAscii?: boolean): Record<string, AnyJson>;
65 /**
66 * @description Returns the base runtime type name for this instance
67 */
68 toRawType(): string;
69}