public final class FundingMonitor
extends java.lang.Object
COIN, ASSET and CURRENCY balances can be monitored. If a balance falls below the threshold, a transaction will be submitted to transfer units from the funding account to the monitored account. A transfer will remain pending if the number of blocks since the previous transfer transaction is less than the monitor interval.
Modifier and Type | Class and Description |
---|---|
static class |
FundingMonitor.MonitoredAccount
Monitored account
|
Modifier and Type | Field and Description |
---|---|
static long |
MIN_FUND_AMOUNT
Minimum monitor amount
|
static int |
MIN_FUND_INTERVAL
Minimum funding interval
|
static long |
MIN_FUND_THRESHOLD
Minimum monitor threshold
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Check if two monitors are equal
|
long |
getAccountId()
Return the fund account identifier
|
java.lang.String |
getAccountName()
Return the fund account name
|
static java.util.List<FundingMonitor> |
getAllMonitors()
Get all monitors
|
long |
getAmount()
Return the fund amount
|
Chain |
getChain()
Return the transaction chain
|
long |
getFeeRateNQTPerFXT()
Return the feeRateNQTPerFXT
|
long |
getHoldingId()
Return the holding identifier
|
HoldingType |
getHoldingType()
Return the monitor holding type
|
int |
getInterval()
Return the fund interval
|
static java.util.List<FundingMonitor.MonitoredAccount> |
getMonitoredAccounts(FundingMonitor monitor)
Get all monitored accounts for a single monitor
|
static java.util.List<FundingMonitor> |
getMonitors(Filter<FundingMonitor> filter)
Get monitors satisfying the supplied filter
|
java.lang.String |
getProperty()
Return the account property name
|
long |
getThreshold()
Return the fund threshold
|
int |
hashCode()
Return the hash code
|
static void |
shutdown()
Stop monitor processing
|
static FundingMonitor |
startMonitor(Chain chain,
HoldingType holdingType,
long holdingId,
java.lang.String property,
long amount,
long threshold,
int interval,
byte[] privateKey,
long feeRateNQTPerFXT)
Start the monitor
|
static int |
stopAllMonitors()
Stop all monitors
Pending fund transactions will still be processed
|
static boolean |
stopMonitor(Chain chain,
HoldingType holdingType,
long holdingId,
java.lang.String property,
long accountId)
Stop monitor
Pending fund transactions will still be processed
|
public static final long MIN_FUND_AMOUNT
public static final long MIN_FUND_THRESHOLD
public static final int MIN_FUND_INTERVAL
public HoldingType getHoldingType()
public long getHoldingId()
public Chain getChain()
public java.lang.String getProperty()
public long getAmount()
public long getThreshold()
public int getInterval()
public long getAccountId()
public java.lang.String getAccountName()
public long getFeeRateNQTPerFXT()
public static FundingMonitor startMonitor(Chain chain, HoldingType holdingType, long holdingId, java.lang.String property, long amount, long threshold, int interval, byte[] privateKey, long feeRateNQTPerFXT)
One or more funding parameters can be overridden in the account property value string: {"amount":"long","threshold":"long","interval":integer}
chain
- Chain for transactionsholdingType
- Holding typeholdingId
- Asset, currency, or coin identifierproperty
- Account property nameamount
- Fund amountthreshold
- Fund thresholdinterval
- Fund intervalprivateKey
- Fund private keyfeeRateNQTPerFXT
- Fee rate to use for the child chain transactions createdpublic static int stopAllMonitors()
public static boolean stopMonitor(Chain chain, HoldingType holdingType, long holdingId, java.lang.String property, long accountId)
chain
- Monitor chainholdingType
- Monitor holding typeholdingId
- Asset, currency, or coin identifierproperty
- Account propertyaccountId
- Fund account identifierpublic static java.util.List<FundingMonitor> getMonitors(Filter<FundingMonitor> filter)
filter
- Monitor filterpublic static java.util.List<FundingMonitor> getAllMonitors()
public static java.util.List<FundingMonitor.MonitoredAccount> getMonitoredAccounts(FundingMonitor monitor)
monitor
- Monitorpublic static void shutdown()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Comparison object