From e79ad82e8495281dfd29659345e88c2e48565f7c Mon Sep 17 00:00:00 2001 From: Georges KABBOUCHI Date: Tue, 10 Aug 2021 17:42:32 +0300 Subject: [PATCH] MakerDAO Supply & Withdraw --- .../makerdao/SidebarMakerdaoSupply.vue | 194 ++++++++++++++++++ .../makerdao/SidebarMakerdaoWithdraw.vue | 180 ++++++++++++++++ composables/useMakerdaoPosition.ts | 3 - composables/useSidebar.ts | 6 +- layouts/default.vue | 6 +- pages/test.vue | 2 +- 6 files changed, 382 insertions(+), 9 deletions(-) create mode 100644 components/sidebar/context/makerdao/SidebarMakerdaoSupply.vue create mode 100644 components/sidebar/context/makerdao/SidebarMakerdaoWithdraw.vue diff --git a/components/sidebar/context/makerdao/SidebarMakerdaoSupply.vue b/components/sidebar/context/makerdao/SidebarMakerdaoSupply.vue new file mode 100644 index 0000000..9183978 --- /dev/null +++ b/components/sidebar/context/makerdao/SidebarMakerdaoSupply.vue @@ -0,0 +1,194 @@ + + + diff --git a/components/sidebar/context/makerdao/SidebarMakerdaoWithdraw.vue b/components/sidebar/context/makerdao/SidebarMakerdaoWithdraw.vue new file mode 100644 index 0000000..722d05a --- /dev/null +++ b/components/sidebar/context/makerdao/SidebarMakerdaoWithdraw.vue @@ -0,0 +1,180 @@ + + + diff --git a/composables/useMakerdaoPosition.ts b/composables/useMakerdaoPosition.ts index 969dbf7..ba0d0f4 100644 --- a/composables/useMakerdaoPosition.ts +++ b/composables/useMakerdaoPosition.ts @@ -110,9 +110,6 @@ export function useMakerdaoPosition(collateralAmountRef: Ref =null, debtAmountRe if (!activeAccount.value) { return; } - - console.log(activeAccount.value.address); - vaults.value = await getVaults(activeAccount.value.address, web3.value); if (vaults.value.length > 0) { vaultId.value = vaults.value[0].id; diff --git a/composables/useSidebar.ts b/composables/useSidebar.ts index e4e76dc..ff1c27d 100644 --- a/composables/useSidebar.ts +++ b/composables/useSidebar.ts @@ -23,6 +23,8 @@ import SidebarCompoundSupply from '~/components/sidebar/context/compound/Sidebar import SidebarCompoundBorrow from '~/components/sidebar/context/compound/SidebarCompoundBorrow.vue' import SidebarCompoundPayback from '~/components/sidebar/context/compound/SidebarCompoundPayback.vue' +import SidebarMakerdaoSupply from '~/components/sidebar/context/makerdao/SidebarMakerdaoSupply.vue' +import SidebarMakerdaoWithdraw from '~/components/sidebar/context/makerdao/SidebarMakerdaoWithdraw.vue' import SidebarMakerdaoBorrow from '~/components/sidebar/context/makerdao/SidebarMakerdaoBorrow.vue' import SidebarMakerdaoPayback from '~/components/sidebar/context/makerdao/SidebarMakerdaoPayback.vue' @@ -51,8 +53,8 @@ const sidebars = { "/mainnet/compound#payback": { component: SidebarCompoundPayback }, "/mainnet/maker": { component: null }, - "/mainnet/maker#withdraw": { component: null }, - "/mainnet/maker#supply": { component: null }, + "/mainnet/maker#supply": { component: SidebarMakerdaoSupply }, + "/mainnet/maker#withdraw": { component: SidebarMakerdaoWithdraw }, "/mainnet/maker#borrow": { component: SidebarMakerdaoBorrow }, "/mainnet/maker#payback": { component: SidebarMakerdaoPayback }, }; diff --git a/layouts/default.vue b/layouts/default.vue index 466e71a..7733590 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -115,10 +115,10 @@ export default defineComponent({ } }, { immediate: true }) - onErrorCaptured(() => { + // onErrorCaptured(() => { - return false - }) + // return false + // }) return { active, diff --git a/pages/test.vue b/pages/test.vue index b04995f..2ad9082 100644 --- a/pages/test.vue +++ b/pages/test.vue @@ -1,3 +1,3 @@ \ No newline at end of file