coming-chat/go-sui-sdk

Invalid type conversion when calling GetObject()

sheldonkreger opened this issue · 3 comments

I am trying to invoke client.GetObject().
suiObjectID, err1 := types.NewHexData("0x29623f7e300d1a90ffb925330d2a596608ca8a45")
resp, err2 := cli.GetObject(ctx, suiObjectID)

Using this syntax, I receive an error:

cannot use suiObjectID (variable of type *types.HexData) as types.HexData value in argument to cli.GetObjectcompilerIncompatibleAssign

In types.go we see:
type ObjectId = HexData

So, I expected this syntax to be valid.

What is the correct way to invoke GetObject()? Thanks in advance.

Are you use this SDK on sui's devnet with the main branch?
Please change to the devnet branch.

go get github.com/coming-chat/go-sui@devnet

Thank you for taking a look. I have switched to the devnet branch, but I receive the same error.

Please use the v2 version and try it again