Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.prudra.dev/llms.txt

Use this file to discover all available pages before exploring further.

Track transfer status

Direct and swap transfers confirm synchronously — the transfer() call returns with status: 'confirmed'. Bridge transfers start as pending and require tracking.

Polling transfer status

import { initialise } from '@prudra/core';
import { getTransaction } from '@prudra/wallet';

initialise({ apiKey: process.env.PRUDRA_API_KEY! });

const tx = await getTransaction({ transactionId: 'wtx_clx1abc123' });
console.log(tx.status);      // 'pending' | 'confirmed' | 'failed'
console.log(tx.confirmedAt); // null while pending
Via cURL:
curl https://api.prudra.dev/wallet-infra/wallets/mwt_clx1abc123/transactions/wtx_clx1abc123 \
  -H "Authorization: Bearer prv_test_sk_..."

Webhook-based tracking

Webhooks are more efficient than polling for bridge transfers. Register once and receive status updates automatically:
curl -X POST https://api.prudra.dev/webhooks \
  -H "Authorization: Bearer prv_test_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-server.com/webhooks/prudra",
    "events": ["transfer.completed", "transfer.failed"]
  }'

Status values

StatusDescriptionNext state
pendingBridge initiated, awaiting destination confirmationconfirmed or failed
confirmedDestination chain confirmed, tokens receivedTerminal
failedBridge failed, funds refunded to source walletTerminal
Direct and swap transfers skip pending entirely — they return confirmed immediately.

List all transfers

import { listTransactions } from '@prudra/wallet';

const txs = await listTransactions({
  walletId:  'mwt_clx1abc123',
  direction: 'outbound',
});

for (const tx of txs) {
  console.log(`${tx.id}  ${tx.route}  ${tx.status}  ${tx.amount} ${tx.fromToken}`);
}