Usage
How to use NEOPIN Connect Web
The following information is deprecated and may limit its use. Please refer to the WalletConnect 2.0 tab for the latest version of NEOPIN wallet integration: WalletConnect 2.0
Initiate Connection
Create a connector by putting the wallet connect bridge URL as 'bridge' props and attach an event to the connector.
import NeopinConnect from "nptconnect-client";
import QRCodeModal from "nptconnect-qrcode-modal";
// Create a connector object.
const connector = new NeopinConnect({
bridge: "https://bridge.walletconnect.org", // Required
qrcodeModal: QRCodeModal
});
// Session created after connection. > Open the QRCodeModal passed to the connector param.
if (!connector.connected) {
connector.createSession();
}
const { accounts, chainId } = await connector.connect();After a connection is established (asynchronous), events are registered in the connector.
Get Account / Get ChainId
Accounts and chainID in the connector drop their values when they connect to the bridge server.
PeerMeta (Client Meta Data)
You can customize PeerMeta (ClientMeta) data. The appID of PeerMeta data is issued when registering an affiliate, and the issued appID value must be used.
Send Transaction (eth_sendTransaction)
This is a method that creates and sends a transaction. This is a method that can be executed when there is a value in the accounts of the connector (when a connection is established).
Sign Transaction (eth_signTransaction)
Last updated