feat: add version getter to VersionedTransaction class (#27734)
This commit is contained in:
parent
079bf561b0
commit
d9b1ebece7
|
@ -4832,7 +4832,7 @@ export class Connection {
|
||||||
signersOrOptions?: Array<Signer> | SendOptions,
|
signersOrOptions?: Array<Signer> | SendOptions,
|
||||||
options?: SendOptions,
|
options?: SendOptions,
|
||||||
): Promise<TransactionSignature> {
|
): Promise<TransactionSignature> {
|
||||||
if ('message' in transaction) {
|
if ('version' in transaction) {
|
||||||
if (signersOrOptions && Array.isArray(signersOrOptions)) {
|
if (signersOrOptions && Array.isArray(signersOrOptions)) {
|
||||||
throw new Error('Invalid arguments');
|
throw new Error('Invalid arguments');
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,10 @@ export class VersionedTransaction {
|
||||||
signatures: Array<Uint8Array>;
|
signatures: Array<Uint8Array>;
|
||||||
message: VersionedMessage;
|
message: VersionedMessage;
|
||||||
|
|
||||||
|
get version(): TransactionVersion {
|
||||||
|
return this.message.version;
|
||||||
|
}
|
||||||
|
|
||||||
constructor(message: VersionedMessage, signatures?: Array<Uint8Array>) {
|
constructor(message: VersionedMessage, signatures?: Array<Uint8Array>) {
|
||||||
if (signatures !== undefined) {
|
if (signatures !== undefined) {
|
||||||
assert(
|
assert(
|
||||||
|
|
Loading…
Reference in New Issue