{"id":20800836,"url":"https://github.com/mcxross/ksui","last_synced_at":"2026-01-11T17:39:05.522Z","repository":{"id":154912213,"uuid":"611172630","full_name":"mcxross/ksui","owner":"mcxross","description":"Multiplatform SDK for Sui","archived":false,"fork":false,"pushed_at":"2024-11-14T09:14:29.000Z","size":4466,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-11-14T10:19:03.246Z","etag":null,"topics":["crpyto","kotlin","rpc","sdk","sui"],"latest_commit_sha":null,"homepage":"https://mcxross.github.io/ksui/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcxross.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-08T09:16:21.000Z","updated_at":"2024-11-14T09:14:33.000Z","dependencies_parsed_at":"2023-09-28T10:46:27.349Z","dependency_job_id":"5421b5dd-0740-41f3-ac79-62f872998a45","html_url":"https://github.com/mcxross/ksui","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcxross%2Fksui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcxross%2Fksui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcxross%2Fksui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcxross%2Fksui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcxross","download_url":"https://codeload.github.com/mcxross/ksui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225073009,"owners_count":17416536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crpyto","kotlin","rpc","sdk","sui"],"created_at":"2024-11-17T18:16:01.955Z","updated_at":"2026-01-11T17:39:05.476Z","avatar_url":"https://github.com/mcxross.png","language":"Kotlin","funding_links":[],"categories":["Client SDKs \u0026 Libraries"],"sub_categories":["Client SDKs"],"readme":"\u003ch1 align=\"center\"\u003eKsui - Multiplatform SDK for Sui\u003c/h1\u003e\n\nKsui, /keɪˈsuːiː/ (pronounced as \"kay-soo-ee\"), is a Kotlin Multiplatform (KMP) SDK for integrating with the Sui\nblockchain.\n\nIt is designed to be a type-safe, client-configurable, and multiplatform SDK that can be used across\ndifferent platforms such as Android, iOS, JS, and JVM. It is built on top of the KMM toolchain and is designed to be\nextensible and easy to use.\n\n\n[![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.9.23-B125EA?logo=kotlin)](https://kotlinlang.org)\n[![Docs Publish](https://github.com/mcxross/ksui/actions/workflows/docs-publish.yml/badge.svg)](https://github.com/mcxross/ksui/actions/workflows/docs-publish.yml)\n[![Maven Central](https://img.shields.io/maven-central/v/xyz.mcxross.ksui/ksui)](https://search.maven.org/artifact/xyz.mcxross.ksui/ksui)\n![Snapshot](https://img.shields.io/nexus/s/xyz.mcxross.ksui/ksui?server=https%3A%2F%2Fs01.oss.sonatype.org\u0026label=Snapshot)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)\n\n![badge-android](http://img.shields.io/badge/Platform-Android-brightgreen.svg?logo=android)\n![badge-ios](http://img.shields.io/badge/Platform-iOS-orange.svg?logo=apple)\n![badge-js](http://img.shields.io/badge/Platform-NodeJS-yellow.svg?logo=javascript)\n![badge-jvm](http://img.shields.io/badge/Platform-JVM-red.svg?logo=openjdk)\n![badge-linux](http://img.shields.io/badge/Platform-Linux-lightgrey.svg?logo=linux)\n![badge-macos](http://img.shields.io/badge/Platform-macOS-orange.svg?logo=apple)\n![badge-windows](http://img.shields.io/badge/Platform-Windows-blue.svg?logo=windows)\n\n# Table of contents\n\n- [Features](#features)\n- [Quick start](#quick-start)\n- [What's included](#whats-included)\n- [Contribution](#contribution)\n- [License](#license)\n\n## Features\n\n- Multiplatform (Android, iOS, JS, JVM)\n- Type-safe intuitive API\n- Client Configurable (Retries, Timeout, etc)\n- Asynchronous client\n- Coroutine based\n- Expressive DSL for PTB construction\n- Plus everything else you would expect from a Sui SDK\n\n## Quick Start\n\n### Installation\n\n#### Multiplatform\n\nAdd the `Ksui` dependency to the common sourceSet\n\n```kotlin\nimplementation(\"xyz.mcxross.ksui:ksui:\u003c$ksui_version\u003e\")\n```\n\n#### Platform specific (Android, JS, Native, JVM)\n\nAdd the `Ksui` dependency to the Project's dependency block\n\nGeneric:\n\n```kotlin\nimplementation(\"xyz.mcxross.ksui:\u003cksui-[platform]\u003e:\u003c$ksui_version\u003e\")\n```\n\nFor example for Android and JS\n\nAndroid:\n\n```kotlin\nimplementation(\"xyz.mcxross.ksui:ksui-android:\u003c$ksui_version\u003e\")\n```\n\n### Account Management\n\n#### Generating a new account\n\nTo generate a new Sui account, simply call the static `create` method on the `Account` class as shown below:\n\n```kotlin\nval yourAccount = Account.create()\n```\n\nThis generates a new account with a random mnemonic, public key, and address.\n\n#### Importing an existing account\n\n##### From a private key\n\nThere are a couple of ways to import an existing account. One way is to import an account from a private key as a\nprivate key object:\n\n```kotlin\nval privateKey = PrivateKey.fromEncoded(\"suipri...8cpv0g\")\n\nval yourAccount = Account.import(privateKey)\n```\n\nor as a string:\n\n```kotlin\nval yourAccount = Account.import(\"suipri...8cpv0g\")\n```\n\n\u003e [!NOTE]\n\u003e **Ksui** adheres to the standard Sui private key format of encoding the private key in Bech32 format as\n\u003e proposed in [SIP-15](https://github.com/sui-foundation/sips/blob/main/sips/sip-15.md).\n\nYou can also import an account from a mnemonic:\n\n```kotlin\nval mnemonic = \"abandon salad ...\"\nval yourAccount = Account.import(mnemonic)\n```\n\n### Initialization\n\nFirst, you need to create a new instance of the Sui RPC HTTP Client as shown below:\n\n```kotlin\nval sui = Sui()\n```\n\nIn case you want to configure the client, you can do so as shown below:\n\n```kotlin\nval config = SuiConfig(settings = SuiSettings(network = Network.MAINNET))\nval sui = Sui(config)\n```\n\nNow you can use the `sui` instance to interact with the Sui chain for reading and writing.\n\n### Reading from the chain\n\nOnce you have initialized the client, you can use it to read from the chain. For example, to get the balance of an\naddress:\n\n```kotlin\nval balance = sui.getBalance(AccountAddress(\"0x4afc81d797fd02bd7e923389677352eb592d55a00b65067fa582c05f62b4788b\"))\n```\n\n### Writing to the chain (PTBs)\n\nTo write to the chain, you need to create a `Transaction` and sign it with the private key of the sender. A transaction,\namong its metadata,\nis made up of PTBs which are a chain of commands that are executed by the chain. For example, to construct a PTB that\n*splits* a\ncoin and *sends* it to another address, you can do so as shown below:\n\n```kotlin\n\n// Assuming you have an account object\nval alice = Account.import(\"suipri...8cpv0g\")\n\n// Create a programmable transaction\nval ptb = programmableTx {\n    command {\n        // Split the coin\n        val splitCoins = splitCoins {\n            coin = Argument.GasCoin\n            into = inputs(1_000_000UL)\n        }\n\n        // Send the split coin to the receiver\n        transferObjects {\n            objects = inputs(splitCoins)\n            to = input(alice.address)\n        }\n    }\n}\n\n// Sign and execute txn\nval txn = sui.signAndExecuteTransactionBlock(alice, ptb)\n\n```\n\nFor more information, please see the [documentation](https://suicookbook.com).\n\n## What's included\n\n| File/Folder      | Description                                                                                             |\n|------------------|---------------------------------------------------------------------------------------------------------|\n| [lib](lib)       | Library implementation folder. It contains the code for Ksui that can be used across multiple platforms |\n| [sample](sample) | Samples on how to use the exported APIs                                                                 |\n\n## Contribution\n\nAll contributions to Ksui are welcome. Before opening a PR, please submit an issue detailing the bug or feature. When\nopening a PR, please ensure that your contribution builds on the KMM toolchain, has been linted\nwith `ktfmt \u003cGOOGLE (INTERNAL)\u003e`, and contains tests when applicable. For more information, please see\nthe [contribution guidelines](CONTRIBUTING.md).\n\n## License\n\n    Copyright 2024 McXross\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcxross%2Fksui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcxross%2Fksui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcxross%2Fksui/lists"}