UNPKG

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