{"_id":"@apsiocoin/protobuf-serialization","_rev":"1-c2c1b6775dbd2a59e40dc879d130cc5f","name":"@apsiocoin/protobuf-serialization","dist-tags":{"latest":"0.0.1-alpha2"},"versions":{"0.0.1-alpha1":{"name":"@apsiocoin/protobuf-serialization","version":"0.0.1-alpha1","description":"Generated types and methods for encoding and decoding protobuf messages as well as working with gRPC services.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"rm -rf dist && mkdir dist && npm run compileProtoc && npm run createTypeDeclarations && npm run compileProtoc -- --no-comments","createTypeDeclarations":"pbts -o dist/index.d.ts --no-comments dist/index.js","compileProtoc":"pbjs -t static-module --force-long --no-create --no-verify --no-convert --no-delimited --no-beautify -w commonjs -o dist/index.js \"proto/apsiocoin/**/*.proto\""},"repository":{"type":"git","url":"git+https://github.com/apsiocoin/protobuf-schemas.git"},"author":{"name":"Dmitry Shuranov","email":"dvshur@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/apsiocoin/protobuf-schemas/issues"},"homepage":"https://github.com/apsiocoin/protobuf-schemas#readme","dependencies":{"@types/long":"^4.0.0","pbjs":"^0.0.14","protobufjs":"^6.8.8"},"gitHead":"cae89ab9164f02c06eabbe2c9102b74fd36b3fd4","_id":"@apsiocoin/protobuf-serialization@0.0.1-alpha1","_nodeVersion":"17.3.0","_npmVersion":"8.3.0","dist":{"integrity":"sha512-ukcvXhfKjhaX0rAU8R3JpYPj/cccAtvig6LpFO7nT40n7ie0TZ5KRT/YWJv3OxdCDeqGWKn18hyJhnwj6tHaGA==","shasum":"6224a88c9422a21c953756c1bf8d43fe877658d2","tarball":"https://registry.npmjs.org/@apsiocoin/protobuf-serialization/-/protobuf-serialization-0.0.1-alpha1.tgz","fileCount":16,"unpackedSize":26540,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQCfxnR9okLBfTAa/GZIHJYtFWAxqdJODfplopRL+bLBVQIfWFn54zklc/etm7BJPA9FhhtLu6k3o6OxmyPkYIlu0g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJigO+cACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFoBAAlT5HjLW71yO8qVd4Va8AD85o2QNrjy9+3IzSMmKL7U/kqb3K\r\nwTIF8OG7XB17W7GW2Yp1FiBvLZQOtSiWh2PNS9mIqbwXPNcV/ABg933t2Fgq\r\n1XVHzjdmeZM5KZSzl64zmI53ARRQJX+AQVbqIM77PtYjFxsCl1V8GCUNJa6/\r\nVXoJazBNMWU12vVdWxStEvgILI534cTcXVL3wsK9wLQI7P+ChMsFpxjQGty8\r\nLRr4ZiwPzjv+NOQrKzNsfszQJLk74IjjCnNlt+znxElH2B5mfiYSvLYBIPc5\r\n1j8bWkDWRiUE/L5nKqDG97ORG5mDmkOJL3LwywajOGAquaVYP/7IuDor0nyx\r\nbxJFKbIgV9zx3clRPQT9fTbGoopyElpQD1a8yCy0Y5DzMrIMTxdSGmjDaqrw\r\nGkfNETxQwx3LXm1m50JK4daq85abxAtDHxV5rUan7FPL03XYBVCLP4DsHbzt\r\n1awLRX+XmCJ8Xdle1Qb0+L1Q+IahoXR5LNWW4DxgO9LTLZ7Z6sEEeRJcO1pX\r\nJ2eUU+E3UqjjjQDcYFJ70+WGM2U9l3G50bZ30rn3EQ5Is9ZXosg18u1482o8\r\nHvA1To3KMRpauO2D12//lfxc/VUb5lsHGiMPKH0G4gUhwk0Pcn/ynl0SsrJX\r\n4TCRBn602bycV/V+ql1lYnWzu9VTkYi0Jdo=\r\n=dzaE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"pythou","email":"nicolassaysset@free.fr"},"directories":{},"maintainers":[{"name":"pythou","email":"nicolassaysset@free.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/protobuf-serialization_0.0.1-alpha1_1652617116272_0.02873284295410472"},"_hasShrinkwrap":false},"0.0.1-alpha2":{"name":"@apsiocoin/protobuf-serialization","version":"0.0.1-alpha2","description":"Generated types and methods for encoding and decoding protobuf messages as well as working with gRPC services.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"rm -rf dist && mkdir dist && npm run compileProtoc && npm run createTypeDeclarations && npm run compileProtoc -- --no-comments","createTypeDeclarations":"pbts -o dist/index.d.ts --no-comments dist/index.js","compileProtoc":"pbjs -t static-module --force-long --no-create --no-verify --no-convert --no-delimited --no-beautify -w commonjs -o dist/index.js \"proto/waves/**/*.proto\""},"repository":{"type":"git","url":"git+https://github.com/wavesplatform/protobuf-schemas.git"},"author":{"name":"Nicolas Saysset","email":"nicolassaysset@free.fr"},"license":"MIT","bugs":{"url":"https://github.com/wavesplatform/protobuf-schemas/issues"},"homepage":"https://github.com/wavesplatform/protobuf-schemas#readme","dependencies":{"@types/long":"^4.0.0","protobufjs":"^6.8.8"},"gitHead":"46110d99e9009767b24ae0f72e7f37f14e2076e6","_id":"@apsiocoin/protobuf-serialization@0.0.1-alpha2","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-7posBKwC9QPiBBQRjBOXhTdD1RRLoAK3NDsgPtLejgN/XjHdfvvnf3v9WPLKJxIXPMZPArM9KjPgWYQaGM/zTQ==","shasum":"5efd095fa25a60eee8b3a0847bd1ec78f5d8cbdc","tarball":"https://registry.npmjs.org/@apsiocoin/protobuf-serialization/-/protobuf-serialization-0.0.1-alpha2.tgz","fileCount":18,"unpackedSize":407960,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwE32Z7aHbdKwughdLwnHVHEwKXsJtDUzGC5isTuwRVwIhAM7J1Ka5ZLRiw6svI0P/r4dSXwChMYtK3pWigIFxibhG"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJigU0UACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqxHA//cRt89CxZnXMKJUM9mIx4K++7NFyuJZIqPvfDErprurRY2MLv\r\nsw9+hpTT0MSJc/Qu9sM1v7SwTYYBI2d8ObIXxwbCARb1J1tWRuzT793q0aOj\r\ndMJC5t+e1wVpEs8cjj9cFZAbLkm7Z3LF9v+Vtw2MOwlsGAk11KtiqM8ikOBJ\r\nUPaei7Fr62rk7a1x7JuEH09vEodaLsqOkPkWscdO87FcRBZHbJvm9Msy8ImR\r\ngwr2YH5DE59Kg7DhI9nFr49dwqGO6gkdsv630AoOUaIICUkbUZeIaFkGRNdZ\r\ndSTVej11TgLUK0u7pOP4nQsdioMMX0T4nqLGJfSDkh/TKM4k91C8IdhZv+74\r\nddMfvdvMPpJxnea55D67UpbEiSIocEXg2eoaFl/+8617rii7416D/QBb5Rc3\r\nCVSStsTRmR9ckfoO9nsOGuLdOeSPdOMKFS8Uy7yArunr7ZzJST0gfeMCVSDy\r\nKrtplf+8WSuNmODKhBtz1v59SYb1Wnld3vY2xMJ63ee6yelLuHYMVqB5ncZR\r\nVkfo8hFqdu5c0nukuAxdZJ6ZDdb4l03HVMAyih9AO5WnMJRTBzyMgV6xkwzR\r\nYiF9nOfg6ZIldmERf2L4Djl+LwFE4eY97x70gsXehgz3qDg80uZmybCr86rv\r\n+xhDVvIjp/N9FbkGUmytpCAzJzcbFR/e6wY=\r\n=rW3m\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"pythou","email":"nicolassaysset@free.fr"},"directories":{},"maintainers":[{"name":"pythou","email":"nicolassaysset@free.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/protobuf-serialization_0.0.1-alpha2_1652641044548_0.04105772311324185"},"_hasShrinkwrap":false}},"time":{"created":"2022-05-15T12:18:36.226Z","0.0.1-alpha1":"2022-05-15T12:18:36.447Z","modified":"2022-05-15T18:57:24.868Z","0.0.1-alpha2":"2022-05-15T18:57:24.799Z"},"maintainers":[{"name":"pythou","email":"nicolassaysset@free.fr"}],"description":"Generated types and methods for encoding and decoding protobuf messages as well as working with gRPC services.","homepage":"https://github.com/wavesplatform/protobuf-schemas#readme","repository":{"type":"git","url":"git+https://github.com/wavesplatform/protobuf-schemas.git"},"author":{"name":"Nicolas Saysset","email":"nicolassaysset@free.fr"},"bugs":{"url":"https://github.com/wavesplatform/protobuf-schemas/issues"},"license":"MIT","readme":"# About\nWaves protobuf schemas repository\n\n# How to use\n## Java\nAdd dependency to your `pom.xml`\n```xml\n<dependency>\n    <groupId>com.wavesplatform</groupId>\n    <artifactId>protobuf-schemas</artifactId>\n    <version>{version}</version>\n</dependency>\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) => f.getName.endsWith(\".proto\") && f.getParent.endsWith(\"waves\")),\n   PB.targets += scalapb.gen(flatPackage = true) -> 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  <ItemGroup>\n    <Protobuf Include=\"proto\\waves\\*.proto\" OutputDir=\"waves\\%(RelativePath)\" GrpcServices=\"None\" />\n    <Protobuf Include=\"proto\\waves\\events\\*.proto\" OutputDir=\"waves\\events\\%(RelativePath)\" GrpcServices=\"None\" />\n    <Protobuf Include=\"proto\\waves\\node\\grpc\\*.proto\" OutputDir=\"waves\\node\\grpc\\%(RelativePath)\" GrpcServices=\"Both\" />\n  </ItemGroup>\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\npython -m grpc_tools.protoc --proto_path=./proto  --python_out=./target/python  `find ./proto -type f`\n```\nTweak `--python_out` parameter to generate files elsewhere. Target path should likely be absolute. \n","readmeFilename":"README.MD"}