solana-program / token

The SPL Token program and its clients
Apache License 2.0
2 stars 0 forks source link

CreateIdempotent does not contain opcode 1. #2

Closed lithdew closed 5 months ago

lithdew commented 5 months ago

getCreateAssociatedTokenIdempotentInstruction does not specify any data. The data it should specify is Uint8Array.of(1).

lorisleiva commented 5 months ago

Hi Kenta, I'm a bit confused. Aside from the instruction discriminator (which is taken into account in the generated code), the CreateIdempotent instruction of the Associated Token program doesn't seem to accept any additional data.

lithdew commented 5 months ago

Right - the instruction discriminator (1) in this case I believe does not get included into the instruction data. The instruction data for CreateIdempotent is undefined.

https://github.com/solana-program/token/blob/f4769061222e28387e0c7d42663fb85bb65b3b2b/clients/js/src/generated/instructions/createAssociatedTokenIdempotent.ts#L247

lorisleiva commented 5 months ago

Oh I see! Well spotted, I'll fix that today. 🫡

lorisleiva commented 5 months ago

This should be fixed in version 0.1.4. 🙏