0

I want to enter a Vec as input But i can't do that i don't know what is wrong !

enter image description here

1 Answer 1

0

Normally you would pass a JS array of strings that represent valid pubkeys, like:

["HXia2kfw8codMQTgDRCqMaDmVpY76aJqwzmGLFsFRfsW", "BMAJg8NEpetxXAihDXMXqxpYcU7Pn6g2rLh9uCfJHsvs"]

And this works fine if you change the type in the instruction from vector to array. So I tend to think that it not accepting the same for Vec<Pubkey> might be a bug in the Solana Playground.

If you're running the local version of the playground, if you modify this line to this.parse(el, innerType as IdlType, idl) it will accept an array of pubkeys as string as you would normally expect.

3
  • but we must use "Vec<publicKey>" due to security reasons! Commented Sep 3, 2023 at 12:14
  • Not suggesting you shouldn't use "Vec<publicKey>". There are a lot of ways you can test the instruction that will work with "Vec<publicKey>"
    – Serban
    Commented Sep 3, 2023 at 12:24
  • yes you are right i am newbie to solana (i was evm developer) i should try an other way thx. Commented Sep 4, 2023 at 7:35

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.