0.1.1 • Published 4 years ago

sia-links v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

SiaLinks

SiaLinks translates Sia links (sia://hash) to standard http links (https://siasky.net/hash).

It comes preloaded with some Skynet portals but you can add your own or remove a portal you don't like.

Installation

npm i sia-links

Usage

Translate a Sia link to a normal http link (we call these Skylinks):

import {translateSiaLink} from "sia-links"

const httpLink = translateSiaLink('sia://AAAEYkkFXaH7YyMDLfw0lEMKm_NDAmvpoq7NurZeQ22Yrg')
if (httpLink !== null) {
  // Use the link however you want!
}

Add/remove portals to/from the list of portals SiaLink uses to generate the Skylinks:

import {addPortal, removePortal} from "sia-links"

let success = addPortal('skynet.portal.xyz')
success = removePortal('slow.portal.bad')

Too simple? Yup, this is a very simple package.

0.1.1

4 years ago

0.1.0

4 years ago