LogoLogo
WebsiteTwitterSubstack
  • Nozomi
    • Introduction
    • Transaction Submission
      • Rust
      • Python
      • JavaScript
      • TypeScript
      • CURL
      • Jupiter Swap Example
      • Go
      • Tip Stream
    • Keeping Your TCP Connection Alive
Powered by GitBook
On this page
Export as PDF
  1. Nozomi
  2. Transaction Submission

Rust

Use full service rpc for getting blockhash. Nozomi only support sendTransaction.


const NOZOMI_TIP: Pubkey = pubkey!("TEMPaMeCRFAS9EKF53Jd6KpHxgL47uWLcpFArU1Fanq");
const MIN_TIP_AMOUNT: u64 = 1_000_000;

fn send_nozomi_tx(ixs: &mut Vec<Instruction>, signer: &Keypair, rpc_client: &RpcClient) {
    let tip_ix = system_instruction::transfer(&signer.pubkey(), &NOZOMI_TIP, MIN_TIP_AMOUNT);
    ixs.push(tip_ix);

    let blockhash = rpc_client.get_latest_blockhash().unwrap();
    let tx = Transaction::new_signed_with_payer(ixs, Some(&signer.pubkey()), &[signer], blockhash);

    rpc_client.send_transaction(&tx).unwrap();
}
```
PreviousTransaction SubmissionNextPython

Last updated 6 months ago