valo-log-finder
TypeScript icon, indicating that this package has built-in type declarations

0.0.9-alpha • Public • Published

valo-log-finder

Valo standard ruleset for well known log patterns

Example codes

import {
  createActionRuleSet,
  createAmountRuleSet
  createLogMatcherForActions,
  createLogMatcherForAmounts,
  getTxCanonicalMsgs,
  getTxAmounts
} from "valo-log-finder"

const tx = {
  "height": ...,
  "txhash": ...,
  "raw_log": ...,
  "logs": ...,
  "gas_wanted": ...,
  "gas_used": ...,
  "tx": ...,
  "timestamp": ...,
}
const address = "nova1..." //TODO: Fix

// getTxCanonicalMsgs
const actionRuleset = createActionRuleSet()
const actionLogMatcher = createLogMatcherForActions(actionRuleset)
const actionMatchedMsg = getTxCanonicalMsgs(tx, actionLogMatcher)

console.log(actionMatchedMsg)


// getTxAmountInfo
const amountRuleset = createAmountRuleSet()
const amountLogMatcher = createLogMatcherForAmounts(amountRuleset)
const amountMatchedMsg = getTxAmounts(tx, amountLogMatcher, address)

console.log(amountMatchedMsg)

Readme

Keywords

none

Package Sidebar

Install

npm i valo-log-finder

Weekly Downloads

3

Version

0.0.9-alpha

License

MIT

Unpacked Size

196 kB

Total Files

76

Last publish

Collaborators

  • james_won