rchain-community / rchain-api

An API for rchain dapps to communicate with the blockchain
Other
22 stars 12 forks source link

package protobufs (with type annotations) #67

Closed dckc closed 3 years ago

dckc commented 5 years ago

I'm writing an example and it would be useful to do something like:

const { Par } = require('rchain-proto').RhoTypes;

The protobufs, with typescript and flow type annotations, would be good to publish as a separate npm package.

dckc commented 5 years ago

for now (241742b), I re-exported RhoTypes and CasperMessage so I could do:

const { RHOCore, RhoTypes } = require('rchain-api');
const data = [true, 1, 'abc', null, [1, 2, 3]];
const rhoProto = RHOCore.fromJSData(data);
RhoTypes.Par.verify(rhoProto);
dckc commented 3 years ago

leaving gRPC and protobuf in the dust