@morpho-dev/router 0.0.27 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -285,6 +285,7 @@ type Client = Compute<RouterClientConfig & {
285
285
  declare function connect(opts?: {
286
286
  url?: string;
287
287
  apiKey?: string;
288
+ headers?: Headers;
288
289
  }): Client;
289
290
  declare namespace connect {
290
291
  type ErrorType = InvalidUrlError;
@@ -285,6 +285,7 @@ type Client = Compute<RouterClientConfig & {
285
285
  declare function connect(opts?: {
286
286
  url?: string;
287
287
  apiKey?: string;
288
+ headers?: Headers;
288
289
  }): Client;
289
290
  declare namespace connect {
290
291
  type ErrorType = InvalidUrlError;
@@ -41,7 +41,7 @@ function getChain(chainId) {
41
41
  return chains[chainName];
42
42
  }
43
43
  var getWhitelistedChains = () => {
44
- return [chains.ethereum, chains["ethereum-virtual-testnet"]];
44
+ return [chains.ethereum, chains.base, chains["ethereum-virtual-testnet"]];
45
45
  };
46
46
  var chains = {
47
47
  ethereum: {
@@ -828,7 +828,7 @@ function connect(opts) {
828
828
  if (u.protocol !== "http:" && u.protocol !== "https:") {
829
829
  throw new InvalidUrlError(u.toString());
830
830
  }
831
- const headers = new Headers();
831
+ const headers = opts?.headers ?? new Headers();
832
832
  headers.set("Content-Type", "application/json");
833
833
  opts?.apiKey !== void 0 ? headers.set("X-API-Key", opts.apiKey) : null;
834
834
  const config = {