Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update dependencies 📦 #4981

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions apps/api/src/helpers/score/getAndStoreHeyNativeMintNftScore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import type { Address } from 'viem';

import logger from '@hey/helpers/logger';
import heyPg from 'src/db/heyPg';
import { createPublicClient, http } from 'viem';
import { zora } from 'viem/chains';

const getAndStoreHeyNativeMintNftScore = async (
id: string,
address: Address
) => {
try {
const client = createPublicClient({
chain: zora,
transport: http('https://rpc.zora.energy')
});

const zorbBalance = await client.readContract({
abi: [
{
inputs: [
{ internalType: 'address', name: 'account', type: 'address' },
{ internalType: 'uint256', name: 'id', type: 'uint256' }
],
name: 'balanceOf',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function'
}
],
address: '0xF2086c0EAA8b34b0Eef73920D0b1B53f4146e2e4',
args: [address as Address, 1n],
functionName: 'balanceOf'
});

const hasZorb = zorbBalance === 1n;

if (hasZorb) {
await heyPg.query(
`
INSERT INTO "AdjustedProfileScore" (score, reason, "profileId")
VALUES (2000, 'ZorbHolder', $1)
ON CONFLICT ("profileId", reason)
DO NOTHING;
`,
[id]
);

logger.info(`BJ - Zorb holder score upserted for ${id} - ${address}`);
}

return true;
} catch {
logger.error(
`BJ - Failed to get and store Zorb score for ${id} - ${address}`
);
return false;
}
};

export default getAndStoreHeyNativeMintNftScore;
2 changes: 1 addition & 1 deletion apps/og/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@hey/data": "workspace:*",
"@hey/helpers": "workspace:*",
"@hey/lens": "workspace:*",
"next": "^14.2.3",
"next": "^14.2.4",
"react": "^18.3.1"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@livepeer/react": "3.1.9",
"@radix-ui/react-hover-card": "^1.0.7",
"@rajesh896/broprint.js": "^2.1.1",
"@tanstack/react-query": "^5.40.1",
"@tanstack/react-query": "^5.44.0",
"@thirdweb-dev/storage": "^2.0.15",
"@uidotdev/usehooks": "^2.4.1",
"@xmtp/content-type-reaction": "^1.1.7",
Expand All @@ -48,7 +48,7 @@
"framer-motion": "^11.2.10",
"graphql": "^16.8.1",
"idb-keyval": "^6.2.1",
"next": "^14.2.3",
"next": "^14.2.4",
"next-themes": "^0.3.0",
"nft-openaction-kit": "^1.0.28",
"party-js": "^2.2.0",
Expand Down Expand Up @@ -78,7 +78,7 @@
"use-resize-observer": "^9.1.0",
"uuid": "^10.0.0",
"viem": "^2.13.8",
"wagmi": "^2.9.11",
"wagmi": "^2.10.0",
"zod": "^3.23.8",
"zustand": "^4.5.2"
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
},
"devDependencies": {
"husky": "^9.0.11",
"prettier": "^3.3.1",
"prettier-plugin-tailwindcss": "^0.6.2",
"prettier": "^3.3.2",
"prettier-plugin-tailwindcss": "^0.6.3",
"start-server-and-test": "^2.0.4",
"turbo": "^2.0.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-tooltip": "^1.0.7",
"clsx": "^2.1.1",
"next": "^14.2.3",
"next": "^14.2.4",
"react": "^18.3.1",
"react-hook-form": "^7.51.5",
"tailwind-merge": "^2.3.0",
Expand Down
Loading
Loading