Skip to content

Commit

Permalink
Update Add Operation button + website title + undo auto add secret ke…
Browse files Browse the repository at this point in the history
…y field + secret key error message (#1127)

* Update Add Operation button to tertiary variant

* Update website title

* Undo auto adding secret key fields

* Update secret key error message
  • Loading branch information
quietbits authored Nov 4, 2024
1 parent e648d73 commit 1a1c7a8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ export const Operations = () => {
<Box gap="sm" direction="row" align="center">
<Button
size="md"
variant="secondary"
variant="tertiary"
icon={<Icon.PlusCircle />}
onClick={() => {
updateOptionParamAndError({
Expand Down
2 changes: 0 additions & 2 deletions src/app/(sidebar)/transaction/sign/components/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,6 @@ export const Overview = () => {
validate={validate.getSecretKeyError}
placeholder="Secret key (starting with S) or hash preimage (in hex)"
autocomplete="off"
useAutoAdd
note="Paste a secret key to add an additional signer"
isPassword
/>
<SignTxButton
Expand Down
3 changes: 1 addition & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import "@/styles/globals.scss";
export const dynamic = "force-dynamic";

export const metadata: Metadata = {
title:
"Explore Stellar Lab: Tools, Learning, and Developer Resources for the Stellar Network",
title: "Stellar Lab",
description:
"Explore Stellar Lab: Build, sign, and submit transactions. Access tools, Stellar RPC, Horizon, and more. Enhance your skills with Stellar Quest.",
};
Expand Down
10 changes: 2 additions & 8 deletions src/validate/methods/getSecretKeyError.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import { StrKey } from "@stellar/stellar-sdk";

export const getSecretKeyError = (value: string) => {
if (value.startsWith("S")) {
if (!StrKey.isValidEd25519SecretSeed(value)) {
return "Invalid secret key.";
}
} else {
if (!value.match(/^[0-9a-f]{2,128}$/gi) || value.length % 2 == 1) {
return `Invalid hex value. Please provide up to 64 bytes in hexadecimal format.`;
}
if (!StrKey.isValidEd25519SecretSeed(value)) {
return "Invalid secret key. Please check your secret key and try again.";
}

return false;
Expand Down

0 comments on commit 1a1c7a8

Please sign in to comment.