Is there a reference for supported anchor IDL types, just like we have for the space reference. Trying to use a slice [usize; 32] but getting the error

IdlError: Type not found: {"type":{"defined":"usize"}}

To add to this, how can I pass in "bytes" from the anchor client side. The parameter is defined like this on my anchor program

fn dummy(bytes: Vec<u8>) -> Result<()> {}

1 Answer 1


Try using a u8 slice instead of usize, the latter has a variable size depending the system. All primitives are supported, and your own structs made of primitives, and a few other types like Pubkey, the rest is a hard maybe.

On the TS client side, you can pass a number[] or a Buffer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.