From 86773dcd9395a07d605e35b4a7b65af4353e9540 Mon Sep 17 00:00:00 2001 From: Kobe Date: Wed, 16 Oct 2024 13:28:49 +0200 Subject: [PATCH] fix: tx process function not detection tx type correctly --- packages/marginfi-client-v2/src/client.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/marginfi-client-v2/src/client.ts b/packages/marginfi-client-v2/src/client.ts index 7ee51cdb8b..25ad3793c6 100644 --- a/packages/marginfi-client-v2/src/client.ts +++ b/packages/marginfi-client-v2/src/client.ts @@ -779,7 +779,7 @@ class MarginfiClient { lastValidBlockHeight = getLatestBlockhashAndContext.value.lastValidBlockHeight; for (const transaction of transactions) { - if (transaction instanceof VersionedTransaction) { + if (transaction && "message" in transaction) { versionedTransactions.push(transaction); } else { const versionedMessage = new TransactionMessage({ @@ -939,7 +939,9 @@ class MarginfiClient { blockhash = getLatestBlockhashAndContext.value.blockhash; lastValidBlockHeight = getLatestBlockhashAndContext.value.lastValidBlockHeight; - if (transaction instanceof Transaction) { + if (transaction && "message" in transaction) { + versionedTransaction = transaction; + } else { const versionedMessage = new TransactionMessage({ instructions: transaction.instructions, payerKey: this.provider.publicKey, @@ -947,8 +949,6 @@ class MarginfiClient { }); versionedTransaction = new VersionedTransaction(versionedMessage.compileToV0Message(this.addressLookupTables)); - } else { - versionedTransaction = transaction; } if (signers) versionedTransaction.sign(signers);