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

first setup for api project to use web3 solana program #42

Conversation

haghighatcs
Copy link
Contributor

@haghighatcs haghighatcs commented Sep 21, 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.

@haghighatcs haghighatcs linked an issue Sep 21, 2024 that may be closed by this pull request
5 tasks
@curvesy curvesy added the enhancement New feature or request label Sep 21, 2024
@reyraa reyraa closed this Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Solana Program Interaction for "Create New Campaign
3 participants