Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
REACT_APP_CONFIG_RPC=https://rpctest.tzbeta.net
REACT_APP_CONFIG_TZKT_API=https://staging.api.edo2net.tzkt.io
REACT_APP_CONFIG_NETWORK=edonet
REACT_APP_CONFIG_BCD_API=https://api.better-call.dev
REACT_APP_CONFIG_BCD_GUI=https://better-call.dev
REACT_APP_CONFIG_CONTRACTS_NFT_FAUCET=KT1Hagc5XQYzkX7HfRbUNXdi4CBfiENzbHiU
REACT_APP_CONFIG_CONTRACTS_MARKETPLACE_FIXED_PRICE_TEZ=KT1H4tMRW3o9GdPJ3r82ZC7BJiR6WgmYazUC
REACT_APP_CONFIG_IPFS_API=https://minter-api.tqhosted.com
REACT_APP_CONFIG_IPFS_GATEWAY=https://tqtezos.mypinata.cloud
24 changes: 24 additions & 0 deletions config/local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"rpc": "https://rpctest.tzbeta.net",
"admin": {
"secret": "edsk2xHxaCtgpKpncPBXgLbZhAz17yp5qgwv6K88zMqqwsrui3UaRB"
},
"tzkt": {
"api": "https://staging.api.edo2net.tzkt.io"
},
"network": "edonet",
"bcd": {
"api": "https://api.better-call.dev",
"gui": "https://better-call.dev"
},
"contracts": {
"nftFaucet": "KT1NXuDT1xczTMNcLPj6ymqTAZhTEQARy3YL",
"marketplace": {
"fixedPrice": {
"tez": "KT1SgCbeuKsbUtQnndYSG9rdM9h8mRADxhSr"
}
}
},
"ipfsApi": "http://localhost:3300",
"ipfsGateway": "https://mypinata.cloud"
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"immer": "8.0.0",
"io-ts": "2.2.16",
"joi": "17.3.0",
"lodash": "4.17.21",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-dropzone": "11.2.4",
Expand All @@ -51,7 +52,7 @@
"ts-node": "9.1.1"
},
"scripts": {
"start": "yarn start:testnet",
"start": "react-scripts start",
"start:testnet": "cp ./config/testnet.json src/config.json && react-scripts start",
"start:sandbox": "cp ./config/sandbox-bootstrapped.json src/config.json && react-scripts start",
"start:mainnet": "cp ./config/mainnet.json src/config.json && react-scripts start",
Expand Down
73 changes: 73 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import configFile from './config.json';
import { Config } from './lib/system';

const {
REACT_APP_CONFIG_RPC = '',
REACT_APP_CONFIG_TZKT_API = '',
REACT_APP_CONFIG_NETWORK = '',
REACT_APP_CONFIG_BCD_API = '',
REACT_APP_CONFIG_BCD_GUI = '',
REACT_APP_CONFIG_CONTRACTS_NFT_FAUCET = '',
REACT_APP_CONFIG_CONTRACTS_MARKETPLACE_FIXED_PRICE_TEZ = '',
REACT_APP_CONFIG_IPFS_API = '',
REACT_APP_CONFIG_IPFS_GATEWAY = ''
} = process.env;

const defaultConfig: Config = {
rpc: 'https://rpctest.tzbeta.net',
tzkt: {
api: 'https://staging.api.edo2net.tzkt.io'
},
network: 'edonet',
bcd: {
api: 'https://api.better-call.dev',
gui: 'https://better-call.dev'
},
contracts: {
nftFaucet: '',
marketplace: {
fixedPrice: {
tez: ''
}
}
},
ipfsApi: 'http://localhost:3300',
ipfsGateway: 'https://mypinata.cloud'
};

const config: Config = {
rpc: REACT_APP_CONFIG_RPC || configFile.rpc || defaultConfig.rpc,
tzkt: {
api:
REACT_APP_CONFIG_TZKT_API || configFile.tzkt.api || defaultConfig.tzkt.api
},
network:
REACT_APP_CONFIG_NETWORK || configFile.network || defaultConfig.network,
bcd: {
api:
REACT_APP_CONFIG_BCD_API || configFile.bcd.api || defaultConfig.bcd.api,
gui: REACT_APP_CONFIG_BCD_GUI || configFile.bcd.gui || defaultConfig.bcd.gui
},
contracts: {
nftFaucet:
REACT_APP_CONFIG_CONTRACTS_NFT_FAUCET ||
configFile.contracts.nftFaucet ||
defaultConfig.contracts.nftFaucet,
marketplace: {
fixedPrice: {
tez:
REACT_APP_CONFIG_CONTRACTS_MARKETPLACE_FIXED_PRICE_TEZ ||
configFile.contracts.marketplace.fixedPrice.tez ||
defaultConfig.contracts.marketplace.fixedPrice.tez
}
}
},
ipfsApi:
REACT_APP_CONFIG_IPFS_API || configFile.ipfsApi || defaultConfig.ipfsApi,
ipfsGateway:
REACT_APP_CONFIG_IPFS_GATEWAY ||
configFile.ipfsGateway ||
defaultConfig.ipfsGateway
};

export default config;
2 changes: 1 addition & 1 deletion src/reducer/slices/collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
getWalletAssetContractsQuery
} from '../async/queries';
import { Nft, AssetContract } from '../../lib/nfts/decoders';
import config from '../../config.json';
import config from '../../config';

//// State

Expand Down
2 changes: 1 addition & 1 deletion src/reducer/slices/marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '../async/queries';
import { Nft } from '../../lib/nfts/decoders';
import { MarketplaceNftLoadingData } from '../../lib/nfts/queries';
import config from '../../config.json';
import config from '../../config';

//// State

Expand Down
2 changes: 1 addition & 1 deletion src/reducer/slices/system.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Minter, SystemWithToolkit, SystemWithWallet } from '../../lib/system';
import { createSlice } from '@reduxjs/toolkit';
import config from '../../config.json';
import config from '../../config';
import {
connectWallet,
disconnectWallet,
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8218,6 +8218,11 @@ lodash.uniq@^4.5.0:
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=

lodash@4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==

"lodash@>=3.5 <5", lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.5:
version "4.17.20"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
Expand Down