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

@vite/ledgerjs-hw-app-vite

v1.0.0

Published

Ledger Hardware Wallet Vite Application API

Downloads

3

Readme

ledgerjs-hw-app-vite

Library for interacting with the Ledger VITE app from the browser or Node.

Module Import

import Vite from "ledgerjs-hw-app-vite";
const vite = new Vite(transport);

API

getAppConfig

获取固件版本号以及 builtin token 数量。

Parameters

None

Examples

const result = await vite.getAppConfig();

Returns Promise<{version: string, builtinTokenCount: Uint16}>

getBuiltinTokenInfo

获取内置 token info,仅用于测试固件的代码。

Parameters

  • index number 内置 token index,从0开始,最大为 builtinTokenCount-1

Examples

const result = await vite.getBuiltinTokenInfo(0);

Returns Promise<{tokenId: TokenId, decimals: number, symbolAndIndex: string}>

getTestAmountText

测试 amount 展示信息的正确性,仅用于测试固件的代码。

Parameters

  • amount BigInt
  • tokenId TokenId

Examples

const amountText = await vite.getTestAmountText('1234567890123456789', 'tti_5649544520544f4b454e6e40');

Returns Promise<string>

getAddress

获取地址及其公钥。

Parameters

  • accountIndex number 账户序号,从0开始
  • boolDisplay boolean 是否在屏幕上显示地址

Examples

const result = await getAddress(accountIndex, false);
const result = await getAddress(accountIndex, true);

Returns Promise<{publicKey: Base64, address: Address}>

signResponseAccountBlock

sign response account block

Parameters

  • accountIndex number 账户序号,从0开始
  • height Uint64 account block height
  • sendBlockHash Hex send block hash
  • previousHash? Hex previous account block hash
  • nonce? Base64 nonce

Examples

const signResult = await vite.signResponseAccountBlock(0, 1, "1e3004d74382a8635b836eb8a3e34ede7c00a7a1bff0c150974c1235287ad07a", null, "4KVvCafscbA=");

Returns Promise<{blockHash: Hex, signature: Base64}>

signRequestAccountBlock

sign request account block

Parameters

  • accountIndex number 账户序号,从0开始
  • height Uint64 account block height
  • toAddress Address to address
  • amount BigInt amount
  • tokenId TokenId token ID
  • data? Base64? data
  • fee? BigInt fee
  • previousHash? Hex previous account block hash
  • nonce? Base64 nonce

Examples

const signResult = await vite.signRequestAccountBlock(0, 4, 'vite_847e1672c9a775ca0f3c3a2d3bf389ca466e5501cbecdb7107', '1000000000000000000', 'tti_5649544520544f4b454e6e40', null, null, '1e3004d74382a8635b836eb8a3e34ede7c00a7a1bff0c150974c1235287ad07a', null);

Returns Promise<{blockHash: Hex, signature: Base64}>