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

@emurgo/ledger-connect-handler

v7.0.1

Published

Interface for communication with Cardano Ledger app

Downloads

22

Readme

yoroi-extension-ledger-connect-handler

This library enables Yoroi extension to communicate with Ledger device, in process this library needs one web page that directly communicates with Ledger device. This library is responsible for opening, sendind resquest, passing back response to Yoroi and closing the target web page.

Message Passing

ledger-content-script

Flow:

  1. Yoroi requests yoroi-extension-ledger-connect-handler(Using function call).
  2. yoroi-extension-ledger-connect-handler opens target Website.
  3. yoroi-extension-ledger-connect-handler sends request message to content-script(Using extension port).
  4. content-script passes request to the target Website app(Using postMessage()).
  5. Target Website app processes the request and send response to content-script(Using postMessage()).
  6. content-script passes response to yoroi-extension-ledger-connect-handler(Using extension port).
  7. Finally, yoroi-extension-ledger-connect-handler passes response to Yoroi(Using function return).

Supported Functions

getExtendedPublicKey

Inputs

{
  serial: ?string,
  params: {
    path: BIP32Path
  },
}

Outputs

{
  deriveSerial: {
    serial: string
  },
  deviceVersion: {
    flags: Flags,
    major: string,
    minor: string,
    patch: string
  },
  response: GetExtendedPublicKeysResponse<GetExtendedPublicKeyResponse>
}

getExtendedPublicKeys

Inputs

{
  serial: ?string,
  params: {
    paths: Array<BIP32Path>
  },
}

Outputs

{
  deriveSerial: {
    serial: string
  },
  deviceVersion: {
    flags: Flags,
    major: string,
    minor: string,
    patch: string
  },
  response: GetExtendedPublicKeysResponse<GetExtendedPublicKeysResponse>
}

signTransaction

Inputs

{
  serial: ?string,
  params: Transaction,
}

Outputs

SignTransactionResponse

showAddress

Inputs

{|
  serial: ?string,
  params: {
    ...ShowAddressRequest,
    expectedAddr: string,
  },
|}

Outputs

undefined

deriveAddress

Inputs

{
  serial: ?string,
  params: DeriveAddressRequest,
}

Outputs

DeriveAddressResponse

getVersion

Inputs

{
  serial: ?string,
  params: undefined,
}

Outputs

GetVersionResponse

getSerial

Inputs

{
  serial: ?string,
  params: undefined,
}

Outputs

GetSerialResponse

Example

Import

import LedgerConnect from 'yoroi-extension-ledger-connect-handler';

Create new instance


const ledgerConnect = new LedgerConnect(config);

config is type of: Config

Calling function

const deviceVersionResp = await ledgerConnect.getVersion();

Supported Ledger Transport

Building up

  • nvm i
  • yarn
  • yarn run build

Publishing

Make sure you have followed Building up steps before publishing.

  • npm publish