Closed saboonikhil closed 2 years ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
docs | ✅ Ready (Inspect) | Visit Preview | Aug 4, 2022 at 6:46PM (UTC) |
Although it would technically work to use
10
as swap fee, this doesn't seem like a realistic value. It should probably be1_000_000_000
or100_000_000
.Other than that, two general comments:
- The indentation is inconsisent throughout the SDK documentation. Sometimes it's two spaces per indent, sometimes four.
- I think these examples would be easier to read if all numbers used a thousands separator, i.e.
10_000_000_000
instead of10000000000
.Also, would it be possible to define a
BASE
object in the SDK that people can use? It seems very timesome and frankly very error-prone to keep using explicit numbers.
I don't think the typescript data type string
allows much.
We can work on the BASE
object post discussion with the frontend team.
Struct: failed on swap_fee: Compact<u128>:: Invalid character
10,000,000,000
is used, the error looks like : Struct: failed on swap_fee: Compact<u128>:: String should not contain decimal points or scientific notation
10
is used as swapFee
, the pool is created with following properties:
Nevertheless, I would not use 10
as swap fee (for instructive purposes). Regarding the thousands separators, why are you guys using strings to communicate with polkadot-js?
Nevertheless, I would not use
10
as swap fee (for instructive purposes). Regarding the thousands separators, why are you guys using strings to communicate with polkadot-js?
What value would you recommend as an example for swapFee
?
String? Just to keep it consistent with the polkadot-js apps. They don't support thousands separators. Probably, another reason why it could potentially add to the confusion when combining using the SDK with just the usual polkadot-js api, as you'll end up with 2 different units there.
I would expect numbers to be numbers and not strings, and so on. I would find it quite bothersome if I had to convert numbers to strings everytime I do an SDK call. Did I get this right, this is a restriction imposed by polkadot-js?
I would use 1000000000
for swap fee (that's 10%) or 100000000
(1%).
Thank you very much!