UNPKG

2.06 kBTypeScriptView Raw
1import type { HexString } from '@polkadot/util/types';
2import type { ExtrinsicSignatureV4 } from '../../interfaces/extrinsics/index.js';
3import type { Address, Call } from '../../interfaces/runtime/index.js';
4import type { ExtrinsicPayloadValue, IExtrinsicImpl, IKeyringPair, Registry, SignatureOptions } from '../../types/index.js';
5import type { ExtrinsicOptions } from '../types.js';
6import { Struct } from '@polkadot/types-codec';
7export declare const EXTRINSIC_VERSION = 4;
8export interface ExtrinsicValueV4 {
9 method?: Call;
10 signature?: ExtrinsicSignatureV4;
11}
12/**
13 * @name GenericExtrinsicV4
14 * @description
15 * The third generation of compact extrinsics
16 */
17export declare class GenericExtrinsicV4 extends Struct implements IExtrinsicImpl {
18 constructor(registry: Registry, value?: Uint8Array | ExtrinsicValueV4 | Call, { isSigned }?: Partial<ExtrinsicOptions>);
19 /** @internal */
20 static decodeExtrinsic(registry: Registry, value?: Call | Uint8Array | ExtrinsicValueV4, isSigned?: boolean): ExtrinsicValueV4;
21 /**
22 * @description The length of the value when encoded as a Uint8Array
23 */
24 get encodedLength(): number;
25 /**
26 * @description The [[Call]] this extrinsic wraps
27 */
28 get method(): Call;
29 /**
30 * @description The [[ExtrinsicSignatureV4]]
31 */
32 get signature(): ExtrinsicSignatureV4;
33 /**
34 * @description The version for the signature
35 */
36 get version(): number;
37 /**
38 * @description Add an [[ExtrinsicSignatureV4]] to the extrinsic (already generated)
39 */
40 addSignature(signer: Address | Uint8Array | string, signature: Uint8Array | HexString, payload: ExtrinsicPayloadValue | Uint8Array | HexString): GenericExtrinsicV4;
41 /**
42 * @description Sign the extrinsic with a specific keypair
43 */
44 sign(account: IKeyringPair, options: SignatureOptions): GenericExtrinsicV4;
45 /**
46 * @describe Adds a fake signature to the extrinsic
47 */
48 signFake(signer: Address | Uint8Array | string, options: SignatureOptions): GenericExtrinsicV4;
49}