-
Notifications
You must be signed in to change notification settings - Fork 343
/
define-proto.sh
executable file
·65 lines (61 loc) · 3.05 KB
/
define-proto.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
set -o errexit -o nounset -o pipefail
command -v shellcheck >/dev/null && shellcheck "$0"
ROOT_PROTO_DIR="./proto/cosmos/cosmos-sdk"
COSMOS_PROTO_DIR="$ROOT_PROTO_DIR/proto"
THIRD_PARTY_PROTO_DIR="$ROOT_PROTO_DIR/third_party/proto"
OUT_DIR="./src/codec/"
mkdir -p "$OUT_DIR"
protoc \
--plugin="$(yarn bin protoc-gen-ts_proto)" \
--ts_proto_out="$OUT_DIR" \
--proto_path="$COSMOS_PROTO_DIR" \
--proto_path="$THIRD_PARTY_PROTO_DIR" \
--ts_proto_opt="esModuleInterop=true,forceLong=long,useOptionals=true" \
"$COSMOS_PROTO_DIR/cosmos/auth/v1beta1/auth.proto" \
"$COSMOS_PROTO_DIR/cosmos/auth/v1beta1/query.proto" \
"$COSMOS_PROTO_DIR/cosmos/bank/v1beta1/bank.proto" \
"$COSMOS_PROTO_DIR/cosmos/bank/v1beta1/query.proto" \
"$COSMOS_PROTO_DIR/cosmos/bank/v1beta1/tx.proto" \
"$COSMOS_PROTO_DIR/cosmos/base/abci/v1beta1/abci.proto" \
"$COSMOS_PROTO_DIR/cosmos/base/query/v1beta1/pagination.proto" \
"$COSMOS_PROTO_DIR/cosmos/base/v1beta1/coin.proto" \
"$COSMOS_PROTO_DIR/cosmos/crypto/multisig/v1beta1/multisig.proto" \
"$COSMOS_PROTO_DIR/cosmos/crypto/secp256k1/keys.proto" \
"$COSMOS_PROTO_DIR/cosmos/distribution/v1beta1/distribution.proto" \
"$COSMOS_PROTO_DIR/cosmos/distribution/v1beta1/query.proto" \
"$COSMOS_PROTO_DIR/cosmos/distribution/v1beta1/tx.proto" \
"$COSMOS_PROTO_DIR/cosmos/staking/v1beta1/query.proto" \
"$COSMOS_PROTO_DIR/cosmos/staking/v1beta1/staking.proto" \
"$COSMOS_PROTO_DIR/cosmos/staking/v1beta1/tx.proto" \
"$COSMOS_PROTO_DIR/cosmos/tx/signing/v1beta1/signing.proto" \
"$COSMOS_PROTO_DIR/cosmos/tx/v1beta1/tx.proto" \
"$COSMOS_PROTO_DIR/cosmos/vesting/v1beta1/vesting.proto" \
"$COSMOS_PROTO_DIR/ibc/applications/transfer/v1/query.proto" \
"$COSMOS_PROTO_DIR/ibc/applications/transfer/v1/tx.proto" \
"$COSMOS_PROTO_DIR/ibc/core/channel/v1/channel.proto" \
"$COSMOS_PROTO_DIR/ibc/core/channel/v1/query.proto" \
"$COSMOS_PROTO_DIR/ibc/core/channel/v1/tx.proto" \
"$COSMOS_PROTO_DIR/ibc/core/client/v1/client.proto" \
"$COSMOS_PROTO_DIR/ibc/core/client/v1/query.proto" \
"$COSMOS_PROTO_DIR/ibc/core/client/v1/tx.proto" \
"$COSMOS_PROTO_DIR/ibc/core/commitment/v1/commitment.proto" \
"$COSMOS_PROTO_DIR/ibc/core/connection/v1/connection.proto" \
"$COSMOS_PROTO_DIR/ibc/core/connection/v1/query.proto" \
"$COSMOS_PROTO_DIR/ibc/core/connection/v1/tx.proto" \
"$COSMOS_PROTO_DIR/ibc/lightclients/tendermint/v1/tendermint.proto" \
"$THIRD_PARTY_PROTO_DIR/confio/proofs.proto" \
"$THIRD_PARTY_PROTO_DIR/tendermint/abci/types.proto" \
"$THIRD_PARTY_PROTO_DIR/tendermint/crypto/keys.proto" \
"$THIRD_PARTY_PROTO_DIR/tendermint/crypto/proof.proto" \
"$THIRD_PARTY_PROTO_DIR/tendermint/libs/bits/types.proto" \
"$THIRD_PARTY_PROTO_DIR/tendermint/types/params.proto" \
"$THIRD_PARTY_PROTO_DIR/tendermint/types/types.proto" \
"$THIRD_PARTY_PROTO_DIR/tendermint/types/validator.proto" \
"$THIRD_PARTY_PROTO_DIR/tendermint/version/types.proto"
# Remove unnecessary codec files
rm -rf \
src/codec/cosmos_proto/ \
src/codec/gogoproto/ \
src/codec/google/api/ \
src/codec/google/protobuf/descriptor.ts