Skip to content

Ready-to-use Java examples of sol4k APIs

License

Notifications You must be signed in to change notification settings

sol4k/sol4k-examples

Repository files navigation

sol4k demo Build

You can find ready-to-use Java examples of sol4k APIs. Each class in this repository is a complete example that you can load and run without any additional setup.

Content

  1. Sending a SOL transfer transaction.
  2. Sending a SOL transfer transaction (Legacy Transaction).
  3. Sending a transaction with multiple instructions.
  4. Creating an Associated Token Account.
  5. Transferring SPL tokens.
  6. Getting Wallet Balance.
  7. Getting SPL Token Balance.
  8. Request Airdrop.

How to import sol4k

Check the main Sol4k repository to find information on how to add Sol4k to your existing codebase.

Funding Test Accounts

To ensure that the examples are readily usable, they include the private key of the test account. However, it is important to note that committing your private keys to version control is never recommended for real projects, and is only done here for convenience purposes.

As anyone has access to the private key of the test account, which is 2mjCPF5ABp6CVAYHd5azz5A8cKQUqqvuiT5NJ4wpAjCc, it may run out of funds. If you encounter issues with some of the examples, please ensure that this account has sufficient funds, either in SOL or USDC. You can use this code snippet to send Devnet SOL, while for USDC, you can utilize this faucet.

About

Ready-to-use Java examples of sol4k APIs

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Languages