bytesbay / web3-token

Web3 Token is a new way to authenticate users in a hybrid dApps using signed messages. Implementation of EIP-4361.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect type for verify() output

bluenex opened this issue · comments

The actual output object looks like this:

{
  address: string;
  body: {
    "expiration-time": string;
    "issued-at": string;
    "nonce": string;
    "uri": string;
    "web3-token-version": string;
  }
}

But the type defined is this:

web3-token/src/lib.d.ts

Lines 25 to 31 in da90d15

export function verify(
token: string,
opts?: VerifyOpts
): {
address: string;
body: VerifyBody;
};

The problem is VerifyBody doesn't have those fields mentioned above. I think having another type for verifying result is reasonable (probably as VerifyResult).

Fixed in the latest version