Skip to content

Commit

Permalink
Merge pull request #339 from arcana-network/testnet
Browse files Browse the repository at this point in the history
Mainnet hotfix release - Removed ramp network and fixed some bugs
  • Loading branch information
shrinathprabhu authored May 31, 2023
2 parents bfdf3ff + 8e3b9bd commit 424ca5e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 118 deletions.
4 changes: 3 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ onBeforeMount(async () => {
async function setIframeStyle() {
const parentConnectionInstance = await parentConnectionStore.parentConnection
?.promise
await parentConnectionInstance?.setIframeStyle(app.iframeStyle)
if (parentConnectionInstance && parentConnectionInstance['setIframeStyle']) {
await parentConnectionInstance?.setIframeStyle(app.iframeStyle)
}
}
watch(showWallet, async (newValue) => {
Expand Down
Binary file added src/assets/images/onrampmoney.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 4 additions & 30 deletions src/components/BuyTokens.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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('!!!')
Expand All @@ -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()
}
Expand Down Expand Up @@ -136,25 +126,6 @@ function handleDone() {
<span class="text-base">Transak</span>
</label>
</div>
<div class="flex gap-3 items-center">
<input
id="Ramp"
v-model="selectedProvider"
type="radio"
value="ramp"
name="provider"
:disabled="!props.rampNetwork"
:class="{ 'opacity-80': !props.rampNetwork }"
/>
<label
for="Ramp"
class="flex gap-2 items-center cursor-pointer"
:class="{ 'opacity-50': !props.rampNetwork }"
>
<img src="@/assets/images/ramp.png" class="h-7 w-7" />
<span class="text-base">Ramp</span>
</label>
</div>
<div class="flex gap-3 items-center">
<input
id="OnRampMoney"
Expand All @@ -170,7 +141,10 @@ function handleDone() {
class="flex gap-2 items-center cursor-pointer"
:class="{ 'opacity-50': props.onRampMoney === false }"
>
<img src="@/assets/images/ramp.png" class="h-7 w-7" />
<img
src="@/assets/images/onrampmoney.png"
class="h-7 w-7 bg-[#F2F2F2] rounded-full"
/>
<span class="text-base">onramp.money</span>
</label>
</div>
Expand Down
15 changes: 3 additions & 12 deletions src/components/UserWallet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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'
)
Expand Down Expand Up @@ -179,7 +171,7 @@ onMounted(() => {
})
watch(
() => rpcStore.selectedRPCConfig.chainId,
() => rpcStore.selectedRPCConfig?.chainId,
async () => {
await getRequestHandler().setRpcConfig({
...rpcStore.selectedRPCConfig,
Expand Down Expand Up @@ -297,7 +289,7 @@ watch(
</button>
<button
v-if="walletBalance && !HIDE_ON_RAMP"
:disabled="!transakNetwork && !rampNetwork && onRampMoney === false"
:disabled="!transakNetwork && onRampMoney === false"
class="text-sm sm:text-xs font-semibold rounded-xl border-2 border-solid border-black dark:border-white flex-1 uppercase disabled:opacity-50"
@click="handleBuy(true)"
>
Expand Down Expand Up @@ -330,7 +322,6 @@ watch(
<BuyTokens
v-if="showModal === 'buy'"
:transak-network="transakNetwork?.value"
:ramp-network="rampNetwork?.value"
:on-ramp-money="onRampMoney"
@close="handleBuy(false)"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/store/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const useRpcStore = defineStore('rpcStore', {
selectedRPCConfig: null,
selectedChainId: null,

walletBalance: '',
walletBalance: '0',
walletBalanceChainId: '',
walletBalancePollingCleanupID: null,
walletBalancePollingIntervalID: null,
Expand Down
74 changes: 0 additions & 74 deletions src/utils/rampsdk.ts

This file was deleted.

0 comments on commit 424ca5e

Please sign in to comment.