import json import base58 from solana.transaction import Transaction from solders.pubkey import Pubkey import struct import sys import base64 import sys if len(sys.argv) != 2: print("Usage: python decode_getTransaction.py ") sys.exit(1) tx_file_path = sys.argv[1] # Load the IDL with open('../idl/pump_fun_idl.json', 'r') as f: idl = json.load(f) # Load the transaction log with open(tx_file_path, 'r') as f: tx_log = json.load(f) # Extract the transaction data tx_data = tx_log['result']['transaction'] print(json.dumps(tx_data, indent=2)) def decode_create_instruction(data): # The Create instruction has 3 string arguments: name, symbol, uri offset = 8 # Skip the 8-byte discriminator results = [] for _ in range(3): length = struct.unpack_from("