Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
o-az committed Aug 6, 2023
1 parent c241fa0 commit 81b96a1
Show file tree
Hide file tree
Showing 13 changed files with 414 additions and 456 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
},
"search.exclude": {
"**/node_modules": true,
"pnpm-lock.yaml": true
"pnpm-lock.yaml": true,
"**/.turbo": true,
".eslintcache": true,
".prettiercache": true,
}
}
12 changes: 6 additions & 6 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
"clean": "rm -rf .turbo dist .eslintcache node_modules"
},
"dependencies": {
"hono": "^3.2.7",
"hono": "^3.3.4",
"pretty-cache-header": "^1.0.0",
"viem": "^1.2.7"
"viem": "^1.5.3"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20230518.0",
"@cloudflare/workers-types": "^4.20230801.0",
"@hono/sentry": "^0.2.1",
"bun": "^0.6.12",
"bun-types": "^0.6.12",
"bun": "^0.7.2",
"bun-types": "^0.7.2",
"linters": "workspace:*",
"tsconfig": "workspace:*",
"typescript": "^5.1.6",
"wrangler": "beta"
"wrangler": "^3.4.0"
},
"private": true,
"license": "GPL-3.0-or-later"
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export async function userBalances({
...item,
address: getAddress(item.address),
})),
chunkSize
chunkSize,
) as Array<Array<Token>>

const balancesResults = await Promise.allSettled(
Expand All @@ -130,7 +130,7 @@ export async function userBalances({
})
sleep(1)
return result
})
}),
)

const balances: Array<TokenBalance> = []
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function publicClient(
}: {
env: Env
options?: PublicClientOptions
}
},
): ReturnType<typeof createPublicClient> {
const httpTransports = rpcUrls(_chain, env)['http'].map(url =>
http(url, {
Expand All @@ -34,7 +34,7 @@ export function publicClient(
retryDelay: seconds(0.125),
timeout: seconds(10),
batch: true,
})
}),
)

return createPublicClient({
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/erc20-methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export async function hasBalanceOfBatch(chain: Chain, addresses: string[], envir
},
'latest',
],
}))
})),
),
})
const data = await response.json<Array<RPC_Response>>()
Expand Down
25 changes: 14 additions & 11 deletions apps/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ app.get(
staleIfError: '12hours',
staleWhileRevalidate: '1year',
}),
})
}),
)

app.use('*', async (context, next) => {
Expand All @@ -43,7 +43,7 @@ app.use('*', async (context, next) => {
sentry.captureMessage('Sentry caught an error"')
sentry.captureException(context.error)
}
}
},
)
return next()
})
Expand Down Expand Up @@ -121,14 +121,14 @@ app.on(

return context.json(
balances.filter(item => item.balance !== '0'),
200
200,
)
} catch (error) {
const errorMessage = error instanceof Error ? error.message : error
console.error(errorMessage)
return context.json({ ok: false, message: errorMessage }, 500)
}
}
},
)

app.get(
Expand Down Expand Up @@ -158,7 +158,7 @@ app.get(

const balance = await balanceOf({ client, walletAddress: address, token: fetchedToken })
return context.json(balance, 200)
}
},
)

/**
Expand Down Expand Up @@ -192,23 +192,26 @@ app.all(
walletAddress,
tokens,
})
})
}),
)

const fulfilledResults = promiseResult.filter(isFulfilled).flatMap(result => result.value)

const chainBalances = chainsTuples.reduce((accumulator, [, chainId]) => {
accumulator[chainId] = []
return accumulator
}, {} as Record<ChainID, Array<TokenBalance>>)
const chainBalances = chainsTuples.reduce(
(accumulator, [, chainId]) => {
accumulator[chainId] = []
return accumulator
},
{} as Record<ChainID, Array<TokenBalance>>,
)

for (const [, tokenBalance] of fulfilledResults.entries()) {
if (tokenBalance.balance == '0' || !isNotFalsy(tokenBalance)) continue
chainBalances[tokenBalance.chainId].push(tokenBalance)
}

return context.json(chainBalances, 200)
}
},
)

const port = 8_787
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function getChainToken(
}: {
chain: Chain
address: Address
}
},
): Promise<{ success: false; data: 'unsupported' } | { success: true; data: Token }> {
const response = await ffetch(environment)(`https://tokens.evm.workers.dev/${chain}/token/${address}`)

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
},
"devDependencies": {
"@turbo/codemod": "^1.10.12",
"@types/node": "^20.3.3",
"@types/node": "^20.4.8",
"bumpp": "^9.1.1",
"bun": "^0.6.12",
"bun-types": "^0.6.12",
"bun": "^0.7.2",
"bun-types": "^0.7.2",
"linters": "workspace:*",
"tsconfig": "workspace:*",
"turbo": "^1.10.7",
"turbo": "^1.10.12",
"typescript": "^5.1.6"
},
"packageManager": "pnpm@8.6.11",
Expand Down
10 changes: 5 additions & 5 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
"deploy-local": "bun lint && forge build && /bin/bash ./scripts/deploy.sh",
"deploy-local-build": "pnpm deploy-local && bun ./scripts/json-to-ts.ts",
"lint": "eslint --fix . --ext='js,cjs,mjs,ts,cts,mts,d.ts,json,yaml,toml' --ignore-path .gitignore --ignore-path .eslintignore --cache",
"format": "prettier . --write './**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx,json,md,sol}' --ignore-path .gitignore --ignore-path .eslintignore --ignore-unknown --cache",
"format": "prettier . --write './**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx,json,md,sol}' --ignore-path='./.eslintignore' --ignore-path='./.gitignore' --ignore-unknown --cache",
"typecheck": "tsc --noEmit",
"clean": "rm -rf out cache cache_hardhat artifacts"
},
"devDependencies": {
"@types/node": "^20.3.3",
"bun": "^0.6.12",
"@types/node": "^20.4.8",
"bun": "^0.7.2",
"dotenv": "^16.3.1",
"linters": "workspace:*",
"solhint": "^3.4.1",
"solhint": "^3.5.1",
"tsconfig": "workspace:*",
"typescript": "^5.1.6",
"viem": "^1.2.7"
"viem": "^1.5.3"
},
"dependencies": {
"@viem/anvil": "^0.0.6"
Expand Down
21 changes: 10 additions & 11 deletions packages/linters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@
"reinstall": "pnpm clean && pnpm install"
},
"dependencies": {
"prettier-plugin-sh": "^0.12.8",
"prettier-plugin-toml": "^0.3.1",
"@types/eslint": "^8.40.2",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"@types/eslint": "^8.44.2",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"eslint": "^8.46.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-toml": "^0.5.0",
"eslint-plugin-unicorn": "^47.0.0",
"eslint-plugin-unicorn": "^48.0.1",
"eslint-plugin-yml": "^1.8.0",
"toml-eslint-parser": "^0.6.0",
"solhint-plugin-prettier": "^0.0.5"
"prettier-plugin-sh": "^0.13.1",
"solhint-plugin-prettier": "^0.0.5",
"toml-eslint-parser": "^0.6.0"
}
}
2 changes: 1 addition & 1 deletion packages/linters/prettier.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
jsxSingleQuote: true,
arrowParens: 'avoid',
singleAttributePerLine: true,
plugins: [require.resolve('prettier-plugin-sh'), require.resolve('prettier-plugin-toml')],
plugins: [require.resolve('prettier-plugin-sh')],
overrides: [
{
files: '*.toml',
Expand Down
4 changes: 2 additions & 2 deletions packages/tsconfig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"dependencies": {
"@total-typescript/ts-reset": "^0.4.2",
"@types/node": "^20.3.3",
"bun-types": "^0.6.12"
"@types/node": "^20.4.8",
"bun-types": "^0.7.2"
}
}
Loading

0 comments on commit 81b96a1

Please sign in to comment.