Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

cardano-sdk

0.1.1 • Public • Published

Cardano JS SDK

JavaScript SDK for interacting with Cardano, providing various key management options including support for popular hardware wallets. The library supports multiple Cardano APIs by establishing a Provider interface. This is beneficial for both development workflow and production scenarios, as application logic does not become coupled to any one implementation.

There are two provider types, and it is important to understand the difference when using the SDK. We have defined the CardanoProvider and WalletProvider.

To satisfy the CardanoProvider interface, the provider must be able to supply a complete, queryable interface into the chain state. Any address should be queryable for both historic transactions and current UTXOs. When interfacing with a CardanoProvider, we use the ClientWallet implementation to satisfy wallet behaviour.

A WalletProvider satisfies a smaller interface than CardanoProvider. The WalletProvider maintains historic chain state only for address sets derived from known parent public keys, which are stored server side. When interfacing with a WalletProvider, we use the RemoteWallet implementation to satisfy wallet behaviour, which is in most cases a simple mapping directly to the WalletProvider.

Project State: Alpha

This SDK is a work in progress and should not be used in production. The initial provider and Cardano primitive implementations are in the base package at this stage, but the intention is to publish separate packages to allow for composition into a clean and minimal bundle.

Feature progress

  • Build a transaction and estimate fees
  • Transaction input selection
  • Transaction signing
    • memory
    • Ledger Nano S
    • Trezor
  • Message signing and verification
    • memory
    • Ledger Nano S
    • Trezor
  • Cardano Providers
  • Staking and Delegation

Examples

The below examples are implemented as integration tests, they should be very easy to understand.

Tests

Run the test suite with npm test.

Ledger Nano S Specs

To run the ledger specs:

  • Have a Ledger device connect, unlocked and in the Cardano app
  • Run LEDGER_SPECS=true npm test

You will need to interact with the device during the test run.

Keywords

Install

npm i cardano-sdk

DownloadsWeekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

331 kB

Total Files

201

Last publish

Collaborators

  • avatar