diff --git a/components/sidebar/context/aaveV2/SidebarAaveV2Supply.vue b/components/sidebar/context/aaveV2/SidebarAaveV2Supply.vue index a6650b4..5064fed 100644 --- a/components/sidebar/context/aaveV2/SidebarAaveV2Supply.vue +++ b/components/sidebar/context/aaveV2/SidebarAaveV2Supply.vue @@ -67,112 +67,147 @@ - diff --git a/composables/swap/use1InchSwap.ts b/composables/swap/use1InchSwap.ts index 43a9846..9043a5c 100644 --- a/composables/swap/use1InchSwap.ts +++ b/composables/swap/use1InchSwap.ts @@ -1,3 +1,4 @@ +import { Spell } from "dsa-connect"; import { useBigNumber } from "../useBigNumber"; import { useDSA } from "../useDSA"; import { useFormatting } from "../useFormatting"; @@ -35,7 +36,7 @@ export const use1InchSwap = () => { unitAmt, calldata, setId - }) { + }): Spell { if ( activeNetworkId.value === Network.Polygon || activeAccount.value.version == 2 diff --git a/composables/useDSA.ts b/composables/useDSA.ts index 8fdc30e..3bd8cd9 100644 --- a/composables/useDSA.ts +++ b/composables/useDSA.ts @@ -1,6 +1,5 @@ import { computed, readonly, ref, watch } from "@nuxtjs/composition-api"; import { useWeb3 } from "./useWeb3"; -//@ts-ignore import DSA from "dsa-connect"; import addresses from "~/constant/addresses"; import abis from "~/constant/abis"; @@ -69,7 +68,7 @@ export function useDSA() { try { const transactionHash = await dsa.value.build({ version: 2 }); - accounts.value = await dsa.value.getAccounts(); + accounts.value = await dsa.value.getAccounts(account.value); return transactionHash; } catch (error) { } finally { diff --git a/composables/useSidebar.ts b/composables/useSidebar.ts index 517e473..8feb30e 100644 --- a/composables/useSidebar.ts +++ b/composables/useSidebar.ts @@ -85,10 +85,12 @@ export function init() { async ([route, active, dsa], [oldRoute, oldActive, oldDsa]) => { await nextTick(); + //@ts-ignore const hasPathChanged = !oldRoute || route.path !== oldRoute.path; const hasIsLoggedInChanged = active !== oldActive; const hasDsaChanged = dsa !== oldDsa; + //@ts-ignore const [hash, params] = route.hash.split("?"); if (hasPathChanged){ @@ -96,6 +98,7 @@ export function init() { return } + //@ts-ignore sidebar.value = sidebars[route.path + hash] || sidebars[hash]; if (!sidebar.value) { diff --git a/composables/useWeb3.ts b/composables/useWeb3.ts index 813671d..0d09b48 100644 --- a/composables/useWeb3.ts +++ b/composables/useWeb3.ts @@ -23,7 +23,7 @@ const chains = [ ]; const active = ref(false); -const chainId = ref(); +const chainId = ref<1|137>(); const networkName = computed( () => chains.find(c => c.chainId === chainId.value)?.name || Network.Mainnet ); @@ -60,6 +60,7 @@ export function useWeb3() { account.value = web3Provider.accounts[0]; } let newWeb3 = new Web3(web3Provider); + //@ts-ignore chainId.value = await newWeb3.eth.getChainId(); web3.value = newWeb3; @@ -118,6 +119,7 @@ export function useWeb3() { return; } let newWeb3 = new Web3(web3Provider); + //@ts-ignore chainId.value = await newWeb3.eth.getChainId(); web3.value = newWeb3; }; diff --git a/package.json b/package.json index e65ae6f..7f6b9f3 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "bignumber.js": "^9.0.1", "core-js": "^3.15.1", "css-color-function": "^1.3.3", - "dsa-connect": "^0.4.3", + "dsa-connect": "^0.4.4-beta.2", "nuxt": "^2.15.7", "qrcode": "^1.4.4", "slugify": "^1.6.0", diff --git a/yarn.lock b/yarn.lock index 01c4cd5..ab1e019 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4675,10 +4675,10 @@ drbg.js@^1.0.1: create-hash "^1.1.2" create-hmac "^1.1.4" -dsa-connect@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/dsa-connect/-/dsa-connect-0.4.3.tgz#382ad7c1b1fa54f963c84adc353dea4bde2f6e80" - integrity sha512-kbG46cvAR2muy2P5jOTVsSZmyDewTAA0lKAeddsrVtpbmys1ujSuDjY/su4At6fAg/iF9/k+ltJAOEvoqt6g9A== +dsa-connect@^0.4.4-beta.2: + version "0.4.4-beta.2" + resolved "https://registry.yarnpkg.com/dsa-connect/-/dsa-connect-0.4.4-beta.2.tgz#d26739c4d67176e7f29b08cb84ee4f510e0bb830" + integrity sha512-ZRk4OAHD0GFJW74fggNfwXCho4AdWKJdXCyGtuCxwTY7Pm1ycisa/469vD6UjcB8j2CrNDk3AsPgXs5IBmkzDQ== duplexer3@^0.1.4: version "0.1.4"