cardano-sdk
v0.1.1
Published
An SDK for interacting with the Cardano blockchain
Downloads
4
Readme
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
- [x] Build a transaction and estimate fees
- [x] Transaction input selection
- [ ] Transaction signing
- [x] memory
- [x] Ledger Nano S
- [ ] Trezor
- [ ] Message signing and verification
- [x] memory
- [ ] Ledger Nano S
- [ ] Trezor
- [ ] Cardano Providers
- [ ] cardano-wallet
- [ ] Yoroi/Soshen
- [ ] Staking and Delegation
Examples
The below examples are implemented as integration tests, they should be very easy to understand.
- Generate a keypair in memory from a BIP39 mnemonic
- Message signatures
- Get the wallet balance for a BIP44 Account
- Determine the next change and receipt addresses for a BIP44 Account
- Transaction input selection
- Interact with a remote wallet
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.