Skip to content

Commit

Permalink
feat: handle stride account parsing
Browse files Browse the repository at this point in the history
Signed-off-by: Griko Nibras <griko@nibras.co>
  • Loading branch information
grikomsn committed Feb 5, 2024
1 parent aa73b45 commit a63bda0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/utils/clients.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CosmWasmClient } from "@cosmjs/cosmwasm-stargate";
import { StargateClient } from "@cosmjs/stargate";
import { AccountParser, StargateClient } from "@cosmjs/stargate";
import { strideAccountParser } from "stridejs";

import { ChainId, chainIdToName } from "@/chains/types";

Expand All @@ -20,7 +21,14 @@ export async function getStargateClientForChainID(chainID: ChainId) {

const preferredEndpoint = getNodeProxyEndpoint(chainID);

const client = await StargateClient.connect(preferredEndpoint, {});
let accountParser: AccountParser | undefined;
if (chainID.includes("stride")) {
accountParser = strideAccountParser;
}

const client = await StargateClient.connect(preferredEndpoint, {
accountParser,
});

STARGATE_CLIENTS[chainID] = client;

Expand Down

0 comments on commit a63bda0

Please sign in to comment.