UNPKG

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