3

Just realised the power of the cardano-serialization-lib-nodejs as it has all the functionality of cardano-cli, wallet etc. Even has some plutus based functions.

But as for any good things the bad side is the detailed documentation of all the hundreds of functions present in this library. Can anyone suggest how someone new to this library can get started with basic stuff like creating transaction, minting NFT etc. Just common stuff we achieve using cardano-cli now a days ?ca

3 Answers 3

3

The documentation is very limiting, but if you're confident with JavaScript or TypeScript then there are a few very good resources out there. I've personally learnt by just reading the Nami wallet source code. There are good examples on how to build transactions, and sign transactions. The API flow document is basically my bible these days too, there are some good comments and the type descriptions make it pretty easy to understand.

Another decent example can be found here for building transactions using the Nami API, but the same applies for if you're using your own created keys or the keys created by Nami wallet itself. When it comes to minting assets though it's not as straight forward, since minting with the cardano-serialization-lib isn't available in stable yet, you need a 10.0 beta version to use it. We're in the process of open-sourcing our SDK wrapper around CSL that makes wallet creation, minting tokens, and sending payments much easier but it's still being tested. Hopefully will be released in the next week or two!

1
  • thanks Thomas. Will dive into the resources you have pointed out.
    – LKBH Pools
    Commented Nov 18, 2021 at 17:11
1

There is some (a bit outdated) examples here as part of the repo, but It may help you to get started.

1

I had the same question and so written a demo with the cardano-serialization-lib here: https://github.com/dynamicstrategies/cardano-wallet-connector

The lib is very powerful and at this point it has replaced me he off chain plutus that i might have needed to write and replaced with reacJS + this lib

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.