Solana program interaction for create new campaign #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the following changes to enable interaction with the Solana program within the Strapi project:
Added Solana IDL File:
The IDL file for the Solana program has been added at ./src/api/project/solana/idl.json.
The IDL is required to interact with the Solana program using @coral-xyz/anchor.
Updated Project Service:
The project.ts service has been extended with a new method interactWithSolanaProgram.
This method uses the IDL to send instructions to the Solana program and handle transactions.
The method returns the transaction ID on successful interaction with the Solana blockchain.
Strapi Integration:
This updated service can be called from a Strapi controller, allowing the frontend to interact with the Solana program
through Strapi’s API.
Changes Made
Added: ./src/api/project/solana/idl.json (Solana Program IDL).
Updated: ./src/api/project/services/project.ts to handle Solana program interaction via the IDL.
How to Test
Ensure that you have a valid Solana wallet connected (or simulate one with a local wallet).
Use Strapi’s API to send a request with the user’s wallet and the appropriate instruction data for the Solana program.
Verify that a valid transaction ID is returned upon successful execution of the interaction with the Solana program.
Checklist