Does there exist an inbuilt toString() method or something similar for Algorand Secret Keys? generateAccount() returns an object with property sk which is a UInt8Array - do I need to write the conversion code as part of my project?
Are typescript type definitions present for algosdk?
I see there isn’t, but is there the possibility of adding a getBlock(...) function which accepts blockHash as the parameter and returns block info? Currently it only takes a round parameter
I’m curious regarding your third question. Could you please tell us more why you’d like to retrieve a block by it’s hash ? In Algorand, we generally try to use the round number as the primary key for the block. I’m wondering where the need for a block hash came from.
My use case specifically is because I’m implementing the Sidetree protocol on Algorand, which requires a non-predictable unique which is tied to a single block. Canonically, this would be the block hash. There’s also other use cases like being able to search with block hash on AlgoExplorer for example.
What about a transaction instead of a block ? Can you create a transaction instead ( where you could also store some arbitrary data in the notes field ) ?
With the indexer enabled, transactions are searchable across the entire blockchain, and you could always find which block contains that particular transaction.
I believe the solution you suggested would also probably work, but I am not running indexer nodes right now. Maybe I will come back to this later and switch it out.