js-algorand-sdk icon indicating copy to clipboard operation
js-algorand-sdk copied to clipboard

[v3] RPC Discovery

Open PhearZero opened this issue 1 year ago • 2 comments

Overview

Let's go V3 🎉!!!

This ticket is for tracking differences found while integrating v3 beta:

  • /block/${round}/hash is no longer camel case when using JSON.stringify: (fixed by using encodeJSON)
  • healthCheck is returning undefined and not an empty Object
  • https://github.com/algorand/js-algorand-sdk/issues/885#issuecomment-2307226167
  • genesis returns a Promise<string> type and does not appear to encode properly with encodeJSON with spacing (see getGenesis)

Renders: Before After

I will update this ticket if I run into any more while integrating.

PhearZero avatar Aug 23 '24 17:08 PhearZero

  • /block/${round}/hash is no longer camel case:

@PhearZero how are you encoding the responses to be displayed on your page? If you use algosdk.encodeJSON (which is what I'd recommend), you should find that the response blockHash field has the same casing as before.

jasonpaulos avatar Aug 23 '24 17:08 jasonpaulos

how are you encoding the responses to be displayed on your page?

@jasonpaulos I was using only JSON.stringify previously. Now I've added a custom replacer that only looks for bigint types. I'll definitely switch over to encodeJSON

PhearZero avatar Aug 23 '24 18:08 PhearZero