FuelLabs / fuel-js

⚡ All Fuel javascript utilities and implementations.
https://docs.fuel.sh
Apache License 2.0
82 stars 24 forks source link

[feature request] return data logging plugin #15

Open SilentCicero opened 3 years ago

SilentCicero commented 3 years ago

Users might want to leverage Fuel's return data, we could allow a simple plugin such that everytime return data is detected, it calls a specific API. This way users could run a Fuel node and filter and database return logs based upon a specific set of criteria.

Proposed API

// ./index.js
const app = require('@fuel-js/client/src/app');

app({
   filter: async (transaction = {}) => {
       transaction.outputs....
   },
})
.then(console.log)
.catch(console.log);

Running it:

node src/index --network="rinkeby" --infura="...."
SilentCicero commented 3 years ago

filter code specced for next @fuel-js/logic release.