@@ -2,7 +2,6 @@ import type { Infer } from '@metamask/superstruct';
22import { assert } from '@metamask/superstruct' ;
33import type {
44 BaseTransactionMessage ,
5- CompilableTransactionMessage ,
65 GetTransactionApi ,
76 Transaction ,
87 TransactionMessageBytesBase64 ,
@@ -22,7 +21,7 @@ import {
2221 type Blockhash ,
2322} from '@solana/kit' ;
2423
25- import type { SolanaKeyringAccount } from '../../../entities' ;
24+ import { type SolanaKeyringAccount } from '../../../entities' ;
2625import type { Network } from '../../constants/solana' ;
2726import type { DecompileTransactionMessageFetchingLookupTablesConfig } from '../../sdk-extensions/codecs' ;
2827import {
@@ -394,37 +393,4 @@ export class TransactionHelper {
394393
395394 return partiallySignTransaction ( [ keyPair ] , transaction ) ;
396395 }
397-
398- /**
399- * Extracts the instructions from a base64 string, adapting the logic depending on whether
400- * the string represents a transaction or a transaction message.
401- *
402- * @param base64EncodedString - The base64 encoded string to extract the instructions from.
403- * @param scope - The network on which the transaction is being sent.
404- * @returns The instructions from the base64 encoded string.
405- * @throws If the base64 encoded string is not a valid transaction or transaction message.
406- */
407- async extractInstructionsFromUnknownBase64String (
408- base64EncodedString : Infer < typeof Base64Struct > ,
409- scope : Network ,
410- ) : Promise < CompilableTransactionMessage [ 'instructions' ] > {
411- const rpc = this . #connection. getRpc ( scope ) ;
412-
413- const transactionOrTransactionMessage =
414- await fromUnknowBase64StringToTransactionOrTransactionMessage (
415- base64EncodedString ,
416- rpc ,
417- ) ;
418-
419- if ( 'instructions' in transactionOrTransactionMessage ) {
420- return transactionOrTransactionMessage . instructions ;
421- }
422-
423- const transactionMessage = await fromBytesToCompilableTransactionMessage (
424- transactionOrTransactionMessage . messageBytes ,
425- rpc ,
426- ) ;
427-
428- return transactionMessage . instructions ;
429- }
430396}
0 commit comments