Hook list
- aaAddressIs
- triggerAaAddressIs
- triggerUnitIs
- baseAaIs
- responseKeyContains
- responseKeyIs
- responseKeyLessThan
- responseKeyMoreThan
- triggerDataContainsKey
- triggerDataKeyIs
- triggerDataKeyLessThan
- triggerDataKeyMoreThan
- responseOutputsAmountLessThan
- responseOutputsAmountMoreThan
- responseOutputsAmountIs
- sentAmountLessThan
- sentAmountMoreThan
- sentAmountIs
- isSuccess
- isBounced
- customHook
Examples
const { Net } = require("aa-hooks");
const net = new Net(["O6H6ZIFI57X3PLTYHOCVYPP5A553CYFQ"], {
ignoreHistory: false,
});
const eventController = (res, req) => {
const symbol = req.messages.find((m => m.app === 'data'))?.payload?.symbol;
console.error("Reg new symbol: ", symbol);
}
net.register("new_symbol", eventController)
.isSuccess()
.triggerDataContainsKey("symbol")
.triggerDataContainsKey("asset")
.triggerDataContainsKey("drawer")
...
net.register("unique_event_id", eventController)
.isSuccess()
.customHook(async (res, meta) => {
const { payload, trigger_unit } = meta;
}, ["payload", "trigger_unit"])
.triggerDataContainsKey("symbol");
Configuring
The default settings are in the library's conf.js, they can be overridden in your project root's conf.js, then in conf.json in the app data folder. The app data folder is:
- macOS:
~/Library/Application Support/<appname>
- Linux:
~/.config/<appname>
- Windows:
%LOCALAPPDATA%\<appname>
<appname>
is name
in your package.json
.
Donations
To support our work, donate through kivach.org.