I have a code
fn main() { let rpc_url = String::from("https://api.mainnet-beta.solana.com/"); let client = RpcClient::new(rpc_url);
let pk = Pubkey::from_str("adresshere").unwrap();
let signatures = client.get_signatures_for_address(&pk).unwrap();
if let Some(last_signature) = signatures.first() {
let signature = Signature::from_str(&last_signature.signature).unwrap();
let trx = client.get_transaction(
&signature,
UiTransactionEncoding::JsonParsed
).unwrap();
match trx.transaction.transaction {
EncodedTransaction::Json(json) => {
match json.message {
UiMessage::Parsed(message) => {
//println!("{:?}", &message.instructions[0]);
match &message.instructions[0] {
UiInstruction::Parsed(inst) => {
match inst {
UiParsedInstruction::Parsed(d) => {
println!("{:?}", d);
}
_ => panic!()
}
}
_ => panic!()
}
}
_ => panic!()
}
}
_ => panic!()
}
} else {
println!("Not found");
}
}
But I'm having trouble getting the program_id. I walk JSON response and using struct and enum-methods from solana_transaction_status I get the answers Please help