Skip to content

Commit

Permalink
Remove debug
Browse files Browse the repository at this point in the history
  • Loading branch information
broody committed Sep 6, 2024
1 parent e3bdd4e commit 0a28af1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 35 deletions.
23 changes: 5 additions & 18 deletions packages/keychain/src/components/connect/Signup/Argent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,21 +149,9 @@ function SignupArgentInner({ username }: { username: string }) {
const buffer = base64url.toBuffer(challenge);
const high = "0x" + buffer.subarray(0, 16).toString("hex");
const low = "0x" + buffer.subarray(16, 32).toString("hex");
console.log({ high, low });
console.log({ challenge: "0x" + buffer.toString("hex") });

const typedData = registerTypedData(username, { low, high }, chainId);

const hash = await extAccount.hashMessage(typedData);
console.log({ hash });

const sig = await extAccount.signMessage(typedData);
const finalizeMutation = await finalizeAccountSignup(
extAccount.address,
chainId,
sig as string[],
);
console.log({ finalizeMutation });
await finalizeAccountSignup(extAccount.address, chainId, sig as string[]);

// set controller address & calldata
const salt = shortString.encodeShortString(username);
Expand Down Expand Up @@ -283,7 +271,7 @@ function SignupArgentInner({ username }: { username: string }) {
break;
}
}
});
}, [state, username, setTitle]);

return (
<Container
Expand Down Expand Up @@ -419,9 +407,8 @@ function SignupArgentInner({ username }: { username: string }) {
<Button
colorScheme="colorful"
onClick={() => {

console.log("deploy");
onDeploy()
onDeploy();
}}
isLoading={isDeploying}
isDisabled={!(isAllFunded && isChecked && extAccount)}
Expand Down Expand Up @@ -455,7 +442,7 @@ function ExternalWalletProvider({ children }: PropsWithChildren) {
function useTokens() {
const { account: extAccount } = useAccount();
const { provider } = useProvider();
const { controller, prefunds } = useConnection();
const { prefunds } = useConnection();
const [tokens, setTokens] = useState<TokenInfo[]>([]);
const [isChecked, setIsChecked] = useState(false);
const [isFetching, setIsFetching] = useState(true);
Expand All @@ -476,7 +463,7 @@ function useTokens() {
if (!isChecked) {
setIsChecked(true);
}
}, [tokens, controller, isChecked, extAccount?.address, provider]);
}, [tokens, isChecked, extAccount?.address, provider]);

useInterval(checkFunds, 3000);

Expand Down
34 changes: 17 additions & 17 deletions packages/keychain/src/components/connect/Signup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export function Signup({
}: SignupProps) {
const theme = useControllerTheme();
const { chainId, rpcUrl, setController } = useConnection();
console.log({ chainId, rpcUrl });
const [error, setError] = useState<Error>();
const [isRegistering, setIsRegistering] = useState(false);
const [isPopup, setIsPopup] = useState(false);
Expand Down Expand Up @@ -242,22 +241,23 @@ export function Signup({
>
sign up
</Button>
{document.cookie.includes("argent") && (
// {typeof window !== "undefined" && window["starknet_argentX"] && (
<Button
colorScheme="colorful"
isLoading={isRegistering}
isDisabled={
debouncing ||
!username ||
isValidating ||
!!usernameField.error
}
onClick={() => setSignupMethod(SignupMethod.ARGENT)}
>
<ArgentIcon />
</Button>
)}
{typeof window !== "undefined" &&
window["starknet_argentX"] &&
window.document.cookie.includes("argent") && (
<Button
colorScheme="colorful"
isLoading={isRegistering}
isDisabled={
debouncing ||
!username ||
isValidating ||
!!usernameField.error
}
onClick={() => setSignupMethod(SignupMethod.ARGENT)}
>
<ArgentIcon />
</Button>
)}
</HStack>
<RegistrationLink
description="Already have a Controller?"
Expand Down

0 comments on commit 0a28af1

Please sign in to comment.