UNPKG

2.62 kBTypeScriptView Raw
1import type { AnyJson, BareOpts, Registry } from '@polkadot/types-codec/types';
2import type { HexString } from '@polkadot/util/types';
3import type { ExtrinsicPayloadV4 } from '../interfaces/extrinsics';
4import type { Hash } from '../interfaces/runtime';
5import type { ExtrinsicPayloadValue, ICompact, IKeyringPair, INumber } from '../types';
6import { Base, Raw } from '@polkadot/types-codec';
7import { GenericExtrinsicEra } from './ExtrinsicEra';
8interface ExtrinsicPayloadOptions {
9 version?: number;
10}
11declare type ExtrinsicPayloadVx = ExtrinsicPayloadV4;
12/**
13 * @name GenericExtrinsicPayload
14 * @description
15 * A signing payload for an [[Extrinsic]]. For the final encoding, it is variable length based
16 * on the contents included
17 */
18export declare class GenericExtrinsicPayload extends Base<ExtrinsicPayloadVx> {
19 constructor(registry: Registry, value?: Partial<ExtrinsicPayloadValue> | Uint8Array | string, { version }?: ExtrinsicPayloadOptions);
20 /**
21 * @description The block [[Hash]] the signature applies to (mortal/immortal)
22 */
23 get blockHash(): Hash;
24 /**
25 * @description The [[ExtrinsicEra]]
26 */
27 get era(): GenericExtrinsicEra;
28 /**
29 * @description The genesis block [[Hash]] the signature applies to
30 */
31 get genesisHash(): Hash;
32 /**
33 * @description The [[Raw]] contained in the payload
34 */
35 get method(): Raw;
36 /**
37 * @description The [[Index]]
38 */
39 get nonce(): ICompact<INumber>;
40 /**
41 * @description The specVersion as a [[u32]] for this payload
42 */
43 get specVersion(): INumber;
44 /**
45 * @description The [[Balance]]
46 */
47 get tip(): ICompact<INumber>;
48 /**
49 * @description The transaction version as a [[u32]] for this payload
50 */
51 get transactionVersion(): INumber;
52 /**
53 * @description Compares the value of the input to see if there is a match
54 */
55 eq(other?: unknown): boolean;
56 /**
57 * @description Sign the payload with the keypair
58 */
59 sign(signerPair: IKeyringPair): {
60 signature: HexString;
61 };
62 /**
63 * @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
64 */
65 toHuman(isExtended?: boolean): AnyJson;
66 /**
67 * @description Converts the Object to JSON, typically used for RPC transfers
68 */
69 toJSON(): any;
70 /**
71 * @description Returns the string representation of the value
72 */
73 toString(): string;
74 /**
75 * @description Returns a serialized u8a form
76 */
77 toU8a(isBare?: BareOpts): Uint8Array;
78}
79export {};