Closed nfurfaro closed 2 years ago
@luizstacio @digorithm Should I consider this type for the new ABI typegen
?
Initially, I followed only the primitives listed here:
The only mention of B512
is under signature recovery:
B512
is a stdlib type, like Address
, EvmAddress
, Option
& Result
.
It seems that sooner or later, for every type added to std
there will be a request to use that type in the SDK.
Perhaps moving forward, as new types are proposed for std
we can coordinate with the SDK teams to roll out support more in parallel?
Are these stdlib types documented somewhere?
@arboleya some are documented here.
In terms of actual implementation, it differs between the Rust and TS SDKs, in some aspects. For instance, Option
and Result
types are not generated in the Rust SDK because Rust natively has Option
and Result
, so the SDK basically "maps" the Option
/Result
from Sway to Option
/Result
from Rust. The TS SDK does something similar, but with different mappings/strategies (e.g. there's no Result<T>
in Typescript).
Regarding this:
Should I consider this type for the new https://github.com/FuelLabs/fuels-ts/pull/570?
If this is where all the other Sway/std-lib types are handled, yes, B512
should be part of it!
@arboleya some are documented here.
But there's no mention of B512
either. 🤔
I was trying to understand where I could get a list of all std types
for easy referencing.
If this is where all the other Sway/std-lib types are handled, yes,
B512
should be part of it!
Thank you, I'll move the topic to a dedicated issue on the fuels-ts
.
This is implemented in Sway as:
I'm currently working around this by making contract functions accept 2
b256
values and constructing theB512
in sway.