-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request][Go SDK]Create struct tag from string #76
Labels
enhancement
New feature or request
Comments
Yep, it exists in TypeScript and Python, needs to be migrated over |
gregnazario
added a commit
that referenced
this issue
Mar 13, 2025
Similar to the TypeScript SDK, this ports over the logic that handles all of the different types into structured types. Resolves #76
gregnazario
added a commit
that referenced
this issue
Mar 13, 2025
Similar to the TypeScript SDK, this ports over the logic that handles all of the different types into structured types. Resolves #76
gregnazario
added a commit
that referenced
this issue
Mar 17, 2025
Similar to the TypeScript SDK, this ports over the logic that handles all of the different types into structured types. Resolves #76
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🚀 Feature Request Description
Add support for creating a struct tag from a string
Motivation
There are a few helper functions to create a few basic struct tag, such as
NewStringTag
,NewOptionTag
, andNewObjectTag
I would like to have a new function, that can parse a string:
NewStructTagFromString
that can parse (recursively) and build a struct tag
the motivation is to be able to easily build transfer transactions from the name of a coin
e.g. here is a snippet, of how I implemented a basic function to do so:
but this function will fail to build a proper struct tag in a recursive case, e.g. for LP coins like:
0x31a6675cbe84365bf2b0cbce617ece6c47023ef70826533bde5203d32171dc3c::swap::LPToken<0x1::aptos_coin::AptosCoin, 0xf22bede237a07e121b56d91a491eb7bcdfd1f5907926a9e58338f964a01b17fa::asset::USDC>
This function, does exist in the python SDK: https://github.com/aptos-labs/aptos-python-sdk/blob/e5e1ecb0a6bea419a24098f17582798cdfc7be56/aptos_sdk/type_tag.py#L311
and it is parsing the string and building the struct recursively from the string
The text was updated successfully, but these errors were encountered: