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

demux

Package Overview
Dependencies
Maintainers
3
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

demux - npm Package Compare versions

Comparing version 3.1.4-5d9830f.0 to 3.1.4-9f3b4a9.0

dist/AbstractActionHandler.d.ts

16

package.json
{
"name": "demux",
"version": "3.1.4-5d9830f.0",
"version": "3.1.4-9f3b4a9.0",
"author": {

@@ -14,2 +14,3 @@ "name": "Julien Heller",

"devDependencies": {
"@blockone/tslint-config-blockone": "^1.0.0",
"@types/bunyan": "^1.8.5",

@@ -22,4 +23,5 @@ "@types/jest": "^23.1.4",

"eslint-plugin-import": "^2.7.0",
"jest": "^22.4.3",
"jest": "^23.6.0",
"release-it": "^7.5.0",
"supertest": "^3.4.1",
"ts-jest": "^23.0.0",

@@ -37,4 +39,5 @@ "tslint": "^5.10.0",

"lint": "tslint -c tslint.json -p tsconfig.json",
"test": "jest",
"build-docs": "./build-docs.sh"
"test": "jest --detectOpenHandles --maxWorkers=2",
"build-docs": "./build-docs.sh",
"current-version": "echo $npm_package_version"
},

@@ -59,4 +62,7 @@ "jest": {

"dependencies": {
"bunyan": "^1.8.12"
"@types/express": "^4.16.0",
"@types/supertest": "^2.0.7",
"bunyan": "^1.8.12",
"express": "^4.16.4"
}
}

@@ -86,2 +86,4 @@ # demux-js [![Build Status](https://travis-ci.org/EOSIO/demux-js.svg?branch=develop)](https://travis-ci.org/EOSIO/demux-js)

* [**`ExpressActionWatcher`**](https://eosio.github.io/demux-js/classes/expressactionwatcher.html): Exposes the API methods from the BaseActionWatcher through an Express server
In order to process actions, we need the following things:

@@ -95,9 +97,46 @@

- Instantiate the implemented `AbstractActionReader` with any needed configuration
- Instantiate the implemented `AbstractActionHandler`, passing in the `HandlerVersion` and any other needed configuration
- Instantiate the implemented `AbstractActionReader` with any needed configuration
- Instantiate a `BaseActionWatcher`, passing in the above Handler and Reader instances
- Call `watch()` on the Watcher
- Instantiate the `BaseActionWatcher` (or a subclass), passing in the Action Handler and Action Watcher instances
- Start indexing via the Action Watcher's `watch()` method (by either calling it directly or otherwise)
#### Example
```javascript
const { BaseActionWatcher, ExpressActionWatcher } = require("demux")
const { MyActionReader } = require("./MyActionReader")
const { MyActionHandler } = require("./MyActionHandler")
const { handlerVersions } = require("./handlerVersions")
const { readerConfig, handlerConfig, pollInterval, portNumber } = require("./config")
const actionReader = new MyActionReader(readerConfig)
const actioHandler = new MyActionHandler(handlerVersions, handlerConfig)
```
Then, either
```javascript
const watcher = new BaseActionWatcher(
actionReader,
actionHandler,
pollInterval,
)
watcher.watch()
```
Or,
```javascript
const expressWatcher = new ExpressActionWatcher(
actionReader,
actionHandler,
pollInterval,
portNumber,
)
expressWatcher.listen()
// You can then make a POST request to `/start` on your configured endpoint
```
### [**API documentation**](https://eosio.github.io/demux-js/)
### [Learn from a full example](examples/eos-transfers)

Sorry, the diff of this file is not supported yet

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