Add steps to run proto gen script
This commit is contained in:
parent
954a40d6e4
commit
6eaaf0e47c
18
README.md
18
README.md
@ -67,3 +67,21 @@ With the simapp process running, run these commands in another window:
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Protobuf
|
||||
|
||||
Prerequisite: [protoc](https://protobuf.dev/installation/)
|
||||
|
||||
Run following scripts when [proto files](./proto/) are updated.
|
||||
|
||||
- Install dependencies:
|
||||
|
||||
```bash
|
||||
yarn
|
||||
```
|
||||
|
||||
- Generate typescript bindings for the proto files:
|
||||
|
||||
```bash
|
||||
./scripts/protocgen.sh
|
||||
```
|
||||
|
||||
@ -2,7 +2,7 @@ import { Table, TableBody, TableCell, TableRow } from "@/components/ui/table";
|
||||
import { printableCoin, thinSpace } from "@/lib/displayHelpers";
|
||||
import { toastError } from "@/lib/utils";
|
||||
import { Coin } from "@cosmjs/amino";
|
||||
import { accountFromAny, SigningZenithClient } from "@/utils/account";
|
||||
import { accountFromAny, SigningZenithClient } from "@/utils/cosmos-client.ts";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useChains } from "../../context/ChainsContext";
|
||||
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";
|
||||
|
||||
@ -8,7 +8,7 @@ import { msgTypeCountsFromJson } from "@/lib/txMsgHelpers";
|
||||
import { cn, toastError } from "@/lib/utils";
|
||||
import { WalletInfo } from "@/types/signing";
|
||||
import { toBase64 } from "@cosmjs/encoding";
|
||||
import { accountFromAny, SigningZenithClient } from "@/utils/account";
|
||||
import { accountFromAny, SigningZenithClient } from "@/utils/cosmos-client.ts";
|
||||
import { Loader2, MoveRightIcon } from "lucide-react";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
|
||||
@ -6,7 +6,7 @@ import { toastError } from "@/lib/utils";
|
||||
import { WalletInfo } from "@/types/signing";
|
||||
import { MultisigThresholdPubkey } from "@cosmjs/amino";
|
||||
import { toBase64 } from "@cosmjs/encoding";
|
||||
import { accountFromAny, SigningZenithClient } from "@/utils/account";
|
||||
import { accountFromAny, SigningZenithClient } from "@/utils/cosmos-client.ts";
|
||||
import { Loader2, MoveRightIcon } from "lucide-react";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
|
||||
@ -2,7 +2,7 @@ import { ChainInfo } from "@/context/ChainsContext/types";
|
||||
import { pubkeyToAddress } from "@cosmjs/amino";
|
||||
import { z } from "zod";
|
||||
import { checkAddressOrPubkey } from "../../../lib/displayHelpers";
|
||||
import { accountFromAny, SigningZenithClient } from "@/utils/account";
|
||||
import { accountFromAny, SigningZenithClient } from "@/utils/cosmos-client.ts";
|
||||
|
||||
export const getCreateMultisigSchema = (chain: ChainInfo) =>
|
||||
z
|
||||
@ -26,13 +26,13 @@ export const getCreateMultisigSchema = (chain: ChainInfo) =>
|
||||
const address = member.startsWith(chain.addressPrefix)
|
||||
? member
|
||||
: pubkeyToAddress(
|
||||
{ type: "tendermint/PubKeySecp256k1", value: member },
|
||||
chain.addressPrefix,
|
||||
);
|
||||
{ type: "tendermint/PubKeySecp256k1", value: member },
|
||||
chain.addressPrefix,
|
||||
);
|
||||
|
||||
const client = await SigningZenithClient.connect(chain.nodeAddress, {
|
||||
accountParser: accountFromAny
|
||||
});
|
||||
const client = await SigningZenithClient.connect(chain.nodeAddress, {
|
||||
accountParser: accountFromAny
|
||||
});
|
||||
|
||||
const accountOnChain = await client.getAccount(address);
|
||||
|
||||
@ -81,7 +81,7 @@ export const getCreateMultisigSchema = (chain: ChainInfo) =>
|
||||
);
|
||||
|
||||
return address;
|
||||
} catch {}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
return member;
|
||||
@ -125,9 +125,8 @@ export const getCreateMultisigSchema = (chain: ChainInfo) =>
|
||||
.refine(
|
||||
({ members, threshold }) => threshold <= members.filter(({ member }) => member !== "").length,
|
||||
({ members }) => ({
|
||||
message: `Threshold can't be higher than the number of members (${
|
||||
members.filter(({ member }) => member !== "").length
|
||||
})`,
|
||||
message: `Threshold can't be higher than the number of members (${members.filter(({ member }) => member !== "").length
|
||||
})`,
|
||||
path: ["threshold"],
|
||||
}),
|
||||
);
|
||||
|
||||
@ -21,7 +21,7 @@ import { createMultisigFromCompressedSecp256k1Pubkeys } from "../../../lib/multi
|
||||
import ConfirmCreateMultisig from "./ConfirmCreateMultisig";
|
||||
import MemberFormField from "./MemberFormField";
|
||||
import { getCreateMultisigSchema } from "./formSchema";
|
||||
import { accountFromAny, SigningZenithClient } from "@/utils/account";
|
||||
import { accountFromAny, SigningZenithClient } from "@/utils/cosmos-client.ts";
|
||||
|
||||
export default function CreateMultisigForm() {
|
||||
const router = useRouter();
|
||||
|
||||
@ -11,7 +11,7 @@ import {
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { ChainInfo } from "@/context/ChainsContext/types";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { accountFromAny, SigningZenithClient } from "@/utils/account";
|
||||
import { accountFromAny, SigningZenithClient } from "@/utils/cosmos-client.ts";
|
||||
import Link from "next/link";
|
||||
import { NextRouter, withRouter } from "next/router";
|
||||
import { useForm } from "react-hook-form";
|
||||
|
||||
@ -13,7 +13,7 @@ import {
|
||||
setShaInStorage,
|
||||
} from "./storage";
|
||||
import { ChainItems } from "./types";
|
||||
import { SigningZenithClient } from "@/utils/account";
|
||||
import { SigningZenithClient } from "@/utils/cosmos-client.ts";
|
||||
|
||||
export const useChainsFromRegistry = () => {
|
||||
const [chainItems, setChainItems] = useState<ChainItems>({
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
pubkeyToAddress,
|
||||
} from "@cosmjs/amino";
|
||||
import { Account, StargateClient } from "@cosmjs/stargate";
|
||||
import { SigningZenithClient } from "@/utils/account";
|
||||
import { SigningZenithClient } from "@/utils/cosmos-client.ts";
|
||||
import { createDbMultisig, getDbMultisig } from "./api";
|
||||
import { checkAddress, explorerLinkAccount } from "./displayHelpers";
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import { MultisigThresholdPubkey } from "@cosmjs/amino";
|
||||
import { fromBase64 } from "@cosmjs/encoding";
|
||||
import { Account, makeMultisignedTxBytes } from "@cosmjs/stargate";
|
||||
import { assert } from "@cosmjs/utils";
|
||||
import { SigningZenithClient } from "@/utils/account";
|
||||
import { SigningZenithClient } from "@/utils/cosmos-client.ts";
|
||||
import { GetServerSideProps } from "next";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
@ -2,7 +2,7 @@ import { getBelongedMultisigs, getCreatedMultisigs } from "@/graphql/multisig";
|
||||
import { getNonce, incrementNonce } from "@/graphql/nonce";
|
||||
import { GetDbMultisigTxsBody } from "@/lib/api";
|
||||
import { verifyKeplrSignature } from "@/lib/keplr";
|
||||
import { SigningZenithClient } from "@/utils/account";
|
||||
import { SigningZenithClient } from "@/utils/cosmos-client.ts";
|
||||
import { decodeSignature, pubkeyToAddress } from "@cosmjs/amino";
|
||||
import { toBase64 } from "@cosmjs/encoding";
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
@ -3,7 +3,7 @@ import { getNonce, incrementNonce } from "@/graphql/nonce";
|
||||
import { getTransactions } from "@/graphql/transaction";
|
||||
import { GetDbMultisigTxsBody } from "@/lib/api";
|
||||
import { verifyKeplrSignature } from "@/lib/keplr";
|
||||
import { SigningZenithClient } from "@/utils/account";
|
||||
import { SigningZenithClient } from "@/utils/cosmos-client.ts";
|
||||
import { decodeSignature, pubkeyToAddress } from "@cosmjs/amino";
|
||||
import { toBase64 } from "@cosmjs/encoding";
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user