{"id":13621262,"url":"https://github.com/Soltsice/Soltsice","last_synced_at":"2025-04-15T01:31:49.130Z","repository":{"id":57366057,"uuid":"101793925","full_name":"Soltsice/Soltsice","owner":"Soltsice","description":"Solidity \u0026 TypeScript Integration, Configuration and Examples","archived":true,"fork":false,"pushed_at":"2019-03-31T16:46:39.000Z","size":839,"stargazers_count":103,"open_issues_count":6,"forks_count":11,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-15T22:09:14.304Z","etag":null,"topics":["ethereum","react","solidity","truffle","typescript"],"latest_commit_sha":null,"homepage":"https://soltsice.github.io/Soltsice/","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/Soltsice.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-29T18:34:34.000Z","updated_at":"2025-03-03T23:59:17.000Z","dependencies_parsed_at":"2022-08-23T19:40:37.112Z","dependency_job_id":null,"html_url":"https://github.com/Soltsice/Soltsice","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soltsice%2FSoltsice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soltsice%2FSoltsice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soltsice%2FSoltsice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soltsice%2FSoltsice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Soltsice","download_url":"https://codeload.github.com/Soltsice/Soltsice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248989253,"owners_count":21194558,"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":["ethereum","react","solidity","truffle","typescript"],"created_at":"2024-08-01T21:01:04.122Z","updated_at":"2025-04-15T01:31:48.672Z","avatar_url":"https://github.com/Soltsice.png","language":"TypeScript","funding_links":[],"categories":["Languages","Solidity","Tools","TypeScript"],"sub_categories":["Other dialects and variants"],"readme":"# [Soltsice](https://github.com/Soltsice/Soltsice)\n\n**Sol**idity \u0026 **T**ype**S**cript **I**ntegration, **C**onfiguration and **E**xamples\n\nWith Soltsice you could generate strongly-typed TypeScript proxies for Ethereum contracts from Solidity ABI with a single command. You could also send raw signed transactions to public Ethereum nodes such as [Infura](https://infura.io/) just by adding an optional private key parameter to any method. Soltsice provides convenient utilities for storing key files, for signing arbitrary data for later address recovery with `ecrecover` functions from contracts code and for other frequent tasks. Finally, Soltsice has `MultiOwnable` and `BotManageable` contracts for granular access control for MultiSig majority, individual owners and backend accounts.\n\n## Quick links\n\n- [Soltsice](#soltsice)\n  - [Quick links](#quick-links)\n  - [Features](#features)\n    - [Solidity ABI to TypeScript contract generation](#solidity-abi-to-typescript-contract-generation)\n      - [Methods](#methods)\n      - [Events](#events)\n      - [Type safety and easy refactoring](#type-safety-and-easy-refactoring)\n      - [Fast API discovery \u0026 Intellisense support](#fast-api-discovery--intellisense-support)\n      - [Isomorphic NPM packages for contracts](#isomorphic-npm-packages-for-contracts)\n    - [Transactions and custom data signing](#transactions-and-custom-data-signing)\n      - [Using remote public nodes is easy](#using-remote-public-nodes-is-easy)\n      - [Micropayments state channels example](#micropayments-state-channels-example)\n    - [Private key management](#private-key-management)\n      - [Security considerations](#security-considerations)\n      - [Local key file storage](#local-key-file-storage)\n    - [Contracts for access control](#contracts-for-access-control)\n      - [MultiOwnable: MultiSig majority and individual owner access](#multiownable-multisig-majority-and-individual-owner-access)\n      - [BotManageable: account managed by backend](#botmanageable-account-managed-by-backend)\n    - [Utilities](#utilities)\n      - [W3 module](#w3-module)\n      - [Ethereum Utils](#ethereum-utils)\n      - [Keythereum](#keythereum)\n      - [Storage contract](#storage-contract)\n      - [`soltsice` code generator from code](#soltsice-code-generator-from-code)\n    - [Work in progress](#work-in-progress)\n  - [Getting started](#getting-started)\n    - [Install \u0026 Usage](#install--usage)\n      - [Workflow](#workflow)\n    - [Starter projects](#starter-projects)\n      - [Contracts starter](#contracts-starter)\n      - [Frontend with CRA \u0026 TypeScript](#frontend-with-cra--typescript)\n      - [Backend API with Swagger](#backend-api-with-swagger)\n  - [Examples](#examples)\n    - [Dbrain contracts](#dbrain-contracts)\n    - [Dbrain blockchain API](#dbrain-blockchain-api)\n    - [Dbrain DApp prototype](#dbrain-dapp-prototype)\n  - [Contributing](#contributing)\n    - [Build](#build)\n    - [License](#license)\n\n---\n\n## Features\n\n### Solidity ABI to TypeScript contract generation\n\nWith Soltsice you could generate strongly-typed TypeScript proxies for Ethereum contracts from Solidity ABI with a single command. \n\n#### Methods\n\nTODO\n\n#### Events\n\nTODO\n\n#### Type safety and easy refactoring\n\nThe initial purpose of this library was to have peace of mind and type safety when working with rapidly changing Solidity ABI. TypeScript proxies for contracts allow to use powerful intellisense feature of code editors.\n\n*Methods with signatures*\n\n\u003cimg src=\"https://raw.githubusercontent.com/Soltsice/Soltsice/master/misc/images/methods.png\" alt=\"Methods with signatures\" width=\"600\" /\u003e\n\n*Typed Constructor*\n\n\u003cimg src=\"https://raw.githubusercontent.com/Soltsice/Soltsice/master/misc/images/constructor.png\" alt=\"Typed Constructor\" width=\"600\" /\u003e\n\n#### Fast API discovery \u0026 Intellisense support\n\nTODO\n\n#### Isomorphic NPM packages for contracts\n\nTODO\n\n### Transactions and custom data signing\n\nTODO\n\n#### Using remote public nodes is easy\n\nTODO Problem: Geth 1.8 added pruning, but still long-running nodes grow in side. Standard BizSpark subscription cannot keep up, needs more resources.\n\nTODO Deploy via migrations using contracts, showcase @ts-check attribute in VSCode\n\n#### Micropayments state channels example\n\nTODO\n\n### Private key management\n\nTODO\n\n#### Security considerations\n\nTODO\n\n#### Local key file storage\n\nTODO\n\nNote that the format is standard one so you could import existing key files just by providing a filepath and password.\n\n\u003csub\u003e[top](#quick-links)\u003c/sub\u003e\n\n### Contracts for access control\n\nTODO\n\n#### MultiOwnable: MultiSig majority and individual owner access\n\nTODO\n\n#### BotManageable: account managed by backend\n\nTODO\n\n### Utilities\n\nTODO\n\n#### W3 module\n\nTODO\n\n#### Ethereum Utils\n\nTODO \n\nTypings\n\n#### Keythereum\n\nTODO\n\n#### Storage contract\n\nTODO\n\n#### `soltsice` code generator from code\n\nTODO\n\n### Work in progress\n\nTODO\n\n\u003csub\u003e[top](#quick-links)\u003c/sub\u003e\n\n---\n\n## Getting started\n\nInstalling and using Soltsice is very easy. You could just add `soltsice` NPM package to your existing project or use a starter project for new development.\n\n### Install \u0026 Usage\n\nYou must have `truffle` and `copyfiles` installed globally:\n\n\u003e npm install -g truffle copyfiles\n\nInstall and save Soltsice:\n\n\u003e npm install soltsice --save\n\nSoltsice allows to generate TypeScript files for Ethereum contracts with the command:\n\n\u003e soltsice ./artifacts ./types\n\nAll `.json` artifacts from `truffle compile` in the folder `artifacts` will be transformed into TypeScript classes in \n`types` with a single `index.ts` file with all exports.\n\nEvery TypeScript contract class inherits `SoltsiceContract`, which is a wrapper over [Truffle-contract](https://github.com/trufflesuite/truffle-contract) with methods generated from ABI.\nIf some functionality is not yet supported by Soltsice, you may use `SoltsiceContract._instance : Promise\u003cany\u003e` field to access untyped Truffle-contract instance.\n\nYou could import generated types as:\n\n```\nimport { W3 } from \"soltsice\";\nimport { BigNumber } from \"bignumber.js\";\nimport { StandardToken } from \"./types\";\n\n// default wrapper for web3: either window['web3'] if present,\n// or http provider connected to localhost: 8545, if not running on https \nlet w3: W3 = new W3();\n\n// null for ctor params which are only used for newly deployed contracts\nlet st: StandardToken = new StandardToken(\"address of deployed contract\", null, w3);\n\n// note that typings are optional in variable definitions, TypeScript infers types\nlet supply: Promise\u003cBigNumber\u003e = st.totalSupply();\n\nsupply.then(value =\u003e {\n    console.log(\"TOTAL SUPPLY\", value.dividedBy(1e18).toFormat(0));\n});\n\n```\n\nSee [dbrain-contracts](https://github.com/Soltsice/dbrain-contracts) and [dbrain-blockchain-api](https://github.com/Soltsice/dbrain-blockchain-api) projects that use this library and a standalone minimal example [here](https://github.com/buybackoff/SoltsiceExample).\n\n#### Workflow\n\n* Edit Solidity contracts, run `truffle compile`, run tests on Truffle stack (solidity or js, if any)\n* Run Soltsice command `soltsice ./src ./dest`, all TypeScript contracts will be updated, any API changes will block subsequent TS compilation\n  (except for rare edge cases such as multiple return parameters which are returned as an array and we use `any` TS type for them)\n* Adjust you code to the changes.\n\n### Starter projects\n\nTODO\n\n#### Contracts starter\n\nTODO A starter project with the shortest path to deploy\n\n#### Frontend with CRA \u0026 TypeScript\n\nTODO Use the contract starter package from DApp starter (dbrain-dapp structure)\n\n#### Backend API with Swagger\n\nTODO Use the contract starter from backend (dbrain-blockchain-api structure)\n\n\u003csub\u003e[top](#quick-links)\u003c/sub\u003e\n\n---\n\n## Examples\n\nTODO\n\n### Dbrain contracts\n\nTODO \nhttps://github.com/Soltsice/dbrain-contracts\nState channels + in-memory off-chain signing mock\n\n### Dbrain blockchain API\n\nTODO\nhttps://github.com/Soltsice/dbrain-blockchain-api\nOff-chain signing prototype on Postgres\n\n### Dbrain DApp prototype\n\nTODO\n\n\u003csub\u003e[top](#quick-links)\u003c/sub\u003e\n\n---\n\n## Contributing\n\nIf [some functionality](#work-in-progress) is not supported yet you are very welcome to open an issue or pull request!\n\n### Build\n\nTo build \u0026 test run the following commands:\n\n```\nnpm install\nnpm run build:contracts\nnpm run soltsice\nnpm test\n```\n\n### License\n\nMIT\n\n(c) 2018 Dbrain.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSoltsice%2FSoltsice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSoltsice%2FSoltsice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSoltsice%2FSoltsice/lists"}