Skip to content
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
1 change: 1 addition & 0 deletions .github/workflows/workflow-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
api,
api-user,
app,
frontend,
backend,
indexer-balance,
indexer-base,
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/app/[locale]/multichain-txns/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import MultiChainTxns from '@/components/app/ChainAbstraction/MultiChainTxns';
import { getRequestBeta } from '@/utils/app/api';
import {
// McTxnsCountRes,
McTxnsReq,
MCTxnsReq,
} from 'nb-schemas';

export default async function TransactionList(props: {
searchParams: Promise<McTxnsReq>;
searchParams: Promise<MCTxnsReq>;
}) {
const searchParams = await props.searchParams;

Expand Down
20 changes: 10 additions & 10 deletions apps/app/src/components/app/ChainAbstraction/MultiChainTxns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import FaInbox from '@/components/app/Icons/FaInbox';
import Filter from '@/components/app/Icons/Filter';
import Near from '@/components/app/Icons/Near';
import { AddressOrTxnsLink } from '@/components/app/common/HoverContextProvider';
import { McTxnCount, McTxns } from 'nb-schemas';
import { MCTxnCount, MCTxn } from 'nb-schemas';
import { useNetworkIcons } from '@/hooks/app/useNetworkIcons';
import { FilterKind } from '@/utils/types';
import Skeleton from '@/components/app/skeleton/common/Skeleton';

interface MultiChainTxnsProps {
dataPromise: Promise<{ data: McTxns[]; meta?: { cursor?: string } }>;
countPromise: Promise<McTxnCount>;
dataPromise: Promise<{ data: MCTxn[]; meta?: { cursor?: string } }>;
countPromise: Promise<MCTxnCount>;
isTab: boolean;
tab: string;
}
Expand Down Expand Up @@ -136,7 +136,7 @@ const MultiChainTxns = ({

const columns: any = [
{
cell: (row: McTxns) =>
cell: (row: MCTxn) =>
row?.receipt_id && row?.transaction_hash ? (
<Tooltip
className={'left-20 max-w-[200px]'}
Expand All @@ -163,7 +163,7 @@ const MultiChainTxns = ({
'pl-6 pr-4 py-4 text-left whitespace-nowrap text-xs font-semibold text-nearblue-600 dark:text-neargray-10 uppercase tracking-wider',
},
{
cell: (row: McTxns) =>
cell: (row: MCTxn) =>
row?.transaction_hash ? (
<span>
<Tooltip
Expand Down Expand Up @@ -199,7 +199,7 @@ const MultiChainTxns = ({
'px-4 py-4 text-left whitespace-nowrap text-xs font-semibold text-nearblue-600 dark:text-neargray-10 uppercase tracking-wider',
},
{
cell: (row: McTxns) =>
cell: (row: MCTxn) =>
row?.account_id ? (
<span>
<Tooltip
Expand Down Expand Up @@ -286,7 +286,7 @@ const MultiChainTxns = ({
thClassName: 'px-4 py-4',
},
{
cell: (row: McTxns) =>
cell: (row: MCTxn) =>
row?.dest_txn ? (
<span>
<Tooltip
Expand Down Expand Up @@ -331,7 +331,7 @@ const MultiChainTxns = ({
'px-4 py-4 text-left whitespace-nowrap text-xs font-semibold text-nearblue-600 dark:text-neargray-10 uppercase tracking-wider',
},
{
cell: (row: McTxns) =>
cell: (row: MCTxn) =>
row?.dest_address ? (
<span>
<Tooltip
Expand Down Expand Up @@ -379,7 +379,7 @@ const MultiChainTxns = ({
'px-4 py-4 text-left whitespace-nowrap text-xs font-semibold text-nearblue-600 dark:text-neargray-10 uppercase tracking-wider',
},
{
cell: (row: McTxns) =>
cell: (row: MCTxn) =>
row?.block?.block_hash && row?.block?.block_height ? (
<span>
<Link
Expand All @@ -402,7 +402,7 @@ const MultiChainTxns = ({
'px-4 py-4 text-left text-xs font-semibold text-nearblue-600 dark:text-neargray-10 uppercase tracking-wider whitespace-nowrap',
},
{
cell: (row: McTxns) =>
cell: (row: MCTxn) =>
row?.block?.block_timestamp ? (
<span>
<Timestamp
Expand Down
6 changes: 3 additions & 3 deletions apps/app/src/components/app/ChainAbstraction/Stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import MiniChart from '@/components/app/Charts/MiniChart';
import BarChart from '@/components/app/Icons/BarChart';
import Skeleton from '@/components/app/skeleton/common/Skeleton';
import { use } from 'react';
import { McTxnsCountRes } from 'nb-schemas';
import { MCTxnCountRes } from 'nb-schemas';
import { DestinationChain } from 'nb-types';

interface StatsProps {
dataChartPromise: Promise<any>;
error: boolean;
txns24HrCountPromise: Promise<McTxnsCountRes>;
txnsTotalCountPromise: Promise<McTxnsCountRes>;
txns24HrCountPromise: Promise<MCTxnCountRes>;
txnsTotalCountPromise: Promise<MCTxnCountRes>;
}

const Stats = ({
Expand Down
8 changes: 8 additions & 0 deletions apps/frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Dockerfile
.dockerignore
node_modules
npm-debug.log
README.md
.next
docker
.git
3 changes: 3 additions & 0 deletions apps/frontend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.next
.turbo
dist
4 changes: 4 additions & 0 deletions apps/frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
extends: ['custom-next'],
root: true,
};
41 changes: 41 additions & 0 deletions apps/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
8 changes: 8 additions & 0 deletions apps/frontend/.mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mcpServers": {
"next-devtools": {
"command": "npx",
"args": ["-y", "next-devtools-mcp@latest"]
}
}
}
5 changes: 5 additions & 0 deletions apps/frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"plugins": ["prettier-plugin-tailwindcss"]
}
33 changes: 33 additions & 0 deletions apps/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM node:24-alpine AS base
RUN apk update
RUN apk add --no-cache libc6-compat

WORKDIR /app

FROM base AS prepare
RUN yarn global add turbo@1
COPY . .
RUN turbo prune frontend --docker

FROM base AS builder
COPY --from=prepare /app/out/json/ .
RUN yarn install
COPY --from=prepare /app/out/full/ .
RUN yarn turbo build

FROM base AS runner
WORKDIR /app

RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001

USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV NODE_ENV=production

COPY --from=builder --chown=nextjs:nodejs /app/apps/frontend/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/apps/frontend/.next/static ./apps/frontend/.next/static
COPY --from=builder --chown=nextjs:nodejs /app/apps/frontend/public ./apps/frontend/public

CMD HOSTNAME="0.0.0.0" node apps/frontend/server.js
36 changes: 36 additions & 0 deletions apps/frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
19 changes: 19 additions & 0 deletions apps/frontend/codemod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = function (fileInfo, api) {
const j = api.jscodeshift;

return j(fileInfo.source)
.find(j.FunctionDeclaration)
.replaceWith((path) => {
const { node } = path;
const arrowFunction = j.arrowFunctionExpression(
node.params,
node.body,
false,
);

return j.variableDeclaration('const', [
j.variableDeclarator(node.id, arrowFunction),
]);
})
.toSource();
};
22 changes: 22 additions & 0 deletions apps/frontend/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/app/globals.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"iconLibrary": "lucide",
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"registries": {}
}
7 changes: 7 additions & 0 deletions apps/frontend/next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { NextConfig } from 'next';

const nextConfig: NextConfig = {
output: 'standalone',
};

export default nextConfig;
65 changes: 65 additions & 0 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint",
"codemod": "jscodeshift -t codemod.js --parser tsx --extensions tsx src/ui/*.tsx"
},
"dependencies": {
"@highcharts/react": "~4.1.0",
"@hot-labs/near-connect": "~0.8.1",
"@radix-ui/react-accordion": "^1.2.12",
"@radix-ui/react-checkbox": "~1.3.3",
"@radix-ui/react-collapsible": "~1.1.12",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-dropdown-menu": "~2.1.16",
"@radix-ui/react-label": "~2.1.8",
"@radix-ui/react-navigation-menu": "~1.2.14",
"@radix-ui/react-popover": "^1.1.15",
"@radix-ui/react-scroll-area": "~1.2.10",
"@radix-ui/react-select": "~2.2.6",
"@radix-ui/react-separator": "~1.1.8",
"@radix-ui/react-slot": "~1.2.4",
"@radix-ui/react-switch": "~1.2.6",
"@radix-ui/react-tabs": "~1.1.13",
"@radix-ui/react-tooltip": "~1.2.8",
"@walletconnect/sign-client": "~2.23.1",
"ahooks": "~3.9.6",
"big.js": "~7.0.1",
"class-variance-authority": "~0.7.1",
"clsx": "~2.1.1",
"cmdk": "^1.1.1",
"es-toolkit": "~1.43.0",
"highcharts": "~12.4.0",
"next": "~16.1.1",
"react": "~19.2.3",
"react-dom": "~19.2.3",
"react-error-boundary": "~6.0.0",
"react-icons": "~5.5.0",
"react-timeago": "~8.3.0",
"rosetta": "~1.1.0",
"sonner": "~2.0.7",
"tailwind-merge": "~3.4.0",
"zod": "~4.1.13"
},
"devDependencies": {
"@tailwindcss/postcss": "~4",
"@types/big.js": "~6.2.2",
"@types/node": "~20",
"@types/react": "~19",
"@types/react-dom": "~19",
"eslint-config-custom-next": "*",
"jscodeshift": "~17.3.0",
"nb-schemas": "*",
"nb-tsconfig": "*",
"nb-types": "*",
"prettier-plugin-tailwindcss": "~0.7.2",
"tailwindcss": "~4",
"tw-animate-css": "~1.4.0",
"typescript": "~5"
}
}
7 changes: 7 additions & 0 deletions apps/frontend/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const config = {
plugins: {
'@tailwindcss/postcss': {},
},
};

export default config;
Binary file added apps/frontend/public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/frontend/public/favicon.ico
Binary file not shown.
Loading
Loading