|
virtual | ~Step ()=default |
|
virtual std::pair< EitherAmount, EitherAmount > | rev (PaymentSandbox &sb, ApplyView &afView, boost::container::flat_set< uint256 > &ofrsToRm, EitherAmount const &out)=0 |
| Find the amount we need to put into the step to get the requested out subject to liquidity limits. More...
|
|
virtual std::pair< EitherAmount, EitherAmount > | fwd (PaymentSandbox &sb, ApplyView &afView, boost::container::flat_set< uint256 > &ofrsToRm, EitherAmount const &in)=0 |
| Find the amount we get out of the step given the input subject to liquidity limits. More...
|
|
virtual std::optional< EitherAmount > | cachedIn () const =0 |
| Amount of currency computed coming into the Step the last time the step ran in reverse. More...
|
|
virtual std::optional< EitherAmount > | cachedOut () const =0 |
| Amount of currency computed coming out of the Step the last time the step ran in reverse. More...
|
|
virtual std::optional< AccountID > | directStepSrcAcct () const |
| If this step is DirectStepI (IOU->IOU direct step), return the src account. More...
|
|
virtual std::optional< std::pair< AccountID, AccountID > > | directStepAccts () const |
|
virtual DebtDirection | debtDirection (ReadView const &sb, StrandDirection dir) const =0 |
| If this step is a DirectStepI and the src redeems to the dst, return true, otherwise return false. More...
|
|
virtual std::uint32_t | lineQualityIn (ReadView const &) const |
| If this step is a DirectStepI, return the quality in of the dst account. More...
|
|
virtual std::pair< std::optional< Quality >, DebtDirection > | qualityUpperBound (ReadView const &v, DebtDirection prevStepDir) const =0 |
| Find an upper bound of quality for the step. More...
|
|
virtual std::uint32_t | offersUsed () const |
| Return the number of offers consumed or partially consumed the last time the step ran, including expired and unfunded offers. More...
|
|
virtual std::optional< Book > | bookStepBook () const |
| If this step is a BookStep, return the book. More...
|
|
virtual bool | isZero (EitherAmount const &out) const =0 |
| Check if amount is zero. More...
|
|
virtual bool | inactive () const |
| Return true if the step should be considered inactive. More...
|
|
virtual bool | equalOut (EitherAmount const &lhs, EitherAmount const &rhs) const =0 |
| Return true if Out of lhs == Out of rhs. More...
|
|
virtual bool | equalIn (EitherAmount const &lhs, EitherAmount const &rhs) const =0 |
| Return true if In of lhs == In of rhs. More...
|
|
virtual std::pair< bool, EitherAmount > | validFwd (PaymentSandbox &sb, ApplyView &afView, EitherAmount const &in)=0 |
| Check that the step can correctly execute in the forward direction. More...
|
|
A step in a payment path.
There are five concrete step classes: DirectStepI is an IOU step between accounts BookStepII is an IOU/IOU offer book BookStepIX is an IOU/XRP offer book BookStepXI is an XRP/IOU offer book XRPEndpointStep is the source or destination account for XRP
Amounts may be transformed through a step in either the forward or the reverse direction. In the forward direction, the function fwd
is used to find the amount the step would output given an input amount. In the reverse direction, the function rev
is used to find the amount of input needed to produce the desired output.
Amounts are always transformed using liquidity with the same quality (quality is the amount out/amount in). For example, a BookStep may use multiple offers when executing fwd
or rev
, but all those offers will be from the same quality directory.
A step may not have enough liquidity to transform the entire requested amount. Both fwd
and rev
return a pair of amounts (one for input amount, one for output amount) that show how much of the requested amount the step was actually able to use.
Definition at line 79 of file Steps.h.