Android / Kotlin
Get Started or Add to an Existing Project
Getting started with Kinetic is incredibly straightforward. Just follow the steps below to start transacting with a token in your app.
Installation
In your root build.gradle or settings.gradle, make sure you’ve included jitpack:
And add the dependency, normally in the module-level build.gradle:
Instantiate the Kinetic Client
The Kinetic Client will give you access to all the methods you need to work with Kinetic on the blockchain.
We recommend starting with Devnet before moving on to Mainnet.
The Kinetic SDK uses Kotlin suspend functions to perform asynchronous network calls. We recommend calling these from within a CoroutineScope as follows where necessary. As there are many ways to handle asynchronous code in Kotlin, we will not include the CoroutineScope in every piece of sample code, but it may be necessary in your implementation.
Don’t have an App Index? Join our Discord and we’ll get you started.
While you’re waiting for confirmation of your App Index, use 1
on devnet so you can get started.
Create Account
You can create accounts randomly or from existing mnemonics or secret keys. Below, we’ll make a keypair and use that for creating an account on the blockchain.
Close Account
It’s good practice to close unneeded accounts. You can only close accounts that you have created and are currently empty.
Check Balance
Check a user balance by passing in the public key of the account you want to check.
The response object includes your total balance as well as detailing all of the Mints and Tokens held by that Public Key.
Airdrop Funds (devnet)
Send some test funds to a specific Public Key on Devnet.
Transfer a Token
Transfer a token from a Keypair to any Public Key.
Kinetic will transfer the kin token by default unless specified otherwise. To send a different token make sure to include the mint parameter like below
Get Transaction Details
Get the details of any transaction by passing in the transaction signature.
Get Solana Explorer URL
Get Account History
Get the full transaction history of any account by passing in the account’s Public Key.
Get Account Info
Easily get the main info of any account by passing in the account’s Public Key.
Get Token Accounts
Get the full list of Token Accounts held by a Keypair on Solana.
Demos and Starter Kits
Created to help get you up and running as quickly as possible, these projects can be a great reference point when you get stuck or even a starter for your own project. Happy coding!