Skip to content

Commit

Permalink
Bump sdk to v1.7.4-rc.3
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0neerpat committed Jul 22, 2024
1 parent 041f7c6 commit a6216d0
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 46 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@ethersproject/address": "^5.0.10",
"@ethersproject/experimental": "5.4.0",
"@ethersproject/providers": "5.4.5",
"@opendollar/sdk": "1.7.4-rc.2",
"@opendollar/sdk": "1.7.4-rc.3",
"@opendollar/svg-generator": "1.0.5",
"@react-spring/web": "^9.7.3",
"@sentry/cli": "^2.31.0",
Expand Down
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
script-src 'self' blob: https://kb.wowto.ai https://app.wowto.ai http://cdn.matomo.cloud/usekeyp.matomo.cloud/matomo.js https://cdn.matomo.cloud/usekeyp.matomo.cloud/matomo.js https://cdn.matomo.cloud/matomo.js https://usekeyp.matomo.cloud/matomo.js;
media-src 'self';
img-src 'self' data: blob: https://explorer-api.walletconnect.com https://usekeyp.matomo.cloud https://app.opendollar.com;
connect-src 'self' blob: https://eth-pokt.nodies.app http://localhost:3000 https://*.quiknode.pro https://api.opensea.io https://api.fuul.xyz https://api.camelot.exchange https://opt-mainnet.g.alchemy.com https://arb-mainnet.g.alchemy.com https://mainnet.optimism.io/ https://eth.llamarpc.com https://base.llamarpc.com https://polygon-bor-rpc.publicnode.com https://eth-pokt.nodies.app https://polygon-pokt.nodies.app https://op-pokt.nodies.app https://arb-pokt.nodies.app https://holy-damp-firefly.arbitrum-mainnet.quiknode.pro https://api.studio.thegraph.com https://od-subgraph-node-image.onrender.com https://usekeyp.matomo.cloud https://o1016103.ingest.us.sentry.io/api/4507153379295232/envelope/ https://o1016103.ingest.us.sentry.io/api/4507153379295232/security/ https://arbitrum-sepolia.infura.io https://arbitrum-sepolia.blockpi.network/v1/rpc/public https://arbitrum.blockpi.network/v1/rpc/public https://optimism.blockpi.network wss://relay.walletconnect.com/ https://verify.walletconnect.org wss://www.walletlink.org/rpc https://explorer-api.walletconnect.com https://chain-proxy.wallet.coinbase.com https://rpc.walletconnect.com https://bot.opendollar.com https://bot.dev.opendollar.com https://subgraph.reflexer.finance/subgraphs/name/reflexer-labs/rai https://api.country.is/ ;
connect-src 'self' blob: https://virtual.arbitrum.rpc.tenderly.co https://eth-pokt.nodies.app http://localhost:3000 https://*.quiknode.pro https://api.opensea.io https://api.fuul.xyz https://api.camelot.exchange https://opt-mainnet.g.alchemy.com https://arb-mainnet.g.alchemy.com https://mainnet.optimism.io/ https://eth.llamarpc.com https://base.llamarpc.com https://polygon-bor-rpc.publicnode.com https://eth-pokt.nodies.app https://polygon-pokt.nodies.app https://op-pokt.nodies.app https://arb-pokt.nodies.app https://holy-damp-firefly.arbitrum-mainnet.quiknode.pro https://api.studio.thegraph.com https://od-subgraph-node-image.onrender.com https://usekeyp.matomo.cloud https://o1016103.ingest.us.sentry.io/api/4507153379295232/envelope/ https://o1016103.ingest.us.sentry.io/api/4507153379295232/security/ https://arbitrum-sepolia.infura.io https://arbitrum-sepolia.blockpi.network/v1/rpc/public https://arbitrum.blockpi.network/v1/rpc/public https://optimism.blockpi.network wss://relay.walletconnect.com/ https://verify.walletconnect.org wss://www.walletlink.org/rpc https://explorer-api.walletconnect.com https://chain-proxy.wallet.coinbase.com https://rpc.walletconnect.com https://bot.opendollar.com https://bot.dev.opendollar.com https://subgraph.reflexer.finance/subgraphs/name/reflexer-labs/rai https://api.country.is/ ;
object-src 'self' blob:;
form-action 'self';
font-src 'self' data: https://fonts.gstatic.com;
Expand Down Expand Up @@ -61,7 +61,7 @@
<script src="./tracking.js"></script>
<script src="https://usekeyp.matomo.cloud/matomo.js"></script>
<!-- End Matomo Code -->
<script type="text/javascript" src="https://kb.wowto.ai/widgets/M4cmuZpuJqb/widget.js" async defer></script>
<!-- <script type="text/javascript" src="https://kb.wowto.ai/widgets/M4cmuZpuJqb/widget.js" async defer></script> -->
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
11 changes: 11 additions & 0 deletions src/assets/grt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ETH: AddEthereumChainParameter['nativeCurrency'] = {
export const RPC_URL_ETHEREUM = process.env.REACT_APP_RPC_URL_ETHEREUM
? process.env.REACT_APP_RPC_URL_ETHEREUM
: 'https://eth.llamarpc.com'
export const RPC_URL_ARBITRUM = 'https://arbitrum.blockpi.network/v1/rpc/public'
export const RPC_URL_ARBITRUM = RPC_URL || 'https://arbitrum.blockpi.network/v1/rpc/public'
export const RPC_URL_OPTIMISM = 'https://op-pokt.nodies.app'
export const RPC_URL_POLYGON = 'https://polygon-bor-rpc.publicnode.com'
export const RPC_URL_BASE = 'https://base.llamarpc.com'
Expand Down
40 changes: 20 additions & 20 deletions src/containers/Vaults/CreateVault.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,22 +229,22 @@ const CreateVault = ({
connectWalletActions.setIsStepLoading(false)
}

useEffect(() => {
if (!account || !provider || !selectedCollateral) return
const checkNeedsBridge = async () => {
setNeedsBridge(
await checkUserHasBalance(selectedCollateral.address, account, provider, parsedAmounts.leftInput)
)
}
checkNeedsBridge()
}, [account, provider, selectedCollateral, parsedAmounts.leftInput])

const setBridge = (reason: string) => {
bridgeModelActions.setReason(reason)
bridgeModelActions.setFromTokenSymbol(selectedCollateral?.symbol)
bridgeModelActions.setToTokenAddress(selectedCollateral?.address)
navigate('/bridge')
}
// useEffect(() => {
// if (!account || !provider || !selectedCollateral) return
// const checkNeedsBridge = async () => {
// setNeedsBridge(
// await checkUserHasBalance(selectedCollateral.address, account, provider, parsedAmounts.leftInput)
// )
// }
// checkNeedsBridge()
// }, [account, provider, selectedCollateral, parsedAmounts.leftInput])

// const setBridge = (reason: string) => {
// bridgeModelActions.setReason(reason)
// bridgeModelActions.setFromTokenSymbol(selectedCollateral?.symbol)
// bridgeModelActions.setToTokenAddress(selectedCollateral?.address)
// navigate('/bridge')
// }

return (
<>
Expand Down Expand Up @@ -298,7 +298,7 @@ const CreateVault = ({
</WrapBtn>
</WrapBox>
)}
{needsBridge && !parsedAmounts.leftInput && (
{/* {needsBridge && !parsedAmounts.leftInput && (
<BridgeLabel>
{`Insufficient funds. Move assets to Arbitrum using the `}
<BridgeButton
Expand All @@ -311,7 +311,7 @@ const CreateVault = ({
Bridge
</BridgeButton>
</BridgeLabel>
)}
)} */}
</DropDownContainer>

<Inputs>
Expand All @@ -336,7 +336,7 @@ const CreateVault = ({
data_test_id="deposit_borrow"
decimals={Number(selectedCollateralDecimals)}
/>
{needsBridge && parsedAmounts.leftInput && (
{/* {needsBridge && parsedAmounts.leftInput && (
<BridgeLabel>
{`Insufficient funds. Move assets to Arbitrum using the `}
<BridgeButton
Expand All @@ -349,7 +349,7 @@ const CreateVault = ({
Bridge
</BridgeButton>
</BridgeLabel>
)}
)} */}
<br />
<TokenInput
token={
Expand Down
34 changes: 17 additions & 17 deletions src/containers/Vaults/ModifyVault.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ const ModifyVault = ({ isDeposit, isOwner, vaultId }: { isDeposit: boolean; isOw
true,
parsedAmounts.rightInput === availableHai && availableHai !== '0'
)
useEffect(() => {
if (!account || !provider || !singleSafe?.collateralName || !chainId || !bridgeTokens[chainId]) return
const token = bridgeTokens[chainId].tokens.find((token: any) => token.name === singleSafe?.collateralName)
const checkNeedsBridge = async () => {
setNeedsBridge(await checkUserHasBalance(token.address, account, provider, parsedAmounts.leftInput))
}
checkNeedsBridge()
}, [account, provider, chainId, singleSafe?.collateralName, parsedAmounts.leftInput])
// useEffect(() => {
// if (!account || !provider || !singleSafe?.collateralName || !chainId || !bridgeTokens[chainId]) return
// const token = bridgeTokens[chainId].tokens.find((token: any) => token.name === singleSafe?.collateralName)
// const checkNeedsBridge = async () => {
// setNeedsBridge(await checkUserHasBalance(token.address, account, provider, parsedAmounts.leftInput))
// }
// checkNeedsBridge()
// }, [account, provider, chainId, singleSafe?.collateralName, parsedAmounts.leftInput])

const onMaxLeftInput = () => {
if (isDeposit) {
Expand Down Expand Up @@ -250,12 +250,12 @@ const ModifyVault = ({ isDeposit, isOwner, vaultId }: { isDeposit: boolean; isOw
}
}

const setBridge = (reason: string) => {
if (!singleSafe) return
bridgeModelActions.setReason(reason)
bridgeModelActions.setFromTokenSymbol(singleSafe?.collateralName)
navigate('/bridge')
}
// const setBridge = (reason: string) => {
// if (!singleSafe) return
// bridgeModelActions.setReason(reason)
// bridgeModelActions.setFromTokenSymbol(singleSafe?.collateralName)
// navigate('/bridge')
// }

return (
<>
Expand Down Expand Up @@ -412,7 +412,7 @@ const ModifyVault = ({ isDeposit, isOwner, vaultId }: { isDeposit: boolean; isOw

{error && (leftInput || rightInput) && (
<ErrorContainer>
{needsBridge && parsedAmounts.leftInput && (
{/* {needsBridge && parsedAmounts.leftInput && (
<BridgeLabel>
{`Insufficient funds. Move assets to Arbitrum using the `}
<BridgeButton
Expand All @@ -425,8 +425,8 @@ const ModifyVault = ({ isDeposit, isOwner, vaultId }: { isDeposit: boolean; isOw
Bridge
</BridgeButton>
</BridgeLabel>
)}
{!needsBridge && (leftInput || rightInput) && <p>Error: {error}</p>}
)} */}
{(leftInput || rightInput) && <p>Error: {error}</p>}
</ErrorContainer>
)}
</Row>
Expand Down
5 changes: 5 additions & 0 deletions src/utils/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import WETH from '../assets/eth.svg'
import OP from '../assets/op-img.svg'
import OD from '../assets/od-token.svg'
import ODG from '../assets/odg-token.svg'
import GRT from '../assets/grt.svg'

import WSTETH from '../assets/wsteth.svg'
import CBETH from '../assets/cbETH.svg'
import RETH from '../assets/rETH.svg'
Expand Down Expand Up @@ -36,6 +38,8 @@ const importTokenIcon = (tokenName: string) => {
return MAGIC
case 'PUFETH':
return PUFETH
case 'GRT':
return GRT
default:
return require('../assets/unknown-token.svg').default
}
Expand All @@ -62,6 +66,7 @@ export const TOKEN_LOGOS: { [key: string]: string } = {
ARB: importTokenIcon('ARB'),
MAGIC: importTokenIcon('MAGIC'),
PUFETH: importTokenIcon('PUFETH'),
GRT: importTokenIcon('GRT'),
ETH: importTokenIcon('WETH'),
}

Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3695,15 +3695,15 @@ __metadata:
languageName: node
linkType: hard

"@opendollar/sdk@npm:1.7.4-rc.2":
version: 1.7.4-rc.2
resolution: "@opendollar/sdk@npm:1.7.4-rc.2"
"@opendollar/sdk@npm:1.7.4-rc.3":
version: 1.7.4-rc.3
resolution: "@opendollar/sdk@npm:1.7.4-rc.3"
dependencies:
"@opendollar/abis": 0.0.0-605371bd
ethers: 5.4.7
peerDependencies:
utf-8-validate: ^5.0.2
checksum: f589ecf8c9e86fcf920841bb9ec142c59e482f6afb44c4140e63d982f9cc9638c7e5a84efea39d6000a3be5fe6ff9bddf3bef522d6fb1d755ff32c68d5f81fe0
checksum: 8ed9174b048af9d688f1160ecc470c929da2874f0f4f6624f703cafde7b298914996afa0e0fb10f4dcbe0f9d2dd507db441278a7fa24c190c336cdc92c763bf8
languageName: node
linkType: hard

Expand Down Expand Up @@ -15006,7 +15006,7 @@ __metadata:
"@ethersproject/address": ^5.0.10
"@ethersproject/experimental": 5.4.0
"@ethersproject/providers": 5.4.5
"@opendollar/sdk": 1.7.4-rc.2
"@opendollar/sdk": 1.7.4-rc.3
"@opendollar/svg-generator": 1.0.5
"@react-spring/web": ^9.7.3
"@sentry/cli": ^2.31.0
Expand Down

0 comments on commit a6216d0

Please sign in to comment.