Waves Keeper error


#1

Hi, i have the following error with Waves Keeper it happens using wampserver and Chrome:

{“message”:“Invalid request data”,“data”:“Failed to construct ‘URL’: Invalid URL”,“code”:“9”}

example code:

<script type='text/javascript'>
    
    $(document).ready( function () 
    {           
        window.WavesKeeper = Waves;
            
		$('.auth-btn').on('click', function (e) {
                WavesKeeper.auth({ name: 'Your App', data: 'Any stuff' })
                    .then(function (res) {
                        console.log(res);
                        $('#address')
                            .html('Your WAVES Address: <b>' + res.address + '</b>')
                            .removeClass('alert-danger').addClass('alert-success');
                    })
                    .catch(function (err) {
                        $('#address').html(JSON.stringify(err)).removeClass('alert-success').addClass('alert-danger');
                    });
                e.preventDefault();
            });

    });

#2

Hi,

This works for me.

Open chrome that has Waves Keeper installed. Go to inspect and then console - past this in and press enter:

const authData = { data: “Auth on my site” };
if (WavesKeeper) {
WavesKeeper.auth( authData )
.then(auth => {
console.log( auth ); //displaying the result on the console
/*…processing data /
}).catch(error => {
console.error( error ); // displaying the result on the console
/
…processing errors */
})
} else {
alert(“To Auth WavesKeeper should be installed.”);

}

It should ask you to Auth the request, and then log to console the details. From there use: https://docs.wavesplatform.com/en/waves-api-and-sdk/waves-keeper-api.html

Good luck!