repo_id
stringclasses
563 values
file_path
stringlengths
40
166
content
stringlengths
1
2.94M
__index_level_0__
int64
0
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-10-lending/package.json
{ "license": "ISC", "scripts": { "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w", "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check" }, "dependencies": { "@coral-xyz/anchor": "^0.30.1", "@pythnetwork/price-service-client": "^1.9.0", "@pythnetwork/pyth-solana-receiver": "^0.8.0", ...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-10-lending/tsconfig.json
{ "compilerOptions": { "types": ["mocha", "chai"], "typeRoots": ["./node_modules/@types"], "lib": ["es2015"], "module": "commonjs", "target": "es6", "esModuleInterop": true } }
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-10-lending/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-10-lending
solana_public_repos/developer-bootcamp-2024/project-10-lending/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. const anchor = require("@coral-xyz/anchor"); module.exports = async function (provider) { // Configure client to use...
0
solana_public_repos/developer-bootcamp-2024/project-10-lending
solana_public_repos/developer-bootcamp-2024/project-10-lending/tests/bankrun.spec.ts
import { describe, it } from 'node:test'; import { BN, Program } from '@coral-xyz/anchor'; import { BankrunProvider } from 'anchor-bankrun'; import { TOKEN_PROGRAM_ID } from '@solana/spl-token'; import { createAccount, createMint, mintTo } from 'spl-token-bankrun'; import { PythSolanaReceiver } from '@pythnetwork/pyth-...
0
solana_public_repos/developer-bootcamp-2024/project-10-lending
solana_public_repos/developer-bootcamp-2024/project-10-lending/bankrun-utils/bankrunConnection.ts
import { TransactionConfirmationStatus, AccountInfo, Keypair, PublicKey, Transaction, RpcResponseAndContext, Commitment, TransactionSignature, SignatureStatusConfig, SignatureStatus, GetVersionedTransactionConfig, GetTransactionConfig, VersionedTransaction, SimulateTransactionConfig, Simul...
0
solana_public_repos/developer-bootcamp-2024/project-10-lending
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/Cargo.toml
[package] name = "lending" version = "0.1.0" description = "Created with Anchor" edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "lending" [features] default = [] cpi = ["no-entrypoint"] no-entrypoint = [] no-idl = [] no-log-ix-name = [] idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build"] [dep...
0
solana_public_repos/developer-bootcamp-2024/project-10-lending
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src/constants.rs
use anchor_lang::prelude::*; #[constant] // https://pyth.network/developers/price-feed-ids#solana-stable pub const SOL_USD_FEED_ID: &str = "0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d"; pub const USDC_USD_FEED_ID: &str = "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a"; pub c...
0
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src/error.rs
use anchor_lang::prelude::*; #[error_code] pub enum ErrorCode { #[msg("Borrowed amount exceeds the maximum LTV.")] OverLTV, #[msg("Borrowed amount results in an under collateralized loan.")] UnderCollateralized, #[msg("Insufficient funds to withdraw.")] InsufficientFunds, #[msg("Attempting ...
0
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src/lib.rs
use anchor_lang::prelude::*; use instructions::*; mod state; mod instructions; mod error; mod constants; declare_id!("CdZeD33fXsAHfZYS8jdxg4qHgXYJwBQ1Bv6GJyETtLST"); #[program] pub mod lending_protocol { use super::*; pub fn init_bank(ctx: Context<InitBank>, liquidation_threshold: u64, max_ltv: u64) -> Res...
0
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src/mod.rs
pub mod state; pub mod error; pub mod instructions; pub mod constants;
0
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src/state.rs
use anchor_lang::prelude::*; #[account] #[derive(InitSpace)] pub struct Bank { /// Authority to make changes to Bank State pub authority: Pubkey, /// Mint address of the asset pub mint_address: Pubkey, /// Current number of tokens in the bank pub total_deposits: u64, /// Current number of ...
0
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src/instructions/withdraw.rs
use anchor_lang::prelude::*; use anchor_spl::associated_token::AssociatedToken; use anchor_spl::token_interface::{ self, Mint, TokenAccount, TokenInterface, TransferChecked }; use crate::state::*; use crate::error::ErrorCode; #[derive(Accounts)] pub struct Withdraw<'info> { #[account(mut)] pub signer: Signer<'...
0
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src/instructions/repay.rs
use anchor_lang::prelude::*; use anchor_spl::associated_token::AssociatedToken; use anchor_spl::token_interface::{ self, Mint, TokenAccount, TokenInterface, TransferChecked }; use crate::state::*; use crate::error::ErrorCode; #[derive(Accounts)] pub struct Repay<'info> { #[account(mut)] pub signer: Signer<'inf...
0
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src/instructions/deposit.rs
use anchor_lang::prelude::*; use anchor_spl::associated_token::AssociatedToken; use anchor_spl::token_interface::{ self, Mint, TokenAccount, TokenInterface, TransferChecked }; use crate::state::*; #[derive(Accounts)] pub struct Deposit<'info> { #[account(mut)] pub signer: Signer<'info>, pub mint: Interface...
0
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src/instructions/borrow.rs
use std::f32::consts::E; use anchor_lang::prelude::*; use anchor_spl::associated_token::AssociatedToken; use anchor_spl::token_interface::{ self, Mint, TokenAccount, TokenInterface, TransferChecked }; use pyth_solana_receiver_sdk::price_update::{get_feed_id_from_hex, PriceUpdateV2}; use crate::constants::{MAXIMUM_AGE,...
0
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src/instructions/mod.rs
pub use admin::*; pub mod admin; pub use deposit::*; pub mod deposit; pub use borrow::*; pub mod borrow; pub use withdraw::*; pub mod withdraw; pub use repay::*; pub mod repay; pub use liquidate::*; pub mod liquidate;
0
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src/instructions/admin.rs
use anchor_lang::prelude::*; use anchor_spl::token_interface::{ Mint, TokenAccount, TokenInterface }; use crate::state::*; #[derive(Accounts)] pub struct InitBank<'info> { #[account(mut)] pub signer: Signer<'info>, pub mint: InterfaceAccount<'info, Mint>, #[account( init, space = 8 + B...
0
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src
solana_public_repos/developer-bootcamp-2024/project-10-lending/lending/src/instructions/liquidate.rs
use anchor_lang::prelude::*; use anchor_spl::associated_token::AssociatedToken; use anchor_spl::token_interface::{ self, Mint, TokenAccount, TokenInterface, TransferChecked }; use pyth_solana_receiver_sdk::price_update::{get_feed_id_from_hex, PriceUpdateV2}; use crate::constants::{MAXIMUM_AGE, SOL_USD_FEED_ID, USDC_USD...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-6-nfts/package.json
{ "name": "new-nft", "version": "1.0.0", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "description": "", "dependencies": { "@metaplex-foundation/mpl-token-metadata": "^3.2.1", "@metaplex-foundati...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-6-nfts/verify-nft.ts
import { findMetadataPda, mplTokenMetadata, verifyCollectionV1, } from "@metaplex-foundation/mpl-token-metadata"; import { airdropIfRequired, getExplorerLink, getKeypairFromFile, } from "@solana-developers/helpers"; import { createUmi } from "@metaplex-foundation/umi-bundle-defaults"; import { Connection...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-6-nfts/create-nft.ts
import { createNft, fetchDigitalAsset, mplTokenMetadata, } from "@metaplex-foundation/mpl-token-metadata"; import { airdropIfRequired, getExplorerLink, getKeypairFromFile, } from "@solana-developers/helpers"; import { createUmi } from "@metaplex-foundation/umi-bundle-defaults"; import { Connection, LAMPO...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-6-nfts/create-collection.ts
import { createNft, fetchDigitalAsset, mplTokenMetadata, } from "@metaplex-foundation/mpl-token-metadata"; import { airdropIfRequired, getExplorerLink, getKeypairFromFile, } from "@solana-developers/helpers"; import { createUmi } from "@metaplex-foundation/umi-bundle-defaults"; import { Connection, LAMPO...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/nx.json
{ "$schema": "./node_modules/nx/schemas/nx-schema.json", "namedInputs": { "default": ["{projectRoot}/**/*", "sharedGlobals"], "production": [ "default", "!{projectRoot}/.eslintrc.json", "!{projectRoot}/eslint.config.js", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", ...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/LICENSE
MIT License Copyright (c) 2024 brimigs 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, distribut...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/vercel.json
{ "buildCommand": "npm run build", "outputDirectory": "dist/web/.next" }
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/package.json
{ "name": "@token-vesting/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 @solan...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/jest.config.ts
import { getJestProjectsAsync } from '@nx/jest'; export default async () => ({ projects: await getJestProjectsAsync(), });
0
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/web/app/page.module.css
.page { }
0
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/web
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web/app
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web/app
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/web/app/vesting/page.tsx
import VestingFeature from '@/components/vesting/vesting-feature'; export default function Page() { return <VestingFeature />; }
0
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/web/app/api
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web/app
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web/app/account
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web/components
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web/components
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web/components
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web/components
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web/components
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web/components
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web/components
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/web/components/vesting/vesting-data-access.tsx
"use client"; import { getVestingProgram, getVestingProgramId } from "@token-vesting/anchor"; import { useConnection } from "@solana/wallet-adapter-react"; import { Cluster, PublicKey } from "@solana/web3.js"; import { useMutation, useQuery } from "@tanstack/react-query"; import { useMemo } from "react"; import toast ...
0
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/web/components
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/web/components/vesting/vesting-feature.tsx
'use client'; import { useWallet } from '@solana/wallet-adapter-react'; import { WalletButton } from '../solana/solana-provider'; import { AppHero, ellipsify } from '../ui/ui-layout'; import { ExplorerLink } from '../cluster/cluster-ui'; import { useVestingProgram } from './vesting-data-access'; import { VestingCreate...
0
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/web/components
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/web/components/vesting/vesting-ui.tsx
"use client"; import { PublicKey } from "@solana/web3.js"; import { useMemo, useState } from "react"; import { useVestingProgram, useVestingProgramAccount, } from "./vesting-data-access"; import { useWallet } from "@solana/wallet-adapter-react"; export function VestingCreate() { const { createVestingAccount } =...
0
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/web/components
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web/components
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web/components
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/web/components
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/anchor/Anchor.toml
[toolchain] [features] resolution = true skip-lint = false [programs.localnet] vesting = "GFdLg11UBR8ZeePW43ZyD1gY4z4UQ96LPa22YBgnn4z8" [registry] url = "https://api.apr.dev" [provider] cluster = "Localnet" wallet = "~/.config/solana/id.json" [scripts] test = "../node_modules/.bin/nx run anchor:jest" [test] start...
0
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/anchor/package.json
{ "name": "@token-vesting/anchor", "version": "0.0.1", "dependencies": { "@coral-xyz/anchor": "^0.30.1", "@solana/spl-token": "^0.4.8", "@solana/web3.js": "1.94.0", "anchor-bankrun": "^0.4.0", "solana-bankrun": "^0.2.0", "spl-token-bankrun": "0.2.5" }, "main": "./index.cjs", "module"...
0
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/anchor
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/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-8-token-vesting/anchor
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/anchor/tests/bankrun.spec.ts
// No imports needed: web3, anchor, pg and more are globally available import * as anchor from "@coral-xyz/anchor"; import { BankrunProvider } from "anchor-bankrun"; import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; import { BN, Program } from "@coral-xyz/anchor"; import { startAnchor, Clock, BanksClient, ...
0
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/anchor/programs
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/anchor/programs/vesting/Cargo.toml
[package] name = "vesting" version = "0.1.0" description = "Created with Anchor" edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "vesting" [features] no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] default = [] idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build"] [dep...
0
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/anchor/programs
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/anchor/programs/vesting/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/anchor/programs/vesting
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/anchor/programs/vesting/src/lib.rs
use anchor_lang::prelude::*; use anchor_spl::associated_token::AssociatedToken; use anchor_spl::token_interface::{ self, Mint, TokenAccount, TokenInterface, TransferChecked }; declare_id!("GFdLg11UBR8ZeePW43ZyD1gY4z4UQ96LPa22YBgnn4z8"); #[program] pub mod vesting { use super::*; pub fn create_vesting_account(...
0
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/anchor
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/anchor/src/vesting-exports.ts
// Here we export some useful types and functions for interacting with the Anchor program. import { AnchorProvider, Program } from '@coral-xyz/anchor'; import { Cluster, PublicKey } from '@solana/web3.js'; import VestingIDL from '../target/idl/vesting.json'; import type { Vesting } from '../target/types/vesting'; // R...
0
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/anchor
solana_public_repos/developer-bootcamp-2024/project-8-token-vesting/anchor/src/index.ts
// This file was generated by preset-anchor. Programs are exported from this file. export * from './vesting-exports';
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-1-favorites/pnpm-lock.yaml
lockfileVersion: '6.0' settings: autoInstallPeers: true excludeLinksFromLockfile: false dependencies: '@coral-xyz/anchor': specifier: ^0.30.0 version: 0.30.0 '@solana-developers/helpers': specifier: ^2.0.0 version: 2.3.0 devDependencies: '@types/bn.js': specifier: ^5.1.0 version: 5....
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-1-favorites/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
solana_public_repos/developer-bootcamp-2024/project-1-favorites/.prettierignore
.anchor .DS_Store target node_modules dist build test-ledger
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-1-favorites/Anchor.toml
[toolchain] [features] resolution = true skip-lint = false [programs.localnet] favorites = "ww9C83noARSQVBnqmCUmaVdbJjmiwcV9j2LkXYMoUCV" [registry] url = "https://api.apr.dev" [provider] cluster = "Localnet" wallet = "~/.config/solana/id.json" [scripts] test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-1-favorites/package.json
{ "scripts": { "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w", "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check" }, "dependencies": { "@coral-xyz/anchor": "^0.30.0", "@solana-developers/helpers": "^2.0.0" }, "license": "MIT", "devDependencies": { "@types/bn.js": "^5.1.0", "...
0
solana_public_repos/developer-bootcamp-2024
solana_public_repos/developer-bootcamp-2024/project-1-favorites/tsconfig.json
{ "compilerOptions": { "types": ["mocha", "chai"], "typeRoots": ["./node_modules/@types"], "lib": ["es2015"], "module": "commonjs", "target": "es6", "esModuleInterop": true } }
0
solana_public_repos/developer-bootcamp-2024/project-1-favorites
solana_public_repos/developer-bootcamp-2024/project-1-favorites/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. const anchor = require('@coral-xyz/anchor'); module.exports = async (provider) => { // Configure client to use the p...
0
solana_public_repos/developer-bootcamp-2024/project-1-favorites
solana_public_repos/developer-bootcamp-2024/project-1-favorites/tests/favorites.ts
import * as anchor from '@coral-xyz/anchor'; import type { Program } from '@coral-xyz/anchor'; import { getCustomErrorMessage } from '@solana-developers/helpers'; import { assert } from 'chai'; import type { Favorites } from '../target/types/favorites'; import { systemProgramErrors } from './system-errors'; const web3 ...
0
solana_public_repos/developer-bootcamp-2024/project-1-favorites
solana_public_repos/developer-bootcamp-2024/project-1-favorites/tests/system-errors.ts
// From https://github.com/solana-labs/solana/blob/a94920a4eadf1008fc292e47e041c1b3b0d949df/sdk/program/src/system_instruction.rs export const systemProgramErrors = [ 'an account with the same address already exists', 'account does not have enough SOL to perform the operation', 'cannot assign account to this pr...
0
solana_public_repos/developer-bootcamp-2024/project-1-favorites/programs
solana_public_repos/developer-bootcamp-2024/project-1-favorites/programs/favorites/Cargo.toml
[package] name = "favorites" version = "0.1.0" description = "Created with Anchor" edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "favorites" [features] no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] default = [] idl-build = ["anchor-lang/idl-build"] [dependencies] anchor-la...
0
solana_public_repos/developer-bootcamp-2024/project-1-favorites/programs
solana_public_repos/developer-bootcamp-2024/project-1-favorites/programs/favorites/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/developer-bootcamp-2024/project-1-favorites/programs/favorites
solana_public_repos/developer-bootcamp-2024/project-1-favorites/programs/favorites/src/lib.rs
use anchor_lang::prelude::*; // Our program's address! // This matches the key in the target/deploy directory declare_id!("ww9C83noARSQVBnqmCUmaVdbJjmiwcV9j2LkXYMoUCV"); // Anchor programs always use 8 bits for the discriminator pub const ANCHOR_DISCRIMINATOR_SIZE: usize = 8; // Our Solana program! #[program] pub mo...
0
solana_public_repos
solana_public_repos/stripe-onramp/next.config.js
/** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: false, }; module.exports = nextConfig;
0
solana_public_repos
solana_public_repos/stripe-onramp/yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 "@babel/runtime@^7.20.7": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673" integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP...
0
solana_public_repos
solana_public_repos/stripe-onramp/package.json
{ "name": "stripe-onramp", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "@stripe/crypto": "^0.0.2", "@stripe/stripe-js": "^1.48.0", "@types/node": "18.14.6", "@types...
0
solana_public_repos
solana_public_repos/stripe-onramp/tsconfig.json
{ "compilerOptions": { "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "node", "resol...
0
solana_public_repos
solana_public_repos/stripe-onramp/.eslintrc.json
{ "extends": "next/core-web-vitals" }
0
solana_public_repos/stripe-onramp/src
solana_public_repos/stripe-onramp/src/styles/globals.css
:root { --max-width: 1100px; --border-radius: 12px; --font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', 'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro', 'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace; --foreground-rgb: 0, 0, 0; --background-start-...
0
solana_public_repos/stripe-onramp/src
solana_public_repos/stripe-onramp/src/pages/index.tsx
import Head from 'next/head' import Script from 'next/script' import { loadStripeOnramp, OnrampSession } from "@stripe/crypto" import { useEffect } from 'react' export default function Home({ clientSecret }: { clientSecret: string | null }) { const loadOnramp = async (clientSecret: string) => { if (clientSecret...
0
solana_public_repos/stripe-onramp/src
solana_public_repos/stripe-onramp/src/pages/_document.tsx
import { Html, Head, Main, NextScript } from 'next/document' export default function Document() { return ( <Html lang="en"> <Head /> <body> <Main /> <NextScript /> </body> </Html> ) }
0
solana_public_repos/stripe-onramp/src
solana_public_repos/stripe-onramp/src/pages/_app.tsx
import '@/styles/globals.css' import type { AppProps } from 'next/app' export default function App({ Component, pageProps }: AppProps) { return <Component {...pageProps} /> }
0