Extract contract information from settlement transactions
The settlement transaction includes the redeem script + unlocking script + outputs. This information can be used to recover a lot of information about the contract.
Combining all this information it should be possible to reconstruct a full ContractData
object. Perhaps a few things will be difficult to figure out, like start price and liquidation multipliers. For some other information might need to look up additional transactions (like the funding transaction to figure out the fee information).
We should implement a utility function that takes in a raw transaction hex, decodes it and reconstructs a full ContractData
object for it.
As a start we will only implement simpler version of this utility function that only extracts the price oracle message.