DappConnect
Methods
| name | type | Parameters Description | response |
|---|---|---|---|
| constructor | function | 1. DappConnectInitParams 2. callback | DappConnect Client |
| init | function | none | Promise: void |
| getConnectLink | function | none | string for web3mqDeepLink |
| sendSign | function | DappConnectSignParams | Promise: void |
Methods
constructor
Init DappConnect client
import { DappConnect, DappConnectCallbackParams } from "@web3mq/dapp-connect";
const handleDappConnectCallback = (event: DappConnectCallbackParams) => {};
const dappConnectClient = new DappConnect(
{ dAppID: "SwapChat:im" },
handleDappConnectCallback
);
console.log("the dapp-connect client: ", dappConnectClient);
getConnectLink()
Create wallet connect deep link
const deepLink = dappConnectClient.getConnectLink();
console.log(deepLink);
sendSign()
tip
After calling the sendsign method, the signature result will not be received directly, but will be returned via a callback function
await dappConnectClient.sendSign({
signContent: "test sign out",
address: walletAddress || "",
});