Skip to content
This repository has been archived by the owner on Oct 24, 2020. It is now read-only.

Am having issues creating transaction and sending it to the network #34

Closed
nwa070 opened this issue Jul 4, 2017 · 3 comments
Closed

Comments

@nwa070
Copy link

nwa070 commented Jul 4, 2017

Please help me out, i can create address and i can get address balance but my problem now i can not create transaction, even when i tried to use btc test net it still not working, but when i try the default sample source code, the code works fine both in btctest net and and sample code.
These are the error i keep on getting
"Got Http response code 400 when accessing https://api.blockcypher.com/v1/bcy/test/txs/new?token="

{
"errors": [
{
"error": "Unable to find a transaction to spend for address 1JHMjL7V3heBZYieNcyHaqvy2aPA5fmY7S."
},
{
"error": "Error building transaction: Invalid output address: wrong network.."
},
{
"error": "Not enough funds after fees in 0 inputs to pay for 0 outputs, missing -14200."
},
{
"error": "Error validating generated transaction: Transaction missing input or output."
}
],
"tx": {
"block_height": -1,
"block_index": -1,
"hash": "d21633ba23f70118185227be58a63527675641ad37967e2aa461559f577aec43",
"addresses": [],
"total": 0,
"fees": 0,
"size": 10,
"preference": "low",
"relayed_by": "178.33.235.187",
"received": "2017-07-04T18:46:17.299499716Z",
"ver": 1,
"lock_time": 0,
"double_spend": false,
"vin_sz": 0,
"vout_sz": 0,
"confirmations": 0,
"inputs": [],
"outputs": []
}
}

when i check the log file
this is what i see

[29-06-2017 09:08:53] BlockCypher\Validation\ModelAccessorValidator: DEBUG : Missing Accessor: BlockCypher\Api\TX:setBlockIndex. You might be using older version of SDK. If not, create an issue at https://github.com/blockcypher/php-client/issues
[29-06-2017 09:08:53] BlockCypher\Validation\ModelAccessorValidator: DEBUG : Missing Accessor: BlockCypher\Api\TX:setBlockIndex. You might be using older version of SDK. If not, create an issue at https://github.com/blockcypher/php-client/issues

please help me the createTransaction.php and CreateAndSignAndSendTransaction.php error has kept me in a box since 4months till now.

@josecelano
Copy link
Contributor

Hi, that API enpoint https://api.blockcypher.com/v1/bcy/test/txs/new?token= is for BlockCypher tesnet, and the address 1JHMjL7V3heBZYieNcyHaqvy2aPA5fmY7S is a Bitcoin mainnet address.

  • Unable to find a transaction to spend for address 1JHMjL7V3heBZYieNcyHaqvy2aPA5fmY7S -> Address 1JHMjL7V3heBZYieNcyHaqvy2aPA5fmY7S has no balance.
  • Error building transaction: Invalid output address: wrong network -> url for tesnnet, address mainet.
  • Not enough funds after fees in 0 inputs to pay for 0 outputs -> Balance from inputs should include tx fee.
  • Error validating generated transaction: Transaction missing input or output -> missing output?

Please paste here, code, and API request/reponse.

@misuqian
Copy link

hi.is there any api for create mainnet address transaction?

@rakeshrocket
Copy link

rakeshrocket commented Oct 24, 2018

I have one issue: below is the detail
URL: https://api.blockcypher.com/v1/btc/main/txs/new?token=-----
Input: {"inputs":[{"addresses": ["18uD4cigMKrgpJAsmM2fhgHT7wv69YX8vU"]}],"outputs":[{"addresses": ["1Pa7Byxz4znVgwuipoXFLU92jfQoXL1V43"], "value": 10000}]}

Response:
{
"tx": {
"block_height": -1,
"block_index": -1,
"hash": "3d858706db789de99060c9b1cb4f662557163c82b50db0afbc96df8e0f79fc63",
"addresses": [
"18uD4cigMKrgpJAsmM2fhgHT7wv69YX8vU",
"1Pa7Byxz4znVgwuipoXFLU92jfQoXL1V43"
],
"total": 10000,
"fees": 9000,
"size": 85,
"preference": "high",
"relayed_by": "122.162.222.156",
"received": "2018-10-24T08:11:00.276190087Z",
"ver": 1,
"double_spend": false,
"vin_sz": 1,
"vout_sz": 1,
"confirmations": 0,
"inputs": [
{
"prev_hash": "e809c05a231e8553bb918a9a64c8f9b0f36b9698ac9bfdca3feb99dce7d7d390",
"output_index": 0,
"output_value": 19000,
"sequence": 4294967295,
"addresses": [
"18uD4cigMKrgpJAsmM2fhgHT7wv69YX8vU"
],
"script_type": "pay-to-pubkey-hash",
"age": 547044
}
],
"outputs": [
{
"value": 10000,
"script": "76a914f795a91c61b61babab1ffea92ac86fac9aa3558f88ac",
"addresses": [
"1Pa7Byxz4znVgwuipoXFLU92jfQoXL1V43"
],
"script_type": "pay-to-pubkey-hash"
}
]
},
"tosign": [
"75956288835fed989c8da40e4ee81d9cde0c311afa464ec7ba93c0e974c98cc5"
]
}

Issue: Receiver wallet is not getting any amount. Please help me out. Thanks in advance.
AND balance in from address is 19000 satoshi

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants