0

I would like to ask for the help.

I'm just starting with the Solana contract interacting (I have experiences with EVM) and I'm now struggling with how to call custom foreign programs. Is there any way how to obtain existing programs methods/types in a similar way like in EVM and ABI?

For example, when I would like to transfer token directly with web3.TransactionInstruction() instead of splToken.Token.createTransferInstruction(), is there any way how to get params/types directly from the program on blockchain without having external documentation?

I would like to automatize some contracts but I don't have docs for them.

I tried connection.getTransaction() to get existing transactions but there are no types and BufferLayout information. I also tried all SolScanners etc but also I didn't find any info about param names and types.

Is there any way how to do that in Solana? Thanks

Ludek Vodicka
  • 1,610
  • 1
  • 18
  • 33
  • There is currently no way to get the possible instructions and expected instruction data from an onchain program. You'll need the source code. – Frank C. Feb 05 '22 at 21:09
  • Hello Frank, thanks a lot for your comment. I already discussed it also on Solana forums and you're unfortunately right. The only chance is to analyze existing transactions and try to replicate them. – Ludek Vodicka Feb 06 '22 at 16:27
  • Yeah, I think I may have been part of the discussion if you are talking about Discord – Frank C. Feb 06 '22 at 21:00
  • I think I didn't discuss it on discor ;-). Only here: https://forums.solana.com/t/get-program-parameters-types-for-existing-program/5010/3. Can you please send me a link to DC about Solana development? – Ludek Vodicka Feb 06 '22 at 21:53
  • https://discord.gg/solana – Frank C. Feb 07 '22 at 08:59

0 Answers0