ro-tex / sia-links

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

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

License:MIT License


Languages

Language:JavaScript 100.0%