Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toEvmAddress function is missing in AbstractAddress type, causing TypeScript error on import #3484

Open
xlzy905 opened this issue Dec 16, 2024 · 4 comments · May be fixed by #3492
Open

toEvmAddress function is missing in AbstractAddress type, causing TypeScript error on import #3484

xlzy905 opened this issue Dec 16, 2024 · 4 comments · May be fixed by #3492
Assignees
Labels
bug Issue is a bug chore Issue is a chore

Comments

@xlzy905
Copy link

xlzy905 commented Dec 16, 2024

fuels-ts SDK Version

0.97.2

Toolchain Versions

active toolchain ---------------- latest-aarch64-apple-darwin (default) forc : 0.49.3 - forc-client - forc-deploy : 0.49.3 - forc-run : 0.49.3 - forc-crypto : 0.49.3 - forc-doc : 0.49.3 - forc-explore : 0.28.1 - forc-fmt : 0.49.3 - forc-lsp : 0.49.3 - forc-tx : 0.49.3 - forc-wallet : not found fuel-core : 0.22.1 fuel-core-keygen : 0.22.1 fuels versions -------------- forc : 0.54.0

Node.js Version

No response

Browser

No response

Operating System

No response

Describe the Problem

When trying to use the toEvmAddress function from the AbstractAddress type, TypeScript throws an error because the function is not defined in the type. This issue occurs during the import process and prevents proper usage of the function in TypeScript.

FUEL_PROVIDER_URL = "https://mainnet.fuel.network/v1/graphql";

image

Code Snippet

No response

Contract ABI

No response

Errors

No response

@FuelLabs FuelLabs deleted a comment Dec 16, 2024
@danielbate danielbate self-assigned this Dec 16, 2024
@danielbate
Copy link
Contributor

Thank you for reporting this @xlzy905.

@FuelLabs/sdk-ts since the deprecation of bech32, is AbstractAddress redundant now? The hinting here is frustrating.

@petertonysmith94
Copy link
Contributor

@FuelLabs/sdk-ts since the deprecation of bech32, is AbstractAddress redundant now? The hinting here is frustrating.

I believe it's due to cross-package dependencies. If we redistribute these interfaces to their appropriate packages, then I believe we could potentially remove the @fuel-ts/interfaces package altogether.

@petertonysmith94
Copy link
Contributor

petertonysmith94 commented Dec 16, 2024

@xlzy905 in the meantime, a workaround would be to do the following:

import { Address } from 'fuels';

// Should have full access to all address methods from here.
const address = Address.fromAddressOrString(myWallet.address);
address.toEvmAddress();

Apologies for this inconvenience.

@xlzy905
Copy link
Author

xlzy905 commented Dec 17, 2024

@xlzy905 in the meantime, a workaround would be to do the following:

import { Address } from 'fuels';

// Should have full access to all address methods from here.
const address = Address.fromAddressOrString(myWallet.address);
address.toEvmAddress();

Apologies for this inconvenience.

Okay. Thank you for your answer

@petertonysmith94 petertonysmith94 added chore Issue is a chore bug Issue is a bug labels Dec 17, 2024
@petertonysmith94 petertonysmith94 linked a pull request Dec 20, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug chore Issue is a chore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants