我正试图在NextJS应用程序和我的Algorand钱包(Pera)之间使用WalletConnect建立一个有效的连接。我可以连接,但是NextJS应用程序不会发送任何像dApp名称这样的元数据。我的密码有什么问题吗?
import WalletConnect from "@walletconnect/client";
import QRCodeModal from "algorand-walletconnect-qrcode-modal";
export default function Index(props) {
// Create a connector
const connector = new WalletConnect({
bridge: "https://bridge.walletconnect.org", // Required
qrcodeModal: QRCodeModal,
clientMeta: {
description: "WalletConnect NodeJS Client",
url: "https://nodejs.org/en/",
icons: ["https://nodejs.org/static/images/logo.svg"],
name: "WalletConnect"
}
});
// Create a function to connect
let connectWallet = () => {
if (!connector.connected) {
connector.createSession()
}
// ... Event subscriptions down here ...
}我从一个简单的connectWallet函数中调用onClick函数
return (
<div>
{/* Add button to call connectWallet */}
<button onClick={() => connectWallet()}>Connect Wallet</button>
</div>
);据我所知,它应该显示我发送给connector的connector数据,但它只显示空字符串,在Pera钱包应用程序上没有图像。
发布于 2022-06-08 21:07:54
Pera的WalletConnect文档似乎并不表示对clientMeta的支持。见https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0025.md和https://developer.algorand.org/docs/get-details/walletconnect/
但是,它仍然应该显示正确的URL。您可以将您看到的内容与https://algorand.github.io/walletconnect-example-dapp/ (显示https://algorand.github.io URL )进行比较。
小提示:通常,您可以通过在https://forum.algorand.org上发布与Algorand相关的问题来获得更快的答案。
https://stackoverflow.com/questions/72449743
复制相似问题