This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "County": "Autauga County", | |
| "State": "Alabama" | |
| }, | |
| { | |
| "County": "Baldwin County", | |
| "State": "Alabama" | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function County(strState, strCountyName) { | |
| this.state = strState; | |
| this.countyName = strCountyName; | |
| } | |
| var arrStates = new Array("AK","AL","AR","AZ","CA","CO","CT","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY", "OH","OK","OR","PA","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY"); | |
| var arrCounties = new Array( | |
| new County("AL","Autauga County"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "New York": [ | |
| "New York", | |
| "Buffalo", | |
| "Rochester", | |
| "Yonkers", | |
| "Syracuse", | |
| "Albany", | |
| "New Rochelle", | |
| "Mount Vernon", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ReactNode, useRef } from 'react' | |
| import { Button, FormControl, FormErrorMessage, FormLabel, Icon, InputGroup } from '@chakra-ui/react' | |
| import { useForm, UseFormRegisterReturn } from 'react-hook-form' | |
| import { FiFile } from 'react-icons/fi' | |
| type FileUploadProps = { | |
| register: UseFormRegisterReturn | |
| accept?: string | |
| multiple?: boolean | |
| children?: ReactNode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useWallet, useConnection } from '@solana/wallet-adapter-react'; | |
| import { Connection } from '@solana/web3.js'; | |
| import { Program, Provider } from '@project-serum/anchor'; | |
| const AnchorExemple = () => { | |
| const { publicKey, sendTransaction } = useWallet(); | |
| const { connection } = useConnection(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useWallet } from "@solana/wallet-adapter-react"; | |
| function Main() { | |
| const { wallets, select, publicKey } = useWallet(); | |
| const isConnectedWallet = !!publicKey; | |
| const phantomWallet = wallets[0]; | |
| const { createUserTransaction, initPoolTransaction | |
| } = useTransaction(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {PublicKey, SystemProgram, Transaction, | |
| TransactionInstruction} from "@solana/web3.js"; | |
| import BN from "bn.js"; | |
| import { Buffer } from "buffer"; | |
| import { useConnection } from "@solana/wallet-adapter-react"; | |
| import { ContractInstructions, Pubkeys } from "./constats"; | |
| //Defines an asynchronous getUserStorageAccountWithNonce function that accepts | |
| // the user’s public key and returns the user’s public key and unique number (nonce). | |
| // Inside the function, we use the findProgramAddress method from @solana/web3.js to | |
| // calculate the user’s public key: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { PublicKey } from "@solana/web3.js"; | |
| // pub enum Instruction { | |
| // Initialize { rewards_per_token: u64 }, | |
| // CreateUser {}, | |
| // } | |
| export class Pubkeys { | |
| static ownerWallet = new PublicKey( | |
| "E1J2ufLWSwXUjrAySpQhScrv2fuci3JJSjTJXCM5TniY" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useWallet } from "@solana/wallet-adapter-react"; | |
| function Main() { | |
| const { wallets, select, publicKey } = useWallet(); | |
| const isConnectedWallet = !!publicKey; | |
| const phantomWallet = wallets[0]; | |
| const connectWalletHandler = () => { | |
| if (phantomWallet.readyState === "NotDetected") { | |
| window.open("https://phantom.app/download"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useMemo } from "react"; | |
| import { WalletAdapterNetwork } from "@solana/wallet-adapter-base"; | |
| import { clusterApiUrl } from "@solana/web3.js"; | |
| import { PhantomWalletAdapter } from "@solana/wallet-adapter-wallets"; | |
| import { WalletModalProvider } from "@solana/wallet-adapter-react-ui"; | |
| import { | |
| ConnectionProvider, | |
| WalletProvider, | |
| } from "@solana/wallet-adapter-react"; | |
| import Main from "./Main"; |
NewerOlder