ThalaLabs / surf

Type-Safe TypeScript Interfaces & React Hooks for Aptos.
MIT License
30 stars 6 forks source link

Getting unknown for Object and Option type #155

Open 0xaptosj opened 2 weeks ago

0xaptosj commented 2 weeks ago

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
0xbe1 commented 2 weeks ago

@0xaptosj can you elaborate?

0xaptosj commented 2 weeks ago

@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

0xaptosj commented 1 week ago

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

SamuelQZQ commented 1 week ago

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