torusresearch / solana-embed

Embeds the Solana Wallet directly in your application via solana-embed. Exposes a Web3 Provider.
https://demo-solana.tor.us
12 stars 6 forks source link

fix: Repair type error with BaseProvider::request #23

Closed steveluscher closed 2 years ago

steveluscher commented 2 years ago

The main branch, at the moment, is not buildable, if you delete the package-lock.json.

npm install && npm run build
@rollup/plugin-typescript TS2416: Property 'request' in type 'BaseProvider<U>' is not assignable to the same property in base type 'SafeEventEmitterProvider'.
  Type '<T>(args: RequestArguments) => Promise<Maybe<T>>' is not assignable to type '<T, U>(args: RequestArguments<T>) => Promise<Maybe<U>>'.
    Types of parameters 'args' and 'args' are incompatible.
      Type 'RequestArguments<T>' is not assignable to type 'RequestArguments'.
        Types of property 'params' are incompatible.
          Type 'T' is not assignable to type 'Record<string, unknown> | unknown[]'.
            Type 'T' is not assignable to type 'unknown[]'.

In this PR, we update the package-lock, and the Typescript types.

metallicalfa2 commented 2 years ago

@steveluscher Thanks for the PR. I'm gonna merge it. (I was in the midst of fixing the issue)

steveluscher commented 2 years ago

Oh wow, I didn't intend this on being merged yet. It's missing a whole lot of stuff and the build actually doesn't work yet.

steveluscher commented 2 years ago

@metallicalfa: the current version of my repair-type-error-in-baseProvider branch is the one that fixes it!

steveluscher commented 2 years ago

Fixed in https://github.com/torusresearch/solana-embed/pull/25

metallicalfa2 commented 2 years ago

@steveluscher By bad. That exchange change was fixing another usage. Hence, i merged it.