stellar / js-xdr

Read/write XDR encoded data structures (RFC 4506)
Apache License 2.0
25 stars 31 forks source link

Add format argument to fromXDR() #3

Closed bartekn closed 9 years ago

bartekn commented 9 years ago

Additional format argument specifying input format.

// decodes the buffer directly
xdr.TransactionResultPair.fromXDR(aBuffer)

// decode the buffer after first decoding from hex
xdr.TransactionResultPair.fromXDR(aBuffer, 'hex')

// decode the buffer after first decoding from base64
xdr.TransactionResultPair.fromXDR(aBuffer, 'base64')

Close #2 To support https://github.com/stellar/js-stellar-base/issues/32

nullstyle commented 9 years ago

:+1: