8

My goal is to send a transaction (e.g. send 1 ADA from addr1A to addr1B) using the following endpoint of the blockfrost.io API:

"Submit an already serialized transaction to the network."

https://docs.blockfrost.io/#tag/Cardano-Transactions/paths/~1tx~1submit/post

It requires a serialized transaction. How can I create a serialized transaction without a local full node? (With a full node this could be done using the cardano-cli).

The emurgo/message-signing library seems to provide this functionality but I'm not sure how to use it. The example they provide just signs some random string.

Are there any other libraries that can be used for this?

The library would need to be able to

  1. Create a transaction (with metadata)
  2. Calculate the fees
  3. Sign/serialize the transaction

2 Answers 2

3

To add to @eddex's answer, another option would be to use the Emurgo's cardano-serialization-lib. There are not many examples available in their documentation, unfortunately.

Link: https://github.com/Emurgo/cardano-serialization-lib

For a guideline on how to use the library specifically for creating transactions, I found a good example in the blockfrost-js repository. The usage of cardano-serialization-lib can be found in one of the helper files.

Link: https://github.com/blockfrost/blockfrost-js/blob/fb9a55fee07927f8d7c8b0a5aa9efd2d3daf6c77/examples/simple-transaction/src/index.ts

2

There is the cardanosharp-wallet library that provides this functionality. They have a section in their README.md that explains signing transactions.

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.