npm.io
4.0.0 • Published 2 weeks ago

@zondax/ledger-filecoin

Licence
Apache-2.0
Version
4.0.0
Deps
2
Size
32 kB
Vulns
0
Weekly
0
Stars
8

@zondax/ledger-filecoin

License npm version

This package provides a basic client library to communicate with the Filecoin App running in a Ledger Nano S+/X, Flex and Stax

We recommend using the npmjs package to receive updates/fixes.

Transports

FilecoinApp accepts any transport that can send an APDU: a legacy Transport from @ledgerhq/hw-transport, or a Device Management Kit session wrapped in DMKTransport from @zondax/ledger-js.

const app = new FilecoinApp(transport)

Breaking change: the transport type parameter

The class is now generic in its transport -- FilecoinApp<T extends LedgerTransport = LedgerTransport> -- so that app.transport keeps the type you constructed it with. T is inferred from the constructor argument, so new FilecoinApp(transport) is unaffected.

Writing the type yourself is not. The bare form falls back to the LedgerTransport default, which describes send and nothing else, so hw-transport members reached through it (close, exchange, on) stop typechecking. Name the transport type to keep them:

-let app: FilecoinApp
+let app: FilecoinApp<Transport>

Development

Available Scripts
# Build the project
pnpm build

# Format code and sort package.json
pnpm format

# Check formatting
pnpm format:check

# Run linter
pnpm lint

# Fix linting issues
pnpm lint:fix

# Run tests (builds first)
pnpm test

# Check for dependency updates
pnpm upgrade

Notes

Use pnpm install to avoid issues.

Keywords