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

vynos

v0.1.15

Published

Micropayments powered by Ethereum

Downloads

3

Readme

Vynos Build Status

In-browser ethereum micropayments wallet.

Installation

Standalone

To use Vynos one has to plug it into a web page as yet another javascript library.

<script src="https://vynos.tech/vA.B.C/vynos.js"></script>

Here vA.B.C represents the version you use, for example: v.0.0.3. When included, it sets a global vynos object, that serves as an entrypoint to Vynos wallet.

Packaged

Including the script tag downloads the code into your application context, and runs that. One could use NPM package just for that: import vynos from 'vynos' equivalents to the script tag above.

Usage

vynos entrypoint provides the following API:

  • vynos.display(): Promise<void> - display Vynos wallet component,
  • vynos.hide(): Promise<void> - hide Vynos wallet component,
  • vynos.ready(): Promise<Vynos> - get access to the wallet; more on that below.

The latter is an asynchronous method, that returns Promise of a wallet. This prevents a developer from calling the wallet while it is not loaded, or waiting for loading using while loop.

One could call vynos.ready() multiple times. It initialises the wallet once. If loaded, it returns the current instance of the wallet:

import vynos from 'vynos'
import * as Web3 from 'web3'

vynos.ready().then(wallet => {
    let web3 = new Web3(wallet.provider)
    web3.eth.getAccounts((err, accounts) => {
        if (err) {
            throw err
        } else {
            let account = accounts[0]
            console.log(account)
        }
    })
})

Wallet instance provides the following API:

  • wallet.initAccount(): Promise<void> - resolved when the user unlocks her wallet; if it is already unlocked, the promise resolves immediately;
  • wallet.openChannel(receiverAccount: string, channelValue: BigNumber.BigNumber): Promise<PaymentChannel> - open a payment channel,
  • wallet.closeChannel(channelId: string): Promise<void> - close the channel,
  • wallet.buy(receiver: string, amount: number, gateway: string, meta: string, purchaseMeta?: PurchaseMeta, channelValue?: number): Promise<VynosBuyResponse> - send a payment to gateway, open a channel if necessary,
  • wallet.listChannels(): Promise<Array<PaymentChannel>> - list all the open channels,
  • wallet.provider - web3 provider.

Build configuration via environment variables

QR_TAB=true - enable tab with QR-code (QR-encoded mnemonic) in Mnemonic dialog while creating new wallet.

Development

Prerequisites

You are expected to have yarn package manager installed globally on your machine. For installation instructions go ts the official web site.

Install

git clone https://github.com/machinomy/vynos
cd vynos
yarn install

Run

yarn run harness

That command starts a web server to play with Vynos on localhost. Open browser on http://localhost:9000 and click on some buttons. It triggers the building process, so you should wait a little bit staring on the page.

You could change the port via .env file:

FRAME_PORT=9090
HARNESS_PORT=9000
BACKGROUND_PORT=9001

WTF is Harness

It demonstrates Vynos work on localhost. It runs a web page (Vynos client) on localhost:9000, serves Vynos frame (stores private keys a-la MetaMaskara) from localhost:9001. Different ports make the browser think the pages belong to different origins, thus should be secured against each other malicious behaviour.

Copyright Notice

Vynos use icons from icons8