{"id":19610709,"url":"https://github.com/onflow/flow-kmm","last_synced_at":"2025-04-27T22:33:00.701Z","repository":{"id":188638546,"uuid":"626994722","full_name":"onflow/flow-kmm","owner":"onflow","description":" Kotlin Multiplatform Mobile (KMM) library for building Android and iOS applications on the Flow blockchain","archived":false,"fork":false,"pushed_at":"2025-04-22T08:56:59.000Z","size":54375,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":23,"default_branch":"main","last_synced_at":"2025-04-25T20:40:41.284Z","etag":null,"topics":["blockchain","flow-blockchain","kotlin","kotlin-multiplatform","onflow"],"latest_commit_sha":null,"homepage":"https://onflow.org","language":"Objective-C","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/onflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-12T15:12:19.000Z","updated_at":"2025-04-22T08:54:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"963f961b-aa25-4267-8e1a-fa38052836ca","html_url":"https://github.com/onflow/flow-kmm","commit_stats":null,"previous_names":["onflow/flow-kmm"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fflow-kmm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fflow-kmm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fflow-kmm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fflow-kmm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onflow","download_url":"https://codeload.github.com/onflow/flow-kmm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251219600,"owners_count":21554444,"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":["blockchain","flow-blockchain","kotlin","kotlin-multiplatform","onflow"],"created_at":"2024-11-11T10:32:08.029Z","updated_at":"2025-04-27T22:32:55.684Z","avatar_url":"https://github.com/onflow.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flow KMM SDK\n\nThe Flow KMM SDK is an open-source Kotlin Multiplatform Mobile (KMM) library for building Android and iOS applications on the Flow blockchain. It provides a set of APIs for querying the blockchain, managing accounts, interacting with smart contracts, and handling cryptographic operations.\n\n## Features\n\n- Kotlin Multiplatform Mobile (KMM) support for Android and iOS\n- Flow Client for interacting with the Flow blockchain\n- Interacting with Flow smart contracts\n- Sending transactions to the Flow blockchain\n- Encode and decode Cadence values \u0026 type\n\n## Get Started\n\n#### Android\n\n```groovy\ndependencies {\n\t\timplementation(\"org.onflow:flow:$flowKMMVersion\")\n}\n```\n\n#### iOS\n\nWe recommend to use Swift Package, and which can be installed via Xcode with the URL of this repository:\n\n```swift\ndependencies: [\n\t.package(url: \"https://github.com/onflow/flow-kmm\", from: \"$flowKMMVersion\")\n]\n```\n\n## API \u0026 Examples\n\nThe library communicates with access nodes via the Flow RESTful API. You can find the 📖 **RESTful API** documentation [here](https://docs.onflow.org/http-api). To start using the SDK, simply provide the desired chainID. You can configure the chainID as follows:\n\n##### Android\n\n```kotlin\n// Android - Mainnet\nval api = FlowApi(ChainId.Mainnet)\n\n// Testnet\nval api = FlowApi(ChainId.Testnet)\n\n// Custom Endpoint\nval accessProvider = ChainId.Custom(\"https://custom.access.endpoint\", \"Custom Chain\")\nval api = FlowApi(accessProvider)\n```\n\n##### iOS\n\n```swift\n// iOS - Mainnet\nlet api = FlowApi(chainId: ChainId.Mainnet())\n// Testnet\nlet api = FlowApi(chainId: ChainId.Testnet())\n// Custom Endpoint\nlet provider = ChainId.Custom(baseUrl: \"https://custom.access.endpoint\", description: \"Custom Chain\")\nlet api = FlowApi(chainId: provider)\n```\n\n## Querying the Flow Network\n\nOnce you've connected to an access node, you can interact with the Flow blockchain to obtain information on blocks, accounts, events, and transactions. In the following sections, we'll delve into the process of retrieving each of these entities.\n\n### Get Account\n\nRetrieve any account from Flow network's latest block or from a specified block height.\n\n📖 **Account address** is a unique account identifier. Be mindful about the `0x` prefix, you should use the prefix as a default representation but be careful and safely handle user inputs without the prefix.\n\nAn account includes the following data:\n\n- **Address**: the account address.\n- **Balance**: balance of the account.\n- **Contracts**: list of contracts deployed to the account.\n- **Keys**: list of keys associated with the account.\n\n```kotlin\n// Android\nval account = api.getAccount(\"0x328649a25184b171\")\n\n// iOS\nlet account = try await api.getAccount(address: \"0x328649a25184b171\")\n```\n\n### Get Block\n\nQuery the network for block by id, height or get the latest block.\n\n📖 **Block ID** is SHA3-256 hash of the entire block payload. This hash is stored as an ID field on any block response object (ie. response from `GetLatestBlock`).\n\n📖 **Block height** expresses the height of the block on the chain. The latest block height increases by one for every valid block produced.\n\n##### Android\n\n```kotlin\n// Get Latest Block\nval latestBlock = api.getBlock()\n\n// Get Block by id\nval block = api.getBlock(id = \"e285bafe8372ae0ad9e0070218c35588b83a09a2a4fa0e1cdc71eedc2488bce1\")\n```\n\n##### iOS\n\n```swift\n// Get Latest Block\nlet latestBlock = try await api.getBlock(id: nil, blockHeight: nil, sealed: true)\n\n// Get Block by id\nlet block = try await api.getBlock(id: \"e285bafe8372ae0ad9e0070218c35588b83a09a2a4fa0e1cdc71eedc2488bce1\", \n                                   blockHeight: nil, \n                                   sealed: true)\n```\n\n## Contributing\n\nWe welcome contributions to the Flow KMM SDK! Please read our [CONTRIBUTING.md](./CONTRIBUTING.md) file for guidelines on submitting issues, feature requests, and pull requests.\n\n## License\n\nThe Flow KMM SDK is released under the [Apache License 2.0](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonflow%2Fflow-kmm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonflow%2Fflow-kmm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonflow%2Fflow-kmm/lists"}