Skip to content

Commit a75fa79

Browse files
refactor: bump dependencies (#350)
Co-authored-by: palace22 <palazzolo1995@gmail.com>
1 parent 1afe453 commit a75fa79

14 files changed

Lines changed: 2271 additions & 1562 deletions

File tree

.changeset/clear-colts-see.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@folks-finance/xchain-sdk": patch
3+
---
4+
5+
bump dependencies

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export default tseslint.config(
4545
"@typescript-eslint/array-type": ["error", { default: "generic" }],
4646
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
4747
"@typescript-eslint/consistent-type-imports": ["error", { prefer: "type-imports" }],
48+
"@typescript-eslint/no-unnecessary-condition": "off",
4849
"@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true }],
4950
"@typescript-eslint/switch-exhaustiveness-check": "error",
5051
"unicorn/better-regex": "error",

examples/borrow.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ async function main() {
5858
const isStableRate = false;
5959

6060
let maxStableRate;
61-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
6261
if (isStableRate) {
6362
const poolInfo = await FolksPool.read.poolInfo(tokenId);
6463
const interestRate = poolInfo.stableBorrowData.interestRate[0];

package.json

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,30 +38,31 @@
3838
"release": "pnpm build && changeset publish"
3939
},
4040
"dependencies": {
41-
"dnum": "^2.13.1",
42-
"viem": "^2.39.3"
41+
"dnum": "^2.17.0",
42+
"viem": "^2.47.5"
4343
},
4444
"devDependencies": {
45-
"@changesets/changelog-github": "^0.5.0",
46-
"@changesets/cli": "^2.27.7",
47-
"@commitlint/cli": "^19.3.0",
48-
"@commitlint/config-conventional": "^19.2.2",
49-
"@commitlint/cz-commitlint": "^19.2.0",
50-
"@eslint/js": "^9.2.0",
51-
"@types/node": "^20.12.12",
52-
"@typescript-eslint/parser": "^7.10.0",
53-
"commitizen": "^4.3.0",
54-
"eslint": "^9.2.0",
55-
"eslint-config-prettier": "^9.1.0",
56-
"eslint-import-resolver-typescript": "^3.6.1",
57-
"eslint-plugin-import-x": "^0.5.0",
58-
"eslint-plugin-unicorn": "^53.0.0",
59-
"globals": "^15.2.0",
60-
"husky": "^9.0.11",
61-
"lint-staged": "^15.2.2",
62-
"prettier": "^3.2.5",
63-
"typescript": "^5.4.5",
64-
"typescript-eslint": "^7.9.0"
45+
"@changesets/changelog-github": "^0.5.2",
46+
"@changesets/cli": "^2.30.0",
47+
"@commitlint/cli": "^19.8.1",
48+
"@commitlint/config-conventional": "^19.8.1",
49+
"@commitlint/cz-commitlint": "^19.8.1",
50+
"@eslint/js": "^9.39.4",
51+
"@types/node": "^20.19.37",
52+
"@typescript-eslint/eslint-plugin": "^8.57.1",
53+
"@typescript-eslint/parser": "^8.57.1",
54+
"commitizen": "^4.3.1",
55+
"eslint": "^9.39.4",
56+
"eslint-config-prettier": "^9.1.2",
57+
"eslint-import-resolver-typescript": "^3.10.1",
58+
"eslint-plugin-import-x": "^0.5.3",
59+
"eslint-plugin-unicorn": "^63.0.0",
60+
"globals": "^15.15.0",
61+
"husky": "^9.1.7",
62+
"lint-staged": "^15.5.2",
63+
"prettier": "^3.8.1",
64+
"typescript": "^5.9.3",
65+
"typescript-eslint": "^8.57.1"
6566
},
6667
"config": {
6768
"commitizen": {

pnpm-lock.yaml

Lines changed: 2207 additions & 1508 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/chains/evm/common/utils/contract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export async function sendERC20Approve(
5858

5959
// approve if not enough
6060
if (allowance < amount)
61-
return await erc20.write.approve([spender, BigInt(amount)], {
61+
return await erc20.write.approve([spender, amount], {
6262
account: getEvmSignerAccount(signer),
6363
chain: signer.chain,
6464
});

src/chains/evm/common/utils/message.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ export function buildSendTokenExtraArgsWhenRemoving(
8787
case TokenType.NATIVE:
8888
case TokenType.ERC20:
8989
return "0x";
90-
default:
90+
case TokenType.CROSS_CHAIN:
9191
return extraArgsToBytes(folksTokenType.address, spokeAddress, amount);
92+
default:
93+
return exhaustiveCheck(type);
9294
}
9395
}
9496

@@ -102,8 +104,10 @@ export function buildSendTokenExtraArgsWhenAdding(
102104
case TokenType.NATIVE:
103105
case TokenType.ERC20:
104106
return "0x";
105-
default:
107+
case TokenType.CROSS_CHAIN:
106108
return extraArgsToBytes(folksTokenType.address, hubPoolAddress, amount);
109+
default:
110+
return exhaustiveCheck(type);
107111
}
108112
}
109113

@@ -639,13 +643,9 @@ async function getGasToSubtract(
639643
to: EvmAddress,
640644
data: Hex,
641645
): Promise<bigint> {
642-
switch (destinationChainId) {
643-
case FOLKS_CHAIN_ID.ARBITRUM:
644-
case FOLKS_CHAIN_ID.ARBITRUM_SEPOLIA:
645-
return getArbitrumL1Estimation(provider, to, data);
646-
default:
647-
return 0n;
648-
}
646+
if (destinationChainId === FOLKS_CHAIN_ID.ARBITRUM || destinationChainId === FOLKS_CHAIN_ID.ARBITRUM_SEPOLIA)
647+
return getArbitrumL1Estimation(provider, to, data);
648+
return 0n;
649649
}
650650

651651
async function getArbitrumL1Estimation(provider: Client, to: EvmAddress, data: Hex): Promise<bigint> {

src/chains/evm/hub/modules/folks-hub-account.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function getAccountInfo(
2323
const accountManager = getAccountManagerContract(provider, hubChain.accountManagerAddress);
2424

2525
// get chain ids to check
26-
folksChainIds = folksChainIds ? folksChainIds : getFolksChainIdsByNetwork(network);
26+
folksChainIds = folksChainIds ?? getFolksChainIdsByNetwork(network);
2727

2828
// define return variable
2929
const accountInfo: AccountInfo = {
@@ -74,7 +74,7 @@ export async function getAccountIdByAddress(
7474
const accountManager = getAccountManagerContract(provider, hubChain.accountManagerAddress);
7575

7676
// get chain ids to check
77-
folksChainIds = folksChainIds ? folksChainIds : getFolksChainIdsByNetwork(network);
77+
folksChainIds = folksChainIds ?? getFolksChainIdsByNetwork(network);
7878

7979
const accountIds = await multicall(provider, {
8080
contracts: folksChainIds.map((folksChainId) => ({

src/chains/evm/hub/modules/folks-hub-loan.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,20 +296,20 @@ export async function getLoanTypeInfo(
296296
isDeprecated,
297297
reward: {
298298
minimumAmount,
299-
collateralSpeed: [BigInt(collateralSpeed), 18],
300-
borrowSpeed: [BigInt(borrowSpeed), 18],
299+
collateralSpeed: [collateralSpeed, 18],
300+
borrowSpeed: [borrowSpeed, 18],
301301
collateralRewardIndex: calcRewardIndex(
302302
collateralUsed,
303303
minimumAmount,
304-
[BigInt(oldCollateralRewardIndex), 18],
305-
[BigInt(collateralSpeed), 18],
304+
[oldCollateralRewardIndex, 18],
305+
[collateralSpeed, 18],
306306
lastUpdateTimestamp,
307307
),
308308
borrowRewardIndex: calcRewardIndex(
309309
borrowUsed,
310310
minimumAmount,
311-
[BigInt(oldBorrowRewardIndex), 18],
312-
[BigInt(borrowSpeed), 18],
311+
[oldBorrowRewardIndex, 18],
312+
[borrowSpeed, 18],
313313
lastUpdateTimestamp,
314314
),
315315
},
@@ -319,7 +319,7 @@ export async function getLoanTypeInfo(
319319
return {
320320
loanTypeId,
321321
deprecated,
322-
loanTargetHealth: [BigInt(loanTargetHealth), 4],
322+
loanTargetHealth: [loanTargetHealth, 4],
323323
pools,
324324
};
325325
}

src/chains/evm/hub/modules/folks-hub-pool.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ export async function getPoolInfo(
199199
averageInterestYield: compoundEverySecond([stableBorrowAverageInterestRate, 18]),
200200
},
201201
capsData: {
202-
deposit: BigInt(depositCap),
203-
borrow: BigInt(borrowCap),
204-
stableBorrowPercentage: [BigInt(stableBorrowPercentageCap), 18],
202+
deposit: depositCap,
203+
borrow: borrowCap,
204+
stableBorrowPercentage: [stableBorrowPercentageCap, 18],
205205
},
206206
configData: {
207207
deprecated,

0 commit comments

Comments
 (0)