Git Product home page Git Product logo

hashconnect's Introduction

HashConnect

HashConnect v3 is public beta. API's may change or be unstable.

For v2 docs go here

Join the Hedera Developer Guild Discord

Hashconnect is a helper library around the Hedera WalletConnect standard, allowing dapps to easily integrate with a variety of wallets.

The provided demo demonstrates the pairing and signing functionality.

Example React Integration

Project ID

Before doing anything you will need a WalletConnect project ID. You can get one by going to WalletConnect Cloud and setting up a project.

Quick Start

This is what you need to start using HashConnect, it will be explained in detail in the subsequent documentation.

import { HashConnect, HashConnectConnectionState, SessionData } from 'hashconnect';
import { LedgerId } from '@hashgraph/sdk';

const appMetadata = {
    name: "<Your dapp name>",
    description: "<Your dapp description>",
    icons: ["<Image url>"],
    url: "<Dapp url>"
}

let hashconnect: HashConnect;
let state: HashConnectConnectionState = HashConnectConnectionState.Disconnected;
let pairingData: SessionData;

async init() {
    //create the hashconnect instance
    hashconnect = new HashConnect(LedgerId.MAINNET, "<Your project ID>", appMetadata, true);

    //register events
    setUpHashConnectEvents();

    //initialize
    await hashconnect.init();

    //open pairing modal
    hashconnect.openPairingModal();
}

setUpHashConnectEvents() {
    hashconnect.pairingEvent.on((newPairing) => {
        pairingData = newPairing;
    })

    hashconnect.disconnectionEvent.on((data) => {
        pairingData = null;
    });

    hashconnect.connectionStatusChangeEvent.on((connectionStatus) => {
        state = connectionStatus;
    })
}

sendTransaction(accountId: string, transaction: Transaction) {
    hashconnect.sendTransaction(accountId, transaction).then(response => {
        //handle success
    }).catch(err => {
        //handle error
    })
}

Concepts

The main functionality of Hashconnect is to send Hedera transactions to a wallet to be signed and executed by a user - we assume you are familiar with the Hedera API's and SDK's used to build these transactions.

HashConnect also providers other sorts of helpers, like user profile fetching and token gating.

Usage

Installation

npm i hashconnect --save

Initialization

Import the library like you would any npm package

import { HashConnect } from 'hashconnect';

Create a metadata object that contains information about your dapp.

const appMetadata = {
    name: "<Your dapp name>",
    description: "<Your dapp description>",
    icons: ["<Image url>"],
    url: "<Dapp url>"
}

Create a variable to hold an instance of Hashconnect, and pass in the network, project id, metadata, and a boolean to enable debug mode.

let hashconnect = new HashConnect(LedgerId.MAINNET, "<Your project ID>", appMetadata, true);

Note: The LedgerId is from the HashGraph SDK, which you can import by doing this:

import { LedgerId } from '@hashgraph/sdk';

Setup

After creating the HashConnect object, set up events, and then call the init function with your parameters.

//register events
setUpHashConnectEvents();

//initialize and use returned data
let initData = await hashconnect.init();

Make sure you register your events before calling init - as some events will fire immediately after calling init.

Get Signer

Pass the accountId of a paired account to get a signer back, this allows you to interact with HashConnect using a simpler API.

signer = hashconnect.getSigner(AccountId.fromString('0.0.12345'));

Usage

const signer = hashconnect.getSigner(fromAccount);

let trans = await new TransferTransaction()
    .addHbarTransfer(fromAccount, -1)
    .addHbarTransfer(toAccount, 1)
    .freezeWithSigner(signer);

let response = await trans.executeWithSigner(signer);

Events

Events are emitted by HashConnect to let you know when a request has been fufilled.

Pairing Event

The pairing event is triggered when a user accepts a pairing or an existing pairing is found.

hashconnect.pairingEvent.on((pairingData) => {
    //do something
})

Disconnect Event

When a user disconnects this event will be triggered so you can update the state of your dapp.

hashconnect.disconnectionEvent.on((data) => {
    //do something
});

Connection Status Change

This event is fired when the connection status changes. This returns a HashConnectConnectionState (details)

hashconnect.connectionStatusChangeEvent.on((connectionStatus) => {
    //do something with connection status
})

Pairing

You can easily show a pairing popup containing the pairing code and a QR code by calling openPairingModal().

hashconnect.openPairingModal();

There are a variety of optional theme properties you can pass into openPairingModal() to customize it:

  • themeMode - "dark" | "light"
  • backgroundColor - string (hex color)
  • accentColor - string (hex color)
  • accentFillColor - string (hex color)
  • borderRadius - string (css border radius)

Pairing to extension

If the HashPack extension is found during init, it will automatically pop it up and request pairing.

Disconnecting

Call hashconnect.disconnect() to disconnect.

Sending Requests

Send Transaction

This request takes two parameters, accountId and a Hedera Transaction, signs it with the specified account ID, and executes it.

let response = await hashconnect.sendTransaction(accountId, transaction);

With Signer:

let signer = hashconnect.getSigner(accountId);

let trans = await new TransferTransaction()
    .addHbarTransfer(fromAccount, -1)
    .addHbarTransfer(toAccount, 1)
    .freezeWithSigner(signer);

let response = await trans.executeWithSigner(signer);

Sign and Return

This request takes two parameters, accountId and a Hedera Transaction, signs it with the specified account ID, and returns a signed transaction that you can execute or send to other users for additional signatures.

let response = await hashconnect.signAndReturnTransaction(accountId, transaction);

With Signer:

let signer = hashconnect.getSigner(accountId);

let trans = await new TransferTransaction()
    .addHbarTransfer(fromAccount, -1)
    .addHbarTransfer(toAccount, 1)
    .freezeWithSigner(signer);

let response = await trans.signTransaction(signer);

Sign Message

This request allows you to get a signature on a generic string, which can be used for things like authentication.

let signature = await hashconnect.signMessages(accountId, message);

With Signer:

let signer = hashconnect.getSigner(accountId);
let signature = await signer.sign(["Hello World!"]);

Verify Signature

Once you've got the result you can call .verifyMessageSignature() to verify it was signed by the correct account. Please note - you will need to get the public key from a mirror node as you cannot trust the public key being returned by the user for verification purposes. You will also likely want to verify it server side.

This method will return a boolean if the signature matches the public key.

let verified = hashconnect.verifyMessageSignature("Hello World!", signMessageResponse, publicKey);

In order to prevent messages from secretly being transactions, there is a bit of manipulation happening to the messages. If you are attempting to verify a signature yourlsef, on the backend for example, you will need to run the message you are verifying through this function first and then verify the result against the signature:

prefixMessageToSign(message: string) {
    return '\x19Hedera Signed Message:\n' + message.length + message
}

Transaction Receipts

The HashConnect .sendTransaction() method will automatically retrieve and return a receipt, however when using the signer flow there is one extra step to getting a receipt:

With Signer:

let response = await trans.executeWithSigner(signer);
let receipt = await response.getReceiptWithSigner(signer);

Types

HashConnectConnectionState
export enum HashConnectConnectionState {
    Connecting="Connecting",
    Connected="Connected",
    Disconnected="Disconnected",
    Paired="Paired"
}
SessionData
export interface SessionData {
  metadata: {
    name: string;
    description: string;
    url: string;
    icons: string[];
  };
  accountIds: string[];
  network: string;
}

hashconnect's People

Contributors

chad-schwab avatar dependabot[bot] avatar rocketmay avatar srokatonie avatar teacoat avatar vhscom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hashconnect's Issues

React Demo is using outdated version - Example app also uses outdated version

In the README there is a link to an example React Integration - I tried using this code not realizing this code is outdated and different from what you install using npm i hashconnect - Either please update README to reflect this or remove the link as it's using an outdated version of the package. The version being used is 0.1.10 when the current version is 0.2.4

Also the example Angular app within the repo doesn't use the latest build from the library - This is a bug instead of hardcoding the version of hashconnect in the package.json which is 0.2.3 it should reflect the latest build version. You can easily do this by just running the build script in the lib directory and have all your examples use the latest build version.

The example app and the current demo page - https://hashpack.github.io/hashconnect/
have a bug when your hashpack wallet has multiple accounts - it seems to be fixed when upgrading your version to 0.2.4

Screenshot 2023-02-22 at 11 57 00 AM

Wallet unsubscribed event

In the case of removing a pairing from a wallet, an event should be sent to dapps informing them that the wallet is no longer subscribed to the topic and to handle appropriately

Recover DAPP pairing

A Dapp pairing might be lost if the saved pairing key gets cleared. Which might happen due to local storage not being present.

Currently a user has to reconnect an app and the the connection appears multiple times in the wallet.
It would be great if an entry could be overwritten by an app to request new keys, this way no additional user action would need to be taken.


Performing a replacement solely on metadata is not secure as anyone could take over the pairing.

This could be implemented by having a dapp generate a secret global key pair server side. The public key gets submitted in the init request and upon trying to reclaim the connection either a challenge can be solved or a simple signed timestamp would be enough to prove ownership.


Considerations: wallets to be used on multiple devices at the same time.

Random TransferTransaction failures (Crash in Hedera JS SDK & HashPack)

Main error (Hedera JS SDK)

Moved Hedera JS SDK Bug to hashgraph/hedera-sdk-js#962

Secondary Error (HashPack)

Separate to this but relevant, there is another error in the catch statement.

The main error is caught but the catch throws another error when trying to call _this2.transferSpinner.showFailure();

vendor.6adfe5d1bcb3c66e.js:319543 ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'showFailure')

Location

doSigning(transaction, privateKey)
โ€ฆ
try
}).catch(res => {
    console.log("transfer error", res);
    _this2.transferError = true;
    _this2.transferErrorMessage = res; // this.AnalyticsService.trackException("send_transaction", res, false);

    _this2.transferSpinner.showFailure();

    let errResonse = {
    topic: _this2.currentMessage.topic,
    success: false,
    error: res.status.toString()
    };

    _this2.transactionResponseFunction(errResonse);
});

Full Debug Logs

main.c205bbaa12d1d9a3.js:23475 Getting nft metadata...
2main.c205bbaa12d1d9a3.js:22906 restarting lock timer
main.c205bbaa12d1d9a3.js:20879 App recieved message
main.c205bbaa12d1d9a3.js:20880 Object
main.c205bbaa12d1d9a3.js:5148 Array(1)
main.c205bbaa12d1d9a3.js:20912 subscribing: 3a028676-fdfd-4570-b36f-8e91e8c5fb80
vendor.6adfe5d1bcb3c66e.js:64144 hashconnect - Pairing to DPub
vendor.6adfe5d1bcb3c66e.js:64615 hashconnect - Subscribing to topic id 3a028676-fdfd-4570-b36f-8e91e8c5fb80
vendor.6adfe5d1bcb3c66e.js:64440 hashconnect - Sending message - id: d423651d-6e57-47df-8de9-296f53f06d07
vendor.6adfe5d1bcb3c66e.js:64652 hashconnect - Sending payload to 3a028676-fdfd-4570-b36f-8e91e8c5fb80 
 encrypted with c09d17c2-8eaa-4e0b-9e4d-95540f08a049
vendor.6adfe5d1bcb3c66e.js:64594 hashconnect - emitting payload
vendor.6adfe5d1bcb3c66e.js:64451 hashconnect - decoding message payload
vendor.6adfe5d1bcb3c66e.js:64336 hashconnect - Message Received of type Acknowledge, sent at 1645301876365 Object
vendor.6adfe5d1bcb3c66e.js:64352 hashconnect - acknowledged - id: d423651d-6e57-47df-8de9-296f53f06d07
vendor.6adfe5d1bcb3c66e.js:64594 hashconnect - emitting payload
vendor.6adfe5d1bcb3c66e.js:64451 hashconnect - decoding message payload
vendor.6adfe5d1bcb3c66e.js:64336 hashconnect - Message Received of type Transaction, sent at 1645301906836 Object
vendor.6adfe5d1bcb3c66e.js:64357 hashconnect - Got transaction Object
vendor.6adfe5d1bcb3c66e.js:64440 hashconnect - Sending message - id: f58ce25f-a83e-4bcd-8986-eefbad072f24
vendor.6adfe5d1bcb3c66e.js:64652 hashconnect - Sending payload to 3a028676-fdfd-4570-b36f-8e91e8c5fb80 
 encrypted with c09d17c2-8eaa-4e0b-9e4d-95540f08a049
main.c205bbaa12d1d9a3.js:21761 Received transaction message:
main.c205bbaa12d1d9a3.js:21764 executing...
main.c205bbaa12d1d9a3.js:2762 transfer error TypeError: Cannot read properties of undefined (reading '0')
    at Network.getNode (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/vendor.6adfe5d1bcb3c66e.js:221968:40)
    at chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/vendor.6adfe5d1bcb3c66e.js:209157:38
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:34981:24)
    at _next (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:35003:9)
    at ZoneDelegate.invoke (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:32016:158)
    at Object.onInvoke (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/vendor.6adfe5d1bcb3c66e.js:341591:25)
    at ZoneDelegate.invoke (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:32016:46)
    at Zone.run (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:31755:37)
    at chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:33101:28
vendor.6adfe5d1bcb3c66e.js:319543 ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'showFailure')
TypeError: Cannot read properties of undefined (reading 'showFailure')
    at chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/main.c205bbaa12d1d9a3.js:2766:34
    at ZoneDelegate.invoke (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:32016:158)
    at Object.onInvoke (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/vendor.6adfe5d1bcb3c66e.js:341591:25)
    at ZoneDelegate.invoke (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:32016:46)
    at Zone.run (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:31755:37)
    at chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:33101:28
    at ZoneDelegate.invokeTask (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:32049:171)
    at Object.onInvokeTask (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/vendor.6adfe5d1bcb3c66e.js:341579:25)
    at ZoneDelegate.invokeTask (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:32049:54)
    at Zone.runTask (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:31808:39)
    at resolvePromise (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:33028:19)
    at chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:32923:9
    at asyncGeneratorStep (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:34984:5)
    at _throw (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:35007:9)
    at ZoneDelegate.invoke (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:32016:158)
    at Object.onInvoke (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/vendor.6adfe5d1bcb3c66e.js:341591:25)
    at ZoneDelegate.invoke (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:32016:46)
    at Zone.run (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:31755:37)
    at chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:33101:28
    at ZoneDelegate.invokeTask (chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk/dist/polyfills.33278d0a6196e5c9.js:32049:171)
defaultErrorLogger @ vendor.6adfe5d1bcb3c66e.js:319543

Feature - Add support for ContractExecuteTransaction Transaction

Executing or trying to fetch signed transaction for ContractExecuteTransaction results in the following error
error: "HASHCONNECT_TRANSACTION_TYPE_NOT_SUPPORTED"

Requirement:
ContractExecuteTransaction transaction should work, so the Dapps can communicate with the Smart contracts.

Not able to proceed with hashconnect.authenticate

Trying to hashconnect.authenticate, after signing a payload but I get the error:

Uncaught (in promise) TypeError: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type object

Sample code:

let payload = { url: "test.com", data: { token: "fufhr9e84hf9w8fehw9e8fhwo9e8fw938fw3o98fhjw3of" } }
let result = await hashconnect.authenticate(
  saveData.topic, 
  saveData.pairedAccounts[0],
  signing_data.serverSigningAccount,
  signing_data.signature, 
  payload
)

// When I sign the payload on the server, the returned signing_data.signature sample is:
let signature_sample = {
    "0": 91,
    "1": 243,
    "2": 54,
    "3": 53,
    "4": 145,
    "5": 215,
    "6": 175,
    "7": 144,
    "8": 65,
    "9": 108,
    "10": 121,
    "11": 93,
    "12": 30,
    "13": 103,
    "14": 148,
    "15": 96,
    "16": 150,
    "17": 39,
    "18": 32,
    "19": 221,
    "20": 242,
    "21": 125,
    "22": 146,
    "23": 86,
    "24": 240,
    "25": 229,
    "26": 128,
    "27": 191,
    "28": 80,
    "29": 177,
    "30": 80,
    "31": 144,
    "32": 165,
    "33": 76,
    "34": 48,
    "35": 245,
    "36": 226,
    "37": 47,
    "38": 135,
    "39": 72,
    "40": 48,
    "41": 161,
    "42": 132,
    "43": 227,
    "44": 16,
    "45": 37,
    "46": 43,
    "47": 108,
    "48": 221,
    "49": 120,
    "50": 246,
    "51": 62,
    "52": 151,
    "53": 86,
    "54": 107,
    "55": 245,
    "56": 46,
    "57": 214,
    "58": 244,
    "59": 180,
    "60": 169,
    "61": 188,
    "62": 55,
    "63": 3
} 

Stack:
NextJs, typescript

Minting NFT token issue

Hello!
I'm playing with hashconnect and i'm get in trouble.
Does hedera-sdk transaction modules are fully supported by HashConnect?
Is the TokenMintTransaction working well?
When i'm trying to mint NFT with

 let trans = await new TokenMintTransaction()
            .setTokenId(tokenId)
            .setAmount(1);
        trans.addMetadata(new Uint8Array(Buffer.from(CID)));
// I also tried solution following Hedera's yt tutorial "How to Mint NFTs on Hedera with JavaScript pt. 1"
// https://youtu.be/lp3mwdYEZEk?t=298
// .setMetadata([Buffer.from(CID)]) 

with later on signing with supplyKey

But with both tries im reciving [Object Object] in wallet modal, and in hashConnect.sendTransaction() method response a success: false.
screenshot_from_wallet

Am I doing something wrong?
I had created before new token type non-fungible with supply type finite, initial supply set to 0 and max to 10 with no decimals. I wasnt set any custom fees. And i had created and trying to mint with the same account, which was also set as treasure account ID and auto-renew account ID.

I'm also have same issue when trying in my own example also in dApp example you have provided.

Message signing discretely malforms provided message

Signing message with: https://github.com/Hashpack/hashconnect#sign

What it says it does is it takes dataToSign and signs it.
What it actuall do is (AFAIK) it first JSON.stringify the dataToSign and then signs it.

Extra characters are added discretely to the message (which changes the signature):

const msg = 'Hello World!'; // => Hello World!
const jmsg = JSON.stringify(msg); // => "Hello World!"

The end result is the returned signature cannot be verified (or to be precise: cannot be verified unless you know about JSON.stringify).

It may not be a problem for JS/Node, but it is a problem if you sign a message on fronted with JS and try to verify it on backend (tested with hashgraph/hedera-sdk-go/v2 and crypto/ed25519).

I see two solutions to this problem:

  1. Keep the behavior but document it (with examples of JSON.stringified values for backend devs)
  2. Get rid of the behavior. Remove JSON.stringify and replace string | object with Uint8Array | string where the string is expected to be hex encoded byte array: https://github.com/Hashpack/hashconnect/blob/main/lib/src/message/relayMessage.ts#L115

Make @hashgraph/sdk a peerDependency

I suggest having the hashgraph package as a peer dependency. I understand that most projects could already be using it.

[...]
},
  "dependencies": {
    "buffer": "^6.0.3",
    "crypto-es": "^1.2.7",
    "crypto-js": "^4.1.1",
    "i": "^0.3.7",
    "isomorphic-ws": "^5.0.0",
    "protons": "^2.0.3",
    "simple-crypto-js": "^3.0.1",
    "ts-typed-events": "3.0.0",
    "uuid": "^8.3.2",
    "ws": "^8.8.1"
  },
"peerDependencies": { 
   "@hashgraph/sdk": "^2.19.2",
},
[...]

ReferenceError: window is not defined

Running the example from https://www.npmjs.com/package/hashconnect with node version 16.14.12

`const { HashConnect } = require( 'hashconnect');
let hashconnect = new HashConnect();

let appMetadata = {
name: "dApp Example",
description: "An example hedera dApp",
icon: "https://absolute.url/to/icon.png"
}

hashconnect.init(appMetadata)
.then(initData => {
let privateKey = initData.privKey
console.log("privateKey", privateKey)
})`

xyz\hconnect\node_modules\hashconnect\dist\hashconnect.js:43
if (window)
^

ReferenceError: window is not defined
at HashConnect. (xyz\hconnect\node_modules\โ†[4mhashconnectโ†[24m\dist\hashconnect.js:43:17)
at Generator.next ()
at fulfilled (xyz\node_modules\โ†[4mtslibโ†[24m\tslib.js:110:62)

Problem with `global` in prod build vite + React

I have vite+React setup. Everything works fine in development enviroment but when I run yarn build I get the following error:
image

I've added a workaround to vite.config.ts:

export default defineConfig({
  plugins: [react()],
  define: {
    global: {}
  },
...

In the dapp example, there are high vulnerabilities from npm audit fix

Figure out how to get rid of these if possible.

npm audit report

ansi-html *
Severity: high
Uncontrolled Resource Consumption in ansi-html - GHSA-whgm-jr23-g3j9
fix available via npm audit fix --force
Will install @angular-devkit/[email protected], which is a breaking change
node_modules/ansi-html
webpack-dev-server 2.0.0-beta - 4.1.0
Depends on vulnerable versions of ansi-html
Depends on vulnerable versions of chokidar
Depends on vulnerable versions of yargs
node_modules/webpack-dev-server
@angular-devkit/build-angular 0.8.8 - 13.0.0-rc.3
Depends on vulnerable versions of webpack-dev-server
node_modules/@angular-devkit/build-angular

ansi-regex >2.1.1 <5.0.1
Severity: moderate
Inefficient Regular Expression Complexity in chalk/ansi-regex - GHSA-93q8-gq69-wqmw
fix available via npm audit fix --force
Will install @angular-devkit/[email protected], which is a breaking change
node_modules/webpack-dev-server/node_modules/cliui/node_modules/ansi-regex
node_modules/webpack-dev-server/node_modules/string-width/node_modules/ansi-regex
node_modules/webpack-dev-server/node_modules/wrap-ansi/node_modules/ansi-regex
strip-ansi 4.0.0 - 5.2.0
Depends on vulnerable versions of ansi-regex
node_modules/webpack-dev-server/node_modules/cliui/node_modules/strip-ansi
node_modules/webpack-dev-server/node_modules/string-width/node_modules/strip-ansi
node_modules/webpack-dev-server/node_modules/wrap-ansi/node_modules/strip-ansi
cliui 4.0.0 - 5.0.0
Depends on vulnerable versions of strip-ansi
Depends on vulnerable versions of wrap-ansi
node_modules/webpack-dev-server/node_modules/cliui
yargs 10.1.0 - 15.0.0
Depends on vulnerable versions of cliui
Depends on vulnerable versions of string-width
node_modules/webpack-dev-server/node_modules/yargs
webpack-dev-server 2.0.0-beta - 4.1.0
Depends on vulnerable versions of ansi-html
Depends on vulnerable versions of chokidar
Depends on vulnerable versions of yargs
node_modules/webpack-dev-server
@angular-devkit/build-angular 0.8.8 - 13.0.0-rc.3
Depends on vulnerable versions of webpack-dev-server
node_modules/@angular-devkit/build-angular
string-width 2.1.0 - 4.1.0
Depends on vulnerable versions of strip-ansi
node_modules/webpack-dev-server/node_modules/string-width
wrap-ansi 3.0.0 - 6.1.0
Depends on vulnerable versions of string-width
Depends on vulnerable versions of strip-ansi
node_modules/webpack-dev-server/node_modules/wrap-ansi

glob-parent <5.1.2
Severity: high
Regular expression denial of service - GHSA-ww39-953v-wcq6
fix available via npm audit fix --force
Will install @angular-devkit/[email protected], which is a breaking change
node_modules/webpack-dev-server/node_modules/glob-parent
chokidar 1.0.0-rc1 - 2.1.8
Depends on vulnerable versions of glob-parent
node_modules/webpack-dev-server/node_modules/chokidar
webpack-dev-server 2.0.0-beta - 4.1.0
Depends on vulnerable versions of ansi-html
Depends on vulnerable versions of chokidar
Depends on vulnerable versions of yargs
node_modules/webpack-dev-server
@angular-devkit/build-angular 0.8.8 - 13.0.0-rc.3
Depends on vulnerable versions of webpack-dev-server
node_modules/@angular-devkit/build-angular

11 vulnerabilities (6 moderate, 5 high)

To address all issues (including breaking changes), run:
npm audit fix --force

error in hashconnect when using it with react.js, getting so many errors this type of errors

WARNING in ./node_modules/hashconnect/dist/esm/hashconnect.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'C:\Users\shubham.prajapati\OneDrive - Decimal Ltd\Desktop\block_chain\hashconnect\hashconnect\node_modules\hashconnect\src\hashconnect.ts' file: Error: ENOENT: no such file or directory, open 'C:\Users\shubham.prajapati\OneDrive - Decimal Ltd\Desktop\block_chain\hashconnect\hashconnect\node_modules\hashconnect\src\hashconnect.ts'

Signing and Sending Transaction with ContractExecuteTransaction Error

Here is my Code

async function run() {

let saveData = {
	topic: "",
	pairingString: "",
	privateKey: "",
	pairedWalletData: null,
	pairedAccounts: [],
};
let appMetadata = {
	name: "Hedera dApp Days",
	description: "Let's buidl a dapp on Hedera",
	icon: "https://raw.githubusercontent.com/ed-marquez/hedera-dapp-days/testing/src/assets/hederaLogo.png",
};

let contractId = ContractId.fromString("0.0.47907889");
let accountId = "0.0.47905112"
const privateKey = PrivateKey.fromString("302e020100300506032b657004220420341b71552663fe46c2cec11d71dda6a5f804e704760f7e625ba59165a56d1a59");

let hashconnect = new HashConnect();

const provider = hashconnect.getProvider('testnet', saveData.topic, accountId)
const signer = hashconnect.getSigner(provider)
let balance = await provider.getAccountBalance(accountId)
const stakeTx = await new ContractExecuteTransaction()
.setContractId(contractId)
.setGas(500000)
.setPayableAmount(50)
.setFunction("stakeTokens")
.freezeWithSigner(signer);
const result = await stakeTx.executeWithSigner(signer)
console.log(result)

}
when i run this, it gives me an error "Error: SimpleCrypto object MUST BE initialised with a SECRET KEY."

Login using ECDSA key in Hashpack

Hi,

We are using HashPack Wallet for our DEX. It's work in progress. For our functionality, we need to sign transactions using ECDSA key. When I try to login using ECDSA private, Hashpack UI doesn't support that. Do we have a plan to support ECDSA keys?

The chrome extension is not injected into iframes

We have a dApp running in an iframe. The dApp is never able to access the chrome extension from the iframe. Please fix this and also where is the link to CDN file for hashconnect for people who dont want commonJS or EJS

Token transaction do not return any event

Using React, i'm trying to execute a token transfert using Hedera Token Service.
When i send the transaction to HashConnect the wallet prompts me to approve the transaction, but after that nothing happens.
Here's my code:

`export async function buyRTTToken(token, trsuaryAccountId,reciverAccountId) {
const client = hederaClient();
let transaction : TransferTransaction = await new TransferTransaction();
transaction.addTokenTransfer(token.tokenId, trsuaryAccountId, -10);
transaction.addTokenTransfer(token.tokenId, reciverAccountId, 10);
transaction.freezeWith(client);

await sendTransaction(transaction, reciverAccountId);

}`

`export async function sendTransaction(tx: Transaction, signignAccount: string) {
let transactionBytes: Uint8Array = tx.toBytes();

const transaction: MessageTypes.Transaction = {
    topic: saveData.topic,
    byteArray: transactionBytes,
    metadata: {
        accountToSign: signignAccount,
        returnTransaction: false
    }
}

await hashconnect.sendTransaction(saveData.topic, transaction)

hashconnect.transactionResponseEvent.once((data) => {
    console.log("transaction response", data)
})

}`

The following code aims to let the reciving user to sign the transaction and to pay for the fees of tranfer, since he is requesting token from the tresuary account

any one Help me what is this issuer???

SimpleCrypto.ts:35 Uncaught (in promise) Error: SimpleCrypto object MUST BE initialised with a SECRET KEY.
at new SimpleCrypto (SimpleCrypto.ts:35:1)
at MessageUtil.encrypt (message-utils.ts:77:1)
at MessageUtil.prepareSimpleMessage (message-utils.ts:33:1)
at HashConnect.sendTransaction (hashconnect.ts:283:1)
at HashConnectSigner.call (signer.ts:95:1)
at TransferTransaction.executeWithSigner (Executable.js:490:1)
at sendTrasaction (signtnx.js:14:1)
at async onClick (App.js:134:1)
SimpleCrypto @ SimpleCrypto.ts:35
encrypt @ message-utils.ts:77
prepareSimpleMessage @ message-utils.ts:33
sendTransaction @ hashconnect.ts:283
call @ signer.ts:95
executeWithSigner @ Executable.js:490
sendTrasaction @ signtnx.js:14
await in sendTrasaction (async)
callCallback @ react-dom.development.js:4164
invokeGuardedCallbackDev @ react-dom.development.js:4213
invokeGuardedCallback @ react-dom.development.js:4277
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4291
executeDispatch @ react-dom.development.js:9041
processDispatchQueueItemsInOrder @ react-dom.development.js:9073
processDispatchQueue @ react-dom.development.js:9086
dispatchEventsForPlugins @ react-dom.development.js:9097
(anonymous) @ react-dom.development.js:9288
batchedUpdates$1 @ react-dom.development.js:26140
batchedUpdates @ react-dom.development.js:3991
dispatchEventForPluginEventSystem @ react-dom.development.js:9287
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ react-dom.development.js:6465
dispatchEvent @ react-dom.development.js:6457
dispatchDiscreteEvent @ react-dom.development.js:6430

TypeError: hashconnect.authenticate is not a function

following readme page to test authenticate
const resp = await hashconnect.authenticate(topic, accountId)

TypeError: hashconnect.authenticate is not a function

How to access authenticate method from
const { HashConnect } = require("hashconnect")

It does not work with Svelte (and Rollup.js)

Hi, it does not work with Svelte default build settings. I know you build your example using Angular. I am wondering if somebody could try use React with the library?

> [email protected] dev /Users/magic/Dev/_svelte/hashconnect-test
> rollup -c -w

rollup v2.61.1
bundles src/main.js โ†’ public/build/bundle.js...
(!) Plugin node-resolve: preferring built-in module 'buffer' over local alternative at '/Users/magic/Dev/_svelte/hashconnect-test/node_modules/buffer/index.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning
(!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/Users/magic/Dev/_svelte/hashconnect-test/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning
(!) `this` has been rewritten to `undefined`
https://rollupjs.org/guide/en/#error-this-is-undefined
node_modules/js-waku/build/esm/lib/discovery.js
1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
                    ^
2:     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3:     return new (P || (P = Promise))(function (resolve, reject) {
...and 1 other occurrence
node_modules/js-waku/build/esm/lib/waku.js
1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
                    ^
2:     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3:     return new (P || (P = Promise))(function (resolve, reject) {
...and 1 other occurrence
node_modules/js-waku/build/esm/lib/waku_message/version_1.js
1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
                    ^
2:     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3:     return new (P || (P = Promise))(function (resolve, reject) {
...and 1 other occurrence

...and 6 other files
(!) Circular dependencies
node_modules/protobufjs/src/util/minimal.js -> node_modules/protobufjs/src/util/longbits.js -> node_modules/protobufjs/src/util/minimal.js
node_modules/protobufjs/src/util/minimal.js -> node_modules/protobufjs/src/util/longbits.js -> /Users/magic/Dev/_svelte/hashconnect-test/node_modules/protobufjs/src/util/minimal.js?commonjs-proxy -> node_modules/protobufjs/src/util/minimal.js
node_modules/js-waku/build/esm/lib/waku.js -> node_modules/js-waku/build/esm/lib/waku_light_push/index.js -> node_modules/js-waku/build/esm/lib/waku.js
...and 6 more
(!) Unresolved dependencies
https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
tslib (imported by tslib?commonjs-external)
(!) Use of eval is strongly discouraged
https://rollupjs.org/guide/en/#avoiding-eval
node_modules/@protobufjs/inquire/index.js
10: function inquire(moduleName) {
11:     try {
12:         var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
                      ^
13:         if (mod && (mod.length || Object.keys(mod).length))
14:             return mod;
[!] Error: Invalid value "iife" for option "output.format" - UMD and IIFE output formats are not supported for code-splitting builds.
https://rollupjs.org/guide/en/#outputformat
Error: Invalid value "iife" for option "output.format" - UMD and IIFE output formats are not supported for code-splitting builds.
    at error (/Users/magic/Dev/_svelte/hashconnect-test/node_modules/rollup/dist/shared/rollup.js:158:30)
    at validateOptionsForMultiChunkOutput (/Users/magic/Dev/_svelte/hashconnect-test/node_modules/rollup/dist/shared/rollup.js:16090:16)
    at Bundle.generate (/Users/magic/Dev/_svelte/hashconnect-test/node_modules/rollup/dist/shared/rollup.js:15929:17)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at handleGenerateWrite (/Users/magic/Dev/_svelte/hashconnect-test/node_modules/rollup/dist/shared/rollup.js:23464:23)
    at async Promise.all (index 0)
    at Task.run (/Users/magic/Dev/_svelte/hashconnect-test/node_modules/rollup/dist/shared/watch.js:243:32)
    at Watcher.run (/Users/magic/Dev/_svelte/hashconnect-test/node_modules/rollup/dist/shared/watch.js:170:13)

Check this repo to reproduce https://github.com/srokatonie/hashconnect-test

npm install
npm run dev

You can try to avoid some errors in the console by amending rollup.config.js

output: {
ยงsourcemap: true,
name: 'app',
inlineDynamicImports: true, // <- uncomment this
format: 'iife',
file: 'public/build/bundle.js',
},

But then you are getting error in browser's console:

node.js:36 Uncaught ReferenceError: tslib_1 is not defined
    at node.js:36

Screenshot 2021-12-23 at 17 25 50

I spend some time on Rollup settings but unfortunately I could not resolve. Angular uses Webpack as build tool, which can be applied in Svelte and possibly resolve the issue. However, this doesn't work "out of the box".

Allow message signing and verification

The hedera sdk supports sinning and verifying message. It would be great if this feature could be exposed via hashconnect

const privateKey : PrivateKey;
const message = Buffer.from("My message to sign");
const signature = privateKey.sign(message);

const publicKey: PublicKey = privateKey.publicKey();
const isValid = publicKey.verify(message,signature);

Support FileAppendTransaction

Currently, we get back Error: There was an issue while signing the request: HASHCONNECT_TRANSACTION_TYPE_NOT_SUPPORTED when trying to send a FileAppendTransaction. FileCreateTransaction is supported, so it would be nice if this was supported as well.

I know this is not a priority, but it would be nice if this was be available so that strato's live-editor docs > guides > contracts would fully work since most of the contract bytecodes exceeded the current limit of 1024 bytes per transaction which require second subsequent append-transaction calls.

Not working with default React setup

Hi, I just created a "Hello World" React app from an official boilerplate. Installed and added hashconnect.

import logo from './logo.svg';
import './App.css';
import { hashconnect } from 'hashconnect';

function App() {
  return (
    <div className="App">
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo" />
        <a
          className="App-link"
          href="https://reactjs.org"
          target="_blank"
          rel="noopener noreferrer"
        >
          Learn React
        </a>
      </header>
    </div>
  );
}

export default App;

Getting the following errors:

CLI:

Failed to compile.

Module not found: Error: Can't resolve 'crypto' in '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/build/esm/lib/waku_message/symmetric'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
	- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "crypto": false }
assets by path static/ 4.52 MiB
  asset static/js/bundle.js 4.5 MiB [emitted] (name: main) 1 related asset
  asset static/js/node_modules_web-vitals_dist_web-vitals_js.chunk.js 6.88 KiB [emitted] 1 related asset
  asset static/js/node_modules_js-waku_build_esm_lib_waku_message_symmetric_node_js.chunk.js 3.27 KiB [emitted] 1 related asset
  asset static/js/node_modules_js-waku_build_esm_lib_waku_message_symmetric_browser_js.chunk.js 2.89 KiB [emitted] 1 related asset
  asset static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg 2.57 KiB [emitted] (auxiliary name: main)
asset index.html 1.67 KiB [emitted]
asset asset-manifest.json 1.25 KiB [emitted]
cached modules 4.08 MiB (javascript) 31.5 KiB (runtime) [cached] 705 modules

WARNING in ./node_modules/hashconnect/dist/hashconnect.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/hashconnect/src/hashconnect.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/hashconnect/src/hashconnect.ts'
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/hashconnect/dist/main.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/hashconnect/src/main.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/hashconnect/src/main.ts'
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/hashconnect/dist/message/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/hashconnect/src/message/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/hashconnect/src/message/index.ts'
 @ ./node_modules/hashconnect/dist/hashconnect.js 14:18-38
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/hashconnect/dist/message/message-handler.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/hashconnect/src/message/message-handler.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/hashconnect/src/message/message-handler.ts'
 @ ./node_modules/hashconnect/dist/message/index.js 13:21-49
 @ ./node_modules/hashconnect/dist/hashconnect.js 14:18-38
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/hashconnect/dist/message/message-utils.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/hashconnect/src/message/message-utils.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/hashconnect/src/message/message-utils.ts'
 @ ./node_modules/hashconnect/dist/message/index.js 9:21-47
 @ ./node_modules/hashconnect/dist/hashconnect.js 14:18-38
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/hashconnect/dist/message/relayMessage.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/hashconnect/src/message/relayMessage.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/hashconnect/src/message/relayMessage.ts'
 @ ./node_modules/hashconnect/dist/main.js 11:21-54
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/hashconnect/dist/types/relay.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/hashconnect/src/types/relay.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/hashconnect/src/types/relay.ts'
 @ ./node_modules/hashconnect/dist/hashconnect.js 12:16-40
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/ip-address/dist/cjs/ip-address.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/ip-address.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/ip-address.ts'
 @ ./node_modules/libp2p-utils/src/ip-port-to-multiaddr.js 18:4-25
 @ ./node_modules/libp2p-websockets/src/socket-to-conn.js 9:20-68
 @ ./node_modules/libp2p-websockets/src/index.js 24:21-48
 @ ./node_modules/js-waku/build/esm/lib/waku.js 42:0-43 56:31-51 117:20-30
 @ ./node_modules/js-waku/build/esm/index.js 4:0-54 4:0-54 4:0-54
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/ip-address/dist/cjs/lib/address-error.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/address-error.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/address-error.ts'
 @ ./node_modules/ip-address/dist/cjs/ip-address.js 58:22-52
 @ ./node_modules/libp2p-utils/src/ip-port-to-multiaddr.js 18:4-25
 @ ./node_modules/libp2p-websockets/src/socket-to-conn.js 9:20-68
 @ ./node_modules/libp2p-websockets/src/index.js 24:21-48
 @ ./node_modules/js-waku/build/esm/lib/waku.js 42:0-43 56:31-51 117:20-30
 @ ./node_modules/js-waku/build/esm/index.js 4:0-54 4:0-54 4:0-54
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/ip-address/dist/cjs/lib/common.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/common.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/common.ts'
 @ ./node_modules/ip-address/dist/cjs/lib/ipv4.js 41:26-45
 @ ./node_modules/ip-address/dist/cjs/ip-address.js 40:13-34
 @ ./node_modules/libp2p-utils/src/ip-port-to-multiaddr.js 18:4-25
 @ ./node_modules/libp2p-websockets/src/socket-to-conn.js 9:20-68
 @ ./node_modules/libp2p-websockets/src/index.js 24:21-48
 @ ./node_modules/js-waku/build/esm/lib/waku.js 42:0-43 56:31-51 117:20-30
 @ ./node_modules/js-waku/build/esm/index.js 4:0-54 4:0-54 4:0-54
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/ip-address/dist/cjs/lib/ipv4.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/ipv4.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/ipv4.ts'
 @ ./node_modules/ip-address/dist/cjs/ip-address.js 40:13-34
 @ ./node_modules/libp2p-utils/src/ip-port-to-multiaddr.js 18:4-25
 @ ./node_modules/libp2p-websockets/src/socket-to-conn.js 9:20-68
 @ ./node_modules/libp2p-websockets/src/index.js 24:21-48
 @ ./node_modules/js-waku/build/esm/lib/waku.js 42:0-43 56:31-51 117:20-30
 @ ./node_modules/js-waku/build/esm/index.js 4:0-54 4:0-54 4:0-54
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/ip-address/dist/cjs/lib/ipv6.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/ipv6.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/ipv6.ts'
 @ ./node_modules/ip-address/dist/cjs/ip-address.js 49:13-34
 @ ./node_modules/libp2p-utils/src/ip-port-to-multiaddr.js 18:4-25
 @ ./node_modules/libp2p-websockets/src/socket-to-conn.js 9:20-68
 @ ./node_modules/libp2p-websockets/src/index.js 24:21-48
 @ ./node_modules/js-waku/build/esm/lib/waku.js 42:0-43 56:31-51 117:20-30
 @ ./node_modules/js-waku/build/esm/index.js 4:0-54 4:0-54 4:0-54
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/ip-address/dist/cjs/lib/v4/constants.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/v4/constants.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/v4/constants.ts'
 @ ./node_modules/ip-address/dist/cjs/lib/ipv4.js 43:29-54
 @ ./node_modules/ip-address/dist/cjs/ip-address.js 40:13-34
 @ ./node_modules/libp2p-utils/src/ip-port-to-multiaddr.js 18:4-25
 @ ./node_modules/libp2p-websockets/src/socket-to-conn.js 9:20-68
 @ ./node_modules/libp2p-websockets/src/index.js 24:21-48
 @ ./node_modules/js-waku/build/esm/lib/waku.js 42:0-43 56:31-51 117:20-30
 @ ./node_modules/js-waku/build/esm/index.js 4:0-54 4:0-54 4:0-54
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/ip-address/dist/cjs/lib/v6/constants.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/v6/constants.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/v6/constants.ts'
 @ ./node_modules/ip-address/dist/cjs/lib/ipv6.js 53:30-55
 @ ./node_modules/ip-address/dist/cjs/ip-address.js 49:13-34
 @ ./node_modules/libp2p-utils/src/ip-port-to-multiaddr.js 18:4-25
 @ ./node_modules/libp2p-websockets/src/socket-to-conn.js 9:20-68
 @ ./node_modules/libp2p-websockets/src/index.js 24:21-48
 @ ./node_modules/js-waku/build/esm/lib/waku.js 42:0-43 56:31-51 117:20-30
 @ ./node_modules/js-waku/build/esm/index.js 4:0-54 4:0-54 4:0-54
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/ip-address/dist/cjs/lib/v6/helpers.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/v6/helpers.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/v6/helpers.ts'
 @ ./node_modules/ip-address/dist/cjs/ip-address.js 67:27-54
 @ ./node_modules/libp2p-utils/src/ip-port-to-multiaddr.js 18:4-25
 @ ./node_modules/libp2p-websockets/src/socket-to-conn.js 9:20-68
 @ ./node_modules/libp2p-websockets/src/index.js 24:21-48
 @ ./node_modules/js-waku/build/esm/lib/waku.js 42:0-43 56:31-51 117:20-30
 @ ./node_modules/js-waku/build/esm/index.js 4:0-54 4:0-54 4:0-54
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/ip-address/dist/cjs/lib/v6/regular-expressions.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/v6/regular-expressions.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/ip-address/lib/v6/regular-expressions.ts'
 @ ./node_modules/ip-address/dist/cjs/lib/ipv6.js 59:28-63
 @ ./node_modules/ip-address/dist/cjs/ip-address.js 49:13-34
 @ ./node_modules/libp2p-utils/src/ip-port-to-multiaddr.js 18:4-25
 @ ./node_modules/libp2p-websockets/src/socket-to-conn.js 9:20-68
 @ ./node_modules/libp2p-websockets/src/index.js 24:21-48
 @ ./node_modules/js-waku/build/esm/lib/waku.js 42:0-43 56:31-51 117:20-30
 @ ./node_modules/js-waku/build/esm/index.js 4:0-54 4:0-54 4:0-54
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/index.ts'
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/discovery.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/discovery.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/discovery.ts'
 @ ./node_modules/js-waku/build/esm/index.js 1:0-52 1:0-52
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/select_peer.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/select_peer.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/select_peer.ts'
 @ ./node_modules/js-waku/build/esm/lib/waku.js 50:0-52 264:10-29
 @ ./node_modules/js-waku/build/esm/index.js 4:0-54 4:0-54 4:0-54
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/utils.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/utils.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/utils.ts'
 @ ./node_modules/js-waku/build/esm/index.js 2:0-39 3:0-28
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/waku.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku.ts'
 @ ./node_modules/js-waku/build/esm/index.js 4:0-54 4:0-54 4:0-54
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/waku_light_push/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_light_push/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_light_push/index.ts'
 @ ./node_modules/js-waku/build/esm/index.js 7:0-84 7:0-84 7:0-84 7:0-84
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/waku_light_push/push_rpc.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_light_push/push_rpc.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_light_push/push_rpc.ts'
 @ ./node_modules/js-waku/build/esm/lib/waku_light_push/index.js 39:0-37 78:22-43 82:27-41
 @ ./node_modules/js-waku/build/esm/index.js 7:0-84 7:0-84 7:0-84 7:0-84
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/waku_message/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_message/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_message/index.ts'
 @ ./node_modules/js-waku/build/esm/index.js 5:0-49 5:0-49
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/waku_message/symmetric/browser.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_message/symmetric/browser.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_message/symmetric/browser.ts'
 @ ./node_modules/js-waku/build/esm/lib/waku_message/symmetric/index.js 5:0-19
 @ ./node_modules/js-waku/build/esm/lib/waku_message/version_1.js 39:0-66 166:15-35 168:25-42 185:34-40 188:11-28 205:21-37
 @ ./node_modules/js-waku/build/esm/index.js 6:0-102 6:0-102 6:0-102 6:0-102
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/waku_message/symmetric/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_message/symmetric/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_message/symmetric/index.ts'
 @ ./node_modules/js-waku/build/esm/lib/waku_message/version_1.js 39:0-66 166:15-35 168:25-42 185:34-40 188:11-28 205:21-37
 @ ./node_modules/js-waku/build/esm/index.js 6:0-102 6:0-102 6:0-102 6:0-102
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/waku_message/symmetric/node.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_message/symmetric/node.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_message/symmetric/node.ts'
 @ ./node_modules/js-waku/build/esm/lib/waku_message/symmetric/index.js 8:2-18
 @ ./node_modules/js-waku/build/esm/lib/waku_message/version_1.js 39:0-66 166:15-35 168:25-42 185:34-40 188:11-28 205:21-37
 @ ./node_modules/js-waku/build/esm/index.js 6:0-102 6:0-102 6:0-102 6:0-102
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/waku_message/version_1.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_message/version_1.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_message/version_1.ts'
 @ ./node_modules/js-waku/build/esm/index.js 6:0-102 6:0-102 6:0-102 6:0-102
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/waku_relay/constants.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_relay/constants.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_relay/constants.ts'
 @ ./node_modules/js-waku/build/esm/lib/waku.js 54:0-63 302:48-69
 @ ./node_modules/js-waku/build/esm/index.js 4:0-54 4:0-54 4:0-54
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/waku_relay/get_relay_peers.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_relay/get_relay_peers.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_relay/get_relay_peers.ts'
 @ ./node_modules/js-waku/build/esm/lib/waku_relay/index.js 43:0-50 183:11-24 255:8-21 265:20-33 322:26-39 457:20-33
 @ ./node_modules/js-waku/build/esm/index.js 8:0-58 8:0-58 8:0-58
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/waku_relay/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_relay/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_relay/index.ts'
 @ ./node_modules/js-waku/build/esm/index.js 8:0-58 8:0-58 8:0-58
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/waku_relay/relay_heartbeat.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_relay/relay_heartbeat.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_relay/relay_heartbeat.ts'
 @ ./node_modules/js-waku/build/esm/lib/waku_relay/index.js 44:0-51 61:25-39
 @ ./node_modules/js-waku/build/esm/index.js 8:0-58 8:0-58 8:0-58
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/waku_store/history_rpc.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_store/history_rpc.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_store/history_rpc.ts'
 @ ./node_modules/js-waku/build/esm/lib/waku_store/index.js 42:0-58 46:0-25 87:23-45 127:32-54 130:22-39
 @ ./node_modules/js-waku/build/esm/index.js 9:0-72 9:0-72 9:0-72 9:0-72
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/lib/waku_store/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_store/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/lib/waku_store/index.ts'
 @ ./node_modules/js-waku/build/esm/index.js 9:0-72 9:0-72 9:0-72 9:0-72
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/proto/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/proto/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/proto/index.ts'
 @ ./node_modules/js-waku/build/esm/index.js 10:0-35 11:0-28
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/proto/waku/v2/light_push.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/proto/waku/v2/light_push.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/proto/waku/v2/light_push.ts'
 @ ./node_modules/js-waku/build/esm/lib/waku_light_push/index.js 36:0-62 41:0-24
 @ ./node_modules/js-waku/build/esm/index.js 7:0-84 7:0-84 7:0-84 7:0-84
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/proto/waku/v2/message.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/proto/waku/v2/message.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/proto/waku/v2/message.ts'
 @ ./node_modules/js-waku/build/esm/lib/waku_message/index.js 38:0-53 124:23-47 205:11-35
 @ ./node_modules/js-waku/build/esm/index.js 5:0-49 5:0-49
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/js-waku/build/esm/proto/waku/v2/store.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/proto/waku/v2/store.ts' file: Error: ENOENT: no such file or directory, open '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/src/proto/waku/v2/store.ts'
 @ ./node_modules/js-waku/build/esm/lib/waku_store/index.js 37:0-66 137:49-91
 @ ./node_modules/js-waku/build/esm/index.js 9:0-72 9:0-72 9:0-72 9:0-72
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

38 warnings have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

ERROR in ./node_modules/js-waku/build/esm/lib/waku_message/symmetric/node.js 33:0-71
Module not found: Error: Can't resolve 'crypto' in '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/build/esm/lib/waku_message/symmetric'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
	- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "crypto": false }
resolve 'crypto' in '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/build/esm/lib/waku_message/symmetric'
  Parsed request is a module
  using description file: /Users/magic/Dev/_playground/my-app/node_modules/js-waku/package.json (relative path: ./build/esm/lib/waku_message/symmetric)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      /Users/magic/Dev/_playground/my-app/node_modules/js-waku/build/esm/lib/waku_message/symmetric/node_modules doesn't exist or is not a directory
      /Users/magic/Dev/_playground/my-app/node_modules/js-waku/build/esm/lib/waku_message/node_modules doesn't exist or is not a directory
      /Users/magic/Dev/_playground/my-app/node_modules/js-waku/build/esm/lib/node_modules doesn't exist or is not a directory
      /Users/magic/Dev/_playground/my-app/node_modules/js-waku/build/esm/node_modules doesn't exist or is not a directory
      /Users/magic/Dev/_playground/my-app/node_modules/js-waku/build/node_modules doesn't exist or is not a directory
      /Users/magic/Dev/_playground/my-app/node_modules/js-waku/node_modules doesn't exist or is not a directory
      /Users/magic/Dev/_playground/my-app/node_modules/node_modules doesn't exist or is not a directory
      looking for modules in /Users/magic/Dev/_playground/my-app/node_modules
        single file module
          using description file: /Users/magic/Dev/_playground/my-app/package.json (relative path: ./node_modules/crypto)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto doesn't exist
            .web.mjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.web.mjs doesn't exist
            .mjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.mjs doesn't exist
            .web.js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.web.js doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.json doesn't exist
            .web.jsx
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.web.jsx doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.jsx doesn't exist
        /Users/magic/Dev/_playground/my-app/node_modules/crypto doesn't exist
      /Users/magic/Dev/_playground/node_modules doesn't exist or is not a directory
      /Users/magic/Dev/node_modules doesn't exist or is not a directory
      looking for modules in /Users/magic/node_modules
        single file module
          No description file found in /Users/magic/node_modules or above
          no extension
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto doesn't exist
          .web.mjs
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto.web.mjs doesn't exist
          .mjs
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto.mjs doesn't exist
          .web.js
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto.web.js doesn't exist
          .js
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto.js doesn't exist
          .json
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto.json doesn't exist
          .web.jsx
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto.web.jsx doesn't exist
          .jsx
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto.jsx doesn't exist
        /Users/magic/node_modules/crypto doesn't exist
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      looking for modules in /Users/magic/Dev/_playground/my-app/node_modules
        single file module
          using description file: /Users/magic/Dev/_playground/my-app/package.json (relative path: ./node_modules/crypto)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto doesn't exist
            .web.mjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.web.mjs doesn't exist
            .mjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.mjs doesn't exist
            .web.js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.web.js doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.json doesn't exist
            .web.jsx
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.web.jsx doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.jsx doesn't exist
        /Users/magic/Dev/_playground/my-app/node_modules/crypto doesn't exist
 @ ./node_modules/js-waku/build/esm/lib/waku_message/symmetric/index.js 8:2-18
 @ ./node_modules/js-waku/build/esm/lib/waku_message/version_1.js 39:0-66 166:15-35 168:25-42 185:34-40 188:11-28 205:21-37
 @ ./node_modules/js-waku/build/esm/index.js 6:0-102 6:0-102 6:0-102 6:0-102
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

ERROR in ./node_modules/js-waku/build/esm/lib/waku_message/version_1.js 34:0-33
Module not found: Error: Can't resolve 'crypto' in '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/build/esm/lib/waku_message'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
	- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "crypto": false }
resolve 'crypto' in '/Users/magic/Dev/_playground/my-app/node_modules/js-waku/build/esm/lib/waku_message'
  Parsed request is a module
  using description file: /Users/magic/Dev/_playground/my-app/node_modules/js-waku/package.json (relative path: ./build/esm/lib/waku_message)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      /Users/magic/Dev/_playground/my-app/node_modules/js-waku/build/esm/lib/waku_message/node_modules doesn't exist or is not a directory
      /Users/magic/Dev/_playground/my-app/node_modules/js-waku/build/esm/lib/node_modules doesn't exist or is not a directory
      /Users/magic/Dev/_playground/my-app/node_modules/js-waku/build/esm/node_modules doesn't exist or is not a directory
      /Users/magic/Dev/_playground/my-app/node_modules/js-waku/build/node_modules doesn't exist or is not a directory
      /Users/magic/Dev/_playground/my-app/node_modules/js-waku/node_modules doesn't exist or is not a directory
      /Users/magic/Dev/_playground/my-app/node_modules/node_modules doesn't exist or is not a directory
      looking for modules in /Users/magic/Dev/_playground/my-app/node_modules
        single file module
          using description file: /Users/magic/Dev/_playground/my-app/package.json (relative path: ./node_modules/crypto)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto doesn't exist
            .web.mjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.web.mjs doesn't exist
            .mjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.mjs doesn't exist
            .web.js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.web.js doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.json doesn't exist
            .web.jsx
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.web.jsx doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.jsx doesn't exist
        /Users/magic/Dev/_playground/my-app/node_modules/crypto doesn't exist
      /Users/magic/Dev/_playground/node_modules doesn't exist or is not a directory
      /Users/magic/Dev/node_modules doesn't exist or is not a directory
      looking for modules in /Users/magic/node_modules
        single file module
          No description file found in /Users/magic/node_modules or above
          no extension
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto doesn't exist
          .web.mjs
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto.web.mjs doesn't exist
          .mjs
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto.mjs doesn't exist
          .web.js
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto.web.js doesn't exist
          .js
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto.js doesn't exist
          .json
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto.json doesn't exist
          .web.jsx
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto.web.jsx doesn't exist
          .jsx
            Field 'browser' doesn't contain a valid alias configuration
            /Users/magic/node_modules/crypto.jsx doesn't exist
        /Users/magic/node_modules/crypto doesn't exist
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      looking for modules in /Users/magic/Dev/_playground/my-app/node_modules
        single file module
          using description file: /Users/magic/Dev/_playground/my-app/package.json (relative path: ./node_modules/crypto)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto doesn't exist
            .web.mjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.web.mjs doesn't exist
            .mjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.mjs doesn't exist
            .web.js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.web.js doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.json doesn't exist
            .web.jsx
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.web.jsx doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              /Users/magic/Dev/_playground/my-app/node_modules/crypto.jsx doesn't exist
        /Users/magic/Dev/_playground/my-app/node_modules/crypto doesn't exist
 @ ./node_modules/js-waku/build/esm/index.js 6:0-102 6:0-102 6:0-102 6:0-102
 @ ./node_modules/hashconnect/dist/hashconnect.js 16:18-36
 @ ./node_modules/hashconnect/dist/main.js 9:21-45
 @ ./src/App.js 6:0-42
 @ ./src/index.js 7:0-24 11:33-36

webpack 5.65.0 compiled with 2 errors and 38 warnings in 2099 ms

Browser:

Screenshot 2021-12-23 at 21 59 55

I am not React dev, the reason I tried was to rule out if the issue appears in Svelte only or not.

Feel free to close if that's related to Webpack/React setup.

Can't execute paid queries with the HashConnect Provider - No client operator is specified

When trying either of the following paid queries with the HashPack provider or signer,

const aInfo = await signer.getAccountInfo();
const bInfo = await provider.getAccountInfo(accountId);

The result is as follows:

Error: `client` must have an `operator` or an explicit payment transaction must be provided
    at AccountInfoQuery._beforeExecute (Query.js:228:1)
    at AccountInfoQuery.execute (Executable.js:375:1)
    at HashConnectSigner.getAccountInfo (signer.ts:54:1)

My understanding is that free queries can be executed by the provider's client directly without sending them to the wallet. However, for paid queries that's not the case. Paid queries (and txns) should be sent to the wallet.
This is likely fixed by constructing the request using the account ID in the signer and passing that to the call method.

===============

For now, a workaround (not ideal) is passing the account ID and private key to the client operator in the provider. This requires hardcoding my private key in the application, which kinda defeats the purpose of the signer/provider architecture.

Example dApp - Create token - INVALID_EXPIRATION_TIME error

Hi, to reproduce simply clone the repo and try to create a token:

git clone https://github.com/Hashpack/hashconnect.git
cd hashconnect/examples/dapp
npm install

Open http://localhost:4200/hashconnect/dapp/ pair with HashPack and create a token.

Response in the dApp:

{
  "response": {
    "topic": "75181bd2-ac8c-4575-8c66-687a78fdc5d5",
    "success": false,
    "error": {
      "name": "StatusError",
      "status": "INVALID_EXPIRATION_TIME",
      "transactionId": "[email protected]",
      "message": "transaction [email protected] failed precheck with status INVALID_EXPIRATION_TIME"
    },
    "id": "0d5204ef-234e-4f3f-a383-6fb986b59289",
    "origin": "chrome-extension://gjagmgiddbbciopjhllkdnddhcglnemk"
  },
  "receipt": null
}

in HashPack:

Screenshot 2022-08-28 at 13 41 42

TransferTransaction token amount view (question)

Hello! Could you explain me what did I do wrong? I'm trying to send test token (0.0.3084461) with Dapp demo. When I'm sending two tokens
Screenshot 2022-03-23 at 11 30 47

In Hashpack I see that I received 0 tokens and then I got an error: TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN

Screenshot 2022-03-23 at 11 35 41

Screenshot 2022-03-23 at 11 43 38

TypeError: hc.transactionResolver is not a function

Got a NextJS project here and struggling to get transactions working, well responses at least!

I am using the Hashconnect service as a context wrapped about the app but also same result on a simple page with HC.

The transaction is sending ok and being paid via Hashpack Popup but the response is not being handled by the NPM

I can't see any writeup's for hc.transactionresolver, but its seems to be a persistent problem at least with React/NextJS.

I have tried a few things around resolver, but no luck!

let transResolve = await new Promise<MessageTypes.TransactionResponse>( (resolve) => (hashconnect.transactionResolver = resolve) ); - no error here, but still same issue from HC NPM

payModule

hashconnectAPIProvider

error

Appreciate any assistance :)

Hedera SDK introduced an easier way to deploy contracts (ContractCreateFlow) - Can't use that with HashPack due to no implementation of Signer.getAccountKey()

@teacoat FYI
Error: Signer.getAccountKey() is not implemented, but is required for ContractCreateFlow
at ContractCreateFlow.executeWithSigner (ContractCreateFlow.js:270:1)

This occurs when trying to use ContractCreateFlow()....executeWithSigner(signer) in the JS SDK with the HashConnect Signer.
See v2.15 of the SDK for details (https://github.com/hashgraph/hedera-sdk-js/releases/tag/v2.15.0)

ContractCreateFlow simplifies contract deployment of Hedera. It's a single module as opposed to having to use FileCreateTransaction(), FileAppendTransaction(), and ContractCreateTransaction()

Thanks!

Some methods may never resolve due to async race conditions and losing references

sendTransaction, requestAdditionalAccounts, and authenticate all return a Promise which may never resolve due to race conditions.

For example, if we call sendTransaction twice rapidly, then transactionResolver will be set twice. This will cause the first call to sendTransaction to never resolve because the first reference to transactionResolver will be lost before MessageHandler calls it receiving a RelayMessageType.TransactionResponse payload.

The following three properties are set by their corresponding methods, and may never resolve due to the error described above.

export class HashConnect implements IHashConnect {
   transactionResolver: (value: MessageTypes.TransactionResponse | PromiseLike<MessageTypes.TransactionResponse>) => void;
   additionalAccountResolver: (value: MessageTypes.AdditionalAccountResponse | PromiseLike<MessageTypes.AdditionalAccountResponse>) => void;
   authResolver: (value: MessageTypes.AuthenticationResponse | PromiseLike<MessageTypes.AuthenticationResponse>) => void;

   async sendTransaction(topic: string, transaction: MessageTypes.Transaction): Promise<MessageTypes.TransactionResponse> {
       ...
       return await new Promise<MessageTypes.TransactionResponse>(resolve => this.transactionResolver = resolve)
   }
   async requestAdditionalAccounts(topic: string, message: MessageTypes.AdditionalAccountRequest): Promise<MessageTypes.AdditionalAccountResponse> {
       ...
       return await new Promise<MessageTypes.AdditionalAccountResponse>(resolve => this.additionalAccountResolver = resolve)
   }
   async authenticate(topic: string, account_id: string, server_signing_account: string, serverSignature: Uint8Array, payload: { url: string, data: any }): Promise<MessageTypes.AuthenticationResponse> {
       ...
       return await new Promise<MessageTypes.AuthenticationResponse>(resolve => this.authResolver = resolve)
   }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.