ccwalletio/tracker

Where is the signData() or equivalent method for signing a message with the Eternl wallet?

Opened this issue · 0 comments

I have done some work to enable and connect to the Eternl wallet and it works. Now I want to sign a message using the wallet for signature verification on the server side. I am using the latest Helios library to interact with the Eternl wallet.

I do see the signTx method for signing transactions attached to the API object created by wrapping the CIP30 handle returned by the enable call. But I don't see a signData method or anything that seems to do the same function. Where do I find that method?

This screen shot shows the interface exposed by the CIP30 handle object, as wrapped by the Helios Cip30Wallet and WalletHelper objects:

image

This is the code I use to connect to the wallet:

            // The wallet must be enabled/connected before attempting
            //  to get the network ID because we get the Cip30Handle
            //  from the enable call.
            self.cip30Handle = await self.cardanoWalletObj.enable()
                .catch(err => {
                    bErrorOccurred = true;

                    // Build the error message.
                    const subErrMsg = misc_shared_lib.conformErrorObjectMsg(err);
                    errMsg = `${errPrefix} -> The following error occurred when calling self.cardanoWalletObj.enable(): ${subErrMsg}`;

                    console.error(`${errMsg} - promise`);
                });

            // Did an unexpected error occur?
            if (bErrorOccurred)
                // Throw the error message that was set.
                throw new Error(errMsg);

            // Create a wallet API object to house the received raw Cip30Handle
            //  object.
            self.cardanoWalletApiObj = new Cip30Wallet(self.cip30Handle);

            // Create a Helios WalletHelper object too for later use.
            self.cardanoWalletHelperObj = new WalletHelper(self.cardanoWalletApiObj);

The cardanoWalletObj contains a refence to the window.cardano.eternl object found in the browser's global variable space. (Chrome)