lgh001 / solana-web3.kotlin-bugfix

Solana SDK in Kotlin

Home Page:https://docs.blocto.app/blocto-sdk/android-sdk/solana

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SolanaWeb3

Maven Central CircleCI GitHub

This is a open source library on kotlin for Solana protocol.

SolanaWeb3 that is currently under development, alpha builds are available in the Sonatype staging repository.

How to

repositories {
    mavenCentral()
    
    // If you need to get SolanaWeb3 versions that are not uploaded to Maven Central.
    maven { url "https://s01.oss.sonatype.org/content/repositories/staging/" }
}

dependencies {
    implementation 'com.portto.solana:web3:0.1.3'
}

Example

val api = Connection(Cluster.DEVNET)

val account = KeyPair.fromSecretKey(walletPrivateKey.decodeBase58())
val instructions = SystemProgram.transfer(
    fromPublicKey = PublicKey("58ewYwS4XiZo5VuspKDdYkgi82n9carELJ63oGb7AZUq"),
    toPublicKey = PublicKey("ENkttsgNeYUJ1HFVHs77c4tqMqyWE3WeHMMkiZ1hkr7x"),
    lamports = 10000
)

val transaction = Transaction().add(instructions)
val txSignature = api.sendTransaction(
    transaction = transaction,
    signers = listOf(account)
)

println(txSignature)

Developed By

Kihon, kihon@portto.com

License

MIT. Original by Arturo Jamaica, forked and maintained by portto.

About

Solana SDK in Kotlin

https://docs.blocto.app/blocto-sdk/android-sdk/solana

License:MIT License


Languages

Language:Kotlin 63.5%Language:Java 36.5%