New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

anchor-link

Package Overview
Dependencies
Maintainers
2
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anchor-link

Library for authenticating and signing transactions using the Anchor Link protocol

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
857
decreased by-18.46%
Maintainers
2
Weekly downloads
 
Created
Source

Persistent, fast and secure signature provider for EOSIO chains built on top of EOSIO Signing Requests (EEP-7)

Key features:

  • End to end encryption
  • Cross device signing
  • Persistent sessions
  • Open standard

Take it for a spin: Anchor Link Demo

Resources:

Protocol

The Anchor Link protocol uses EEP-7 identity requests to establish a channel to compatible wallets using an untrusted HTTP POST to WebSocket forwarder (see buoy node.js and buoy golang).

A session key and unique channel URL is generated by the client which is attached to the identity request and sent to the wallet (see transports). The wallet signs the identity proof and sends it back along with its own channel URL and session key. Subsequent signature requests can now be encrypted to a shared secret derived from the two keys and pushed directly to the wallet channel.

📘 Full Protocol specification

Installation

The anchor-link package is distributed both as a module on npm and a standalone bundle on unpkg.

Install Anchor Link and a transport:

yarn add anchor-link anchor-link-browser-transport
# or
npm install --save anchor-link anchor-link-browser-transport

Import them into your project:

import AnchorLink from 'anchor-link'
import AnchorLinkBrowserTransport from 'anchor-link-browser-transport'

Jump to basic usage.

Browser using a pre-built bundle

Include the scripts in your <head> tag.

<script src="https://unpkg.com/anchor-link"></script>
<script src="https://unpkg.com/anchor-link-browser-transport"></script>

AnchorLink and AnchorLinkBrowserTransport are now available in the global scope of your document.

Using node.js

Using node.js or bundler (e.g. webpack) recommended

yarn add anchor-link

Transports

Transports in Anchor Link are responsible for getting signature requests to the users wallet when establishing a session or when using anchor link without logging in.

Available transports:

PackageDescription
anchor-link-browser-transportBrowser overlay that generates QR codes or triggers local URI handler if available
anchor-link-console-transportTransport that prints ASCII QR codes and esr:// links to the JavaScript console

See the LinkTransport documentation for details on how to implement custom transports.

Installation

Take it for a spin

Download Anchor

Persistent signing sessions for [Anchor]*

Persistent Session library for ESR

EOSIO

Example usage:

import {Link} from 'anchor-link'

const link = new Link({
    chainId: 'e70aaab8997e1dfce58fbfac80cbbb8fecec7b99cf982a9444273cbc64c41473',
    rpc: 'https://jungle.greymass.com',
    service: 'https://link.dirty.fish',
})

link.transact({
    broadcast: true,
    action: {
        account: 'eosio.token',
        name: 'transfer',
        authorization: [
            {
                actor: '............1',
                permission: '............1',
            },
        ],
        data: {
            from: '............1',
            to: 'teamgreymass',
            quantity: '0.0001 EOS',
            memo: 'nani',
        },
    },
})
    .then((result) => {
        console.log('success', result)
    })
    .catch((error) => {
        console.log('error', error)
    })

FAQs

Package last updated on 09 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc