Where can I get types to describe integration actions with fuel wallet?

I have check this article about wallet and how to connect and disconnect but i need types description for my functions in typescript. Please help me to find npm type package or full type description of FuelWeb3Provider

7 Likes

Hey Lidia, I just screated a new category in the forum dedicated to the wallet and SDK. The npm package is https://www.npmjs.com/package/fuels and you can find the docs for the wallet SDK here API | Fuel Wallet

4 Likes

Yes, I have seen this one already, and my question was about this category.
So, I am looking for a types description for this wallet object called FuelWeb3

something like @types/fuels, but they’re nothing like this on npm

Type for methods and instances are mentioned in the article but there is no link where I can get them.



4 Likes

Also, you can check this topic for more info

5 Likes

Hi @sway, you don’t provide a nice way to import types yet. But the work is in progress. You can track it here: Add FuelWeb3 on the types package · Issue #310 · FuelLabs/fuels-wallet · GitHub.

But you can use a temporary solution for it by installing: https://www.npmjs.com/package/@fuel-wallet/sdk

And adding into a types file the following code;

import { FuelWeb3SDK } from '@fuel-wallet/sdk';

declare global {
  interface Window {
    FuelWeb3: FuelWeb3SDK;
  }
}

Once the PR is merged you are going to be able to import '@fuel-wallet/sdk directly into your types.d.ts or react-app-env.d.ts by adding the following line;

/// <reference types="@fuel-wallet/sdk" />

Or directly on the tsconfig config file by adding;

{
    "compilerOptions": {
          "types": ["@fuel-wallet/sdk"]
    }
    ...
}
3 Likes

Wonderful, thats what I was looking for, i will follow this PR
thanks

4 Likes

@sway the new versions with the types are now available on @fuel-wallet version 0.2.0. https://www.npmjs.com/package/@fuel-wallet/sdk

3 Likes

Wow, you guys are so good

4 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.