|
1 | 1 | // Copyright 2017-2024 @polkadot/types authors & contributors |
2 | 2 | // SPDX-License-Identifier: Apache-2.0 |
3 | 3 |
|
4 | | -import type { Text, Vec } from '@polkadot/types-codec'; |
| 4 | +import type { bool, Text, Vec } from '@polkadot/types-codec'; |
5 | 5 | import type { AnyJson, Registry } from '@polkadot/types-codec/types'; |
6 | 6 | import type { HexString } from '@polkadot/util/types'; |
7 | 7 | import type { Address, BlockHash, Call, ExtrinsicEra, Hash, MultiLocation } from '../interfaces/index.js'; |
@@ -55,7 +55,7 @@ export class GenericSignerPayload extends Struct implements ISignerPayload, Sign |
55 | 55 | constructor (registry: Registry, value?: HexString | Record<string, unknown> | Map<unknown, unknown> | unknown[]) { |
56 | 56 | const extensionTypes = objectSpread<Record<string, string>>({}, registry.getSignedExtensionTypes(), registry.getSignedExtensionExtra()); |
57 | 57 |
|
58 | | - super(registry, objectSpread<Record<string, string>>({}, extensionTypes, knownTypes), value); |
| 58 | + super(registry, objectSpread<Record<string, string>>({}, extensionTypes, knownTypes, { withSignedTransaction: 'bool' }), value); |
59 | 59 |
|
60 | 60 | this.#extraTypes = {}; |
61 | 61 | const getter = (key: string) => this.get(key); |
@@ -126,6 +126,12 @@ export class GenericSignerPayload extends Struct implements ISignerPayload, Sign |
126 | 126 | return this.getT('metadataHash'); |
127 | 127 | } |
128 | 128 |
|
| 129 | + get withSignedTransaction (): boolean { |
| 130 | + const val: bool = this.getT('withSignedTransaction'); |
| 131 | + |
| 132 | + return val.isTrue; |
| 133 | + } |
| 134 | + |
129 | 135 | /** |
130 | 136 | * @description Creates an representation of the structure as an ISignerPayload JSON |
131 | 137 | */ |
@@ -166,7 +172,8 @@ export class GenericSignerPayload extends Struct implements ISignerPayload, Sign |
166 | 172 | specVersion: this.runtimeVersion.specVersion.toHex(), |
167 | 173 | tip: this.tip.toHex(), |
168 | 174 | transactionVersion: this.runtimeVersion.transactionVersion.toHex(), |
169 | | - version: this.version.toNumber() |
| 175 | + version: this.version.toNumber(), |
| 176 | + withSignedTransaction: this.withSignedTransaction |
170 | 177 | }); |
171 | 178 | } |
172 | 179 |
|
|
0 commit comments