repo_id
stringclasses
563 values
file_path
stringlengths
40
166
content
stringlengths
1
2.94M
__index_level_0__
int64
0
0
solana_public_repos/dapp-scaffold-react-native/src
solana_public_repos/dapp-scaffold-react-native/src/components/Header.tsx
import React from 'react'; import { ImageBackground, StyleSheet, Text, useColorScheme, View, } from 'react-native'; import {Colors} from './Colors'; export function Header() { const isDarkMode = useColorScheme() === 'dark'; return ( <ImageBackground accessibilityRole="image" testID="new-a...
0
solana_public_repos/dapp-scaffold-react-native/src
solana_public_repos/dapp-scaffold-react-native/src/components/index.ts
export * from './AccountSelect'; export * from './Balance'; export * from './Header'; export * from './NetworkSelect'; export * from './Section';
0
solana_public_repos/AnishDe12020
solana_public_repos/AnishDe12020/arsnal/pnpm-lock.yaml
lockfileVersion: '6.0' dependencies: '@codemirror/lang-javascript': specifier: ^6.1.9 version: 6.1.9 '@codemirror/lang-rust': specifier: ^6.0.1 version: 6.0.1 '@hookform/resolvers': specifier: ^3.1.1 version: 3.1.1(react-hook-form@7.45.0) '@lezer/highlight': specifier: ^1.1.6 ve...
0
solana_public_repos/AnishDe12020
solana_public_repos/AnishDe12020/arsnal/tailwind.config.js
/** @type {import('tailwindcss').Config} */ module.exports = { darkMode: ["class"], content: [ "./pages/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}", "./app/**/*.{ts,tsx}", "./src/**/*.{ts,tsx}", ], theme: { container: { center: true, padding: "2rem", screens: { "2x...
0
solana_public_repos/AnishDe12020
solana_public_repos/AnishDe12020/arsnal/next.config.mjs
/** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, experimental: { appDir: true, }, } export default nextConfig
0
solana_public_repos/AnishDe12020
solana_public_repos/AnishDe12020/arsnal/tsconfig.tsbuildinfo
{"program":{"fileNames":["../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/.pnpm/typescri...
0
solana_public_repos/AnishDe12020
solana_public_repos/AnishDe12020/arsnal/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/AnishDe12020
solana_public_repos/AnishDe12020/arsnal/.prettierignore
cache .cache package.json package-lock.json public CHANGELOG.md .yarn dist node_modules .next build .contentlayer
0
solana_public_repos/AnishDe12020
solana_public_repos/AnishDe12020/arsnal/.editorconfig
# editorconfig.org root = true [*] charset = utf-8 end_of_line = lf indent_size = 2 indent_style = space insert_final_newline = true trim_trailing_whitespace = true
0
solana_public_repos/AnishDe12020
solana_public_repos/AnishDe12020/arsnal/prettier.config.js
/** @type {import('prettier').Config} */ module.exports = { endOfLine: "lf", semi: false, singleQuote: false, tabWidth: 2, trailingComma: "es5", importOrder: [ "^(react/(.*)$)|^(react$)", "^(next/(.*)$)|^(next$)", "<THIRD_PARTY_MODULES>", "", "^types$", "^@/types/(.*)$", "^@/conf...
0
solana_public_repos/AnishDe12020
solana_public_repos/AnishDe12020/arsnal/package.json
{ "name": "next-template", "version": "0.0.2", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint", "lint:fix": "next lint --fix", "preview": "next build && next start", "typecheck": "tsc --noEmit", "format:write": "p...
0
solana_public_repos/AnishDe12020
solana_public_repos/AnishDe12020/arsnal/components.json
{ "$schema": "https://ui.shadcn.com/schema.json", "style": "new-york", "rsc": true, "tailwind": { "config": "tailwind.config.js", "css": "styles/globals.css", "baseColor": "stone", "cssVariables": true }, "aliases": { "components": "@/components", "utils": "@/lib/utils" } }
0
solana_public_repos/AnishDe12020
solana_public_repos/AnishDe12020/arsnal/tsconfig.json
{ "compilerOptions": { "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "incremental": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "node", "r...
0
solana_public_repos/AnishDe12020
solana_public_repos/AnishDe12020/arsnal/.eslintignore
dist/* .cache public node_modules *.esm.js
0
solana_public_repos/AnishDe12020
solana_public_repos/AnishDe12020/arsnal/postcss.config.js
module.exports = { plugins: { tailwindcss: {}, autoprefixer: {}, }, }
0
solana_public_repos/AnishDe12020
solana_public_repos/AnishDe12020/arsnal/.eslintrc.json
{ "$schema": "https://json.schemastore.org/eslintrc", "root": true, "extends": [ "next/core-web-vitals", "prettier", "plugin:tailwindcss/recommended" ], "plugins": ["tailwindcss"], "rules": { "@next/next/no-html-link-for-pages": "off", "react/jsx-key": "off", "tailwindcss/no-custom-c...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/types/colors.ts
export const colors = { green: "bg-green-600/30 text-green-300", blue: "bg-blue-600/30 text-blue-300", purple: "bg-purple-600/30 text-purple-300", red: "bg-red-600/30 text-red-300", } export interface ITypeBadge { color: string value: string defined?: boolean }
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/types/program.ts
import { Idl } from "@project-serum/anchor" export type LocalProgram = { id: string name: string programId?: string idl: Idl }
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/types/nav.ts
export interface NavItem { title: string href?: string disabled?: boolean external?: boolean }
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/types/cluster.ts
export enum Cluster { MainnetBeta = "mainnet-beta", Devnet = "devnet", Testnet = "testnet", Localnet = "localnet", }
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/app/layout.tsx
import "@/styles/globals.css" import { Metadata } from "next" import Script from "next/script" import { siteConfig } from "@/config/site" import { fontSans } from "@/lib/fonts" import { cn } from "@/lib/utils" import Bar from "@/components/bar" import { SiteHeader } from "@/components/site-header" import { ThemeProvi...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/app/page.tsx
"use client" import Link from "next/link" import { ArrowRightIcon } from "lucide-react" import { siteConfig } from "@/config/site" import { cn } from "@/lib/utils" import { buttonVariants } from "@/components/ui/button" export default function IndexPage() { return ( <section className="flex flex-col items-cent...
0
solana_public_repos/AnishDe12020/arsnal/app
solana_public_repos/AnishDe12020/arsnal/app/playground/layout.tsx
import { ReactNode } from "react" const PlaygroundLayout = ({ children }: { children: ReactNode }) => { return ( <div className="flex flex-col items-center max-w-3xl gap-8 mx-auto mt-16"> {children} </div> ) } export default PlaygroundLayout
0
solana_public_repos/AnishDe12020/arsnal/app
solana_public_repos/AnishDe12020/arsnal/app/playground/page.tsx
"use client" import { useEffect, useState } from "react" import Link from "next/link" import { getPrograms, removeProgram } from "@/utils/localdb" import { truncatePubkey } from "@/utils/truncate" import { PlusIcon } from "lucide-react" import { toast } from "sonner" import { LocalProgram } from "@/types/program" imp...
0
solana_public_repos/AnishDe12020/arsnal/app/playground
solana_public_repos/AnishDe12020/arsnal/app/playground/new/page.tsx
"use client" import { useRouter } from "next/navigation" import { zodResolver } from "@hookform/resolvers/zod" import { createId } from "@paralleldrive/cuid2" import { PublicKey } from "@solana/web3.js" import { useForm } from "react-hook-form" import { toast } from "sonner" import { z } from "zod" import { Button } ...
0
solana_public_repos/AnishDe12020/arsnal/app/playground/program
solana_public_repos/AnishDe12020/arsnal/app/playground/program/[id]/page.tsx
"use client" import { useMemo } from "react" import { notFound, useSearchParams } from "next/navigation" import { getProgram } from "@/utils/localdb" import { AnchorProvider, Program } from "@project-serum/anchor" import { useConnection } from "@solana/wallet-adapter-react" import { Keypair, PublicKey, Transaction } f...
0
solana_public_repos/AnishDe12020/arsnal/app/playground/program/[id]
solana_public_repos/AnishDe12020/arsnal/app/playground/program/[id]/edit/page.tsx
"use client" import { notFound, useRouter } from "next/navigation" import { isValidIdl } from "@/utils/idl" import { editProgram, getProgram } from "@/utils/localdb" import { zodResolver } from "@hookform/resolvers/zod" import { PublicKey } from "@solana/web3.js" import { useForm } from "react-hook-form" import { toas...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/config/site.ts
export type SiteConfig = typeof siteConfig export const siteConfig = { name: "Arsnal", description: "Simplifying the Solana DX with a suite of debugging tools and a playground for interacting with programs", mainNav: [ { title: "Home", href: "/", }, ], links: { twitter: "https://t...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/utils/cluster.ts
import { clusterApiUrl } from "@solana/web3.js" import { Cluster } from "@/types/cluster" export const getRpc = (cluster: string) => { switch (cluster) { case Cluster.MainnetBeta: return "https://solana-mainnet.rpc.extrnode.com" case Cluster.Devnet: return clusterApiUrl("devnet") case Clus...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/utils/idl.ts
import { Idl } from "@project-serum/anchor" import { IdlType } from "@project-serum/anchor/dist/cjs/idl" import { colors, ITypeBadge } from "@/types/colors" export const isValidIdl = (idl: any): idl is Idl => { if ( !idl.version || !idl.name || !idl.instructions || !Array.isArray(idl.instructions) ...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/utils/truncate.ts
export const truncateStr = (str: string, left: number, right: number) => { const leftStr = str.slice(0, left) const rightStr = str.slice(-right) return `${leftStr}...${rightStr}` } export const truncatePubkey = (pubkey: string) => { return truncateStr(pubkey, 6, 6) }
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/utils/localdb.ts
// there will bea programs array that stores the program id and program idl using local forage import { Idl } from "@project-serum/anchor" import localforage from "localforage" import { LocalProgram } from "@/types/program" export const addProgram = async ( cuid: string, name: string, idl: Idl, programId?: s...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/utils/knownAccount.ts
import { SystemProgram, SYSVAR_INSTRUCTIONS_PUBKEY } from "@solana/web3.js" export interface KnownAccount { name: string address: string } export const knownAccounts: KnownAccount[] = [ { name: "systemProgram", address: SystemProgram.programId.toBase58(), }, { name: "ixSysvar", address: SYSV...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/state/cluster.ts
import { atomWithStorage } from "jotai/utils" import { Cluster } from "../types/cluster" const clusterAtom = atomWithStorage<Cluster>("cluster", Cluster.Devnet) export default clusterAtom
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/styles/globals.css
@tailwind base; @tailwind components; @tailwind utilities; @layer base { * { @apply border-border; } body { @apply bg-background text-foreground; } }
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/components/theme-provider.tsx
"use client" import * as React from "react" import { ThemeProvider as NextThemesProvider } from "next-themes" import { ThemeProviderProps } from "next-themes/dist/types" export function ThemeProvider({ children, ...props }: ThemeProviderProps) { return <NextThemesProvider {...props}>{children}</NextThemesProvider> ...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/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 classN...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/components/type-badge.tsx
import { ITypeBadge } from "@/types/colors" import { cn } from "@/lib/utils" const TypeBadge = ({ type }: { type: ITypeBadge }) => { return ( <div className={cn( "font-mono text-xs px-1 py-0.5 inline-flex items-center rounded-sm", "bg-purple-600/30 text-purple-300" )} > {typ...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/components/site-header.tsx
import Link from "next/link" import { siteConfig } from "@/config/site" import { buttonVariants } from "@/components/ui/button" import { Icons } from "@/components/icons" import { MainNav } from "@/components/main-nav" import { ThemeToggle } from "@/components/theme-toggle" export function SiteHeader() { return ( ...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/components/icons.tsx
import { Loader2, LucideProps, Moon, SunMedium, Twitter, type Icon as LucideIcon, } from "lucide-react" export type Icon = LucideIcon export const Icons = { sun: SunMedium, moon: Moon, twitter: Twitter, spinner: Loader2, logo: (props: LucideProps) => ( <svg xmlns="http://www.w3.org/2000/svg"...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/components/bar.tsx
"use client" import { Cluster } from "@/types/cluster" import useCluster from "@/hooks/use-cluster" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "./ui/select" const Bar = () => { const { cluster, setCluster } = useCluster() return ( <div className="flex items-cent...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/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" import { Icons } from "@/components/icons" interface MainNavProps { items?: NavItem[] } export function MainNav({ items }: MainNavProps) { ...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/components/theme-toggle.tsx
"use client" import * as React from "react" import { useTheme } from "next-themes" import { Button } from "@/components/ui/button" import { Icons } from "@/components/icons" export function ThemeToggle() { const { setTheme, theme } = useTheme() return ( <Button variant="ghost" size="sm" on...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/ui/alert-dialog.tsx
"use client" import * as React from "react" import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" import { cn } from "@/lib/utils" import { buttonVariants } from "@/components/ui/button" const AlertDialog = AlertDialogPrimitive.Root const AlertDialogTrigger = AlertDialogPrimitive.Trigger const Alert...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/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/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/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/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/ui/accordion.tsx
"use client" import * as React from "react" import * as AccordionPrimitive from "@radix-ui/react-accordion" import { ChevronDownIcon } from "@radix-ui/react-icons" import { cn } from "@/lib/utils" const Accordion = AccordionPrimitive.Root const AccordionItem = React.forwardRef< React.ElementRef<typeof AccordionPr...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/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/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/ui/badge.tsx
import * as React from "react" import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const badgeVariants = cva( "inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offs...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/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="w-full overflow-auto"> <table ref={ref} className={cn("w-full caption-bottom text-sm", cl...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/ui/button.tsx
import * as React from "react" import { Slot } from "@radix-ui/react-slot" import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const buttonVariants = cva( "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-no...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/ui/select.tsx
"use client" import * as React from "react" import { CaretSortIcon, CheckIcon } from "@radix-ui/react-icons" import * as SelectPrimitive from "@radix-ui/react-select" import { cn } from "@/lib/utils" const Select = SelectPrimitive.Root const SelectGroup = SelectPrimitive.Group const SelectValue = SelectPrimitive.V...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/ui/textarea.tsx
import * as React from "react" import { cn } from "@/lib/utils" export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {} const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>( ({ className, ...props }, ref) => { return ( <textarea className={cn...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/ui/input.tsx
import * as React from "react" import { cn } from "@/lib/utils" export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {} const Input = React.forwardRef<HTMLInputElement, InputProps>( ({ className, type, ...props }, ref) => { return ( <input type={type} classNam...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/ui/form.tsx
import * as React from "react" import * as LabelPrimitive from "@radix-ui/react-label" import { Slot } from "@radix-ui/react-slot" import { Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext, } from "react-hook-form" import { cn } from "@/lib/utils" import { Label } from "@/c...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/instructions/card.tsx
import { parseFieldType } from "@/utils/idl" import { Idl, Program } from "@project-serum/anchor" import { IdlInstruction } from "@project-serum/anchor/dist/cjs/idl" import { AccordionItem } from "@radix-ui/react-accordion" import TypeBadge from "../type-badge" import { Accordion, AccordionContent, AccordionTrigger } ...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/instructions/builder.tsx
import { useState } from "react" import { zodResolver } from "@hookform/resolvers/zod" import { Program } from "@project-serum/anchor" import { Idl, IdlInstruction } from "@project-serum/anchor/dist/cjs/idl" import { Keypair, PublicKey, TransactionInstruction } from "@solana/web3.js" import { X } from "lucide-react" im...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/instructions/arg-field.tsx
import { parseFieldType } from "@/utils/idl" import { ControllerRenderProps, FieldValues } from "react-hook-form" import { Input } from "../ui/input" import { Switch } from "../ui/switch" import { Textarea } from "../ui/textarea" interface ArgFieldProps { arg: Record<string, any> field: ControllerRenderProps<Fiel...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/instructions/args-input.tsx
import { parseFieldType } from "@/utils/idl" import { getKnownAccount, isKnownAccount } from "@/utils/knownAccount" import { Control, useFieldArray } from "react-hook-form" import { Button } from "../ui/button" import { FormControl, FormField, FormItem } from "../ui/form" import { Input } from "../ui/input" import { S...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/instructions/accounts-input.tsx
import { getKnownAccount, isKnownAccount } from "@/utils/knownAccount" import { Control, useFieldArray, UseFormSetValue } from "react-hook-form" import { Button } from "../ui/button" import { FormControl, FormField, FormItem } from "../ui/form" import { Input } from "../ui/input" import { Switch } from "../ui/switch" ...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/wrappers/solana-provider.tsx
"use client" import { useMemo } from "react" import { ConnectionProvider, WalletProvider, } from "@solana/wallet-adapter-react" import { BackpackWalletAdapter, GlowWalletAdapter, PhantomWalletAdapter, } from "@solana/wallet-adapter-wallets" import useCluster from "@/hooks/use-cluster" export const SolanaPr...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/wrappers/sonner-toaster.tsx
"use client" import { Toaster as SonnerToaster } from "sonner" const Toaster = () => <SonnerToaster richColors theme="dark" /> export default Toaster
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/account-card/index.tsx
import { parseFieldType } from "@/utils/idl" import { Program } from "@project-serum/anchor" import { Idl, IdlAccountDef } from "@project-serum/anchor/dist/cjs/idl" import TypeBadge from "../type-badge" import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "../ui/accordion" import { T...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/account-card/deserialize-account-address.tsx
import { useState } from "react" import { AccountsCoder } from "@project-serum/anchor" import { IdlAccountDef } from "@project-serum/anchor/dist/cjs/idl" import { useConnection } from "@solana/wallet-adapter-react" import { PublicKey } from "@solana/web3.js" import ReactJson from "react-json-view" import { toast } from...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/account-card/deserialize-account-data.tsx
import { useMemo, useState } from "react" import { AccountsCoder } from "@project-serum/anchor" import { IdlAccountDef } from "@project-serum/anchor/dist/cjs/idl" import ReactJson from "react-json-view" import { Textarea } from "../ui/textarea" interface DeserializeAccountData { account: IdlAccountDef accountsCod...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/type-card/index.tsx
import { parseFieldType } from "@/utils/idl" import { Program } from "@project-serum/anchor" import { Idl, IdlTypeDef } from "@project-serum/anchor/dist/cjs/idl" import ReactJson from "react-json-view" import TypeBadge from "../type-badge" import { Table, TableBody, TableCell, TableHead, TableHeader, Table...
0
solana_public_repos/AnishDe12020/arsnal/components
solana_public_repos/AnishDe12020/arsnal/components/errors/index.tsx
import { useMemo, useState } from "react" import { IdlErrorCode } from "@project-serum/anchor/dist/cjs/idl" import { colors } from "@/types/colors" import TypeBadge from "../type-badge" import { Input } from "../ui/input" import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "../u...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/public/thirteen.svg
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="31" fill="none"><g opacity=".9"><path fill="url(#a)" d="M13 .4v29.3H7V6.3h-.2L0 10.5V5L7.2.4H13Z"/><path fill="url(#b)" d="M28.8 30.1c-2.2 0-4-.3-5.7-1-1.7-.8-3-1.8-4-3.1a7.7 7.7 0 0 1-1.4-4.6h6.2c0 .8.3 1.4.7 2 .4.5 1 .9 1.7 1.2.7.3 1.6.4 2.5.4 1 0 1.7-.2 2.5-...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/public/vercel.svg
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-1...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/public/next.svg
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/hooks/use-cluster.ts
import { useMemo } from "react" import { getRpc } from "@/utils/cluster" import { useAtom } from "jotai" import clusterAtom from "../state/cluster" const useCluster = () => { const [cluster, setCluster] = useAtom(clusterAtom) const rpcUrl = useMemo(() => getRpc(cluster), [cluster]) return { cluster, s...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/lib/fonts.ts
import { JetBrains_Mono as FontMono, Inter as FontSans } from "next/font/google" export const fontSans = FontSans({ subsets: ["latin"], variable: "--font-sans", }) export const fontMono = FontMono({ subsets: ["latin"], variable: "--font-mono", })
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/lib/utils.ts
import { type ClassValue, clsx } from "clsx" import { twMerge } from "tailwind-merge" export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)) }
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/lib/codemirror-theme.ts
import { tags } from "@lezer/highlight" import createTheme from "@uiw/codemirror-themes" const customCodemirrorTheme = createTheme({ theme: "dark", settings: { background: "#151515", foreground: "#E5E5E5", caret: "#E5E5E5", selection: "#BFD084", selectionMatch: "#BFD084", lineHighlight: "#1...
0
solana_public_repos/AnishDe12020/arsnal
solana_public_repos/AnishDe12020/arsnal/.vscode/settings.json
{ "typescript.tsdk": "../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib", "typescript.enablePromptUseWorkspaceTsdk": true }
0
solana_public_repos/drift-labs
solana_public_repos/drift-labs/protocol-v2/Cargo.toml
[workspace] members = [ "programs/*", ] exclude = [ "deps/serum-dex" ] [profile.release] lto = "fat" codegen-units = 1 [profile.release.build-override] opt-level = 3 incremental = false codegen-units = 1
0
solana_public_repos/drift-labs
solana_public_repos/drift-labs/protocol-v2/codecov.yml
comment: layout: "header, diff, flags, components" component_management: individual_components: - component_id: drift name: drift paths: - programs/drift
0
solana_public_repos/drift-labs
solana_public_repos/drift-labs/protocol-v2/LICENSE
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, ...
0
solana_public_repos/drift-labs
solana_public_repos/drift-labs/protocol-v2/.verified-build.json
{ "dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH": ["--commit-hash", "8d2cd726afdc800f89c841ff3cf1968980719df0", "--library-name", "drift"] }
0
solana_public_repos/drift-labs
solana_public_repos/drift-labs/protocol-v2/Cargo.lock
# This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "aead" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ "generic-ar...
0
solana_public_repos/drift-labs
solana_public_repos/drift-labs/protocol-v2/.prettierignore
**/node_modules/**
0
solana_public_repos/drift-labs
solana_public_repos/drift-labs/protocol-v2/Anchor.toml
[provider] cluster = "localnet" wallet = "~/.config/solana/id.json" [workspace] exclude = ["programs/openbook_v2"] [scripts] # to run local validator tests, use "./test-scripts/run-ts-mocha" in "test" test = "echo" # need to call anchor test to update metadata field in idl before running tests, so just do a noop lint...
0
solana_public_repos/drift-labs
solana_public_repos/drift-labs/protocol-v2/yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 "@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA...
0
solana_public_repos/drift-labs
solana_public_repos/drift-labs/protocol-v2/package.json
{ "directories": { "test": "tests" }, "author": "", "license": "ISC", "devDependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/anchor-30": "npm:@coral-xyz/anchor@0.30.1", "@project-serum/common": "0.0.1-beta.3", "@project-serum/serum": "0.13.65", "@pythnetwork/client": "2.21.0", "@solana/spl-t...
0
solana_public_repos/drift-labs
solana_public_repos/drift-labs/protocol-v2/.prettierrc.js
module.exports = { semi: true, trailingComma: 'es5', singleQuote: true, printWidth: 80, tabWidth: 2, useTabs: true, bracketSameLine: false, endOfLine: 'auto', };
0
solana_public_repos/drift-labs
solana_public_repos/drift-labs/protocol-v2/typedoc.json
{ "tsconfig": "sdk/tsconfig.json", "entryPoints": ["sdk/src/index.ts"], "out": "docs/sdk/" }
0
solana_public_repos/drift-labs
solana_public_repos/drift-labs/protocol-v2/.eslintrc.js
module.exports = { "root": true, "parser": "@typescript-eslint/parser", "env": { "browser": true, "node": true }, "ignorePatterns": ["**/lib", "**/node_modules", "migrations"], "plugins": [], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/r...
0
solana_public_repos/drift-labs
solana_public_repos/drift-labs/protocol-v2/tsconfig.json
{ "compilerOptions": { "types": ["mocha", "chai"], "typeRoots": ["./node_modules/@types"], "lib": ["es2015"], "module": "commonjs", "target": "es6", "esModuleInterop": true, "skipLibCheck": true, "resolveJsonModule": true } }
0
solana_public_repos/drift-labs/protocol-v2
solana_public_repos/drift-labs/protocol-v2/.husky/pre-commit
#!/bin/sh . "$(dirname "$0")/_/husky.sh" yarn prettify yarn lint cd sdk && yarn run test yarn build if [ -z "$TS_PRECOMMIT_ONLY" ] || [ "$TS_PRECOMMIT_ONLY" = "false" ]; then cargo fmt -- --check cargo clippy -p drift -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic cargo clippy -p ...
0
solana_public_repos/drift-labs/protocol-v2
solana_public_repos/drift-labs/protocol-v2/tests/marketOrder.ts
import * as anchor from '@coral-xyz/anchor'; import { assert } from 'chai'; import { Program } from '@coral-xyz/anchor'; import { Keypair, PublicKey, Transaction } from '@solana/web3.js'; import { BN, PRICE_PRECISION, TestClient, PositionDirection, User, Wallet, getMarketOrderParams, EventSubscriber, } from ...
0
solana_public_repos/drift-labs/protocol-v2
solana_public_repos/drift-labs/protocol-v2/tests/spotWithdrawUtil100.ts
import * as anchor from '@coral-xyz/anchor'; import { assert } from 'chai'; import { Program } from '@coral-xyz/anchor'; import { setFeedPriceNoProgram } from './testHelpers'; import { PublicKey } from '@solana/web3.js'; import { PositionDirection, User, BASE_PRECISION, getLimitOrderParams, PostOnlyParams, } from...
0
solana_public_repos/drift-labs/protocol-v2
solana_public_repos/drift-labs/protocol-v2/tests/placeAndMakeSpotOrder.ts
import * as anchor from '@coral-xyz/anchor'; import { assert } from 'chai'; import { Program } from '@coral-xyz/anchor'; import { Keypair, LAMPORTS_PER_SOL } from '@solana/web3.js'; import { TestClient, BN, PRICE_PRECISION, PositionDirection, User, Wallet, EventSubscriber, BASE_PRECISION, getLimitOrderParam...
0
solana_public_repos/drift-labs/protocol-v2
solana_public_repos/drift-labs/protocol-v2/tests/deleteInitializedSpotMarket.ts
import * as anchor from '@coral-xyz/anchor'; import { assert } from 'chai'; import { Program } from '@coral-xyz/anchor'; import { TestClient, BN, OracleSource, SPOT_MARKET_RATE_PRECISION, SPOT_MARKET_WEIGHT_PRECISION, } from '../sdk/src'; import { mockOracleNoProgram, mockUSDCMint, mockUserUSDCAccount, } fro...
0
solana_public_repos/drift-labs/protocol-v2
solana_public_repos/drift-labs/protocol-v2/tests/phoenixTestAccountData.ts
export const baseVaultAccountData = 'BpuIV/6rgYT7aH9jRhjANdrEOdwa6ztVmKDwAAAAAAHPpZ5WyqmX9wzJtHGLCFbgkvnEalbj0lnx9RK6r6IKuQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAADwHR8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; export const quoteVaultAccountData = 'xvp6877brTo9ZfNqq8l...
0
solana_public_repos/drift-labs/protocol-v2
solana_public_repos/drift-labs/protocol-v2/tests/openbookHelpers.ts
import { Keypair, LAMPORTS_PER_SOL, PublicKey, SystemProgram, Transaction, } from '@solana/web3.js'; import { BankrunContextWrapper } from '../sdk/src/bankrun/bankrunConnection'; import { ASSOCIATED_TOKEN_PROGRAM_ID, getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID, } from '@solana/spl-token'; import { BN, Progr...
0
solana_public_repos/drift-labs/protocol-v2
solana_public_repos/drift-labs/protocol-v2/tests/liquidateBorrowForPerpPnl.ts
import * as anchor from '@coral-xyz/anchor'; import { assert } from 'chai'; import { Program } from '@coral-xyz/anchor'; import { PublicKey } from '@solana/web3.js'; import { BASE_PRECISION, BN, OracleSource, ZERO, TestClient, PRICE_PRECISION, PositionDirection, EventSubscriber, OracleGuardRails, MarketSta...
0
solana_public_repos/drift-labs/protocol-v2
solana_public_repos/drift-labs/protocol-v2/tests/prelisting.ts
import * as anchor from '@coral-xyz/anchor'; import { assert } from 'chai'; import { Program } from '@coral-xyz/anchor'; import { BN, PRICE_PRECISION, TestClient, PositionDirection, User, EventSubscriber, BASE_PRECISION, getLimitOrderParams, OracleSource, getPrelaunchOraclePublicKey, } from '../sdk/src'; i...
0
solana_public_repos/drift-labs/protocol-v2
solana_public_repos/drift-labs/protocol-v2/tests/liquidatePerp.ts
import * as anchor from '@coral-xyz/anchor'; import { Program } from '@coral-xyz/anchor'; import { BASE_PRECISION, BN, ContractTier, EventSubscriber, isVariant, LIQUIDATION_PCT_PRECISION, OracleGuardRails, OracleSource, PositionDirection, PRICE_PRECISION, QUOTE_PRECISION, TestClient, User, Wallet, ZERO, ...
0
solana_public_repos/drift-labs/protocol-v2
solana_public_repos/drift-labs/protocol-v2/tests/pythPullOracleData.ts
export const WORMHOLE_DATA = 'eE1KYiJTYH0EAAAAEwAAAFiTtadsP3OWRWSIhb3MwGzXCjzT/2y5Ulib3oYsJe9DkhMvudSkIVcRTehGAZO986L8+B+GoJdl9HYv0RB6AIazLXoJd5JqIFEx2HMdOcvrjIKy/YL67ScR1Zrw8kmdFucm9rIRs5dWwEJEG+bYZQtptU6+cV4jQ1TOW000j7dLlY6JZuLsPb1JWKfNFefK8HxOPcjnxGn5LIzYj7gAWiB0o7+ROVPWlSYNiLwaolpO7jY+8AAKwAdnJ7NfvqLawo/uXMsP6naOr...
0
solana_public_repos/drift-labs/protocol-v2
solana_public_repos/drift-labs/protocol-v2/tests/triggerSpotOrder.ts
import * as anchor from '@coral-xyz/anchor'; import { assert } from 'chai'; import { Program } from '@coral-xyz/anchor'; import { Keypair } from '@solana/web3.js'; import { TestClient, BN, PRICE_PRECISION, PositionDirection, User, Wallet, OrderTriggerCondition, getTriggerMarketOrderParams, OracleGuardRails,...
0