Skip to content

XDR to JS Numbers and String Conversion

Piyal Basu edited this page Jun 22, 2023 · 3 revisions

Parsing an XDR to display the results as Javascript. For ex: calling simulateTransaction to get a [token balance] (https://github.com/stellar/soroban-react-payment/blob/main/src/helpers/soroban.ts#L318):

Converting an i128 from an XDR to String: helper method

Convert an u32 from an XDR to Number: helper method

Convert Bytes from an XDR to String: helper method

Clone this wiki locally