Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typos #668

Merged
merged 2 commits into from
Dec 19, 2023
Merged

Typos #668

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/nextjs/hooks/scaffold-eth/useAutoConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import scaffoldConfig from "~~/scaffold.config";
import { burnerWalletId } from "~~/services/web3/wagmi-burner/BurnerConnector";
import { getTargetNetworks } from "~~/utils/scaffold-eth";

const SCAFFOLD_WALLET_STROAGE_KEY = "scaffoldEth2.wallet";
const SCAFFOLD_WALLET_STORAGE_KEY = "scaffoldEth2.wallet";
const WAGMI_WALLET_STORAGE_KEY = "wagmi.wallet";

// ID of the SAFE connector instance
Expand Down Expand Up @@ -59,7 +59,7 @@ const getInitialConnector = (
*/
export const useAutoConnect = (): void => {
const wagmiWalletValue = useReadLocalStorage<string>(WAGMI_WALLET_STORAGE_KEY);
const [walletId, setWalletId] = useLocalStorage<string>(SCAFFOLD_WALLET_STROAGE_KEY, wagmiWalletValue ?? "");
const [walletId, setWalletId] = useLocalStorage<string>(SCAFFOLD_WALLET_STORAGE_KEY, wagmiWalletValue ?? "");
const connectState = useConnect();
const accountState = useAccount();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { usePublicClient } from "wagmi";
import { Contract, ContractCodeStatus, ContractName, contracts } from "~~/utils/scaffold-eth/contract";

/**
* Gets the matching contract info for the provided contract name from the contracts present in deployedContracts.ts and externalContracts.ts corrsponding to targetNetworks configured in scaffold.congfig.ts
* Gets the matching contract info for the provided contract name from the contracts present in deployedContracts.ts
* and externalContracts.ts corresponding to targetNetworks configured in scaffold.config.ts
*/
export const useDeployedContractInfo = <TContractName extends ContractName>(contractName: TContractName) => {
const isMounted = useIsMounted();
Expand Down
3 changes: 2 additions & 1 deletion packages/nextjs/hooks/scaffold-eth/useScaffoldContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { useDeployedContractInfo } from "~~/hooks/scaffold-eth";
import { Contract, ContractName } from "~~/utils/scaffold-eth/contract";

/**
* Gets an viem instance of the contract present in deployedContracts.ts or externalContracts.ts corrsponding to targetNetworks configured in scaffold.congfig.ts. Optional walletClient can be passed for doing write transactions.
* Gets a viem instance of the contract present in deployedContracts.ts or externalContracts.ts corresponding to
* targetNetworks configured in scaffold.config.ts. Optional walletClient can be passed for doing write transactions.
* @param config - The config settings for the hook
* @param config.contractName - deployed contract name
* @param config.walletClient - optional walletClient from wagmi useWalletClient hook can be passed for doing write transactions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
} from "~~/utils/scaffold-eth/contract";

/**
* Wrapper around wagmi's useContractRead hook which automatically loads (by name) the contract ABI and address from the contracts present in deployedContracts.ts & externalContracts.ts corrsponding to targetNetworks configured in scaffold.congfig.ts
* Wrapper around wagmi's useContractRead hook which automatically loads (by name) the contract ABI and address from
* the contracts present in deployedContracts.ts & externalContracts.ts corresponding to targetNetworks configured in scaffold.config.ts
* @param config - The config settings, including extra wagmi configuration
* @param config.contractName - deployed contract name
* @param config.functionName - name of the function to be called
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { ContractAbi, ContractName, UseScaffoldWriteConfig } from "~~/utils/scaf
type UpdatedArgs = Parameters<ReturnType<typeof useContractWrite<Abi, string, undefined>>["writeAsync"]>[0];

/**
* Wrapper around wagmi's useContractWrite hook which automatically loads (by name) the contract ABI and address from the contracts present in deployedContracts.ts & externalContracts.ts corrsponding to targetNetworks configured in scaffold.congfig.ts
* Wrapper around wagmi's useContractWrite hook which automatically loads (by name) the contract ABI and address from
* the contracts present in deployedContracts.ts & externalContracts.ts corresponding to targetNetworks configured in scaffold.config.ts
* @param config - The config settings, including extra wagmi configuration
* @param config.contractName - contract name
* @param config.functionName - name of the function to be called
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { addIndexedArgsToEvent, useDeployedContractInfo } from "~~/hooks/scaffol
import { ContractAbi, ContractName, UseScaffoldEventConfig } from "~~/utils/scaffold-eth/contract";

/**
* Wrapper around wagmi's useEventSubscriber hook which automatically loads (by name) the contract ABI and address from the contracts present in deployedContracts.ts & externalContracts.ts
* Wrapper around wagmi's useEventSubscriber hook which automatically loads (by name) the contract ABI and
* address from the contracts present in deployedContracts.ts & externalContracts.ts
* @param config - The config settings
* @param config.contractName - deployed contract name
* @param config.eventName - name of the event to listen for
Expand All @@ -23,9 +24,9 @@ export const useScaffoldEventSubscriber = <
const { data: deployedContractData } = useDeployedContractInfo(contractName);
const { targetNetwork } = useTargetNetwork();

const addInexedArgsToLogs = (logs: Log[]) => logs.map(addIndexedArgsToEvent);
const addIndexedArgsToLogs = (logs: Log[]) => logs.map(addIndexedArgsToEvent);
const listenerWithIndexedArgs = (logs: Log[]) =>
listener(addInexedArgsToLogs(logs) as Parameters<typeof listener>[0]);
listener(addIndexedArgsToLogs(logs) as Parameters<typeof listener>[0]);

return useContractEvent({
address: deployedContractData?.address,
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/hooks/scaffold-eth/useTransactor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const TxnNotification = ({ message, blockExplorerLink }: { message: string; bloc
/**
* Runs Transaction passed in to returned function showing UI feedback.
* @param _walletClient - Optional wallet client to use. If not provided, will use the one from useWalletClient.
* @returns function that takes in transaction function as callback, shows UI feedback for transcation and returns a promise of the transaction hash
* @returns function that takes in transaction function as callback, shows UI feedback for transaction and returns a promise of the transaction hash
*/
export const useTransactor = (_walletClient?: WalletClient): TransactionFunc => {
let walletClient = _walletClient;
Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs/pages/blockexplorer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useFetchBlocks } from "~~/hooks/scaffold-eth";
import { useTargetNetwork } from "~~/hooks/scaffold-eth/useTargetNetwork";
import { notification } from "~~/utils/scaffold-eth";

const Blockexplorer: NextPage = () => {
const BlockExplorer: NextPage = () => {
const { blocks, transactionReceipts, currentPage, totalBlocks, setCurrentPage, error } = useFetchBlocks();
const { targetNetwork } = useTargetNetwork();

Expand Down Expand Up @@ -59,4 +59,4 @@ const Blockexplorer: NextPage = () => {
);
};

export default Blockexplorer;
export default BlockExplorer;
4 changes: 2 additions & 2 deletions packages/nextjs/services/web3/wagmi-burner/BurnerConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export class BurnerConnector extends Connector<StaticJsonRpcProvider, BurnerConn
async getWalletClient(config?: { chainId?: number | undefined } | undefined) {
const chain = this.getChainFromId(config?.chainId);
if (!this.burnerWallet) {
const bunerAccount = privateKeyToAccount(loadBurnerSK());
const burnerAccount = privateKeyToAccount(loadBurnerSK());

const client = createWalletClient({
chain: chain,
account: bunerAccount,
account: burnerAccount,
transport: http(),
});
this.burnerWallet = client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const BurnerConnectorErrorList = {
accountNotFound: "Account not found",
couldNotConnect: "Could not connect to network",
unsupportedBurnerChain: "This network is not supported for burner connector",
chainIdNotResolved: "Cound not resolve chainId",
chainIdNotResolved: "Could not resolve chainId",
chainNotSupported: "Chain is not supported, check burner wallet config",
} as const;

Expand Down