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

Multiple errors when using custom Stacks API #5996

Open
hstove opened this issue Dec 3, 2024 · 18 comments
Open

Multiple errors when using custom Stacks API #5996

hstove opened this issue Dec 3, 2024 · 18 comments
Assignees
Labels
area:api area:testnet bug Functionality broken bug-p2 Critical functionality broken for few users, with no clear workarounds extension sbtc

Comments

@hstove
Copy link
Contributor

hstove commented Dec 3, 2024

I've been trying to use Leather (6.54.0) with Nakamoto Testnet, but I've hit two different errors.

One, when switching to an existing network I've configured before for Nakamoto Testnet, I get this right after clicking the network in the network switching dialogue:

TypeError: useNativeSegwitAccountBuilder(...) is not a function
    at useNativeSegwitSigner (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/index.js:31374:50)
    at useCurrentAccountNativeSegwitSigner (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/index.js:31389:10)
    at useCurrentAccountNativeSegwitAddressIndexZero (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/index.js:31406:18)
    at Home (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/index.js:16705:107)
    at Nh (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103245:137)
    at cj (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103281:258)
    at Vk (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103376:88)
    at Uk (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103364:389)
    at Tk (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103364:320)
    at Ik (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103364:180)
    at Nk (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103355:88)
    at Ek (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103357:300)
    at jg (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103212:105)
    at chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103351:273

And then I can add a new Nakamoto Testnet, which gets me past that error, but I get this error when I try and submit a transaction:

TypeError: generateAccount is not a function
    at chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/index.js:31358:38
    at recomputationWrapper (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:255254:25)
    at memoized (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:255191:21)
    at dependenciesChecker (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:255266:39)
    at memoized (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:255191:21)
    at memoized (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:248874:28)
    at a (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:128804:204)
    at chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:128804:420
    at Object.useSyncExternalStore (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103263:368)
    at push.32713.exports.useSyncExternalStore (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:106971:309)
    at push.85317.exports.useSyncExternalStoreWithSelector (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:128804:489)
    at useSelector2 (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:248881:27)
    at useCurrentNativeSegwitAccount (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/index.js:31361:77)
    at useHasCurrentBitcoinAccount (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/index.js:31132:93)
    at useConfigBitcoinEnabled (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/index.js:30593:152)
    at TotalBalanceSuspense (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/index.js:2514:83)
    at Nh (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103245:137)
    at Vk (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103374:337)
    at Uk (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103364:389)
    at Tk (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103364:320)
    at Ik (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103364:180)
    at Nk (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103355:88)
    at Ek (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103357:300)
    at jg (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103212:105)
    at Wk (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103367:470)
    at Pk (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103365:398)
    at Gk (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:103354:269)
    at J (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:114921:203)
    at MessagePort.R (chrome-extension://ldinpeekobnhjjdofggfgjlcehhmanlj/61.js:114922:128)
Copy link

linear bot commented Dec 3, 2024

@hstove
Copy link
Contributor Author

hstove commented Dec 3, 2024

Another note is that, when creating the network, I get an error "Cannot determine ChainID from node". This error happens if I specify mainnet and testnet4 as the Bitcoin network. It seems to work if I select regtest or testnet3. When it works, it shows 0 Stacks balance, which I'm guessing is because it's querying an SPXXX (mainnet) address due to chainID stuff.

@314159265359879
Copy link
Contributor

@camerow

@314159265359879 314159265359879 added bug Functionality broken bug-p2 Critical functionality broken for few users, with no clear workarounds area:testnet area:api sbtc labels Dec 3, 2024
@markmhendrickson
Copy link
Collaborator

@camerow let's prioritize this during the current cycle given its relation to sBTC?

@camerow
Copy link
Collaborator

camerow commented Dec 10, 2024

Yeah, agreed. Calling in the big gun: @alter-eggo

@alter-eggo alter-eggo self-assigned this Dec 10, 2024
@markmhendrickson
Copy link
Collaborator

@alter-eggo resurfacing

@camerow camerow added the extension label Jan 7, 2025 — with Linear
@alter-eggo
Copy link
Contributor

@hstove can you please tell what urls you provide here?

Image

@hstove
Copy link
Contributor Author

hstove commented Jan 13, 2025

I was using https://api.nakamoto.testnet.hiro.so, but that's no longer a thing. I made no change to the Bitcoin API URL.

@alter-eggo
Copy link
Contributor

@hstove are there other url I can use to check?

@camerow
Copy link
Collaborator

camerow commented Jan 16, 2025

@alter-eggo how's progress going here, do you need me to help track down any more information?

@alter-eggo
Copy link
Contributor

@camerow I cannot replicate the issue without url to test 🤔

@hstove
Copy link
Contributor Author

hstove commented Jan 16, 2025

Hey @alter-eggo @camerow , I was able to find a different network's URL that repros the problem: https://api.nakamoto-2.hiro.so

Copy link
Collaborator

camerow commented Jan 16, 2025

Thank you @hstove!

@markmhendrickson markmhendrickson changed the title Multiple errors when using custom Stacks API Multiple errors when using custom Stacks API Jan 17, 2025
@markmhendrickson markmhendrickson changed the title Multiple errors when using custom Stacks API Multiple errors when using custom Stacks API Jan 17, 2025
@alter-eggo
Copy link
Contributor

hm, it's not event possible to add network with such url
network id on this url here is 512, though as I see from the code we support only 2147483648

export declare enum ChainID {
    Testnet = 2147483648,
    Mainnet = 1
}
Image

@kyranjamie
Copy link
Collaborator

Do we need to add a configuration to allow different chain IDs then, or can we infer it by calling the API?

@hstove
Copy link
Contributor Author

hstove commented Jan 27, 2025

Yep you can infer it from the URL, /v2/info gives network_id aka ChainID

@alter-eggo
Copy link
Contributor

alter-eggo commented Jan 27, 2025

@kyranjamie maybe call the api (url/v2/info) and check if network id is there? if yes - validation passed?

@alter-eggo
Copy link
Contributor

fixed validation here: #6093
added network with https://api.nakamoto-2.hiro.so/ and it works ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api area:testnet bug Functionality broken bug-p2 Critical functionality broken for few users, with no clear workarounds extension sbtc
Projects
None yet
Development

No branches or pull requests

6 participants