Package zephyr.wallet.model
Class ZephyrReserveInfo
java.lang.Object
zephyr.wallet.model.ZephyrReserveInfo
The reserve info of the Zephyr network at the current height, as the core's get_reserve_info
reports it.
Amounts are in atomic units and arrive from the native bridge as decimal strings (the core
computes them as 128-bit integers); the two ratios are dimensionless and keep the full double
precision of the core. The JSON keys are snake_case, exactly as the bridge emits them.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty reserve info;ZephyrWallet.getReserveInfo()returns a filled one. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of the reserve assets, in atomic units.Returns the moving average of the reserve assets, in atomic units.Returns the equity of the reserve, in atomic units.Returns the moving average of the equity, in atomic units.Returns the hard fork version at which the reserve info was computed.Returns the liabilities of the reserve, in atomic units.Returns the circulating amount of the reserve asset, in atomic units.Returns the circulating amount of the stable asset, in atomic units.Returns the reserve ratio (dimensionless).Returns the moving average of the reserve ratio (dimensionless).Returns the amount of ZPH held in the reserve, in atomic units.Returns the circulating amount of the yield asset, in atomic units.Returns the amount held in the yield reserve, in atomic units.inthashCode()voidsetAssets(BigInteger assets) Sets the value of the reserve assets, in atomic units.voidsetAssetsMa(BigInteger assetsMa) Sets the moving average of the reserve assets, in atomic units.voidsetEquity(BigInteger equity) Sets the equity of the reserve, in atomic units.voidsetEquityMa(BigInteger equityMa) Sets the moving average of the equity, in atomic units.voidsetHfVersion(Integer hfVersion) Sets the hard fork version at which the reserve info was computed.voidsetLiabilities(BigInteger liabilities) Sets the liabilities of the reserve, in atomic units.voidsetNumReserves(BigInteger numReserves) Sets the circulating amount of the reserve asset, in atomic units.voidsetNumStables(BigInteger numStables) Sets the circulating amount of the stable asset, in atomic units.voidsetReserveRatio(BigDecimal reserveRatio) Sets the reserve ratio (dimensionless).voidsetReserveRatioMa(BigDecimal reserveRatioMa) Sets the moving average of the reserve ratio (dimensionless).voidsetZephReserve(BigInteger zephReserve) Sets the amount of ZPH held in the reserve, in atomic units.voidsetZyieldCirc(BigInteger zyieldCirc) Sets the circulating amount of the yield asset, in atomic units.voidsetZyieldRsv(BigInteger zyieldRsv) Sets the amount held in the yield reserve, in atomic units.toString()toString(int indent) Returns one line per field.
-
Constructor Details
-
ZephyrReserveInfo
public ZephyrReserveInfo()Constructs an empty reserve info;ZephyrWallet.getReserveInfo()returns a filled one.
-
-
Method Details
-
getZephReserve
Returns the amount of ZPH held in the reserve, in atomic units.- Returns:
- the amount of ZPH held in the reserve, in atomic units
-
setZephReserve
Sets the amount of ZPH held in the reserve, in atomic units.- Parameters:
zephReserve- is the amount of ZPH held in the reserve, in atomic units
-
getNumStables
Returns the circulating amount of the stable asset, in atomic units.- Returns:
- the circulating amount of the stable asset, in atomic units
-
setNumStables
Sets the circulating amount of the stable asset, in atomic units.- Parameters:
numStables- is the circulating amount of the stable asset, in atomic units
-
getNumReserves
Returns the circulating amount of the reserve asset, in atomic units.- Returns:
- the circulating amount of the reserve asset, in atomic units
-
setNumReserves
Sets the circulating amount of the reserve asset, in atomic units.- Parameters:
numReserves- is the circulating amount of the reserve asset, in atomic units
-
getAssets
Returns the value of the reserve assets, in atomic units.- Returns:
- the value of the reserve assets, in atomic units
-
setAssets
Sets the value of the reserve assets, in atomic units.- Parameters:
assets- is the value of the reserve assets, in atomic units
-
getAssetsMa
Returns the moving average of the reserve assets, in atomic units.- Returns:
- the moving average of the reserve assets, in atomic units
-
setAssetsMa
Sets the moving average of the reserve assets, in atomic units.- Parameters:
assetsMa- is the moving average of the reserve assets, in atomic units
-
getLiabilities
Returns the liabilities of the reserve, in atomic units.- Returns:
- the liabilities of the reserve, in atomic units
-
setLiabilities
Sets the liabilities of the reserve, in atomic units.- Parameters:
liabilities- is the liabilities of the reserve, in atomic units
-
getEquity
Returns the equity of the reserve, in atomic units.- Returns:
- the equity of the reserve, in atomic units
-
setEquity
Sets the equity of the reserve, in atomic units.- Parameters:
equity- is the equity of the reserve, in atomic units
-
getEquityMa
Returns the moving average of the equity, in atomic units.- Returns:
- the moving average of the equity, in atomic units
-
setEquityMa
Sets the moving average of the equity, in atomic units.- Parameters:
equityMa- is the moving average of the equity, in atomic units
-
getReserveRatio
Returns the reserve ratio (dimensionless).- Returns:
- the reserve ratio (dimensionless)
-
setReserveRatio
Sets the reserve ratio (dimensionless).- Parameters:
reserveRatio- is the reserve ratio (dimensionless)
-
getReserveRatioMa
Returns the moving average of the reserve ratio (dimensionless).- Returns:
- the moving average of the reserve ratio (dimensionless)
-
setReserveRatioMa
Sets the moving average of the reserve ratio (dimensionless).- Parameters:
reserveRatioMa- is the moving average of the reserve ratio (dimensionless)
-
getHfVersion
Returns the hard fork version at which the reserve info was computed.- Returns:
- the hard fork version at which the reserve info was computed
-
setHfVersion
Sets the hard fork version at which the reserve info was computed.- Parameters:
hfVersion- is the hard fork version at which the reserve info was computed
-
getZyieldCirc
Returns the circulating amount of the yield asset, in atomic units.- Returns:
- the circulating amount of the yield asset, in atomic units
-
setZyieldCirc
Sets the circulating amount of the yield asset, in atomic units.- Parameters:
zyieldCirc- is the circulating amount of the yield asset, in atomic units
-
getZyieldRsv
Returns the amount held in the yield reserve, in atomic units.- Returns:
- the amount held in the yield reserve, in atomic units
-
setZyieldRsv
Sets the amount held in the yield reserve, in atomic units.- Parameters:
zyieldRsv- is the amount held in the yield reserve, in atomic units
-
toString
-
toString
Returns one line per field.- Parameters:
indent- indents the lines- Returns:
- the human-readable string
-
hashCode
public int hashCode() -
equals
-