Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: polkadot extension detection, #1063 #1068

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"@osn/polkadot-react-identicon": "^1.0.10",
"@osn/previewer": "^1.4.4",
"@osn/rich-text-editor": "^0.6.6",
"@polkadot/extension-dapp": "^0.52.3",
"@polkadot/util": "^13.0.2",
"@polkadot/util-crypto": "^13.0.2",
"@polkadot/extension-dapp": "^0.56.2",
"@polkadot/util": "^13.2.3",
"@polkadot/util-crypto": "^13.2.3",
"@reduxjs/toolkit": "^1.6.1",
"@svgr/webpack": "^6.3.1",
"bignumber.js": "^9.0.1",
Expand Down
10 changes: 5 additions & 5 deletions next/services/chainApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ async function singByMetaMask(text, address) {
}

export const signMessage = async (text, address) => {
if (!address) {
throw new Error("Sign address is missing");
}

if (ethers.utils.isAddress(address)) {
return singByMetaMask(text, address);
}

await web3Enable("opensquare.io");
if (!isWeb3Injected) {
throw new Error("Polkadot Extension is not installed");
}

if (!address) {
throw new Error("Sign addres is missing");
}

await web3Enable("opensquare.io");
const injector = await web3FromAddress(address);

const data = stringToHex(text);
Expand Down
Loading
Loading