### Query documentation via HTTP GET Source: https://use.temporal.xyz/nozomi/keeping-your-tcp-connection-alive.md Perform an HTTP GET request to the documentation URL with 'ask' and 'goal' parameters to retrieve information. ```http GET https://use.temporal.xyz/nozomi/keeping-your-tcp-connection-alive.md?ask=&goal= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://use.temporal.xyz/llms.txt Perform an HTTP GET request to the documentation index to receive a direct answer and relevant excerpts. ```http GET https://use.temporal.xyz/nozomi/troubleshooting.md?ask=&goal= ``` -------------------------------- ### GET /nozomi/tipping-and-faq.md Source: https://use.temporal.xyz/nozomi/tipping-and-faq.md Queries the documentation page for specific information using natural language questions and optional goal context. ```APIDOC ## GET /nozomi/tipping-and-faq.md ### Description Perform an HTTP GET request on the current page URL to query the documentation dynamically. ### Method GET ### Endpoint https://use.temporal.xyz/nozomi/tipping-and-faq.md ### Parameters #### Query Parameters - **ask** (string) - Required - The immediate question to ask, written in natural language. - **goal** (string) - Optional - Describes the broader end goal to tailor the answer. ``` -------------------------------- ### GET /nozomi/troubleshooting.md Source: https://use.temporal.xyz/llms.txt Performs a natural language query against the documentation index to retrieve an answer and relevant source excerpts. ```APIDOC ## GET /nozomi/troubleshooting.md ### Description Perform an HTTP GET request on the documentation index with the `ask` parameter to retrieve a direct answer and relevant excerpts from the documentation. ### Method GET ### Endpoint https://use.temporal.xyz/nozomi/troubleshooting.md ### Parameters #### Query Parameters - **ask** (string) - Required - The immediate, specific, and self-contained question in natural language. - **goal** (string) - Optional - Describes the broader end goal to tailor the answer for the user. ### Response #### Success Response (200) - **body** (string) - Contains a direct answer to the question and relevant excerpts and sources from the documentation. ``` -------------------------------- ### GET /nozomi/readme.md Source: https://use.temporal.xyz/nozomi/readme.md Queries the documentation for information by providing a specific question and an optional end goal. ```APIDOC ## GET /nozomi/readme.md ### Description Perform a natural language query against the documentation to retrieve answers and relevant source excerpts. ### Method GET ### Endpoint https://use.temporal.xyz/nozomi/readme.md ### Parameters #### Query Parameters - **ask** (string) - Required - The specific, self-contained question to ask. - **goal** (string) - Optional - The broader end goal to help tailor the response. ``` -------------------------------- ### Submit Transaction to Nozomi API v2 in Rust Source: https://use.temporal.xyz/nozomi/transaction-submission-api-v2/rust.md This example demonstrates how to construct a transaction with a tip instruction, serialize it, and send it to the Nozomi endpoint. ```rust use solana_client::rpc_client::RpcClient; use solana_sdk::{message::Instruction, pubkey, pubkey::Pubkey, signature::Keypair, signer::Signer, transaction::Transaction}; use base64::{Engine as _, engine::general_purpose}; const NOZOMI_ENDPOINT: &str = "https://nozomi.temporal.xyz/api/sendTransaction2?c="; const NOZOMI_TIP: Pubkey = pubkey!("TEMPaMeCRFAS9EKF53Jd6KpHxgL47uWLcpFArU1Fanq"); const MIN_TIP_AMOUNT: u64 = 1_000_000; const SOLANA_RPC_ENDPOINT: &str = "https://api.mainnet-beta.solana.com"; fn send_nozomi_txn( ixns: &mut Vec, signer: &Keypair, nozomi_endpoint: &str, solana_rpc_client: &RpcClient ) -> Result<(), Box> { let tip_ixn = solana_system_interface::instruction::transfer( &signer.pubkey(), &NOZOMI_TIP, MIN_TIP_AMOUNT ); ixns.push(tip_ixn); let blockhash = solana_rpc_client.get_latest_blockhash()?; let txn = Transaction::new_signed_with_payer( ixns, Some(&signer.pubkey()), &[signer], blockhash ); let txn_bytes = bincode::serialize(&txn)?; let txn_base64 = general_purpose::STANDARD.encode(&txn_bytes); let client = reqwest::blocking::Client::new(); let response = client .post(nozomi_endpoint) .header("Content-Type", "text/plain") .body(txn_base64) .send()?; // api v2 does not return a signature, just check for success if response.status().is_success() { Ok(()) } else { Err(Box::new(response.error_for_status().unwrap_err())) } } fn build_ixns() -> Vec { // your instruction building logic here.. vec![] } fn main() { let solana_rpc_client = RpcClient::new(SOLANA_RPC_ENDPOINT.to_string()); // replace with actual keypair loading logic let signer = Keypair::new(); let mut ixns = build_ixns(); if send_nozomi_txn( &mut ixns, &signer, NOZOMI_ENDPOINT, &solana_rpc_client ).is_ok() { println!("Transaction sent successfully"); } } ``` -------------------------------- ### GET /nozomi/faq.md Source: https://use.temporal.xyz/nozomi/faq.md Queries the documentation page for an answer to a specific question, optionally providing a goal to tailor the response. ```APIDOC ## GET /nozomi/faq.md ### Description Queries the documentation dynamically to retrieve an answer to a specific question based on the page content. ### Method GET ### Endpoint https://use.temporal.xyz/nozomi/faq.md ### Parameters #### Query Parameters - **ask** (string) - Required - The specific, self-contained question to ask. - **goal** (string) - Optional - The broader end goal to help tailor the answer. ### Response - **answer** (string) - A direct answer to the question. - **excerpts** (array) - Relevant excerpts from the documentation. - **sources** (array) - Sources used to generate the answer. ``` -------------------------------- ### GET /tip_floor Source: https://use.temporal.xyz/nozomi/tip-stream.md Retrieves the current tip floor data. ```APIDOC ## GET /tip_floor ### Description Retrieves the current tip floor data. ### Method GET ### Endpoint https://api.nozomi.temporal.xyz/tip_floor ### Response #### Success Response (200) - **time** (string) - ISO 8601 timestamp - **landed_tips_25th_percentile** (number) - 25th percentile of landed tips - **landed_tips_50th_percentile** (number) - 50th percentile of landed tips - **landed_tips_75th_percentile** (number) - 75th percentile of landed tips - **landed_tips_95th_percentile** (number) - 95th percentile of landed tips - **landed_tips_99th_percentile** (number) - 99th percentile of landed tips ``` -------------------------------- ### Construct API Request URL Source: https://use.temporal.xyz/nozomi/endpoints.md Example of a full request URL using the auto-routed base URL and the sendTransaction2 endpoint. ```text https://nozomi.temporal.xyz/api/sendTransaction2?c= ``` -------------------------------- ### GET /nozomi/endpoints.md Source: https://use.temporal.xyz/nozomi/endpoints.md Queries the documentation page dynamically to retrieve answers, excerpts, and sources based on a specific question and optional goal. ```APIDOC ## GET /nozomi/endpoints.md ### Description Queries the documentation page dynamically to retrieve answers, excerpts, and sources based on a specific question and optional goal. ### Method GET ### Endpoint https://use.temporal.xyz/nozomi/endpoints.md ### Parameters #### Query Parameters - **ask** (string) - Required - The immediate question to ask, written in natural language. - **goal** (string) - Optional - Describes the broader end goal to tailor the answer. ``` -------------------------------- ### Connect to Tip Stream via WebSocket Source: https://use.temporal.xyz/nozomi/tip-stream.md Establish a connection to the real-time tip stream using wscat. ```bash wscat -c wss://api.nozomi.temporal.xyz/tip_stream ``` -------------------------------- ### Submit Transaction via Nozomi RPC in JavaScript Source: https://use.temporal.xyz/nozomi/transaction-submission-json-rpc/javascript.md Demonstrates how to construct a versioned transaction, include a required tip instruction, and send it to the Nozomi endpoint using @solana/web3.js. ```javascript import { Connection, PublicKey, Keypair, SystemProgram, TransactionMessage, VersionedTransaction } from "@solana/web3.js"; const NOZOMI_ENDPOINT = "https://nozomi.temporal.xyz/?c="; const NOZOMI_TIP = new PublicKey("TEMPaMeCRFAS9EKF53Jd6KpHxgL47uWLcpFArU1Fanq"); const MIN_TIP_AMOUNT = 1_000_000; const SOLANA_RPC_ENDPOINT = "https://api.mainnet-beta.solana.com"; async function sendNozomiTxn(ixns, signer, nozomiRpcClient, solanaRpcClient) { const tipIxn = SystemProgram.transfer({ fromPubkey: signer.publicKey, toPubkey: NOZOMI_TIP, lamports: MIN_TIP_AMOUNT }); ixns.push(tipIxn); const { blockhash } = await solanaRpcClient.getLatestBlockhash(); const messageV0 = new TransactionMessage({ payerKey: signer.publicKey, recentBlockhash: blockhash, instructions: ixns, }).compileToV0Message(); const versionedTxn = new VersionedTransaction(messageV0); versionedTxn.sign([signer]); return await nozomiRpcClient.sendTransaction(versionedTxn); } function buildIxns() { // your instruction building logic here.. return []; } async function main() { const nozomiRpcClient = new Connection(NOZOMI_ENDPOINT); const solanaRpcClient = new Connection(SOLANA_RPC_ENDPOINT); // replace with actual keypair loading logic const signer = Keypair.generate(); const ixns = buildIxns(); const signature = await sendNozomiTxn(ixns, signer, nozomiRpcClient, solanaRpcClient); console.log(`Transaction sent with signature: ${signature}`); } main().catch(err => { console.error(err); }); ``` -------------------------------- ### Submit Transaction to Nozomi in Rust Source: https://use.temporal.xyz/nozomi/transaction-submission-json-rpc/rust.md Demonstrates how to configure an RpcClient for Nozomi, add a tip instruction, and send a signed transaction. ```rust use solana_client::rpc_client::RpcClient; use solana_sdk::{message::Instruction, pubkey, pubkey::Pubkey, signature::Keypair, signer::Signer, transaction::Transaction}; const NOZOMI_ENDPOINT: &str = "https://nozomi.temporal.xyz/?c="; const NOZOMI_TIP: Pubkey = pubkey!("TEMPaMeCRFAS9EKF53Jd6KpHxgL47uWLcpFArU1Fanq"); const MIN_TIP_AMOUNT: u64 = 1_000_000; const SOLANA_RPC_ENDPOINT: &str = "https://api.mainnet-beta.solana.com"; fn send_nozomi_txn(ixns: &mut Vec, signer: &Keypair, nozomi_rpc_client: &RpcClient, solana_rpc_client: &RpcClient) { let tip_ix = solana_system_interface::instruction::transfer(&signer.pubkey(), &NOZOMI_TIP, MIN_TIP_AMOUNT); ixns.push(tip_ix); let blockhash = solana_rpc_client.get_latest_blockhash().unwrap(); let tx = Transaction::new_signed_with_payer(ixns, Some(&signer.pubkey()), &[signer], blockhash); nozomi_rpc_client.send_transaction(&tx).unwrap(); } fn build_ixns() -> Vec { // your instruction building logic here.. vec![] } fn main() { let nozomi_rpc_client = RpcClient::new(NOZOMI_ENDPOINT.to_string()); let solana_rpc_client = RpcClient::new(SOLANA_RPC_ENDPOINT.to_string()); let keypair = Keypair::new(); let mut ixns = build_ixns(); send_nozomi_txn(&mut ixns, &keypair, &nozomi_rpc_client, &solana_rpc_client); } ``` -------------------------------- ### Submit Transaction via Nozomi JSON-RPC Source: https://use.temporal.xyz/nozomi/transaction-submission-json-rpc/typescript.md Demonstrates how to construct a versioned transaction, include a tip instruction for Nozomi, and send it using the Nozomi RPC client. ```typescript import { Connection, PublicKey, Keypair, TransactionInstruction, SystemProgram, TransactionMessage, VersionedTransaction, TransactionSignature } from "@solana/web3.js"; const NOZOMI_ENDPOINT = "https://nozomi.temporal.xyz/?c="; const NOZOMI_TIP = new PublicKey("TEMPaMeCRFAS9EKF53Jd6KpHxgL47uWLcpFArU1Fanq"); const MIN_TIP_AMOUNT = 1_000_000; const SOLANA_RPC_ENDPOINT = "https://api.mainnet-beta.solana.com"; async function sendNozomiTxn(ixns: TransactionInstruction[], signer: Keypair, nozomiRpcClient: Connection, solanaRpcClient: Connection): Promise { const tipIxn = SystemProgram.transfer({ fromPubkey: signer.publicKey, toPubkey: NOZOMI_TIP, lamports: MIN_TIP_AMOUNT }); ixns.push(tipIxn); const { blockhash } = await solanaRpcClient.getLatestBlockhash(); const messageV0 = new TransactionMessage({ payerKey: signer.publicKey, recentBlockhash: blockhash, instructions: ixns, }).compileToV0Message(); const versionedTxn = new VersionedTransaction(messageV0); versionedTxn.sign([signer]); return await nozomiRpcClient.sendTransaction(versionedTxn); } function buildIxns(): TransactionInstruction[] { // your instruction building logic here.. return []; } async function main() { const nozomiRpcClient = new Connection(NOZOMI_ENDPOINT); const solanaRpcClient = new Connection(SOLANA_RPC_ENDPOINT); // replace with actual keypair loading logic const signer = Keypair.generate(); const ixns = buildIxns(); const signature = await sendNozomiTxn(ixns, signer, nozomiRpcClient, solanaRpcClient); console.log(`Transaction sent with signature: ${signature}`); } main().catch(err => { console.error(err); }); ``` -------------------------------- ### Submit Transaction to Nozomi via Python Source: https://use.temporal.xyz/nozomi/transaction-submission-json-rpc/python.md Uses the solana-py library to construct a transaction with a tip instruction and submit it to the Nozomi endpoint. ```python import asyncio from typing import List from solders.pubkey import Pubkey from solders.keypair import Keypair from solders.signature import Signature from solders.instruction import Instruction from solana.transaction import Transaction from solders.system_program import transfer, TransferParams from solana.rpc.async_api import AsyncClient NOZOMI_ENDPOINT = "https://nozomi.temporal.xyz/?c=" NOZOMI_TIP = Pubkey.from_string("TEMPaMeCRFAS9EKF53Jd6KpHxgL47uWLcpFArU1Fanq") MIN_TIP_AMOUNT = 1_000_000 SOLANA_RPC_ENDPOINT = "https://api.mainnet-beta.solana.com" async def send_nozomi_txn(ixns: List[Instruction], signer: Keypair, nozomi_rpc_client: AsyncClient, solana_rpc_client: AsyncClient) -> Signature: tip_ixn = transfer(TransferParams( from_pubkey=signer.pubkey(), to_pubkey=NOZOMI_TIP, lamports=MIN_TIP_AMOUNT )) ixns.append(tip_ixn) blockhash = (await solana_rpc_client.get_latest_blockhash()).value.blockhash txn = Transaction() for ixn in ixns: txn.add(ixn) # solanapy does not expose an encoding option via TxOpts return (await nozomi_rpc_client.send_transaction(txn, signer, recent_blockhash=blockhash)).value def build_ixns() -> List[Instruction]: # your instruction building logic here.. return [] async def main(): nozomi_rpc_client = AsyncClient(NOZOMI_ENDPOINT) solana_rpc_client = AsyncClient(SOLANA_RPC_ENDPOINT) # replace with actual keypair loading logic signer = Keypair() ixns = build_ixns() signature = await send_nozomi_txn(ixns, signer, nozomi_rpc_client, solana_rpc_client) print(f"Transaction sent with signature: {signature}") if __name__ == "__main__": asyncio.run(main()) ``` -------------------------------- ### WebSocket /tip_stream Source: https://use.temporal.xyz/nozomi/tip-stream.md Connects to the real-time tip stream. ```APIDOC ## WebSocket /tip_stream ### Description Connects to the real-time tip stream via WebSocket. ### Endpoint wss://api.nozomi.temporal.xyz/tip_stream ``` -------------------------------- ### POST /api/sendBatch Source: https://use.temporal.xyz/nozomi/batch-send/curl.md Sends a batch of data to the Nozomi API using a binary file upload. ```APIDOC ## POST /api/sendBatch ### Description Sends a batch of data to the Nozomi API. The request requires an API key provided as a query parameter and the binary data provided in the request body. ### Method POST ### Endpoint https://nozomi.temporal.xyz/api/sendBatch ### Parameters #### Query Parameters - **c** (string) - Required - Your API key #### Request Body - **binary data** (application/octet-stream) - Required - The batch data file (e.g., @batch.bin) ### Request Example curl -X POST \ "https://nozomi.temporal.xyz/api/sendBatch?c=YOUR_API_KEY" \ -H "Content-Type: application/octet-stream" \ --data-binary @batch.bin ``` -------------------------------- ### Query Tip Floor via REST Source: https://use.temporal.xyz/nozomi/tip-stream.md Retrieve the current tip floor data using a standard curl request. ```bash curl https://api.nozomi.temporal.xyz/tip_floor ``` -------------------------------- ### Send Batch Data via cURL Source: https://use.temporal.xyz/nozomi/batch-send/curl.md Use this command to send binary batch data to the Nozomi API. Ensure the API key is provided in the URL query parameter. ```bash curl -X POST \ "https://nozomi.temporal.xyz/api/sendBatch?c=YOUR_API_KEY" \ -H "Content-Type: application/octet-stream" \ --data-binary @batch.bin ``` -------------------------------- ### sendBatch(endpoint, apiKey, rawTxs) Source: https://use.temporal.xyz/nozomi/batch-send/javascript.md Sends a batch of raw transactions to the specified Nozomi endpoint using the provided API key. ```APIDOC ## sendBatch(endpoint, apiKey, rawTxs) ### Description Sends a batch of 1-16 raw transactions to the Nozomi API. It encodes the transactions into a binary format and performs a POST request. ### Parameters - **endpoint** (string) - The base URL of the Nozomi API. - **apiKey** (string) - The API key for authentication. - **rawTxs** (Array) - An array of 1-16 raw transactions, each between 66 and 1232 bytes. ### Request Example ```javascript await sendBatch("https://api.nozomi.example", "your-api-key", [tx1, tx2]); ``` ``` -------------------------------- ### Submit Transaction to Nozomi API Source: https://use.temporal.xyz/nozomi/transaction-submission-api-v2/javascript.md Constructs a versioned transaction with a required tip instruction and submits it to the Nozomi endpoint via a POST request. ```javascript import { Connection, PublicKey, Keypair, SystemProgram, TransactionMessage, VersionedTransaction } from "@solana/web3.js"; const NOZOMI_ENDPOINT = "https://nozomi.temporal.xyz/api/sendTransaction2?c="; const NOZOMI_TIP = new PublicKey("TEMPaMeCRFAS9EKF53Jd6KpHxgL47uWLcpFArU1Fanq"); const MIN_TIP_AMOUNT = 1_000_000; const SOLANA_RPC_ENDPOINT = "https://api.mainnet-beta.solana.com"; async function sendNozomiTxn(ixns, signer, nozomiEndpoint, solanaRpcClient) { const tipIxn = SystemProgram.transfer({ fromPubkey: signer.publicKey, toPubkey: NOZOMI_TIP, lamports: MIN_TIP_AMOUNT }); ixns.push(tipIxn); const { blockhash } = await solanaRpcClient.getLatestBlockhash(); const messageV0 = new TransactionMessage({ payerKey: signer.publicKey, recentBlockhash: blockhash, instructions: ixns, }).compileToV0Message(); const versionedTxn = new VersionedTransaction(messageV0); versionedTxn.sign([signer]); const txnBytes = versionedTxn.serialize(); const txnBase64 = Buffer.from(txnBytes).toString('base64'); const response = await fetch(nozomiEndpoint, { method: 'POST', headers: { 'Content-Type': 'text/plain', }, body: txnBase64 }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Transaction failed with status ${response.status}: ${errorText}`); } // api v2 does not return a signature, just check for success console.log('Transaction sent successfully'); } function buildIxns() { // your instruction building logic here.. return []; } async function main() { const solanaRpcClient = new Connection(SOLANA_RPC_ENDPOINT); // replace with actual keypair loading logic const signer = Keypair.generate(); const ixns = buildIxns(); await sendNozomiTxn(ixns, signer, NOZOMI_ENDPOINT, solanaRpcClient); } main().catch(err => { console.error(err); }); ``` -------------------------------- ### POST /?c= Source: https://use.temporal.xyz/nozomi/transaction-submission-json-rpc.md Submits a transaction to the Solana network using the JSON-RPC protocol. This endpoint acts as a drop-in replacement for standard Solana RPC nodes. ```APIDOC ## POST /?c= ### Description Submits a transaction to the Solana network using the JSON-RPC protocol. This endpoint acts as a drop-in replacement for standard Solana RPC nodes. ### Method POST ### Endpoint /?c= ### Parameters #### Query Parameters - **c** (string) - Required - Your Nozomi API key. ### Request Body - **jsonrpc** (string) - Required - The JSON-RPC version, must be "2.0". - **id** (number) - Required - A unique identifier for the request. - **method** (string) - Required - The RPC method, must be "sendTransaction". - **params** (array) - Required - An array containing the base64 encoded transaction bytes and an options object with "encoding": "base64". ### Request Example { "jsonrpc": "2.0", "id": 1, "method": "sendTransaction", "params": [ "", { "encoding": "base64" } ] } ### Response #### Success Response (200) - **jsonrpc** (string) - The JSON-RPC version. - **id** (number) - The request identifier. - **result** (string) - The transaction signature. #### Response Example { "jsonrpc": "2.0", "id": 1, "result": "" } ``` -------------------------------- ### POST /api/sendBatch Source: https://use.temporal.xyz/nozomi/batch-send.md Submit a batch of raw Solana transactions using a binary-encoded format. ```APIDOC ## POST /api/sendBatch ### Description Submit multiple raw Solana transactions in a single request using a compact binary format. This endpoint is stream-processed, meaning transactions are forwarded as they are parsed. ### Method POST ### Endpoint /api/sendBatch?c= ### Parameters #### Query Parameters - **c** (string) - Required - Your API key for authentication. #### Request Body - **Binary-encoded transaction batch** (application/octet-stream) - Required - A concatenation of length-prefixed transactions. Each transaction is prefixed by a big-endian u16 indicating the size of the following transaction bytes. ### Response #### Success Response (200) - **Empty Body** - All transactions accepted. #### Error Responses - **400** - Framing error, size violation, parse failure, or insufficient tip. - **401** - Invalid or missing API key. - **429** - Rate limited. - **500** - Internal error. ``` -------------------------------- ### Submit Transaction to Nozomi API Source: https://use.temporal.xyz/nozomi/transaction-submission-api-v2/python.md Uses aiohttp to send a base64-encoded transaction to the Nozomi endpoint. Requires a tip instruction to be appended to the transaction instructions. ```python import aiohttp import asyncio import base64 from typing import List from solders.pubkey import Pubkey from solders.keypair import Keypair from solders.instruction import Instruction from solders.transaction import Transaction from solders.system_program import transfer, TransferParams from solders.hash import Hash from solana.rpc.async_api import AsyncClient NOZOMI_ENDPOINT = "https://nozomi.temporal.xyz/api/sendTransaction2?c=" NOZOMI_TIP = Pubkey.from_string("TEMPaMeCRFAS9EKF53Jd6KpHxgL47uWLcpFArU1Fanq") MIN_TIP_AMOUNT = 1_000_000 SOLANA_RPC_ENDPOINT = "https://api.mainnet-beta.solana.com" async def send_nozomi_txn( ixns: List[Instruction], signer: Keypair, nozomi_endpoint: str, solana_rpc_client: AsyncClient ) -> None: tip_ixn = transfer(TransferParams( from_pubkey=signer.pubkey(), to_pubkey=NOZOMI_TIP, lamports=MIN_TIP_AMOUNT )) ixns.append(tip_ixn) blockhash_resp = await solana_rpc_client.get_latest_blockhash() blockhash = blockhash_resp.value.blockhash txn = Transaction.new_signed_with_payer( ixns, signer.pubkey(), [signer], blockhash ) txn_bytes = bytes(txn) txn_base64 = base64.b64encode(txn_bytes).decode('utf-8') async with aiohttp.ClientSession() as session: async with session.post( nozomi_endpoint, headers={"Content-Type": "text/plain"}, data=txn_base64 ) as response: # api v2 does not return a signature, just check for success if response.status >= 200 and response.status < 300: print("Transaction sent successfully") else: error_text = await response.text() raise Exception(f"Transaction failed with status {response.status}: {error_text}") def build_ixns() -> List[Instruction]: # your instruction building logic here.. return [] async def main(): solana_rpc_client = AsyncClient(SOLANA_RPC_ENDPOINT) # replace with actual keypair loading logic signer = Keypair() ixns = build_ixns() await send_nozomi_txn(ixns, signer, NOZOMI_ENDPOINT, solana_rpc_client) if __name__ == "__main__": asyncio.run(main()) ``` -------------------------------- ### POST https://nozomi.temporal.xyz/ Source: https://use.temporal.xyz/nozomi/transaction-submission-json-rpc/curl.md Submits a transaction to the Nozomi network using the JSON-RPC 2.0 protocol. ```APIDOC ## POST https://nozomi.temporal.xyz/ ### Description Submits a transaction to the Nozomi network using the JSON-RPC 2.0 protocol. ### Method POST ### Endpoint https://nozomi.temporal.xyz/?c= ### Request Body - **jsonrpc** (string) - Required - Must be "2.0" - **id** (number) - Required - Request identifier - **method** (string) - Required - Must be "sendTransaction" - **params** (array) - Required - Contains the base64-encoded transaction bytes and an encoding configuration object. ### Request Example { "jsonrpc": "2.0", "id": 1, "method": "sendTransaction", "params": [ "", { "encoding": "base64" } ] } ``` -------------------------------- ### Regional Endpoint Configuration Source: https://use.temporal.xyz/nozomi/endpoints.md List of available regional endpoints for direct and Cloudflare-proxied connections. ```APIDOC ## Regional Endpoints ### Description Connect to specific regional datacenters to achieve the lowest possible latency based on your infrastructure location. ### Regions | Region | Direct Endpoint | Cloudflare Endpoint | | --- | --- | --- | | Pittsburgh | pit1.nozomi.temporal.xyz | pit.nozomi.temporal.xyz | | Newark | ewr1.nozomi.temporal.xyz | ewr.nozomi.temporal.xyz | | Ashburn | ash1.nozomi.temporal.xyz | ash.nozomi.temporal.xyz | | Los Angeles | lax1.nozomi.temporal.xyz | lax.nozomi.temporal.xyz | | Frankfurt | fra2.nozomi.temporal.xyz | fra.nozomi.temporal.xyz | | Amsterdam | ams1.nozomi.temporal.xyz | ams.nozomi.temporal.xyz | | London | lon1.nozomi.temporal.xyz | lon.nozomi.temporal.xyz | | Tokyo | tyo1.nozomi.temporal.xyz | tyo.nozomi.temporal.xyz | | Singapore | sgp1.nozomi.temporal.xyz | sgp.nozomi.temporal.xyz | ### Connection Guidelines - **Direct**: Best for datacenters or VPS with good peering. Supports `http://` (lowest latency) and `https://`. - **Cloudflare**: Best for residential connections, variable network quality, or browser-based applications. Supports `https://` only. ``` -------------------------------- ### encodeBatch(rawTxs) Source: https://use.temporal.xyz/nozomi/batch-send/javascript.md Encodes an array of raw transactions into a binary buffer for batch transmission. ```APIDOC ## encodeBatch(rawTxs) ### Description Validates and encodes an array of raw transactions into a single Buffer. Each transaction is prefixed with its 2-byte length in big-endian format. ### Parameters - **rawTxs** (Array) - An array of 1-16 raw transactions. ### Returns - **Buffer** - The encoded binary data. ``` -------------------------------- ### POST /api/sendBatch Source: https://use.temporal.xyz/nozomi/endpoints.md Endpoint for sending a batch of transactions. ```APIDOC ## POST /api/sendBatch ### Description Endpoint for submitting a batch of transactions. Returns an empty body on success. ### Method POST ### Endpoint /api/sendBatch ### Parameters #### Query Parameters - **c** (string) - Required - API key for authentication. ### Response #### Success Response (200) - **body** (empty) - Batch processed successfully. ``` -------------------------------- ### Encode and Send Transaction Batches in JavaScript Source: https://use.temporal.xyz/nozomi/batch-send/javascript.md Encodes an array of raw transactions into a binary buffer and sends them to a specified endpoint. The batch size must be between 1 and 16 transactions, and each transaction must be between 66 and 1232 bytes. ```javascript function encodeBatch(rawTxs) { if (rawTxs.length === 0 || rawTxs.length > 16) { throw new Error("batch must contain 1-16 transactions"); } let total = 0; for (const tx of rawTxs) { if (tx.length < 66 || tx.length > 1232) { throw new Error(`invalid tx size: ${tx.length}`); } total += 2 + tx.length; } const out = Buffer.allocUnsafe(total); let off = 0; for (const tx of rawTxs) { out.writeUInt16BE(tx.length, off); off += 2; Buffer.from(tx).copy(out, off); off += tx.length; } return out; } async function sendBatch(endpoint, apiKey, rawTxs) { const body = encodeBatch(rawTxs); const res = await fetch( `${endpoint}/api/sendBatch?c=${apiKey}`, { method: "POST", headers: { "Content-Type": "application/octet-stream" }, body, } ); if (!res.ok) { const text = await res.text(); throw new Error(`sendBatch failed (${res.status}): ${text}`); } } ``` -------------------------------- ### Submit Transaction via cURL Source: https://use.temporal.xyz/nozomi/transaction-submission-api-v2/curl.md Sends a base64 encoded transaction to the Nozomi API using a POST request. ```bash curl https://nozomi.temporal.xyz/api/sendTransaction2?c= \ -X POST \ -H "Content-Type: text/plain" \ -d '' ``` -------------------------------- ### sendTransaction Source: https://use.temporal.xyz/nozomi/transaction-submission-json-rpc/javascript.md Sends a versioned transaction to the Nozomi RPC client after appending the required tip instruction. ```APIDOC ## sendTransaction ### Description Submits a versioned transaction to the Nozomi RPC endpoint. The transaction must include a tip instruction to the Nozomi tip account (TEMPaMeCRFAS9EKF53Jd6KpHxgL47uWLcpFArU1Fanq) with a minimum amount of 1,000,000 lamports. ### Method JSON-RPC (via @solana/web3.js Connection) ### Parameters - **ixns** (Array) - Required - An array of Solana instructions to be included in the transaction. - **signer** (Keypair) - Required - The account signing the transaction. - **nozomiRpcClient** (Connection) - Required - The Nozomi RPC connection instance. - **solanaRpcClient** (Connection) - Required - A standard Solana RPC connection instance for fetching blockhashes. ### Response - **signature** (string) - The transaction signature returned by the Nozomi RPC client. ``` -------------------------------- ### Authenticate API Requests Source: https://use.temporal.xyz/nozomi/endpoints.md Include the API key as a query parameter in all requests. A 401 status code indicates an invalid or missing key. ```text ?c= ``` -------------------------------- ### POST https://nozomi.temporal.xyz/api/sendTransaction2 Source: https://use.temporal.xyz/nozomi/transaction-submission-api-v2/python.md Submits a signed Solana transaction to the Nozomi API for processing. ```APIDOC ## POST https://nozomi.temporal.xyz/api/sendTransaction2?c= ### Description Submits a base64-encoded signed Solana transaction to the Nozomi API. The transaction must include a tip instruction to the specified Nozomi tip address. ### Method POST ### Endpoint https://nozomi.temporal.xyz/api/sendTransaction2?c= ### Parameters #### Query Parameters - **c** (string) - Required - Your API key for the Nozomi service. ### Request Body - **body** (string) - Required - The base64-encoded bytes of the signed Solana transaction. ### Response #### Success Response (200-299) - **status** (integer) - Indicates successful submission of the transaction. ``` -------------------------------- ### Maintain TCP connection with a ping loop Source: https://use.temporal.xyz/nozomi/keeping-your-tcp-connection-alive.md A bash script that sends a request to the /ping endpoint every 60 seconds to keep the connection active. ```bash while true; do curl -s https://nozomi.temporal.xyz/ping > /dev/null sleep 60 done ``` -------------------------------- ### POST /api/sendTransaction2 Source: https://use.temporal.xyz/nozomi/transaction-submission-api-v2.md Submits a base64-encoded transaction to the network with minimal overhead. ```APIDOC ## POST /api/sendTransaction2 ### Description Submits a transaction to the network. This endpoint is optimized for performance by accepting a base64-encoded body and avoiding JSON parsing. ### Method POST ### Endpoint /api/sendTransaction2?c= ### Parameters #### Query Parameters - **c** (string) - Required - Your API key for authentication. #### Request Body - **body** (string) - Required - Base64-encoded transaction bytes. ### Response #### Success Response (200) - **Body** (empty) - Returns an empty body on success. ``` -------------------------------- ### POST /api/sendTransaction2 Source: https://use.temporal.xyz/nozomi/transaction-submission-api-v2/curl.md Submits a transaction to the Nozomi API by sending base64-encoded transaction bytes in the request body. ```APIDOC ## POST /api/sendTransaction2 ### Description Submits a transaction to the Nozomi API. The transaction bytes must be base64-encoded and provided in the request body. ### Method POST ### Endpoint https://nozomi.temporal.xyz/api/sendTransaction2 ### Parameters #### Query Parameters - **c** (string) - Required - Your API key. #### Request Body - **body** (string) - Required - The base64-encoded transaction bytes. ### Request Example ```bash curl https://nozomi.temporal.xyz/api/sendTransaction2?c= \ -X POST \ -H "Content-Type: text/plain" \ -d '' ``` ``` -------------------------------- ### Tip Data Schema Source: https://use.temporal.xyz/nozomi/tip-stream.md The JSON structure returned by the tip stream endpoints, representing landed tip percentiles over time. ```json [ { "time": "string (ISO 8601 timestamp)", "landed_tips_25th_percentile": "number", "landed_tips_50th_percentile": "number", "landed_tips_75th_percentile": "number", "landed_tips_95th_percentile": "number", "landed_tips_99th_percentile": "number" } ] ``` -------------------------------- ### Wire Format Specification Source: https://use.temporal.xyz/nozomi/batch-send.md The request body must be a concatenation of length-prefixed transactions using big-endian u16 for length prefixes. ```text [len_hi][len_lo][tx_bytes...][len_hi][len_lo][tx_bytes...]... ``` -------------------------------- ### JSON-RPC Endpoint Source: https://use.temporal.xyz/nozomi/endpoints.md Endpoint for performing JSON-RPC operations to retrieve transaction signatures. ```APIDOC ## JSON-RPC / ### Description Endpoint for JSON-RPC requests to retrieve transaction signatures. ### Method JSON-RPC ### Endpoint / ### Parameters #### Query Parameters - **c** (string) - Required - API key for authentication. ``` -------------------------------- ### JSON-RPC Transaction Submission Response Source: https://use.temporal.xyz/nozomi/transaction-submission-json-rpc.md The expected JSON-RPC response format containing the transaction signature upon successful submission. ```json { "jsonrpc": "2.0", "id": 1, "result": "" } ``` -------------------------------- ### JSON-RPC Transaction Submission Request Source: https://use.temporal.xyz/nozomi/transaction-submission-json-rpc.md The standard JSON-RPC request body for sending a transaction. Ensure the transaction bytes are base64 encoded and the encoding parameter is explicitly set to 'base64'. ```json { "jsonrpc": "2.0", "id": 1, "method": "sendTransaction", "params": [ "", { "encoding": "base64" } ] } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.