Skip to content

Commit

Permalink
👷‍♂️ Updated dependencies (viem, wagmi, web3modal) (Abracadabra-money…
Browse files Browse the repository at this point in the history
…#362)

* Updated dependencies @wagmi/core, @web3modal/wagmi, viem.
Updated connect

* updated wallet connect, added wagmiConfig to store

* updated switchNetwork helper

* updated createMultiRewardFarm

* getCauldronInfo delete getAccount  wagmi

* updated approval helper

* getAccount updated on getAccountHelper for validators

* updated import erc20Abi and type address

* updated getAccount wagmi to getAccountHelper

* updated FarmPosition component method harvest

* updated FarmPositionMobilePopup component method harvest

* updated LockBlock component methods approve and lock

* updated Stake component methods stakeHandler and stakeLockedHandler

* updated Unstake component method unstakeHandler

* updated helper bentoBox action deposit

* updated helper bentoBox action withdraw

* updated helper approveTokenViem

* updated helper blast stake action claim

* updated helper blast stake action deposit

* updated helper blast stake action lock

* updated helper blast stake action lockStake

* updated helper blast stake action stake

* updated helper blast stake action withdraw

* updated helper blast stake action withdrawLocked

* updated helper blast stake action withdrawStake

* updated helper farm action deposit

* updated helper farm action exit

* updated helpers farm action stake and withdraw

* updated swap helper action addLiquidity

* updated swap helper action addLiquidityETH

* updated swap helper action addLiquidityETHUnsafe

* updated swap helper action addLiquidityUnsafe

* updated swap helper action removeLiquidity

* updated swap helper action removeLiquidityETH

* updated swap helper action sellBaseETHForTokens

* updated swap helper action sellBaseTokensForETH

* updated swap helper action sellBaseTokensForTokens

* updated swap helper action sellQuoteETHForTokens

* updated swap helper action sellQuoteTokensForETH

* updated swap helper action sellQuoteTokensForTokens

* updated swap helper action swapETHForTokens

* updated swap helper action swapTokensForETH

* updated swap helper action swapTokensForTokens

* updated crv stake helpers action deposit and withdraw

* updated magicApe stake actions

* updated magicGlp stake actions

* updated magicKlp stake actions

* updated magicLvl stake actions

* updated spell stake actions

* updated readContract for getCurveWithdrawOneCoinAmount and getYearnVaultWithdrawAmount

* updated readContract and multicall

* updated tsconfig

* updated web3modalb dependencies

* added @web3modal/core and  @web3modal/ui dependencies

* updated tsconfig.app

* updated vite.config.ts

* updated style tabs width

* updated switchNetwork helper

* updated kava rpc

* finished migration wagmi

* updated chains configs, added ethersProvider to config.

* updated StaticJsonRpcProvider creation

* updated checkUnSupportedChain helper

---------

Co-authored-by: Andrey <[email protected]>
Co-authored-by: 0xhardrefresh <[email protected]>
  • Loading branch information
3 people authored Apr 12, 2024
1 parent 76ea429 commit 671b7d9
Show file tree
Hide file tree
Showing 140 changed files with 10,743 additions and 3,859 deletions.
12,613 changes: 9,620 additions & 2,993 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@
"@upstash/ratelimit": "^0.4.3",
"@vercel/edge": "^0.3.4",
"@vercel/kv": "^0.2.2",
"@wagmi/core": "^1.3.0",
"@wagmi/connectors": "^4.1.25",
"@wagmi/core": "^2.6.16",
"@walletconnect/web3-provider": "^1.8.0",
"@web3modal/ethereum": "^2.6.0",
"@web3modal/html": "^2.6.0",
"@web3modal/wagmi": "^3.5.0",
"@web3modal/core": "^4.1.5",
"@web3modal/ui": "^4.1.5",
"@web3modal/wagmi": "^4.1.5",
"axios": "^1.3.4",
"axios-rate-limit": "^1.3.0",
"chart.js": "^4.2.1",
Expand All @@ -45,14 +46,13 @@
"marked": "^11.2.0",
"moment": "^2.29.4",
"veaury": "^2.3.12",
"viem": "^1.1.7",
"viem": "^2.9.13",
"vue": "^3.2.47",
"vue-echarts": "^6.6.5",
"vue-router": "^4.1.6",
"vue-tippy": "^6.0.0",
"vue3-carousel": "^0.3.1",
"vuex": "^4.0.2",
"web3modal": "^1.9.9"
"vuex": "^4.0.2"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.2.0",
Expand Down
16 changes: 8 additions & 8 deletions src/components/farm/FarmPosition.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@

<script>
import {
prepareWriteContract,
waitForTransaction,
writeContract,
} from "@wagmi/core";
import { getChainConfig } from "@/helpers/chains/getChainsInfo";
writeContractHelper,
simulateContractHelper,
waitForTransactionReceiptHelper,
} from "@/helpers/walletClienHelper";
import spellIcon from "@/assets/images/tokens/SPELL.png";
import BaseButton from "@/components/base/BaseButton.vue";
import { getChainConfig } from "@/helpers/chains/getChainsInfo";
import BaseTokenIcon from "@/components/base/BaseTokenIcon.vue";
import { formatUSD, formatTokenBalance } from "@/helpers/filters";
Expand Down Expand Up @@ -170,7 +170,7 @@ export default {
async harvest() {
if (this.disableEarnedButton) return;
try {
const config = await prepareWriteContract({
const { request } = await simulateContractHelper({
...this.selectedFarm.contractInfo,
functionName: this.selectedFarm.isMultiReward
? "getRewards"
Expand All @@ -180,9 +180,9 @@ export default {
: [this.selectedFarm.poolId, 0],
});
const { hash } = await writeContract(config);
const hash = await writeContractHelper(request);
await waitForTransaction({ hash });
await waitForTransactionReceiptHelper({ hash });
} catch (error) {
console.log("harvest err:", error);
}
Expand Down
16 changes: 8 additions & 8 deletions src/components/farm/FarmPositionMobilePopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@

<script>
import {
prepareWriteContract,
waitForTransaction,
writeContract,
} from "@wagmi/core";
import { getChainConfig } from "@/helpers/chains/getChainsInfo";
writeContractHelper,
simulateContractHelper,
waitForTransactionReceiptHelper,
} from "@/helpers/walletClienHelper";
import spellIcon from "@/assets/images/tokens/SPELL.png";
import BaseButton from "@/components/base/BaseButton.vue";
import { getChainConfig } from "@/helpers/chains/getChainsInfo";
import BaseTokenIcon from "@/components/base/BaseTokenIcon.vue";
import { formatUSD, formatTokenBalance } from "@/helpers/filters";
Expand Down Expand Up @@ -194,7 +194,7 @@ export default {
async harvest() {
if (this.disableEarnedButton) return;
try {
const config = await prepareWriteContract({
const { request } = await simulateContractHelper({
...this.selectedFarm.contractInfo,
functionName: this.selectedFarm.isMultiReward
? "getRewards"
Expand All @@ -204,9 +204,9 @@ export default {
: [this.selectedFarm.poolId, 0],
});
const { hash } = await writeContract(config);
const hash = await writeContractHelper(request);
await waitForTransaction({ hash });
await waitForTransactionReceiptHelper({ hash });
} catch (error) {
console.log("harvest err:", error);
}
Expand Down
16 changes: 8 additions & 8 deletions src/components/market/OrderItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@
</template>

<script lang="ts">
import { mapGetters } from "vuex";
import { utils, BigNumber } from "ethers";
import { defineAsyncComponent } from "vue";
import { useImage } from "@/helpers/useImage";
import { formatTokenBalance } from "@/helpers/filters";
import {
ORDER_PENDING,
ORDER_SUCCESS,
Expand All @@ -85,11 +80,16 @@ import {
getOrderType,
// @ts-ignore
} from "@/helpers/gm/orders";
import { getProviderByChainId } from "@/helpers/getProviderByChainId";
import { mapGetters } from "vuex";
import { utils, BigNumber } from "ethers";
import { defineAsyncComponent } from "vue";
import { useImage } from "@/helpers/useImage";
import { formatTokenBalance } from "@/helpers/filters";
import FAIL_ICON from "@/assets/images/order-fail.svg";
import SUCCESS_ICON from "@/assets/images/order-success.svg";
import { PERCENT_PRESITION } from "@/helpers/cauldron/utils";
import { getEthersProvider } from "@/helpers/chains/getChainsInfo";
const DEFAULT_SLIPPAGE = utils.parseUnits("1", PERCENT_PRESITION);
export default {
Expand Down Expand Up @@ -153,7 +153,7 @@ export default {
}),
provider() {
return getProviderByChainId(this.cauldronObject.config.chainId);
return getEthersProvider(this.cauldronObject.config.chainId);
},
orderType() {
Expand Down
30 changes: 15 additions & 15 deletions src/components/pools/pool/LockBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@
</template>

<script>
// import { defineAsyncComponent } from "vue";
import {
writeContractHelper,
simulateContractHelper,
waitForTransactionReceiptHelper,
} from "@/helpers/walletClienHelper";
import moment from "moment";
import { mapGetters } from "vuex";
import BlastLockingMultiRewardsAbi from "@/abis/BlastLockingMultiRewards";
// import { defineAsyncComponent } from "vue";
import { BlastLockingMultiRewards } from "@/constants/blast";
import { getPublicClient } from "@/helpers/chains/getChainsInfo";
import {
prepareWriteContract,
waitForTransaction,
writeContract,
} from "@wagmi/core";
import { switchNetwork } from "@/helpers/chains/switchNetwork";
import moment from "moment";
import { getPublicClient } from "@/helpers/chains/getChainsInfo";
import BlastLockingMultiRewardsAbi from "@/abis/BlastLockingMultiRewards";
export default {
props: {
Expand Down Expand Up @@ -113,16 +113,16 @@ export default {
},
async approve() {
const config = await prepareWriteContract({
const { request } = await simulateContractHelper({
address: this.pool.contract.address,
abi: this.pool.contract.abi,
functionName: "approve",
args: [BlastLockingMultiRewards, this.pool.userInfo.balance],
});
const { hash } = await writeContract(config);
const hash = await writeContractHelper(request);
const result = await waitForTransaction({ hash });
const result = await waitForTransactionReceiptHelper({ hash });
if (result.status === "success") {
this.lockAllowance = await this.fetchLockAllowance();
Expand All @@ -132,16 +132,16 @@ export default {
async lock() {
const now = moment().unix(); // current Unix timestamp
// const inNinetyDays = moment().add(90, "days").unix(); // Unix timestamp 90 days from now
const config = await prepareWriteContract({
const { request } = await simulateContractHelper({
address: BlastLockingMultiRewards,
abi: BlastLockingMultiRewardsAbi,
functionName: "stakeLocked",
args: [this.pool.userInfo.balance, now + 100],
});
const { hash } = await writeContract(config);
const hash = await writeContractHelper(request);
const result = await waitForTransaction({ hash });
const result = await waitForTransactionReceiptHelper({ hash });
if (result.status === "success") {
this.$emit("updateInfo");
Expand Down
38 changes: 21 additions & 17 deletions src/components/pools/pool/actions/Stake.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,21 @@
</template>

<script>
import { defineAsyncComponent } from "vue";
import moment from "moment";
import { mapActions, mapGetters, mapMutations } from "vuex";
import {
prepareWriteContract,
waitForTransaction,
writeContract,
} from "@wagmi/core";
writeContractHelper,
simulateContractHelper,
waitForTransactionReceiptHelper,
} from "@/helpers/walletClienHelper";
import moment from "moment";
import { formatUnits } from "viem";
import { notificationErrorMsg } from "@/helpers/notification/notificationError.js";
import notification from "@/helpers/notification/notification";
import { approveTokenViem } from "@/helpers/approval";
import { defineAsyncComponent } from "vue";
import { trimZeroDecimals } from "@/helpers/numbers";
import { formatTokenBalance, formatUSD } from "@/helpers/filters";
import { approveTokenViem } from "@/helpers/approval";
import { formatTokenBalance } from "@/helpers/filters";
import { mapActions, mapGetters, mapMutations } from "vuex";
import notification from "@/helpers/notification/notification";
import { switchNetwork } from "@/helpers/chains/switchNetwork";
import { notificationErrorMsg } from "@/helpers/notification/notificationError.js";
export default {
props: {
Expand Down Expand Up @@ -205,16 +205,18 @@ export default {
);
try {
const config = await prepareWriteContract({
const { request } = await simulateContractHelper({
address: this.pool.lockContract.address,
abi: this.pool.lockContract.abi,
functionName: "stake",
args: [this.inputAmount],
});
const { hash } = await writeContract(config);
const hash = await writeContractHelper(request);
const { result, error } = await waitForTransaction({ hash });
const { result, error } = await waitForTransactionReceiptHelper({
hash,
});
await this.$emit("updatePoolInfo");
Expand Down Expand Up @@ -244,16 +246,18 @@ export default {
);
try {
const config = await prepareWriteContract({
const { request } = await simulateContractHelper({
address: this.pool.lockContract.address,
abi: this.pool.lockContract.abi,
functionName: "stakeLocked",
args: [this.inputAmount, now + 100],
});
const { hash } = await writeContract(config);
const hash = await writeContractHelper(request);
const { result, error } = await waitForTransaction({ hash });
const { result, error } = await waitForTransactionReceiptHelper({
hash,
});
await this.$emit("updatePoolInfo");
Expand Down
24 changes: 13 additions & 11 deletions src/components/pools/pool/actions/Unstake.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@
</template>

<script>
import { defineAsyncComponent } from "vue";
import { mapActions, mapGetters, mapMutations } from "vuex";
import {
prepareWriteContract,
waitForTransaction,
writeContract,
} from "@wagmi/core";
writeContractHelper,
simulateContractHelper,
waitForTransactionReceiptHelper,
} from "@/helpers/walletClienHelper";
import { formatUnits } from "viem";
import { notificationErrorMsg } from "@/helpers/notification/notificationError.js";
import notification from "@/helpers/notification/notification";
import { defineAsyncComponent } from "vue";
import { trimZeroDecimals } from "@/helpers/numbers";
import { formatTokenBalance } from "@/helpers/filters";
import { mapActions, mapGetters, mapMutations } from "vuex";
import notification from "@/helpers/notification/notification";
import { switchNetwork } from "@/helpers/chains/switchNetwork";
import { notificationErrorMsg } from "@/helpers/notification/notificationError.js";
export default {
props: {
Expand Down Expand Up @@ -166,16 +166,18 @@ export default {
);
try {
const config = await prepareWriteContract({
const { request } = await simulateContractHelper({
address: this.pool.lockContract.address,
abi: this.pool.lockContract.abi,
functionName: "withdraw",
args: [this.inputAmount],
});
const { hash } = await writeContract(config);
const hash = await writeContractHelper(request);
const { result, error } = await waitForTransaction({ hash });
const { result, error } = await waitForTransactionReceiptHelper({
hash,
});
await this.$emit("updatePoolInfo");
Expand Down
4 changes: 2 additions & 2 deletions src/components/popups/GMStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ import { useImage } from "@/helpers/useImage";
import { formatTokenBalance } from "@/helpers/filters";
import BaseLoader from "@/components/base/BaseLoader.vue";
import notification from "@/helpers/notification/notification";
import { getProviderByChainId } from "@/helpers/getProviderByChainId";
import { getEthersProvider } from "@/helpers/chains/getChainsInfo";
import {
ORDER_PENDING,
Expand Down Expand Up @@ -196,7 +196,7 @@ export default {
}),
provider() {
return getProviderByChainId(this.cauldronObject.config.chainId);
return getEthersProvider(this.cauldronObject.config.chainId);
},
popupTitle() {
Expand Down
Loading

0 comments on commit 671b7d9

Please sign in to comment.