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

Cannot create BCH address with format cashaddr #2486

Open
plopezlpz opened this issue Jul 7, 2022 · 5 comments
Open

Cannot create BCH address with format cashaddr #2486

plopezlpz opened this issue Jul 7, 2022 · 5 comments
Labels

Comments

@plopezlpz
Copy link

Environment Details

  • OS: MacOS
  • Node Version: v14.18.1
  • Yarn Version: v1.22.17
  • BitGoJS Version: 14.1.2
  • BitGo Environment: testnet

Expected Behavior

I should be able to create a BCH address with format cashaddr

Current Behavior

Error "invalid address: bchtest:pqyynzzfct29s4wljeu8r2e4ltghknvhfcqe6062ue"

Possible Solution

Steps to Reproduce

const bitgo = new BitGo({ accessToken: "YOUR_ACCESS_TOKEN", env: "test" });
bitgo.coin("tbch").wallets()
    .get({ id: "YOUR_WALLET_ID" })
    .then(w => w.createAddress({ label: "test", format: "cashaddr" }))
    .catch(console.error));
@plopezlpz plopezlpz added the bug label Jul 7, 2022
@plopezlpz plopezlpz changed the title Cannot create BCH address with format cashaddr Cannot create BCH address with format cashaddr Jul 7, 2022
@plopezlpz plopezlpz changed the title Cannot create BCH address with format cashaddr Cannot create BCH address with format cashaddr Jul 7, 2022
@plopezlpz plopezlpz changed the title Cannot create BCH address with format cashaddr Cannot create BCH address with format cashaddr Jul 7, 2022
@plopezlpz
Copy link
Author

this method is returning false for bch addresses in cashaddr format:

isValidAddress(address: string, forceAltScriptSupport = false): boolean {

@mmcshinsky-bitgo mmcshinsky-bitgo self-assigned this Jul 21, 2022
@mmcshinsky-bitgo
Copy link
Contributor

Hi @plopezlpz. I was able to replicate your error. The address created is correct but I do see the same returned error. I'm going to initiate fixing this. Thank you!

@wobondar
Copy link

hi @mmcshinsky-bitgo,

is there any progress on that?

Thank you!

@mmcshinsky-bitgo
Copy link
Contributor

mmcshinsky-bitgo commented Jul 26, 2022

I've tracking down the commit that may be the candidate for throwing an error for bitcoincash. I'm following up with other engineers across timezones so there may be a delay while I receive information on the changes.

At the moment, I recommend:

  1. hitting the API directly while we work towards a resolution (safe)
  2. wrapping the single createAddress instance in a try/catch and letting the correct error "pass" since the address is being successfully created (not safe)

@mmcshinsky-bitgo mmcshinsky-bitgo removed their assignment Nov 8, 2022
@btcromesh
Copy link

Would anyone be able to fix these files names?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants