Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Operator] strategyType not generated properly #473

Closed
Janaka-Steph opened this issue Oct 13, 2021 · 5 comments
Closed

[Operator] strategyType not generated properly #473

Janaka-Steph opened this issue Oct 13, 2021 · 5 comments

Comments

@Janaka-Steph
Copy link

In generated file operator_pb_d.ts, strategyType has a typo trategyType which results in type being any when used in frontend.

  getStrategyType(): trategyType;
  setStrategyType(value: trategyType): UpdateMarketStrategyRequest;
export namespace MarketInfo {
  export type AsObject = {
    market?: types_pb.Market.AsObject,
    fee?: types_pb.Fee.AsObject,
    tradable: boolean,
    strategyType: trategyType,
    accountIndex: number,
    price?: types_pb.Price.AsObject,
    balance?: types_pb.Balance.AsObject,
  }
}

etc..

@tiero
Copy link
Collaborator

tiero commented Oct 13, 2021

can you help us replicate how you compiling the stubs from protobuf? If you have any script or something

@Janaka-Steph
Copy link
Author

Janaka-Steph commented Oct 13, 2021

Also happens we ActionType, being ctionType.

export namespace AddWebhookRequest {
  export type AsObject = {
    endpoint: string,
    action: ctionType,
    secret: string,
  }
}

Maybe a coincidence but both have Type in their name.

@Janaka-Steph
Copy link
Author

Janaka-Steph commented Oct 13, 2021

This is the compiling script

#!/usr/bin/env bash

cd ./src/api-spec || exit
mkdir -p generated/js

GRPC_TOOLS_NODE_PROTOC="../../node_modules/.bin/grpc_tools_node_protoc"
GRPC_WEB_PLUGIN="../../node_modules/.bin/protoc-gen-grpc-web"

${GRPC_TOOLS_NODE_PROTOC} \
--js_out=import_style=commonjs,binary:./generated/js \
--grpc-web_out=import_style=typescript,mode=grpcwebtext:./generated/js \
--plugin=protoc-gen-grpc-web=${GRPC_WEB_PLUGIN} \
./*.proto

Using grpc-web "^1.2.1"

@Janaka-Steph
Copy link
Author

Janaka-Steph commented Oct 13, 2021

Related issues
grpc/grpc-web#939
grpc/grpc-web#1039

@tiero
Copy link
Collaborator

tiero commented Oct 13, 2021

need to lock 1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants