Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solana program interaction for create new campaign #48

Merged

Conversation

reyraa
Copy link
Member

@reyraa reyraa commented Oct 8, 2024

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

  • Added IDL file for the Solana program.
  • Implemented service method for Solana interaction.
  • Tested interaction and transaction flow on Devnet/Mainnet.

@reyraa reyraa linked an issue Oct 8, 2024 that may be closed by this pull request
5 tasks
@reyraa reyraa assigned reyraa, curvesy and haghighatcs and unassigned reyraa and curvesy Oct 8, 2024
@reyraa reyraa requested a review from curvesy October 8, 2024 13:59
@haghighatcs
Copy link
Contributor

LGTM

@reyraa reyraa merged commit d34ba7a into development Oct 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Solana Program Interaction for "Create New Campaign
3 participants