Colin
Colin

Reputation: 3752

How can I get final output states inside flow?

At the end of a transaction flow, if it creates a new state (or states), how can I get access to the output StateAndRef objects?

Upvotes: 1

Views: 68

Answers (1)

Roger Willis
Roger Willis

Reputation: 922

You can do three things:

  1. On your SignedTransaction object you can call SignedTransaction.tx.outRefsOfType<T>() and that will return a List<StateAndRef<T>> for you.
  2. Perform a vault query to extract the states which have just been added to the vault. Vault queries return List<StateAndRef<T>>
  3. Subscribe to an observable via the trackBy functionality of the vault. When the transaction is committed the observable will emit StateAndRef<T>s for the newly committed states

Upvotes: 0

Related Questions