dfinity / agent-js

A collection of libraries and tools for building software around the Internet Computer, in JavaScript.

Home Page:https://agent-js.icp.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Type 'Secp256k1KeyIdentity' is not assignable to type 'Identity

letmejustputthishere opened this issue · comments

Describe the bug
When creating an HttpAgent passing a Secp256k1KeyIdentity as the identity, ts complains with the following error

Type 'Secp256k1KeyIdentity' is not assignable to type 'Identity | Promise<Identity> | undefined'.
    Type 'Secp256k1KeyIdentity' is not assignable to type 'Identity'.
      The types returned by 'getPrincipal()' are incompatible between these types.

To Reproduce
Steps to reproduce the behavior:

Use @dfinity/agent@0.21.4 and @dfinity/identity-secp256k1@1.0.0 and try to create an HttpAgent with a secp identity.

Expected behavior
The types should be compatible

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Yea, I noticed the same issue yesterday. Currenly had to use 'any' type...