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

feat: add epochs to stargate #269

Merged
merged 1 commit into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/stargate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sifchain/stargate",
"version": "1.2.0",
"version": "1.3.0",
"description": "@cosmjs/stargate client for sifnode",
"main": "build/commonjs/index.js",
"exports": {
Expand Down
8 changes: 6 additions & 2 deletions packages/stargate/src/queryClient.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/ban-types */
/* eslint-disable @typescript-eslint/restrict-plus-operands */
import {
createProtobufRpcClient,
QueryClient,
Expand All @@ -12,6 +14,7 @@ import { QueryClientImpl as DispensationQueryClient } from "@sifchain/proto-type
import { QueryClientImpl as EthBridgeQueryClient } from "@sifchain/proto-types/sifnode/ethbridge/v1/query";
import { QueryClientImpl as TokenRegistryQueryClient } from "@sifchain/proto-types/sifnode/tokenregistry/v1/query";
import { QueryClientImpl as MarginQueryClient } from "@sifchain/proto-types/sifnode/margin/v1/query";
import { QueryClientImpl as EpochsQueryClient } from "@sifchain/proto-types/sifnode/epochs/v1/query";
import type { Rpc, StringLiteral } from "./types";

const setupBareExtension =
Expand All @@ -23,8 +26,8 @@ const setupBareExtension =
const clientWithUncapitalizedMethods = Object.fromEntries(
Object.getOwnPropertyNames(Object.getPrototypeOf(baseClient))
.filter((x) => x !== "constructor")
.filter((x) => typeof (baseClient as any)[x] === "function")
.map((x) => [x[0]?.toLowerCase() + x.slice(1), ((baseClient as any)[x] as Function).bind(baseClient)]),
.filter((x) => typeof (baseClient as never)[x] === "function")
.map((x) => [x[0]?.toLowerCase() + x.slice(1), ((baseClient as never)[x] as Function).bind(baseClient)]),
) as {
[P in keyof TClient as P extends string ? Uncapitalize<P> : P]: TClient[P];
};
Expand All @@ -48,6 +51,7 @@ const createQueryClientFromTmClient = (tmClient: Tendermint34Client) =>
setupBareExtension("ethBridge", EthBridgeQueryClient),
setupBareExtension("tokenRegistry", TokenRegistryQueryClient),
setupBareExtension("margin", MarginQueryClient),
setupBareExtension("epochs", EpochsQueryClient),
);

const createQueryClientFromEndpoint = async (endpoint: string | HttpEndpoint) =>
Expand Down
4 changes: 4 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading