Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import AppLogin from './AppLogin';
import { SectionV2 } from './components/reusables/SharedStylingV2';
import { ErrorContext } from './contexts/ErrorContext';
import { setIndex, setRun, setWelcomeNotifsEmpty } from './redux/slices/userJourneySlice';
import { useBrowserNotification } from 'hooks/useBrowserNotification';

// Internal Configs
import { appConfig } from 'config';
Expand Down Expand Up @@ -145,6 +146,8 @@ export default function App() {
setcurrentTime(now);
}, []);

useBrowserNotification();

useEffect(() => {
if (!account) return;
dispatch(resetSpamSlice());
Expand Down
38 changes: 26 additions & 12 deletions src/api/index.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
// External Packages
import axios from "axios";
import axios from 'axios';

// Internal Configs
import { appConfig } from "config";
import { appConfig } from 'config';

// Constants
const BASE_URL = appConfig.apiUrl
const TOOLING_BASE_URL = appConfig.toolingApiUrl
const BASE_URL = appConfig.apiUrl;
const TOOLING_BASE_URL = appConfig.toolingApiUrl;
const DELIVERY_NODE_BASE_URL = appConfig.deliveryNodeApiUrl;

/**
* A function used to make get requests throughout the entire application
* @param {String} path e.g /feeds/getFeeds, this represents the route of the enpoint to call
* @returns {Promise}
*/
export const getReq = async (path) => {
try {
const response = await axios.get(BASE_URL + path);
return response;
} catch (error) {
throw error;
}
};
try {
const response = await axios.get(BASE_URL + path);
return response;
} catch (error) {
throw error;
}
};

/**
* A function used to make post requests to the backend
Expand Down Expand Up @@ -55,5 +56,18 @@ export const toolingPostReq = async (path, obj) => {
}
};

export * from './ipfs';
export const deliveryNodePostReq = async (path, obj) => {
try {
const response = await axios.post(DELIVERY_NODE_BASE_URL + path, obj, {
headers: {
'Content-Type': 'application/json',
},
});
return response;
} catch (error) {
console.error(error.response.data);
throw error.response.data;
}
};

export * from './ipfs';
170 changes: 83 additions & 87 deletions src/config/config-dev.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// environmental configurations for the dapp for different environments
export const config = {
/**
/**
* Push Nodes Environment - can be dev, staging or prod - important to keep one on one connection
*/
pushNodesEnv: 'dev',
/**

/**
* API Calls Related
*/
appEnv: 'dev',
Expand All @@ -14,11 +14,12 @@ export const config = {
apiUrl: 'https://backend-dev.epns.io/apis',
w2wApiUrl: 'https://backend-dev.epns.io/apis',
toolingApiUrl: 'https://tooling.epns.io/apis',
deliveryNodeApiUrl: 'https://delivery-dev.epns.io/apis',

ipfsInfuraAPIKey: process.env.REACT_APP_IPFS_INFURA_API_KEY || '22rfiNb1J645FdehoqbKMpLbF6V',
ipfsInfuraAPISecret: process.env.REACT_APP_IPFS_INFURA_API_SECRET || 'a757597f020425c3ae532e6be84de552',

/**
/**
* Allowed Networks
*/
allowedNetworks: [
Expand All @@ -29,42 +30,41 @@ export const config = {
420, // optimism goerli testnet
1442, // polygon zkevm testnet
421613, // arbitrum testnet
123 // fuse testnet
123, // fuse testnet
],

/**
/**
* Core Network Related Data
*/
coreContractChain: 11155111, //the chain id of the network which the core contract relies on
coreRPC: 'https://sepolia.infura.io/v3/5524d420b29f4f7a8d8d2f582a0d43f7',
mainnetCoreRPC: "https://mainnet.infura.io/v3/4ff53a5254144d988a8318210b56f47a",
coreRPC: 'https://sepolia.infura.io/v3/fffaf09bf68e4c4e8f8c5dcfc9383295',
mainnetCoreRPC: 'https://mainnet.infura.io/v3/4ff53a5254144d988a8318210b56f47a',
mainnetCoreContractChain: 1,
aliasRPC: {
80001: "https://polygon-mumbai.infura.io/v3/150f25623ae64d08ab7ec7dd0c6b6ee9",
97: "https://data-seed-prebsc-1-s1.binance.org:8545",
420: "https://opt-goerli.g.alchemy.com/v2/98vFj7OCg4vbGKvCDpj6pOAMSBVC7rzm",
1442: "https://rpc.public.zkevm-test.net",
421613: "https://goerli-rollup.arbitrum.io/rpc"
80001: 'https://polygon-mumbai.infura.io/v3/150f25623ae64d08ab7ec7dd0c6b6ee9',
97: 'https://data-seed-prebsc-1-s1.binance.org:8545',
420: 'https://opt-goerli.g.alchemy.com/v2/98vFj7OCg4vbGKvCDpj6pOAMSBVC7rzm',
1442: 'https://rpc.public.zkevm-test.net',
421613: 'https://goerli-rollup.arbitrum.io/rpc',
},
infuraApiUrl: 'https:/infura-ipfs.io/ipfs/',

/**
/**
* Analaytics + Firebase
*/
googleAnalyticsId: 'UA-165415629-5',
vapidKey: 'BFRmmAEEXOhk31FIsooph5CxlXKh6N0_NocUWHzvtpoUEvqQTwLXu6XtwkrH7ckyr2CvVz1ll-8q4oo6-ZqFJPY',
vapidKey: 'BJYsH1MYRqzfuzduyHLNaUfZCYdAahcJXsdWzdTqleWox0vOLaycyVPdy_J9XWzSIKvRu0xkwxo75mhDiVJhNnw',
firebaseConfig: {
apiKey: 'AIzaSyClOk4qP0ttFW-BPnXy7WT920xfdXSbFu8',
authDomain: 'epns-internal.firebaseapp.com',
databaseURL: 'https://epns-internal.firebaseio.com',
projectId: 'epns-internal',
storageBucket: 'epns-internal.appspot.com',
messagingSenderId: '755180533582',
appId: '1:755180533582:web:752ff8db31905506b7d01f',
measurementId: 'G-ZJH2T7R9S1',
apiKey: 'AIzaSyB4aXx2pJ9T5sw0Q1bba3jI1EAGp0Z5kBI',
authDomain: 'push-dev-a6a63.firebaseapp.com',
projectId: 'push-dev-a6a63',
storageBucket: 'push-dev-a6a63.appspot.com',
messagingSenderId: '974364469170',
appId: '1:974364469170:web:47fd6304c6cf36b5bfe6ab',
measurementId: 'G-5YR8N35DY4',
},

/**
/**
* External links
*/
links: {
Expand All @@ -73,109 +73,105 @@ export const config = {
extension: 'https://chrome.google.com/webstore/detail/epns-staging-protocol-alp/bjiennpmhdcandkpigcploafccldlakj',
howto: 'https://push.org/docs',
},
}
};

/**
* Smart Contract Related
*/
export const addresses = {
ceaErc20: "0xc1C0472c0C80bCcDC7F5D01A376Bd97a734B8815",
epnscore: "0x5AB1520E2bd519BDab2e1347EEe81C00a77f4946",
epnsEthComm: "0x9dDCD7ed7151afab43044E4D694FA064742C428c",
epnsPolyComm: "0xAf55BE8e6b0d6107891bA76eADeEa032ef8A4504", // the ploygon comm contract
pushToken: "0x37c779a1564DCc0e3914aB130e0e787d93e21804", //address for push token
pushChannelAdmin: "0xfA47d7EaEC85eE8db2cBFF7d18AC407d1A556Dc2",
aDai: "0x31f30d9A5627eAfeC4433Ae2886Cf6cc3D25E772",
epnsToken: "0x37c779a1564DCc0e3914aB130e0e787d93e21804",
epnsLPToken: "0x1f094Bd8c260D0C3fC79157096015990885af4d2",
rockstar: "0x3f8C2152b79276b78315CAF66cCF951780580A8a",
batchMintNFT: "0xCf733D547B9f7F87c1B1f63f45c197C007F8eedf",
NFTRewards: "0xc4708BB6EC3B797344f123126171302e4e3E68E2",
distributor: "0x5B548D33874DeABaC2F683A6E1864795E09932F0",
rockstarV2: "0xA2b885e7065EA59a3251489715ca80DE5Ff642f8", //mainnet address
NFTRewardsV2: "0xdc66567a990B7fa10730459537620857c9e03287", //mainnet address
ceaErc20: '0xc1C0472c0C80bCcDC7F5D01A376Bd97a734B8815',
epnscore: '0x5AB1520E2bd519BDab2e1347EEe81C00a77f4946',
epnsEthComm: '0x9dDCD7ed7151afab43044E4D694FA064742C428c',
epnsPolyComm: '0xAf55BE8e6b0d6107891bA76eADeEa032ef8A4504', // the ploygon comm contract
pushToken: '0x37c779a1564DCc0e3914aB130e0e787d93e21804', //address for push token
pushChannelAdmin: '0xfA47d7EaEC85eE8db2cBFF7d18AC407d1A556Dc2',
aDai: '0x31f30d9A5627eAfeC4433Ae2886Cf6cc3D25E772',
epnsToken: '0x37c779a1564DCc0e3914aB130e0e787d93e21804',
epnsLPToken: '0x1f094Bd8c260D0C3fC79157096015990885af4d2',
rockstar: '0x3f8C2152b79276b78315CAF66cCF951780580A8a',
batchMintNFT: '0xCf733D547B9f7F87c1B1f63f45c197C007F8eedf',
NFTRewards: '0xc4708BB6EC3B797344f123126171302e4e3E68E2',
distributor: '0x5B548D33874DeABaC2F683A6E1864795E09932F0',
rockstarV2: '0xA2b885e7065EA59a3251489715ca80DE5Ff642f8', //mainnet address
NFTRewardsV2: '0xdc66567a990B7fa10730459537620857c9e03287', //mainnet address

//For Yield Farm V1(Deprecated)
staking: "0xAECb9074e222e8F06f8034140A3F86610E4d3c3E", // deprecated staking addresses
depYieldFarmPUSH: "0x6EA019f7FE2640A55154DdC36Bfd21275De388BD", // deprecated YieldFarm Push address
depYieldFarmLP:"0xc2886D0e7DAd16cc92b1156Dc9A0b0D3F047FD15",
staking: '0xAECb9074e222e8F06f8034140A3F86610E4d3c3E', // deprecated staking addresses
depYieldFarmPUSH: '0x6EA019f7FE2640A55154DdC36Bfd21275De388BD', // deprecated YieldFarm Push address
depYieldFarmLP: '0xc2886D0e7DAd16cc92b1156Dc9A0b0D3F047FD15',

pushToken: "0x37c779a1564DCc0e3914aB130e0e787d93e21804",
pushToken: '0x37c779a1564DCc0e3914aB130e0e787d93e21804',

// For Sepolia
pushToken: "0x37c779a1564DCc0e3914aB130e0e787d93e21804",
pushToken: '0x37c779a1564DCc0e3914aB130e0e787d93e21804',
// pushCoreV2: "0x8a965286c0752DFE821868312025091f60BD902A", // 15 min epoch
pushCoreV2: "0x5AB1520E2bd519BDab2e1347EEe81C00a77f4946", //21 days epoch
uniV2LPToken: "0x2333609Cc527a9309Cdad16E0742a3C6DC1C551b",
uniswapV2Router02: "0xC532a74256D3Db42D0Bf7a0400fEFDbad7694008",
WETHAddress: "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9",
USDTAddress: "0x7169D38820dfd117C3FA1f22a697dBA58d90BA06",
pushCoreV2: '0x5AB1520E2bd519BDab2e1347EEe81C00a77f4946', //21 days epoch
uniV2LPToken: '0x2333609Cc527a9309Cdad16E0742a3C6DC1C551b',
uniswapV2Router02: '0xC532a74256D3Db42D0Bf7a0400fEFDbad7694008',
WETHAddress: '0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9',
USDTAddress: '0x7169D38820dfd117C3FA1f22a697dBA58d90BA06',

//For 30 mins epoch
// stakingV2: "0xCa02F3FdF3794aF08CADb98b0E4504261cB8c302",
// yieldFarmLP: "0x22C1dBC8975c23De9e2219C0fC3E03b404577512",

//For 21 days Epoch
stakingV2: "0xFf13FBc1dE7FBF300059FE56495c82bBa2F986c6",
yieldFarmLP: "0xAB531bD9D39c492a05de65Eee85F6C712c05ea0b",



alphaAccessNft: "0x39f77Db4d5d3e85c213233D5Af02C46a85Cf1Db4"
stakingV2: '0xFf13FBc1dE7FBF300059FE56495c82bBa2F986c6',
yieldFarmLP: '0xAB531bD9D39c492a05de65Eee85F6C712c05ea0b',


}
alphaAccessNft: '0x39f77Db4d5d3e85c213233D5Af02C46a85Cf1Db4',
};

export const CHAIN_DETAILS = {
11155111: {
label: "Ethereum Sepolia",
name: "ETH_TEST_SEPOLIA",
label: 'Ethereum Sepolia',
name: 'ETH_TEST_SEPOLIA',
chainId: 11155111,
rpcUrl: "https://sepolia.infura.io/v3/5524d420b29f4f7a8d8d2f582a0d43f7",
commAddress: "0x28709649Dfda9baDEbb61dBF7a8D199cfC8EcF2e",
network: "sepolia",
},
rpcUrl: 'https://sepolia.infura.io/v3/5524d420b29f4f7a8d8d2f582a0d43f7',
commAddress: '0x28709649Dfda9baDEbb61dBF7a8D199cfC8EcF2e',
network: 'sepolia',
},
80001: {
label: "Polygon Mumbai",
name: "POLYGON_TEST_MUMBAI",
label: 'Polygon Mumbai',
name: 'POLYGON_TEST_MUMBAI',
chainId: 80001,
rpcUrl: "https://polygon-mumbai.infura.io/v3/150f25623ae64d08ab7ec7dd0c6b6ee9",
commAddress: "0xAf55BE8e6b0d6107891bA76eADeEa032ef8A4504",
network: "polygon-mumbai",
rpcUrl: 'https://polygon-mumbai.infura.io/v3/150f25623ae64d08ab7ec7dd0c6b6ee9',
commAddress: '0xAf55BE8e6b0d6107891bA76eADeEa032ef8A4504',
network: 'polygon-mumbai',
},
97: {
label: "BNB Testnet",
name: "BNB_TESTNET",
label: 'BNB Testnet',
name: 'BNB_TESTNET',
chainId: 97,
rpcUrl: "https://data-seed-prebsc-1-s1.binance.org:8545",
commAddress: "0x4132061E3349ff36cFfCadA460E10Bd4f31F7ea8"
rpcUrl: 'https://data-seed-prebsc-1-s1.binance.org:8545',
commAddress: '0x4132061E3349ff36cFfCadA460E10Bd4f31F7ea8',
},
420: {
label: "Optimism Goerli",
name: "OPTIMISM_TESTNET",
label: 'Optimism Goerli',
name: 'OPTIMISM_TESTNET',
chainId: 420,
rpcUrl: 'https://opt-goerli.g.alchemy.com/v2/98vFj7OCg4vbGKvCDpj6pOAMSBVC7rzm',
commAddress: '0x4305D572F2bf38Fc2AE8D0172055b1EFd18F57a6'
commAddress: '0x4305D572F2bf38Fc2AE8D0172055b1EFd18F57a6',
},
1442: {
label: "Polygon zkEVM Testnet",
name: "POLYGON_ZK_EVM_TESTNET",
label: 'Polygon zkEVM Testnet',
name: 'POLYGON_ZK_EVM_TESTNET',
chainId: 1442,
rpcUrl: 'https://rpc.public.zkevm-test.net',
commAddress: '0x630b152e4185c63D7177c656b56b26f878C61572'
commAddress: '0x630b152e4185c63D7177c656b56b26f878C61572',
},
421613: {
label: "Arbitrum Testnet",
name: "ARBITRUM_TESTNET",
label: 'Arbitrum Testnet',
name: 'ARBITRUM_TESTNET',
chainId: 421613,
rpcUrl: '',
commAddress: '0x2f6aE0907116A2c50D712e78b48D874fadeB6850'
commAddress: '0x2f6aE0907116A2c50D712e78b48D874fadeB6850',
},
123: {
label: "Fuse Testnet",
name: "FUSE_TESTNET",
label: 'Fuse Testnet',
name: 'FUSE_TESTNET',
chainId: 123,
rpcUrl: 'https://rpc.fusespark.io',
commAddress: '0x7eBb54D86CF928115965DB596a3E600404dD8039'
}
}
commAddress: '0x7eBb54D86CF928115965DB596a3E600404dD8039',
},
};
Loading