Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aa-hook-t

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aa-hook-t

![AA hooks](/public/img.svg)

  • 0.0.21
  • unpublished
  • beta
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

AA hooks

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");

// create net of hooks
const net = new Net(["O6H6ZIFI57X3PLTYHOCVYPP5A553CYFQ"], {
    ignoreHistory: false, // loading old reponses
});

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")
    ...
    
// custom hook
net.register("unique_event_id", eventController)
    .isSuccess()
    .customHook(async (res, meta) => {
        const { payload, trigger_unit } = meta;
        // this is a fillter function
        // always returns boolean value*
    }, ["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.

Kivach

FAQs

Package last updated on 27 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc