Skip to main content

Transactions

Get transaction by ID

GET /v1/transactions/{tx_id}

Returns an enhanced parsed transaction from the Kwery index when available, otherwise from the node mempool.

Plan requirement

Developer and Business plans. Free plan users receive 403.

Credits

  • 10 credits base (enhanced API)
  • +5 credits when a live getMempoolEntry RPC fallback is used

Example

const API_KEY = "kwery_live_YOUR_KEY";
const API_URL = "https://kwery-api.com";

const tx = await fetch(`${API_URL}/v1/transactions/abc123...`, {
  headers: { "X-API-Key": API_KEY },
}).then((r) => r.json());

console.log(tx.parsed);

Response

{
  "tx_id": "abc123...",
  "status": "confirmed",
  "parsed": {
    "tx_id": "abc123...",
    "outputs": [],
    "tags": []
  },
  "source": "index",
  "block_time": "2025-06-25T12:00:00+00:00",
  "credits_used": 10
}

Confirmed transactions are served from the indexer cache. Pending transactions may come from index or mempool.


Priority fees (before submit)

Kaspa does not have Solana-style bundles or a separate priority field on submit. Priority is the transaction fee — any amount above the network minimum, with miners ordering by feerate (sompi per gram of mass).

Recommended flow:

  1. GET /v1/fees/estimate — feerate buckets (priority, normal, low)
  2. Build & sign tx with fee ≥ feerate × mass for your target speed
  3. POST /v1/transactions/submit — retries, optional mempool wait, RBF

See Fee Estimate for details.


Submit transaction

POST /v1/transactions/submit

Optimized landing path: upstream retries, optional mempool wait, multi-upstream failover, and RBF (submitTransactionReplacement). Sign the tx with your target fee before calling this endpoint — Kwery cannot add priority after signing.

Plan requirement

Developer and Business plans.

Credits

  • 10 credits base (enhanced API)
  • 5 credits per upstream RPC attempt (submit + optional mempool poll)

Request body

FieldTypeDescription
transactionobjectSigned Kaspa transaction
allow_orphanboolPass through to submitTransaction
replace_by_feeboolUse submitTransactionReplacement
wait_for_mempoolboolPoll getMempoolEntry after submit
wait_timeout_secondsnumberMax wait (0.5–30, default 5)

Example

import kaspa from "kaspa-wasm";

const API_KEY = "kwery_live_YOUR_KEY";
const API_URL = "https://kwery-api.com";

// Build & sign with kaspa-wasm (Generator, PrivateKey, etc.)
const signedTx = { /* your signed transaction */ };

const result = await fetch(`${API_URL}/v1/transactions/submit`, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": API_KEY,
  },
  body: JSON.stringify({
    transaction: signedTx,
    wait_for_mempool: true,
  }),
}).then((r) => r.json());

console.log(result.tx_id, result.mempool_seen);

Response

{
  "tx_id": "abc123...",
  "submitted": true,
  "mempool_seen": true,
  "attempts": 1,
  "credits_used": 20
}