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

did-eth-typed-data

v1.0.6

Published

This template repository provides a bare-bones structure for writing an agent plugin for Veramo and/or for providing your own implementations for key management and storage, or for DID storage.

Downloads

16

Readme

Veramo plugin template

This template repository provides a bare-bones structure for writing an agent plugin for Veramo and/or for providing your own implementations for key management and storage, or for DID storage.

Quick start

  • Copy this repo
  • Rename package in package.json
  • yarn
  • yarn build or yarn watch
  • yarn generate-plugin-schema
  • yarn start or VSCode Debugger (CMD + Shift + D) > Run OpenAPI server

Structure of this template

1. A custom Veramo agent plugin

An agent plugin for Veramo is a class that provides some methods to be called on the agent object, and also emit and listen to agent events triggered by other plugins.

This repository has an example of such a class in ./src/agent/my-plugin.ts that provides the myPluginFoo() method and listens to validatedMessage events and emits my-event and my-other-event.

The types associated with this plugin are declared in ./src/types/IMyAgentPlugin.ts

Adding a declaration for this in package.json makes it easier to programmatically generate a schema for your plugin:

{
  //...
  "veramo": {
    "pluginInterfaces": {
      "IMyAgentPlugin": "./src/types/IMyAgentPlugin.ts"
    }
  }
}

2. Custom key management templates

This template contains some skeleton code for some customizations to the ways keys are managed by Veramo. You can change how and where keys are stored and how they are encrypted by the default Veramo plugins, and/or create your own AbstractKeyManagementSystem implementation from scratch.

3. Custom DID management templates

You can change how DIDs are stored by Veramo. You can implement support for other DID methods by overriding MyIdentifierProvider

4. Use your plugin with @veramo/cli

See ./agent.yml for an example Veramo CLI configuration that uses the plugin and customizations from this template alongside other Veramo plugins to create a fully functioning agent.

Testing your plugin

There are a number of ways to test your plugin.

Integration tests

This repository contains 2 sample test setups that run the same tests in different contexts.

  • localAgent.test.ts creates an agent using agent.yml and runs the shared tests using that agent.
  • restAgent.test.ts creates an agent using agent.yml and runs it as a remote agent. Then, it creates another agent that uses @veramo/remote-client to expose the methods of the remote agent locally, and runs the tests using the local agent.

Call your agent using the Veramo OpenAPI server

You can also run yarn veramo server in your terminal and then go to http://localhost:3335/api-docs to see all the available plugin methods. You can call them after you click Authorize and provide the API key defined in agent.yml. By default, it is test123.

Step by step debugging

This repository includes some Visual Studio Code launch configurations that can be used for step by step debugging.