object TwoPartyTradeFlow
This asset trading flow implements a "delivery vs payment" type swap. It has two parties (B and S for buyer and seller) and the following steps:
Assuming no malicious termination, they both end the flow being in posession of a valid, signed transaction that represents an atomic asset swap.
Note that it's the
To initiate the flow, use either the runBuyer or runSeller methods, depending on which side of the trade your node is taking. These methods return a future which will complete once the trade is over and a fully signed transaction is available: you can either block your thread waiting for the flow to complete by using ListenableFuture.get or more usefully, register a callback that will be invoked when the time comes.
To see an example of how to use this class, look at the unit tests.
Buyer |
class Buyer : FlowLogic<SignedTransaction> |
Seller |
class Seller : FlowLogic<SignedTransaction> |
SellerTradeInfo |
data class SellerTradeInfo |
SignaturesFromSeller |
data class SignaturesFromSeller |
AssetMismatchException |
class AssetMismatchException : FlowException |
UnacceptablePriceException |
class UnacceptablePriceException : FlowException |