diff --git a/apps/api.nameai.io/README.md b/apps/api.nameai.io/README.md index ab5ec117c..607e9c08f 100644 --- a/apps/api.nameai.io/README.md +++ b/apps/api.nameai.io/README.md @@ -1,6 +1,7 @@ # NameAI ## API + The API extends the NameGuard API and is fully compatible with it. NameAI-specific endpoints are under the `https://api.nameai.io` path prefix and @@ -11,10 +12,13 @@ API documentation is available at [api.nameai.io/docs](https://api.nameai.io/doc Lambda is publicly accessible under given domain [api.nameai.io](https://api.nameai.io) ## SDK + The NameAI SDK provides a convenient way to interact with the NameAI API in your JavaScript/TypeScript applications. You can find the SDK implementation and documentation at [github.com/namehash/namekit/tree/main/packages/nameai-sdk](https://github.com/namehash/namekit/tree/main/packages/nameai-sdk). # AWS deploy + ## Requirements + - Poetry - Python package management - Docker - building image for lambda @@ -23,9 +27,11 @@ The NameAI SDK provides a convenient way to interact with the NameAI API in your Before you can use the `deploy_lambda.sh` script to deploy your AWS Lambda function, you need to ensure that several prerequisites are met. This section outlines the necessary steps and configurations required for a successful deployment. ### 1. AWS Account Setup + You must have an active AWS account. If you do not have one, you can create it at [AWS Free Tier](https://aws.amazon.com/free/). ### 2. AWS IAM Permissions + Ensure that the AWS user or role executing the script has the necessary permissions to interact with AWS Lambda, ECR (Elastic Container Registry), and Route 53. The following permissions are typically required: - `lambda:*` - for managing Lambda functions. @@ -36,6 +42,7 @@ Ensure that the AWS user or role executing the script has the necessary permissi For detailed guidance on creating IAM policies, refer to the [AWS IAM documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html). ### 3. AWS Certificate Manager (ACM) + You need to create an AWS certificate in AWS Certificate Manager (ACM) for your Lambda function. This certificate is used for HTTPS communication. Follow these steps: - Go to the [AWS Certificate Manager](https://console.aws.amazon.com/acm/home). @@ -45,6 +52,7 @@ You need to create an AWS certificate in AWS Certificate Manager (ACM) for your For more information, refer to the guide on [Requesting a Public Certificate in AWS Certificate Manager](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html). ### 4. Amazon Route 53 Setup + You must have a hosted zone created in Amazon Route 53 to manage your domain's DNS settings. Follow these steps: - Go to the [Route 53 console](https://console.aws.amazon.com/route53/home). @@ -53,18 +61,21 @@ You must have a hosted zone created in Amazon Route 53 to manage your domain's D For guidance, refer to the documentation on [Creating a Hosted Zone in Route 53](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/CreatingHostedZone.html). ### 5. Relationship Between AWS Certificate and Hosted Zone + After creating the certificate and hosted zone, you need to validate the certificate and ensure that the domain name associated with the certificate is correctly configured in the hosted zone. Follow the guides on: - [Validating an ACM Certificate](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate.html). - [Using Route 53 to Route Traffic to Your Resources](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-resources.html). ### 6. Docker and AWS CLI Installation + Ensure that Docker and the AWS CLI are installed and configured on your machine. Follow these steps: - **Install Docker**: Follow the instructions on [Get Docker](https://docs.docker.com/get-docker/). - **Install AWS CLI**: Follow the instructions on [Installing the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html). ### 7. Environment Variables + You need to set up the following environment variables before running the script: - `PROVIDER_URI_MAINNET` @@ -77,6 +88,7 @@ You need to set up the following environment variables before running the script These variables should be populated with the appropriate values for your application. ### 8. GitHub Secrets Configuration + If you are using GitHub Actions for deployment, you need to configure the following secrets in your GitHub repository: - `AWS_ROLE` - The IAM role to assume for AWS actions. @@ -91,28 +103,33 @@ If you are using GitHub Actions for deployment, you need to configure the follow You can add these secrets in your GitHub repository settings under the "Secrets" section. ## Dockerfile + 1. Uses an ARM64 Python 3.11 base image optimized for AWS Lambda 2. Installs necessary dependencies 3. Copies the project files into the image 4. Sets the entry point for the Lambda function - # Getting Started + This section is describing how to setup running NameAI instance on local environment ## Environment variables + NameAI requires certain env variables propagated for it's NameGuard subcomponent. Those variables are defined and described in [.env.example](./.env.example) file which is a point of reference. Script responsible for running local NameAI instance is expecting those variables to be poulated in .env file before execution. ## Requirements + python3 with pip installed on local env ## Scripts + Running [start-local.sh](./start-local.sh) script will result in creating running NameAI instance on local environment. -This instance can be reached under [localhost:8000](localhost:8000) +This instance can be reached under [localhost:8000](localhost:8000) ## Static data generation + Static data is generated by running [generate_static_data.py](./nameai/generate_static_data.py) script. This script can be run manually with `poetry run python -m nameai.generate_static_data`. @@ -128,4 +145,4 @@ Visit our [website](https://namehashlabs.org/) to get in contact. Licensed under the MIT License, Copyright © 2023-present [NameHash Labs](https://namehashlabs.org). -See [LICENSE](./LICENSE) for more information. \ No newline at end of file +See [LICENSE](./LICENSE) for more information. diff --git a/apps/examples.nameguard.io/src/app/address/[address]/page.tsx b/apps/examples.nameguard.io/src/app/address/[address]/page.tsx index fc27bc5c6..1ffaa2bb9 100644 --- a/apps/examples.nameguard.io/src/app/address/[address]/page.tsx +++ b/apps/examples.nameguard.io/src/app/address/[address]/page.tsx @@ -9,7 +9,9 @@ export default async function Page({ }) { const { address } = params; - const data = await nameguard.getSecurePrimaryName(address, { returnNameGuardReport: true }); + const data = await nameguard.getSecurePrimaryName(address, { + returnNameGuardReport: true, + }); return (
diff --git a/apps/examples.nameguard.io/src/app/components/SecurePrimaryName.tsx b/apps/examples.nameguard.io/src/app/components/SecurePrimaryName.tsx index 688fc4de5..9fcc6f601 100644 --- a/apps/examples.nameguard.io/src/app/components/SecurePrimaryName.tsx +++ b/apps/examples.nameguard.io/src/app/components/SecurePrimaryName.tsx @@ -25,36 +25,31 @@ export async function SecurePrimaryName({ address }: Props) { headers(); // This function does not use the NameGuard API server - const data = await nameguard.getSecurePrimaryName(address, - { returnNameGuardReport: true }); + const data = await nameguard.getSecurePrimaryName(address, { + returnNameGuardReport: true, + }); const pillColor = - data.impersonation_estimate === "potential" ? - "bg-red-300" : - data.impersonation_estimate === "unlikely" ? - "bg-green-300" : - "bg-yellow-300"; + data.impersonation_estimate === "potential" + ? "bg-red-300" + : data.impersonation_estimate === "unlikely" + ? "bg-green-300" + : "bg-yellow-300"; const pillText = - data.impersonation_estimate === "potential" ? - "Potential impersonation!" : - data.impersonation_estimate === "unlikely" ? - "Name is secure" : - "No primary name!"; + data.impersonation_estimate === "potential" + ? "Potential impersonation!" + : data.impersonation_estimate === "unlikely" + ? "Name is secure" + : "No primary name!"; return (
-
- {data.display_name} -
+
{data.display_name}
-
- {address} -
+
{address}
-
- {pillText} -
+
{pillText}
); } diff --git a/apps/examples.nameguard.io/src/app/components/SecurePrimaryNameLoading.tsx b/apps/examples.nameguard.io/src/app/components/SecurePrimaryNameLoading.tsx index bcd83515b..da32ef9b7 100644 --- a/apps/examples.nameguard.io/src/app/components/SecurePrimaryNameLoading.tsx +++ b/apps/examples.nameguard.io/src/app/components/SecurePrimaryNameLoading.tsx @@ -7,9 +7,7 @@ export function SecurePrimaryNameLoading({ address }: Props) {
-
- {address} -
+
{address}
diff --git a/apps/nameai.io/app/page.tsx b/apps/nameai.io/app/page.tsx index 622301a18..17cf1ae1e 100644 --- a/apps/nameai.io/app/page.tsx +++ b/apps/nameai.io/app/page.tsx @@ -11,37 +11,6 @@ export default function Page() { <>
- {/* Integration Example Panel */} -
-
-
-
- -
- -
- - Example ENS ecosystem integration - - - Powering VisionScore - -
-
- -
-
+ props: React.HTMLAttributes, ) => { return ( { @@ -758,8 +757,6 @@ const getIconForExternalLinkHost = (host: ExternalLinkHosts): JSX.Element => { switch (host) { case ExternalLinkHosts.ENSDomains: return ; - case ExternalLinkHosts.Vision: - return ; default: return <>; } diff --git a/apps/namegraph.dev/components/collections/collection-card.tsx b/apps/namegraph.dev/components/collections/collection-card.tsx index c97d4a307..353f3ea30 100644 --- a/apps/namegraph.dev/components/collections/collection-card.tsx +++ b/apps/namegraph.dev/components/collections/collection-card.tsx @@ -39,7 +39,9 @@ export const CollectionCard = ({ className="ml-3 flex justify-center items-center rounded-md bg-background h-[72px] w-[72px] bg-gray-100" >
-

{collection.avatar_emoji}

+

+ {collection.avatar_emoji} +

diff --git a/apps/namegraph.dev/components/footer/service-provider-badge.tsx b/apps/namegraph.dev/components/footer/service-provider-badge.tsx index 073f6a2c8..976fc5ee5 100644 --- a/apps/namegraph.dev/components/footer/service-provider-badge.tsx +++ b/apps/namegraph.dev/components/footer/service-provider-badge.tsx @@ -1,5 +1,5 @@ export const ServiceProviderBadge = ( - props: React.HTMLAttributes + props: React.HTMLAttributes, ) => { return ( {
- {/* Integration Example Panel */} -
-
-
-
- -
- -
- - Example ENS ecosystem integration - - - - powering related name suggestions at Vision{" "} - - -
-
- -
-
diff --git a/apps/namegraph.dev/components/name/vision-icon.tsx b/apps/namegraph.dev/components/name/vision-icon.tsx deleted file mode 100644 index 97eeb15c4..000000000 --- a/apps/namegraph.dev/components/name/vision-icon.tsx +++ /dev/null @@ -1,574 +0,0 @@ -import { SVGProps } from "react"; - -export const EnsVisionIcon = (props: SVGProps) => { - return ( - - - - - - - - - - - - - - - - - - - - - - - ); -}; diff --git a/apps/namegraph.dev/components/ui/button.tsx b/apps/namegraph.dev/components/ui/button.tsx index be0dce840..7084276cc 100644 --- a/apps/namegraph.dev/components/ui/button.tsx +++ b/apps/namegraph.dev/components/ui/button.tsx @@ -1,8 +1,8 @@ -import * as React from "react" -import { Slot } from "@radix-ui/react-slot" -import { cva, type VariantProps } from "class-variance-authority" +import * as React from "react"; +import { Slot } from "@radix-ui/react-slot"; +import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const buttonVariants = cva( "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-950 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 dark:focus-visible:ring-neutral-300", @@ -17,7 +17,8 @@ const buttonVariants = cva( "border border-neutral-200 bg-white shadow-sm hover:bg-neutral-100 hover:text-neutral-900 dark:border-neutral-800 dark:bg-neutral-950 dark:hover:bg-neutral-800 dark:hover:text-neutral-50", secondary: "bg-neutral-100 text-neutral-900 shadow-sm hover:bg-neutral-100/80 dark:bg-neutral-800 dark:text-neutral-50 dark:hover:bg-neutral-800/80", - ghost: "hover:bg-neutral-100 hover:text-neutral-900 dark:hover:bg-neutral-800 dark:hover:text-neutral-50", + ghost: + "hover:bg-neutral-100 hover:text-neutral-900 dark:hover:bg-neutral-800 dark:hover:text-neutral-50", link: "text-neutral-900 underline-offset-4 hover:underline dark:text-neutral-50", }, size: { @@ -31,27 +32,27 @@ const buttonVariants = cva( variant: "default", size: "default", }, - } -) + }, +); export interface ButtonProps extends React.ButtonHTMLAttributes, VariantProps { - asChild?: boolean + asChild?: boolean; } const Button = React.forwardRef( ({ className, variant, size, asChild = false, ...props }, ref) => { - const Comp = asChild ? Slot : "button" + const Comp = asChild ? Slot : "button"; return ( - ) - } -) -Button.displayName = "Button" + ); + }, +); +Button.displayName = "Button"; -export { Button, buttonVariants } +export { Button, buttonVariants }; diff --git a/apps/namegraph.dev/components/ui/card.tsx b/apps/namegraph.dev/components/ui/card.tsx index be021b080..af6e5aa31 100644 --- a/apps/namegraph.dev/components/ui/card.tsx +++ b/apps/namegraph.dev/components/ui/card.tsx @@ -1,6 +1,6 @@ -import * as React from "react" +import * as React from "react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const Card = React.forwardRef< HTMLDivElement, @@ -10,12 +10,12 @@ const Card = React.forwardRef< ref={ref} className={cn( "rounded-xl border border-neutral-200 bg-white text-neutral-950 shadow dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50", - className + className, )} {...props} /> -)) -Card.displayName = "Card" +)); +Card.displayName = "Card"; const CardHeader = React.forwardRef< HTMLDivElement, @@ -26,8 +26,8 @@ const CardHeader = React.forwardRef< className={cn("flex flex-col space-y-1.5 p-6", className)} {...props} /> -)) -CardHeader.displayName = "CardHeader" +)); +CardHeader.displayName = "CardHeader"; const CardTitle = React.forwardRef< HTMLDivElement, @@ -38,8 +38,8 @@ const CardTitle = React.forwardRef< className={cn("font-semibold leading-none tracking-tight", className)} {...props} /> -)) -CardTitle.displayName = "CardTitle" +)); +CardTitle.displayName = "CardTitle"; const CardDescription = React.forwardRef< HTMLDivElement, @@ -50,16 +50,16 @@ const CardDescription = React.forwardRef< className={cn("text-sm text-neutral-500 dark:text-neutral-400", className)} {...props} /> -)) -CardDescription.displayName = "CardDescription" +)); +CardDescription.displayName = "CardDescription"; const CardContent = React.forwardRef< HTMLDivElement, React.HTMLAttributes >(({ className, ...props }, ref) => (
-)) -CardContent.displayName = "CardContent" +)); +CardContent.displayName = "CardContent"; const CardFooter = React.forwardRef< HTMLDivElement, @@ -70,7 +70,14 @@ const CardFooter = React.forwardRef< className={cn("flex items-center p-6 pt-0", className)} {...props} /> -)) -CardFooter.displayName = "CardFooter" +)); +CardFooter.displayName = "CardFooter"; -export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } +export { + Card, + CardHeader, + CardFooter, + CardTitle, + CardDescription, + CardContent, +}; diff --git a/apps/namegraph.dev/components/ui/input.tsx b/apps/namegraph.dev/components/ui/input.tsx index d9245ddbd..9ac9495e2 100644 --- a/apps/namegraph.dev/components/ui/input.tsx +++ b/apps/namegraph.dev/components/ui/input.tsx @@ -1,6 +1,6 @@ -import * as React from "react" +import * as React from "react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const Input = React.forwardRef>( ({ className, type, ...props }, ref) => { @@ -9,14 +9,14 @@ const Input = React.forwardRef>( type={type} className={cn( "flex h-9 w-full rounded-md border border-neutral-200 bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-neutral-950 placeholder:text-neutral-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-950 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:border-neutral-800 dark:file:text-neutral-50 dark:placeholder:text-neutral-400 dark:focus-visible:ring-neutral-300", - className + className, )} ref={ref} {...props} /> - ) - } -) -Input.displayName = "Input" + ); + }, +); +Input.displayName = "Input"; -export { Input } +export { Input }; diff --git a/apps/namegraph.dev/components/ui/pagination.tsx b/apps/namegraph.dev/components/ui/pagination.tsx index d3311054c..facef58f7 100644 --- a/apps/namegraph.dev/components/ui/pagination.tsx +++ b/apps/namegraph.dev/components/ui/pagination.tsx @@ -1,8 +1,8 @@ -import * as React from "react" -import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react" +import * as React from "react"; +import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"; -import { cn } from "@/lib/utils" -import { ButtonProps, buttonVariants } from "@/components/ui/button" +import { cn } from "@/lib/utils"; +import { ButtonProps, buttonVariants } from "@/components/ui/button"; const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (