Skip to content

Commit

Permalink
[Gateway] : One Gateway for all chains and deployments. (#483)
Browse files Browse the repository at this point in the history
* change:
 - one gateway deployment selector
 - updated icons for all deployments layer
 - setup reducer state update for deployment selection.

* updated sentry with app chain from ui selection

* seting up network state on changing the app chain

* change:
 - reset basedenabled state on switching chain
 - updated ethereum to mainnet
 - add rinkeby and ethereum chains config.
 - updated the getNetwork function to return all chains info.

* change
 - setting up network with redux persitant
 - maintain state in session to avoid reset on reload of page.
 - create network reducer and corresponding setup.

* updated sentry & fix linting issues.

* change:
- icon setup for bobabase
- network type setup with tabs
- representing current network setup correctly.

* change:
- updated network and network type in redux for state persistant
- cleanup setup reducer, action, selector
- import SelectNetwork from networkSelector.
- ChainSwitcher => NetworkSwitcher.
- created Menu Config
- updated menu list component.
- Tabs style change to capitalize.
- move network related const to network.util

* changing layer icons on switching network from networkSwitcher.

* change:
- updated initialize account & base with network, type
- create networkdetails function to fetch details w.r.to. each chain
- created wallet switch
- refactor network service.
- create separate files for each chains.
- cleanup network util
-

* change:
- fix menu listing w.r.to active network.

* bobaexplorer url fix for each network and layer.

* change: selected icons on networkList items along with check

* updated icons for chains and remove unused IconComponent

* fix for import

* persist the earlier layer and connect on the same layer on new network

* remove consoles.

* change:
- Updated config for all network (Mainnet/Testnet) BNB, FANTOM, AVAX, MOONBEAM, ETHEREUM
- Move moonbase to testnet block
- Fix networkSwitcher tab to work based on selected networktype
- cleanup & warning fixes

* change:
- updated network util config
- added support for network l1, l2 names
- bridge page names and logos changes based on selected network.

* udpated icons for boba chains project listing.

* reverted master config change

* change:
- prepare & setup routes with components based on active networks
- disable monster for other networks except ethereum
- optimized way to disable the routes and menu items.
- refactored menu list styling.
- cleanup on layout component.

* console cleanup

* partial: query param based network selection
only ethereum, avax chainId

* change: add chain id's for other fantom, bnb, moonbeam

* moved default values to constant files.

* fix for setting index routes on generated route config.

* add native token symbol and name to l1 config.

* disable bridge page for now from other deployment.

* set network from useNetwork hook only in case of query param.

* [ Gateway ] One gateway sync alt l1 (#497)

* change
 - setting up network with redux persitant
 - maintain state in session to avoid reset on reload of page.
 - create network reducer and corresponding setup.

* updated sentry & fix linting issues.

* setting up address and app service for multi chains

* updated sentry packages.

* decrement sentry package due unexpected errors onbuild

* change:
- supported tokens and addresss moved to app.service
- update initiation of watcher
- removed dead code.

* change:
- enable nft only for ethereum
- updated address for get balance and initialize base invokation for ethereum only.

* change:
- wallet page to be working on all network with bridging.

* Change:
- prepare transaction services  to load the transaction for history page.

* change:
- moved fetchTrasaction to transactionService.
- cleanup fetchExits specific files as it's not used any more.

* fix earn page listing of lp.

* change: remove warning in console.

* fix network names & fix omg watcher axios instance

* change:
- fixes gasSwitcher footer values w.r.to each deployment
- savings will visible for ethereum network only.
- prepare seperate service to fetch gas and verifier status
- fix CrossDomainMessenger watcher / fastWatcher

* emergency swap content update for each deployment.

* update sentry config

* fix: emergency swap deployments
fix: switchFee function calls

* fix: fuacet as component, faucet service
fix: cleanup token component

* referening address from this.addresses instead of allAddresses

* fix: fetch calls only on ETH network
fix: cleanup feeswitcher network.

* updated the file name

* setting up fees for boba

* change: network hash is broken on history page.

* cleanup network service

* One Gateway : Wallet Token Listing Fixes

* L1 to L2 bridging

- setting up history tabs for multichain
- setting up classic input bridge
- updated CrosschainMessenger contract address for other deployment
- fix for classic deposit to l2 validated for goerli (eth / erc20 / native)
- fix for classic deposit to l2 account (eth / erc20 / native)
- fee switcher should only be visible for L2 layer.

* fetch transaction on connect only
* avoid fetching data from etherscan
* adding sushi to BNB network
* updated layerzero testnet adresses
* updated sentry to latest pack
* Added naming for l1 native token on exit

* clean up etherscan fetch call

* removed l1 etherscan url

* fix for devtools

* crash fix for switch chain + labels on history tx list.

* remove console error

* cleanup console

* fetch boba feee choice only incase of L2

* cleanup unused vars.

* masterconfig cleanup with respective import

* - fix for supported alt l1 chains
- cleanup react_app_chain param

* fix: earn page labels, boba chains broken, disable subgraph on goerli.

* fix: loading address only on initAccount phase to fix crash.

* fix: verifier instance if url not found

* wallet page crash fixes.

* invoking functions only when basedEnabled means connected to MM.

* cleanup console

* Added meta token to bnb testnet

* [Gateway] : Gateway Version on footer of the page along with styling fixes (#573)

* [Gateway] Fix: Style fixes component. (#581)

* Auto switching MM network (#605)

* Wavect/mockups: Design alignment (#595)

* change:
 - one gateway deployment selector
 - updated icons for all deployments layer
 - setup reducer state update for deployment selection.

* updated sentry with app chain from ui selection

* seting up network state on changing the app chain

* change:
 - reset basedenabled state on switching chain
 - updated ethereum to mainnet
 - add rinkeby and ethereum chains config.
 - updated the getNetwork function to return all chains info.

* change
 - setting up network with redux persitant
 - maintain state in session to avoid reset on reload of page.
 - create network reducer and corresponding setup.

* updated sentry & fix linting issues.

* change:
- icon setup for bobabase
- network type setup with tabs
- representing current network setup correctly.

* change:
- updated network and network type in redux for state persistant
- cleanup setup reducer, action, selector
- import SelectNetwork from networkSelector.
- ChainSwitcher => NetworkSwitcher.
- created Menu Config
- updated menu list component.
- Tabs style change to capitalize.
- move network related const to network.util

* changing layer icons on switching network from networkSwitcher.

* change:
- updated initialize account & base with network, type
- create networkdetails function to fetch details w.r.to. each chain
- created wallet switch
- refactor network service.
- create separate files for each chains.
- cleanup network util
-

* change:
- fix menu listing w.r.to active network.

* bobaexplorer url fix for each network and layer.

* change: selected icons on networkList items along with check

* updated icons for chains and remove unused IconComponent

* fix for import

* persist the earlier layer and connect on the same layer on new network

* remove consoles.

* change:
- Updated config for all network (Mainnet/Testnet) BNB, FANTOM, AVAX, MOONBEAM, ETHEREUM
- Move moonbase to testnet block
- Fix networkSwitcher tab to work based on selected networktype
- cleanup & warning fixes

* change:
- updated network util config
- added support for network l1, l2 names
- bridge page names and logos changes based on selected network.

* udpated icons for boba chains project listing.

* reverted master config change

* change:
- prepare & setup routes with components based on active networks
- disable monster for other networks except ethereum
- optimized way to disable the routes and menu items.
- refactored menu list styling.
- cleanup on layout component.

* console cleanup

* partial: query param based network selection
only ethereum, avax chainId

* change: add chain id's for other fantom, bnb, moonbeam

* moved default values to constant files.

* fix for setting index routes on generated route config.

* add native token symbol and name to l1 config.

* disable bridge page for now from other deployment.

* set network from useNetwork hook only in case of query param.

* [ Gateway ] One gateway sync alt l1 (#497)

* change
 - setting up network with redux persitant
 - maintain state in session to avoid reset on reload of page.
 - create network reducer and corresponding setup.

* updated sentry & fix linting issues.

* setting up address and app service for multi chains

* updated sentry packages.

* decrement sentry package due unexpected errors onbuild

* change:
- supported tokens and addresss moved to app.service
- update initiation of watcher
- removed dead code.

* change:
- enable nft only for ethereum
- updated address for get balance and initialize base invokation for ethereum only.

* change:
- wallet page to be working on all network with bridging.

* Change:
- prepare transaction services  to load the transaction for history page.

* change:
- moved fetchTrasaction to transactionService.
- cleanup fetchExits specific files as it's not used any more.

* fix earn page listing of lp.

* change: remove warning in console.

* fix network names & fix omg watcher axios instance

* change:
- fixes gasSwitcher footer values w.r.to each deployment
- savings will visible for ethereum network only.
- prepare seperate service to fetch gas and verifier status
- fix CrossDomainMessenger watcher / fastWatcher

* emergency swap content update for each deployment.

* update sentry config

* fix: emergency swap deployments
fix: switchFee function calls

* fix: fuacet as component, faucet service
fix: cleanup token component

* referening address from this.addresses instead of allAddresses

* fix: fetch calls only on ETH network
fix: cleanup feeswitcher network.

* updated the file name

* setting up fees for boba

* change: network hash is broken on history page.

* cleanup network service

* One Gateway : Wallet Token Listing Fixes

* L1 to L2 bridging

- setting up history tabs for multichain
- setting up classic input bridge
- updated CrosschainMessenger contract address for other deployment
- fix for classic deposit to l2 validated for goerli (eth / erc20 / native)
- fix for classic deposit to l2 account (eth / erc20 / native)
- fee switcher should only be visible for L2 layer.

* fetch transaction on connect only
* avoid fetching data from etherscan
* adding sushi to BNB network
* updated layerzero testnet adresses
* updated sentry to latest pack
* Added naming for l1 native token on exit

* clean up etherscan fetch call

* removed l1 etherscan url

* fix for devtools

* crash fix for switch chain + labels on history tx list.

* remove console error

* cleanup console

* fetch boba feee choice only incase of L2

* cleanup unused vars.

* masterconfig cleanup with respective import

* - fix for supported alt l1 chains
- cleanup react_app_chain param

* fix: earn page labels, boba chains broken, disable subgraph on goerli.

* fix: loading address only on initAccount phase to fix crash.

* fix: verifier instance if url not found

* wallet page crash fixes.

* invoking functions only when basedEnabled means connected to MM.

* cleanup console

* Added meta token to bnb testnet

* [Gateway] : Gateway Version on footer of the page along with styling fixes (#573)

* [Gateway] Fix: Style fixes component. (#581)

* redesigned pageHeader(implemented boba icon), some small changes
redesigned colors, margins, overall design on bobaBridge when connected
fixed margins next to the IconSwitcher
redesign bobaBridge 'when not connected'
fixed all "Ethereum" spelling mistakes
redesigned bobaBridge - changed some colors, variants, sizes
align new design (1.02) to footer

* - some changes to the History page to align the design with the overall design of the figma file
- redesigned/reworked the Tooltip Component + changed the tooltip prop in the Button component according to the Tooltip Component,
- some changes to the pageHeader (underlined fee,
- some changes to the index.js (Tooltip style overwrite, tooltip background colors)
- adjusted Social Media Icon hover + fixed Discord Icon hover
- some small adjustments (redesigned Fee, maxWith on Transaction history block)
- redesigned the LayerSwitcher
- redesigned Wallet page when connected including tab colors, connection-part, connect-button
- redesigned Ecosystem page (small changes to some background colors and hover effect)

* fixed some "merge conflict resolving" artifacts

* Fixed: transaction hash is to long, will now be shortened if screen size is below 1920px

* Fixed: "Fee" is shown double & add HelpOutlineIcon again
Fixed: FeeSwitcher should only be visible on L2

* Switched some wordings on the wallet page (disconnect -> disconnected, connecting -> connected) because it makes more sense that way.

* Fixed/changes back to the old user prompt and aligned it to the new figma design as well hide the Token/NFT tabs when not logged in

---------

Co-authored-by: Sahil Kashetwar <[email protected]>
Co-authored-by: Sahil K <[email protected]>
Co-authored-by: Riedl Kevin, Bsc <[email protected]>

* Fix [Gateway] : One gateway bridging (#589)

* invoke get monster and other functions once account initlized

* bridge styling fixes mobile view

* fix: clenaup deposit signature status setup as it's not required
Enable bridge buttons once tx is completed.

* fetch fee choice only in case of L2
fix switching between layers and network.

* cleanup

* reverted the layer switch change

* fix for the fast depositing to l2.

* farm deposit fixes.

* transfer modal button fixes.

* - fix farm deposit modal for l2
- farm withdraw modal button style fix
- transfer nft modal btn style fix
- fix liquidity estimate fn in ns.
- checking for native token balance instead of ETH for fee switching.

- disable unstake and stake more button when layer is different

* - fast desposit clean up.
- listing of native tokens on farm l2.

* - fix min balance for fee switch to native token.

* fix: fetch exit cost function with l2 -> l1 validataion

* L2 -> L1 Bridging fixes for ethereum and other deployments

* add btn variant to cancel modal.

* - layerswitcher cleanup and fix for the click on connect layer on closing mm popup.
- throw error from switch chain.

* fix: crash on earn page on deposit goerli.

* fix: updated min native balance for fee to const with 0.002

* fix: fetch min native token for fee from contract for alt-l1

* fix: farm deposit crash ethereum L2.

* console cleanup

* Automatically switch RPC network in gateway (#616)

* Automatically switch L1 RPC endpoint
* Update variable name

---------

Co-authored-by: Boyuan-Chen <[email protected]>

* fast exit fixes (#619)

* Add wallet service and fix switchChain (#620)

---------

Co-authored-by: Wavect GmbH <[email protected]>
Co-authored-by: Riedl Kevin, Bsc <[email protected]>
Co-authored-by: Boyuan-Chen <[email protected]>
  • Loading branch information
4 people authored Mar 3, 2023
1 parent a159ed3 commit bb3ca48
Show file tree
Hide file tree
Showing 155 changed files with 7,415 additions and 3,784 deletions.
8 changes: 1 addition & 7 deletions ops_boba/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ This folder contains all Boba APIs for the production

This API is used to swap BOBA for a small amount of ETH paying a zero gas fee

## Service API

#### - `get.wallet.version`

This API returns the gateway version

## Token API

#### - `get.supply`
Expand Down Expand Up @@ -72,4 +66,4 @@ This folder contains all Boba APIs for the production

#### - ` get.l2.pendingexits`

This API returns all pending exits
This API returns all pending exits
33 changes: 0 additions & 33 deletions ops_boba/api/service-api/serverless.yml

This file was deleted.

19 changes: 0 additions & 19 deletions ops_boba/api/service-api/webwallet_version.py

This file was deleted.

1 change: 0 additions & 1 deletion packages/boba/gateway/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ REACT_APP_GAS_POLL_INTERVAL=30000
SKIP_PREFLIGHT_CHECK=true
REACT_APP_WALLET_VERSION=1.0.10
REACT_APP_ENV=dev
REACT_APP_CHAIN=mainnet
REACT_APP_STATUS=normal
REACT_APP_SPEED_CHECK=
REACT_APP_GA4_MEASUREMENT_ID=
Expand Down
11 changes: 6 additions & 5 deletions packages/boba/gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"buildenv-prod": "NODE_ENV=production react-env --dest build",
"get_artifacts": "./scripts/get_all_artifacts.sh",
"serve": "npm run buildenv-prod && serve -s build -l 3000 -c public/serve.json",
"start": "npm run buildenv-dev && react-scripts start",
"build:prod": "GENERATE_SOURCEMAP=false REACT_APP_ENV=prod react-scripts build",
"build:dev": "GENERATE_SOURCEMAP=false REACT_APP_ENV=dev react-scripts build",
"start": "npm run buildenv-dev && REACT_APP_WALLET_VERSION=$npm_package_version react-scripts start",
"build:prod": "GENERATE_SOURCEMAP=false REACT_APP_WALLET_VERSION=$npm_package_version REACT_APP_ENV=prod react-scripts build",
"build:dev": "GENERATE_SOURCEMAP=false REACT_APP_WALLET_VERSION=$npm_package_version REACT_APP_ENV=dev react-scripts build",
"audit-check": "audit-ci --moderate",
"postinstall": "patch-package",
"deploy:mainnet": "GENERATE_SOURCEMAP=false REACT_APP_ENV=prod react-scripts build && aws s3 rm s3://boba-gateway --recursive && aws s3 sync build s3://boba-gateway && aws s3 cp s3://boba-gateway/index.html s3://boba-gateway/index.html --metadata-directive REPLACE --cache-control max-age=0 --content-type text/html",
"deploy:goerli": "GENERATE_SOURCEMAP=false REACT_APP_ENV=prod REACT_APP_CHAIN=goerli react-scripts build && aws s3 rm s3://ethereum-testnet-gateway-gatewaybucket-jn968xk15skr --recursive && aws s3 sync build s3://ethereum-testnet-gateway-gatewaybucket-jn968xk15skr && aws s3 cp s3://ethereum-testnet-gateway-gatewaybucket-jn968xk15skr/index.html s3://ethereum-testnet-gateway-gatewaybucket-jn968xk15skr/index.html --metadata-directive REPLACE --cache-control max-age=0 --content-type text/html"
"deploy:mainnet": "GENERATE_SOURCEMAP=false REACT_APP_WALLET_VERSION=$npm_package_version REACT_APP_ENV=prod react-scripts build && aws s3 rm s3://boba-gateway --recursive && aws s3 sync build s3://boba-gateway && aws s3 cp s3://boba-gateway/index.html s3://boba-gateway/index.html --metadata-directive REPLACE --cache-control max-age=0 --content-type text/html",
"deploy:goerli": "GENERATE_SOURCEMAP=false REACT_APP_WALLET_VERSION=$npm_package_version REACT_APP_ENV=prod REACT_APP_CHAIN=goerli react-scripts build && aws s3 rm s3://ethereum-testnet-gateway-gatewaybucket-jn968xk15skr --recursive && aws s3 sync build s3://ethereum-testnet-gateway-gatewaybucket-jn968xk15skr && aws s3 cp s3://ethereum-testnet-gateway-gatewaybucket-jn968xk15skr/index.html s3://ethereum-testnet-gateway-gatewaybucket-jn968xk15skr/index.html --metadata-directive REPLACE --cache-control max-age=0 --content-type text/html"
},
"dependencies": {
"@apollo/client": "^3.5.10",
Expand Down Expand Up @@ -57,6 +57,7 @@
"react-zendesk": "^0.1.13",
"recharts": "^2.1.10",
"redux": "^4.1.2",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"sass": "^1.51.0",
"serve": "^11.3.2",
Expand Down
1 change: 0 additions & 1 deletion packages/boba/gateway/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ gateway.boba.betwork.
| SKIP_PREFLIGHT_CHECK | N/A | N/A | N/A |
| REACT_APP_WALLET_VERSION | Yes | N/A | This will be useful while prepare the build. |
| REACT_APP_ENV | Yes | dev | This will be used in case of sentry configuration. |
| REACT_APP_CHAIN | Yes | mainnet | Chain where we want to connect the app to like goerli, mainnet |
| REACT_APP_STATUS | NO | N/A | To notify the status about any maintainance activity going on. |
| REACT_APP_SPEED_CHECK | | | |
| REACT_APP_GA4_MEASUREMENT_ID | Yes | N/A | Google analytics api key |
Expand Down
5 changes: 2 additions & 3 deletions packages/boba/gateway/src/actions/farmAction.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Varna - A Privacy-Preserving Marketplace
Varna uses Fully Homomorphic Encryption to make markets fair.
Varna uses Fully Homomorphic Encryption to make markets fair.
Copyright (C) 2021 Enya Inc. Palo Alto, CA
This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -48,7 +48,6 @@ const getFarmInfoSuccess = (L1PoolInfo, L1UserInfo, L2PoolInfo, L2UserInfo) => (
// })

export const getFarmInfo = () => async (dispatch) => {
console.log("getFarmInfo()")
dispatch(getFarmInfoBegin())
const [L1LPInfo, L2LPInfo] = await Promise.all([
networkService.getL1LPInfo(),
Expand Down Expand Up @@ -122,4 +121,4 @@ export function fetchL1LPBalance(currency) {

export function fetchL2LPBalance(currency) {
return createAction('FETCH/L2LPBALANCE', () => networkService.L2LPBalance(currency))
}
}
33 changes: 26 additions & 7 deletions packages/boba/gateway/src/actions/networkAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,26 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */

import gasService from 'services/gas.service'
import networkService from 'services/networkService'
import transctionService from 'services/transaction.service'
import { createAction } from './createAction'

export function fetchBalances() {
return createAction('BALANCE/GET', () => networkService.getBalances())
}

export function fetchGas() {
return createAction('GAS/GET', () => networkService.getGas())
return createAction('GAS/GET', () => gasService.getGas())
}

export function addTokenList() {
console.log("addTokenList")
return createAction('TOKENLIST/GET', () => networkService.addTokenList())
}

export function fetchTransactions() {
return createAction('TRANSACTION/GETALL', () =>
networkService.getTransactions()
transctionService.getTransactions()
)
}

Expand All @@ -47,10 +48,6 @@ export function fetchFastExits() {
)
}

export function fetchExits() {
return createAction('EXIT/GETALL', () => networkService.getExits())
}

export function exitBOBA(token, value) {
return createAction('EXIT/CREATE', () =>
networkService.exitBOBA(token, value)
Expand Down Expand Up @@ -243,3 +240,25 @@ export function enableBrowserWallet(network) {
export function getAllAddresses() {
return createAction('GET/ALL/ADDRESS', () => networkService.getAllAddresses())
}


/********************************/
/******ONE GATEWAY ACTIONS *****/
/********************************/
/**
* @params
* network - ethereum, bnb, fantom, avax, moonbase, moonbeam
* networkType - MAINNET, TESTNET
*/
export function setNetwork(payload) {
return function (dispatch) {
return dispatch({ type: 'NETWORK/SET', payload: payload })
}
}

// to update the active network.
export function setActiveNetwork(payload) {
return function (dispatch) {
return dispatch({ type: 'NETWORK/SET/ACTIVE' })
}
}
18 changes: 0 additions & 18 deletions packages/boba/gateway/src/actions/serviceAction.js

This file was deleted.

6 changes: 0 additions & 6 deletions packages/boba/gateway/src/actions/setupAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ export function setBaseState(enabled) {
}
}

export function setNetwork(network) {
return function (dispatch) {
return dispatch({ type: 'SETUP/NETWORK/SET', payload: network })
}
}

export function setLayer(layer) {
return function (dispatch) {
return dispatch({ type: 'SETUP/LAYER/SET', payload: layer })
Expand Down
4 changes: 0 additions & 4 deletions packages/boba/gateway/src/actions/signAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,3 @@ export async function updateSignatureStatus_exitTRAD ( sigStatus ) {
export async function updateSignatureStatus_depositLP ( sigStatus ) {
store.dispatch({type: 'DEPOSIT/LP/SIGNED',payload: sigStatus})
}

export async function updateSignatureStatus_depositTRAD ( sigStatus ) {
store.dispatch({type: 'DEPOSIT/TRAD/SIGNED',payload: sigStatus})
}
4 changes: 2 additions & 2 deletions packages/boba/gateway/src/actions/verifierAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */

import networkService from 'services/networkService'
import verifierService from 'services/verifier.service'
import { createAction } from './createAction'

export function fetchVerifierStatus() {
return createAction('VERIFIER/GET', () => networkService.fetchVerifierStatus())
return createAction('VERIFIER/GET', () => verifierService.getVerifierStatus())
}
19 changes: 0 additions & 19 deletions packages/boba/gateway/src/api/buyerAxios.js

This file was deleted.

22 changes: 5 additions & 17 deletions packages/boba/gateway/src/api/metaTransactionAxios.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
import axios from 'axios'
import { getBaseServices } from 'util/masterConfig'

export default function metaTransactionAxiosInstance(networkGateway){
export default function metaTransactionAxiosInstance(networkConfig) {
const url = networkConfig['META_TRANSACTION']

let axiosInstance = null;

if(networkGateway === 'local') {
return null //does not make sense on local
}
else if (networkGateway === 'goerli') {
axiosInstance = axios.create({
baseURL: getBaseServices().GOERLI_META_TRANSACTION,
})
}
else if (networkGateway === 'mainnet') {
axiosInstance = axios.create({
baseURL: getBaseServices().MAINNET_META_TRANSACTION,
})
}
let axiosInstance = axios.create({
baseURL: url,
})

axiosInstance.interceptors.request.use((config) => {
config.headers['Accept'] = 'application/json'
Expand Down
30 changes: 7 additions & 23 deletions packages/boba/gateway/src/api/omgxWatcherAxios.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
import axios from 'axios'
import { getNetwork } from 'util/masterConfig'
const nw = getNetwork()

export default function omgxWatcherAxiosInstance(networkGateway){
export default function omgxWatcherAxiosInstance(networkConfig) {
const watcherUrl = networkConfig[ 'OMGX_WATCHER_URL' ]

let axiosInstance = null

if(networkGateway === 'local') {
return null //does not make sense on local
}
else if (networkGateway === 'goerli') {
if(nw.goerli.OMGX_WATCHER_URL === null) return
axiosInstance = axios.create({
baseURL: nw.goerli.OMGX_WATCHER_URL,
})
}
else if (networkGateway === 'mainnet') {

if(nw.mainnet.OMGX_WATCHER_URL === null) return
axiosInstance = axios.create({
baseURL: nw.mainnet.OMGX_WATCHER_URL,
})
}
let axiosInstance = axios.create({
baseURL: watcherUrl,
})

axiosInstance.interceptors.request.use((config) => {
config.headers['Accept'] = 'application/json'
config.headers['Content-Type'] = 'application/json'
config.headers[ 'Accept' ] = 'application/json'
config.headers[ 'Content-Type' ] = 'application/json'
return config
})

Expand Down
14 changes: 0 additions & 14 deletions packages/boba/gateway/src/api/sellerAxios.js

This file was deleted.

14 changes: 0 additions & 14 deletions packages/boba/gateway/src/api/serviceAxios.js

This file was deleted.

Loading

0 comments on commit bb3ca48

Please sign in to comment.