Timeline for Bitcoinjs-lib how to add multiple utxos in addInput
Current License: CC BY-SA 4.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 31, 2020 at 10:49 | vote | accept | Hamza Yasin | ||
Mar 31, 2020 at 10:45 | comment | added | Hamza Yasin | Yes it does. i would like to upvote this answer but can't don't have such reputations. Thanks (Y) | |
Mar 31, 2020 at 8:53 | comment | added | MCCCS | Does it work now? | |
Mar 31, 2020 at 8:53 | history | edited | MCCCS | CC BY-SA 4.0 |
added 305 characters in body
|
Mar 31, 2020 at 5:33 | comment | added | Hamza Yasin | Sure I'll be waiting | |
Mar 30, 2020 at 19:54 | comment | added | MCCCS | I'll post a solution tomorrow. | |
Mar 30, 2020 at 19:16 | comment | added | Hamza Yasin | I have updated the question with the new code please see the code above and also read the comments in code. Thanks | |
Mar 30, 2020 at 19:02 | comment | added | Hamza Yasin | Do i have your email so that i can send you my full file, so that you will know what i'm doing | |
Mar 30, 2020 at 18:58 | comment | added | Hamza Yasin | It doesn't work actually, Here is my inputs now: ` let utxo = [{ txId: 'hash', outputIndex: 1, address: 'ltc1...', script: '00142f37386a7c332261dc4d77f77b0b92cbb9abf3e4', satoshis: 3000000 }, { txId: 'hash', outputIndex: 0, address: 'ltc1...', script: '00142f37386a7c332261dc4d77f77b0b92cbb9abf3e4', satoshis: 2000000 } ] utxo.map(item => { txb.addInput(item.txId, item.outputIndex, null, scriptPubkey); }) txb.addOutput("ltc1q9umns6nuxv3xrhzdwlmhkzujewu6hulyuwgx30", 4999000); txb.sign(0, keypair, null, null, 5000000); ` | |
Mar 30, 2020 at 18:34 | comment | added | MCCCS |
Does it work for you now? Passing each scriptPubkey to each sign with each input.
|
|
Mar 30, 2020 at 18:33 | history | edited | MCCCS | CC BY-SA 4.0 |
deleted 672 characters in body
|
Mar 30, 2020 at 18:22 | comment | added | Hamza Yasin | Yes i'm using bitcoinjs-lib instead of bitcore-lib, Let me tell you, I have used bitcore-lib for bitcoin bech32 addresses and it works fine to sign the transacations, But when i used litecore-lib to sign bech32 transactions for LTC so it fails because litecore-lib doesn't support it. So that's wht i'm using bitcoinjs-lib to sign transactions for litecoin bech32 transactions, which works fine when i have sigle utxo object on my address but when array has multiple utxos so i got confuse which object i have to use? on the same case bitcore-lib txb.from(utxo) it accept array. | |
Mar 30, 2020 at 15:57 | comment | added | MCCCS | Are you using bitcore-lib-ltc? The code in the question seems to use bitcoinjs instead of bitcore-lib. | |
Mar 30, 2020 at 14:52 | comment | added | Hamza Yasin | I thought to do this, but i think i have a stupid question here, You know when using bitcore-lib, we pass utxo array of object in from function like this: txb.from(utxo).to(recipient, value).sign() I want to use addInput function like that. Ass i'm doing this for litecoin so i can't use litecore-lib as it don't support bech32.I hope you understand my question. | |
Mar 30, 2020 at 13:05 | history | answered | MCCCS | CC BY-SA 4.0 |