npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

metronome-wallet-core

v3.0.0

Published

Core logic to develop an Ethereum Metronome wallet

Downloads

45

Readme

metronome-wallet-core

Greenkeeper badge

Core logic to develop an Ethereum Metronome wallet.

The core logic has a modular design where each module or plugin can emit events and expose methods to other plugins or the code client.

Quick start

Minimum Node version required is v12, v14 is recommended

const createCore = require('metronome-wallet-core')

const core = createCore()

const { api, emitter, events } = core.start()

// Listen for `events` on the `emitter`.
// Call `api` methods

core.stop()

API

  • createCore(): Creates a wallet core instance.

  • core.start({ config }): Initializes the core logic. Returns an object containing the exposed methods in api, an emitter to expose events and the list of emitted events in the events array. See below for details.

  • core.stop(): stops everything.

Config

The configuration object has default properties as defined in src/defaultConfig.json.

Plugins (modules)

All plugins must follow this pattern:

function createPlugin () {
  return {
    start ({ config, eventBus, plugins }) {
      // Initialize
      return { events, name, api }
    },
    stop () {
      // Clean up
    }
  }
}

The start method will receive the core config, an eventBus emitter and an object containing all the other plugin's exposed methods. The return object shall contain a list of events that might be interesting to the core's user, the name of the plugin and an object containing all api methods exposed.

The eventBus is the same instance as core.start().emitter. All methods exposed by all plugins will be available to all other plugins and namespaced core.start().api using the name property.

The following plugins are bundled:

  • eth: Provides connectivity with the Ethereum node.
  • explorer: Provides notifications and keeps track of new blocks, transactions and events.
  • metronome: Provides Metronome-specific functionality as interacting with the auctions, converter and token contracts.
  • rates: Provides crypto-to-fiat exchange rates.
  • tokens: Provides base ERC20 token functions.
  • wallet: Provides base key/account management

License

MIT