UNPKG

3.24 kBTypeScriptView Raw
1import type { HexString } from '@polkadot/util/types';
2import type { EcdsaSignature, Ed25519Signature, ExtrinsicEra, ExtrinsicSignature, Sr25519Signature } from '../../interfaces/extrinsics';
3import type { Address, Call } from '../../interfaces/runtime';
4import type { ExtrinsicPayloadValue, ICompact, IExtrinsicSignature, IKeyringPair, INumber, Registry, SignatureOptions } from '../../types';
5import type { ExtrinsicSignatureOptions } from '../types';
6import { Struct } from '@polkadot/types-codec';
7import { GenericExtrinsicPayloadV4 } from './ExtrinsicPayload';
8/**
9 * @name GenericExtrinsicSignatureV4
10 * @description
11 * A container for the [[Signature]] associated with a specific [[Extrinsic]]
12 */
13export declare class GenericExtrinsicSignatureV4 extends Struct implements IExtrinsicSignature {
14 #private;
15 constructor(registry: Registry, value?: GenericExtrinsicSignatureV4 | Uint8Array, { isSigned }?: ExtrinsicSignatureOptions);
16 /** @internal */
17 static decodeExtrinsicSignature(value?: GenericExtrinsicSignatureV4 | Uint8Array, isSigned?: boolean): GenericExtrinsicSignatureV4 | Uint8Array;
18 /**
19 * @description The length of the value when encoded as a Uint8Array
20 */
21 get encodedLength(): number;
22 /**
23 * @description `true` if the signature is valid
24 */
25 get isSigned(): boolean;
26 /**
27 * @description The [[ExtrinsicEra]] (mortal or immortal) this signature applies to
28 */
29 get era(): ExtrinsicEra;
30 /**
31 * @description The [[Index]] for the signature
32 */
33 get nonce(): ICompact<INumber>;
34 get registry(): Registry;
35 /**
36 * @description The actual [[EcdsaSignature]], [[Ed25519Signature]] or [[Sr25519Signature]]
37 */
38 get signature(): EcdsaSignature | Ed25519Signature | Sr25519Signature;
39 /**
40 * @description The raw [[ExtrinsicSignature]]
41 */
42 get multiSignature(): ExtrinsicSignature;
43 /**
44 * @description The [[Address]] that signed
45 */
46 get signer(): Address;
47 /**
48 * @description The [[Balance]] tip
49 */
50 get tip(): ICompact<INumber>;
51 protected _injectSignature(signer: Address, signature: ExtrinsicSignature, payload: GenericExtrinsicPayloadV4): IExtrinsicSignature;
52 /**
53 * @description Adds a raw signature
54 */
55 addSignature(signer: Address | Uint8Array | string, signature: Uint8Array | HexString, payload: ExtrinsicPayloadValue | Uint8Array | HexString): IExtrinsicSignature;
56 /**
57 * @description Creates a payload from the supplied options
58 */
59 createPayload(method: Call, options: SignatureOptions): GenericExtrinsicPayloadV4;
60 /**
61 * @description Generate a payload and applies the signature from a keypair
62 */
63 sign(method: Call, account: IKeyringPair, options: SignatureOptions): IExtrinsicSignature;
64 /**
65 * @description Generate a payload and applies a fake signature
66 */
67 signFake(method: Call, address: Address | Uint8Array | string, options: SignatureOptions): IExtrinsicSignature;
68 /**
69 * @description Encodes the value as a Uint8Array as per the SCALE specifications
70 * @param isBare true when the value has none of the type-specific prefixes (internal)
71 */
72 toU8a(isBare?: boolean): Uint8Array;
73}