#!/usr/bin/env bash

# Path to these plugins
PROTOC_GEN_TS_PATH="./node_modules/.bin/protoc-gen-ts_proto"

PROTOS_PATH=$1


# Directory to write generated code to
OUT_DIR="./src/gen/geyser"

protoc \
  --plugin=${PROTOC_GEN_TS_PATH} \
  --proto_path="${PROTOS_PATH}" \
  --ts_proto_out=${OUT_DIR} \
  --ts_proto_opt=outputServices=grpc-js \
  --ts_proto_opt=esModuleInterop=true \
  confirmed_block.proto geyser.proto transaction_by_addr.proto
