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

@tokenized/signing-agent

v1.9.1

Published

An automated agent for signing transactions using the Tokenized protocol. Available as a CLI, HTTP server and NodeJS library.

Downloads

57

Readme

Tokenized Signing Agent

An automated agent for signing transactions using the Tokenized protocol. Available as a CLI, HTTP server and NodeJS library.

Quick start

Prerequisites

  • a file (here called secrets.json) containing the platform endpoint URL and client identifiers. Obtain this from Tokenized support.
  • this software package, installed from NPM [https://npmjs.com/package/@tokenized/signing-agent] or source code [https://github.com/tokenized/signing-agent]
  • NodeJS version 20 or later [https://nodejs.org/en/download]
npm i -g @tokenized/signing-agent

(if using a source checkout, use this instead: npm i -g .)

Create a user

Obtain the development Tokenized desktop app and enable the Compact pairing code feature.

Sign up a new user for the signing agent.

Pair the agent

When prompted to Scan the mobile app pairing code, copy the code and run (replacing 123456789 with the code on screen):

tokenized-signing-agent pair secrets.json 123456789 :generate

A 24 word seed phrase will be printed on screen. Store this appropriately, being aware that it cannot be recreated and in the wrong hands could be used to steal funds. In the event of loss of the secrets.json file this seed phrase will be needed to recover the signing agent, otherwise the signing agent will need to be re-created and the workspace migrated to the new control arrangement.

After this point the secrets.json will contain:

  • the Tokenized platform API endpoint
  • client identifier and secret specific to your installation
  • a secret used to authorize the client to contact the API on behalf of your newly created user
  • a secret used to unlock the root key for signing purposes.

Create a workspace to hold funds

Create a new workspace (in the desktop app) and invite the signing agent and another administrator with manual signing access in a 1 of 2 signing arrangement. Accept the invitiation to the signing agent to join that workspace:

tokenized-signing-agent accept secrets.json <workspace-handle>

Test the token send functionality

Acquire tokens in the fund holding workspace, replace instrumentID with the one from the Tokenized desktop app, and replace [email protected] with your workspace handle and [email protected] with the recipient's handle. The amount is in the instrument's minor units (for example cents rather than dollars)

tokenized-signing-agent send secrets.json [email protected] [email protected] instrumentID 20

Run an HTTP server

tokenized-signing-agent serve secrets.json 8080

Note this server is unauthenticated and unencrypted and should only be accessible within a secure environment.

curl -d '{"from": "[email protected]", "to": "[email protected]", "instrument": "instrumentID","amount": 20}' http://localhost:8080/send

Explore the CLI

tokenized-signing-agent help

Use the library

import { API } from "@tokenized/signing-agent";

const api = new API({
  endpoint: "https://url.of.tokenized.platform/",
  clientId: "id-Tokenized-sent-me",
  clientKey: "secret-Tokenized-sent-me",
  keyId: "id-generated-when-I-paired",
  privateJWK: { d: "secret-generated-when-I-paired" },
  deviceId: "id-generated-when-I-paired",
  encryptionSecret: { k: "secret-key-used-to-decrypt-root-key" },
  rootKeyId: "id-of-root-key",
});

await api.send("[email protected]", "[email protected]", "COUMes...Wea", 20);