Usage

How to use NEOPIN Connect Web

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