Providers
Transaction Submission
Submit transactions and monitor confirmations
Transaction Submission
Providers handle transaction submission and confirmation monitoring. Submit pre-signed transactions and track their status on the blockchain.
Basic Submission
Submit a signed transaction CBOR string:
import { , , , } from "@evolution-sdk/evolution"
const = .()
.({
: "https://cardano-mainnet.blockfrost.io/api/v0",
: ..!
})
// Submit signed transaction
const = "84a300..." // Signed transaction CBOR
const = .()
const = await .()
.("Transaction submitted:", )Wait for Confirmation
Monitor transaction until confirmed on blockchain:
// Wait for confirmation (checks every 5 seconds by default)
const = await .()
// Custom interval: check every 10 seconds
// const confirmed = await client.awaitTx(txHash, 10000)Transaction Evaluation
Evaluate a transaction before submission to estimate script execution costs:
// Evaluate script execution costs
const = await .()
.(() => {
.(`[${.}#${.}]`,
`mem: ${..}, steps: ${..}`)
})Common Submission Errors
| Error String | Meaning | Retryable? |
|---|---|---|
OutsideValidityIntervalUTxO | Transaction expired | No — rebuild with new validity |
BadInputsUTxO | UTxO already spent | No — rebuild with fresh UTxOs |
ValueNotConservedUTxO | Input/output value mismatch | No — fix transaction logic |
FeeTooSmallUTxO | Fee too low | No — rebuild with correct fee |
| Network timeout | Provider unreachable | Yes — retry after delay |
try {
const signedTx = Transaction.fromCBORHex(signedTxCbor)
const txHash = await client.submitTx(signedTx)
const confirmed = await client.awaitTx(txHash)
} catch (error: any) {
// Terminal errors — don't retry, rebuild the transaction
if (error.message.includes("BadInputsUTxO")) {
console.error("UTxO already spent — rebuild with fresh UTxOs")
} else if (error.message.includes("OutsideValidityIntervalUTxO")) {
console.error("Transaction expired — rebuild with new validity window")
} else {
// Transient errors — safe to retry
console.error("Submission failed:", error.message)
}
}Next Steps
- Use Cases — Complete real-world examples
- Provider Types — Choose the right provider
- Error Handling — Full error type reference and debugging
- Retry-Safe Transactions — Builder-level retry patterns