百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

Soltsice

> 前端框架
开源

Solidity 和 TypeScript 的集成、配置和示例

100 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

Solidity 和 TypeScript 的集成、配置和示例

Soltsice

Solidity & TypeScript Integration, Configuration and Examples

With 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 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.

Quick links

  • Soltsice
    • Quick links
    • Features
      • Solidity ABI to TypeScript contract generation
        • Methods
        • Events
        • Type safety and easy refactoring
        • Fast API discovery & Intellisense support
        • Isomorphic NPM packages for contracts
      • Transactions and custom data signing
        • Using remote public nodes is easy
        • Micropayments state channels example
      • Private key management
        • Security considerations
        • Local key file storage
      • Contracts for access control
        • MultiOwnable: MultiSig majority and individual owner access
        • BotManageable: account managed by backend
      • Utilities
        • W3 module
        • Ethereum Utils
        • Keythereum
        • Storage contract
        • soltsice code generator from code
      • Work in progress
    • Getting started
      • Install & Usage
        • Workflow
      • Starter projects
        • Contracts starter
        • Frontend with CRA & TypeScript
        • Backend API with Swagger
    • Examples
      • Dbrain contracts
      • Dbrain blockchain API
      • Dbrain DApp prototype
    • Contributing
      • Build
      • License

Features

Solidity ABI to TypeScript contract generation

With Soltsice you could generate strongly-typed TypeScript proxies for Ethereum contracts from Solidity ABI with a single command.

Methods

TODO

Events

TODO

Type safety and easy refactoring

The 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.

Methods with signatures

Typed Constructor

Fast API discovery & Intellisense support

TODO

Isomorphic NPM packages for contracts

TODO

Transactions and custom data signing

TODO

Using remote public nodes is easy

TODO Problem: Geth 1.8 added pruning, but still long-running nodes grow in side. Standard BizSpark subscription cannot keep up, needs more resources.

TODO Deploy via migrations using contracts, showcase @ts-check attribute in VSCode

Micropayments state channels example

TODO

Private key management

TODO

Security considerations

TODO

Local key file storage

TODO

Note that the format is standard one so you could import existing key files just by providing a filepath and password.

top

Contracts for access control

TODO

MultiOwnable: MultiSig majority and individual owner access

TODO

BotManageable: account managed by backend

TODO

Utilities

TODO

W3 module

TODO

Ethereum Utils

TODO

Typings

Keythereum

TODO

Storage contract

TODO

soltsice code generator from code

TODO

Work in progress

TODO

top


Getting started

Installing 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.

Install & Usage

You must have truffle and copyfiles installed globally:

npm install -g truffle copyfiles

Install and save Soltsice:

npm install soltsice --save

Soltsice allows to generate TypeScript files for Ethereum contracts with the command:

soltsice ./artifacts ./types

All .json artifacts from truffle compile in the folder artifacts will be transformed into TypeScript classes in types with a single index.ts file with all exports.

Every TypeScript contract class inherits SoltsiceContract, which is a wrapper over Truffle-contract with methods generated from ABI. If some functionality is not yet supported by Soltsice, you may use SoltsiceContract._instance : Promise field to access untyped Truffle-contract instance.

You could import generated types as:

…

See dbrain-contracts and dbrain-blockchain-api projects that use this library and a standalone minimal example here.

Workflow

  • Edit Solidity contracts, run truffle compile, run tests on Truffle stack (solidity or js, if any)
  • Run Soltsice command soltsice ./src ./dest, all TypeScript contracts will be updated, any API changes will block subsequent TS compilation (except for rare edge cases such as multiple return parameters which are returned as an array and we use any TS type for them)
  • Adjust you code to the changes.

Starter projects

TODO

Contracts starter

TODO A starter project with the shortest path to deploy

Frontend with CRA & TypeScript

TODO Use the contract starter package from DApp starter (dbrain-dapp structure)

Backend API with Swagger

TODO Use the contract starter from backend (dbrain-blockchain-api structure)

top


Examples

TODO

Dbrain contracts

TODO https://github.com/Soltsice/dbrain-contracts State channels + in-memory off-chain signing mock

Dbrain blockchain API

TODO https://github.com/Soltsice/dbrain-blockchain-api Off-chain signing prototype on Postgres

Dbrain DApp prototype

TODO

top


Contributing

If some functionality is not supported yet you are very welcome to open an issue or pull request!

Build

To build & test run the following commands:

bash
npm install
npm run build:contracts
npm run soltsice
npm test

License

MIT

(c) 2018 Dbrain.io

Issues· 6 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptethereumreactsoliditytruffle

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架