sol4k / sol4k-examples

Ready-to-use Java examples of sol4k APIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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. Creating an Associated Token Account.
  3. Transferring SPL tokens.
  4. Getting Wallet Balance.
  5. Getting SPL Token Balance.
  6. 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

License:Apache License 2.0


Languages

Language:Java 100.0%