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

Building testnet sBTC deposit transaction failing #1573

Closed
kenrogers opened this issue Oct 10, 2023 · 1 comment
Closed

Building testnet sBTC deposit transaction failing #1573

kenrogers opened this issue Oct 10, 2023 · 1 comment
Labels
bug Unwanted or unintended logic causing harm

Comments

@kenrogers
Copy link

What version of Stacks.js are you using?

Using sBTC package

Describe the bug

When I try to build a new deposit transaction using the testnet helper, it fails due to lack of funds. I've verified that the address does indeed have UTXOs to spend. Checking the UTXOs in the console successfully shows them.

How to reproduce

Here is the code calling the function:

  const test = new TestnetHelper();
    const dev = new DevEnvHelper();

    const utxos = await test.fetchUtxos(
      userData.profile.btcAddress.p2wpkh.testnet
    );

    // get sBTC deposit address from bridge API
    const response = await fetch(
      "https://bridge.sbtc.tech/bridge-api/testnet/v1/sbtc/init-ui"
    );
    const data = await response.json();

    const tx = await sbtcDepositHelper({
      network: TESTNET,
      pegAddress: data.sbtcContractData.sbtcWalletAddress,
      stacksAddress: userData.profile.stxAddress.testnet,
      amountSats: satoshis,
      feeRate: test.estimateFeeRate("low"),
      utxos,
      bitcoinChangeAddress: userData.profile.btcAddress.p2wpkh.testnet,
    });
    console.log(tx);
    return;

Additional context

Bitcoin address being used to fetch UTXOs: tb1q3zl64vadtuh3vnsuhdgv6pm93n82ye8qc36c07

image
@kenrogers kenrogers added the bug Unwanted or unintended logic causing harm label Oct 10, 2023
@janniks
Copy link
Collaborator

janniks commented Oct 23, 2023

I think this is one we figured out, feel free to reopen if I'm misremembering 👍

@janniks janniks closed this as completed Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unwanted or unintended logic causing harm
Projects
Archived in project
Development

No branches or pull requests

2 participants