ThalaLabs/surf

Getting unknown for Object and Option type

0xaptosj opened this issue · 5 comments

For Object type

get_messages returns a vector of objects with type being my_module_address::Message, however the type inferred by surf is unknown[], I was expecting it to return {inner: string}[].

Node script using surf.

Contract code

Screenshot 2024-07-05 at 11 10 44 AM

For Option type

get_message_content returns all fields of the message, where it has a bunch of fields with Option type. Surf also returns unknown for those Option types.

Node script using surf

Contract code

Screenshot 2024-07-05 at 11 14 57 AM

@0xaptosj can you elaborate?

@0xaptosj can you elaborate?

Yes, I will add more detail this week, i'm working a in depth tutorial on surf now and will have an update soon

@0xbe1 @SamuelQZQ i updated the issue description. thanks for taking a look!

@0xaptosj thank you for the information. I will try to fix it.

@0xaptosj should be fixed in @thalalabs/surf@1.7.2