Skip to content

Commit

Permalink
chore: update code
Browse files Browse the repository at this point in the history
  • Loading branch information
camewell071 committed Jan 15, 2024
1 parent 060a151 commit 71b02dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/components/ConnectModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const ConnectModal = React.memo(({ isShow, onHide }: IProps)=> {
await signMessage(type);
dispatch(requestReload())
onHide()
toast.success("Successfully.")
} catch (error) {
const { message } = getError(error);
toast.error(message)
Expand Down
3 changes: 3 additions & 0 deletions src/hooks/useConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { verifySignature } from '@/services/whitelist';
import { AddressType, getAddressInfo } from 'bitcoin-address-validation';
import messageVerifier from '@/utils/message.verifier';
import AllowListStorage from '@/utils/storage/allowlist.storage';
import toast from 'react-hot-toast';

const MESSAGE_FOR_SIGN = (address: string) => {
return `Bitcoin Virtual Machine (BVM) is requesting you to sign this message with your Bitcoin wallet ${address}. By clicking "Sign" or "Approve," you are verifying that you are the rightful owner of the wallet. Please note that this action is only for authentication purposes and will not initiate any blockchain transactions, nor will it incur any network or gas fees.`
Expand Down Expand Up @@ -69,6 +70,7 @@ const useConnect = () => {
message,
signature
});
toast.success("Successfully.")
await AllowListStorage.setStorage({
address: params.address,
pubKey: params.pubKey,
Expand Down Expand Up @@ -116,6 +118,7 @@ const useConnect = () => {
const { message } = getError(errors[0]);
throw new Error(message)
}
toast.success("Successfully.")
}

const signMessage = async (type: WalletType) => {
Expand Down

0 comments on commit 71b02dd

Please sign in to comment.