You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i use the api: https://api.blockcypher.com/v1/btc/test3/txs/new
If the parameter looks like that, the result is normal { "inputs": [{ "addresses": [ "mhCcmGJ8dFzenpz9p4DQM8gWHW62LNPUzN" ] }], "outputs": [{ "addresses": [ "2N8SH6dNdfi6T4UeATox4NsU7eJ3s3ZmTTj" ], "value": 10 }] }
** 1. An error will be reported if I change the inputs address to pay-to-script-hash address**
request:
{"inputs":[{"addresses": ["2N8SH6dNdfi6T4UeATox4NsU7eJ3s3ZmTTj"]}],"outputs":[{"addresses":["mhCcmGJ8dFzenpz9p4DQM8gWHW62LNPUzN"], "value": 10}]}
response:
"errors": [
{
"error": "Error building input: Cannot use P2SH as input without 'script_type' set to 'multisig-n-of-m'"
},
{
"error": "Not enough funds in 1 inputs to pay for 1 outputs, missing -10."
},
{
"error": "Not enough funds after fees in 0 inputs to pay for 1 outputs, missing -8810."
},
{
"error": "Error validating generated transaction: Transaction missing input or output."
}
]
** 2. Then I try to add “script_type” to the argument and still get an error.**
reqest:
{"inputs":[{"addresses": ["2N8SH6dNdfi6T4UeATox4NsU7eJ3s3ZmTTj"],"script_type": "pay-to-script-hash"}],"outputs":[{"addresses":["mhCcmGJ8dFzenpz9p4DQM8gWHW62LNPUzN"], "value": 10}]}
response:
{
"errors": [
{
"error": "Error building input: Cannot use P2SH as input without 'script_type' set to 'multisig-n-of-m'"
},
{
"error": "Not enough funds in 1 inputs to pay for 1 outputs, missing -10."
},
{
"error": "Not enough funds after fees in 0 inputs to pay for 1 outputs, missing -8810."
},
{
"error": "Error validating generated transaction: Transaction missing input or output."
}
],
"tx": {
"block_height": -1,
"block_index": -1,
"hash": "8d9346abe91b6dfe9f57df853bfe38309749b1dad36a9ef3410aa450b539746b",
"addresses": [
"mhCcmGJ8dFzenpz9p4DQM8gWHW62LNPUzN"
],
"total": 10,
"fees": 0,
"size": 44,
"vsize": 44,
"preference": "low",
"relayed_by": "39.108.86.138",
"received": "2022-06-19T13:50:35.870756092Z",
"ver": 1,
"double_spend": false,
"vin_sz": 0,
"vout_sz": 1,
"confirmations": 0,
"inputs": [],
"outputs": [
{
"value": 10,
"script": "76a914127875f1bfeef15a909066fe7827970fb7abdbc188ac",
"addresses": [
"mhCcmGJ8dFzenpz9p4DQM8gWHW62LNPUzN"
],
"script_type": "pay-to-pubkey-hash"
}
]
}
}
I wonder if the API input parameter does not support p2sh addresses. Or I sent the wrong parameters
thank you
The text was updated successfully, but these errors were encountered:
When i use the api:
https://api.blockcypher.com/v1/btc/test3/txs/new
If the parameter looks like that, the result is normal
{ "inputs": [{ "addresses": [ "mhCcmGJ8dFzenpz9p4DQM8gWHW62LNPUzN" ] }], "outputs": [{ "addresses": [ "2N8SH6dNdfi6T4UeATox4NsU7eJ3s3ZmTTj" ], "value": 10 }] }
** 1. An error will be reported if I change the inputs address to pay-to-script-hash address**
** 2. Then I try to add “script_type” to the argument and still get an error.**
I wonder if the API input parameter does not support p2sh addresses. Or I sent the wrong parameters
thank you
The text was updated successfully, but these errors were encountered: