Skip to content

Error BigInt #6657

Open
Open

Description

@Nexov25

${expected} and got ${JSON.stringify(data)},
^

TypeError: Do not know how to serialize a BigInt
at JSON.stringify ()
at throwForUpdateMaker (/storage/emulated/0/abotwa/.dzkbot/node_modules/bitcoinjs-lib/node_modules/bip174/src/lib/utils.js:60:35)
at Object.updateInput (/storage/emulated/0/abotwa/.dzkbot/node_modules/bitcoinjs-lib/node_modules/bip174/src/lib/utils.js:96:13) at Object.addInputAttributes (/storage/emulated/0/abotwa/.dzkbot/node_modules/bitcoinjs-lib/node_modules/bip174/src/lib/utils.js:114:11)
at Psbt.addInput (/storage/emulated/0/abotwa/.dzkbot/node_modules/bitcoinjs-lib/node_modules/bip174/src/lib/psbt.js:99:13)
at Psbt.addInput (/storage/emulated/0/abotwa/.dzkbot/node_modules/bitcoinjs-lib/src/psbt.js:212:13)

Activity

  1. davidkaplanbitgo commented on Aug 11, 2025

    @davidkaplanbitgo
    Contributor

    Can you please show how you generated this error?

  2. Nexov25 commented on Aug 12, 2025

    @Nexov25
    Author

    psbt.addInput({
    hash: utxo.id,
    index: utxo.vout,
    witnessUtxo: {
    script: sellerScript,
    value: BigInt(utxo.amount),
    },
    redeemScript: p2sh.redeem.output
    });

    psbt.addOutput({
    script: bitgo.address.toOutputScript(buyerAddress, this.networks),
    value: BigInt(bitcoinAmount)
    });

        psbt.addOutput({
            script: bitgo.address.toOutputScript(sellerAddress, this.networks),
            value: BigInt(accumulated - bitcoinAmount)
        });
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions