From f633b5d5a37508822f42b273280eabae866373c1 Mon Sep 17 00:00:00 2001 From: shmuel Date: Sun, 19 Dec 2021 10:24:19 +0200 Subject: [PATCH 01/14] txt change --- src/containers/FarmInfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/FarmInfo.js b/src/containers/FarmInfo.js index 001455a..defc7dc 100644 --- a/src/containers/FarmInfo.js +++ b/src/containers/FarmInfo.js @@ -207,7 +207,7 @@ class FarmInfo extends Component { - Information for B.Protocol users for <a target="_blank" href="https://docs.bprotocol.org/info/liquidity-mining">BIP #4</a><br/> (18th September - 17th December)<br/> + Information for B.Protocol users for <a target="_blank" href="https://docs.bprotocol.org/info/liquidity-mining">BIP #4</a><br/> (18th September - 20th December)<br/> Current TVL ${tvl}M <br/> From be6656235353fad4dc2faf8f35e62ec8846c1fc9 Mon Sep 17 00:00:00 2001 From: shmuel <shmuel@shmuels-MacBook-Pro.local> Date: Mon, 27 Dec 2021 19:20:39 +0200 Subject: [PATCH 02/14] fixed terms and conditions --- src/components/modals/BproClaimModal.js | 3 ++- src/components/modals/TermsAndConditionsModal.js | 6 ++---- src/stores/user.store.js | 5 +++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/modals/BproClaimModal.js b/src/components/modals/BproClaimModal.js index ce9ab0f..604f494 100644 --- a/src/components/modals/BproClaimModal.js +++ b/src/components/modals/BproClaimModal.js @@ -14,6 +14,7 @@ import XIcon from "../../assets/red-x-icon.svg" import TermsAndConditionsModal from "./TermsAndConditionsModal" import AnimateNumericalString from "../../components/style-components/AnimateNumericalString" import {stringToFixed} from '../../lib/Utils' +import userStore from "../../stores/user.store" const Container = styled.div` @@ -177,7 +178,7 @@ class BproClaimModal extends Component { const {actionState} = this.state const claimed = actionState == "done" const balance = stringToFixed(totalBproNotInWallet, 9) - const agreed = bproStore.userAgreesToTerms + const agreed = userStore.userAgreesToTerms const disabled = claimable == "0" return ( <Container> diff --git a/src/components/modals/TermsAndConditionsModal.js b/src/components/modals/TermsAndConditionsModal.js index 0b003e1..7facc40 100644 --- a/src/components/modals/TermsAndConditionsModal.js +++ b/src/components/modals/TermsAndConditionsModal.js @@ -10,7 +10,7 @@ import {device} from "../../screenSizes" import LoadingRing from "../LoadingRing" import BpLoader from "../../components/style-components/BpLoader" import VIcon from "../../assets/v-icon.svg" -import bproStore, {uBproStore} from "../../stores/bpro.store" +import userStore from "../../stores/user.store" import TermsAndConditionsContent from "./TermsAndConditionContent" import BproClaimModal from "./BproClaimModal" @@ -102,9 +102,7 @@ class TermsAndConditionsModal extends Component { } iAgree = () => { - // todo: - bproStore.iAgree() - uBproStore.iAgree() + userStore.iAgree() const noWrapper = true EventBus.$emit('show-modal', <BproClaimModal {...this.props}/>, noWrapper); } diff --git a/src/stores/user.store.js b/src/stores/user.store.js index 4e50b30..81d0a40 100644 --- a/src/stores/user.store.js +++ b/src/stores/user.store.js @@ -26,6 +26,11 @@ class UserStore { walletType = null provider connecting = false + userAgreesToTerms = false + + iAgree = () => { + this.userAgreesToTerms = true + } constructor (){ makeAutoObservable(this) From 5c43dbed24911cb6446c6ebd6b3ce962ac428638 Mon Sep 17 00:00:00 2001 From: shmuel <shmuel@shmuels-MacBook-Pro.local> Date: Mon, 27 Dec 2021 20:45:01 +0200 Subject: [PATCH 03/14] fixed calim u-BPRO BIP4 --- src/containers/FarmInfo.js | 20 +++++++++----------- src/stores/bpro.store.js | 16 +++++++--------- src/stores/insta.store.js | 16 ++++++---------- src/stores/user.store.js | 8 ++++---- 4 files changed, 26 insertions(+), 34 deletions(-) diff --git a/src/containers/FarmInfo.js b/src/containers/FarmInfo.js index 3b5b5ee..d77dee8 100644 --- a/src/containers/FarmInfo.js +++ b/src/containers/FarmInfo.js @@ -14,7 +14,7 @@ import mainStore from "../stores/main.store" import mainCompStore from "../stores/main.comp.store" import liquityStore from "../stores/main.liquity.store" import userStore from "../stores/user.store" -import instaStore, {bproInstaStores} from "../stores/insta.store" +import instaStore from "../stores/insta.store" import BproClaimModal from "../components/modals/BproClaimModal" import EventBus from "../lib/EventBus" import ConnectButton from "../components/ConnectButton"; @@ -111,11 +111,11 @@ export const Cell = styled(Text)` } ` -export const ANS = props => { +export const ANS = observer((props) => { return ( <AnimateNumericalString val={props.val} decimals={props.decimal || 3}> </AnimateNumericalString> ) -} +}) export const Button = styled.div` transition: all 0.3s ease-in-out; @@ -181,9 +181,7 @@ class FarmInfo extends Component { const { tvlUsdNumeric: makerTvl } = mainStore const { liquityTvlNumeric: liquityTvl, othersTvlNumeric } = liquityStore const tvl = parseInt((compTvl + makerTvl + liquityTvl + othersTvlNumeric) / 1000000) - const instaAccount = instaStore.accounts[0] - const instaBproStore = bproInstaStores[instaAccount] - + if(params.inIframe){ return ( <Container> @@ -236,26 +234,26 @@ class FarmInfo extends Component { </Flex> </ContentBox> </div> - <div> + {Object.entries(instaStore.bproInstaStores).map(([account, store]) => <div> <Title> - INSTADAPP account {instaAccount} + INSTADAPP account {account} Claimable uBPRO-BIP4 - + - - + )}
<a target="_blank" href="https://forum.bprotocol.org/t/bip-1-bpro-tokenomics-change-reward-liquidity-providers-on-sushiswap-and-uniswap/82"> diff --git a/src/stores/bpro.store.js b/src/stores/bpro.store.js index a5fac9f..09a0192 100644 --- a/src/stores/bpro.store.js +++ b/src/stores/bpro.store.js @@ -17,7 +17,6 @@ const {toBN, toWei, fromWei} = Web3.utils export class BproStore { - userAgreesToTerms = false smartContractScore = null claimed = "0" claimable = "0" @@ -41,12 +40,11 @@ export class BproStore { this.bproType = type this.instaUser = instaUser makeAutoObservable(this) - this.init() } onUserConnect = async () => { try{ - await !this.smartContractScore ? this.init() : Promise.resolve(this.smartContractScore) + await this.init() await Promise.all([ this.getClaimableAmount(), this.getUnclaimableAmount(), @@ -80,7 +78,7 @@ export class BproStore { let {user, web3} = userStore user = this.instaUser || user const claimed = await getClaimedAmount(web3, user, this.bproType) - + console.log(claimed) const {amount} = this.smartContractScore.userData[user.toLowerCase()] || {} if(amount){ @@ -128,29 +126,29 @@ export class BproStore { user = this.instaUser || user const {cycle, index, amount, proof} = this.smartContractScore.userData[user.toLowerCase()] const tx = claimBpro(web3, user, cycle, index.toString(), amount, proof, this.bproType) - await ApiAction(tx, user, web3, 0) + await ApiAction(tx, userStore.user, web3, 0) await this.onUserConnect() // refresh state } init = async () => { let url try{ + if(this.smartContractScore && this.smartContractScore.userData){ + return Promise.resolve(this.smartContractScore) + } const web3 = new Web3(BP_API) // todo fetch data const {contentHash} = await getBproDistribution(web3, this.bproType) url = "https://cloudflare-ipfs.com/ipfs/" + contentHash const res = await fetch(url) this.smartContractScore = await res.json() + return this.smartContractScore } catch (err) { console.error("failed to fetch score data from: ", url) console.error(err) } } - iAgree = () => { - this.userAgreesToTerms = true - } - showClaimBproPopup = () => { if(!userStore.loggedIn){ userStore.showConnect() diff --git a/src/stores/insta.store.js b/src/stores/insta.store.js index 345456d..3d4c56c 100644 --- a/src/stores/insta.store.js +++ b/src/stores/insta.store.js @@ -7,10 +7,8 @@ import userStore from "./user.store" import { BproStore } from './bpro.store' import { ApyStore } from './apy.store' -export const bproInstaStores = {} - class InstaStore { - accounts = [] + bproInstaStores = {} constructor (){ makeAutoObservable(this) @@ -28,14 +26,12 @@ class InstaStore { const { web3, networkType, user } = userStore const accounts = await getAccounts(web3, networkType, user) accounts.forEach(account => { - bproInstaStores[account] = new BproStore('uBPRO-BIP4', account) - bproInstaStores[account].onUserConnect() - }) - runInAction(()=> { - this.accounts = accounts + const store = new BproStore('uBPRO-BIP4', account) + store.onUserConnect() + this.bproInstaStores[account] = store }) } - -} +} + export default new InstaStore() \ No newline at end of file diff --git a/src/stores/user.store.js b/src/stores/user.store.js index 81d0a40..f6b4cbd 100644 --- a/src/stores/user.store.js +++ b/src/stores/user.store.js @@ -28,14 +28,14 @@ class UserStore { connecting = false userAgreesToTerms = false - iAgree = () => { - this.userAgreesToTerms = true - } - constructor (){ makeAutoObservable(this) } + iAgree = () => { + this.userAgreesToTerms = true + } + selectWallet = async () => { return new Promise((resolve, reject) =>{ this.walletSelectionResult = null From fd771221f4fa48b75bcedc14ba8d545f82f3ba99 Mon Sep 17 00:00:00 2001 From: shmuel <shmuel@shmuels-MacBook-Pro.local> Date: Wed, 19 Jan 2022 00:44:12 +0200 Subject: [PATCH 04/14] vesta-sidebar + logo + netwrok support + iframe --- src/App.js | 2 ++ src/assets/vesta-logo.svg | 72 +++++++++++++++++++++++++++++++++++++++ src/components/Sidebar.js | 10 ++++++ src/containers/Vesta.js | 27 +++++++++++++++ src/stores/user.store.js | 14 +++++++- 5 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 src/assets/vesta-logo.svg create mode 100644 src/containers/Vesta.js diff --git a/src/App.js b/src/App.js index 1e637a8..f3d3047 100644 --- a/src/App.js +++ b/src/App.js @@ -19,6 +19,7 @@ routerStore.setRouteProps(browserHistory) const Dashboard = React.lazy(() => import("./containers/Dashboard")); const Compound = React.lazy(() => import("./containers/Compound")); const Liquity = React.lazy(() => import("./containers/Liquity")); +const Vesta = React.lazy(() => import("./containers/Vesta")); const Risk = React.lazy(() => import("./containers/Risk")); const TermsOfUse = React.lazy(() => import("./containers/Terms")); const FAQ = React.lazy(() => import("./containers/FAQ")); @@ -53,6 +54,7 @@ const App = observer(() => { <Route exact path="/maker" render={props =>(renderPage(props, Dashboard))} /> <Route exact path="/compound" render={props =>(renderPage(props, Compound))} /> <Route exact path="/liquity" render={props =>(renderPage(props, Liquity))} /> + <Route exact path="/vesta" render={props =>(renderPage(props, Vesta))} /> <Route exact path="/faq" render={props =>(renderPage(props, FAQ))} /> <Route exact path="/terms" render={props =>(renderPage(props, TermsOfUse))} /> <Route exact path="/risk" render={props =>(renderPage(props, Risk))} /> diff --git a/src/assets/vesta-logo.svg b/src/assets/vesta-logo.svg new file mode 100644 index 0000000..3c0fd39 --- /dev/null +++ b/src/assets/vesta-logo.svg @@ -0,0 +1,72 @@ +<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:vectornator="http://vectornator.io" style="fill-rule:nonzero;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;" xml:space="preserve" version="1.1" viewBox="0 0 337.95 100"> +<metadata> +<vectornator:setting key="DimensionsVisible" value="1"/> +<vectornator:setting key="PencilOnly" value="0"/> +<vectornator:setting key="SnapToPoints" value="0"/> +<vectornator:setting key="GuidesVisible" value="1"/> +<vectornator:setting key="OutlineMode" value="0"/> +<vectornator:setting key="RulersVisible" value="1"/> +<vectornator:setting key="SnapToEdges" value="0"/> +<vectornator:setting key="CMYKEnabledKey" value="0"/> +<vectornator:setting key="DisplayWhiteBackground" value="0"/> +<vectornator:setting key="doHistoryDisabled" value="0"/> +<vectornator:setting key="TimeLapseWatermarkDisabled" value="0"/> +<vectornator:setting key="SnapToGuides" value="1"/> +<vectornator:setting key="DynamicGuides" value="0"/> +<vectornator:setting key="SnapToGrid" value="0"/> +<vectornator:setting key="IsolateActiveLayer" value="0"/> +<vectornator:setting key="Units" value="Points"/> +</metadata> +<defs> +<path d="M63.2964+26.3652L79.4012+26.3652L79.4012+58.7057L63.2964+58.7057L63.2964+26.3652Z" id="Mask"/> +<path d="M17.1935+26.3652L64.4023+26.3652L64.4023+90.1928L17.1935+90.1928L17.1935+26.3652Z" id="Mask_2"/> +</defs> +<g id="Untitled" vectornator:layerName="Untitled"> +<path d="M48.7294+0C21.8181+0+0+22.387+0+50C0+77.6152+21.8181+100+48.7294+100C75.6429+100+97.4588+77.6152+97.4588+50C97.4588+22.387+75.6429+0+48.7294+0Z" opacity="1" fill="#f7f8ef"/> +<path d="M48.5587+9.82491C27.0301+9.82491+9.57524+27.7349+9.57524+49.8249C9.57524+71.9171+27.0301+89.8249+48.5587+89.8249C70.0895+89.8249+87.5422+71.9171+87.5422+49.8249C87.5422+27.7349+70.0895+9.82491+48.5587+9.82491Z" opacity="1" fill="#021123"/> +<path d="M41.7353+58.3333L41.4545+58.1893L56.9633+26.3652L57.3132+26.3652L41.7353+58.3333" opacity="1" fill="#f7f8ef"/> +<path d="M46.159+58.3245L45.8804+58.1804L61.3826+26.3652L61.7325+26.3652L46.159+58.3245" opacity="1" fill="#f7f8ef"/> +<path d="M43.2106+58.3311L42.9298+58.1871L58.4364+26.3652L58.7863+26.3652L43.2106+58.3311" opacity="1" fill="#f7f8ef"/> +<path d="M44.6859+58.3267L44.4051+58.1826L59.9095+26.3652L60.2594+26.3652L44.6859+58.3267" opacity="1" fill="#f7f8ef"/> +<path d="M40.2622+58.3378L39.9814+58.1937L55.4901+26.3652L55.8422+26.3652L40.2622+58.3378" opacity="1" fill="#f7f8ef"/> +<g opacity="1" vectornator:mask="#Mask"> +<clipPath id="ClipPath"> +<use xlink:href="#Mask" fill="none" overflow="visible"/> +</clipPath> +<g clip-path="url(#ClipPath)"> +<path d="M79.0556+26.3652L79.4077+26.3652L63.8536+58.2824L63.575+58.1383L79.0556+26.3652" opacity="1" fill="#f7f8ef"/> +</g> +</g> +<path d="M34.3633+58.3511L34.0825+58.207L49.5977+26.3652L49.9498+26.3652L34.3633+58.3511" opacity="1" fill="#f7f8ef"/> +<path d="M37.3117+58.3444L37.033+58.2004L52.5439+26.3652L52.896+26.3652L37.3117+58.3444" opacity="1" fill="#f7f8ef"/> +<path d="M35.8386+58.3466L35.5578+58.2048L51.0708+26.3652L51.4229+26.3652L35.8386+58.3466" opacity="1" fill="#f7f8ef"/> +<path d="M38.7869+58.34L38.5061+58.1981L54.017+26.3652L54.3691+26.3652L38.7869+58.34" opacity="1" fill="#f7f8ef"/> +<path d="M55.0063+58.3023L54.7277+58.1582L70.2191+26.3652L70.569+26.3652L55.0063+58.3023" opacity="1" fill="#f7f8ef"/> +<path d="M56.4816+58.3001L56.2008+58.156L71.6922+26.3652L72.0422+26.3652L56.4816+58.3001" opacity="1" fill="#f7f8ef"/> +<path d="M57.9569+58.2957L57.6761+58.1516L73.1654+26.3652L73.5153+26.3652L57.9569+58.2957" opacity="1" fill="#f7f8ef"/> +<path d="M47.6343+58.32L47.3535+58.176L62.8557+26.3652L63.2056+26.3652L47.6343+58.32" opacity="1" fill="#f7f8ef"/> +<path d="M62.3805+58.2868L62.0997+58.1427L77.5847+26.3652L77.9346+26.3652L62.3805+58.2868" opacity="1" fill="#f7f8ef"/> +<path d="M60.9052+58.289L60.6244+58.1449L76.1116+26.3652L76.4615+26.3652L60.9052+58.289" opacity="1" fill="#f7f8ef"/> +<path d="M59.43+58.2934L59.1492+58.1494L74.6385+26.3652L74.9884+26.3652L59.43+58.2934" opacity="1" fill="#f7f8ef"/> +<path d="M50.5827+58.3134L50.304+58.1693L65.7998+26.3652L66.1519+26.3652L50.5827+58.3134" opacity="1" fill="#f7f8ef"/> +<path d="M49.1095+58.3178L48.8287+58.1738L64.3267+26.3652L64.6787+26.3652L49.1095+58.3178" opacity="1" fill="#f7f8ef"/> +<path d="M53.5332+58.3067L53.2524+58.1627L68.746+26.3652L69.0959+26.3652L53.5332+58.3067" opacity="1" fill="#f7f8ef"/> +<path d="M52.0579+58.309L51.7771+58.1671L67.2729+26.3652L67.625+26.3652L52.0579+58.309" opacity="1" fill="#f7f8ef"/> +<g opacity="1" vectornator:mask="#Mask_2"> +<clipPath id="ClipPath_2"> +<use xlink:href="#Mask_2" fill="none" overflow="visible"/> +</clipPath> +<g clip-path="url(#ClipPath_2)"> +<path d="M48.3017+90.1995L17.1957+26.3652L48.3017+26.3652L63.8536+58.2824L48.3017+90.1995" opacity="1" fill="#f7f8ef"/> +</g> +</g> +<g opacity="1"> +<path d="M162.3+26.0763L175.112+26.0763L154.973+85.0939L143.321+85.0939L123.382+26.0763L136.555+26.0763L149.367+70.88L162.3+26.0763Z" opacity="1" fill="#ffffff"/> +<path d="M198.735+49.6994C196.093+49.6994+194.044+50.5268+192.589+52.1818C191.135+53.8367+190.22+56.0789+189.847+58.9084L207.584+58.9084C207.397+55.8921+206.483+53.6032+204.841+52.0417C203.2+50.4801+201.164+49.6994+198.735+49.6994ZM198.735+40.2902C202.366+40.2902+205.635+40.9709+208.545+42.3322C211.454+43.6935+213.857+45.8423+215.752+48.7785C217.46+51.3677+218.568+54.3706+219.075+57.7873C219.369+59.7892+219.489+62.672+219.436+66.4357L189.566+66.4357C189.727+70.8133+191.101+73.883+193.69+75.6447C195.265+76.7391+197.16+77.2863+199.376+77.2863C201.725+77.2863+203.633+76.619+205.102+75.2843C205.902+74.5636+206.61+73.5626+207.224+72.2814L218.875+72.2814C218.581+74.8706+217.233+77.4998+214.831+80.1691C211.094+84.4132+205.862+86.5353+199.136+86.5353C193.584+86.5353+188.686+84.7469+184.441+81.1701C180.197+77.5932+178.075+71.7742+178.075+63.713C178.075+56.159+179.99+50.3667+183.821+46.3361C187.651+42.3055+192.623+40.2902+198.735+40.2902Z" opacity="1" fill="#ffffff"/> +<path d="M236.012+71.1603C236.252+73.189+236.772+74.6304+237.573+75.4845C238.988+77.006+241.604+77.7668+245.421+77.7668C247.663+77.7668+249.445+77.4331+250.766+76.7658C252.087+76.0985+252.748+75.0975+252.748+73.7628C252.748+72.4816+252.214+71.5073+251.146+70.84C250.079+70.1727+246.115+69.0249+239.255+67.3966C234.317+66.1688+230.833+64.6339+228.805+62.7921C226.776+60.977+225.762+58.3612+225.762+54.9445C225.762+50.9139+227.343+47.4505+230.506+44.5543C233.669+41.6582+238.12+40.2101+243.859+40.2101C249.305+40.2101+253.742+41.2978+257.172+43.4733C260.602+45.6487+262.571+49.4057+263.078+54.7443L251.667+54.7443C251.507+53.2762+251.093+52.1151+250.426+51.2609C249.171+49.7127+247.036+48.9386+244.02+48.9386C241.537+48.9386+239.769+49.3257+238.714+50.0998C237.66+50.8738+237.133+51.7814+237.133+52.8224C237.133+54.1304+237.693+55.0779+238.814+55.6652C239.936+56.2791+243.899+57.3335+250.706+58.8283C255.244+59.896+258.647+61.5109+260.916+63.673C263.158+65.8618+264.279+68.5978+264.279+71.881C264.279+76.2052+262.671+79.7353+259.455+82.4713C256.238+85.2073+251.267+86.5753+244.54+86.5753C237.68+86.5753+232.615+85.1273+229.345+82.2311C226.075+79.3349+224.44+75.6447+224.44+71.1603L236.012+71.1603Z" opacity="1" fill="#ffffff"/> +<path d="M268.243+49.9796L268.243+41.8517L274.329+41.8517L274.329+29.6798L285.62+29.6798L285.62+41.8517L292.707+41.8517L292.707+49.9796L285.62+49.9796L285.62+73.0421C285.62+74.8306+285.847+75.945+286.301+76.3854C286.755+76.8258+288.143+77.046+290.465+77.046C290.812+77.046+291.179+77.0394+291.566+77.026C291.953+77.0127+292.333+76.9927+292.707+76.966L292.707+85.4943L287.302+85.6945C281.91+85.8813+278.226+84.9471+276.251+82.8918C274.97+81.5838+274.329+79.5685+274.329+76.8459L274.329+49.9796L268.243+49.9796Z" opacity="1" fill="#ffffff"/> +<path d="M324.098+63.8732C323.377+64.327+322.65+64.694+321.916+64.9743C321.181+65.2545+320.174+65.5148+318.893+65.755L316.33+66.2355C313.928+66.6626+312.206+67.1831+311.165+67.797C309.403+68.838+308.522+70.4529+308.522+72.6418C308.522+74.5903+309.063+75.9984+310.144+76.8659C311.225+77.7334+312.54+78.1671+314.088+78.1671C316.544+78.1671+318.806+77.4464+320.875+76.005C322.943+74.5636+324.018+71.9344+324.098+68.1173L324.098+63.8732ZM317.171+58.548C319.28+58.2811+320.788+57.9474+321.695+57.547C323.324+56.853+324.138+55.772+324.138+54.3039C324.138+52.5154+323.517+51.2809+322.276+50.6002C321.035+49.9196+319.213+49.5793+316.811+49.5793C314.115+49.5793+312.206+50.2466+311.085+51.5812C310.284+52.5688+309.75+53.9035+309.483+55.5851L298.473+55.5851C298.713+51.7681+299.781+48.6317+301.676+46.1759C304.692+42.3322+309.87+40.4103+317.211+40.4103C321.989+40.4103+326.233+41.3579+329.943+43.2531C333.654+45.1483+335.509+48.7251+335.509+53.9835L335.509+74.0031C335.509+75.3911+335.535+77.0727+335.589+79.048C335.669+80.5428+335.896+81.5571+336.27+82.091C336.643+82.6248+337.204+83.0653+337.951+83.4123L337.951+85.0939L325.539+85.0939C325.192+84.213+324.952+83.3856+324.818+82.6115C324.685+81.8374+324.578+80.9565+324.498+79.9689C322.923+81.6772+321.108+83.132+319.053+84.3332C316.597+85.7479+313.821+86.4552+310.725+86.4552C306.774+86.4552+303.511+85.3275+300.935+83.0719C298.359+80.8164+297.071+77.6199+297.071+73.4826C297.071+68.1173+299.14+64.2335+303.277+61.8312C305.546+60.5233+308.883+59.589+313.287+59.0285L317.171+58.548Z" opacity="1" fill="#ffffff"/> +</g> +<g opacity="1"/> +</g> +</svg> \ No newline at end of file diff --git a/src/components/Sidebar.js b/src/components/Sidebar.js index 28a4c88..4b8a686 100644 --- a/src/components/Sidebar.js +++ b/src/components/Sidebar.js @@ -7,6 +7,7 @@ import Discord from "../assets/discord.svg"; import AAVELogo from "../assets/aav-ewhite-logo.svg"; import CompoundLogo from "../assets/compound-logo.svg"; import LiquityLogo from "../assets/liquity-logo.svg"; +import VestaLogo from "../assets/vesta-logo.svg"; import MakerLogo from "../assets/logo-maker-white.svg"; import HundredLogo from "../assets/hundred-logo.svg"; import MigrationModal from "./modals/MigrationModal"; @@ -134,6 +135,15 @@ class Sidebar extends Component { <img src={LiquityLogo} /> {false && <small>(Testnet)</small>} </div> + <div + className={`product link-accesible ${ + pathname === "/vesta" && + "selected" + }`} + onClick={() => this.handleItemSelect("vesta")}> + <img src={VestaLogo} /> + <small>Testnet</small> + </div> <div className="product"> <a href="https://hundred.finance" target="_blank"> diff --git a/src/containers/Vesta.js b/src/containers/Vesta.js new file mode 100644 index 0000000..6ea4e7c --- /dev/null +++ b/src/containers/Vesta.js @@ -0,0 +1,27 @@ +import React, { Component } from "react"; +import {observer} from "mobx-react" +import routerStore from "../stores/router.store" + +class Vesta extends Component { + + constructor(props) { + super(props); + } + + componentDidMount() { + routerStore.setRouteProps(this.props.history) + } + + render() { + return ( + <iframe + src="https://react-client-v2.bprotocol.workers.dev/" + width="100%" + height="100%" + frameBorder="0" + /> + ); + } +} + +export default observer(Vesta) diff --git a/src/stores/user.store.js b/src/stores/user.store.js index 4e50b30..3076055 100644 --- a/src/stores/user.store.js +++ b/src/stores/user.store.js @@ -15,6 +15,13 @@ import WalletConnectProvider from "@walletconnect/web3-provider"; import {walletTypes, getMetaMask, getWalletConnect} from "../wallets/Wallets" import WalletSelectionModal from "../components/modals/WalletSelectionModal" +const supportedNetworks = { + "1": "Mainnet", + "42": "Kovan", + "421611": "Arbitrum Testnet", + "1137": "Hardhat" +} + class UserStore { loggedIn = false @@ -100,7 +107,8 @@ class UserStore { // save connection data to local storage window.localStorage.setItem("walletType", this.walletType) const networkType = await this.web3.eth.net.getId() - if (parseInt(networkType) !== parseInt(0x2a) && parseInt(networkType) !== parseInt(0x1) && parseInt(networkType) !== 1337) { + debugger + if (!supportedNetworks[networkType.toString()]) { EventBus.$emit("app-error", "Only Mainnet and Kovan testnet are supported"); return false; } @@ -134,6 +142,10 @@ class UserStore { connectionWarning = () => { this.loggedIn = false + if(window.location.pathname != "/compound"){ + this.removeConnectionWarning() + return + } EventBus.$emit('app-alert', "something went wrong please try to reconnect", "reconnect", this.connect) } From ab8833eff7eaebeb5358e41747595d4badf0ab08 Mon Sep 17 00:00:00 2001 From: shmuel <shmuel@shmuels-MacBook-Pro.local> Date: Wed, 19 Jan 2022 00:45:14 +0200 Subject: [PATCH 05/14] static file generation for build --- generate-static.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generate-static.sh b/generate-static.sh index dde67c6..77efa2a 100755 --- a/generate-static.sh +++ b/generate-static.sh @@ -6,4 +6,5 @@ mkdir liquity && cp index.html liquity mkdir faq && cp index.html faq mkdir risk && cp index.html risk mkdir terms && cp index.html terms -mkdir farm-info && cp index.html farm-info \ No newline at end of file +mkdir farm-info && cp index.html farm-info +mkdir vesta && cp index.html vesta \ No newline at end of file From de21d3d3b4b4eb8c9cead3d62666231a99f017b6 Mon Sep 17 00:00:00 2001 From: shmuel <shmuel@shmuels-MacBook-Pro.local> Date: Wed, 19 Jan 2022 00:45:26 +0200 Subject: [PATCH 06/14] 1.0.26 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d0a3b86..25a9658 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bprotocol-react-client", - "version": "1.0.25", + "version": "1.0.26", "private": true, "dependencies": { "@cloudflare/kv-asset-handler": "^0.1.0", From 3d5a04827a6533b2e68cb370ec4d650888a7c7fc Mon Sep 17 00:00:00 2001 From: shmuel <shmuel@shmuels-MacBook-Pro.local> Date: Wed, 19 Jan 2022 00:45:30 +0200 Subject: [PATCH 07/14] 1.0.27 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 25a9658..d0c37d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bprotocol-react-client", - "version": "1.0.26", + "version": "1.0.27", "private": true, "dependencies": { "@cloudflare/kv-asset-handler": "^0.1.0", From 68754b02ec13675e2f7b2cc298fba174010ef554 Mon Sep 17 00:00:00 2001 From: shmuel <shmuel@shmuels-MacBook-Pro.local> Date: Wed, 19 Jan 2022 00:45:33 +0200 Subject: [PATCH 08/14] 1.0.28 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d0c37d0..4e3cee3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bprotocol-react-client", - "version": "1.0.27", + "version": "1.0.28", "private": true, "dependencies": { "@cloudflare/kv-asset-handler": "^0.1.0", From fec674b8c3fe16620fbb36720e9f43dc043658b5 Mon Sep 17 00:00:00 2001 From: shmuel <shmuel@shmuels-MacBook-Pro.local> Date: Wed, 19 Jan 2022 00:45:35 +0200 Subject: [PATCH 09/14] 1.0.29 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4e3cee3..c96e6f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bprotocol-react-client", - "version": "1.0.28", + "version": "1.0.29", "private": true, "dependencies": { "@cloudflare/kv-asset-handler": "^0.1.0", From dad0d3dfd8a9d70de65f59fa03390fc754c31170 Mon Sep 17 00:00:00 2001 From: shmuel <shmuel@shmuels-MacBook-Pro.local> Date: Thu, 3 Feb 2022 13:38:13 +0200 Subject: [PATCH 10/14] fix --- src/containers/Vesta.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/Vesta.js b/src/containers/Vesta.js index 6ea4e7c..294df74 100644 --- a/src/containers/Vesta.js +++ b/src/containers/Vesta.js @@ -15,7 +15,7 @@ class Vesta extends Component { render() { return ( <iframe - src="https://react-client-v2.bprotocol.workers.dev/" + src="/vesta-app/" width="100%" height="100%" frameBorder="0" From 59df94dd81bcbf0234a4702305621523a983db15 Mon Sep 17 00:00:00 2001 From: shmuel <shmuel@shmuels-MacBook-Pro.local> Date: Sun, 6 Feb 2022 14:47:21 +0200 Subject: [PATCH 11/14] bugFix: maker import layout --- src/components/Sidebar.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Sidebar.js b/src/components/Sidebar.js index a808403..906f339 100644 --- a/src/components/Sidebar.js +++ b/src/components/Sidebar.js @@ -77,8 +77,9 @@ class Sidebar extends Component { ? <div > <MakerMigration> - <div className="ln"> </div> { !params.export && userInfo && userInfo.makerdaoCdpInfo.hasCdp && ( + <React.Fragment> + <div className="ln"> </div> <div> <div className="cdp-convert"> {makerStoreNames.map(makerCollType => <MakerMigrationButton key={makerCollType} makerCollType={makerCollType}/>)} @@ -102,6 +103,7 @@ class Sidebar extends Component { </div> </div> </div> + </React.Fragment> )} {params.export && <div className="container"> @@ -133,7 +135,7 @@ class Sidebar extends Component { }`} onClick={() => this.handleItemSelect("liquity")}> <img src={LiquityLogo} /> - {false && <small>(Testnet)</small>} + {false && <small>(Arbitrum)</small>} </div> <div className={`product link-accesible ${ From 483d8191d50b13f3548a42f012e98f55ec9d6542 Mon Sep 17 00:00:00 2001 From: shmuel <shmuel@shmuels-MacBook-Pro.local> Date: Sun, 6 Feb 2022 15:10:16 +0200 Subject: [PATCH 12/14] bugFix: network alert --- src/stores/user.store.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stores/user.store.js b/src/stores/user.store.js index 8d8cc44..3d056ae 100644 --- a/src/stores/user.store.js +++ b/src/stores/user.store.js @@ -114,7 +114,9 @@ class UserStore { const networkType = await this.web3.eth.net.getId() debugger if (!supportedNetworks[networkType.toString()]) { - EventBus.$emit("app-error", "Only Mainnet and Kovan testnet are supported"); + if(window.location.pathname == "/compound" || window.location.pathname == "/maker" || window.location.pathname == "/app"){ + EventBus.$emit("app-error", "Only Mainnet and Kovan testnet are supported"); + } return false; } runInAction(()=> { From c90d14abd7bc223494e891e33524c9784259b5cc Mon Sep 17 00:00:00 2001 From: shmuel <shmuel@shmuels-MacBook-Pro.local> Date: Sun, 6 Feb 2022 15:27:39 +0200 Subject: [PATCH 13/14] network alert fix --- src/stores/main.hundred.store.js | 1 - src/stores/user.store.js | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/stores/main.hundred.store.js b/src/stores/main.hundred.store.js index 6840c20..0226d03 100644 --- a/src/stores/main.hundred.store.js +++ b/src/stores/main.hundred.store.js @@ -30,7 +30,6 @@ class MainHundredStore { try{ const {data} = await axios.get('https://api.llama.fi/protocol/b.protocol') const {currentChainTvls} = data - debugger this.hundredTvlArbitrum = currentChainTvls.Arbitrum this.hundredTvlFantom = currentChainTvls.Fantom } catch (err) { diff --git a/src/stores/user.store.js b/src/stores/user.store.js index 3d056ae..785360a 100644 --- a/src/stores/user.store.js +++ b/src/stores/user.store.js @@ -18,7 +18,6 @@ import WalletSelectionModal from "../components/modals/WalletSelectionModal" const supportedNetworks = { "1": "Mainnet", "42": "Kovan", - "421611": "Arbitrum Testnet", "1137": "Hardhat" } @@ -112,9 +111,9 @@ class UserStore { // save connection data to local storage window.localStorage.setItem("walletType", this.walletType) const networkType = await this.web3.eth.net.getId() - debugger if (!supportedNetworks[networkType.toString()]) { - if(window.location.pathname == "/compound" || window.location.pathname == "/maker" || window.location.pathname == "/app"){ + const path = window.location.pathname + if(path == "/compound" || path == "/maker" || path == "/app"){ EventBus.$emit("app-error", "Only Mainnet and Kovan testnet are supported"); } return false; From 5bac3fc33b12c15f35734c85e1d0e31877ae54b0 Mon Sep 17 00:00:00 2001 From: shmuel <shmuel@shmuels-MacBook-Pro.local> Date: Sun, 6 Feb 2022 15:47:08 +0200 Subject: [PATCH 14/14] fix --- src/components/Sidebar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Sidebar.js b/src/components/Sidebar.js index 906f339..8261757 100644 --- a/src/components/Sidebar.js +++ b/src/components/Sidebar.js @@ -135,7 +135,7 @@ class Sidebar extends Component { }`} onClick={() => this.handleItemSelect("liquity")}> <img src={LiquityLogo} /> - {false && <small>(Arbitrum)</small>} + {false && <small>(test)</small>} </div> <div className={`product link-accesible ${ @@ -144,7 +144,7 @@ class Sidebar extends Component { }`} onClick={() => this.handleItemSelect("vesta")}> <img src={VestaLogo} /> - <small>Testnet</small> + <small>Arbitrum</small> </div> <div className="product"> <a href="https://hundred.finance" target="_blank">