Skip to content

Commit

Permalink
chore: Bump up wagmi viem (#8484)
Browse files Browse the repository at this point in the history
  • Loading branch information
memoyil authored Dec 1, 2023
1 parent 418c8f7 commit 2ec03f1
Show file tree
Hide file tree
Showing 26 changed files with 178 additions and 137 deletions.
18 changes: 18 additions & 0 deletions .changeset/eighty-pants-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@pancakeswap/position-managers': patch
'@pancakeswap/widgets-internal': patch
'@pancakeswap/smart-router': patch
'@pancakeswap/multicall': patch
'@pancakeswap/sdk': patch
'@pancakeswap/gauges': patch
'@pancakeswap/v3-sdk': patch
'@pancakeswap/farms': patch
'@pancakeswap/pools': patch
'@pancakeswap/uikit': patch
'@pancakeswap/wagmi': patch
'@pancakeswap/ifos': patch
'routing-api': patch
'scripts': patch
---

chore: Bump up gauges
2 changes: 1 addition & 1 deletion apis/farms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"itty-router": "^2.6.1",
"itty-router-extras": "^0.4.2",
"lodash": "^4.17.21",
"viem": "1.15.1",
"viem": "1.19.9",
"zod": "^3.22.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apis/routing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"graphql-request": "5.0.0",
"itty-router": "^2.6.1",
"itty-router-extras": "^0.4.2",
"viem": "1.15.1"
"viem": "1.19.9"
},
"devDependencies": {
"@cloudflare/workers-types": "^3.10.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"react-dom": "^18.2.0",
"styled-components": "6.0.7",
"styled-jsx": "^5.1.2",
"viem": "1.15.1"
"viem": "1.19.9"
},
"devDependencies": {
"@next/eslint-plugin-next": "13.4.2",
Expand Down
4 changes: 2 additions & 2 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
"swr": "^2.2.4",
"tiny-invariant": "^1.3.0",
"uuid": "^8.0.0",
"viem": "1.15.1",
"wagmi": "1.4.3",
"viem": "1.19.9",
"wagmi": "1.4.7",
"zod": "^3.22.3"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ const useCakeBenefits = () => {
let iCake = ''
let vCake = { vaultScore: '0', totalScore: '0' }
if (lockPosition === VaultPosition.Locked) {
// @ts-ignore
// TODO: Fix viem
const credit = await ifoCreditAddressContract.read.getUserCredit([account])
iCake = getBalanceNumber(new BigNumber(credit.toString())).toLocaleString('en', { maximumFractionDigits: 3 })

Expand Down
11 changes: 8 additions & 3 deletions apps/web/src/hooks/useApproveCallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,20 @@ export function useApproveCallback(
let useExact = false

const estimatedGas = await tokenContract.estimateGas
.approve([spender as Address, MaxUint256], {
account: tokenContract.account,
})
.approve(
[spender as Address, MaxUint256], // TODO: Fix viem
// @ts-ignore
{
account: tokenContract.account,
},
)
.catch(() => {
// general fallback for tokens who restrict approval amounts
useExact = true
return tokenContract.estimateGas
.approve(
[spender as Address, overrideAmountApprove ?? amountToApprove?.quotient ?? targetAmount ?? MaxUint256],
// @ts-ignore
{
account: tokenContract.account,
},
Expand Down
4 changes: 4 additions & 0 deletions apps/web/src/utils/contractHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ export const getContract = <TAbi extends Abi | unknown[], TWalletClient extends
const c = viemGetContract({
abi,
address,
// TODO: Fix viem
// @ts-ignore
publicClient: publicClient ?? viemClients[chainId],
// TODO: Fix viem
// @ts-ignore
walletClient: signer,
})
return {
Expand Down
21 changes: 14 additions & 7 deletions apps/web/src/views/AddLiquidity/AddStableLiquidity/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,14 @@ export default function AddStableLiquidity({
const value = (currencyB?.isNative ? parsedAmountB : parsedAmountA).quotient
value_ = value
call = nativeHelperContract.estimateGas
.add_liquidity(args, {
value,
account: contract.account,
})
.add_liquidity(
args, // TODO: Fix viem
// @ts-ignore
{
value,
account: contract.account,
},
)
.then((estimatedGasLimit) => {
return nativeHelperContract.write.add_liquidity(args, {
gas: calculateGasMargin(estimatedGasLimit),
Expand All @@ -234,9 +238,12 @@ export default function AddStableLiquidity({
const args = [tokenAmounts, minLPOutput || lpMintedSlippage] as const
args_ = args
call = stableSwapContract.estimateGas
.add_liquidity(args, {
account: contract.account,
})
.add_liquidity(
args, // @ts-ignore
{
account: contract.account,
},
)
.then((estimatedGasLimit) => {
return stableSwapContract.write.add_liquidity(args, {
gas: calculateGasMargin(estimatedGasLimit),
Expand Down
6 changes: 5 additions & 1 deletion apps/web/src/views/AddLiquidityV3/Migrate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,11 @@ function V2PairMigrate({
setConfirmingMigration(true)

migrator.estimateGas
.multicall([data], { account: migrator.account!, value: 0n })
.multicall(
[data], // TODO: Fix viem
// @ts-ignore
{ account: migrator.account!, value: 0n },
)
.then((gasEstimate) => {
return migrator.write
.multicall([data], { gas: calculateGasMargin(gasEstimate), account, chain: migrator.chain, value: 0n })
Expand Down
2 changes: 1 addition & 1 deletion packages/farms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"bignumber.js": "^9.0.0",
"dayjs": "^1.11.10",
"lodash": "^4.17.21",
"viem": "1.15.1"
"viem": "1.19.9"
}
}
2 changes: 1 addition & 1 deletion packages/gauges/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"@pancakeswap/chains": "workspace:^",
"@pancakeswap/tokens": "workspace:^",
"@pancakeswap/v3-sdk": "workspace:^",
"viem": "1.15.1"
"viem": "1.19.9"
}
}
8 changes: 4 additions & 4 deletions packages/ifos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"@pancakeswap/sdk": "workspace:*",
"@pancakeswap/tokens": "workspace:*",
"@pancakeswap/utils": "workspace:*",
"viem": "^1.15.1",
"wagmi": "^1.4.3"
"viem": "1.19.9",
"wagmi": "1.4.7"
},
"dependencies": {
"@layerzerolabs/scan-client": "^0.0.6",
Expand All @@ -24,7 +24,7 @@
"@pancakeswap/tokens": "workspace:*",
"@pancakeswap/tsconfig": "workspace:*",
"@pancakeswap/utils": "workspace:*",
"viem": "1.15.1",
"wagmi": "1.4.3"
"viem": "1.19.9",
"wagmi": "1.4.7"
}
}
5 changes: 5 additions & 0 deletions packages/ifos/src/queries/fetchUserIfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const getIfoCreditAddressContract = (
}
const publicClient = provider({ chainId })

// TODO: Fix viem
// @ts-ignore
return getContract({ abi: iCakeABI, address, publicClient, walletClient })
}

Expand All @@ -32,6 +34,8 @@ export const fetchPublicIfoData = async (chainId: ChainId | undefined, provider:

try {
const ifoCreditAddressContract = getIfoCreditAddressContract(chainId, provider)
// TODO: Fix viem
// @ts-ignore
const ceiling = await ifoCreditAddressContract.read.ceiling()
return {
ceiling: new BigNumber(ceiling.toString()).toJSON(),
Expand All @@ -55,6 +59,7 @@ export const fetchUserIfoCredit = async ({ account, chainId, provider }: Params)
}
try {
const ifoCreditAddressContract = getIfoCreditAddressContract(chainId, provider)
// @ts-ignore
const credit = await ifoCreditAddressContract.read.getUserCredit([account])
return new BigNumber(credit.toString()).toJSON()
} catch (error) {
Expand Down
2 changes: 2 additions & 0 deletions packages/ifos/src/utils/getInfoSenderContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export function getInfoSenderContract({ chainId, provider }: Params) {
return getContract({
abi: pancakeInfoSenderABI,
address: senderContractAddress,
// TODO: Fix viem
// @ts-ignore
publicClient: provider({ chainId }),
})
}
2 changes: 1 addition & 1 deletion packages/multicall/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": {
"@pancakeswap/sdk": "workspace:*",
"@pancakeswap/chains": "workspace:*",
"viem": "1.15.1"
"viem": "1.19.9"
},
"devDependencies": {
"@pancakeswap/tsconfig": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/pools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"@pancakeswap/chains": "workspace:*",
"bignumber.js": "^9.0.0",
"lodash": "^4.17.21",
"viem": "1.15.1",
"wagmi": "1.4.3"
"viem": "1.19.9",
"wagmi": "1.4.7"
},
"devDependencies": {
"@pancakeswap/tsconfig": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/position-managers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"@pancakeswap/chains": "workspace:*",
"bignumber.js": "^9.0.0",
"lodash": "^4.17.21",
"viem": "1.15.1",
"wagmi": "1.4.3"
"viem": "1.19.9",
"wagmi": "1.4.7"
},
"devDependencies": {
"@types/lodash": "^4.14.168",
Expand Down
2 changes: 1 addition & 1 deletion packages/smart-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"mnemonist": "^0.38.3",
"stats-lite": "^2.2.0",
"tiny-invariant": "^1.3.0",
"viem": "1.15.1",
"viem": "1.19.9",
"zod": "^3.22.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/swap-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"tiny-invariant": "^1.3.0",
"tiny-warning": "^1.0.3",
"toformat": "^2.0.0",
"viem": "1.15.1"
"viem": "1.19.9"
},
"devDependencies": {
"@types/big.js": "^4.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/uikit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"react-popper": "^2.3.0",
"styled-system": "^5.1.5",
"tslib": "^2.2.0",
"wagmi": "1.4.3"
"wagmi": "1.4.7"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/v3-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"tiny-invariant": "^1.3.0",
"tiny-warning": "^1.0.3",
"toformat": "^2.0.0",
"viem": "1.15.1"
"viem": "1.19.9"
},
"devDependencies": {
"@pancakeswap/utils": "workspace:*",
Expand Down
8 changes: 4 additions & 4 deletions packages/wagmi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"@blocto/sdk": "^0.5.4",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"viem": "^1.2.9",
"wagmi": "^1.4.3"
"viem": "1.19.9",
"wagmi": "1.4.7"
},
"devDependencies": {
"@blocto/sdk": "^0.5.4",
Expand All @@ -31,8 +31,8 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"tsup": "^6.7.0",
"viem": "1.15.1",
"wagmi": "1.4.3"
"viem": "1.19.9",
"wagmi": "1.4.7"
},
"exports": {
"./package.json": "./package.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/widgets-internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@pancakeswap/swap-sdk-core": "workspace:*",
"bignumber.js": "^9.0.0",
"lodash": "^4.17.21",
"viem": "1.15.1",
"viem": "1.19.9",
"d3": "^7.8.2",
"clsx": "^1.2.1",
"dayjs": "^1.11.10"
Expand Down
Loading

1 comment on commit 2ec03f1

@vercel
Copy link

@vercel vercel bot commented on 2ec03f1 Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

uikit – ./packages/uikit

uikit.pancake.run
uikit-git-develop.pancake.run

Please sign in to comment.