Skip to content

Struct byte values typed as Uint8Array, but are actually number[] #156

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

Open
joe-p opened this issue Apr 11, 2025 · 0 comments
Open

Struct byte values typed as Uint8Array, but are actually number[] #156

joe-p opened this issue Apr 11, 2025 · 0 comments

Comments

@joe-p
Copy link
Contributor

joe-p commented Apr 11, 2025

Subject of the issue

For structs in state, the client generator will generate a type like:

Your environment

Steps to reproduce

  1. Run client generator with struct that has bytes in it

  2. See generated type

export type ClaimedInfo = {
  txnId: Uint8Array
}
  1. Retrieve that value
        const claimedInfo = await appClient.state.box.claimedMap.value({
                    tokenDropId: dropId,
                    address: claimAccounts[i].addr.toString(),
                } as AddressClaimKey)

Expected behaviour

claimedInfo.txnId is Uint8Array

Actual behaviour

claimedInfo.txnId is number[]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant