{"id":23263151,"url":"https://github.com/wavesplatform/protobuf-schemas","last_synced_at":"2025-10-18T19:31:51.453Z","repository":{"id":35030421,"uuid":"195045050","full_name":"wavesplatform/protobuf-schemas","owner":"wavesplatform","description":"Waves protobuf schemas","archived":false,"fork":false,"pushed_at":"2024-09-19T16:26:45.000Z","size":135,"stargazers_count":5,"open_issues_count":2,"forks_count":8,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-12-12T14:10:41.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wavesplatform.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-03T12:01:10.000Z","updated_at":"2024-09-24T12:43:56.000Z","dependencies_parsed_at":"2023-02-18T07:45:30.345Z","dependency_job_id":"3a0386ad-d460-4085-a058-4f6c13f8c992","html_url":"https://github.com/wavesplatform/protobuf-schemas","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fprotobuf-schemas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fprotobuf-schemas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fprotobuf-schemas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fprotobuf-schemas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wavesplatform","download_url":"https://codeload.github.com/wavesplatform/protobuf-schemas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229931753,"owners_count":18146695,"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-12-19T14:15:00.081Z","updated_at":"2025-10-18T19:31:51.378Z","avatar_url":"https://github.com/wavesplatform.png","language":"Rust","readme":"# About\nWaves protobuf schemas repository\n\n# How to use\n## Java\nAdd dependency to your `pom.xml`\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.wavesplatform\u003c/groupId\u003e\n    \u003cartifactId\u003eprotobuf-schemas\u003c/artifactId\u003e\n    \u003cversion\u003e{version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n## ScalaPB\n1. Add dependency to your `build.sbt`: \n```scala\nlibraryDependencies += \"com.wavesplatform\" % \"protobuf-schemas\" % \"{version}\" % \"protobuf-src\" intransitive()\n```\n2. Configure ScalaPB to compile external schemas with:\n```scala\ninConfig(Compile)(Seq(\n   PB.protoSources in Compile := Seq(PB.externalIncludePath.value),\n   includeFilter in PB.generate := new SimpleFileFilter((f: File) =\u003e f.getName.endsWith(\".proto\") \u0026\u0026 f.getParent.endsWith(\"waves\")),\n   PB.targets += scalapb.gen(flatPackage = true) -\u003e sourceManaged.value\n ))\n```\n3. If you use SNAPSHOT version, add this line\n```scala\nresolvers += Resolver.sonatypeRepo(\"snapshots\")\n```\nSee [ScalaPB docs](https://scalapb.github.io/docs/third-party-protos) for more info.\n## JavaScript\nNpm package: `@waves/protobuf-serialization`.\n\nIt contains generated JavaScript classes, TypeScript definitions as well as raw proto files. The default build uses CommonJS and includes all of the proto files. We used `pbjs` to build JavaScript and `pbts` to build TypeScript definitions.\n\nYou could also make your own custom build from raw `.proto` files, for example, if you want to use only a subset of proto schemas or gRPC services. They can be found in `@waves/protobuf-serialization/proto` directory.\n\n`long.js` is used for 64-bit integers: `int64`, `uint64`, etc.\n\nExample:\n1. `npm install --save @waves/protobuf-serialization`\n2. Default build usage\n```javascript\nimport { waves } from '@waves/protobuf-serialization';\n\nconst block = new waves.Block();\nblock.header = // ... set necessary fields\n\nconst buffer = waves.Block.encode(block);\n\nconst blockDecoded = waves.Block.decode(buffer);\n```\n\n## C#\n1. Add `App.config`, `packages.config` to your C# solution \n2. Add \n```\n  \u003cItemGroup\u003e\n    \u003cProtobuf Include=\"proto\\waves\\*.proto\" OutputDir=\"waves\\%(RelativePath)\" GrpcServices=\"None\" /\u003e\n    \u003cProtobuf Include=\"proto\\waves\\events\\*.proto\" OutputDir=\"waves\\events\\%(RelativePath)\" GrpcServices=\"None\" /\u003e\n    \u003cProtobuf Include=\"proto\\waves\\node\\grpc\\*.proto\" OutputDir=\"waves\\node\\grpc\\%(RelativePath)\" GrpcServices=\"Both\" /\u003e\n  \u003c/ItemGroup\u003e\n```\nto your `.csproj` file. After this just build your project.\n\nor as alternative you can use util protoc, for example:\n``` protoc --csharp_out=RelativePath  --proto_path=RelativePathToProtoDir RelativePathToProtoFile```\n\nAlso there is a NuGet package WavesPlatform.ProtobufSchema with this project.\n\n## Rust\nAdd dependency to your `Cargo.toml`\n```toml\n[dependencies]\nwaves-protobuf-schemas = { git = \"https://github.com/wavesplatform/protobuf-schemas\" }\n```\n\n# How to generate sources locally\n\n## Java\nUse `mvn package` to create JAR artifacts:\n1. `protobuf-schemas-{version}-protobuf-src.jar` - raw .proto files\n2. `protobuf-schemas-{version}.jar` - protoc-generated Java classes\n\n## Python\nGenerating python sources requires python 3 or later. Run the following commands from the root of this repository to generate python sources in `/target/python`:\n```\npython3 -m venv .venv\n. .venv/bin/activate\npip install grpcio grpcio-tools base58\ngit clone https://github.com/wavesplatform/protobuf-schemas.git\npython -m grpc_tools.protoc --proto_path=./protobuf-schemas/proto --python_out=. --grpc_python_out=. `find ./protobuf-schemas/proto -type f`\n```\nTweak `--python_out` and `--grpc_python_out` parameters to generate files elsewhere. Target path should likely be absolute. Now you can use generated classes:\n```python\nimport grpc\nfrom waves.events.grpc.blockchain_updates_pb2_grpc import BlockchainUpdatesApiStub\nfrom waves.events.grpc.blockchain_updates_pb2 import SubscribeRequest\nfrom base58 import b58encode, b58decode\n\ndef asset_id(asset_id_bytes):\n    return len(asset_id_bytes) \u003e 0 and b58encode(asset_id_bytes) or 'WAVES'\n\ndef print_update(update):\n    update_id = b58encode(update.id)\n    print(f'block {update_id}:')\n    for (tx_id, tx_state_update) in zip(update.append.transaction_ids, update.append.transaction_state_updates):\n        print(f'  tx {b58encode(tx_id)}:')\n        for balance in tx_state_update.balances:\n            print(f'    {b58encode(balance.address)}: {balance.amount_before} -\u003e {balance.amount_after.amount} [{asset_id(balance.amount_after.asset_id)}]')\n\nwith grpc.insecure_channel('grpc.wavesnodes.com:6881') as channel:\n    for block in BlockchainUpdatesApiStub(channel).Subscribe(SubscribeRequest(from_height=3135450, to_height=3135470)):\n        print_update(block.update)\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fprotobuf-schemas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwavesplatform%2Fprotobuf-schemas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fprotobuf-schemas/lists"}