repo_id
stringclasses
563 values
file_path
stringlengths
40
166
content
stringlengths
1
2.94M
__index_level_0__
int64
0
0
solana_public_repos/solana-playground/solana-playground/client/src/pages/ide
solana_public_repos/solana-playground/solana-playground/client/src/pages/ide/Global/index.ts
export { default } from "./Global";
0
solana_public_repos/solana-playground/solana-playground/client/src
solana_public_repos/solana-playground/solana-playground/client/src/routes/routes.ts
import { defaultRoute } from "./default"; import { github, githubDefault } from "./github"; import { notFound } from "./not-found"; import { programs } from "./programs"; import { share } from "./share"; import { tutorial } from "./tutorial"; import { tutorials } from "./tutorials"; /** All available routes, order mat...
0
solana_public_repos/solana-playground/solana-playground/client/src
solana_public_repos/solana-playground/solana-playground/client/src/routes/tutorial.tsx
import { Disposable, PgExplorer, PgRouter, PgTutorial, PgView, } from "../utils/pg"; export const tutorial = PgRouter.create({ path: "/tutorials/{tutorialName}", handle: ({ tutorialName }) => { // Get the tutorial const tutorial = PgTutorial.getTutorialData(tutorialName); // Check whether th...
0
solana_public_repos/solana-playground/solana-playground/client/src
solana_public_repos/solana-playground/solana-playground/client/src/routes/programs.tsx
import { PgCommon, PgRouter } from "../utils/pg"; import { handleRoute } from "./utils"; export const programs = PgRouter.create({ path: "/programs", handle: () => { return handleRoute({ getMain: async () => { const programs = await PgCommon.fetchJSON("/programs/programs.json"); const { P...
0
solana_public_repos/solana-playground/solana-playground/client/src
solana_public_repos/solana-playground/solana-playground/client/src/routes/github.tsx
import { PgGithub, PgRouter } from "../utils/pg"; import { handleRoute } from "./utils"; export const githubDefault = PgRouter.create({ path: "/{githubUrl}", validate: ({ githubUrl }) => PgGithub.isValidUrl(githubUrl), handle: ({ githubUrl }) => { return handleRoute({ getMain: async () => { con...
0
solana_public_repos/solana-playground/solana-playground/client/src
solana_public_repos/solana-playground/solana-playground/client/src/routes/share.tsx
import { PgRouter, PgShare } from "../utils/pg"; import { handleRoute } from "./utils"; export const share = PgRouter.create({ path: "/{shareId}", validate: ({ shareId }) => PgShare.isValidId(shareId), handle: ({ shareId }) => { return handleRoute({ getMain: async () => { const { EditorWithTabs...
0
solana_public_repos/solana-playground/solana-playground/client/src
solana_public_repos/solana-playground/solana-playground/client/src/routes/index.ts
export * from "./routes";
0
solana_public_repos/solana-playground/solana-playground/client/src
solana_public_repos/solana-playground/solana-playground/client/src/routes/default.tsx
import { PgExplorer, PgRouter, PgTutorial } from "../utils/pg"; import { handleRoute } from "./utils"; export const defaultRoute = PgRouter.create({ path: "/", handle: () => { return handleRoute({ getMain: async () => { // Don't change the UI to avoid flickering if the current workspace is ...
0
solana_public_repos/solana-playground/solana-playground/client/src
solana_public_repos/solana-playground/solana-playground/client/src/routes/tutorials.tsx
import { PgRouter } from "../utils/pg"; import { handleRoute } from "./utils"; export const tutorials = PgRouter.create({ path: "/tutorials", handle: () => { return handleRoute({ getMain: async () => { const { Tutorials } = await import("../views/main/primary/Tutorials"); return Tutorials...
0
solana_public_repos/solana-playground/solana-playground/client/src
solana_public_repos/solana-playground/solana-playground/client/src/routes/utils.tsx
import { CallableJSX, Disposable, NullableJSX, PgExplorer, PgRouter, PgView, SyncOrAsync, } from "../utils/pg"; /** Handle routes conveniently. */ export const handleRoute = (params: { /** Get primary main view component/element. */ getMain: () => Promise<NullableJSX | CallableJSX>; /** Sidebar pag...
0
solana_public_repos/solana-playground/solana-playground/client/src
solana_public_repos/solana-playground/solana-playground/client/src/routes/not-found.tsx
import { PgRouter } from "../utils/pg"; import { handleRoute } from "./utils"; export const notFound = PgRouter.create({ path: "/{invalidPath}", handle: ({ invalidPath }) => { return handleRoute({ getMain: async () => { const { NotFound } = await import("../views/main/primary/NotFound"); ...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-2-voting/jest.preset.js
const nxPreset = require('@nx/jest/preset').default; module.exports = { ...nxPreset };
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-2-voting/nx.json
{ "$schema": "./node_modules/nx/schemas/nx-schema.json", "defaultBase": "master", "namedInputs": { "default": ["{projectRoot}/**/*", "sharedGlobals"], "production": [ "default", "!{projectRoot}/.eslintrc.json", "!{projectRoot}/eslint.config.js", "!{projectRoot}/**/?(*.)+(spec|test)...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-2-voting/LICENSE
MIT License Copyright (c) 2024 jacobcreech Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distr...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-2-voting/vercel.json
{ "buildCommand": "npm run build", "outputDirectory": "dist/web/.next" }
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-2-voting/tsconfig.base.json
{ "compileOnSave": false, "compilerOptions": { "rootDir": ".", "sourceMap": true, "declaration": false, "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, "target": "es2015", "module": "esnext", "lib": ["es2020", ...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-2-voting/package.json
{ "name": "@voting/source", "version": "0.0.0", "license": "MIT", "scripts": { "anchor": "nx run anchor:anchor", "anchor-build": "nx run anchor:anchor build", "anchor-localnet": "nx run anchor:anchor localnet", "anchor-test": "nx run anchor:anchor test", "feature": "nx generate @solana-devel...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-2-voting/jest.config.ts
import { getJestProjectsAsync } from '@nx/jest'; export default async () => ({ projects: await getJestProjectsAsync(), });
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/tailwind.config.js
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind'); const { join } = require('path'); /** @type {import('tailwindcss').Config} */ module.exports = { content: [ join( __dirname, '{src,pages,components,app}/**/*!(*.stories|*.spec).{ts,tsx,html}' ), ...createGlobPatterns...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/project.json
{ "name": "web", "$schema": "../node_modules/nx/schemas/project-schema.json", "sourceRoot": "web", "projectType": "application", "tags": [], "targets": { "build": { "executor": "@nx/next:build", "outputs": ["{options.outputPath}"], "defaultConfiguration": "production", "options":...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/next.config.js
//@ts-check // eslint-disable-next-line @typescript-eslint/no-var-requires const { composePlugins, withNx } = require('@nx/next'); /** * @type {import('@nx/next/plugins/with-nx').WithNxOptions} **/ const nextConfig = { webpack: (config) => { config.externals = [ ...(config.externals || []), 'bigin...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/next-env.d.ts
/// <reference types="next" /> /// <reference types="next/image-types/global" /> // NOTE: This file should not be edited // see https://nextjs.org/docs/basic-features/typescript for more information.
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/tsconfig.json
{ "extends": "../tsconfig.base.json", "compilerOptions": { "jsx": "preserve", "allowJs": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "resolveJsonModule": true, "isolatedModules": tr...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/index.d.ts
/* eslint-disable @typescript-eslint/no-explicit-any */ declare module '*.svg' { const content: any; export const ReactComponent: any; export default content; }
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/postcss.config.js
const { join } = require('path'); // Note: If you use library-specific PostCSS/Tailwind configuration then you should remove the `postcssConfig` build // option from your application's configuration (i.e. project.json). // // See: https://nx.dev/guides/using-tailwind-css-in-react#step-4:-applying-configuration-to-libr...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/.eslintrc.json
{ "extends": [ "plugin:@nx/react-typescript", "next", "next/core-web-vitals", "../.eslintrc.json" ], "ignorePatterns": ["!**/*", ".next/**/*"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "rules": { "@next/next/no-html-link-for-pages": ["error", "web/pag...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app/react-query-provider.tsx
'use client'; import React, { ReactNode, useState } from 'react'; import { ReactQueryStreamedHydration } from '@tanstack/react-query-next-experimental'; import { QueryClientProvider, QueryClient } from '@tanstack/react-query'; export function ReactQueryProvider({ children }: { children: ReactNode }) { const [client...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app/global.css
@tailwind base; @tailwind components; @tailwind utilities; html, body { height: 100%; } .wallet-adapter-button-trigger { background: rgb(100, 26, 230) !important; border-radius: 8px !important; padding-left: 16px !important; padding-right: 16px !important; } .wallet-adapter-dropdown-list, .wallet-adapter-bu...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app/page.module.css
.page { }
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app/layout.tsx
import './global.css'; import { UiLayout } from '@/components/ui/ui-layout'; import { ClusterProvider } from '@/components/cluster/cluster-data-access'; import { SolanaProvider } from '@/components/solana/solana-provider'; import { ReactQueryProvider } from './react-query-provider'; export const metadata = { title: ...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app/page.tsx
import DashboardFeature from '@/components/dashboard/dashboard-feature'; export default function Page() { return <DashboardFeature />; }
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app/clusters/page.tsx
import ClusterFeature from '@/components/cluster/cluster-feature'; export default function Page() { return <ClusterFeature />; }
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app/basic/page.tsx
import BasicFeature from '@/components/basic/basic-feature'; export default function Page() { return <BasicFeature />; }
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app/api
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app/api/vote/route.ts
import { ACTIONS_CORS_HEADERS, ActionGetResponse, ActionPostRequest, createPostResponse } from "@solana/actions"; import * as anchor from '@coral-xyz/anchor'; import { Voting } from '@/../anchor/target/types/voting'; import { Keypair, PublicKey, Transaction } from '@solana/web3.js'; import idl from '@/../anchor/target...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app/api
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app/api/hello/route.ts
export async function GET(request: Request) { return new Response('Hello, from API!'); }
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app/account/page.tsx
import AccountListFeature from '@/components/account/account-list-feature'; export default function Page() { return <AccountListFeature />; }
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app/account
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/app/account/[address]/page.tsx
import AccountDetailFeature from '@/components/account/account-detail-feature'; export default function Page() { return <AccountDetailFeature />; }
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components/ui/ui-layout.tsx
'use client'; import { WalletButton } from '../solana/solana-provider'; import * as React from 'react'; import { ReactNode, Suspense, useEffect, useRef } from 'react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { AccountChecker } from '../account/account-ui'; import { Clust...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components/cluster/cluster-data-access.tsx
'use client'; import { clusterApiUrl, Connection } from '@solana/web3.js'; import { atom, useAtomValue, useSetAtom } from 'jotai'; import { atomWithStorage } from 'jotai/utils'; import { createContext, ReactNode, useContext } from 'react'; import toast from 'react-hot-toast'; export interface Cluster { name: string...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components/cluster/cluster-ui.tsx
'use client'; import { useConnection } from '@solana/wallet-adapter-react'; import { IconTrash } from '@tabler/icons-react'; import { useQuery } from '@tanstack/react-query'; import { ReactNode, useState } from 'react'; import { AppModal } from '../ui/ui-layout'; import { ClusterNetwork, useCluster } from './cluster-d...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components/cluster/cluster-feature.tsx
'use client'; import { useState } from 'react'; import { AppHero } from '../ui/ui-layout'; import { ClusterUiModal } from './cluster-ui'; import { ClusterUiTable } from './cluster-ui'; export default function ClusterFeature() { const [showModal, setShowModal] = useState(false); return ( <div> <AppHero ...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components/basic/basic-ui.tsx
'use client'; import { Keypair } from '@solana/web3.js'; import { useBasicProgram } from './basic-data-access'; export function BasicCreate() { const { greet } = useBasicProgram(); return ( <button className="btn btn-xs lg:btn-md btn-primary" onClick={() => greet.mutateAsync(Keypair.generate())} ...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components/basic/basic-data-access.tsx
'use client'; import { programId, getBasicProgram } from '@voting/anchor'; import { Program } from '@coral-xyz/anchor'; import { useConnection } from '@solana/wallet-adapter-react'; import { Keypair } from '@solana/web3.js'; import { useMutation, useQuery } from '@tanstack/react-query'; import toast from 'react-hot-to...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components/basic/basic-feature.tsx
'use client'; import { useWallet } from '@solana/wallet-adapter-react'; import { ExplorerLink } from '../cluster/cluster-ui'; import { WalletButton } from '../solana/solana-provider'; import { AppHero, ellipsify } from '../ui/ui-layout'; import { useBasicProgram } from './basic-data-access'; import { BasicCreate, Basi...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components/solana/solana-provider.tsx
'use client'; import dynamic from 'next/dynamic'; import { AnchorProvider } from '@coral-xyz/anchor'; import { WalletError } from '@solana/wallet-adapter-base'; import { AnchorWallet, useConnection, useWallet, ConnectionProvider, WalletProvider, } from '@solana/wallet-adapter-react'; import { WalletModalProv...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components/dashboard/dashboard-feature.tsx
'use client'; import { AppHero } from '../ui/ui-layout'; const links: { label: string; href: string }[] = [ { label: 'Solana Docs', href: 'https://docs.solana.com/' }, { label: 'Solana Faucet', href: 'https://faucet.solana.com/' }, { label: 'Solana Cookbook', href: 'https://solanacookbook.com/' }, { label: 'S...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components/account/account-data-access.tsx
'use client'; import { useConnection, useWallet } from '@solana/wallet-adapter-react'; import { TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID } from '@solana/spl-token'; import { Connection, LAMPORTS_PER_SOL, PublicKey, SystemProgram, TransactionMessage, TransactionSignature, VersionedTransaction, } from '@sol...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components/account/account-ui.tsx
'use client'; import { useWallet } from '@solana/wallet-adapter-react'; import { LAMPORTS_PER_SOL, PublicKey } from '@solana/web3.js'; import { IconRefresh } from '@tabler/icons-react'; import { useQueryClient } from '@tanstack/react-query'; import { useMemo, useState } from 'react'; import { AppModal, ellipsify } fro...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components/account/account-detail-feature.tsx
'use client'; import { PublicKey } from '@solana/web3.js'; import { useMemo } from 'react'; import { useParams } from 'next/navigation'; import { ExplorerLink } from '../cluster/cluster-ui'; import { AppHero, ellipsify } from '../ui/ui-layout'; import { AccountBalance, AccountButtons, AccountTokens, AccountT...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components
solana_public_repos/developer-bootcamp-2024/project-2-voting/web/components/account/account-list-feature.tsx
'use client'; import { useWallet } from '@solana/wallet-adapter-react'; import { WalletButton } from '../solana/solana-provider'; import { redirect } from 'next/navigation'; export default function AccountListFeature() { const { publicKey } = useWallet(); if (publicKey) { return redirect(`/account/${publicK...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/Cargo.toml
[workspace] members = [ "programs/*" ] resolver = "2" [profile.release] overflow-checks = true lto = "fat" codegen-units = 1 [profile.release.build-override] opt-level = 3 incremental = false codegen-units = 1
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/project.json
{ "name": "anchor", "$schema": "../node_modules/nx/schemas/project-schema.json", "sourceRoot": "anchor/src", "projectType": "library", "tags": [], "targets": { "build": { "executor": "@nx/rollup:rollup", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/anch...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/.swcrc
{ "jsc": { "target": "es2017", "parser": { "syntax": "typescript", "decorators": true, "dynamicImport": true }, "transform": { "decoratorMetadata": true, "legacyDecorator": true }, "keepClassNames": true, "externalHelpers": true, "loose": true }, "modu...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/Anchor.toml
[toolchain] [features] seeds = false skip-lint = false [programs.localnet] voting = "5s3PtT8kLYCv1WEp6dSh3T7EuF35Z6jSu5Cvx4hWG79H" [registry] url = "https://api.apr.dev" [provider] cluster = "Localnet" wallet = "~/.config/solana/id.json" [scripts] test = "../node_modules/.bin/nx run anchor:jest" [test] startup_wa...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/package.json
{ "name": "@voting/anchor", "version": "0.0.1", "dependencies": { "@coral-xyz/anchor": "^0.30.0", "@solana/web3.js": "1.91.9", "anchor-bankrun": "^0.4.0", "solana-bankrun": "^0.2.0" }, "main": "./index.cjs", "module": "./index.js", "private": true }
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/tsconfig.json
{ "extends": "../tsconfig.base.json", "compilerOptions": { "module": "commonjs" }, "files": [], "include": [], "references": [ { "path": "./tsconfig.lib.json" }, { "path": "./tsconfig.spec.json" } ] }
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/tsconfig.lib.json
{ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../dist/out-tsc", "declaration": true, "types": ["node"], "resolveJsonModule": true, "allowSyntheticDefaultImports": true }, "include": ["src/**/*.ts"], "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] }
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/.eslintrc.json
{ "extends": ["../.eslintrc.json"], "ignorePatterns": ["!**/*"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "rules": {} }, { "files": ["*.ts", "*.tsx"], "rules": {} }, { "files": ["*.js", "*.jsx"], "rules": {} }, { "files": [...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/tsconfig.spec.json
{ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, "include": [ "jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts" ] }
0
solana_public_repos/developer-bootcamp-2024/project-2-voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/jest.config.ts
/* eslint-disable */ import { readFileSync } from 'fs'; // Reading the SWC compilation config and remove the "exclude" // for the test files to be compiled by SWC const { exclude: _, ...swcJestConfig } = JSON.parse( readFileSync(`${__dirname}/.swcrc`, 'utf-8') ); // disable .swcrc look-up by SWC core because we're ...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/migrations/deploy.ts
// Migrations are an early feature. Currently, they're nothing more than this // single deploy script that's invoked from the CLI, injecting a provider // configured from the workspace's Anchor.toml. import * as anchor from '@coral-xyz/anchor'; module.exports = async function (provider) { // Configure client to use...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/tests/bankrun.spec.ts
import { startAnchor } from "solana-bankrun"; import { BankrunProvider } from "anchor-bankrun"; import { PublicKey } from '@solana/web3.js'; import * as anchor from '@coral-xyz/anchor'; import { BN, Program } from "@coral-xyz/anchor"; const IDL = require("../target/idl/voting.json"); import { Voting } from '../target...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/tests/basic.spec.ts
import * as anchor from '@coral-xyz/anchor'; import { Program } from '@coral-xyz/anchor'; import { Voting } from '../target/types/voting'; import { PublicKey } from '@solana/web3.js'; describe('Voting', () => { // Configure the client to use the local cluster. anchor.setProvider(anchor.AnchorProvider.env()); co...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/programs
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/programs/voting/Cargo.toml
[package] name = "voting" version = "0.1.0" description = "Created with Anchor" edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "voting" [features] no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] default = [] idl-build = ["anchor-lang/idl-build"] [dependencies] anchor-lang = {...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/programs
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/programs/voting/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/programs/voting
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/programs/voting/src/lib.rs
use anchor_lang::prelude::*; declare_id!("5s3PtT8kLYCv1WEp6dSh3T7EuF35Z6jSu5Cvx4hWG79H"); #[program] pub mod voting { use super::*; pub fn initialize_poll(ctx: Context<InitializePoll>, _poll_id: u64, start_time: u64, end_t...
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/src/index.ts
// This file was generated by preset-anchor. Programs are exported from this file. export * from './voting-exports';
0
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor
solana_public_repos/developer-bootcamp-2024/project-2-voting/anchor/src/voting-exports.ts
// Here we export some useful types and functions for interacting with the Anchor program. import { AnchorProvider, Program } from '@coral-xyz/anchor'; import { PublicKey } from '@solana/web3.js'; import type { Voting } from '../target/types/voting'; import { IDL as VotingIDL } from '../target/types/voting'; // Re-exp...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/pnpm-lock.yaml
lockfileVersion: '9.0' settings: autoInstallPeers: true excludeLinksFromLockfile: false importers: .: dependencies: '@coral-xyz/anchor': specifier: ^0.30.1 version: 0.30.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@pythnetwork/price-service-client': specifier: ^1.9.0 ...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/next.config.mjs
/** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: false, }; export default nextConfig;
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/tailwind.config.ts
import type { Config } from "tailwindcss" const config = { darkMode: ["class"], content: [ './pages/**/*.{ts,tsx}', './components/**/*.{ts,tsx}', './app/**/*.{ts,tsx}', './src/**/*.{ts,tsx}', ], prefix: "", theme: { container: { center: true, padding: "2rem", screens: { ...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/prettier.config.js
// prettier.config.js module.exports = { plugins: ['prettier-plugin-tailwindcss'], }
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/package.json
{ "name": "nextjs-solana-overbid", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "@coral-xyz/anchor": "^0.30.1", "@pythnetwork/price-service-client": "^1.9.0", "@radix-ui...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components.json
{ "$schema": "https://ui.shadcn.com/schema.json", "style": "default", "rsc": true, "tsx": true, "tailwind": { "config": "tailwind.config.ts", "css": "app/globals.css", "baseColor": "zinc", "cssVariables": true, "prefix": "" }, "aliases": { "components": "@/components", "utils":...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/tsconfig.json
{ "compilerOptions": { "target": "es2015", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModule...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/postcss.config.js
module.exports = { plugins: { tailwindcss: {}, autoprefixer: {}, }, };
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/.eslintrc.json
{ "extends": "next/core-web-vitals", "rules": { "react-hooks/rules-of-hooks": "off" } }
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/types/nav.ts
export interface NavItem { title: string; href?: string; disabled?: boolean; external?: boolean; }
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/app/utils.ts
import { PriceFeed } from "@pythnetwork/price-service-client"; import { LAMPORTS_PER_SOL } from "@solana/web3.js"; const PRICE_FEED_DECIMAL_ADJUSTMENT = 10; // price feed 1e8, adjust to same base unit as SOL export const BASE_UNIT = LAMPORTS_PER_SOL; // 1e9 export function calculateHealthFactor( lamportBalance: num...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/app/layout.tsx
import "@/styles/globals.css"; import type { Metadata } from "next"; import { fontSans } from "@/lib/fonts"; import { cn } from "@/lib/utils"; import { SiteHeader } from "@/components/site-header"; import { TailwindIndicator } from "@/components/tailwind-indicator"; import { ThemeProvider } from "@/components/providers...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/app/page.tsx
"use client"; import DepositAndWithdraw from "@/components/stablecoin/deposit-withdraw"; import CollateralAccountDisplay from "@/components/stablecoin/collateral"; export default function DepositWithdrawPage() { return ( <div className="mt-5 flex items-start justify-center space-x-4"> <DepositAndWithdraw ...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/app/globals.css
@tailwind base; @tailwind components; @tailwind utilities; @layer base { :root { --background: 0 0% 100%; --foreground: 240 10% 3.9%; --card: 0 0% 100%; --card-foreground: 240 10% 3.9%; --popover: 0 0% 100%; --popover-foreground: 240 10% 3.9%; --primary: 240 5.9% 10%; --primary-...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/app
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/app/config/page.tsx
"use client"; import UpdateConfigUI from "@/components/stablecoin/update-config"; export default function ConfigPage() { return ( <div className="mt-5 flex items-center justify-center"> <UpdateConfigUI /> </div> ); }
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/app
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/app/liquidate/page.tsx
"use client"; import CollateralAccountsTable from "@/components/stablecoin/collateral-table"; export default function LiquidatePage() { return ( <div className="mt-5 flex items-center justify-center"> <CollateralAccountsTable /> </div> ); }
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/config/site.ts
export type SiteConfig = typeof siteConfig; export const siteConfig = { name: "StableCoin", mainNav: [ { title: "Deposit/Withdraw", href: "/", }, { title: "Liquidate", href: "/liquidate", }, { title: "Config", href: "/config", }, ], };
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/styles/globals.css
@tailwind base; @tailwind components; @tailwind utilities; @layer base { :root { --background: 0 0% 100%; --foreground: 240 10% 3.9%; --card: 0 0% 100%; --card-foreground: 240 10% 3.9%; --popover: 0 0% 100%; --popover-foreground: 240 10% 3.9%; --primary: 240 5.9% 10%; --primary-fo...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components/tailwind-indicator.tsx
export function TailwindIndicator() { if (process.env.NODE_ENV === "production") return null; return ( <div className="fixed bottom-1 left-1 z-50 flex h-6 w-6 items-center justify-center rounded-full bg-gray-800 p-3 font-mono text-xs text-white"> <div className="block sm:hidden">xs</div> <div class...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components/site-header.tsx
"use client"; import { siteConfig } from "@/config/site"; import { MainNav } from "@/components/main-nav"; import { WalletMultiButton } from "@solana/wallet-adapter-react-ui"; export function SiteHeader() { return ( <header className="sticky top-0 z-40 w-full border-b bg-background"> <div className="conta...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components/wallet-multi-button.tsx
"use client"; import dynamic from "next/dynamic"; const WalletMultiButton = dynamic( () => import("@solana/wallet-adapter-react-ui").then( (module) => module.WalletMultiButton, ), { ssr: false }, ); export default WalletMultiButton;
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components/main-nav.tsx
import * as React from "react"; import Link from "next/link"; import { NavItem } from "@/types/nav"; import { siteConfig } from "@/config/site"; import { cn } from "@/lib/utils"; interface MainNavProps { items?: NavItem[]; } export function MainNav({ items }: MainNavProps) { return ( <div className="flex gap-...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components/ui/tabs.tsx
"use client" import * as React from "react" import * as TabsPrimitive from "@radix-ui/react-tabs" import { cn } from "@/lib/utils" const Tabs = TabsPrimitive.Root const TabsList = React.forwardRef< React.ElementRef<typeof TabsPrimitive.List>, React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> >(({ classN...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components/ui/card.tsx
import * as React from "react" import { cn } from "@/lib/utils" const Card = React.forwardRef< HTMLDivElement, React.HTMLAttributes<HTMLDivElement> >(({ className, ...props }, ref) => ( <div ref={ref} className={cn( "rounded-lg border bg-card text-card-foreground shadow-sm", className )}...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components/ui/slider.tsx
"use client" import * as React from "react" import * as SliderPrimitive from "@radix-ui/react-slider" import { cn } from "@/lib/utils" const Slider = React.forwardRef< React.ElementRef<typeof SliderPrimitive.Root>, React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> >(({ className, ...props }, ref) => ( ...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components/ui/toaster.tsx
"use client" import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, } from "@/components/ui/toast" import { useToast } from "@/components/ui/use-toast" export function Toaster() { const { toasts } = useToast() return ( <ToastProvider> {toasts.map(function ({...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components/ui/label.tsx
"use client" import * as React from "react" import * as LabelPrimitive from "@radix-ui/react-label" import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const labelVariants = cva( "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components/ui/alert.tsx
import * as React from "react" import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const alertVariants = cva( "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", ...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components/ui/use-toast.ts
"use client" // Inspired by react-hot-toast library import * as React from "react" import type { ToastActionElement, ToastProps, } from "@/components/ui/toast" const TOAST_LIMIT = 1 const TOAST_REMOVE_DELAY = 1000000 type ToasterToast = ToastProps & { id: string title?: React.ReactNode description?: React...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components/ui/switch.tsx
"use client" import * as React from "react" import * as SwitchPrimitives from "@radix-ui/react-switch" import { cn } from "@/lib/utils" const Switch = React.forwardRef< React.ElementRef<typeof SwitchPrimitives.Root>, React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> >(({ className, ...props }, ref) =>...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components/ui/dialog.tsx
"use client"; import * as React from "react"; import * as DialogPrimitive from "@radix-ui/react-dialog"; import { X } from "lucide-react"; import { cn } from "@/lib/utils"; const Dialog = DialogPrimitive.Root; const DialogTrigger = DialogPrimitive.Trigger; const DialogPortal = DialogPrimitive.Portal; const Dialog...
0
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components
solana_public_repos/developer-bootcamp-2024/project-11-programmable-money/frontend/components/ui/table.tsx
import * as React from "react" import { cn } from "@/lib/utils" const Table = React.forwardRef< HTMLTableElement, React.HTMLAttributes<HTMLTableElement> >(({ className, ...props }, ref) => ( <div className="relative w-full overflow-auto"> <table ref={ref} className={cn("w-full caption-bottom tex...
0