UNPKG

3.97 kBTypeScriptView Raw
1import type { MultiLocation } from '@polkadot/types/interfaces';
2import type { HexString } from '@polkadot/util/types';
3import type { EcdsaSignature, Ed25519Signature, ExtrinsicEra, ExtrinsicSignature, Sr25519Signature } from '../../interfaces/extrinsics/index.js';
4import type { Address, Call, Hash } from '../../interfaces/runtime/index.js';
5import type { ExtrinsicPayloadValue, ICompact, IExtrinsicSignature, IKeyringPair, INumber, IOption, Registry, SignatureOptions } from '../../types/index.js';
6import type { ExtrinsicSignatureOptions } from '../types.js';
7import { Struct } from '@polkadot/types-codec';
8import { GenericExtrinsicPayloadV5 } from './ExtrinsicPayload.js';
9/**
10 * @name GenericExtrinsicSignatureV5
11 * @description
12 * A container for the [[Signature]] associated with a specific [[Extrinsic]]
13 */
14export declare class GenericExtrinsicSignatureV5 extends Struct implements IExtrinsicSignature {
15 #private;
16 constructor(registry: Registry, value?: GenericExtrinsicSignatureV5 | Uint8Array, { isSigned }?: ExtrinsicSignatureOptions);
17 /** @internal */
18 static decodeExtrinsicSignature(value?: GenericExtrinsicSignatureV5 | Uint8Array, isSigned?: boolean): GenericExtrinsicSignatureV5 | Uint8Array;
19 /**
20 * @description The length of the value when encoded as a Uint8Array
21 */
22 get encodedLength(): number;
23 /**
24 * @description `true` if the signature is valid
25 */
26 get isSigned(): boolean;
27 /**
28 * @description The [[ExtrinsicEra]] (mortal or immortal) this signature applies to
29 */
30 get era(): ExtrinsicEra;
31 /**
32 * @description The [[Index]] for the signature
33 */
34 get nonce(): ICompact<INumber>;
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 /**
52 * @description The [[u32]] or [[MultiLocation]] assetId
53 */
54 get assetId(): IOption<INumber | MultiLocation>;
55 /**
56 * @description the [[u32]] mode
57 */
58 get mode(): INumber;
59 /**
60 * @description The (optional) [[Hash]] for the metadata proof
61 */
62 get metadataHash(): IOption<Hash>;
63 /**
64 * @description The [[u8]] for the TransactionExtension version
65 */
66 get transactionExtensionVersion(): INumber;
67 /**
68 * [Disabled for ExtrinsicV5]
69 */
70 protected _injectSignature(_signer: Address, _signature: ExtrinsicSignature, _payload: GenericExtrinsicPayloadV5): IExtrinsicSignature;
71 /**
72 * @description Adds a raw signature
73 *
74 * [Disabled for ExtrinsicV5]
75 */
76 addSignature(_signer: Address | Uint8Array | string, _signature: Uint8Array | HexString, _payload: ExtrinsicPayloadValue | Uint8Array | HexString): IExtrinsicSignature;
77 /**
78 * @description Creates a payload from the supplied options
79 */
80 createPayload(method: Call, options: SignatureOptions): GenericExtrinsicPayloadV5;
81 /**
82 * @description Generate a payload and applies the signature from a keypair
83 *
84 * [Disabled for ExtrinsicV5]
85 */
86 sign(_method: Call, _account: IKeyringPair, _options: SignatureOptions): IExtrinsicSignature;
87 /**
88 * @description Generate a payload and applies a fake signature
89 *
90 * [Disabled for ExtrinsicV5]
91 */
92 signFake(_method: Call, _address: Address | Uint8Array | string, _options: SignatureOptions): IExtrinsicSignature;
93 /**
94 * @description Encodes the value as a Uint8Array as per the SCALE specifications
95 * @param isBare true when the value has none of the type-specific prefixes (internal)
96 */
97 toU8a(isBare?: boolean): Uint8Array;
98}