Awesome
sui kotlin
Android SDK for Sui
Requirement
- Android API 26
- Kotlin
Dependency
implementation 'com.github.cosmostation:suikotlin:0.3.0'
Initialize
Initialize for security.
SuiClient.initialize(applicationContext)
API
Using api like below.
SuiCLient.instance.{API}
Generate new mnemonic
fun generateMnemonic(): String
Get address from mnemonic
fun getAddress(mnemonic: String): String
Get address from KeyPair
fun getAddress(keyPair: EdDSAKeyPair): String
Get KeyPair from mnemonic
fun getKeyPair(mnemonic: String): EdDSAKeyPair
Sign data bytearray with KeyPair
fun sign(keyPair: EdDSAKeyPair, data: ByteArray): ByteArray
Get objects by address
suspend fun getObjectsByOwner
Get object details from sui objects
suspend fun getObjectDetails
Get transactions
suspend fun getTransactions
Get transaction details from transaction digests
suspend fun getTransactionDetails
Fetch custom request(support sui json-rpc specs.)
suspend fun fetchCustomRequest(requests: JsonRpcRequest): JsonRpcResponse
Fetch custom request list(support sui json-rpc specs.) : Batch not working
suspend fun fetchCustomRequests(requests: List<JsonRpcRequest>): List<JsonRpcResponse>
Faucet
suspend fun faucet
Transfer object
suspend fun transferObject
Move Call
suspend fun moveCall
Transfer sui
suspend fun transferSui
Execute signed transaction
suspend fun executeTransaction