CardanoSharp / cardanosharp-wallet

CardanoSharp.Wallet is a Cardano Cryptographic and Serialization library for .NET applications.
MIT License
102 stars 40 forks source link

I think there's an issue in the CalculateFee section in the readme #42

Closed danbigthink closed 2 years ago

danbigthink commented 2 years ago

The example shows:

// Calculate Fee var fee = transaction.CalculateFee(minFeeA, minFeeB);

// Update Fee and Rebuild transactionBody.SetFee(fee); Transaction transaction = transactionBuilder.Build();

Note that transaction is created only after the var fee = transaction.... is called? This wouldn't even compile!

It would be helpful to add an example that shows what you do with the transaction after it's built, personally I had to struggle to figure out that I can take the signed transactions cbor string hex and use that!

Great project everyone, just needs a bit more documentation showing an entire flow from start to finish. I'd suggest something that shows how to create/restore a wallet, see balances of assets/ada, tx history, submit of actual transaction.

nothingalike commented 2 years ago

@danbigthink thank you for pointing that out. I have updated the ReadMe

as for complete examples, that is definitely a little harder. CardanoSharp provides Offline functionality which is only half the battle. You need an Online resource for information like getting balances, tx history, and submitting tx. this library does not do that. You can leverage https://github.com/blockfrost/blockfrost-dotnet for getting that online access. If you go this route, you can take a look at the Xamarin demo i showed on Catalyst. https://github.com/CardanoSharp/cardanosharp-catalyst-demo

danbigthink commented 2 years ago

Thanks for the quick response @nothingalike and the link. I appreciate it! I run my own infrastructure and don't use blockfrost as I feel a few features are missing that I require (pubsub events on addresses, direct access to dbsync postgres and such).

nothingalike commented 2 years ago

oh ok perfect, you can try these. tread lightly, I would recommend forking these (or one) and update as needed

https://github.com/CardanoSharp/cardanosharp-dbsync-dapper https://github.com/CardanoSharp/cardanosharp-dbsync-efcore