Skip to content

Commit

Permalink
feat: clean up clients
Browse files Browse the repository at this point in the history
  • Loading branch information
whalelephant committed Feb 20, 2024
1 parent a589b96 commit fc2a618
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
23 changes: 8 additions & 15 deletions cli/src/clients/cosmwasm.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import path from "path";
import { Secp256k1, Secp256k1Keypair, EnglishMnemonic, Slip10, Slip10Curve, Bip39 } from "@cosmjs/crypto";
import { SigningArchwayClient } from "@archwayhq/arch3.js";
import { SigningCosmWasmClient, UploadResult, Code, ExecuteResult } from "@cosmjs/cosmwasm-stargate";
import { DirectSecp256k1HdWallet, GeneratedType } from "@cosmjs/proto-signing";
import { Tendermint37Client } from "@cosmjs/tendermint-rpc";
Expand All @@ -26,9 +25,9 @@ import type { Chain } from "../config/chains";
import { accountsPath } from "../config/fs";

class CWClient {
client: SigningArchwayClient | SigningCosmWasmClient;
client: SigningCosmWasmClient;
readonly sender: string;
constructor(client: SigningArchwayClient | SigningCosmWasmClient, sender: string) {
constructor(client: SigningCosmWasmClient, sender: string) {
this.client = client;
this.sender = sender;
}
Expand Down Expand Up @@ -111,18 +110,12 @@ class CWClient {

const extraOptions = chainId.includes("osmo") ? { protoRegistry, aminoConverters } : {};

if (addressPrefix == "archway") {
console.log("archway client");
const client = await SigningArchwayClient.createWithSigner(tmClient, signer);
return new CWClient(client, address);
} else {
const client = await SigningCosmWasmClient.createWithSigner(tmClient, signer, {
broadcastPollIntervalMs: 500,
gasPrice: GasPrice.fromString(gasPrice + feeToken),
...extraOptions,
});
return new CWClient(client, address);
}
const client = await SigningCosmWasmClient.createWithSigner(tmClient, signer, {
broadcastPollIntervalMs: 500,
gasPrice: GasPrice.fromString(gasPrice + feeToken),
...extraOptions,
});
return new CWClient(client, address);
}
}

Expand Down
2 changes: 0 additions & 2 deletions cli/src/config/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export enum SupportChains {
"juno_testnet",
"neutron_testnet",
"injective_testnet",
"archway_testnet",
"stargaze_testnet",
"juno_localnet",
"osmosis_testnet",
Expand All @@ -29,7 +28,6 @@ export interface Chain {
}

export * from "./juno";
export * from "./archway";
export * from "./neutron";
export * from "./injective";
export * from "./stargaze";
Expand Down

1 comment on commit fc2a618

@falgyra12

This comment was marked as spam.

Please sign in to comment.