Skip to content
Discussion options

You must be logged in to vote

Two Problems Identified

1. key_type

For key_type in getTableItem, you'll need to provide the full struct reference, as defined by MoveType.

A reminder, String is a struct, not a primitive type (e.g. integers and others).

2. value_type

value_type is also misrepresented, since your table contains a vector of Asset, and not just a single Asset.

Solutions

1. key_type

In your example, it would require changes from:

key_type: 'string'

to:

key_type: '0x1::string::String'

I derived this struct reference from the Move reference documentation on Move-stdlib's string.

2. value_type

You'll need to include the vector as part of the string, resulting in changes from:

value_type: '0x508c3346b5cf6e78a2…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Alexzander-Stone
Comment options

Alexzander-Stone Apr 29, 2024
Collaborator Author

@deepkushagra
Comment options

@Alexzander-Stone
Comment options

Alexzander-Stone May 1, 2024
Collaborator Author

@deepkushagra
Comment options

@Alexzander-Stone
Comment options

Alexzander-Stone May 1, 2024
Collaborator Author

Answer selected by Alexzander-Stone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ts-sdk Questions related to the TypeScript SDK
2 participants