✅ Hashconnect

What is the Hashconnect?

We support the Hashconnect, a tool that facilitates communication between Dapps and wallets using the Hedera. You can find more details on the following link.

Pair the Hashconnect

If you pair the Hashconnect, you can connect the wallet to the dapp.

face.hedera.getHashConnect().init() initializes the Hashconnect in the Face Wallet SDK and establishes a connection with the Hashconnect relay server.

face.hedera.getHashConnect().pair(pairingString) connects the Hashconnect to the wallet using the pairing string generated in the Dapp.

import { Face, Network } from '@haechi-labs/face-sdk';
import { HashConnect, HashConnectTypes } from 'hashconnect';

const metadata: HashConnectTypes.AppMetadata = {
     name: 'Face Wallet Sample Dapp',
     description: 'for face wallet test',
     icon: 'https://my.facewallet.xyz/icon',

// init hashconnect on dapp and wallet
const initData = await hashConnect.init(metadata, 'testnet', true);
await face.hedera.getHashConnect().init();

// connect dapp and wallet
const pairingString = hashConnect.generatePairingString(initData.topic, 'testnet', false);
const pairData = await face.hedera.getHashConnect().pair(pairingString);

// {
//    "accountId": "0.0.num" or "0.0.evmAddress",
//    "topic" : ${topic}
// }

Send Transaction (Sign Transaction and Delegate Tx Fee)

You can sign the transaction to be requested using the Hashconnect.

success parameter of the signed transaction object means that the signing and sending the transaction has been failed. If success is false, the account accountToSign is different with the wallet's account. Or it means that user's account has not been created yet.

If the user's account has not been created yet, the error will include NOT_CREATED_ACCOUNT.

import { Face, Network } from '@haechi-labs/face-sdk';
import { HashConnect, HashConnectTypes } from 'hashconnect';
import {
} from '@hashgraph/sdk';

const payerPK = `PAYER_PK`; 
const payerId = 'PAYER_ID';

const client = Client.(forTestnet() | forMainnet())
.setOperator(payerId, payerPK);

const account = await face.hedera.getAccountId();

const transaction = await new TransferTransaction()
  		.addNftTransfer(tokenId, tokenNum, account, receiver)
  |  await new TransferTransaction()
      .addHbarTransfer(account, -0.1)
      .addHbarTransfer(receiver, 0.1)
	|  await new TokenAssociateTransaction()

const signed = await hashConnect.sendTransaction(topic, {
  byteArray: transaction.toBytes(),
  metadata: {
    accountToSign: account,
    returnTransaction: true,

if (!signed.success) {
  console.log(`Hedera Signed Fail ${signed.error}`);

const signedTransaction = Transaction.fromBytes(signed.signedTransaction as Uint8Array);
const result = await signedTransaction.execute(client);