UNPKG

2.06 kBTypeScriptView Raw
1import type { HexString } from '@polkadot/util/types';
2import type { ExtrinsicSignatureV4 } from '../../interfaces/extrinsics';
3import type { Address, Call } from '../../interfaces/runtime';
4import type { ExtrinsicPayloadValue, IExtrinsicImpl, IKeyringPair, Registry, SignatureOptions } from '../../types';
5import type { ExtrinsicOptions } from '../types';
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 get registry(): Registry;
30 /**
31 * @description The [[ExtrinsicSignatureV4]]
32 */
33 get signature(): ExtrinsicSignatureV4;
34 /**
35 * @description The version for the signature
36 */
37 get version(): number;
38 /**
39 * @description Add an [[ExtrinsicSignatureV4]] to the extrinsic (already generated)
40 */
41 addSignature(signer: Address | Uint8Array | string, signature: Uint8Array | HexString, payload: ExtrinsicPayloadValue | Uint8Array | HexString): GenericExtrinsicV4;
42 /**
43 * @description Sign the extrinsic with a specific keypair
44 */
45 sign(account: IKeyringPair, options: SignatureOptions): GenericExtrinsicV4;
46 /**
47 * @describe Adds a fake signature to the extrinsic
48 */
49 signFake(signer: Address | Uint8Array | string, options: SignatureOptions): GenericExtrinsicV4;
50}