Skip to content

Commit

Permalink
WIP: fix all unused exports from packages/networks
Browse files Browse the repository at this point in the history
Signed-off-by: clegirar <[email protected]>
  • Loading branch information
clegirar committed Sep 19, 2023
1 parent 1d402fb commit b002aef
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,4 @@ networks.json: node_modules validate-networks
.PHONY: unused-exports
unused-exports: node_modules
## TODO unexclude all paths except packages/api;packages/contracts-clients;packages/evm-contracts-clients
npx ts-unused-exports ./tsconfig.json --excludePathsFromReport="packages/api;packages/contracts-clients;packages/evm-contracts-clients;packages/components/socialFeed/RichText/inline-toolbar;packages/networks;./App.tsx;.*\.web|.electron|.d.ts" --ignoreTestFiles
npx ts-unused-exports ./tsconfig.json --excludePathsFromReport="packages/api;packages/contracts-clients;packages/evm-contracts-clients;packages/components/socialFeed/RichText/inline-toolbar;./App.tsx;.*\.web|.electron|.d.ts" --ignoreTestFiles
21 changes: 0 additions & 21 deletions packages/networks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,6 @@ export const getCurrency = (
return getNetwork(networkId)?.currencies.find((c) => c.denom === denom);
};

export const getToriNativeCurrency = (networkId: string) => {
const network = getNetwork(networkId);
if (network?.kind === NetworkKind.Cosmos)
return network?.currencies.find(
(currencyInfo: CurrencyInfo) => currencyInfo.kind === "native"
) as NativeCurrencyInfo;
else {
const toriIbcCurrency = network?.currencies.find(
(currencyInfo: CurrencyInfo) =>
currencyInfo.kind === "ibc" && currencyInfo.sourceDenom === "utori"
);
return getNativeCurrency(networkId, toriIbcCurrency?.denom);
}
};

export const getIBCCurrency = (
networkId: string | undefined,
denom: string | undefined
Expand Down Expand Up @@ -425,12 +410,6 @@ export const getKeplrSigningStargateClient = async (
);
};

export const getNonSigningStargateClient = async (networkId: string) => {
const network = mustGetCosmosNetwork(networkId);

return await StargateClient.connect(network.rpcEndpoint);
};

export const getKeplrSigningCosmWasmClient = async (
networkId: string,
gasPriceKind: "low" | "average" | "high" = "average"
Expand Down
1 change: 1 addition & 0 deletions packages/networks/solana/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { NetworkKind, NetworkInfo } from "../types";

// ts-unused-exports:disable-next-line
export const solanaNetwork: NetworkInfo = {
id: "solana",
kind: NetworkKind.Solana,
Expand Down
8 changes: 3 additions & 5 deletions packages/networks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export enum NetworkKind {
Gno = "Gno",
}

export interface NetworkInfoBase {
interface NetworkInfoBase {
id: string;
displayName: string;
kind: NetworkKind;
Expand Down Expand Up @@ -71,7 +71,7 @@ export type EthereumNetworkInfo = NetworkInfoBase & {
riotContractAddress: string;
};

export type SolanaNetworkInfo = NetworkInfoBase & {
type SolanaNetworkInfo = NetworkInfoBase & {
kind: NetworkKind.Solana;
holaplexGraphqlEndpoint: string;
vaultContractAddress: string;
Expand Down Expand Up @@ -99,8 +99,6 @@ export type NetworkInfo =
| SolanaNetworkInfo
| GnoNetworkInfo;

export type CurrencyKind = "native" | "ibc";

export type NativeCurrencyInfo = {
kind: "native";
denom: string;
Expand All @@ -111,7 +109,7 @@ export type NativeCurrencyInfo = {
color: string;
};

export type IBCCurrencyInfo = {
type IBCCurrencyInfo = {
kind: "ibc";
denom: string;
sourceNetwork: string;
Expand Down

0 comments on commit b002aef

Please sign in to comment.