{"id":13652284,"url":"https://github.com/Supercolony-net/typechain-polkadot","last_synced_at":"2025-04-23T03:30:41.239Z","repository":{"id":41199858,"uuid":"504046955","full_name":"Supercolony-net/typechain-polkadot","owner":"Supercolony-net","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-06T18:47:37.000Z","size":317,"stargazers_count":13,"open_issues_count":3,"forks_count":28,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-18T14:32:13.985Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Supercolony-net.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-06-16T06:59:36.000Z","updated_at":"2024-06-04T01:18:15.000Z","dependencies_parsed_at":"2024-01-03T05:15:05.710Z","dependency_job_id":"f8397b2a-ddae-40a2-a937-5cfdbd84b737","html_url":"https://github.com/Supercolony-net/typechain-polkadot","commit_stats":{"total_commits":33,"total_committers":7,"mean_commits":4.714285714285714,"dds":0.5454545454545454,"last_synced_commit":"8fd42b0ba6ab1bb5b9f7b31ac5a13c75898ea514"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Supercolony-net%2Ftypechain-polkadot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Supercolony-net%2Ftypechain-polkadot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Supercolony-net%2Ftypechain-polkadot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Supercolony-net%2Ftypechain-polkadot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Supercolony-net","download_url":"https://codeload.github.com/Supercolony-net/typechain-polkadot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250365245,"owners_count":21418654,"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":[],"created_at":"2024-08-02T02:00:57.954Z","updated_at":"2025-04-23T03:30:40.149Z","avatar_url":"https://github.com/Supercolony-net.png","language":"TypeScript","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"![created by sc](https://user-images.githubusercontent.com/24861482/182869484-fb90e4a9-6289-48a5-82ea-e8c9bc0097ad.png)\n\n## Overview :page_facing_up:\n\nTypechain was created by [Supercolony](supercolony.net) to to improve developers’ experience working with ink! smartcontracts.\n\n\nNowadays, when technologies are growing faster and faster, we should think about optimizations of different routine processes and making older stuff better. One of these optimizations is to make code typesafe that will be flexible in different situations.\n\nWhen a smart contract is being written, front-end developer receives file representation of it in the format called Application Binary Interface (ABI). One ABI per each contract, new ABI for every update of a contract.\n\nInformation about how to interact with a contract (methods names, arguments \u0026 returns types etc.) is included in this ABI file. It is not quite human-readable, so extraction of that information becomes a challenge. We need to have correct type definitions for each contract in TypeScript.\n\nInteraction with blockchain is done with polkadot.js library, which only has abstract definitions for the contract in use, thus users' code cannot be typesafe. And Typechain-Polkadot can change it.\n\n### Installation \u0026 import\n\nInstall the package as dependency:\n\n```bash\nyarn add @supercolony/typechain-polkadot\n```\n\nPass the folder with artifacts(in the example it is `artifacts`) as input argument \nand the output folder(in the example it is `typed_contracts`):\n```bash\nnpx typechain-polkadot --in artifacts --out typed_contracts\n```\n\nImport the contract what you want to use(in the example it is [`my_psp22`](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp22)):\n```typescript\nimport MyPSP22 from \"../typed_contracts/contracts/my_psp22\"\n```\n\nIn the code you can find all available methods and constructors.\n\nRight now, you can't instantiate the contract via typechain(coming soon),\nbut you can wrap any already deployed contract. If in the code you already \nhave instantiated `contract` then you can easily wrap it:\n\n```typescript\nconst typed_contract = new MyPSP22(\n    contract.address.toString(), \n    signer /* who will sign transactions*/, \n    contract.api\n);\n```\n\nMore information you can find in [docs](docs/about.md).\n\n### Usage of Typechain-compiler\n\n```bash\nnpx typechain-compiler --config config.json\n```\n\nAlso you can set some additional arguments like `--noCompile`, `--noTypechain`, `--release`\n\nConfig interface will be something like this:\n```typescript\nexport interface Config {\n    projectFiles: string[]; // Path to all project files, everystring in glob format\n    skipLinting : boolean; // Skip linting of project files\n    artifactsPath : string; // Path to artifacts folder, where artifacts will be stored it will save both .contract and .json (contract ABI)\n    typechainGeneratedPath : string; // Path to typechain generated folder\n}\n```\n\n### Project Details\n\nTypesafe contracts' descriptions can be generated automatically by a script, taking a list of ABIs as an input, giving usable TS type definitions and even runtime code as its output.\n\nGiven, that a front-end developer needs to do this with every contracts update, such tool would save a lot of time and prevent mistakes of misusing smart contracts. It is installed as a package with built-in CLI.\n\nWhen contracts descriptions come both with ABI and source code (`*.contract` files), our tool will provide means for deployment as well.\n\n\n## Roadmap 🚗\n\nTypechain participates in the Web3 Grants, you can find the roadmap there:\n- [Grant I](https://github.com/w3f/Grants-Program/blob/master/applications/typechain-polkadot.md)\n  - [Delivery milestone 1](https://github.com/w3f/Grant-Milestone-Delivery/blob/master/deliveries/typechain-polkadot-milestone-1.md#milestone-delivery-mailbox)\n- Grant II - Comming soon....\n\n-----------\n#### Made with ❤️ by [Supercolony](https://supercolony.net)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSupercolony-net%2Ftypechain-polkadot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSupercolony-net%2Ftypechain-polkadot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSupercolony-net%2Ftypechain-polkadot/lists"}