├── tooling ├── eslint │ ├── vitejs.js │ ├── react.js │ ├── package.json │ └── base.js └── prettier │ ├── tsconfig.json │ ├── package.json │ └── index.js ├── packages ├── apibara │ ├── .gitignore │ ├── eslint.config.js │ ├── apibara.config.ts │ ├── tsconfig.json │ ├── env.ts │ └── package.json ├── starknet-types-07 │ ├── index.mjs │ └── package.json ├── starknet-types-08 │ ├── index.mjs │ └── package.json ├── starknet-types-09 │ ├── index.mjs │ └── package.json ├── db │ ├── tsconfig.json │ ├── src │ │ ├── schema │ │ │ ├── index.ts │ │ │ ├── dune.ts │ │ │ ├── velords.ts │ │ │ ├── auth.ts │ │ │ └── bridge.ts │ │ ├── index.ts │ │ ├── client.ts │ │ ├── poolClient.ts │ │ └── int8range.ts │ ├── eslint.config.js │ ├── drizzle.config.ts │ ├── env.ts │ └── package.json └── constants │ ├── src │ ├── index.ts │ ├── chains.ts │ ├── marketplace.ts │ └── bridge-addresses.ts │ ├── eslint.config.js │ └── package.json ├── apps └── account-portal │ ├── src │ ├── hooks │ │ ├── bridge │ │ │ ├── useBridgeL1Realms.ts │ │ │ ├── useWriteInitiateWithdrawRealms.ts │ │ │ ├── useWriteDepositRealms.ts │ │ │ ├── useWriteFinalizeWithdrawRealms.ts │ │ │ └── useBridgeL2Realms.ts │ │ ├── use-stark-name.ts │ │ ├── use-mobile.tsx │ │ ├── governance │ │ │ ├── use-voting-power.ts │ │ │ ├── use-current-delegate.ts │ │ │ ├── use-delegate-realms.ts │ │ │ └── use-vote-proposal.ts │ │ ├── token │ │ │ ├── L1 │ │ │ │ ├── useERC721SetApprovalForAll.tsx │ │ │ │ └── useERC721Approval.tsx │ │ │ └── L2 │ │ │ │ └── useERC721Approval.ts │ │ ├── use-wrong-network.ts │ │ ├── use-starknet-wallet.ts │ │ ├── use-velords-claims.ts │ │ ├── use-ipfs-pin.ts │ │ ├── use-l2-realms-claims.ts │ │ └── useSimulateTransactions.ts │ ├── gql │ │ ├── eternum │ │ │ ├── index.ts │ │ │ └── gql.ts │ │ └── snapshot │ │ │ └── index.ts │ ├── types │ │ ├── vite-env.d.ts │ │ └── snapshot.ts │ ├── components │ │ ├── layout │ │ │ ├── ethereum-connect.tsx │ │ │ ├── not-found.tsx │ │ │ ├── breadcrumbs.tsx │ │ │ ├── search-form.tsx │ │ │ ├── mode-toggle.tsx │ │ │ ├── starknet-wallet-button.tsx │ │ │ ├── default-catch-boundary.tsx │ │ │ ├── login-card.tsx │ │ │ └── nav-main.tsx │ │ ├── ui │ │ │ ├── skeleton.tsx │ │ │ ├── collapsible.tsx │ │ │ ├── textarea.tsx │ │ │ ├── input.tsx │ │ │ ├── label.tsx │ │ │ ├── separator.tsx │ │ │ ├── toaster.tsx │ │ │ ├── progress.tsx │ │ │ ├── checkbox.tsx │ │ │ ├── slider.tsx │ │ │ ├── switch.tsx │ │ │ ├── badge.tsx │ │ │ ├── tooltip.tsx │ │ │ ├── popover.tsx │ │ │ ├── read-more.tsx │ │ │ ├── avatar.tsx │ │ │ ├── radio-group.tsx │ │ │ ├── toggle.tsx │ │ │ ├── scroll-area.tsx │ │ │ ├── alert.tsx │ │ │ ├── toggle-group.tsx │ │ │ ├── tabs.tsx │ │ │ ├── card.tsx │ │ │ ├── button.tsx │ │ │ ├── accordion.tsx │ │ │ ├── calendar.tsx │ │ │ ├── breadcrumb.tsx │ │ │ ├── pagination.tsx │ │ │ └── table.tsx │ │ ├── modules │ │ │ ├── governance │ │ │ │ ├── delegate-list.tsx │ │ │ │ ├── proposal-user-vote-badge.tsx │ │ │ │ ├── proposal-results.tsx │ │ │ │ ├── delegate-card-skeleton.tsx │ │ │ │ ├── proposal-list.tsx │ │ │ │ └── delegate-list-actions.tsx │ │ │ └── realms │ │ │ │ ├── bridge-tx-chains.tsx │ │ │ │ ├── realm-card.tsx │ │ │ │ ├── realm-resources.tsx │ │ │ │ └── bridge-tx-skeleton.tsx │ │ └── icons │ │ │ ├── ethereum.svg │ │ │ └── bridge.svg │ ├── routes │ │ ├── -components │ │ │ └── spinner.tsx │ │ ├── realms.claims.tsx │ │ ├── api │ │ │ └── auth │ │ │ │ └── $.tsx │ │ ├── coming-soon.index.tsx │ │ ├── index.tsx │ │ ├── delegate.list.tsx │ │ └── realms.index.tsx │ ├── utils │ │ ├── auth-client.ts │ │ ├── auth │ │ │ └── auth-siws-client.ts │ │ ├── auth.ts │ │ ├── seo.ts │ │ ├── time.ts │ │ ├── utils.ts │ │ └── cursorPagination.ts │ ├── lib │ │ ├── constants.ts │ │ ├── eternum │ │ │ ├── apiClient.ts │ │ │ └── getRealms.ts │ │ ├── queries │ │ │ ├── execute.ts │ │ │ └── torii.ts │ │ ├── getLordsPrice.ts │ │ ├── getRealmsLordsClaims.ts │ │ ├── getVeLordsBurns.ts │ │ ├── getBridgeTransactions.ts │ │ └── snapshot │ │ │ └── getUserVotes.ts │ ├── router.tsx │ ├── abi │ │ └── L2 │ │ │ └── RealmsBridge.ts │ └── providers │ │ ├── theme.tsx │ │ └── ethereum.tsx │ ├── README.md │ ├── public │ ├── favicon.ico │ ├── apple-touch-icon.png │ ├── realms │ │ └── resources │ │ │ ├── 1.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ ├── 4.png │ │ │ ├── 5.png │ │ │ ├── 6.png │ │ │ ├── 7.png │ │ │ ├── 8.png │ │ │ ├── 9.png │ │ │ ├── 10.png │ │ │ ├── 11.png │ │ │ ├── 12.png │ │ │ ├── 13.png │ │ │ ├── 14.png │ │ │ ├── 15.png │ │ │ ├── 16.png │ │ │ ├── 17.png │ │ │ ├── 18.png │ │ │ ├── 19.png │ │ │ ├── 20.png │ │ │ ├── 21.png │ │ │ ├── 22.png │ │ │ ├── 254.png │ │ │ ├── 255.png │ │ │ ├── 29.png │ │ │ └── coin.png │ ├── android-chrome-192x192.png │ ├── android-chrome-512x512.png │ └── manifest.webmanifest │ ├── .gitignore │ ├── vercel.json │ ├── eslint.config.js │ ├── components.json │ ├── tsconfig.json │ ├── .env.example │ ├── codegen.ts │ ├── env.ts │ └── vite.config.ts ├── tsconfig.json ├── pnpm-workspace.yaml ├── .env.example ├── tsconfig.node.json ├── .gitignore ├── tsconfig.app.json ├── package.json └── README.md /tooling/eslint/vitejs.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/apibara/.gitignore: -------------------------------------------------------------------------------- 1 | .apibara 2 | -------------------------------------------------------------------------------- /apps/account-portal/src/hooks/bridge/useBridgeL1Realms.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/account-portal/src/gql/eternum/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./gql"; -------------------------------------------------------------------------------- /apps/account-portal/src/gql/snapshot/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./gql"; -------------------------------------------------------------------------------- /packages/starknet-types-07/index.mjs: -------------------------------------------------------------------------------- 1 | export * from "@starknet-io/types-js"; 2 | -------------------------------------------------------------------------------- /packages/starknet-types-08/index.mjs: -------------------------------------------------------------------------------- 1 | export * from "@starknet-io/types-js"; 2 | -------------------------------------------------------------------------------- /packages/starknet-types-09/index.mjs: -------------------------------------------------------------------------------- 1 | export * from "@starknet-io/types-js"; 2 | -------------------------------------------------------------------------------- /apps/account-portal/src/types/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /apps/account-portal/src/types/snapshot.ts: -------------------------------------------------------------------------------- 1 | export enum Choice { 2 | Against = 0, 3 | For = 1, 4 | Abstain = 2, 5 | } 6 | -------------------------------------------------------------------------------- /apps/account-portal/README.md: -------------------------------------------------------------------------------- 1 | # Example 2 | 3 | To run this example: 4 | 5 | - `npm install` or `yarn` 6 | - `npm start` or `yarn start` 7 | -------------------------------------------------------------------------------- /apps/account-portal/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/favicon.ico -------------------------------------------------------------------------------- /packages/db/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.node.json", 3 | "include": ["src"], 4 | "exclude": ["node_modules"] 5 | } 6 | -------------------------------------------------------------------------------- /tooling/prettier/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@realms-world/tsconfig/base.json", 3 | "include": ["."], 4 | "exclude": ["node_modules"] 5 | } 6 | -------------------------------------------------------------------------------- /apps/account-portal/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/apple-touch-icon.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/1.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/2.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/3.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/4.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/5.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/6.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/7.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/8.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/9.png -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { "path": "./tsconfig.app.json" }, 5 | { "path": "./tsconfig.node.json" } 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/10.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/11.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/12.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/13.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/14.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/15.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/16.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/17.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/18.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/19.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/20.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/21.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/22.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/254.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/254.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/255.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/255.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/29.png -------------------------------------------------------------------------------- /apps/account-portal/public/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/android-chrome-192x192.png -------------------------------------------------------------------------------- /apps/account-portal/public/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/android-chrome-512x512.png -------------------------------------------------------------------------------- /apps/account-portal/public/realms/resources/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BibliothecaDAO/account-portal/HEAD/apps/account-portal/public/realms/resources/coin.png -------------------------------------------------------------------------------- /packages/constants/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./bridge-addresses"; 2 | export * from "./chains"; 3 | export * from "./contracts"; 4 | export * from "./marketplace"; 5 | -------------------------------------------------------------------------------- /packages/db/src/schema/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./bridge"; 2 | export * from "./auth"; 3 | export * from "./governance"; 4 | export * from "./dune"; 5 | export * from "./velords"; 6 | -------------------------------------------------------------------------------- /apps/account-portal/src/components/layout/ethereum-connect.tsx: -------------------------------------------------------------------------------- 1 | 2 | export const EthereumConnect = ({ label }: { label?: string }) => { 3 | return ( 4 | 5 | 6 | ); 7 | }; 8 | -------------------------------------------------------------------------------- /apps/account-portal/src/routes/-components/spinner.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | 3 | export function Spinner() { 4 | return
5 | } 6 | -------------------------------------------------------------------------------- /packages/db/eslint.config.js: -------------------------------------------------------------------------------- 1 | import baseConfig from "@realms-world/eslint-config/base"; 2 | 3 | /** @type {import('typescript-eslint').Config} */ 4 | export default [ 5 | ...baseConfig, 6 | ]; 7 | -------------------------------------------------------------------------------- /packages/constants/eslint.config.js: -------------------------------------------------------------------------------- 1 | import baseConfig from "@realms-world/eslint-config/base"; 2 | 3 | /** @type {import('typescript-eslint').Config} */ 4 | export default [ 5 | ...baseConfig, 6 | ]; 7 | -------------------------------------------------------------------------------- /apps/account-portal/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | yarn.lock 4 | 5 | !.env 6 | .DS_Store 7 | .cache 8 | .vercel 9 | .output 10 | .tanstack 11 | .nitro 12 | /build/ 13 | /api/ 14 | /server/build 15 | /public/build -------------------------------------------------------------------------------- /packages/starknet-types-07/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@starknet-io/starknet-types-07", 3 | "version": "0.7.10", 4 | "main": "index.mjs", 5 | "type": "module", 6 | "dependencies": { 7 | "@starknet-io/types-js": "0.7.10" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/starknet-types-08/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@starknet-io/starknet-types-08", 3 | "version": "0.8.4", 4 | "main": "index.mjs", 5 | "type": "module", 6 | "dependencies": { 7 | "@starknet-io/types-js": "0.8.4" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/starknet-types-09/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@starknet-io/starknet-types-09", 3 | "version": "0.9.1", 4 | "main": "index.mjs", 5 | "type": "module", 6 | "dependencies": { 7 | "@starknet-io/types-js": "0.9.1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/apibara/eslint.config.js: -------------------------------------------------------------------------------- 1 | import baseConfig from "@realms-world/eslint-config/base"; 2 | 3 | /** @type {import('typescript-eslint').Config} */ 4 | export default [ 5 | { 6 | ignores: [".apibara/**"], 7 | }, 8 | ...baseConfig, 9 | ]; 10 | -------------------------------------------------------------------------------- /apps/account-portal/vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "env": { 4 | "NODE_OPTIONS": "--max-old-space-size=4096 --max-http-header-size=16384" 5 | } 6 | }, 7 | "env": { 8 | "NODE_ENV": "production", 9 | "VERCEL_ENV": "production" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/db/drizzle.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from "drizzle-kit"; 2 | import { env } from "./env"; 3 | 4 | export default { 5 | schema: "./src/schema/index.ts", 6 | dialect: "postgresql", 7 | dbCredentials: { 8 | url: env.DATABASE_URL, 9 | ssl: true, 10 | }, 11 | } satisfies Config; 12 | -------------------------------------------------------------------------------- /apps/account-portal/public/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "icons": [ 3 | { 4 | "src": "/android-chrome-192x192.png", 5 | "sizes": "192x192", 6 | "type": "image/png" 7 | }, 8 | { 9 | "src": "/android-chrome-512x512.png", 10 | "sizes": "512x512", 11 | "type": "image/png" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | # pnpm-monrepo/pnpm-workspace.yaml 2 | packages: 3 | - "./apps/**" 4 | - "./packages/**" 5 | - "./tooling/**" 6 | catalog: 7 | eslint: ^9.9.0 8 | prettier: ^3.3.3 9 | zod: ^3.24.1 10 | dotenv-cli: ^7.4.2 11 | starknet: ^8.1.2 12 | viem: ^2.31.3 13 | drizzle-kit: ^0.31.4 14 | drizzle-orm: ^0.44.2 15 | typescript: ^5.8.2 16 | -------------------------------------------------------------------------------- /packages/db/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "drizzle-orm"; 2 | export * from "./schema/bridge"; 3 | export * from "./schema/auth"; 4 | 5 | // Export commonly used query builders 6 | export { 7 | eq, 8 | and, 9 | or, 10 | desc, 11 | asc, 12 | like, 13 | sql, 14 | gt, 15 | lt 16 | } from "drizzle-orm"; 17 | export type { SQL, AnyColumn } from "drizzle-orm"; 18 | -------------------------------------------------------------------------------- /apps/account-portal/src/components/ui/skeleton.tsx: -------------------------------------------------------------------------------- 1 | import { cn } from "@/utils/utils"; 2 | 3 | function Skeleton({ 4 | className, 5 | ...props 6 | }: React.HTMLAttributes) { 7 | return ( 8 |
12 | ); 13 | } 14 | 15 | export { Skeleton }; 16 | -------------------------------------------------------------------------------- /apps/account-portal/eslint.config.js: -------------------------------------------------------------------------------- 1 | import baseConfig from "@realms-world/eslint-config/base"; 2 | import reactConfig from "@realms-world/eslint-config/react"; 3 | 4 | /** @type {import('typescript-eslint').Config} */ 5 | export default [ 6 | { 7 | ignores: ["dist/**", ".storybook/**", ".vercel", ".output", "byukd/"], 8 | }, 9 | ...baseConfig, 10 | ...reactConfig, 11 | ]; 12 | -------------------------------------------------------------------------------- /apps/account-portal/src/components/ui/collapsible.tsx: -------------------------------------------------------------------------------- 1 | import * as CollapsiblePrimitive from "@radix-ui/react-collapsible" 2 | 3 | const Collapsible = CollapsiblePrimitive.Root 4 | 5 | const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger 6 | 7 | const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent 8 | 9 | export { Collapsible, CollapsibleTrigger, CollapsibleContent } 10 | -------------------------------------------------------------------------------- /apps/account-portal/src/routes/realms.claims.tsx: -------------------------------------------------------------------------------- 1 | import { ClaimRewards } from "@/components/modules/realms/claims"; 2 | import { createFileRoute } from "@tanstack/react-router"; 3 | 4 | export const Route = createFileRoute("/realms/claims")({ 5 | component: RouteComponent, 6 | }); 7 | 8 | function RouteComponent() { 9 | return ( 10 |
11 | 12 |
13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /packages/constants/src/chains.ts: -------------------------------------------------------------------------------- 1 | export enum ChainId { 2 | MAINNET = 1, 3 | SEPOLIA = 11155111, 4 | MISSISSIPPI_TESTNET = 33784, 5 | 6 | SN_MAIN = "0x534e5f4d41494e", 7 | SN_SEPOLIA = "0x534e5f5345504f4c4941", 8 | 9 | REALMS_L3 = "420", 10 | 11 | SLOT_TESTNET = 555, // TODO: update with the real value 12 | 13 | SN_DEVNET = 556, // TODO: update with the real value 14 | } 15 | -------------------------------------------------------------------------------- /apps/account-portal/src/utils/auth-client.ts: -------------------------------------------------------------------------------- 1 | import { siwsClientPlugin } from "@/utils/auth/auth-siws-client"; 2 | import { createAuthClient } from "better-auth/react"; 3 | 4 | // Use type assertion to tell TypeScript this is safe 5 | export const authClient = createAuthClient({ 6 | baseURL: 7 | (import.meta.env.VITE_BASE_URL as string | undefined) ?? 8 | "http://localhost:3000", 9 | plugins: [siwsClientPlugin()], 10 | }); 11 | -------------------------------------------------------------------------------- /apps/account-portal/src/utils/auth/auth-siws-client.ts: -------------------------------------------------------------------------------- 1 | import type { BetterAuthClientPlugin } from "better-auth"; 2 | 3 | import type { siws } from "./auth-siws-plugin"; 4 | 5 | type SignInWithStarknetPlugin = typeof siws; 6 | 7 | export const siwsClientPlugin = () => { 8 | return { 9 | id: "sign-in-with-starknet", 10 | $InferServerPlugin: {} as ReturnType, 11 | } satisfies BetterAuthClientPlugin; 12 | }; 13 | -------------------------------------------------------------------------------- /apps/account-portal/src/routes/api/auth/$.tsx: -------------------------------------------------------------------------------- 1 | import { auth } from "@/utils/auth"; 2 | import { createServerFileRoute } from "@tanstack/react-start/server"; 3 | 4 | export const ServerRoute = createServerFileRoute("/api/auth/$").methods({ 5 | GET: ({ request }) => { 6 | return auth.handler(request); 7 | }, 8 | POST: ({ request }) => { 9 | console.log("POST request received"); 10 | return auth.handler(request); 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /packages/apibara/apibara.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "apibara/config"; 2 | import esbuild from "rollup-plugin-esbuild"; 3 | 4 | export default defineConfig({ 5 | runtimeConfig: { 6 | streamUrl: "https://starknet.preview.apibara.org", 7 | contractAddress: 8 | "0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a", 9 | }, 10 | exportConditions: ["node"], 11 | rolldownConfig: { 12 | plugins: [esbuild()], 13 | }, 14 | }); 15 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | VITE_PUBLIC_CHAIN=mainnet 2 | VITE_PUBLIC_SLOT=eternum-prod 3 | 4 | VITE_PUBLIC_IMAGE_CDN_URL=https://media.arkproject.dev 5 | VITE_PUBLIC_IMAGE_PROXY_URL=https://imgproxy.arkproject.dev 6 | VITE_PUBLIC_IPFS_GATEWAY=https://ipfs.arkproject.dev/ipfs/ 7 | 8 | DATABASE_URL=postgresql://XXXXXX:XXXXXXXXX@XXXXXXXX-pooler.us-east-2.aws.neon.tech/XXXX?sslmode=require 9 | 10 | VITE_RESERVOIR_API_KEY= # required for L1 Realms 11 | 12 | VITE_DUNE_API_KEY= # optional -------------------------------------------------------------------------------- /apps/account-portal/src/hooks/use-stark-name.ts: -------------------------------------------------------------------------------- 1 | import { shortenAddress, shortenName } from "@/utils/utils"; 2 | import { useStarkName as useStarkNameReact } from "@starknet-react/core"; 3 | 4 | export function useStarkDisplayName(address?: `0x${string}`): string { 5 | const { data: domain } = useStarkNameReact({ address }); 6 | const shortened = domain 7 | ? shortenName(domain) 8 | : address 9 | ? shortenAddress(address) 10 | : "none"; 11 | 12 | return shortened; 13 | } 14 | -------------------------------------------------------------------------------- /apps/account-portal/components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "new-york", 4 | "rsc": false, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.js", 8 | "css": "src/index.css", 9 | "baseColor": "zinc", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/utils/utils", 16 | "ui": "@/components/ui", 17 | "lib": "@/lib", 18 | "hooks": "@/hooks" 19 | }, 20 | "iconLibrary": "lucide" 21 | } 22 | -------------------------------------------------------------------------------- /apps/account-portal/src/lib/constants.ts: -------------------------------------------------------------------------------- 1 | // Contract addresses for veLORDS ecosystem 2 | 3 | // Time constants matching the Cairo contract 4 | export const TIME_CONSTANTS = { 5 | DAY: 86400, // 3600 * 24 6 | WEEK: 604800, // DAY * 7 7 | TOKEN_CHECKPOINT_DEADLINE: 86400, // DAY 8 | ITERATION_LIMIT: 500, 9 | PROTOCOL_START_TIME: 1725494400, // September 5, 2024 - veLORDS protocol launch 10 | }; 11 | 12 | // APY calculation constants 13 | export const APY_CONSTANTS = { 14 | BLOCKS_PER_YEAR: 52, // 52 weeks per year 15 | BASIS_POINTS: 10000, 16 | DECIMALS: 18, 17 | }; 18 | -------------------------------------------------------------------------------- /packages/constants/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@realms-world/constants", 3 | "version": "0.1.0", 4 | "types": "./src/index.ts", 5 | "license": "MIT", 6 | "main": "./src/index.ts", 7 | "type": "module", 8 | "files": [ 9 | "dist/**", 10 | "src/**" 11 | ], 12 | "scripts": { 13 | "lint": "eslint", 14 | "format": "prettier --check \"**/*.{mjs,ts,md,json}\"", 15 | "typecheck": "tsc --noEmit" 16 | }, 17 | "dependencies": { 18 | "dotenv": "^16.4.7" 19 | }, 20 | "devDependencies": { 21 | }, 22 | "prettier": "@realms-world/prettier-config" 23 | } 24 | -------------------------------------------------------------------------------- /tooling/eslint/react.js: -------------------------------------------------------------------------------- 1 | import reactPlugin from "eslint-plugin-react"; 2 | import hooksPlugin from "eslint-plugin-react-hooks"; 3 | 4 | /** @type {Awaited} */ 5 | export default [ 6 | { 7 | files: ["**/*.ts", "**/*.tsx"], 8 | plugins: { 9 | react: reactPlugin, 10 | "react-hooks": hooksPlugin, 11 | }, 12 | rules: { 13 | ...reactPlugin.configs["jsx-runtime"].rules, 14 | ...hooksPlugin.configs.recommended.rules, 15 | }, 16 | languageOptions: { 17 | globals: { 18 | React: "writable", 19 | }, 20 | }, 21 | }, 22 | ]; 23 | -------------------------------------------------------------------------------- /packages/apibara/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "display": "Default", 4 | "compilerOptions": { 5 | "forceConsistentCasingInFileNames": true, 6 | "target": "ES2022", 7 | "lib": ["ES2023"], 8 | "module": "ESNext", 9 | "moduleResolution": "bundler", 10 | "skipLibCheck": true, 11 | "types": ["node"], 12 | "noEmit": true, 13 | "strict": true, 14 | "baseUrl": ".", 15 | "paths": { 16 | "@/*": ["./*"] 17 | } 18 | }, 19 | "include": [".", "./.apibara/types"], 20 | "exclude": ["node_modules"] 21 | } -------------------------------------------------------------------------------- /tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "target": "ES2022", 5 | "lib": ["ES2023"], 6 | "module": "ESNext", 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "isolatedModules": true, 13 | "moduleDetection": "force", 14 | "noEmit": true, 15 | 16 | /* Linting */ 17 | "strict": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "noFallthroughCasesInSwitch": true, 21 | "noUncheckedSideEffectImports": true 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /packages/apibara/env.ts: -------------------------------------------------------------------------------- 1 | import { z } from "zod"; 2 | 3 | const envSchema = z.object({ 4 | // Version and chain info 5 | VITE_PUBLIC_CHAIN: z.enum(["sepolia", "mainnet", "testnet", "local"]), // Add other chains as needed 6 | 7 | }); 8 | 9 | let env: z.infer; 10 | try { 11 | env = envSchema.parse(process.env); 12 | } catch (error) { 13 | if (error instanceof z.ZodError) { 14 | console.error("❌ Invalid environment variables:", JSON.stringify(error.errors, null, 2)); 15 | } 16 | throw new Error("Invalid environment variables"); 17 | } 18 | 19 | export { env }; 20 | 21 | // Type for your validated env 22 | export type Env = z.infer; -------------------------------------------------------------------------------- /apps/account-portal/src/hooks/use-mobile.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | const MOBILE_BREAKPOINT = 768 4 | 5 | export function useIsMobile() { 6 | const [isMobile, setIsMobile] = React.useState(undefined) 7 | 8 | React.useEffect(() => { 9 | const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`) 10 | const onChange = () => { 11 | setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) 12 | } 13 | mql.addEventListener("change", onChange) 14 | setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) 15 | return () => mql.removeEventListener("change", onChange) 16 | }, []) 17 | 18 | return !!isMobile 19 | } 20 | -------------------------------------------------------------------------------- /tooling/prettier/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@realms-world/prettier-config", 3 | "private": true, 4 | "version": "0.1.0", 5 | "type": "module", 6 | "exports": { 7 | ".": "./index.js" 8 | }, 9 | "scripts": { 10 | "clean": "git clean -xdf .cache .turbo node_modules", 11 | "format": "prettier --check \"**/*.{mjs,ts,md,json}\"", 12 | "typecheck": "tsc --noEmit" 13 | }, 14 | "dependencies": { 15 | "@ianvs/prettier-plugin-sort-imports": "^4.4.1", 16 | "prettier": "catalog:", 17 | "prettier-plugin-tailwindcss": "^0.6.11" 18 | }, 19 | "devDependencies": { 20 | "typescript": "catalog:" 21 | }, 22 | "prettier": "@realms-world/prettier-config" 23 | } 24 | -------------------------------------------------------------------------------- /packages/db/env.ts: -------------------------------------------------------------------------------- 1 | import { z } from "zod"; 2 | 3 | const envSchema = z.object({ 4 | // Version and chain info 5 | DATABASE_URL: z.string(), // Add other chains as needed 6 | VERCEL_ENV: z.string().optional(), 7 | }); 8 | 9 | let env: z.infer; 10 | try { 11 | env = envSchema.parse(process.env); 12 | } catch (error) { 13 | if (error instanceof z.ZodError) { 14 | console.error( 15 | "❌ Invalid environment variables:", 16 | JSON.stringify(error.errors, null, 2) 17 | ); 18 | } 19 | throw new Error("Invalid environment variables"); 20 | } 21 | 22 | export { env }; 23 | 24 | // Type for your validated env 25 | export type Env = z.infer; 26 | -------------------------------------------------------------------------------- /apps/account-portal/src/lib/eternum/apiClient.ts: -------------------------------------------------------------------------------- 1 | import { env } from "../../../env"; 2 | 3 | const API_BASE_URL = env.VITE_TORII_API_URL + "/sql"; 4 | 5 | /** 6 | * Generic API client for making SQL queries to the backend. 7 | * Handles URL construction, error handling, and JSON parsing. 8 | * @param query - The SQL query string 9 | * @returns The parsed JSON response 10 | */ 11 | export async function fetchSQL(query: string): Promise { 12 | const url = `${API_BASE_URL}?query=${encodeURIComponent(query)}`; 13 | const response = await fetch(url); 14 | 15 | if (!response.ok) { 16 | throw new Error(`Failed to fetch: ${response.statusText}`); 17 | } 18 | return await response.json(); 19 | } 20 | -------------------------------------------------------------------------------- /apps/account-portal/src/hooks/governance/use-voting-power.ts: -------------------------------------------------------------------------------- 1 | import { RealmsABI } from "@/abi/L2/Realms"; 2 | import { SUPPORTED_L2_CHAIN_ID } from "@/utils/utils"; 3 | import { useAccount, useReadContract } from "@starknet-react/core"; 4 | 5 | import { CollectionAddresses } from "@realms-world/constants"; 6 | 7 | export const useVotingPower = () => { 8 | const { address } = useAccount(); 9 | 10 | const l2RealmsAddress = CollectionAddresses.realms[ 11 | SUPPORTED_L2_CHAIN_ID 12 | ] as `0x${string}`; 13 | 14 | return useReadContract({ 15 | abi: RealmsABI, 16 | address: l2RealmsAddress, 17 | args: address ? [address] : undefined, 18 | functionName: "get_votes", 19 | watch: true, 20 | }); 21 | }; 22 | -------------------------------------------------------------------------------- /apps/account-portal/src/hooks/governance/use-current-delegate.ts: -------------------------------------------------------------------------------- 1 | import { RealmsABI } from "@/abi/L2/Realms"; 2 | import { SUPPORTED_L2_CHAIN_ID } from "@/utils/utils"; 3 | import { useAccount, useReadContract } from "@starknet-react/core"; 4 | 5 | import { CollectionAddresses } from "@realms-world/constants"; 6 | 7 | export const useCurrentDelegate = () => { 8 | const { address } = useAccount(); 9 | 10 | const l2RealmsAddress = CollectionAddresses.realms[ 11 | SUPPORTED_L2_CHAIN_ID 12 | ] as `0x${string}`; 13 | 14 | return useReadContract({ 15 | abi: RealmsABI, 16 | address: l2RealmsAddress, 17 | args: address ? [address] : undefined, 18 | functionName: "delegates", 19 | watch: true, 20 | }); 21 | }; 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | 26 | .env 27 | 28 | app.config.timestamp-* 29 | vite.config.js.timestamp-* 30 | vite.config.ts.timestamp-* 31 | app.config.js.timestamp-* 32 | app.config.ts.timestamp-* 33 | 34 | app.config.timestamp_* 35 | vite.config.js.timestamp_* 36 | vite.config.ts.timestamp_* 37 | app.config.js.timestamp_* 38 | app.config.ts.timestamp_* 39 | packages/db/drizzle/meta/ 40 | 41 | *.sql 42 | -------------------------------------------------------------------------------- /apps/account-portal/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": ["**/*.ts", "**/*.tsx"], 3 | "compilerOptions": { 4 | "strict": true, 5 | "esModuleInterop": true, 6 | "jsx": "react-jsx", 7 | "module": "ESNext", 8 | "moduleResolution": "bundler", 9 | "moduleDetection": "force", 10 | "lib": ["DOM", "DOM.Iterable", "ES2022"], 11 | "isolatedModules": true, 12 | "resolveJsonModule": true, 13 | "skipLibCheck": true, 14 | "target": "ES2022", 15 | "allowJs": true, 16 | "forceConsistentCasingInFileNames": true, 17 | "baseUrl": ".", 18 | "allowImportingTsExtensions": true, 19 | "allowSyntheticDefaultImports": true, 20 | "paths": { 21 | "@/*": ["./src/*"] 22 | }, 23 | "noEmit": true 24 | } 25 | } -------------------------------------------------------------------------------- /tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", 4 | "target": "ES2020", 5 | "useDefineForClassFields": true, 6 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 7 | "module": "ESNext", 8 | "skipLibCheck": true, 9 | 10 | /* Bundler mode */ 11 | "moduleResolution": "bundler", 12 | "allowImportingTsExtensions": true, 13 | "isolatedModules": true, 14 | "moduleDetection": "force", 15 | "noEmit": true, 16 | "jsx": "react-jsx", 17 | 18 | /* Linting */ 19 | "strict": true, 20 | "noUnusedLocals": true, 21 | "noUnusedParameters": true, 22 | "noFallthroughCasesInSwitch": true, 23 | "noUncheckedSideEffectImports": true 24 | }, 25 | } 26 | -------------------------------------------------------------------------------- /apps/account-portal/.env.example: -------------------------------------------------------------------------------- 1 | # Chain configuration (mainnet or sepolia) 2 | VITE_PUBLIC_CHAIN=mainnet 3 | 4 | # Required: Alchemy API Key 5 | # Get your free API key at: https://www.alchemy.com/ 6 | # The free tier includes: 7 | # - 300M compute units/month 8 | # - NFT API access 9 | # - No credit card required 10 | VITE_ALCHEMY_API_KEY=your_alchemy_api_key_here 11 | 12 | # Optional: Other API keys 13 | VITE_RESERVOIR_API_KEY= 14 | VITE_DUNE_API_KEY= 15 | VITE_ETHPLORER_APIKEY= 16 | 17 | # Required: Public configuration 18 | VITE_PUBLIC_SLOT=0 19 | 20 | # Optional: URLs (defaults will be used if not provided) 21 | VITE_BASE_URL= 22 | VITE_PUBLIC_IMAGE_CDN_URL= 23 | VITE_PUBLIC_IMAGE_PROXY_URL= 24 | VITE_PUBLIC_IPFS_GATEWAY= 25 | VITE_TORII_API_URL= 26 | VITE_PUBLIC_NODE_URL= -------------------------------------------------------------------------------- /apps/account-portal/src/components/ui/textarea.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | import { cn } from "@/utils/utils" 4 | 5 | const Textarea = React.forwardRef< 6 | HTMLTextAreaElement, 7 | React.ComponentProps<"textarea"> 8 | >(({ className, ...props }, ref) => { 9 | return ( 10 |