Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

update and expose default options #1414

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions modules/client/src/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getRandomPrivateKey } from "@connext/utils";
const CONNEXT_DEFAULT_SIGNER_KEY = "CONNEXT_DEFAULT_SIGNER";

const removeUndefinedFields = <T>(obj: T): T => {
Object.keys(obj).forEach(key => typeof obj[key] === "undefined" && delete obj[key]);
Object.keys(obj).forEach((key) => typeof obj[key] === "undefined" && delete obj[key]);
return obj;
};

Expand All @@ -21,7 +21,7 @@ const getGeneratedSigner = (): string => {
return signer;
};

const getUrlOptions = (network: string): { ethProviderUrl: string; nodeUrl: string } => {
export const getUrlOptions = (network: string): { ethProviderUrl: string; nodeUrl: string } => {
let urlOptions;

if (network.toLowerCase() === "localhost") {
Expand All @@ -31,7 +31,7 @@ const getUrlOptions = (network: string): { ethProviderUrl: string; nodeUrl: stri
network.toLowerCase() === "mainnet"
? "indra.connext.network"
: network.toLowerCase() === "rinkeby"
? "rinkeby.indra.connext.network"
? "staging.indra.connext.network"
: null;
if (!baseUrl) {
throw new Error(`Provided network (${network.toLowerCase()}) is not supported`);
Expand Down
3 changes: 2 additions & 1 deletion modules/client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import "core-js/stable";
import "regenerator-runtime/runtime";
import * as utils from "@connext/utils";
import { getUrlOptions, getDefaultOptions } from "./default";

import { connect } from "./connect";
import { ConnextClient } from "./connext";

export { ConnextClient, connect, utils };
export { ConnextClient, connect, utils, getUrlOptions, getDefaultOptions };