Reputation: 36
In the flow of creating some state I add reference state to some other object (some custom account in my case). So when I receive this state on the rpc client by trackBy() method I want to know what object it referencing. As I understand, reference exists in transaction, not in the state. What is the proper way to get transaction from state in RPC client?
Upvotes: 0
Views: 103
Reputation: 2548
Not sure you can do that directly from the client, you'd probably need to write a flow that accepts a transaction Id and returns a list of the references.
So inside your flow you'd have something like:
SignedTransaction tx = this.getServiceHub().getValidatedTransactions()
.getTransaction(SecureHash.parse("Your Tx Id"));
ArrayList<StateRef> refs = tx.getReferences();
Upvotes: 1