Repository navigation
Conversation
…ers with arbitrary performance
|
This looks awesome. Thanks. My thinking is that this js-xdr library should only really deal with stuff core to the xdr protocol, whereas stellar's usage of xdr would be in the js-stellar-base repo. Since U256/I256/etc are a stellar-specific concept (soroban-specific really) that doesn't exist in the core xdr protocol, I'd say this code should live over there. I'm happy to take this code and port it to that library, or you're welcome to and I'll approve the PR over there. Whichever you prefer, @orbitlens . |
|
@paulbellamy My motivation to implement these new types in the
|
I do like that as well.
I'd be in favor your suggestion to leave the bigint-encoder here and importing it in js-stellar-base. I like your Hyper/UnsignedHyper refactor, and agree the code re-use would be great.
It's not about whether core uses these or not. This library tries to stick to only the xdr spec, and i128/256 are not in the xdr spec. Stellar-specific stuff belongs in js-stellar-base.
I agree about the webpack/tree-shaking/bundle-size aspect. It is more about code organization into our existing framework.
I'm personally not a huge fan of the split between js-xdr and js-stellar-base, but it is what we have right now, so we should try to stick to it. |
|
@paulbellamy As soon as In fact, exporting abstract |
|
Sounds like a good plan to me. |
|
Agreed with the discussion here: Another component of this work, unfortunately, is going to be modifying the relevant parts of stellar/dts-xdr to generate types that match the new method signatures for |
|
Closing as this was incorporated into #100 |
Added basic XDR types
i128,u128,i256,u256for operations with 128/256-bit integers. They can be used as basic types forScValwrappers.Examples of encoding, slicing to parts, and casting to js
BigInt:source/bigint-encoder.jscontains helpers for operations with BigInts of arbitrary precision (I tested even with 512/1024 integers), more examples intest/unit/bigint-encoder_test.jstest casestest/unit/i256_test.jsTODO: test coverage for u128, i128, u256