diff --git a/README.md b/README.md index e258bd6..9abc91d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ⚙️ Built using NextJS, Tailwind and Typescript. - ✅ **Contract Hot Reload**: Your frontend auto-adapts to your smart contract as you edit it. -- 🪝 **[Custom hooks](https://docs.scaffoldeth.io/hooks/)**: Collection of React hooks to simplify interactions with smart contracts. +- 🪝 **[Custom hooks](https://docs.scaffoldeth.io/hooks/)**: Collection of React hooks to simplify interactions with Move modules . - 🧱 [**Components**](https://docs.scaffoldeth.io/components/): Collection of common web3 components to quickly build your frontend. - 🔐 **Integration with Wallet Providers**: Connect your Petra Wallet and interact with the Aptos or Movement M1 network. @@ -36,7 +36,7 @@ cd scaffold-move yarn install ``` -2. ~~Run a local network in the first terminal:~~ +2. ~~Run a local network in the first terminal:~~ - [Website](https://scaffold-move-chi.vercel.app/) +- [Dorahacks](https://dorahacks.io/buidl/13953) +- [Github](https://github.com/arjanjohan/scaffold-move) ## Team diff --git a/package.json b/package.json index 412a647..35191d4 100644 --- a/package.json +++ b/package.json @@ -34,9 +34,5 @@ }, "engines": { "node": ">=18.17.0" - }, - "dependencies": { - "aptos": "^1.21.0", - "js-yaml": "^4.1.0" } } diff --git a/packages/nextjs/app/bio/page.tsx b/packages/nextjs/app/bio/page.tsx index dfdb70c..3222aa9 100644 --- a/packages/nextjs/app/bio/page.tsx +++ b/packages/nextjs/app/bio/page.tsx @@ -1,22 +1,14 @@ "use client"; import { useState } from "react"; -import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk"; import { InputTransactionData, useWallet } from "@aptos-labs/wallet-adapter-react"; import type { NextPage } from "next"; import { InputBase } from "~~/components/scaffold-eth"; import deployedModules from "~~/contracts/deployedModules"; import useSubmitTransaction from "~~/hooks/scaffold-move/useSubmitTransaction"; -import { useGetAccountModules } from "~~/hooks/scaffold-move/useGetAccountModules"; +import { aptosClient } from "~~/utils/scaffold-move/aptosClient"; -// TODO: move this somewhere global -const aptosConfig = new AptosConfig({ - network: Network.CUSTOM, - fullnode: "https://aptos.devnet.m1.movementlabs.xyz", - indexer: "https://indexer.devnet.m1.movementlabs.xyz/", - faucet: "https://faucet2.movementlabs.xyz", -}); -const aptos = new Aptos(aptosConfig); +const aptos = aptosClient("m1_devnet"); const ONCHAIN_BIO = deployedModules.devnet.onchain_bio.abi; @@ -30,20 +22,13 @@ const OnchainBio: NextPage = () => { const [currentName, setCurrentName] = useState(null); const [currentBio, setCurrentBio] = useState(null); - const {data, isLoading, error} = useGetAccountModules(ONCHAIN_BIO.address); - console.log("useGetAccountModules", data, "isLoading", isLoading, "error", error); - - - const {submitTransaction, transactionResponse, transactionInProcess} = - useSubmitTransaction(); + const { submitTransaction, transactionResponse, transactionInProcess } = useSubmitTransaction(); const fetchBio = async () => { if (!account) { - console.log("No account"); return []; } try { - const resourceName = "Bio"; const bioResource = await aptos.getAccountResource({ accountAddress: account?.address, @@ -51,13 +36,11 @@ const OnchainBio: NextPage = () => { }); setAccountHasBio(true); if (bioResource) { - console.log("Name:", bioResource.name, "Bio:", bioResource.bio); setCurrentName(bioResource.name); setCurrentBio(bioResource.bio); } else { setCurrentName(null); setCurrentBio(null); - console.log("no bio"); } } catch (e: any) { setAccountHasBio(false); @@ -115,6 +98,7 @@ const OnchainBio: NextPage = () => { - - {accountHasBio && !transactionInProcess && ( -
-
{currentName}
-
{currentBio}
-
- )} + {accountHasBio && !transactionInProcess && ( +
+
+ Name: +
+
{currentName}
+
+ Bio: +
+
{currentBio}
+
+ )} + ); diff --git a/packages/nextjs/app/debug/_components/DebugContracts.tsx b/packages/nextjs/app/debug/_components/DebugContracts.tsx index 5ccaba5..3b3f810 100644 --- a/packages/nextjs/app/debug/_components/DebugContracts.tsx +++ b/packages/nextjs/app/debug/_components/DebugContracts.tsx @@ -4,14 +4,13 @@ import { useEffect } from "react"; import { useLocalStorage } from "usehooks-ts"; import { BarsArrowUpIcon } from "@heroicons/react/20/solid"; import { ContractUI } from "~~/app/debug/_components/contract"; -import { ContractName } from "~~/utils/scaffold-eth/contract"; +import { ContractName } from "~~/utils/scaffold-move/contract"; import { getAllContracts } from "~~/utils/scaffold-move/contractsData"; const contractsData = getAllContracts(); const contractNames = Object.keys(contractsData) as ContractName[]; export function DebugContracts() { - const selectedContractStorageKey = "scaffoldEth2.selectedContract"; const [selectedContract, setSelectedContract] = useLocalStorage( @@ -41,11 +40,11 @@ export function DebugContracts() { ? "bg-base-300 hover:bg-base-300 no-animation" : "bg-base-100 hover:bg-secondary" }`} - key={contractName} + key={contractName as string} onClick={() => setSelectedContract(contractName)} > - {contractName} - {contractsData[contractName].external && ( + {contractName as string} + {contractsData[contractName as string].external && ( @@ -56,7 +55,7 @@ export function DebugContracts() { )} {contractNames.map(contractName => ( diff --git a/packages/nextjs/app/debug/_components/contract/ContractInput.tsx b/packages/nextjs/app/debug/_components/contract/ContractInput.tsx index 766431e..21c6840 100644 --- a/packages/nextjs/app/debug/_components/contract/ContractInput.tsx +++ b/packages/nextjs/app/debug/_components/contract/ContractInput.tsx @@ -12,7 +12,7 @@ import { IntegerInput, IntegerVariant, } from "~~/components/scaffold-eth"; -import { AbiParameterTuple } from "~~/utils/scaffold-eth/contract"; +import { AbiParameterTuple } from "~~/utils/scaffold-move/contract"; type ContractInputProps = { setForm: Dispatch>>; diff --git a/packages/nextjs/app/debug/_components/contract/ContractReadMethods.tsx b/packages/nextjs/app/debug/_components/contract/ContractReadMethods.tsx index 2c4cefb..28aee9a 100644 --- a/packages/nextjs/app/debug/_components/contract/ContractReadMethods.tsx +++ b/packages/nextjs/app/debug/_components/contract/ContractReadMethods.tsx @@ -1,18 +1,13 @@ import { FunctionForm } from "~~/app/debug/_components/contract"; import { Contract, ContractName } from "~~/utils/scaffold-move/contract"; +import { Types } from "aptos"; -export const ContractReadMethods = ({ - deployedContractData -}: { - deployedContractData: Contract -}) => { +export const ContractReadMethods = ({ deployedContractData }: { deployedContractData: Contract }) => { if (!deployedContractData || deployedContractData.abi === undefined) { return null; } - const functionsToDisplay = deployedContractData.abi.exposed_functions.filter((fn) => - fn.is_view, - ); + const functionsToDisplay = deployedContractData.abi.exposed_functions.filter((fn: Types.MoveFunction) => fn.is_view); if (!functionsToDisplay.length) { return <>No view functions; @@ -20,15 +15,10 @@ export const ContractReadMethods = ({ return ( <> - - {functionsToDisplay.map((fn, index) => ( + {functionsToDisplay.map((fn: Types.MoveFunction, index: number) => (
-
+ + ))} ); diff --git a/packages/nextjs/app/debug/_components/contract/ContractUI.tsx b/packages/nextjs/app/debug/_components/contract/ContractUI.tsx index 95605e0..75946f4 100644 --- a/packages/nextjs/app/debug/_components/contract/ContractUI.tsx +++ b/packages/nextjs/app/debug/_components/contract/ContractUI.tsx @@ -2,13 +2,12 @@ // @refresh reset import { ContractReadMethods } from "./ContractReadMethods"; -import { ModuleResources } from "./ModuleResources"; -import { ContractVariables } from "./ContractVariables"; import { ContractWriteMethods } from "./ContractWriteMethods"; -import { Address, Balance} from "~~/components/scaffold-move"; - +import { ModuleResources } from "./ModuleResources"; +import { Address, Balance } from "~~/components/scaffold-move"; import { useDeployedContractInfo } from "~~/hooks/scaffold-move"; -import { ContractName } from "~~/utils/scaffold-eth/contract"; +import { useTargetNetwork } from "~~/hooks/scaffold-move/useTargetNetwork"; +import { ContractName } from "~~/utils/scaffold-move/contract"; type ContractUIProps = { contractName: ContractName; @@ -19,8 +18,7 @@ type ContractUIProps = { * UI component to interface with deployed contracts. **/ export const ContractUI = ({ contractName, className = "" }: ContractUIProps) => { - // const { targetNetwork } = useTargetNetwork(); - const targetNetwork = "devnet" + const { targetNetwork } = useTargetNetwork(); const { data: deployedContractData, isLoading: deployedContractLoading } = useDeployedContractInfo(contractName); if (deployedContractLoading) { @@ -33,7 +31,7 @@ export const ContractUI = ({ contractName, className = "" }: ContractUIProps) => if (!deployedContractData || !deployedContractData.abi) { return (

- {`No contract found by the name of "${contractName}" on chain "${targetNetwork}"!`} + {`No contract found by the name of "${String(contractName)}" on chain "${targetNetwork}"!`}

); } @@ -45,22 +43,20 @@ export const ContractUI = ({ contractName, className = "" }: ContractUIProps) =>
- {contractName} + {String(contractName)}
Balance: - +
{targetNetwork && (

- Network:{" "} - {targetNetwork} + Network: {String(targetNetwork.name)}

)}
-
@@ -83,9 +79,7 @@ export const ContractUI = ({ contractName, className = "" }: ContractUIProps) =>
- +
@@ -97,9 +91,8 @@ export const ContractUI = ({ contractName, className = "" }: ContractUIProps) =>
- + I disabled the Resources tab due to errors in the Vercel deployment, run the project locally to see it in action. + {/* */}
diff --git a/packages/nextjs/app/debug/_components/contract/ContractWriteMethods.tsx b/packages/nextjs/app/debug/_components/contract/ContractWriteMethods.tsx index c21bfb1..2088e6f 100644 --- a/packages/nextjs/app/debug/_components/contract/ContractWriteMethods.tsx +++ b/packages/nextjs/app/debug/_components/contract/ContractWriteMethods.tsx @@ -1,18 +1,13 @@ import { FunctionForm } from "~~/app/debug/_components/contract"; import { Contract, ContractName } from "~~/utils/scaffold-move/contract"; +import { Types } from "aptos"; -export const ContractWriteMethods = ({ - deployedContractData, -}: { - deployedContractData: Contract; -}) => { +export const ContractWriteMethods = ({ deployedContractData }: { deployedContractData: Contract }) => { if (!deployedContractData || deployedContractData.abi === undefined) { return null; } - const functionsToDisplay = deployedContractData.abi.exposed_functions.filter((fn) => - fn.is_entry, - ); + const functionsToDisplay = deployedContractData.abi.exposed_functions.filter((fn : Types.MoveFunction) => fn.is_entry); if (!functionsToDisplay.length) { return <>No write functions; @@ -20,14 +15,10 @@ export const ContractWriteMethods = ({ return ( <> - {functionsToDisplay.map((fn, index) => ( + {functionsToDisplay.map((fn: Types.MoveFunction, index: number) => (
-
+ + ))} ); diff --git a/packages/nextjs/app/debug/_components/contract/FunctionForm.tsx b/packages/nextjs/app/debug/_components/contract/FunctionForm.tsx index 6a218f7..fafbcc8 100644 --- a/packages/nextjs/app/debug/_components/contract/FunctionForm.tsx +++ b/packages/nextjs/app/debug/_components/contract/FunctionForm.tsx @@ -1,18 +1,14 @@ "use client"; -import { Types } from "aptos"; -import { parseTypeTag } from "@aptos-labs/ts-sdk"; -import { - InputTransactionData, -} from "@aptos-labs/wallet-adapter-react"; - import { useState } from "react"; -import useSubmitTransaction from "~~/hooks/scaffold-move/useSubmitTransaction"; import { encodeInputArgsForViewRequest } from "../../../../utils/utils"; -import { view } from "~~/hooks"; +import { parseTypeTag } from "@aptos-labs/ts-sdk"; +import { InputTransactionData, useWallet } from "@aptos-labs/wallet-adapter-react"; +import { Types } from "aptos"; // import { useGlobalState } from "../../../../global-config/GlobalConfig"; import { displayTxResult } from "~~/app/debug/_components/contract"; - +import { view } from "~~/hooks"; +import useSubmitTransaction from "~~/hooks/scaffold-move/useSubmitTransaction"; const zeroInputs = false; @@ -33,22 +29,17 @@ function removeSignerParam(fn: Types.MoveFunction, write: boolean) { if (!write) { return fn.params; } - return fn.params.filter((p) => p !== "signer" && p !== "&signer"); + return fn.params.filter(p => p !== "signer" && p !== "&signer"); } -export const FunctionForm = ({ - key, - module, - fn, - write, -}: FunctionFormProps) => { +export const FunctionForm = ({ key, module, fn, write }: FunctionFormProps) => { const { submitTransaction, transactionResponse, transactionInProcess } = useSubmitTransaction(); const [viewInProcess, setViewInProcess] = useState(false); const [result, setResult] = useState(); const [data, setData] = useState({ typeArgs: [], args: [] }); - // const [state] = useGlobalState(); - const state = {network_value: "https://aptos.devnet.m1.movementlabs.xyz"} + const { account } = useWallet(); + const state = { network_value: "https://aptos.devnet.m1.movementlabs.xyz" }; const fnParams = removeSignerParam(fn, write); @@ -71,7 +62,7 @@ export const FunctionForm = ({ if (arg.startsWith("[")) { return JSON.parse(arg) as any[]; } else { - return arg.split(",").map((arg) => { + return arg.split(",").map(arg => { return arg.trim(); }); } @@ -115,7 +106,6 @@ export const FunctionForm = ({ const handleView = async () => { let viewRequest: Types.ViewRequest; - console.log("viewRequest AVH", state.network_value, data.ledgerVersion); try { viewRequest = { @@ -131,7 +121,6 @@ export const FunctionForm = ({ } setViewInProcess(true); try { - console.log("viewRequest", viewRequest, state.network_value, data.ledgerVersion); const result = await view(viewRequest, state.network_value, data.ledgerVersion); setResult(result); console.log("function_interacted", fn.name, { txn_status: "success" }); @@ -142,7 +131,7 @@ export const FunctionForm = ({ error = error.substring(prefix.length).trim(); } setResult(undefined); - console.log("AVH function_interacted", fn.name, { txn_status: "failed" }); + console.log("function_interacted", fn.name, { txn_status: "failed" }); } setViewInProcess(false); }; @@ -150,11 +139,8 @@ export const FunctionForm = ({ return (
-

- {fn.name} -

+

{fn.name}

{fnParams.map((param, i) => { - // const isOption = param.startsWith("0x1::option::Option"); return (
@@ -164,7 +150,7 @@ export const FunctionForm = ({ { + onChange={e => { const newArgs = [...data.args]; newArgs[i] = e.target.value; setData({ ...data, args: newArgs }); @@ -178,23 +164,27 @@ export const FunctionForm = ({ {write && (
- - {transactionResponse !== null && transactionResponse?.transactionSubmitted && ( + {transactionResponse !== null && transactionResponse?.transactionSubmitted && (

Result:

-
{transactionResponse.success ? "✅ transaction successful" : "❌ transaction failed"}
+
+                    {transactionResponse.success ? "✅ transaction successful" : "❌ transaction failed"}
+                  
)} {/* TODO: Add TxReceipt for Move */} {/* {displayedTxResult ? : null} */}
-
- )} {!write && (
@@ -212,11 +202,8 @@ export const FunctionForm = ({ Read 📡
- )} -
-
); }; diff --git a/packages/nextjs/app/debug/_components/contract/ModuleResource.tsx b/packages/nextjs/app/debug/_components/contract/ModuleResource.tsx index cad9adf..93aaf64 100644 --- a/packages/nextjs/app/debug/_components/contract/ModuleResource.tsx +++ b/packages/nextjs/app/debug/_components/contract/ModuleResource.tsx @@ -1,5 +1,4 @@ - -import {Types} from "aptos"; +import { Types } from "aptos"; import ReactJson from "react-json-view"; type ModuleResourceProps = { @@ -8,23 +7,15 @@ type ModuleResourceProps = { collapsedByDefault: boolean; }; - const GROUP_ARRAYS_AFTER_LENGTH = 100; const COLLAPSE_STRINGS_AFTER_LENGTH = 80; -const MAX_CARD_HEIGHT = 500; - -export const ModuleResource = ({ - key, - resource, - collapsedByDefault -}: ModuleResourceProps) => { - - console.log("resource", resource); +export const ModuleResource = ({ key, resource, collapsedByDefault }: ModuleResourceProps) => { return ( <>
{resource.type}
}) => { + const { isLoading, data, error } = useGetAccountResources(deployedContractData.abi!.address); -export const ModuleResources = ({ - deployedContractData, -}: { - deployedContractData: Contract; -}) => { - if (!deployedContractData || deployedContractData.abi === undefined) { - return null; + if (error) { + return ( + <> + Cannot fetch resources. + {error.type &&

Error: {error.type}

} + {error.message &&

Error message: {error.message}

} + + ); } - const {isLoading, data, error} = useGetAccountResources(deployedContractData.abi!.address); - - - const [accountResources, setAccountResources] = - useState(null); - - if (!data?.length) { return <>No resources; } @@ -32,12 +24,8 @@ export const ModuleResources = ({ {data.map((resource, index) => (
-
+ +
))} ); diff --git a/packages/nextjs/app/debug/_components/contract/Tuple.tsx b/packages/nextjs/app/debug/_components/contract/Tuple.tsx index 0e3175d..7f4745f 100644 --- a/packages/nextjs/app/debug/_components/contract/Tuple.tsx +++ b/packages/nextjs/app/debug/_components/contract/Tuple.tsx @@ -1,8 +1,8 @@ import { Dispatch, SetStateAction, useEffect, useState } from "react"; import { ContractInput } from "./ContractInput"; import { getFunctionInputKey, getInitalTupleFormState } from "./utilsContract"; -import { replacer } from "~~/utils/scaffold-eth/common"; -import { AbiParameterTuple } from "~~/utils/scaffold-eth/contract"; +import { replacer } from "~~/utils/scaffold-move/common"; +import { AbiParameterTuple } from "~~/utils/scaffold-move/contract"; type TupleProps = { abiTupleParameter: AbiParameterTuple; diff --git a/packages/nextjs/app/debug/_components/contract/TupleArray.tsx b/packages/nextjs/app/debug/_components/contract/TupleArray.tsx index 3fa9ac8..e1789d1 100644 --- a/packages/nextjs/app/debug/_components/contract/TupleArray.tsx +++ b/packages/nextjs/app/debug/_components/contract/TupleArray.tsx @@ -1,8 +1,8 @@ import { Dispatch, SetStateAction, useEffect, useState } from "react"; import { ContractInput } from "./ContractInput"; import { getFunctionInputKey, getInitalTupleArrayFormState } from "./utilsContract"; -import { replacer } from "~~/utils/scaffold-eth/common"; -import { AbiParameterTuple } from "~~/utils/scaffold-eth/contract"; +import { replacer } from "~~/utils/scaffold-move/common"; +import { AbiParameterTuple } from "~~/utils/scaffold-move/contract"; type TupleArrayProps = { abiTupleParameter: AbiParameterTuple & { isVirtual?: true }; diff --git a/packages/nextjs/app/debug/_components/contract/TxReceipt.tsx b/packages/nextjs/app/debug/_components/contract/TxReceipt.tsx index 764faeb..bbf84f7 100644 --- a/packages/nextjs/app/debug/_components/contract/TxReceipt.tsx +++ b/packages/nextjs/app/debug/_components/contract/TxReceipt.tsx @@ -3,7 +3,7 @@ import { CopyToClipboard } from "react-copy-to-clipboard"; import { TransactionReceipt } from "viem"; import { CheckCircleIcon, DocumentDuplicateIcon } from "@heroicons/react/24/outline"; import { ObjectFieldDisplay } from "~~/app/debug/_components/contract"; -import { replacer } from "~~/utils/scaffold-eth/common"; +import { replacer } from "~~/utils/scaffold-move/common"; export const TxReceipt = ({ txResult }: { txResult: TransactionReceipt }) => { const [txResultCopied, setTxResultCopied] = useState(false); diff --git a/packages/nextjs/app/debug/_components/contract/index.tsx b/packages/nextjs/app/debug/_components/contract/index.tsx index 2d5b26b..338472f 100644 --- a/packages/nextjs/app/debug/_components/contract/index.tsx +++ b/packages/nextjs/app/debug/_components/contract/index.tsx @@ -3,4 +3,4 @@ export * from "./ContractUI"; export * from "./TxReceipt"; export * from "./utilsContract"; export * from "./utilsDisplay"; -export * from "./FunctionForm" +export * from "./FunctionForm"; diff --git a/packages/nextjs/app/debug/_components/contract/utilsContract.tsx b/packages/nextjs/app/debug/_components/contract/utilsContract.tsx index 023efe8..05da2a2 100644 --- a/packages/nextjs/app/debug/_components/contract/utilsContract.tsx +++ b/packages/nextjs/app/debug/_components/contract/utilsContract.tsx @@ -1,5 +1,5 @@ import { AbiFunction, AbiParameter } from "abitype"; -import { AbiParameterTuple } from "~~/utils/scaffold-eth/contract"; +import { AbiParameterTuple } from "~~/utils/scaffold-move/contract"; /** * Generates a key based on function metadata diff --git a/packages/nextjs/app/debug/_components/contract/utilsDisplay.tsx b/packages/nextjs/app/debug/_components/contract/utilsDisplay.tsx index 3148aff..71231ab 100644 --- a/packages/nextjs/app/debug/_components/contract/utilsDisplay.tsx +++ b/packages/nextjs/app/debug/_components/contract/utilsDisplay.tsx @@ -1,8 +1,8 @@ import { ReactElement, useState } from "react"; import { TransactionBase, TransactionReceipt, formatEther, isAddress, isHex } from "viem"; import { ArrowsRightLeftIcon } from "@heroicons/react/24/solid"; -import { Address } from "~~/components/scaffold-eth"; -import { replacer } from "~~/utils/scaffold-eth/common"; +import { Address } from "~~/components/scaffold-move"; +import { replacer } from "~~/utils/scaffold-move/common"; type DisplayContent = | string diff --git a/packages/nextjs/app/debug/page.tsx b/packages/nextjs/app/debug/page.tsx index 267b3c6..f8a4a85 100644 --- a/packages/nextjs/app/debug/page.tsx +++ b/packages/nextjs/app/debug/page.tsx @@ -1,6 +1,6 @@ import { DebugContracts } from "./_components/DebugContracts"; import type { NextPage } from "next"; -import { getMetadata } from "~~/utils/scaffold-eth/getMetadata"; +import { getMetadata } from "~~/utils/scaffold-move/getMetadata"; export const metadata = getMetadata({ title: "Debug Contracts", diff --git a/packages/nextjs/app/layout.tsx b/packages/nextjs/app/layout.tsx index 9c5daa1..8ac71f3 100644 --- a/packages/nextjs/app/layout.tsx +++ b/packages/nextjs/app/layout.tsx @@ -2,7 +2,7 @@ import "@rainbow-me/rainbowkit/styles.css"; import { ScaffoldEthAppWithProviders } from "~~/components/ScaffoldEthAppWithProviders"; import { ThemeProvider } from "~~/components/ThemeProvider"; import "~~/styles/globals.css"; -import { getMetadata } from "~~/utils/scaffold-eth/getMetadata"; +import { getMetadata } from "~~/utils/scaffold-move/getMetadata"; export const metadata = getMetadata({ title: "Scaffold-Move App", diff --git a/packages/nextjs/app/page.tsx b/packages/nextjs/app/page.tsx index 14dae44..b8c14a7 100644 --- a/packages/nextjs/app/page.tsx +++ b/packages/nextjs/app/page.tsx @@ -1,12 +1,10 @@ "use client"; import Link from "next/link"; +import { useWallet } from "@aptos-labs/wallet-adapter-react"; import type { NextPage } from "next"; import { BugAntIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline"; import { Address } from "~~/components/scaffold-move"; -import { - useWallet, -} from "@aptos-labs/wallet-adapter-react"; const Home: NextPage = () => { const { account: connectedAccount } = useWallet(); @@ -21,7 +19,7 @@ const Home: NextPage = () => {

Connected Address:

- +

@@ -57,10 +55,8 @@ const Home: NextPage = () => {

- Explore your local transactions with the{" "} - {/* */} - Block Explorer {" "} - {/* {" "} */} + Explore your local transactions with the {/* */} + Block Explorer {/* {" "} */} tab. Coming soon...

diff --git a/packages/nextjs/components/Footer.tsx b/packages/nextjs/components/Footer.tsx index bd5c976..96ee138 100644 --- a/packages/nextjs/components/Footer.tsx +++ b/packages/nextjs/components/Footer.tsx @@ -1,18 +1,17 @@ import React from "react"; -import Link from "next/link"; -import { hardhat } from "viem/chains"; -import { MagnifyingGlassIcon } from "@heroicons/react/24/outline"; +// import Link from "next/link"; +// import { MagnifyingGlassIcon } from "@heroicons/react/24/outline"; import { HeartIcon } from "@heroicons/react/24/outline"; import { SwitchTheme } from "~~/components/SwitchTheme"; // import { Faucet } from "~~/components/scaffold-eth"; -import { useTargetNetwork } from "~~/hooks/scaffold-eth/useTargetNetwork"; +import { useTargetNetwork } from "~~/hooks/scaffold-move/useTargetNetwork"; /** * Site footer */ export const Footer = () => { const { targetNetwork } = useTargetNetwork(); - const isLocalNetwork = targetNetwork.id === hardhat.id; + const isLocalNetwork = targetNetwork.id === "local"; return (
diff --git a/packages/nextjs/components/Header.tsx b/packages/nextjs/components/Header.tsx index 1290aeb..ce8d5dc 100644 --- a/packages/nextjs/components/Header.tsx +++ b/packages/nextjs/components/Header.tsx @@ -4,12 +4,10 @@ import React, { useRef, useState } from "react"; import Image from "next/image"; import Link from "next/link"; import { usePathname } from "next/navigation"; -import { WalletSelector } from "@aptos-labs/wallet-adapter-ant-design"; import { Bars3Icon, BugAntIcon } from "@heroicons/react/24/outline"; // import { FaucetButton } from "~~/components/scaffold-eth"; // import { useOutsideClick } from "~~/hooks/scaffold-eth"; -import {CustomConnectButton} from "~~/components/scaffold-move"; - +import { CustomConnectButton } from "~~/components/scaffold-move"; type HeaderMenuLink = { label: string; diff --git a/packages/nextjs/components/ScaffoldEthAppWithProviders.tsx b/packages/nextjs/components/ScaffoldEthAppWithProviders.tsx index 9c76e15..b48ffd5 100644 --- a/packages/nextjs/components/ScaffoldEthAppWithProviders.tsx +++ b/packages/nextjs/components/ScaffoldEthAppWithProviders.tsx @@ -2,12 +2,10 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { Toaster } from "react-hot-toast"; -import { WagmiProvider } from "wagmi"; import { Footer } from "~~/components/Footer"; import { Header } from "~~/components/Header"; import { ProgressBar } from "~~/components/scaffold-eth/ProgressBar"; import { WalletProvider } from "~~/components/scaffold-move/WalletContext"; -import { wagmiConfig } from "~~/services/web3/wagmiConfig"; const ScaffoldEthApp = ({ children }: { children: React.ReactNode }) => { return ( @@ -32,14 +30,12 @@ export const queryClient = new QueryClient({ export const ScaffoldEthAppWithProviders = ({ children }: { children: React.ReactNode }) => { return ( - - - + + - - {children} - - - + + {children} + + ); }; diff --git a/packages/nextjs/components/scaffold-eth/Address.tsx b/packages/nextjs/components/scaffold-eth/Address.tsx deleted file mode 100644 index f24b459..0000000 --- a/packages/nextjs/components/scaffold-eth/Address.tsx +++ /dev/null @@ -1,141 +0,0 @@ -"use client"; - -import { useEffect, useState } from "react"; -import Link from "next/link"; -import { CopyToClipboard } from "react-copy-to-clipboard"; -import { Address as AddressType, getAddress, isAddress } from "viem"; -import { hardhat } from "viem/chains"; -import { normalize } from "viem/ens"; -import { useEnsAvatar, useEnsName } from "wagmi"; -import { CheckCircleIcon, DocumentDuplicateIcon } from "@heroicons/react/24/outline"; -import { BlockieAvatar } from "~~/components/scaffold-eth"; -import { useTargetNetwork } from "~~/hooks/scaffold-eth/useTargetNetwork"; -import { getBlockExplorerAddressLink } from "~~/utils/scaffold-eth"; - -type AddressProps = { - address?: AddressType; - disableAddressLink?: boolean; - format?: "short" | "long"; - size?: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl"; -}; - -const blockieSizeMap = { - xs: 6, - sm: 7, - base: 8, - lg: 9, - xl: 10, - "2xl": 12, - "3xl": 15, -}; - -/** - * Displays an address (or ENS) with a Blockie image and option to copy address. - */ -export const Address = ({ address, disableAddressLink, format, size = "base" }: AddressProps) => { - const [ens, setEns] = useState(); - const [ensAvatar, setEnsAvatar] = useState(); - const [addressCopied, setAddressCopied] = useState(false); - const checkSumAddress = address ? getAddress(address) : undefined; - - const { targetNetwork } = useTargetNetwork(); - - const { data: fetchedEns } = useEnsName({ - address: checkSumAddress, - chainId: 1, - query: { - enabled: isAddress(checkSumAddress ?? ""), - }, - }); - const { data: fetchedEnsAvatar } = useEnsAvatar({ - name: fetchedEns ? normalize(fetchedEns) : undefined, - chainId: 1, - query: { - enabled: Boolean(fetchedEns), - gcTime: 30_000, - }, - }); - - // We need to apply this pattern to avoid Hydration errors. - useEffect(() => { - setEns(fetchedEns); - }, [fetchedEns]); - - useEffect(() => { - setEnsAvatar(fetchedEnsAvatar); - }, [fetchedEnsAvatar]); - - // Skeleton UI - if (!checkSumAddress) { - return ( -
-
-
-
-
-
- ); - } - - if (!isAddress(checkSumAddress)) { - return Wrong address; - } - - const blockExplorerAddressLink = getBlockExplorerAddressLink(targetNetwork, checkSumAddress); - let displayAddress = checkSumAddress?.slice(0, 6) + "..." + checkSumAddress?.slice(-4); - - if (ens) { - displayAddress = ens; - } else if (format === "long") { - displayAddress = checkSumAddress; - } - - return ( -
-
- -
- {disableAddressLink ? ( - {displayAddress} - ) : targetNetwork.id === hardhat.id ? ( - - {displayAddress} - - ) : ( - - {displayAddress} - - )} - {addressCopied ? ( -
- ); -}; diff --git a/packages/nextjs/components/scaffold-eth/index.tsx b/packages/nextjs/components/scaffold-eth/index.tsx index 5475153..be66d76 100644 --- a/packages/nextjs/components/scaffold-eth/index.tsx +++ b/packages/nextjs/components/scaffold-eth/index.tsx @@ -1,3 +1 @@ -export * from "./Address"; -export * from "./BlockieAvatar"; export * from "./Input"; diff --git a/packages/nextjs/components/scaffold-move/Address.tsx b/packages/nextjs/components/scaffold-move/Address.tsx index 298c489..09c8336 100644 --- a/packages/nextjs/components/scaffold-move/Address.tsx +++ b/packages/nextjs/components/scaffold-move/Address.tsx @@ -3,11 +3,10 @@ import { useState } from "react"; import Link from "next/link"; import { CopyToClipboard } from "react-copy-to-clipboard"; -import { hardhat } from "viem/chains"; import { CheckCircleIcon, DocumentDuplicateIcon } from "@heroicons/react/24/outline"; -import { BlockieAvatar } from "~~/components/scaffold-eth"; -import { useTargetNetwork } from "~~/hooks/scaffold-eth/useTargetNetwork"; -import { getBlockExplorerAddressLink } from "~~/utils/scaffold-eth"; +import { BlockieAvatar } from "~~/components/scaffold-move"; +import { useTargetNetwork } from "~~/hooks/scaffold-move/useTargetNetwork"; +import { getBlockExplorerAddressLink } from "~~/utils/scaffold-move"; type AddressProps = { address?: string; @@ -73,13 +72,12 @@ export const Address = ({ address, disableAddressLink, format, size = "base" }: ); } - const blockExplorerAddressLink = getBlockExplorerAddressLink(targetNetwork, address); let displayAddress = address?.slice(0, 6) + "..." + address?.slice(-4); // if (ens) { // displayAddress = ens; - // } else + // } else if (format === "long") { displayAddress = address; } @@ -95,7 +93,7 @@ export const Address = ({ address, disableAddressLink, format, size = "base" }:
{disableAddressLink ? ( {displayAddress} - ) : targetNetwork.id === hardhat.id ? ( + ) : targetNetwork.id === "local" ? ( {displayAddress} diff --git a/packages/nextjs/components/scaffold-move/Balance.tsx b/packages/nextjs/components/scaffold-move/Balance.tsx index e533712..3092c82 100644 --- a/packages/nextjs/components/scaffold-move/Balance.tsx +++ b/packages/nextjs/components/scaffold-move/Balance.tsx @@ -1,7 +1,7 @@ "use client"; -import {useGetAccountAPTBalance} from "~~/hooks/scaffold-move/useGetAccountAPTBalance"; -import {getFormattedBalanceStr} from "../../utils/scaffold-move/ContentValue/CurrencyValue" +import { getFormattedBalanceStr } from "../../utils/scaffold-move/ContentValue/CurrencyValue"; +import { useGetAccountAPTBalance } from "~~/hooks/scaffold-move/useGetAccountAPTBalance"; type BalanceProps = { address: string; diff --git a/packages/nextjs/components/scaffold-eth/BlockieAvatar.tsx b/packages/nextjs/components/scaffold-move/BlockieAvatar.tsx similarity index 100% rename from packages/nextjs/components/scaffold-eth/BlockieAvatar.tsx rename to packages/nextjs/components/scaffold-move/BlockieAvatar.tsx diff --git a/packages/nextjs/components/scaffold-move/CustomConnectButton/AddressInfoDropdown.tsx b/packages/nextjs/components/scaffold-move/CustomConnectButton/AddressInfoDropdown.tsx index 4f74b5d..551872c 100644 --- a/packages/nextjs/components/scaffold-move/CustomConnectButton/AddressInfoDropdown.tsx +++ b/packages/nextjs/components/scaffold-move/CustomConnectButton/AddressInfoDropdown.tsx @@ -1,5 +1,6 @@ import { useRef, useState } from "react"; import { NetworkOptions } from "./NetworkOptions"; +import { useWallet } from "@aptos-labs/wallet-adapter-react"; import CopyToClipboard from "react-copy-to-clipboard"; import { ArrowLeftOnRectangleIcon, @@ -10,12 +11,9 @@ import { DocumentDuplicateIcon, QrCodeIcon, } from "@heroicons/react/24/outline"; -import { BlockieAvatar, isENS } from "~~/components/scaffold-eth"; +import { BlockieAvatar, isENS } from "~~/components/scaffold-move"; import { useOutsideClick } from "~~/hooks/scaffold-move"; -import { getTargetNetworks } from "~~/utils/scaffold-eth"; -import { - useWallet -} from "@aptos-labs/wallet-adapter-react"; +import { getTargetNetworks } from "~~/utils/scaffold-move"; const allowedNetworks = getTargetNetworks(); @@ -32,7 +30,6 @@ export const AddressInfoDropdown = ({ displayName, blockExplorerAddressLink, }: AddressInfoDropdownProps) => { - const [addressCopied, setAddressCopied] = useState(false); const [selectingNetwork, setSelectingNetwork] = useState(false); @@ -43,8 +40,7 @@ export const AddressInfoDropdown = ({ }; useOutsideClick(dropdownRef, closeDropdown); - - const { disconnect, wallet } = useWallet(); + const { disconnect } = useWallet(); return ( <>
@@ -120,7 +116,7 @@ export const AddressInfoDropdown = ({ Switch Network - ) : null} + ) : null}
  • diff --git a/packages/nextjs/components/scaffold-move/CustomConnectButton/index.tsx b/packages/nextjs/components/scaffold-move/CustomConnectButton/index.tsx index e3dcbc2..546ac3c 100644 --- a/packages/nextjs/components/scaffold-move/CustomConnectButton/index.tsx +++ b/packages/nextjs/components/scaffold-move/CustomConnectButton/index.tsx @@ -1,26 +1,18 @@ "use client"; -import { useEffect, useState } from "react"; import { Balance } from "../Balance"; import { AddressInfoDropdown } from "./AddressInfoDropdown"; -import { WrongNetworkDropdown } from "./WrongNetworkDropdown"; -import { useTargetNetwork } from "~~/hooks/scaffold-eth/useTargetNetwork"; -import { getBlockExplorerAddressLink } from "~~/utils/scaffold-eth"; import { WalletSelector } from "@aptos-labs/wallet-adapter-ant-design"; - - -import { - useWallet -} from "@aptos-labs/wallet-adapter-react"; +import { useWallet } from "@aptos-labs/wallet-adapter-react"; +// import { WrongNetworkDropdown } from "./WrongNetworkDropdown"; +import { useTargetNetwork } from "~~/hooks/scaffold-move/useTargetNetwork"; +import { getBlockExplorerAddressLink } from "~~/utils/scaffold-move"; export const CustomConnectButton = () => { const { targetNetwork } = useTargetNetwork(); - // const [account, setAccount] = useState(null); - const chain = {name: "devnet"}; // TODO: replace - - - const { account, connected} = useWallet(); + const chain = { name: "devnet" }; // TODO: replace + const { account, connected } = useWallet(); const blockExplorerAddressLink = account ? getBlockExplorerAddressLink(targetNetwork, account?.address) : undefined; @@ -28,22 +20,21 @@ export const CustomConnectButton = () => { <> {!connected ? (
    - +
    - ) - // : chainId !== targetNetwork.id ? ( - // - // ) - : ( + ) : ( + // : chainId !== targetNetwork.id ? ( + // + // ) <>
    - {/* */} - {chain ? chain.name : "Loading..."} + + {chain ? targetNetwork.name : "Loading..."}
    diff --git a/packages/nextjs/components/scaffold-move/Input/index.ts b/packages/nextjs/components/scaffold-move/Input/index.ts new file mode 100644 index 0000000..edafec3 --- /dev/null +++ b/packages/nextjs/components/scaffold-move/Input/index.ts @@ -0,0 +1,3 @@ +"use client"; + +export * from "./utils"; diff --git a/packages/nextjs/components/scaffold-move/Input/utils.ts b/packages/nextjs/components/scaffold-move/Input/utils.ts new file mode 100644 index 0000000..519f535 --- /dev/null +++ b/packages/nextjs/components/scaffold-move/Input/utils.ts @@ -0,0 +1,3 @@ +// Treat any dot-separated string as a potential ENS name +const ensRegex = /.+\..+/; +export const isENS = (address = "") => ensRegex.test(address); diff --git a/packages/nextjs/components/scaffold-move/WalletContext.tsx b/packages/nextjs/components/scaffold-move/WalletContext.tsx index 494e07d..d2f496f 100644 --- a/packages/nextjs/components/scaffold-move/WalletContext.tsx +++ b/packages/nextjs/components/scaffold-move/WalletContext.tsx @@ -1,4 +1,4 @@ -import { ReactNode, createContext, useContext } from "react"; +import { ReactNode } from "react"; import { AptosWalletAdapterProvider } from "@aptos-labs/wallet-adapter-react"; import { PetraWallet } from "petra-plugin-wallet-adapter"; diff --git a/packages/nextjs/components/scaffold-move/index.tsx b/packages/nextjs/components/scaffold-move/index.tsx index 8064f6b..b930c90 100644 --- a/packages/nextjs/components/scaffold-move/index.tsx +++ b/packages/nextjs/components/scaffold-move/index.tsx @@ -1,3 +1,5 @@ export * from "./Address"; export * from "./Balance"; export * from "./CustomConnectButton"; +export * from "./BlockieAvatar"; +export * from "./Input"; diff --git a/packages/nextjs/contracts/deployedModules.ts b/packages/nextjs/contracts/deployedModules.ts index 7dfc423..59fc3c7 100644 --- a/packages/nextjs/contracts/deployedModules.ts +++ b/packages/nextjs/contracts/deployedModules.ts @@ -17,4 +17,5 @@ const deployedContracts = { } } as const; -export default deployedContracts satisfies GenericContractsDeclaration; \ No newline at end of file +export default deployedContracts; +// satisfies GenericContractsDeclaration; \ No newline at end of file diff --git a/packages/nextjs/contracts/externalModules.ts b/packages/nextjs/contracts/externalModules.ts index 7fd196a..3ef2354 100644 --- a/packages/nextjs/contracts/externalModules.ts +++ b/packages/nextjs/contracts/externalModules.ts @@ -9,4 +9,5 @@ const externalContracts = { } } as const; -export default externalContracts satisfies GenericContractsDeclaration; \ No newline at end of file +export default externalContracts; +// satisfies GenericContractsDeclaration; \ No newline at end of file diff --git a/packages/nextjs/hooks/client.ts b/packages/nextjs/hooks/client.ts index b199628..e51fde4 100644 --- a/packages/nextjs/hooks/client.ts +++ b/packages/nextjs/hooks/client.ts @@ -5,25 +5,21 @@ export enum ResponseErrorType { } export type ResponseError = - | {type: ResponseErrorType.NOT_FOUND; message?: string} - | {type: ResponseErrorType.UNHANDLED; message: string} - | {type: ResponseErrorType.TOO_MANY_REQUESTS; message?: string}; + | { type: ResponseErrorType.NOT_FOUND; message?: string } + | { type: ResponseErrorType.UNHANDLED; message: string } + | { type: ResponseErrorType.TOO_MANY_REQUESTS; message?: string }; export async function withResponseError(promise: Promise): Promise { - return await promise.catch((error) => { + return await promise.catch(error => { console.error("ERROR!", error, typeof error); if (typeof error == "object" && "status" in error) { // This is a request! error = error as Response; if (error.status === 404) { - throw {type: ResponseErrorType.NOT_FOUND}; + throw { type: ResponseErrorType.NOT_FOUND }; } } - if ( - error.message - .toLowerCase() - .includes(ResponseErrorType.TOO_MANY_REQUESTS.toLowerCase()) - ) { + if (error.message.toLowerCase().includes(ResponseErrorType.TOO_MANY_REQUESTS.toLowerCase())) { throw { type: ResponseErrorType.TOO_MANY_REQUESTS, }; diff --git a/packages/nextjs/hooks/index.ts b/packages/nextjs/hooks/index.ts index 502852e..e7b3112 100644 --- a/packages/nextjs/hooks/index.ts +++ b/packages/nextjs/hooks/index.ts @@ -1,5 +1,5 @@ -import {AptosClient, Types} from "aptos"; -import {withResponseError} from "./client"; +import { withResponseError } from "./client"; +import { AptosClient, Types } from "aptos"; // export async function getTransactions( // requestParameters: {start?: number; limit?: number}, @@ -95,18 +95,16 @@ import {withResponseError} from "./client"; // } export function getAccountResources( - requestParameters: {address: string; ledgerVersion?: number}, + requestParameters: { address: string; ledgerVersion?: number }, nodeUrl: string, ): Promise { const client = new AptosClient(nodeUrl); - const {address, ledgerVersion} = requestParameters; + const { address, ledgerVersion } = requestParameters; let ledgerVersionBig; if (ledgerVersion !== undefined) { ledgerVersionBig = BigInt(ledgerVersion); } - return withResponseError( - client.getAccountResources(address, {ledgerVersion: ledgerVersionBig}), - ); + return withResponseError(client.getAccountResources(address, { ledgerVersion: ledgerVersionBig })); } // export function getAccountResource( @@ -131,18 +129,16 @@ export function getAccountResources( // } export function getAccountModules( - requestParameters: {address: string; ledgerVersion?: number}, + requestParameters: { address: string; ledgerVersion?: number }, nodeUrl: string, ): Promise { const client = new AptosClient(nodeUrl); - const {address, ledgerVersion} = requestParameters; + const { address, ledgerVersion } = requestParameters; let ledgerVersionBig; if (ledgerVersion !== undefined) { ledgerVersionBig = BigInt(ledgerVersion); } - return withResponseError( - client.getAccountModules(address, {ledgerVersion: ledgerVersionBig}), - ); + return withResponseError(client.getAccountModules(address, { ledgerVersion: ledgerVersionBig })); } export function getAccountModule( @@ -154,7 +150,7 @@ export function getAccountModule( nodeUrl: string, ): Promise { const client = new AptosClient(nodeUrl); - const {address, moduleName, ledgerVersion} = requestParameters; + const { address, moduleName, ledgerVersion } = requestParameters; let ledgerVersionBig; if (ledgerVersion !== undefined) { ledgerVersionBig = BigInt(ledgerVersion); @@ -166,11 +162,7 @@ export function getAccountModule( ); } -export function view( - request: Types.ViewRequest, - nodeUrl: string, - ledgerVersion?: string, -): Promise { +export function view(request: Types.ViewRequest, nodeUrl: string, ledgerVersion?: string): Promise { const client = new AptosClient(nodeUrl); let parsedVersion = ledgerVersion; diff --git a/packages/nextjs/hooks/scaffold-eth/index.ts b/packages/nextjs/hooks/scaffold-eth/index.ts deleted file mode 100644 index 6f79f41..0000000 --- a/packages/nextjs/hooks/scaffold-eth/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -export * from "./useAnimationConfig"; -// export * from "./useBurnerWallet"; -// export * from "./useContractLogs"; -// export * from "./useDeployedContractInfo"; -// export * from "./useFetchBlocks"; -// export * from "./useNetworkColor"; -// export * from "./useOutsideClick"; -// // export * from "./useScaffoldContract"; -// // export * from "./useScaffoldEventHistory"; -// export * from "./useScaffoldReadContract"; -// // export * from "./useScaffoldWatchContractEvent"; -// export * from "./useScaffoldWriteContract"; -export * from "./useTargetNetwork"; -// export * from "./useTransactor"; -// export * from "./useWatchBalance"; diff --git a/packages/nextjs/hooks/scaffold-eth/useAnimationConfig.ts b/packages/nextjs/hooks/scaffold-eth/useAnimationConfig.ts deleted file mode 100644 index e0044fd..0000000 --- a/packages/nextjs/hooks/scaffold-eth/useAnimationConfig.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { useEffect, useState } from "react"; - -const ANIMATION_TIME = 2000; - -export function useAnimationConfig(data: any) { - const [showAnimation, setShowAnimation] = useState(false); - const [prevData, setPrevData] = useState(); - - useEffect(() => { - if (prevData !== undefined && prevData !== data) { - setShowAnimation(true); - setTimeout(() => setShowAnimation(false), ANIMATION_TIME); - } - setPrevData(data); - }, [data, prevData]); - - return { - showAnimation, - }; -} diff --git a/packages/nextjs/hooks/scaffold-move/index.ts b/packages/nextjs/hooks/scaffold-move/index.ts index b3ad99f..70c6df7 100644 --- a/packages/nextjs/hooks/scaffold-move/index.ts +++ b/packages/nextjs/hooks/scaffold-move/index.ts @@ -1,4 +1,4 @@ export * from "./useDeployedContractInfo"; export * from "./useGetAccountAPTBalance"; export * from "./useGetAccountResources"; -export * from "./useOutsideClick"; \ No newline at end of file +export * from "./useOutsideClick"; diff --git a/packages/nextjs/hooks/scaffold-move/useDeployedContractInfo.ts b/packages/nextjs/hooks/scaffold-move/useDeployedContractInfo.ts index 6e96446..e008ab9 100644 --- a/packages/nextjs/hooks/scaffold-move/useDeployedContractInfo.ts +++ b/packages/nextjs/hooks/scaffold-move/useDeployedContractInfo.ts @@ -10,7 +10,6 @@ export const useDeployedContractInfo = (cont const isMounted = useIsMounted(); const targetNetwork = "devnet"; const deployedContract = contracts?.[targetNetwork]?.[contractName.toString()] as Contract; - console.log("deployedContract", deployedContract); const [status, setStatus] = useState(ContractCodeStatus.LOADING); // const publicClient = usePublicClient({ chainId: targetNetwork.id }); diff --git a/packages/nextjs/hooks/scaffold-move/useGetAccountAPTBalance.ts b/packages/nextjs/hooks/scaffold-move/useGetAccountAPTBalance.ts index 7b993b7..e1b9b8d 100644 --- a/packages/nextjs/hooks/scaffold-move/useGetAccountAPTBalance.ts +++ b/packages/nextjs/hooks/scaffold-move/useGetAccountAPTBalance.ts @@ -1,4 +1,4 @@ -import {useGetAccountResources} from "./useGetAccountResources"; +import { useGetAccountResources } from "./useGetAccountResources"; interface CoinStore { coin: { @@ -7,16 +7,13 @@ interface CoinStore { } export function useGetAccountAPTBalance(address: string) { - const {isLoading, data, error} = useGetAccountResources(address); + const { isLoading, data, error } = useGetAccountResources(address); if (isLoading || error || !data) { return null; } - const coinStore = data.find( - (resource) => - resource.type === "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>", - ); + const coinStore = data.find(resource => resource.type === "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>"); if (!coinStore) { return null; diff --git a/packages/nextjs/hooks/scaffold-move/useGetAccountModules.ts b/packages/nextjs/hooks/scaffold-move/useGetAccountModules.ts index 6120659..0c2e0be 100644 --- a/packages/nextjs/hooks/scaffold-move/useGetAccountModules.ts +++ b/packages/nextjs/hooks/scaffold-move/useGetAccountModules.ts @@ -1,18 +1,16 @@ -import {Types} from "aptos"; -import {useQuery, UseQueryResult} from "@tanstack/react-query"; -import {getAccountModules} from ".."; -import {ResponseError} from "../client"; +import { getAccountModules } from ".."; +import { ResponseError } from "../client"; +import { UseQueryResult, useQuery } from "@tanstack/react-query"; +import { Types } from "aptos"; + // import {useGlobalState} from "../../global-config/GlobalConfig"; -export function useGetAccountModules( - address: string, -): UseQueryResult { +export function useGetAccountModules(address: string): UseQueryResult { // const [state] = useGlobalState(); - const state = {network_value: "https://aptos.devnet.m1.movementlabs.xyz"} - + const state = { network_value: "https://aptos.devnet.m1.movementlabs.xyz" }; return useQuery, ResponseError>({ - queryKey: ["accountModules", {address}, state.network_value], - queryFn: () => getAccountModules({address}, state.network_value), + queryKey: ["accountModules", { address }, state.network_value], + queryFn: () => getAccountModules({ address }, state.network_value), }); } diff --git a/packages/nextjs/hooks/scaffold-move/useGetAccountResources.ts b/packages/nextjs/hooks/scaffold-move/useGetAccountResources.ts index ff88ef1..a7ddb23 100644 --- a/packages/nextjs/hooks/scaffold-move/useGetAccountResources.ts +++ b/packages/nextjs/hooks/scaffold-move/useGetAccountResources.ts @@ -1,7 +1,8 @@ -import {Types} from "aptos"; -import {useQuery, UseQueryResult} from "@tanstack/react-query"; -import {getAccountResources} from ".."; -import {ResponseError} from "../client"; +import { getAccountResources } from ".."; +import { ResponseError } from "../client"; +import { UseQueryResult, useQuery } from "@tanstack/react-query"; +import { Types } from "aptos"; + // import {useGlobalState} from "../../global-config/GlobalConfig"; export function useGetAccountResources( @@ -11,11 +12,11 @@ export function useGetAccountResources( }, ): UseQueryResult { // const [state] = useGlobalState(); - const state = {network_value: "https://aptos.devnet.m1.movementlabs.xyz"} + const state = { network_value: "https://aptos.devnet.m1.movementlabs.xyz" }; const test = useQuery, ResponseError>({ - queryKey: ["accountResources", {address}, state.network_value], - queryFn: () => getAccountResources({address}, state.network_value), + queryKey: ["accountResources", { address }, state.network_value], + queryFn: () => getAccountResources({ address }, state.network_value), retry: options?.retry ?? false, }); return test; diff --git a/packages/nextjs/hooks/scaffold-move/useGraphqlClient.tsx b/packages/nextjs/hooks/scaffold-move/useGraphqlClient.tsx index 0a131c7..1893270 100644 --- a/packages/nextjs/hooks/scaffold-move/useGraphqlClient.tsx +++ b/packages/nextjs/hooks/scaffold-move/useGraphqlClient.tsx @@ -1,13 +1,8 @@ import React from "react"; -import { - ApolloClient, - InMemoryCache, - ApolloProvider, - HttpLink, - NormalizedCacheObject, -} from "@apollo/client"; -import {useEffect, useState} from "react"; -import {Network, NetworkName} from "../../constants"; +import { useEffect, useState } from "react"; +import { Network, NetworkName } from "../../constants"; +import { ApolloClient, ApolloProvider, HttpLink, InMemoryCache, NormalizedCacheObject } from "@apollo/client"; + // import {useGlobalState} from "../../global-config/GlobalConfig"; function getIsGraphqlClientSupportedFor(networkName: NetworkName): boolean { @@ -32,9 +27,7 @@ export function getGraphqlURI(networkName: NetworkName): string | undefined { } } -function getGraphqlClient( - networkName: NetworkName, -): ApolloClient { +function getGraphqlClient(networkName: NetworkName): ApolloClient { return new ApolloClient({ link: new HttpLink({ uri: getGraphqlURI(networkName), @@ -45,11 +38,11 @@ function getGraphqlClient( export function useGetGraphqlClient() { // const [state] = useGlobalState(); - const state = {network_name: Network.DEVNET, network_value: "https://aptos.devnet.m1.movementlabs.xyz"} + const state = { network_name: Network.DEVNET, network_value: "https://aptos.devnet.m1.movementlabs.xyz" }; - const [graphqlClient, setGraphqlClient] = useState< - ApolloClient - >(getGraphqlClient(state.network_name)); + const [graphqlClient, setGraphqlClient] = useState>( + getGraphqlClient(state.network_name), + ); useEffect(() => { setGraphqlClient(getGraphqlClient(state.network_name)); @@ -62,7 +55,7 @@ type GraphqlClientProviderProps = { children: React.ReactNode; }; -export function GraphqlClientProvider({children}: GraphqlClientProviderProps) { +export function GraphqlClientProvider({ children }: GraphqlClientProviderProps) { const graphqlClient = useGetGraphqlClient(); return {children}; @@ -70,15 +63,14 @@ export function GraphqlClientProvider({children}: GraphqlClientProviderProps) { export function useGetIsGraphqlClientSupported(): boolean { // const [state] = useGlobalState(); - const state = {network_name: Network.DEVNET, network_value: "https://aptos.devnet.m1.movementlabs.xyz"} + const state = { network_name: Network.DEVNET, network_value: "https://aptos.devnet.m1.movementlabs.xyz" }; - const [isGraphqlClientSupported, setIsGraphqlClientSupported] = - useState(getIsGraphqlClientSupportedFor(state.network_name)); + const [isGraphqlClientSupported, setIsGraphqlClientSupported] = useState( + getIsGraphqlClientSupportedFor(state.network_name), + ); useEffect(() => { - setIsGraphqlClientSupported( - getIsGraphqlClientSupportedFor(state.network_name), - ); + setIsGraphqlClientSupported(getIsGraphqlClientSupportedFor(state.network_name)); }, [state.network_name]); return isGraphqlClientSupported; diff --git a/packages/nextjs/hooks/scaffold-move/useSubmitTransaction.ts b/packages/nextjs/hooks/scaffold-move/useSubmitTransaction.ts index b29904b..3a473b0 100644 --- a/packages/nextjs/hooks/scaffold-move/useSubmitTransaction.ts +++ b/packages/nextjs/hooks/scaffold-move/useSubmitTransaction.ts @@ -1,16 +1,11 @@ -import {FailedTransactionError} from "aptos"; -import {useEffect, useState} from "react"; -import { - useWallet, - InputTransactionData, -} from "@aptos-labs/wallet-adapter-react"; +import { useEffect, useState } from "react"; +import { InputTransactionData, useWallet } from "@aptos-labs/wallet-adapter-react"; +import { FailedTransactionError } from "aptos"; +import { useTargetNetwork } from "~~/hooks/scaffold-move/useTargetNetwork"; // import {useGlobalState} from "../../global-config/GlobalConfig"; -import {Aptos, AptosConfig, Network} from "@aptos-labs/ts-sdk"; +import { aptosClient } from "~~/utils/scaffold-move/aptosClient"; - -export type TransactionResponse = - | TransactionResponseOnSubmission - | TransactionResponseOnError; +export type TransactionResponse = TransactionResponseOnSubmission | TransactionResponseOnError; // "submission" here means that the transaction is posted on chain and gas is paid. // However, the status of the transaction might not be "success". @@ -27,22 +22,15 @@ export type TransactionResponseOnError = { }; const useSubmitTransaction = () => { - const [transactionResponse, setTransactionResponse] = - useState(null); - const [transactionInProcess, setTransactionInProcess] = - useState(false); + const [transactionResponse, setTransactionResponse] = useState(null); + const [transactionInProcess, setTransactionInProcess] = useState(false); // const [state] = useGlobalState(); - const aptosConfig = new AptosConfig({ - network: Network.CUSTOM, - fullnode: 'https://aptos.devnet.m1.movementlabs.xyz', - indexer: 'https://indexer.devnet.m1.movementlabs.xyz/', - faucet: 'https://faucet2.movementlabs.xyz' - }); - const aptos = new Aptos(aptosConfig); - const state = {network_value: "https://aptos.devnet.m1.movementlabs.xyz", aptos_client: aptos} + const network = useTargetNetwork(); + const aptos = aptosClient("m1_devnet"); + const state = { network_value: "https://aptos.devnet.m1.movementlabs.xyz", aptos_client: aptos }; - const {signAndSubmitTransaction} = useWallet(); + const { signAndSubmitTransaction } = useWallet(); useEffect(() => { if (transactionResponse !== null) { @@ -51,13 +39,8 @@ const useSubmitTransaction = () => { }, [transactionResponse]); async function submitTransaction(transaction: InputTransactionData) { - - setTransactionInProcess(true); - console.log("submitting transaction", transaction); - const signAndSubmitTransactionCall = async ( - transaction: InputTransactionData, - ): Promise => { + const signAndSubmitTransactionCall = async (transaction: InputTransactionData): Promise => { const responseOnError: TransactionResponseOnError = { transactionSubmitted: false, message: "Unknown Error", @@ -65,16 +48,15 @@ const useSubmitTransaction = () => { let response; try { response = await signAndSubmitTransaction(transaction); - console.log("response", response); // transaction submit succeed if ("hash" in response) { // await state.aptos_client.waitForTransaction(response["hash"], { // checkSuccess: true, // }); - + await state.aptos_client.waitForTransaction(response["hash"]); - + return { transactionSubmitted: true, transactionHash: response["hash"], @@ -82,7 +64,7 @@ const useSubmitTransaction = () => { }; } // transaction failed - return {...responseOnError, message: response.message}; + return { ...responseOnError, message: response.message }; } catch (error) { if (error instanceof FailedTransactionError) { return { @@ -92,15 +74,13 @@ const useSubmitTransaction = () => { success: false, }; } else if (error instanceof Error) { - return {...responseOnError, message: error.message}; + return { ...responseOnError, message: error.message }; } } return responseOnError; }; - await signAndSubmitTransactionCall(transaction).then( - setTransactionResponse, - ); + await signAndSubmitTransactionCall(transaction).then(setTransactionResponse); } function clearTransactionResponse() { diff --git a/packages/nextjs/hooks/scaffold-eth/useTargetNetwork.ts b/packages/nextjs/hooks/scaffold-move/useTargetNetwork.ts similarity index 51% rename from packages/nextjs/hooks/scaffold-eth/useTargetNetwork.ts rename to packages/nextjs/hooks/scaffold-move/useTargetNetwork.ts index ff0b23d..9841c87 100644 --- a/packages/nextjs/hooks/scaffold-eth/useTargetNetwork.ts +++ b/packages/nextjs/hooks/scaffold-move/useTargetNetwork.ts @@ -1,32 +1,22 @@ -import { useEffect, useMemo } from "react"; -import { useAccount } from "wagmi"; +import { useEffect } from "react"; import scaffoldConfig from "~~/scaffold.config"; import { useGlobalState } from "~~/services/store/store"; -import { ChainWithAttributes } from "~~/utils/scaffold-eth"; -import { NETWORKS_EXTRA_DATA } from "~~/utils/scaffold-eth"; +import { Chain } from "~~/utils/scaffold-move/chains"; /** * Retrieves the connected wallet's network from scaffold.config or defaults to the 0th network in the list if the wallet is not connected. */ -export function useTargetNetwork(): { targetNetwork: ChainWithAttributes } { - const { chain } = useAccount(); +export function useTargetNetwork(): { targetNetwork: Chain } { + const chain = "devnet"; // TODO: Get this from wallet? const targetNetwork = useGlobalState(({ targetNetwork }) => targetNetwork); const setTargetNetwork = useGlobalState(({ setTargetNetwork }) => setTargetNetwork); useEffect(() => { - const newSelectedNetwork = scaffoldConfig.targetNetworks.find(targetNetwork => targetNetwork.id === chain?.id); + const newSelectedNetwork = scaffoldConfig.targetNetworks.find(targetNetwork => targetNetwork.id === chain); if (newSelectedNetwork && newSelectedNetwork.id !== targetNetwork.id) { setTargetNetwork(newSelectedNetwork); } - }, [chain?.id, setTargetNetwork, targetNetwork.id]); + }, [chain, setTargetNetwork, targetNetwork.id]); - return useMemo( - () => ({ - targetNetwork: { - ...targetNetwork, - ...NETWORKS_EXTRA_DATA[targetNetwork.id], - }, - }), - [targetNetwork], - ); + return { targetNetwork }; } diff --git a/packages/nextjs/scaffold.config.ts b/packages/nextjs/scaffold.config.ts index 6485373..5980e67 100644 --- a/packages/nextjs/scaffold.config.ts +++ b/packages/nextjs/scaffold.config.ts @@ -1,35 +1,19 @@ -import * as chains from "viem/chains"; -import {Aptos, AptosConfig, NetworkToNetworkName} from "@aptos-labs/ts-sdk"; - +import { Chain, defaultChains } from "./utils/scaffold-move/chains"; export type ScaffoldConfig = { - targetNetworks: readonly chains.Chain[]; + targetNetworks: readonly Chain[]; pollingInterval: number; - alchemyApiKey: string; - walletConnectProjectId: string; onlyLocalBurnerWallet: boolean; }; const scaffoldConfig = { // The networks on which your DApp is live - targetNetworks: [chains.sepolia], + targetNetworks: [defaultChains.m1_devnet, defaultChains.aptos_testnet], // The interval at which your front-end polls the RPC servers for new data // it has no effect if you only target the local network (default is 4000) pollingInterval: 30000, - // This is ours Alchemy's default API key. - // You can get your own at https://dashboard.alchemyapi.io - // It's recommended to store it in an env variable: - // .env.local for local testing, and in the Vercel/system env config for live apps. - alchemyApiKey: process.env.NEXT_PUBLIC_ALCHEMY_API_KEY || "oKxs-03sij-U_N0iOlrSsZFr29-IqbuF", - - // This is ours WalletConnect's default project ID. - // You can get your own at https://cloud.walletconnect.com - // It's recommended to store it in an env variable: - // .env.local for local testing, and in the Vercel/system env config for live apps. - walletConnectProjectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID || "3a8170812b534d0ff9d794f19a901d64", - // Only show the Burner Wallet when running on hardhat network onlyLocalBurnerWallet: true, } as const satisfies ScaffoldConfig; diff --git a/packages/nextjs/services/store/store.ts b/packages/nextjs/services/store/store.ts index 158ca9a..a111e49 100644 --- a/packages/nextjs/services/store/store.ts +++ b/packages/nextjs/services/store/store.ts @@ -1,6 +1,6 @@ import { create } from "zustand"; import scaffoldConfig from "~~/scaffold.config"; -import { ChainWithAttributes } from "~~/utils/scaffold-eth"; +import { Chain } from "~~/utils/scaffold-move/chains"; /** * Zustand Store @@ -12,11 +12,11 @@ import { ChainWithAttributes } from "~~/utils/scaffold-eth"; */ type GlobalState = { - targetNetwork: ChainWithAttributes; - setTargetNetwork: (newTargetNetwork: ChainWithAttributes) => void; + targetNetwork: Chain; + setTargetNetwork: (newTargetNetwork: Chain) => void; }; export const useGlobalState = create(set => ({ targetNetwork: scaffoldConfig.targetNetworks[0], - setTargetNetwork: (newTargetNetwork: ChainWithAttributes) => set(() => ({ targetNetwork: newTargetNetwork })), + setTargetNetwork: (newTargetNetwork: Chain) => set(() => ({ targetNetwork: newTargetNetwork })), })); diff --git a/packages/nextjs/services/web3/wagmiConfig.tsx b/packages/nextjs/services/web3/wagmiConfig.tsx deleted file mode 100644 index e207843..0000000 --- a/packages/nextjs/services/web3/wagmiConfig.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { wagmiConnectors } from "./wagmiConnectors"; -import { Chain, createClient, http } from "viem"; -import { hardhat, mainnet } from "viem/chains"; -import { createConfig } from "wagmi"; -import scaffoldConfig from "~~/scaffold.config"; -import { getAlchemyHttpUrl } from "~~/utils/scaffold-eth"; - -const { targetNetworks } = scaffoldConfig; - -// We always want to have mainnet enabled (ENS resolution, ETH price, etc). But only once. -export const enabledChains = targetNetworks.find((network: Chain) => network.id === 1) - ? targetNetworks - : ([...targetNetworks, mainnet] as const); - -export const wagmiConfig = createConfig({ - chains: enabledChains, - connectors: wagmiConnectors, - ssr: true, - client({ chain }) { - return createClient({ - chain, - transport: http(getAlchemyHttpUrl(chain.id)), - ...(chain.id !== (hardhat as Chain).id - ? { - pollingInterval: scaffoldConfig.pollingInterval, - } - : {}), - }); - }, -}); diff --git a/packages/nextjs/services/web3/wagmiConnectors.tsx b/packages/nextjs/services/web3/wagmiConnectors.tsx deleted file mode 100644 index 8167996..0000000 --- a/packages/nextjs/services/web3/wagmiConnectors.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { connectorsForWallets } from "@rainbow-me/rainbowkit"; -import { - coinbaseWallet, - ledgerWallet, - metaMaskWallet, - rainbowWallet, - safeWallet, - walletConnectWallet, -} from "@rainbow-me/rainbowkit/wallets"; -import { rainbowkitBurnerWallet } from "burner-connector"; -import * as chains from "viem/chains"; -import scaffoldConfig from "~~/scaffold.config"; - -const { onlyLocalBurnerWallet, targetNetworks } = scaffoldConfig; - -const wallets = [ - metaMaskWallet, - walletConnectWallet, - ledgerWallet, - coinbaseWallet, - rainbowWallet, - safeWallet, - ...(!targetNetworks.some(network => network.id !== (chains.hardhat as chains.Chain).id) || !onlyLocalBurnerWallet - ? [rainbowkitBurnerWallet] - : []), -]; - -/** - * wagmi connectors for the wagmi context - */ -export const wagmiConnectors = connectorsForWallets( - [ - { - groupName: "Supported Wallets", - wallets, - }, - ], - - { - appName: "scaffold-eth-2", - projectId: scaffoldConfig.walletConnectProjectId, - }, -); diff --git a/packages/nextjs/utils/scaffold-eth/block.ts b/packages/nextjs/utils/scaffold-eth/block.ts deleted file mode 100644 index 19e8c9f..0000000 --- a/packages/nextjs/utils/scaffold-eth/block.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Block, Transaction, TransactionReceipt } from "viem"; - -export type TransactionWithFunction = Transaction & { - functionName?: string; - functionArgs?: any[]; - functionArgNames?: string[]; - functionArgTypes?: string[]; -}; - -type TransactionReceipts = { - [key: string]: TransactionReceipt; -}; - -export type TransactionsTableProps = { - blocks: Block[]; - transactionReceipts: TransactionReceipts; -}; diff --git a/packages/nextjs/utils/scaffold-eth/contract.ts b/packages/nextjs/utils/scaffold-eth/contract.ts deleted file mode 100644 index b8ea655..0000000 --- a/packages/nextjs/utils/scaffold-eth/contract.ts +++ /dev/null @@ -1,316 +0,0 @@ -import { MutateOptions } from "@tanstack/react-query"; -import { - Abi, - AbiParameter, - AbiParameterToPrimitiveType, - AbiParametersToPrimitiveTypes, - ExtractAbiEvent, - ExtractAbiEventNames, - ExtractAbiFunction, -} from "abitype"; -import type { ExtractAbiFunctionNames } from "abitype"; -import type { Simplify } from "type-fest"; -import type { MergeDeepRecord } from "type-fest/source/merge-deep"; -import { - Address, - Block, - GetEventArgs, - GetTransactionReceiptReturnType, - GetTransactionReturnType, - Log, - TransactionReceipt, - WriteContractErrorType, -} from "viem"; -import { Config, UseReadContractParameters, UseWatchContractEventParameters } from "wagmi"; -import { WriteContractParameters, WriteContractReturnType } from "wagmi/actions"; -import { WriteContractVariables } from "wagmi/query"; -import deployedContractsData from "~~/contracts/deployedModules"; -import externalContractsData from "~~/contracts/externalModules"; -import scaffoldConfig from "~~/scaffold.config"; - -type AddExternalFlag = { - [ChainId in keyof T]: { - [ContractName in keyof T[ChainId]]: T[ChainId][ContractName] & { external?: true }; - }; -}; - -const deepMergeContracts = , E extends Record>( - local: L, - external: E, -) => { - const result: Record = {}; - const allKeys = Array.from(new Set([...Object.keys(external), ...Object.keys(local)])); - for (const key of allKeys) { - if (!external[key]) { - result[key] = local[key]; - continue; - } - const amendedExternal = Object.fromEntries( - Object.entries(external[key] as Record>).map(([contractName, declaration]) => [ - contractName, - { ...declaration, external: true }, - ]), - ); - result[key] = { ...local[key], ...amendedExternal }; - } - return result as MergeDeepRecord, AddExternalFlag, { arrayMergeMode: "replace" }>; -}; - -const contractsData = deepMergeContracts(deployedContractsData, externalContractsData); - -export type InheritedFunctions = { readonly [key: string]: string }; - -export type GenericContract = { - address: Address; - abi: Abi; - inheritedFunctions?: InheritedFunctions; - external?: true; -}; - -export type GenericContractsDeclaration = { - [chainId: number]: { - [contractName: string]: GenericContract; - }; -}; - -export const contracts = contractsData as GenericContractsDeclaration | null; - -type ConfiguredChainId = (typeof scaffoldConfig)["targetNetworks"][0]["id"]; - -type IsContractDeclarationMissing = typeof contractsData extends { [key in ConfiguredChainId]: any } - ? TNo - : TYes; - -type ContractsDeclaration = IsContractDeclarationMissing; - -type Contracts = ContractsDeclaration[ConfiguredChainId]; - -export type ContractName = keyof Contracts; - -export type Contract = Contracts[TContractName]; - -type InferContractAbi = TContract extends { abi: infer TAbi } ? TAbi : never; - -export type ContractAbi = InferContractAbi>; - -export type AbiFunctionInputs = ExtractAbiFunction< - TAbi, - TFunctionName ->["inputs"]; - -export type AbiFunctionArguments = AbiParametersToPrimitiveTypes< - AbiFunctionInputs ->; - -export type AbiFunctionOutputs = ExtractAbiFunction< - TAbi, - TFunctionName ->["outputs"]; - -export type AbiFunctionReturnType = IsContractDeclarationMissing< - any, - AbiParametersToPrimitiveTypes> extends readonly [any] - ? AbiParametersToPrimitiveTypes>[0] - : AbiParametersToPrimitiveTypes> ->; - -export type AbiEventInputs> = ExtractAbiEvent< - TAbi, - TEventName ->["inputs"]; - -export enum ContractCodeStatus { - "LOADING", - "DEPLOYED", - "NOT_FOUND", -} - -type AbiStateMutability = "pure" | "view" | "nonpayable" | "payable"; -export type ReadAbiStateMutability = "view" | "pure"; -export type WriteAbiStateMutability = "nonpayable" | "payable"; - -export type FunctionNamesWithInputs< - TContractName extends ContractName, - TAbiStateMutibility extends AbiStateMutability = AbiStateMutability, -> = Exclude< - Extract< - ContractAbi[number], - { - type: "function"; - stateMutability: TAbiStateMutibility; - } - >, - { - inputs: readonly []; - } ->["name"]; - -type Expand = T extends object ? (T extends infer O ? { [K in keyof O]: O[K] } : never) : T; - -type UnionToIntersection = Expand<(U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never>; - -type OptionalTupple = T extends readonly [infer H, ...infer R] ? readonly [H | undefined, ...OptionalTupple] : T; - -type UseScaffoldArgsParam< - TContractName extends ContractName, - TFunctionName extends ExtractAbiFunctionNames>, -> = - TFunctionName extends FunctionNamesWithInputs - ? { - args: OptionalTupple, TFunctionName>>>; - value?: ExtractAbiFunction, TFunctionName>["stateMutability"] extends "payable" - ? bigint | undefined - : undefined; - } - : { - args?: never; - }; - -export type UseScaffoldReadConfig< - TContractName extends ContractName, - TFunctionName extends ExtractAbiFunctionNames, ReadAbiStateMutability>, -> = { - contractName: TContractName; - watch?: boolean; -} & IsContractDeclarationMissing< - Partial, - { - functionName: TFunctionName; - } & UseScaffoldArgsParam & - Omit ->; - -export type ScaffoldWriteContractVariables< - TContractName extends ContractName, - TFunctionName extends ExtractAbiFunctionNames, WriteAbiStateMutability>, -> = IsContractDeclarationMissing< - Partial, - { - functionName: TFunctionName; - } & UseScaffoldArgsParam & - Omit ->; - -type WriteVariables = WriteContractVariables; - -export type TransactorFuncOptions = { - onBlockConfirmation?: (txnReceipt: TransactionReceipt) => void; - blockConfirmations?: number; -}; - -export type ScaffoldWriteContractOptions = MutateOptions< - WriteContractReturnType, - WriteContractErrorType, - WriteVariables, - unknown -> & - TransactorFuncOptions; - -export type UseScaffoldEventConfig< - TContractName extends ContractName, - TEventName extends ExtractAbiEventNames>, - TEvent extends ExtractAbiEvent, TEventName> = ExtractAbiEvent< - ContractAbi, - TEventName - >, -> = { - contractName: TContractName; - eventName: TEventName; -} & IsContractDeclarationMissing< - Omit & { - onLogs: ( - logs: Simplify< - Omit, "args" | "eventName"> & { - args: Record; - eventName: string; - } - >[], - ) => void; - }, - Omit>, "onLogs" | "address" | "abi" | "eventName"> & { - onLogs: ( - logs: Simplify< - Omit, "args"> & { - args: AbiParametersToPrimitiveTypes & - GetEventArgs< - ContractAbi, - TEventName, - { - IndexedOnly: false; - } - >; - } - >[], - ) => void; - } ->; - -type IndexedEventInputs< - TContractName extends ContractName, - TEventName extends ExtractAbiEventNames>, -> = Extract, TEventName>[number], { indexed: true }>; - -export type EventFilters< - TContractName extends ContractName, - TEventName extends ExtractAbiEventNames>, -> = IsContractDeclarationMissing< - any, - IndexedEventInputs extends never - ? never - : { - [Key in IsContractDeclarationMissing< - any, - IndexedEventInputs["name"] - >]?: AbiParameterToPrimitiveType, { name: Key }>>; - } ->; - -export type UseScaffoldEventHistoryConfig< - TContractName extends ContractName, - TEventName extends ExtractAbiEventNames>, - TBlockData extends boolean = false, - TTransactionData extends boolean = false, - TReceiptData extends boolean = false, -> = { - contractName: TContractName; - eventName: IsContractDeclarationMissing; - fromBlock: bigint; - filters?: EventFilters; - blockData?: TBlockData; - transactionData?: TTransactionData; - receiptData?: TReceiptData; - watch?: boolean; - enabled?: boolean; -}; - -export type UseScaffoldEventHistoryData< - TContractName extends ContractName, - TEventName extends ExtractAbiEventNames>, - TBlockData extends boolean = false, - TTransactionData extends boolean = false, - TReceiptData extends boolean = false, - TEvent extends ExtractAbiEvent, TEventName> = ExtractAbiEvent< - ContractAbi, - TEventName - >, -> = - | IsContractDeclarationMissing< - any[], - { - log: Log; - args: AbiParametersToPrimitiveTypes & - GetEventArgs< - ContractAbi, - TEventName, - { - IndexedOnly: false; - } - >; - block: TBlockData extends true ? Block : null; - receipt: TReceiptData extends true ? GetTransactionReturnType : null; - transaction: TTransactionData extends true ? GetTransactionReceiptReturnType : null; - }[] - > - | undefined; - -export type AbiParameterTuple = Extract; diff --git a/packages/nextjs/utils/scaffold-eth/contractsData.ts b/packages/nextjs/utils/scaffold-eth/contractsData.ts deleted file mode 100644 index 84d4278..0000000 --- a/packages/nextjs/utils/scaffold-eth/contractsData.ts +++ /dev/null @@ -1,7 +0,0 @@ -import scaffoldConfig from "~~/scaffold.config"; -import { contracts } from "~~/utils/scaffold-eth/contract"; - -export function getAllContracts() { - const contractsData = contracts?.[scaffoldConfig.targetNetworks[0].id]; - return contractsData ? contractsData : {}; -} diff --git a/packages/nextjs/utils/scaffold-eth/decodeTxData.ts b/packages/nextjs/utils/scaffold-eth/decodeTxData.ts deleted file mode 100644 index 5b9a3b8..0000000 --- a/packages/nextjs/utils/scaffold-eth/decodeTxData.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { TransactionWithFunction } from "./block"; -import { GenericContractsDeclaration } from "./contract"; -import { Abi, AbiFunction, decodeFunctionData, getAbiItem } from "viem"; -import { hardhat } from "viem/chains"; -import contractData from "~~/contracts/deployedModules"; - -type ContractsInterfaces = Record; -type TransactionType = TransactionWithFunction | null; - -const deployedContracts = contractData as GenericContractsDeclaration | null; -const chainMetaData = deployedContracts?.[hardhat.id]; -const interfaces = chainMetaData - ? Object.entries(chainMetaData).reduce((finalInterfacesObj, [contractName, contract]) => { - finalInterfacesObj[contractName] = contract.abi; - return finalInterfacesObj; - }, {} as ContractsInterfaces) - : {}; - -export const decodeTransactionData = (tx: TransactionWithFunction) => { - if (tx.input.length >= 10 && !tx.input.startsWith("0x60e06040")) { - for (const [, contractAbi] of Object.entries(interfaces)) { - try { - const { functionName, args } = decodeFunctionData({ - abi: contractAbi, - data: tx.input, - }); - tx.functionName = functionName; - tx.functionArgs = args as any[]; - tx.functionArgNames = getAbiItem({ - abi: contractAbi as AbiFunction[], - name: functionName, - })?.inputs?.map((input: any) => input.name); - tx.functionArgTypes = getAbiItem({ - abi: contractAbi as AbiFunction[], - name: functionName, - })?.inputs.map((input: any) => input.type); - - break; - } catch (e) { - console.error(`Parsing failed: ${e}`); - } - } - } - return tx; -}; - -export const getFunctionDetails = (transaction: TransactionType) => { - if ( - transaction && - transaction.functionName && - transaction.functionArgNames && - transaction.functionArgTypes && - transaction.functionArgs - ) { - const details = transaction.functionArgNames.map( - (name, i) => `${transaction.functionArgTypes?.[i] || ""} ${name} = ${transaction.functionArgs?.[i] ?? ""}`, - ); - return `${transaction.functionName}(${details.join(", ")})`; - } - return ""; -}; diff --git a/packages/nextjs/utils/scaffold-eth/fetchPriceFromUniswap.ts b/packages/nextjs/utils/scaffold-eth/fetchPriceFromUniswap.ts deleted file mode 100644 index 2a5ab56..0000000 --- a/packages/nextjs/utils/scaffold-eth/fetchPriceFromUniswap.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { ChainWithAttributes, getAlchemyHttpUrl } from "./networks"; -import { CurrencyAmount, Token } from "@uniswap/sdk-core"; -import { Pair, Route } from "@uniswap/v2-sdk"; -import { Address, createPublicClient, http, parseAbi } from "viem"; -import { mainnet } from "viem/chains"; - -const publicClient = createPublicClient({ - chain: mainnet, - transport: http(getAlchemyHttpUrl(mainnet.id)), -}); - -const ABI = parseAbi([ - "function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast)", - "function token0() external view returns (address)", - "function token1() external view returns (address)", -]); - -export const fetchPriceFromUniswap = async (targetNetwork: ChainWithAttributes): Promise => { - if ( - targetNetwork.nativeCurrency.symbol !== "ETH" && - targetNetwork.nativeCurrency.symbol !== "SEP" && - !targetNetwork.nativeCurrencyTokenAddress - ) { - return 0; - } - try { - const DAI = new Token(1, "0x6B175474E89094C44Da98b954EedeAC495271d0F", 18); - const TOKEN = new Token( - 1, - targetNetwork.nativeCurrencyTokenAddress || "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", - 18, - ); - const pairAddress = Pair.getAddress(TOKEN, DAI) as Address; - - const wagmiConfig = { - address: pairAddress, - abi: ABI, - }; - - const reserves = await publicClient.readContract({ - ...wagmiConfig, - functionName: "getReserves", - }); - - const token0Address = await publicClient.readContract({ - ...wagmiConfig, - functionName: "token0", - }); - - const token1Address = await publicClient.readContract({ - ...wagmiConfig, - functionName: "token1", - }); - const token0 = [TOKEN, DAI].find(token => token.address === token0Address) as Token; - const token1 = [TOKEN, DAI].find(token => token.address === token1Address) as Token; - const pair = new Pair( - CurrencyAmount.fromRawAmount(token0, reserves[0].toString()), - CurrencyAmount.fromRawAmount(token1, reserves[1].toString()), - ); - const route = new Route([pair], TOKEN, DAI); - const price = parseFloat(route.midPrice.toSignificant(6)); - return price; - } catch (error) { - console.error( - `useNativeCurrencyPrice - Error fetching ${targetNetwork.nativeCurrency.symbol} price from Uniswap: `, - error, - ); - return 0; - } -}; diff --git a/packages/nextjs/utils/scaffold-eth/index.ts b/packages/nextjs/utils/scaffold-eth/index.ts deleted file mode 100644 index 6d69193..0000000 --- a/packages/nextjs/utils/scaffold-eth/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from "./fetchPriceFromUniswap"; -export * from "./networks"; -export * from "./notification"; -export * from "./block"; -export * from "./decodeTxData"; -export * from "./getParsedError"; diff --git a/packages/nextjs/utils/scaffold-eth/networks.ts b/packages/nextjs/utils/scaffold-eth/networks.ts deleted file mode 100644 index 0a658a2..0000000 --- a/packages/nextjs/utils/scaffold-eth/networks.ts +++ /dev/null @@ -1,136 +0,0 @@ -import * as chains from "viem/chains"; -import scaffoldConfig from "~~/scaffold.config"; - -type ChainAttributes = { - // color | [lightThemeColor, darkThemeColor] - color: string | [string, string]; - // Used to fetch price by providing mainnet token address - // for networks having native currency other than ETH - nativeCurrencyTokenAddress?: string; -}; - -export type ChainWithAttributes = chains.Chain & Partial; - -// Mapping of chainId to RPC chain name an format followed by alchemy and infura -export const RPC_CHAIN_NAMES: Record = { - [chains.mainnet.id]: "eth-mainnet", - [chains.goerli.id]: "eth-goerli", - [chains.sepolia.id]: "eth-sepolia", - [chains.optimism.id]: "opt-mainnet", - [chains.optimismGoerli.id]: "opt-goerli", - [chains.optimismSepolia.id]: "opt-sepolia", - [chains.arbitrum.id]: "arb-mainnet", - [chains.arbitrumGoerli.id]: "arb-goerli", - [chains.arbitrumSepolia.id]: "arb-sepolia", - [chains.polygon.id]: "polygon-mainnet", - [chains.polygonMumbai.id]: "polygon-mumbai", - [chains.polygonAmoy.id]: "polygon-amoy", - [chains.astar.id]: "astar-mainnet", - [chains.polygonZkEvm.id]: "polygonzkevm-mainnet", - [chains.polygonZkEvmTestnet.id]: "polygonzkevm-testnet", - [chains.base.id]: "base-mainnet", - [chains.baseGoerli.id]: "base-goerli", - [chains.baseSepolia.id]: "base-sepolia", -}; - -export const getAlchemyHttpUrl = (chainId: number) => { - return RPC_CHAIN_NAMES[chainId] - ? `https://${RPC_CHAIN_NAMES[chainId]}.g.alchemy.com/v2/${scaffoldConfig.alchemyApiKey}` - : undefined; -}; - -export const NETWORKS_EXTRA_DATA: Record = { - [chains.hardhat.id]: { - color: "#b8af0c", - }, - [chains.mainnet.id]: { - color: "#ff8b9e", - }, - [chains.sepolia.id]: { - color: ["#5f4bb6", "#87ff65"], - }, - [chains.gnosis.id]: { - color: "#48a9a6", - }, - [chains.polygon.id]: { - color: "#2bbdf7", - nativeCurrencyTokenAddress: "0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0", - }, - [chains.polygonMumbai.id]: { - color: "#92D9FA", - nativeCurrencyTokenAddress: "0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0", - }, - [chains.optimismSepolia.id]: { - color: "#f01a37", - }, - [chains.optimism.id]: { - color: "#f01a37", - }, - [chains.arbitrumSepolia.id]: { - color: "#28a0f0", - }, - [chains.arbitrum.id]: { - color: "#28a0f0", - }, - [chains.fantom.id]: { - color: "#1969ff", - }, - [chains.fantomTestnet.id]: { - color: "#1969ff", - }, - [chains.scrollSepolia.id]: { - color: "#fbebd4", - }, -}; - -/** - * Gives the block explorer transaction URL, returns empty string if the network is a local chain - */ -export function getBlockExplorerTxLink(chainId: number, txnHash: string) { - const chainNames = Object.keys(chains); - - const targetChainArr = chainNames.filter(chainName => { - const wagmiChain = chains[chainName as keyof typeof chains]; - return wagmiChain.id === chainId; - }); - - if (targetChainArr.length === 0) { - return ""; - } - - const targetChain = targetChainArr[0] as keyof typeof chains; - const blockExplorerTxURL = chains[targetChain]?.blockExplorers?.default?.url; - - if (!blockExplorerTxURL) { - return ""; - } - - return `${blockExplorerTxURL}/tx/${txnHash}`; -} - -/** - * Gives the block explorer URL for a given address. - * Defaults to Etherscan if no (wagmi) block explorer is configured for the network. - */ -export function getBlockExplorerAddressLink(network: chains.Chain, address: string) { - // const blockExplorerBaseURL = network.blockExplorers?.default?.url; - // if (network.id === chains.hardhat.id) { - // return `/blockexplorer/address/${address}`; - // } - - // if (!blockExplorerBaseURL) { - return `https://explorer.devnet.m1.movementlabs.xyz/account/${address}?network=devnet`; - // } - - // return `${blockExplorerBaseURL}/address/${address}`; -} - -/** - * @returns targetNetworks array containing networks configured in scaffold.config including extra network metadata - */ -export function getTargetNetworks(): ChainWithAttributes[] { - return scaffoldConfig.targetNetworks.map(targetNetwork => ({ - ...targetNetwork, - ...NETWORKS_EXTRA_DATA[targetNetwork.id], - })); -} diff --git a/packages/nextjs/utils/scaffold-move/ContentValue/CurrencyValue.tsx b/packages/nextjs/utils/scaffold-move/ContentValue/CurrencyValue.tsx index 8c2836b..19fbc4a 100644 --- a/packages/nextjs/utils/scaffold-move/ContentValue/CurrencyValue.tsx +++ b/packages/nextjs/utils/scaffold-move/ContentValue/CurrencyValue.tsx @@ -9,11 +9,7 @@ function trimRight(rightSide: string) { return rightSide; } -export function getFormattedBalanceStr( - balance: string, - decimals?: number, - fixedDecimalPlaces?: number, -): string { +export function getFormattedBalanceStr(balance: string, decimals?: number, fixedDecimalPlaces?: number): string { // If balance is zero or decimals is 0, just return it if (balance == "0" || (decimals !== undefined && decimals === 0)) { return balance; @@ -28,9 +24,7 @@ export function getFormattedBalanceStr( } // Otherwise, insert decimal point at len - decimals - const leftSide = BigInt(balance.slice(0, len - decimals)).toLocaleString( - "en-US", - ); + const leftSide = BigInt(balance.slice(0, len - decimals)).toLocaleString("en-US"); let rightSide = balance.slice(len - decimals); if (BigInt(rightSide) == BigInt(0)) { return leftSide; @@ -38,10 +32,7 @@ export function getFormattedBalanceStr( // remove trailing 0s rightSide = trimRight(rightSide); - if ( - fixedDecimalPlaces !== undefined && - rightSide.length > fixedDecimalPlaces - ) { + if (fixedDecimalPlaces !== undefined && rightSide.length > fixedDecimalPlaces) { rightSide = rightSide.slice(0, fixedDecimalPlaces - rightSide.length); } @@ -59,12 +50,7 @@ type CurrencyValueProps = { currencyCode?: string | React.ReactNode; }; -export default function CurrencyValue({ - amount, - decimals, - fixedDecimalPlaces, - currencyCode, -}: CurrencyValueProps) { +export default function CurrencyValue({ amount, decimals, fixedDecimalPlaces, currencyCode }: CurrencyValueProps) { const number = getFormattedBalanceStr(amount, decimals, fixedDecimalPlaces); if (currencyCode) { return ( @@ -77,21 +63,12 @@ export default function CurrencyValue({ } } -export function APTCurrencyValue({ - amount: amountStr, - decimals, - fixedDecimalPlaces, -}: CurrencyValueProps) { +export function APTCurrencyValue({ amount: amountStr, decimals, fixedDecimalPlaces }: CurrencyValueProps) { // remove leading "-" when it's a negative number let amount = amountStr; if (amountStr.startsWith("-")) { amount = amountStr.substring(1); } - return ( - - ); + return ; } diff --git a/packages/nextjs/utils/scaffold-move/aptosClient.ts b/packages/nextjs/utils/scaffold-move/aptosClient.ts new file mode 100644 index 0000000..1b0c434 --- /dev/null +++ b/packages/nextjs/utils/scaffold-move/aptosClient.ts @@ -0,0 +1,20 @@ +import { defaultChains } from "./chains"; +import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk"; + +export function aptosClient(chainId: string) { + const chain = defaultChains[chainId]; + if (!chain) { + throw new Error(`Chain with id ${chainId} not found`); + } + + const aptosConfig = new AptosConfig({ + network: chain.network, + ...(chain.network === Network.CUSTOM && { + fullnode: chain.fullnode, + indexer: chain.indexer, + faucet: chain.faucet, + }), + }); + + return new Aptos(aptosConfig); +} diff --git a/packages/nextjs/utils/scaffold-move/chains.ts b/packages/nextjs/utils/scaffold-move/chains.ts new file mode 100644 index 0000000..d2bb5ef --- /dev/null +++ b/packages/nextjs/utils/scaffold-move/chains.ts @@ -0,0 +1,36 @@ +import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk"; + +export type Chain = { + id: string; + name: string; + network: Network; + fullnode?: string; + indexer?: string; + faucet?: string; +}; + +type Chains = { + [key: string]: Chain; +}; + +export const defaultChains: Chains = { + m1_devnet: { + id: "devnet", + name: "M1 Devnet", + network: Network.CUSTOM, + fullnode: "https://aptos.devnet.m1.movementlabs.xyz", + indexer: "https://indexer.devnet.m1.movementlabs.xyz/", + faucet: "https://faucet2.movementlabs.xyz", + }, + // m1_testnet: { + // id: 'testnet', + // name: 'M1 Testnet', + // network: Network.CUSTOM, + // rpcUrl: 'https://devnet.m1.movementlabs.xyz/', + // }, + aptos_testnet: { + id: "testnet", + name: "Aptos Testnet", + network: Network.TESTNET, + }, +}; diff --git a/packages/nextjs/utils/scaffold-eth/common.ts b/packages/nextjs/utils/scaffold-move/common.ts similarity index 100% rename from packages/nextjs/utils/scaffold-eth/common.ts rename to packages/nextjs/utils/scaffold-move/common.ts diff --git a/packages/nextjs/utils/scaffold-move/contract.ts b/packages/nextjs/utils/scaffold-move/contract.ts index c2b2ef6..174737a 100644 --- a/packages/nextjs/utils/scaffold-move/contract.ts +++ b/packages/nextjs/utils/scaffold-move/contract.ts @@ -1,9 +1,11 @@ +import { Types } from "aptos"; import type { MergeDeepRecord } from "type-fest/source/merge-deep"; import deployedContractsData from "~~/contracts/deployedModules"; import externalContractsData from "~~/contracts/externalModules"; import scaffoldConfig from "~~/scaffold.config"; -import { Types } from "aptos"; - +import { + AbiParameter +} from "abitype"; type AddExternalFlag = { [ChainId in keyof T]: { @@ -35,29 +37,6 @@ const deepMergeContracts = , E extends Record const contractsData = deepMergeContracts(deployedContractsData, externalContractsData); -type MoveFunction = { - name: string; - visibility: string; - is_entry: boolean; - is_view: boolean; - generic_type_params: any[]; - params: string[]; - return: string[]; -}; - -type MoveStructField = { - name: string; - type: string; -}; - -type MoveStruct = { - name: string; - is_native: boolean; - abilities: string[]; - generic_type_params: any[]; - fields: MoveStructField[]; -}; - export type GenericContract = { bytecode: string; abi?: GenericContractAbi; @@ -68,9 +47,9 @@ export type GenericContractAbi = { address: string; // TODO: address type name: string; friends: string[]; //TODO: check which type? - exposed_functions: MoveFunction[]; - structs: MoveStruct[]; -} + exposed_functions: Types.MoveFunction[]; + structs: Types.MoveStruct[]; +}; export type GenericContractsDeclaration = { [chainId: string]: { [contractName: string]: GenericContract; @@ -79,7 +58,6 @@ export type GenericContractsDeclaration = { export const contracts = contractsData as GenericContractsDeclaration | null; - type ConfiguredChainId = (typeof scaffoldConfig)["targetNetworks"][0]["id"]; type IsContractDeclarationMissing = typeof contractsData extends { [key in ConfiguredChainId]: any } @@ -88,16 +66,15 @@ type IsContractDeclarationMissing = typeof contractsData extends { [k type ContractsDeclaration = IsContractDeclarationMissing; -type Contracts = ContractsDeclaration[ConfiguredChainId]; - +type Contracts = ContractsDeclaration["devnet"]; export type ContractName = keyof Contracts; export type Contract = Contracts[TContractName]; - - export enum ContractCodeStatus { "LOADING", "DEPLOYED", "NOT_FOUND", } + +export type AbiParameterTuple = Extract; diff --git a/packages/nextjs/utils/scaffold-eth/getMetadata.ts b/packages/nextjs/utils/scaffold-move/getMetadata.ts similarity index 100% rename from packages/nextjs/utils/scaffold-eth/getMetadata.ts rename to packages/nextjs/utils/scaffold-move/getMetadata.ts diff --git a/packages/nextjs/utils/scaffold-eth/getParsedError.ts b/packages/nextjs/utils/scaffold-move/getParsedError.ts similarity index 100% rename from packages/nextjs/utils/scaffold-eth/getParsedError.ts rename to packages/nextjs/utils/scaffold-move/getParsedError.ts diff --git a/packages/nextjs/utils/scaffold-move/index.ts b/packages/nextjs/utils/scaffold-move/index.ts new file mode 100644 index 0000000..971d7cf --- /dev/null +++ b/packages/nextjs/utils/scaffold-move/index.ts @@ -0,0 +1,3 @@ +export * from "./networks"; +export * from "./notification"; +export * from "./getParsedError"; diff --git a/packages/nextjs/utils/scaffold-move/networks.ts b/packages/nextjs/utils/scaffold-move/networks.ts new file mode 100644 index 0000000..27a523c --- /dev/null +++ b/packages/nextjs/utils/scaffold-move/networks.ts @@ -0,0 +1,27 @@ +import scaffoldConfig from "~~/scaffold.config"; +import { Chain } from "~~/utils/scaffold-move/chains"; + +/** + * Gives the block explorer transaction URL, returns empty string if the network is a local chain + */ +export function getBlockExplorerTxLink(chainId: string, txnHash: string) { + return `https://explorer.${chainId}.m1.movementlabs.xyz/txn/~${txnHash}?network=${chainId}`; +} + +/** + * Gives the block explorer URL for a given address. + * Defaults to Etherscan if no (wagmi) block explorer is configured for the network. + */ +export function getBlockExplorerAddressLink(network: Chain, address: string) { + const chainId = network.id; + return `https://explorer.${chainId}.m1.movementlabs.xyz/account/${address}?network=${chainId}`; +} + +/** + * @returns targetNetworks array containing networks configured in scaffold.config including extra network metadata + */ +export function getTargetNetworks(): Chain[] { + return scaffoldConfig.targetNetworks.map(targetNetwork => ({ + ...targetNetwork, + })); +} diff --git a/packages/nextjs/utils/scaffold-eth/notification.tsx b/packages/nextjs/utils/scaffold-move/notification.tsx similarity index 100% rename from packages/nextjs/utils/scaffold-eth/notification.tsx rename to packages/nextjs/utils/scaffold-move/notification.tsx diff --git a/packages/nextjs/utils/utils.ts b/packages/nextjs/utils/utils.ts index db9513b..827c33e 100644 --- a/packages/nextjs/utils/utils.ts +++ b/packages/nextjs/utils/utils.ts @@ -1,4 +1,5 @@ -import {HexString, Types} from "aptos"; +import { HexString, Types } from "aptos"; + // import pako from "pako"; // import {Statsig} from "statsig-react"; /** @@ -160,18 +161,15 @@ import {HexString, Types} from "aptos"; export function encodeInputArgsForViewRequest(type: string, value: string) { if (type.includes("vector")) { // when it's a vector, we support both hex and javascript array format - return value.trim().startsWith("0x") - ? value.trim() - : encodeVectorForViewRequest(type, value); + return value.trim().startsWith("0x") ? value.trim() : encodeVectorForViewRequest(type, value); } else if (type === "bool") { - if (value !== "true" && value !== "false") - throw new Error(`Invalid bool value: ${value}`); + if (value !== "true" && value !== "false") throw new Error(`Invalid bool value: ${value}`); return value === "true" ? true : false; } else if (["u8", "u16", "u32"].includes(type)) { return ensureNumber(value); } else if (type.startsWith("0x1::option::Option")) { - return {vec: [...(value ? [value] : [])]}; + return { vec: [...(value ? [value] : [])] }; } else return value; } @@ -197,23 +195,22 @@ function encodeVectorForViewRequest(type: string, value: string) { return ( HexString.fromUint8Array( new Uint8Array( - rawVector.map((v) => { + rawVector.map(v => { const result = ensureNumber(v.trim()); - if (result < 0 || result > 255) - throw new Error(`Invalid u8 value: ${result}`); + if (result < 0 || result > 255) throw new Error(`Invalid u8 value: ${result}`); return result; }), ), ) as any ).hexString; } else if (["u16", "u32"].includes(match[1])) { - return rawVector.map((v) => ensureNumber(v.trim())); + return rawVector.map(v => ensureNumber(v.trim())); } else if (["u64", "u128", "u256"].includes(match[1])) { // For bigint, not need to convert, only validation - rawVector.forEach((v) => ensureBigInt(v.trim())); + rawVector.forEach(v => ensureBigInt(v.trim())); return rawVector; } else if (match[1] === "bool") { - return rawVector.map((v) => ensureBoolean(v.trim())); + return rawVector.map(v => ensureBoolean(v.trim())); } else { // 1. Address type no need to convert // 2. Other complex types like Struct is not support yet. We just pass what user input. @@ -262,10 +259,7 @@ export function ensureBoolean(val: boolean | string): boolean { function assertType(val: any, types: string[] | string, message?: string) { if (!types?.includes(typeof val)) { throw new Error( - message || - `Invalid arg: ${val} type should be ${ - types instanceof Array ? types.join(" or ") : types - }`, + message || `Invalid arg: ${val} type should be ${types instanceof Array ? types.join(" or ") : types}`, ); } } diff --git a/yarn.lock b/yarn.lock index 3414123..14d8ece 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,6 +5,31 @@ __metadata: version: 6 cacheKey: 8 +"@0no-co/graphql.web@npm:^1.0.5": + version: 1.0.7 + resolution: "@0no-co/graphql.web@npm:1.0.7" + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 + peerDependenciesMeta: + graphql: + optional: true + checksum: 84a30777b1241c19db24fa3f92d53549df2af95f553721c332346d53d9989592a952a2aa5c9c6434d299643c7a679119368febe3707f7ba2a4b788c63f56fa0a + languageName: node + linkType: hard + +"@0no-co/graphqlsp@npm:^1.12.9": + version: 1.12.11 + resolution: "@0no-co/graphqlsp@npm:1.12.11" + dependencies: + "@gql.tada/internal": ^1.0.0 + graphql: ^15.5.0 || ^16.0.0 || ^17.0.0 + peerDependencies: + graphql: ^15.5.0 || ^16.0.0 || ^17.0.0 + typescript: ^5.0.0 + checksum: 8baa82621e802bc9f4df555730136442b01bad26cf91e033412af010faea2304ddeaf90c40459f9b84567c9cd866d01328924faf9488e77b32ff3fe2be933340 + languageName: node + linkType: hard + "@aashutoshrathi/word-wrap@npm:^1.2.3": version: 1.2.6 resolution: "@aashutoshrathi/word-wrap@npm:1.2.6" @@ -484,7 +509,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.10.1, @babel/runtime@npm:^7.10.4, @babel/runtime@npm:^7.11.1, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.16.7, @babel/runtime@npm:^7.18.0, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.20.0, @babel/runtime@npm:^7.20.13, @babel/runtime@npm:^7.22.5, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.23.6, @babel/runtime@npm:^7.23.9, @babel/runtime@npm:^7.24.4, @babel/runtime@npm:^7.24.7": +"@babel/runtime@npm:^7.10.1, @babel/runtime@npm:^7.10.4, @babel/runtime@npm:^7.11.1, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.16.7, @babel/runtime@npm:^7.18.0, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.20.0, @babel/runtime@npm:^7.20.13, @babel/runtime@npm:^7.22.5, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.23.6, @babel/runtime@npm:^7.23.8, @babel/runtime@npm:^7.23.9, @babel/runtime@npm:^7.24.4, @babel/runtime@npm:^7.24.7, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.6.2, @babel/runtime@npm:^7.7.2": version: 7.24.7 resolution: "@babel/runtime@npm:7.24.7" dependencies: @@ -860,7 +885,37 @@ __metadata: languageName: node linkType: hard -"@graphql-typed-document-node/core@npm:^3.1.1": +"@gql.tada/cli-utils@npm:1.5.0": + version: 1.5.0 + resolution: "@gql.tada/cli-utils@npm:1.5.0" + dependencies: + "@0no-co/graphqlsp": ^1.12.9 + "@gql.tada/internal": 1.0.3 + "@vue/compiler-dom": ^3.4.23 + "@vue/language-core": ^2.0.17 + graphql: ^15.5.0 || ^16.0.0 || ^17.0.0 + svelte2tsx: ^0.7.6 + peerDependencies: + "@0no-co/graphqlsp": ^1.12.9 + graphql: ^15.5.0 || ^16.0.0 || ^17.0.0 + typescript: ^5.0.0 + checksum: b97b9ea570c31ef42884e3d930bbdbce7b482fd7d04de933df3a57cf7b1f1097a63c4c8cc5685f33446c9fc2088d49ca7e9de4f455cb267e35dee245336fe2c7 + languageName: node + linkType: hard + +"@gql.tada/internal@npm:1.0.3, @gql.tada/internal@npm:^1.0.0": + version: 1.0.3 + resolution: "@gql.tada/internal@npm:1.0.3" + dependencies: + "@0no-co/graphql.web": ^1.0.5 + peerDependencies: + graphql: ^15.5.0 || ^16.0.0 || ^17.0.0 + typescript: ^5.0.0 + checksum: adf0c1cdb6eb558dd386603218cd1d78ba2efbbb7054e496ede7f188e70b0e14a729b03bb89648e736f599cc3e1ad1ec56f54ca4a1c0de19485c5ad7d4c7f1dc + languageName: node + linkType: hard + +"@graphql-typed-document-node/core@npm:^3.1.1, @graphql-typed-document-node/core@npm:^3.2.0": version: 3.2.0 resolution: "@graphql-typed-document-node/core@npm:3.2.0" peerDependencies: @@ -1427,6 +1482,45 @@ __metadata: languageName: node linkType: hard +"@mysten/bcs@npm:0.11.1": + version: 0.11.1 + resolution: "@mysten/bcs@npm:0.11.1" + dependencies: + bs58: ^5.0.0 + checksum: c6f1c68afea3ec4681d0084d801225328504c9ea1925e8a3ad63277d9445d169110006d185d75c30eb3662df98cf97ea9eb73231a0cf684e71fa653aabdabf27 + languageName: node + linkType: hard + +"@mysten/sui.js@npm:0.54.1, @mysten/sui.js@npm:^0.54.1": + version: 0.54.1 + resolution: "@mysten/sui.js@npm:0.54.1" + dependencies: + "@graphql-typed-document-node/core": ^3.2.0 + "@mysten/bcs": 0.11.1 + "@noble/curves": ^1.1.0 + "@noble/hashes": ^1.3.1 + "@scure/bip32": ^1.3.1 + "@scure/bip39": ^1.2.1 + "@suchipi/femver": ^1.0.0 + bech32: ^2.0.0 + gql.tada: ^1.7.0 + graphql: ^16.8.1 + superstruct: ^1.0.3 + tweetnacl: ^1.0.3 + checksum: e0e6379d7ab21c4fdfb2f89e7e9b3bdd705ece621a46490e4c706190b5af725879b5245ecce9fafeeec812b964181b9ec94e8d901e2c1f3898a37dff7c834a11 + languageName: node + linkType: hard + +"@mysten/wallet-standard@npm:^0.11.6": + version: 0.11.6 + resolution: "@mysten/wallet-standard@npm:0.11.6" + dependencies: + "@mysten/sui.js": 0.54.1 + "@wallet-standard/core": 1.0.3 + checksum: d1a6d8075a98a58098be61e9048d423247ddd335ea0e6879ffb5c047d7012b1fadeda6e270086e3d7edd2aca84687faf232fc620584c2c4f61d17292e0ba8d95 + languageName: node + linkType: hard + "@next/env@npm:14.0.4": version: 14.0.4 resolution: "@next/env@npm:14.0.4" @@ -1524,6 +1618,15 @@ __metadata: languageName: node linkType: hard +"@noble/curves@npm:^1.1.0": + version: 1.4.2 + resolution: "@noble/curves@npm:1.4.2" + dependencies: + "@noble/hashes": 1.4.0 + checksum: c475a83c4263e2c970eaba728895b9b5d67e0ca880651e9c6e3efdc5f6a4f07ceb5b043bf71c399fc80fada0b8706e69d0772bffdd7b9de2483b988973a34cba + languageName: node + linkType: hard + "@noble/curves@npm:^1.4.0, @noble/curves@npm:~1.4.0": version: 1.4.0 resolution: "@noble/curves@npm:1.4.0" @@ -1756,6 +1859,13 @@ __metadata: languageName: node linkType: hard +"@radix-ui/primitive@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/primitive@npm:1.1.0" + checksum: 7cbf70bfd4b2200972dbd52a9366801b5a43dd844743dc97eb673b3ec8e64f5dd547538faaf9939abbfe8bb275773767ecf5a87295d90ba09c15cba2b5528c89 + languageName: node + linkType: hard + "@radix-ui/react-compose-refs@npm:1.1.0": version: 1.1.0 resolution: "@radix-ui/react-compose-refs@npm:1.1.0" @@ -1769,7 +1879,183 @@ __metadata: languageName: node linkType: hard -"@radix-ui/react-slot@npm:^1.0.2": +"@radix-ui/react-context@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-context@npm:1.1.0" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: d48df5e5193a1d963a1ff7a58f08497c60ddc364216c59090c8267985bd478447dd617847ea277afe10e67c4e0c528894c8d7407082325e0650038625140558a + languageName: node + linkType: hard + +"@radix-ui/react-dialog@npm:^1.0.5": + version: 1.1.1 + resolution: "@radix-ui/react-dialog@npm:1.1.1" + dependencies: + "@radix-ui/primitive": 1.1.0 + "@radix-ui/react-compose-refs": 1.1.0 + "@radix-ui/react-context": 1.1.0 + "@radix-ui/react-dismissable-layer": 1.1.0 + "@radix-ui/react-focus-guards": 1.1.0 + "@radix-ui/react-focus-scope": 1.1.0 + "@radix-ui/react-id": 1.1.0 + "@radix-ui/react-portal": 1.1.1 + "@radix-ui/react-presence": 1.1.0 + "@radix-ui/react-primitive": 2.0.0 + "@radix-ui/react-slot": 1.1.0 + "@radix-ui/react-use-controllable-state": 1.1.0 + aria-hidden: ^1.1.1 + react-remove-scroll: 2.5.7 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 5f270518b61e0b570a321f1db09ed95939969e9bff71fad02bce02126f047f5305d74ff79bb4e763677062db881b1e4ecd297b1556a917fed3d7a77cc0a7c235 + languageName: node + linkType: hard + +"@radix-ui/react-dismissable-layer@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-dismissable-layer@npm:1.1.0" + dependencies: + "@radix-ui/primitive": 1.1.0 + "@radix-ui/react-compose-refs": 1.1.0 + "@radix-ui/react-primitive": 2.0.0 + "@radix-ui/react-use-callback-ref": 1.1.0 + "@radix-ui/react-use-escape-keydown": 1.1.0 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 857feab2d5184a72df4e6dd9430c8e4b9fe7304790ef69512733346eee5fc33a6527256fc135d4bee6d94e8cc9c1b83c3d91da96cb4bf8300f88e9c660b71b08 + languageName: node + linkType: hard + +"@radix-ui/react-focus-guards@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-focus-guards@npm:1.1.0" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 199717e7da1ba9b3fa74b04f6a245aaebf6bdb8ae7d6f4b5f21f95f4086414a3587beebc77399a99be7d3a4b2499eaa52bf72bef660f8e69856b0fd0593b074f + languageName: node + linkType: hard + +"@radix-ui/react-focus-scope@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-focus-scope@npm:1.1.0" + dependencies: + "@radix-ui/react-compose-refs": 1.1.0 + "@radix-ui/react-primitive": 2.0.0 + "@radix-ui/react-use-callback-ref": 1.1.0 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: bea6c993752780c46c69f0c21a0fd96f11b9ed7edac23deb0953fbd8524d90938bf4c8060ccac7cad14caba3eb493f2642be7f8933910f4b6fa184666b7fcb40 + languageName: node + linkType: hard + +"@radix-ui/react-id@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-id@npm:1.1.0" + dependencies: + "@radix-ui/react-use-layout-effect": 1.1.0 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 6fbc9d1739b3b082412da10359e63967b4f3a60383ebda4c9e56b07a722d29bee53b203b3b1418f88854a29315a7715867133bb149e6e22a027a048cdd20d970 + languageName: node + linkType: hard + +"@radix-ui/react-portal@npm:1.1.1": + version: 1.1.1 + resolution: "@radix-ui/react-portal@npm:1.1.1" + dependencies: + "@radix-ui/react-primitive": 2.0.0 + "@radix-ui/react-use-layout-effect": 1.1.0 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 84dab64ce9c9f4ed7d75df6d1d82877dc7976a98cc192287d39ba2ea512415ed7bf34caf02d579a18fe21766403fa9ae41d2482a14dee5514179ee1b09cc333c + languageName: node + linkType: hard + +"@radix-ui/react-presence@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-presence@npm:1.1.0" + dependencies: + "@radix-ui/react-compose-refs": 1.1.0 + "@radix-ui/react-use-layout-effect": 1.1.0 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 7f482268aa5bb5a4214dcf39d20ad93cac96585f1f248931be897ed8a9f99965b7f9b2e8bd4f4140c64eb243b471c471bf148e107f49578cc582faa773d3e83a + languageName: node + linkType: hard + +"@radix-ui/react-primitive@npm:2.0.0": + version: 2.0.0 + resolution: "@radix-ui/react-primitive@npm:2.0.0" + dependencies: + "@radix-ui/react-slot": 1.1.0 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 04afc0f3a5ccf1de6e4861f755a89f31640d5a07237c5ac5bffe47bcd8fdf318257961fa56fedc823af49281800ee755752a371561c36fd92f008536a0553748 + languageName: node + linkType: hard + +"@radix-ui/react-slot@npm:1.1.0, @radix-ui/react-slot@npm:^1.0.2": version: 1.1.0 resolution: "@radix-ui/react-slot@npm:1.1.0" dependencies: @@ -1784,6 +2070,62 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-use-callback-ref@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-use-callback-ref@npm:1.1.0" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 2ec7903c67e3034b646005556f44fd975dc5204db6885fc58403e3584f27d95f0b573bc161de3d14fab9fda25150bf3b91f718d299fdfc701c736bd0bd2281fa + languageName: node + linkType: hard + +"@radix-ui/react-use-controllable-state@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-use-controllable-state@npm:1.1.0" + dependencies: + "@radix-ui/react-use-callback-ref": 1.1.0 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: a6c167cf8eb0744effbeab1f92ea6c0ad71838b222670c0488599f28eecd941d87ac1eed4b5d3b10df6dc7b7b2edb88a54e99d92c2942ce3b21f81d5c188f32d + languageName: node + linkType: hard + +"@radix-ui/react-use-escape-keydown@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-use-escape-keydown@npm:1.1.0" + dependencies: + "@radix-ui/react-use-callback-ref": 1.1.0 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 9bf88ea272b32ea0f292afd336780a59c5646f795036b7e6105df2d224d73c54399ee5265f61d571eb545d28382491a8b02dc436e3088de8dae415d58b959b71 + languageName: node + linkType: hard + +"@radix-ui/react-use-layout-effect@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-use-layout-effect@npm:1.1.0" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 271ea0bf1cd74718895a68414a6e95537737f36e02ad08eeb61a82b229d6abda9cff3135a479e134e1f0ce2c3ff97bb85babbdce751985fb755a39b231d7ccf2 + languageName: node + linkType: hard + "@rainbow-me/rainbowkit@npm:2.1.0": version: 2.1.0 resolution: "@rainbow-me/rainbowkit@npm:2.1.0" @@ -1826,6 +2168,59 @@ __metadata: languageName: node linkType: hard +"@razorlabs/m1-wallet-sdk@npm:^0.1.7": + version: 0.1.7 + resolution: "@razorlabs/m1-wallet-sdk@npm:0.1.7" + dependencies: + "@razorlabs/wallet-standard": ^0.2.4 + aptos: ^1.21.0 + buffer: ^6.0.3 + checksum: 622262b0b341d25aac878f42cda5ce26eaec21b0a1976a65f6172ba3e8bceb0a4fa7fd47e80a71a02bf9ebfa3c9e126f6c94854cc7258554c91f946e2937627b + languageName: node + linkType: hard + +"@razorlabs/m2-wallet-sdk@npm:^0.1.3": + version: 0.1.3 + resolution: "@razorlabs/m2-wallet-sdk@npm:0.1.3" + dependencies: + "@mysten/sui.js": ^0.54.1 + "@mysten/wallet-standard": ^0.11.6 + buffer: ^6.0.3 + checksum: f29f2210b5dd8fa0ba70c1d4aa9aa79cc19af062d2b8a08cdcb625ee87f41d85700434415cde4f049a9f701d054ae05250dd70da38ebc346bf4f78fad2704cec + languageName: node + linkType: hard + +"@razorlabs/wallet-kit@npm:^0.2.6": + version: 0.2.6 + resolution: "@razorlabs/wallet-kit@npm:0.2.6" + dependencies: + "@mysten/sui.js": ^0.54.1 + "@mysten/wallet-standard": ^0.11.6 + "@radix-ui/react-dialog": ^1.0.5 + "@razorlabs/m1-wallet-sdk": ^0.1.7 + "@razorlabs/m2-wallet-sdk": ^0.1.3 + "@razorlabs/wallet-standard": ^0.2.4 + "@wallet-standard/core": ^1.0.3 + aptos: ^1.21.0 + classnames: ^2.5.1 + react: ^18.3.1 + react-dom: ^18.3.1 + react-query: ^3.39.3 + react-router-dom: ^6.23.1 + checksum: 3e872f8abfa409f4c4f4405c8e455a346be83521d274d032b66e766ba4ae51822d956f54fd272239d8bd8bd641f3e8017c77ad17960b07dfac65ccb534f6319b + languageName: node + linkType: hard + +"@razorlabs/wallet-standard@npm:^0.2.4": + version: 0.2.4 + resolution: "@razorlabs/wallet-standard@npm:0.2.4" + dependencies: + "@wallet-standard/core": ^1.0.3 + aptos: ^1.21.0 + checksum: ab5ca5b3f40a3dbc0e49046b01d238be799b43ba1940e2e851abfc2bf18311711569688985be6deac0adfd03e117db68b3073b97f48332cd91c85a8d2b377c4d + languageName: node + linkType: hard + "@rc-component/async-validator@npm:^5.0.3": version: 5.0.4 resolution: "@rc-component/async-validator@npm:5.0.4" @@ -2088,7 +2483,7 @@ __metadata: languageName: node linkType: hard -"@scure/bip32@npm:^1.4.0": +"@scure/bip32@npm:^1.3.1, @scure/bip32@npm:^1.4.0": version: 1.4.0 resolution: "@scure/bip32@npm:1.4.0" dependencies: @@ -2109,7 +2504,7 @@ __metadata: languageName: node linkType: hard -"@scure/bip39@npm:^1.3.0": +"@scure/bip39@npm:^1.2.1, @scure/bip39@npm:^1.3.0": version: 1.3.0 resolution: "@scure/bip39@npm:1.3.0" dependencies: @@ -2310,6 +2705,13 @@ __metadata: languageName: node linkType: hard +"@suchipi/femver@npm:^1.0.0": + version: 1.0.0 + resolution: "@suchipi/femver@npm:1.0.0" + checksum: 9764b4aaf93c8b8d1fa0ba07288402cf49bfa0ea8adc0ec6eb866fe98db3d32ddf953bc0dee05e723ed7b417de8db74bace6879db6b014aade5a04a62a40d0c6 + languageName: node + linkType: hard + "@swc/helpers@npm:0.5.2": version: 0.5.2 resolution: "@swc/helpers@npm:0.5.2" @@ -3070,6 +3472,73 @@ __metadata: languageName: node linkType: hard +"@volar/language-core@npm:~2.4.0-alpha.15": + version: 2.4.0-alpha.15 + resolution: "@volar/language-core@npm:2.4.0-alpha.15" + dependencies: + "@volar/source-map": 2.4.0-alpha.15 + checksum: a478a3d35e5aec5d38f008f0eaa6db75013c9511b7861e978dd78b91d395adaeaca0e05f85cdab03c23d6802c1c0cc1b088b1df532e2a3916ebd4746a5803d5d + languageName: node + linkType: hard + +"@volar/source-map@npm:2.4.0-alpha.15": + version: 2.4.0-alpha.15 + resolution: "@volar/source-map@npm:2.4.0-alpha.15" + checksum: fd8f68d99206f75b5b13d32ba1650ba5eea62c75db2dc6436e3eb31b169d90f27eeae8f71c80a4a731b2745917a57af6b7ef58e2f8f293fc2f2d58bc68c3ee18 + languageName: node + linkType: hard + +"@vue/compiler-core@npm:3.4.31": + version: 3.4.31 + resolution: "@vue/compiler-core@npm:3.4.31" + dependencies: + "@babel/parser": ^7.24.7 + "@vue/shared": 3.4.31 + entities: ^4.5.0 + estree-walker: ^2.0.2 + source-map-js: ^1.2.0 + checksum: f3a854d8b4e1415de98967d32e1a831977f3d4b3819a347bc8adfe922ac78b5fe8c3558dd96ff4ac39f9794e0dad9df7068b28c1ab23e850aeeea1c6759150cf + languageName: node + linkType: hard + +"@vue/compiler-dom@npm:^3.4.0, @vue/compiler-dom@npm:^3.4.23": + version: 3.4.31 + resolution: "@vue/compiler-dom@npm:3.4.31" + dependencies: + "@vue/compiler-core": 3.4.31 + "@vue/shared": 3.4.31 + checksum: 432db99196b11891a6aef689f59a56c5a382c05367482609ff6af62ab2c435f280776c725bdc2e5deec67dea8a82c36b5cc8d079786ac46acee8efc99c2daceb + languageName: node + linkType: hard + +"@vue/language-core@npm:^2.0.17": + version: 2.0.26 + resolution: "@vue/language-core@npm:2.0.26" + dependencies: + "@volar/language-core": ~2.4.0-alpha.15 + "@vue/compiler-dom": ^3.4.0 + "@vue/shared": ^3.4.0 + computeds: ^0.0.1 + minimatch: ^9.0.3 + muggle-string: ^0.4.1 + path-browserify: ^1.0.1 + vue-template-compiler: ^2.7.14 + peerDependencies: + typescript: "*" + peerDependenciesMeta: + typescript: + optional: true + checksum: 201b77d8b95051c50637b286f7146d21e88ee644d9032a02a7724f6ab098b8c4e118bdea0a272d64115a892a8217c7aef6077c41b30dbb564f9bd3aee2f691f1 + languageName: node + linkType: hard + +"@vue/shared@npm:3.4.31, @vue/shared@npm:^3.4.0": + version: 3.4.31 + resolution: "@vue/shared@npm:3.4.31" + checksum: 28b452eda16cb7ed63a40cb7892e16bb5a7d855839a7bfca9b5ef70b4e59ceb9938a88db2c3adbff35c602304cd133f1090e0c7f35d10db5d9361a253be2cd2e + languageName: node + linkType: hard + "@wagmi/connectors@npm:5.0.7": version: 5.0.7 resolution: "@wagmi/connectors@npm:5.0.7" @@ -3148,7 +3617,7 @@ __metadata: languageName: node linkType: hard -"@wallet-standard/core@npm:1.0.3": +"@wallet-standard/core@npm:1.0.3, @wallet-standard/core@npm:^1.0.3": version: 1.0.3 resolution: "@wallet-standard/core@npm:1.0.3" dependencies: @@ -3896,6 +4365,15 @@ __metadata: languageName: node linkType: hard +"aria-hidden@npm:^1.1.1": + version: 1.2.4 + resolution: "aria-hidden@npm:1.2.4" + dependencies: + tslib: ^2.0.0 + checksum: 2ac90b70d29c6349d86d90e022cf01f4885f9be193932d943a14127cf28560dd0baf068a6625f084163437a4be0578f513cf7892f4cc63bfe91aa41dce27c6b2 + languageName: node + linkType: hard + "aria-query@npm:^5.1.3": version: 5.3.0 resolution: "aria-query@npm:5.3.0" @@ -4151,6 +4629,13 @@ __metadata: languageName: node linkType: hard +"base-x@npm:^4.0.0": + version: 4.0.0 + resolution: "base-x@npm:4.0.0" + checksum: b25db9e07eb1998472a20557c7f00c797dc0595f79df95155ab74274e7fa98b9f2659b3ee547ac8773666b7f69540656793aeb97ad2b1ceccdb6fa5faaf69ac0 + languageName: node + linkType: hard + "base16@npm:^1.0.0": version: 1.0.0 resolution: "base16@npm:1.0.0" @@ -4165,6 +4650,20 @@ __metadata: languageName: node linkType: hard +"bech32@npm:^2.0.0": + version: 2.0.0 + resolution: "bech32@npm:2.0.0" + checksum: fa15acb270b59aa496734a01f9155677b478987b773bf701f465858bf1606c6a970085babd43d71ce61895f1baa594cb41a2cd1394bd2c6698f03cc2d811300e + languageName: node + linkType: hard + +"big-integer@npm:^1.6.16": + version: 1.6.52 + resolution: "big-integer@npm:1.6.52" + checksum: 6e86885787a20fed96521958ae9086960e4e4b5e74d04f3ef7513d4d0ad631a9f3bde2730fc8aaa4b00419fc865f6ec573e5320234531ef37505da7da192c40b + languageName: node + linkType: hard + "big.js@npm:^5.2.2": version: 5.2.2 resolution: "big.js@npm:5.2.2" @@ -4244,6 +4743,22 @@ __metadata: languageName: node linkType: hard +"broadcast-channel@npm:^3.4.1": + version: 3.7.0 + resolution: "broadcast-channel@npm:3.7.0" + dependencies: + "@babel/runtime": ^7.7.2 + detect-node: ^2.1.0 + js-sha3: 0.8.0 + microseconds: 0.2.0 + nano-time: 1.0.0 + oblivious-set: 1.0.0 + rimraf: 3.0.2 + unload: 2.2.0 + checksum: 803794c48dcce7f03aca69797430bd8b1c4cfd70b7de22079cd89567eeffaa126a1db98c7c2d86af8131d9bb41ed367c0fef96dfb446151c927b831572c621fc + languageName: node + linkType: hard + "brorand@npm:^1.1.0": version: 1.1.0 resolution: "brorand@npm:1.1.0" @@ -4265,6 +4780,15 @@ __metadata: languageName: node linkType: hard +"bs58@npm:^5.0.0": + version: 5.0.0 + resolution: "bs58@npm:5.0.0" + dependencies: + base-x: ^4.0.0 + checksum: 2475cb0684e07077521aac718e604a13e0f891d58cff923d437a2f7e9e28703ab39fce9f84c7c703ab369815a675f11e3bd394d38643bfe8969fbe42e6833d45 + languageName: node + linkType: hard + "buffer-crc32@npm:~0.2.3": version: 0.2.13 resolution: "buffer-crc32@npm:0.2.13" @@ -4693,6 +5217,13 @@ __metadata: languageName: node linkType: hard +"computeds@npm:^0.0.1": + version: 0.0.1 + resolution: "computeds@npm:0.0.1" + checksum: 9d81c5850b7c48072253e15e369f72da22288e9d6a9be32adc2729ba076dddec51078e84e00dae9c567cdb2c6e1dd5981f985561b519976a29f1ecc9869779f2 + languageName: node + linkType: hard + "concat-map@npm:0.0.1": version: 0.0.1 resolution: "concat-map@npm:0.0.1" @@ -4878,6 +5409,13 @@ __metadata: languageName: node linkType: hard +"de-indent@npm:^1.0.2": + version: 1.0.2 + resolution: "de-indent@npm:1.0.2" + checksum: 8deacc0f4a397a4414a0fc4d0034d2b7782e7cb4eaf34943ea47754e08eccf309a0e71fa6f56cc48de429ede999a42d6b4bca761bf91683be0095422dbf24611 + languageName: node + linkType: hard + "debug@npm:4, debug@npm:4.3.4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:~4.3.1, debug@npm:~4.3.2": version: 4.3.4 resolution: "debug@npm:4.3.4" @@ -4938,6 +5476,13 @@ __metadata: languageName: node linkType: hard +"dedent-js@npm:^1.0.1": + version: 1.0.1 + resolution: "dedent-js@npm:1.0.1" + checksum: 3a86f4b11176b387c0633b4b201aef884f9bc83eb9485bd1156c5d9b3984a58fd7686f8213b67212b714a1abf00279bef5cd4eea6a9a7f033e37ce33352af9a9 + languageName: node + linkType: hard + "deep-is@npm:^0.1.3": version: 0.1.4 resolution: "deep-is@npm:0.1.4" @@ -5074,6 +5619,13 @@ __metadata: languageName: node linkType: hard +"detect-node@npm:^2.0.4, detect-node@npm:^2.1.0": + version: 2.1.0 + resolution: "detect-node@npm:2.1.0" + checksum: 832184ec458353e41533ac9c622f16c19f7c02d8b10c303dfd3a756f56be93e903616c0bb2d4226183c9351c15fc0b3dba41a17a2308262afabcfa3776e6ae6e + languageName: node + linkType: hard + "didyoumean@npm:^1.2.2": version: 1.2.2 resolution: "didyoumean@npm:1.2.2" @@ -5287,6 +5839,13 @@ __metadata: languageName: node linkType: hard +"entities@npm:^4.5.0": + version: 4.5.0 + resolution: "entities@npm:4.5.0" + checksum: 853f8ebd5b425d350bffa97dd6958143179a5938352ccae092c62d1267c4e392a039be1bae7d51b6e4ffad25f51f9617531fedf5237f15df302ccfb452cbf2d7 + languageName: node + linkType: hard + "env-paths@npm:^2.2.0": version: 2.2.1 resolution: "env-paths@npm:2.2.1" @@ -5940,7 +6499,7 @@ __metadata: languageName: node linkType: hard -"estree-walker@npm:2.0.2, estree-walker@npm:^2.0.1": +"estree-walker@npm:2.0.2, estree-walker@npm:^2.0.1, estree-walker@npm:^2.0.2": version: 2.0.2 resolution: "estree-walker@npm:2.0.2" checksum: 6151e6f9828abe2259e57f5fd3761335bb0d2ebd76dc1a01048ccee22fabcfef3c0859300f6d83ff0d1927849368775ec5a6d265dde2f6de5a1be1721cd94efc @@ -6798,6 +7357,23 @@ __metadata: languageName: node linkType: hard +"gql.tada@npm:^1.7.0": + version: 1.8.1 + resolution: "gql.tada@npm:1.8.1" + dependencies: + "@0no-co/graphql.web": ^1.0.5 + "@0no-co/graphqlsp": ^1.12.9 + "@gql.tada/cli-utils": 1.5.0 + "@gql.tada/internal": 1.0.3 + peerDependencies: + typescript: ^5.0.0 + bin: + gql-tada: bin/cli.js + gql.tada: bin/cli.js + checksum: 6c50910a9e4da034948b39af25d07e39e63394bc547c968fdb1f22065f4be342849b09bf594aa1a5c26645ca72d07847f9dddbfbec00048d48958ae9f4ebd6da + languageName: node + linkType: hard + "graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" @@ -6823,7 +7399,7 @@ __metadata: languageName: node linkType: hard -"graphql@npm:^16.9.0": +"graphql@npm:^15.5.0 || ^16.0.0 || ^17.0.0, graphql@npm:^16.8.1, graphql@npm:^16.9.0": version: 16.9.0 resolution: "graphql@npm:16.9.0" checksum: 8cb3d54100e9227310383ce7f791ca48d12f15ed9f2021f23f8735f1121aafe4e5e611a853081dd935ce221724ea1ae4638faef5d2921fb1ad7c26b5f46611e9 @@ -6925,6 +7501,15 @@ __metadata: languageName: node linkType: hard +"he@npm:^1.2.0": + version: 1.2.0 + resolution: "he@npm:1.2.0" + bin: + he: bin/he + checksum: 3d4d6babccccd79c5c5a3f929a68af33360d6445587d628087f39a965079d84f18ce9c3d3f917ee1e3978916fc833bb8b29377c3b403f919426f91bc6965e7a7 + languageName: node + linkType: hard + "hey-listen@npm:^1.0.8": version: 1.0.8 resolution: "hey-listen@npm:1.0.8" @@ -8065,6 +8650,15 @@ __metadata: languageName: node linkType: hard +"lower-case@npm:^2.0.2": + version: 2.0.2 + resolution: "lower-case@npm:2.0.2" + dependencies: + tslib: ^2.0.3 + checksum: 83a0a5f159ad7614bee8bf976b96275f3954335a84fad2696927f609ddae902802c4f3312d86668722e668bef41400254807e1d3a7f2e8c3eede79691aa1f010 + languageName: node + linkType: hard + "lowercase-keys@npm:^2.0.0": version: 2.0.0 resolution: "lowercase-keys@npm:2.0.0" @@ -8141,6 +8735,16 @@ __metadata: languageName: node linkType: hard +"match-sorter@npm:^6.0.2": + version: 6.3.4 + resolution: "match-sorter@npm:6.3.4" + dependencies: + "@babel/runtime": ^7.23.8 + remove-accents: 0.5.0 + checksum: 950c1600173a639e216947559a389b64258d52f33aea3a6ddb97500589888b83c976a028f731f40bc08d9d8af20de7916992fabb403f38330183a1df44c7634b + languageName: node + linkType: hard + "media-query-parser@npm:^2.0.2": version: 2.0.2 resolution: "media-query-parser@npm:2.0.2" @@ -8194,6 +8798,13 @@ __metadata: languageName: node linkType: hard +"microseconds@npm:0.2.0": + version: 0.2.0 + resolution: "microseconds@npm:0.2.0" + checksum: 22bfa8553f92c7d95afff6de0aeb2aecf750680d41b8c72b02098ccc5bbbb0a384380ff539292dbd3788f5dfc298682f9d38a2b4c101f5ee2c9471d53934c5fa + languageName: node + linkType: hard + "mime-db@npm:1.52.0": version: 1.52.0 resolution: "mime-db@npm:1.52.0" @@ -8279,6 +8890,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^9.0.3": + version: 9.0.5 + resolution: "minimatch@npm:9.0.5" + dependencies: + brace-expansion: ^2.0.1 + checksum: 2c035575eda1e50623c731ec6c14f65a85296268f749b9337005210bb2b34e2705f8ef1a358b188f69892286ab99dc42c8fb98a57bde55c8d81b3023c19cea28 + languageName: node + linkType: hard + "minimist@npm:^1.2.0, minimist@npm:^1.2.6": version: 1.2.8 resolution: "minimist@npm:1.2.8" @@ -8484,6 +9104,13 @@ __metadata: languageName: node linkType: hard +"muggle-string@npm:^0.4.1": + version: 0.4.1 + resolution: "muggle-string@npm:0.4.1" + checksum: 85fe1766d18d43cf22b6da7d047203a65b2e2b1ccfac505b699c2a459644f95ebb3c854a96db5be559eea0e213f6ee32b986b8c2f73c48e6c89e1fd829616532 + languageName: node + linkType: hard + "multiformats@npm:^9.4.2": version: 9.9.0 resolution: "multiformats@npm:9.9.0" @@ -8502,6 +9129,15 @@ __metadata: languageName: node linkType: hard +"nano-time@npm:1.0.0": + version: 1.0.0 + resolution: "nano-time@npm:1.0.0" + dependencies: + big-integer: ^1.6.16 + checksum: eef8548546cc1020625f8e44751a7263e9eddf0412a6a1a6c80a8d2be2ea7973622804a977cdfe796807b85b20ff6c8ba340e8dd20effcc7078193ed5edbb5d4 + languageName: node + linkType: hard + "nanoid@npm:^3.3.6": version: 3.3.6 resolution: "nanoid@npm:3.3.6" @@ -8606,6 +9242,16 @@ __metadata: languageName: node linkType: hard +"no-case@npm:^3.0.4": + version: 3.0.4 + resolution: "no-case@npm:3.0.4" + dependencies: + lower-case: ^2.0.2 + tslib: ^2.0.3 + checksum: 0b2ebc113dfcf737d48dde49cfebf3ad2d82a8c3188e7100c6f375e30eafbef9e9124aadc3becef237b042fd5eb0aad2fd78669c20972d045bbe7fea8ba0be5c + languageName: node + linkType: hard + "node-addon-api@npm:^2.0.0": version: 2.0.2 resolution: "node-addon-api@npm:2.0.2" @@ -8926,6 +9572,13 @@ __metadata: languageName: node linkType: hard +"oblivious-set@npm:1.0.0": + version: 1.0.0 + resolution: "oblivious-set@npm:1.0.0" + checksum: f31740ea9c3a8242ad2324e4ebb9a35359fbc2e6e7131731a0fc1c8b7b1238eb07e4c8c631a38535243a7b8e3042b7e89f7dc2a95d2989afd6f80bd5793b0aab + languageName: node + linkType: hard + "ofetch@npm:^1.3.3": version: 1.3.3 resolution: "ofetch@npm:1.3.3" @@ -9113,6 +9766,16 @@ __metadata: languageName: node linkType: hard +"pascal-case@npm:^3.1.1": + version: 3.1.2 + resolution: "pascal-case@npm:3.1.2" + dependencies: + no-case: ^3.0.4 + tslib: ^2.0.3 + checksum: ba98bfd595fc91ef3d30f4243b1aee2f6ec41c53b4546bfa3039487c367abaa182471dcfc830a1f9e1a0df00c14a370514fa2b3a1aacc68b15a460c31116873e + languageName: node + linkType: hard + "path-browserify@npm:^1.0.1": version: 1.0.1 resolution: "path-browserify@npm:1.0.1" @@ -10258,6 +10921,18 @@ __metadata: languageName: node linkType: hard +"react-dom@npm:^18.3.1": + version: 18.3.1 + resolution: "react-dom@npm:18.3.1" + dependencies: + loose-envify: ^1.1.0 + scheduler: ^0.23.2 + peerDependencies: + react: ^18.3.1 + checksum: 298954ecd8f78288dcaece05e88b570014d8f6dce5db6f66e6ee91448debeb59dcd31561dddb354eee47e6c1bb234669459060deb238ed0213497146e555a0b9 + languageName: node + linkType: hard + "react-hook-form@npm:^7.52.1": version: 7.52.1 resolution: "react-hook-form@npm:7.52.1" @@ -10328,6 +11003,24 @@ __metadata: languageName: node linkType: hard +"react-query@npm:^3.39.3": + version: 3.39.3 + resolution: "react-query@npm:3.39.3" + dependencies: + "@babel/runtime": ^7.5.5 + broadcast-channel: ^3.4.1 + match-sorter: ^6.0.2 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react-dom: + optional: true + react-native: + optional: true + checksum: d2de6a0992dbf039ff2de564de1ae6361f8ac7310159dae42ec16f833b79c05caedced187235c42373ac331cc5f2fe9e2b31b14ae75a815e86d86e30ca9887ad + languageName: node + linkType: hard + "react-remove-scroll-bar@npm:^2.3.4": version: 2.3.4 resolution: "react-remove-scroll-bar@npm:2.3.4" @@ -10363,7 +11056,7 @@ __metadata: languageName: node linkType: hard -"react-router-dom@npm:^6.24.1": +"react-router-dom@npm:^6.23.1, react-router-dom@npm:^6.24.1": version: 6.24.1 resolution: "react-router-dom@npm:6.24.1" dependencies: @@ -10426,6 +11119,15 @@ __metadata: languageName: node linkType: hard +"react@npm:^18.3.1": + version: 18.3.1 + resolution: "react@npm:18.3.1" + dependencies: + loose-envify: ^1.1.0 + checksum: a27bcfa8ff7c15a1e50244ad0d0c1cb2ad4375eeffefd266a64889beea6f6b64c4966c9b37d14ee32d6c9fcd5aa6ba183b6988167ab4d127d13e7cb5b386a376 + languageName: node + linkType: hard + "read-cache@npm:^1.0.0": version: 1.0.0 resolution: "read-cache@npm:1.0.0" @@ -10562,6 +11264,13 @@ __metadata: languageName: node linkType: hard +"remove-accents@npm:0.5.0": + version: 0.5.0 + resolution: "remove-accents@npm:0.5.0" + checksum: 7045b37015acb03df406d21f9cbe93c3fcf2034189f5d2e33b1dace9c7d6bdcd839929905ced21a5d76c58553557e1a42651930728702312a5774179d5b9147b + languageName: node + linkType: hard + "require-directory@npm:^2.1.1": version: 2.1.1 resolution: "require-directory@npm:2.1.1" @@ -10717,7 +11426,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.2": +"rimraf@npm:3.0.2, rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: @@ -10811,6 +11520,7 @@ __metadata: version: 0.0.0-use.local resolution: "scaffold-move@workspace:." dependencies: + "@razorlabs/wallet-kit": ^0.2.6 "@types/js-yaml": ^4 aptos: ^1.21.0 husky: ^8.0.1 @@ -10828,6 +11538,15 @@ __metadata: languageName: node linkType: hard +"scheduler@npm:^0.23.2": + version: 0.23.2 + resolution: "scheduler@npm:0.23.2" + dependencies: + loose-envify: ^1.1.0 + checksum: 3e82d1f419e240ef6219d794ff29c7ee415fbdc19e038f680a10c067108e06284f1847450a210b29bbaf97b9d8a97ced5f624c31c681248ac84c80d56ad5a2c4 + languageName: node + linkType: hard + "scroll-into-view-if-needed@npm:^3.1.0": version: 3.1.0 resolution: "scroll-into-view-if-needed@npm:3.1.0" @@ -11055,6 +11774,13 @@ __metadata: languageName: node linkType: hard +"source-map-js@npm:^1.2.0": + version: 1.2.0 + resolution: "source-map-js@npm:1.2.0" + checksum: 791a43306d9223792e84293b00458bf102a8946e7188f3db0e4e22d8d530b5f80a4ce468eb5ec0bf585443ad55ebbd630bf379c98db0b1f317fd902500217f97 + languageName: node + linkType: hard + "source-map@npm:^0.5.0": version: 0.5.7 resolution: "source-map@npm:0.5.7" @@ -11384,6 +12110,19 @@ __metadata: languageName: node linkType: hard +"svelte2tsx@npm:^0.7.6": + version: 0.7.13 + resolution: "svelte2tsx@npm:0.7.13" + dependencies: + dedent-js: ^1.0.1 + pascal-case: ^3.1.1 + peerDependencies: + svelte: ^3.55 || ^4.0.0-next.0 || ^4.0 || ^5.0.0-next.0 + typescript: ^4.9.4 || ^5.0.0 + checksum: cfc8476be6546cdee70c376d87feebbcd0c44342d27e5660ba8af076e1b23a83e162ed56b13d29d9c3d2f7972f1ac4bf505a691ef68a7de37198e57bc5c2300a + languageName: node + linkType: hard + "symbol-observable@npm:^4.0.0": version: 4.0.0 resolution: "symbol-observable@npm:4.0.0" @@ -11693,7 +12432,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.3.0, tslib@npm:^2.6.2": +"tslib@npm:^2.0.3, tslib@npm:^2.3.0, tslib@npm:^2.6.2": version: 2.6.3 resolution: "tslib@npm:2.6.3" checksum: 74fce0e100f1ebd95b8995fbbd0e6c91bdd8f4c35c00d4da62e285a3363aaa534de40a80db30ecfd388ed7c313c42d930ee0eaf108e8114214b180eec3dbe6f5 @@ -11961,6 +12700,16 @@ __metadata: languageName: node linkType: hard +"unload@npm:2.2.0": + version: 2.2.0 + resolution: "unload@npm:2.2.0" + dependencies: + "@babel/runtime": ^7.6.2 + detect-node: ^2.0.4 + checksum: 88ba950c5ff83ab4f9bbd8f63bbf19ba09687ed3c434efd43b7338cc595bc574df8f9b155ee6eee7a435de3d3a4a226726988428977a68ba4907045f1fac5d41 + languageName: node + linkType: hard + "unpipe@npm:1.0.0": version: 1.0.0 resolution: "unpipe@npm:1.0.0" @@ -12353,6 +13102,16 @@ __metadata: languageName: node linkType: hard +"vue-template-compiler@npm:^2.7.14": + version: 2.7.16 + resolution: "vue-template-compiler@npm:2.7.16" + dependencies: + de-indent: ^1.0.2 + he: ^1.2.0 + checksum: a0d52ecbb99bad37f370341b5c594c5caa1f72b15b3f225148ef378fc06aa25c93185ef061f7e6e5e443c9067e70d8f158742716112acf84088932ebcc49ad10 + languageName: node + linkType: hard + "wagmi@npm:2.9.8": version: 2.9.8 resolution: "wagmi@npm:2.9.8"