diff --git a/packages/core/base/src/types.ts b/packages/core/base/src/types.ts index 65247a098..24aa5b327 100644 --- a/packages/core/base/src/types.ts +++ b/packages/core/base/src/types.ts @@ -12,3 +12,9 @@ export enum WalletAdapterNetwork { export type TransactionOrVersionedTransaction | null> = SupportedTransactionVersions extends null ? Transaction : Transaction | VersionedTransaction; + +export function isVersionedTransaction( + transaction: Transaction | VersionedTransaction +): transaction is VersionedTransaction { + return 'message' in transaction; +}