Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Make NFT optional with env
Browse files Browse the repository at this point in the history
  • Loading branch information
lambertkevin committed Sep 24, 2021
1 parent 665f666 commit 0862cb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/api/Ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import network from "../network";
import { blockchainBaseURL } from "./Ledger";
import { FeeEstimationFailed } from "../errors";
import { makeLRUCache } from "../cache";
import { getEnv } from "../env";

export type Block = {
height: BigNumber;
}; // TODO more fields actually
Expand Down Expand Up @@ -131,8 +133,9 @@ export const apiForCurrency = (currency: CryptoCurrency): API => {
let { data } = await network({
method: "GET",
url: URL.format({
/** @important FIXME: transactions are mocked while we are waiting for the API */
pathname: `http://51.210.220.222/blockchain/v3/eth/addresses/${address}/transactions`,
pathname: getEnv("NFT")
? `http://51.210.220.222/blockchain/v3/eth/addresses/${address}/transactions`
: `${baseURL}/addresses/${address}/transactions`,
query: {
batch_size,
noinput: true,
Expand Down
5 changes: 5 additions & 0 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,11 @@ const envDefinitions = {
parser: stringParser,
desc: "switch the app into a MOCK mode for test purpose, the value will be used as a seed for the rng. Avoid falsy values.",
},
NFT: {
def: false,
parser: boolParser,
desc: "synchronizing nfts",
},
OPERATION_ADDRESSES_LIMIT: {
def: 100,
parser: intParser,
Expand Down

0 comments on commit 0862cb5

Please sign in to comment.