{"id":13735735,"url":"https://manosbatsis.github.io/corda-lean-state/","last_synced_at":"2025-05-08T12:30:52.300Z","repository":{"id":57721246,"uuid":"393992277","full_name":"manosbatsis/corda-lean-state","owner":"manosbatsis","description":"Generate Corda Contract and Persistent states from a simplified interface","archived":false,"fork":false,"pushed_at":"2021-08-29T20:16:04.000Z","size":1378,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-28T00:02:08.355Z","etag":null,"topics":["corda","corda-developers","corda-framework","cordapp","cordapps"],"latest_commit_sha":null,"homepage":"https://manosbatsis.github.io/corda-lean-state/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manosbatsis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-08T15:04:50.000Z","updated_at":"2021-08-29T20:13:15.000Z","dependencies_parsed_at":"2022-09-26T21:41:27.504Z","dependency_job_id":null,"html_url":"https://github.com/manosbatsis/corda-lean-state","commit_stats":null,"previous_names":["manosbatsis/corda-statemeant","manosbatsis/corda-restate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manosbatsis%2Fcorda-lean-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manosbatsis%2Fcorda-lean-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manosbatsis%2Fcorda-lean-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manosbatsis%2Fcorda-lean-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manosbatsis","download_url":"https://codeload.github.com/manosbatsis/corda-lean-state/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252804206,"owners_count":21806769,"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":["corda","corda-developers","corda-framework","cordapp","cordapps"],"created_at":"2024-08-03T03:01:10.474Z","updated_at":"2025-05-08T12:30:51.992Z","avatar_url":"https://github.com/manosbatsis.png","language":"Kotlin","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"# Corda LeanState [![Maven Central](https://img.shields.io/maven-central/v/com.github.manosbatsis.corda.leanstate/leanstate-contracts.svg)](https://repo1.maven.org/maven2/com/github/manosbatsis/corda/leanstate/)\n\nShamelessly lazy or simply tired of manually maintaining `ContractState` / `PersistentState` mappings?\nLeanState (re)generates perfectly synced and consistent state classes at build-time, \nbased on model interfaces like `NewsPaper` bellow as input:\n\n```kotlin\n@LeanStateModel\ninterface NewsPaper {\n   val publisher: Party?\n   //...\n}\n```\n\nYou can (optionally!) extend Corda's standard interfaces if you really need  \ncustom overrides VS those added by the processor (e.g.  for `supportedSchemas()`). \nThe processor will refrain from generating its own  if you do.  \nSuch a requirement should be rare as generation is configurable in a few ways, \nsee [state model](https://manosbatsis.github.io/corda-lean-state/state-model)  \nand [full example](https://manosbatsis.github.io/corda-lean-state/full-example) \nsections for details.\n\nHere's what `NewsPaper` above will generate with default settings (edited for brevity). \nContract state:\n\n```kotlin\n@BelongsToContract(value = NewsPaperContract::class)\ndata class NewsPaperContractState(\n        override val linearId: UniqueIdentifier = UniqueIdentifier(),\n        override val publisher: Party? = null,\n        //...\n) : NewsPaperContract.NewsPaper, ParticipantsState, LinearState, QueryableState {\n    override val participants: List\u003cAbstractParty\u003e = //...\n    override fun generateMappedObject(schema: MappedSchema): NewsPaperPersistentState = //...\n    override fun supportedSchemas(): Iterable\u003cMappedSchema\u003e = listOf(SchemaV1)\n    object Schema\n    object SchemaV1 : MappedSchema(Schema::class.java, 1,\n            listOf(NewsPaperPersistentState::class.java))\n}\n```\n\nPersistent state (edited for brevity):\n\n```kotlin\n@Entity @Table(name = \"news_paper\")\nclass NewsPaperPersistentState(\n  @Column(name = \"linear_id_id\",nullable = false) val linearIdId: UUID,\n  @Column(name = \"linear_id_external_id\") val linearIdExternalId: String? = null,\n  @Column(name = \"publisher_name_common_name\") val publisherNameCommonName: String? = null,\n  @Column(name = \"publisher_name_organisation_unit\") val publisherNameOrganisationUnit: String? = null,\n  @Column(name = \"publisher_name_organisation\") val publisherNameOrganisation: String?,\n  @Column(name = \"publisher_name_locality\") val publisherNameLocality: String?,\n  @Column(name = \"publisher_name_state\") val publisherNameState: String? = null,\n  @Column(name = \"publisher_name_country\") val publisherNameCountry: String?,\n  //...\n) : PersistentState()\n\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/manosbatsis.github.io%2Fcorda-lean-state%2F","html_url":"https://awesome.ecosyste.ms/projects/manosbatsis.github.io%2Fcorda-lean-state%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/manosbatsis.github.io%2Fcorda-lean-state%2F/lists"}