UNPKG

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