diff --git a/src/app/(sidebar)/explore-endpoints/[[...pages]]/page.tsx b/src/app/(sidebar)/explore-endpoints/[[...pages]]/page.tsx index 122b7171..9cfbda13 100644 --- a/src/app/(sidebar)/explore-endpoints/[[...pages]]/page.tsx +++ b/src/app/(sidebar)/explore-endpoints/[[...pages]]/page.tsx @@ -46,6 +46,8 @@ export default function ExploreEndpoints() { .find((page) => pathname.includes(page.route)) ?.nestedItems?.find((i) => i.route === pathname); + console.log("page: ", page); + const pageData = page?.form; const requiredFields = sanitizeArray( pageData?.requiredParams?.split(",") || [], diff --git a/src/app/(sidebar)/transaction/sign/page.tsx b/src/app/(sidebar)/transaction/sign/page.tsx index 3a2d7454..b322b008 100644 --- a/src/app/(sidebar)/transaction/sign/page.tsx +++ b/src/app/(sidebar)/transaction/sign/page.tsx @@ -3,41 +3,30 @@ import { useState } from "react"; import { Alert, Card, Icon, Text, Button } from "@stellar/design-system"; -import { useStore } from "@/store/useStore"; - -import { ExpandBox } from "@/components/ExpandBox"; -import { PubKeyPicker } from "@/components/FormElements/PubKeyPicker"; -import { MuxedAccountResult } from "@/components/MuxedAccountResult"; -import { SdsLink } from "@/components/SdsLink"; - -import { muxedAccount } from "@/helpers/muxedAccount"; - import { XdrPicker } from "@/components/FormElements/XdrPicker"; - import { validate } from "@/validate"; -import { collapseTextChangeRangesAcrossMultipleVersions } from "typescript"; -import { unescape } from "querystring"; export default function SignTransaction() { const [txInput, setTxInput] = useState(""); const [isTxValid, setIsTxValid] = useState(undefined); - - const [muxedFieldError, setMuxedFieldError] = useState(""); - const [sdkError, setSdkError] = useState(""); + const [txError, setTxError] = useState(""); const onChange = (value: string) => { + setTxError(""); setTxInput(value); - const isValid = Boolean(validate.xdr(txInput)); - - console.log("**LOG** validate.xdr(txInput): ", validate.xdr(txInput)); - console.log("**LOG** isValid: ", isValid); + if (value.length > 0) { + const validatedXDR = validate.xdr(value); - setIsTxValid(isValid); + if (validatedXDR.result === "success") { + setIsTxValid(true); + } else if (validatedXDR.result === "error") { + setIsTxValid(false); + setTxError(validatedXDR.message); + } + } }; - console.log("**LOG** txInput: ", txInput); - return (
@@ -53,13 +42,13 @@ export default function SignTransaction() { } value={txInput || ""} - error={sdkError} + error={txError} onChange={(e) => onChange(e.target.value)} />