Class AccountBalanceNotifier
java.lang.Object
nxt.addons.AbstractContract<Object,Object>
com.jelurida.ardor.contracts.trading.AccountBalanceNotifier
A contact which monitors minimum balances for coins and assets and post a warning on a slack channel (configured via web-hook url)
in case any of the coin or asset balances goes below some threshold balance
(for instance the 10 ARDR necessary for the trading bot contract to operate).
Configuration: "slackWebHookUrl" - points to web-hook of slack channel for notifications "limits" - array of minimum balance limits
Here is contract runner config example:
"AccountBalanceNotifier": {
"slackWebHookUrl": "",
"limits": [{
"accountRs": "ARDOR-XK4R-7VJU-6EQG-7R335",
"type": "coin",
"id": "ARDR",
"minBalance": 10.0,
"refreshInterval": 1
},{
"accountRs": "ARDOR-E93F-7E8Z-BHJ8-A65RG",
"type": "asset",
"id": "123",
"minBalance": 7.0,
"refreshInterval": 3
}]
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classstatic interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(InitializationContext context) Contract initialization.processBlock(BlockContext context) Methods inherited from class nxt.addons.AbstractContract
isDuplicate, processInvocation, processRequest, processTransaction, processVoucherMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nxt.addons.Contract
minProductVersion, shutdown
-
Constructor Details
-
AccountBalanceNotifier
public AccountBalanceNotifier()
-
-
Method Details
-
init
Description copied from interface:ContractContract initialization.Invoked once after loading the contract class, before any other callback. Use this callback to initialize long running services required by the contract.
- Parameters:
context- the contract context
-
processBlock
- Specified by:
processBlockin interfaceContract<Object,Object> - Overrides:
processBlockin classAbstractContract<Object,Object>
-