Giter Club home page Giter Club logo

Comments (2)

MJoaaquin avatar MJoaaquin commented on June 6, 2024

I had the same issue, did you find any solution?

from siwe.

ElliotWood13 avatar ElliotWood13 commented on June 6, 2024

@MJoaaquin I started adding various props that were classed as optional till I got it working. Here's a code snippet example of what mine looks like..

import { generateNonce, SiweMessage } from 'siwe'; // version "1.1.6"

function createSiweMessage(address: string) {
  const SESSION_DURATION_MS = 1000 * 60 * 60 * 4; // 4 hours (max allowed)
  const expirationDate = new Date(Date.now() + SESSION_DURATION_MS);

  const message = new SiweMessage({
    domain: example.com,
    address: address,
    statement: 'Sign in with Ethereum',
    uri: https://example.com/pathMaybeNeeded,
    version: '1',
    chainId: 80001,
    nonce: generateNonce(),
    expirationTime: expirationDate.toISOString(),
  });

  return message.prepareMessage();
}

It's worth checking if you're calling local host or if you're actually calling an external endpoint with the message.

I hope this helps you!

from siwe.

Related Issues (20)

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.