Android SDK for Sui
- Android API 26
- Kotlin
implementation 'com.github.cosmostation:suikotlin:0.0.2'
Initialize for security.
SuiClient.initialize(applicationContext)
Using api like below.
SuiCLient.instance.{API}
fun generateMnemonic(): String
fun getAddress(mnemonic: String): String
fun getAddress(keyPair: EdDSAKeyPair): String
fun getKeyPair(mnemonic: String): EdDSAKeyPair
fun sign(keyPair: EdDSAKeyPair, data: ByteArray): ByteArray
suspend fun getObjectsByOwner(address: String): List<SuiObjectInfo>?
//@TODO parse string
suspend fun getObjectDetails(objectInfos: List<SuiObjectInfo>): List<String>?
suspend fun getTransactions(
transactionQuery: TransactionQuery,
nextOffset: String? = null,
limit: Int? = null,
descending: Boolean = false
): SuiTransactionDigest?
suspend fun getTransactionDetails(digests: List<String>): List<String>?
suspend fun fetchCustomRequest(requests: JsonRpcRequest): JsonRpcResponse
suspend fun fetchCustomRequests(requests: List<JsonRpcRequest>): List<JsonRpcResponse>
//@TODO parse string
suspend fun faucet(address: String): Any
suspend fun transferObject(
objectId: String, receiver: String, sender: String, gasBudget: Int, gasObjectId: String? = null)
): SuiWrappedTxBytes?
suspend fun moveCall(
sender: String,
packageObjectId: String,
module: String,
function: String,
typeArguments: List<String> = listOf(),
arguments: List<String> = listOf(),
gasPayment: String? = null,
gasBudget: Int
): SuiWrappedTxBytes?
suspend fun transferSui(
objectId: String, receiver: String, sender: String, gasBudget: Int, amount: Int? = null
): SuiWrappedTxBytes?
//@TODO parse string
suspend fun executeTransaction(
txBytes: ByteArray, signedBytes: ByteArray, keyPair: EdDSAKeyPair
): Any?