Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/celestiaorg/protobuf3-solidity-lib
Codec library for protobuf3 in Solidity
https://github.com/celestiaorg/protobuf3-solidity-lib
ethereum lazyledger protobuf3 solidity
Last synced: about 1 month ago
JSON representation
Codec library for protobuf3 in Solidity
- Host: GitHub
- URL: https://github.com/celestiaorg/protobuf3-solidity-lib
- Owner: celestiaorg
- License: apache-2.0
- Created: 2020-08-30T18:16:33.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-04T17:33:54.000Z (9 months ago)
- Last Synced: 2024-10-31T19:45:53.563Z (2 months ago)
- Topics: ethereum, lazyledger, protobuf3, solidity
- Language: JavaScript
- Homepage:
- Size: 2.82 MB
- Stars: 14
- Watchers: 4
- Forks: 4
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# protobuf3-solidity-lib
[![NPM Package](https://img.shields.io/npm/v/@lazyledger/protobuf3-solidity-lib)](https://www.npmjs.org/package/@lazyledger/protobuf3-solidity-lib)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/lazyledger/protobuf3-solidity-lib)](https://github.com/lazyledger/protobuf3-solidity-lib/releases)
[![Node.js CI](https://github.com/lazyledger/protobuf3-solidity-lib/workflows/Node.js%20CI/badge.svg)](https://github.com/lazyledger/protobuf3-solidity-lib/actions?query=workflow%3A%22Node.js+CI%22)
[![GitHub](https://img.shields.io/github/license/lazyledger/protobuf3-solidity-lib)](https://github.com/lazyledger/protobuf3-solidity-lib/blob/master/LICENSE)Codec library for [protobuf3](https://developers.google.com/protocol-buffers) in Solidity. This library provides [encoding and decoding functions for core protobuf3 types](https://developers.google.com/protocol-buffers/docs/encoding).
## Overview
### Installation
```sh
npm install --save @lazyledger/protobuf3-solidity-lib
```### Usage
Import the library in Solidity:
```solidity
pragma solidity >=0.8.4 <0.9.0;import "@lazyledger/protobuf3-solidity-lib/contracts/ProtobufLib.sol";
```## Building from source
Install dependencies:
```sh
npm install
```Build:
```sh
npm run build
```Test:
```sh
npm run test
```## Supported Features
| type | decode | encode |
|-------------------|:------:|:------:|
| key | ✔️ | ✔️ |
| varint | ✔️ | ✔️ |
| `int32` | ✔️ | ✔️ |
| `int64` | ✔️ | ✔️ |
| `uint32` | ✔️ | ✔️ |
| `uint64` | ✔️ | ✔️ |
| `sint32` | ✔️ | ✔️ |
| `sint64` | ✔️ | ✔️ |
| `fixed32` | ✔️ | ✔️ |
| `sfixed32` | ✔️ | ✔️ |
| `fixed64` | ✔️ | ✔️ |
| `sfixed64` | ✔️ | ✔️ |
| `bool` | ✔️ | ✔️ |
| enum | ✔️ | ✔️ |
| `string` | ✔️ | ✔️ |
| `bytes` | ✔️ | ✔️ |
| embedded messages | ✔️ | ✔️ |
| packed repeated | ✔️ | ✔️ |### Unsupported Features
Start and end group deprecated wire types, `float`, `double` field types.