Instance Method
transaction(at:)
Returns the transaction at the given index as an owned Transaction (safe to store past this block’s lifetime).
func transaction(at index: Int) -> Transaction
Parameters
-
index
-
Zero-based transaction index.
Discussion
Index 0 is always the coinbase transaction. Non-coinbase transactions follow in block order (typically ascending fee rate for miner-assembled blocks, but this is convention — the consensus rules don’t require it).
Precondition
index must be in 0..<transactionCount.