From 44ddab80e6758b3681f4d7a6adfcba2275d2acdd Mon Sep 17 00:00:00 2001 From: shrinathprabhu Date: Wed, 31 May 2023 18:41:45 +0530 Subject: [PATCH 1/2] Remove ramp network and replace onrampmoney logo --- src/assets/images/onrampmoney.png | Bin 0 -> 1032 bytes src/components/BuyTokens.vue | 34 ++------------ src/components/UserWallet.vue | 15 ++---- src/utils/rampsdk.ts | 74 ------------------------------ 4 files changed, 7 insertions(+), 116 deletions(-) create mode 100644 src/assets/images/onrampmoney.png delete mode 100644 src/utils/rampsdk.ts diff --git a/src/assets/images/onrampmoney.png b/src/assets/images/onrampmoney.png new file mode 100644 index 0000000000000000000000000000000000000000..2130677bd633773af4283b571365577fbf4a3e0c GIT binary patch literal 1032 zcmZQzV30^FsVqn=%S>Ycg51nB!`#e7Ae%8GH?<@YBnAYE87VnM5GDgdL1uCZj18mt z3NlM_!5l^)sgs$LpA6!;FfcGNfJA_p`8bev1oFW=#txvAJ& zfOI6585n|?2tl9>Oi(JbC>5fQfq^fvv?2#=6UeUhnFU1!K)NflAUPjMi)0oTqylLW z2!LXq#4vi1H*%vv5A?1iG{I+ zjTOl6$W2Ks5n|wClfSwAyl#NeCYF@6-g*Q185|ZMy$sAejw}w3^lF3b_7sbUGMJqU zW(}yBVEgv5``vV_A-(m11+tRJ0`7=`fM^~qx_NX^XKFu>(mz6YuL&r@dx}%`cd3CFCoU{ zkNH`r6aW0UA3T53XgT4EPLj%(oYr}zD>*MOcS`vpAF<-Uj$Zymr|8y#i`K%icC$OX zUL0PqcXKh5ree3#gx1{T3k9j0B(o;9=W5+&H{D)zZSP65>5ohJ3r(ubR1SZ7rB^?* z`nZ?>%N+#?$5uR>a3|q#?7hb~b3%$XX|8*e!C_u1USyZPTK(Bn#`03`xL^*36{}Y> zT)fyYMc`W&>t4p5U)M4f1Jin*eX@FNBjH-b@GMJVkN9PM^_vx^{#Dor1aj=1+IGYK zE92a%qQd2#PDitIzcX~oxGyb#xBGl z%CB|0jMkSb-wfX65x7oD^fPOEg~YZADK~#{^vJ0)y!&2m8nytKd^qhv$%m1b?Shd} zN<{A^Z?}2_1`Y-ma2f&;O&lxO-%gi)ca+C>)^>rOOKZ~&to(L*A5LPe=vV*%a~o=b literal 0 HcmV?d00001 diff --git a/src/components/BuyTokens.vue b/src/components/BuyTokens.vue index e6ad5f4e..0df94690 100644 --- a/src/components/BuyTokens.vue +++ b/src/components/BuyTokens.vue @@ -3,13 +3,11 @@ import { ref, type Ref } from 'vue' import AppLoader from '@/components/AppLoader.vue' import { openOnRampMoneyHostedUI } from '@/utils/onrampmoney.ramp' -import { openRampSdk } from '@/utils/rampsdk' import { openTransak } from '@/utils/transak' import { useImage } from '@/utils/useImage' type BuyTokenProps = { transakNetwork?: string - rampNetwork?: string onRampMoney: number | false | undefined } @@ -43,12 +41,6 @@ function handleStatusModalText(provider: 'Transak' | 'Ramp' | 'onramp.money') { } } -function handleRamp() { - isLoading.value = true - openRampSdk(props.rampNetwork as string) - handleStatusModalText('Ramp') -} - function handleOnRampMoney() { if (props.onRampMoney === undefined || props.onRampMoney === false) { throw new Error('!!!') @@ -61,8 +53,6 @@ function handleOnRampMoney() { function handleBuy() { if (selectedProvider.value === 'transak') { handleTransak() - } else if (selectedProvider.value === 'ramp') { - handleRamp() } else if (selectedProvider.value === 'onramp.money') { handleOnRampMoney() } @@ -136,25 +126,6 @@ function handleDone() { Transak -
- - -
- + onramp.money
diff --git a/src/components/UserWallet.vue b/src/components/UserWallet.vue index 62de84e7..14def286 100644 --- a/src/components/UserWallet.vue +++ b/src/components/UserWallet.vue @@ -19,7 +19,6 @@ import { useRpcStore } from '@/store/rpc' import { useUserStore } from '@/store/user' import { HIDE_ON_RAMP } from '@/utils/constants' import { isSupportedByOnRampMoney } from '@/utils/onrampmoney.ramp' -import { getRampSupportedNetworks } from '@/utils/rampsdk' import { getRequestHandler } from '@/utils/requestHandlerSingleton' import { getTransakSupportedNetworks } from '@/utils/transak' import { truncateToTwoDecimals } from '@/utils/truncateToTwoDecimal' @@ -62,13 +61,6 @@ const transakNetwork = computed(() => { ) }) -const rampNetwork = computed(() => { - const selectedChainId = Number(rpcStore.selectedChainId) - return getRampSupportedNetworks().find( - (network) => network.chainId === selectedChainId - ) -}) - const onRampMoney = computed(() => { const selectedChainId = Number(rpcStore.selectedChainId) if (isSupportedByOnRampMoney(selectedChainId)) { @@ -119,7 +111,7 @@ function openAddNetwork(open) { } function openEditNetwork(open, chainId: number | null = null) { - if (Number(rpcStore.selectedRpcConfig.chainId) === Number(chainId)) { + if (Number(rpcStore.selectedRpcConfig?.chainId) === Number(chainId)) { toast.error( 'This network is current selected, please chose a different one and try again' ) @@ -179,7 +171,7 @@ onMounted(() => { }) watch( - () => rpcStore.selectedRPCConfig.chainId, + () => rpcStore.selectedRPCConfig?.chainId, async () => { await getRequestHandler().setRpcConfig({ ...rpcStore.selectedRPCConfig, @@ -297,7 +289,7 @@ watch(