Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including polynym with all npm packages installed. Try it out:

var polynym = require("polynym")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

polynym v1.0.7

A simple solution to resolve BSV addresses from popular wallets and services

polynym

A simple library and API that accepts any HandCash $handle, RelayX 1handle or PayMail address and resolves it to a Bitcoin SV P2PKH address, as well as accepting and returning valid P2PKH addresses. You can also use it as a lookup service on polynym.io or consume it as a free API over at https://api.polynym.io/getAddress/<address or handle> in any of your projects.

usage

To get started, run npm install polynym in your root directory. Here's an simple example implementation in Node.js:

const express = require('express'),
app = express(),
polynym = require('polynym');

app.get('/getAddress/:id', (req, res) => {
    polynym.resolveAddress(req.params.id).then(x => {
        res.json(x);
    }).catch(e=>{
        res.status(400).json(e);
    });
});

app.listen(1337);

or using the await/async syntax:

const express = require('express'),
app = express(),
polynym = require('polynym');

app.get('/getAddress/:id', async (req, res) => {
    try {
      x = await polynym.resolveAddress(req.params.id);
      res.json(x);
    } catch(e){
      res.status(400).json(e);
    }
});

app.listen(1337);

In the above example, a GET request to http://localhost:1337/getAddress/$unwriter would return the Bicoin SV address of unwriter's HandCash $handle: {"address":"15EwahT55Yn566A7tagq5Mbyhs8txjZpus"}

support

To request support for any additional services, please leave a feature request. For all other questions or support, please message me @deanmlittle or find me in the Atlantis slack group.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free