<p>OP's found:</p>
<blockquote>
<p>The issue ultimately stemmed from sending numerical values with quotes around them. The function apparently identifies this as a string and disregards the value if it's expecting a number. Key point to remember when using easybitcoin-php - never place quotes around a parameter that is expecting a number</p>
</blockquote>
<p><sub>Community Wiki because material is all from comments</sub></p>

CC BY-SA 4.0
2024-01-21T11:48:17.000Z
2024-01-21T11:48:17.000Z
RedGrittyBrick
<p>I've been using easybitcoin to access &quot;Wallet RPCs&quot; as defined here - <a href="https://developer.bitcoin.org/reference/rpc/index.html#rawtransactions-rpcs" rel="nofollow noreferrer">https://developer.bitcoin.org/reference/rpc/index.html#rawtransactions-rpcs</a></p>
<p>But it doesn't seem to work with &quot;Rawtransactions RPCs&quot; like createrawtransaction or getrawtransaction.  Nothing is being returned from these calls.</p>
<p>Any ideas on how to get PHP to work with Rawtransactions RPCs?</p>

CC BY-SA 4.0
2024-01-19T14:52:32.917Z
What is "easybitcoin"? Is it a service, a library, a program? If you are trying to use someone else’s Bitcoin Core node, I would suggest that you use up-to-date documentation which would be found e.g. here for [v26.0.0](https://bitcoincore.org/en/doc/26.0.0). If you are using some service, have you checked that service’s documentation what API calls they provide access for?
Murch
CC BY-SA 4.0
2024-01-19T15:43:17.500Z
Are you using the library from https://github.com/aceat64/EasyBitcoin-PHP which has not been updated in the last seven years? Have you checked `->error` and `->raw_response`? Can you create the simplest possible PHP script that demonstrates the problem and edit it into your question?
RedGrittyBrick
CC BY-SA 4.0
2024-01-20T00:21:13.373Z
Yea RGB, that's the one. lol.  Checked out the error response and it's returning "Invalid parameter, missing vout key"; even though the vouts are being provided.  I was able to overcome other errors but I'm stuck at this one.
mista phi
CC BY-SA 4.0
2024-01-20T00:29:15.343Z
Yea RGB, that's the one. I checked out the error response and it's returning "Invalid parameter, missing vout key"; even though the vouts are sent.  I was able to overcome other errors but stuck at this one.  It turns out that the call has to be made with an array that's not formatted in json otherwise I get an error of "Expecting type array, got string".  The input I send is: Array ( [0] => Array ( [txid] => abcb22f7bee8e3c210ea73b2fb06acdb3ed71c12bc296b0337d83476c8d566e1 [vout] => 1 ) [1] => Array ( [txid] => abcbe89927171e204454f390a4e1bcc7d22cc450ba70fa5d667787bb6d449bf1 [vout] => 1 ) )
mista phi
CC BY-SA 4.0
2024-01-20T07:27:09.070Z
I've confirmed that it does work...  The issue ultimately stemmed from sending numerical values with quotes around them.  The function apparently identifies this as a string and disregards the value if it's expecting a number.  Key point to remember when using easybitcoin-php - never place quotes around a parameter that is expecting a number and you may have to send an array in the parms rather than sending it in json format.   Thx to you guys that contributed.
mista phi
CC BY-SA 4.0
2024-01-20T10:50:01.417Z
Here's a tip that may be helpful for others.  If your script is creating an array of utxo inputs to send to createrawtransaction, you too may get an error "Invalid parameter, missing vout key" - even when you are clearly including the vout in the array.  To resolve this, do a json_encode on the array, perform a str_replace to remove any quotes around vout values like str_replace('"0"', 0, str_replace('"1"', 1, $input)), then do a json_decode($input, true) to get an array again.  Use this array as input to createrawtransaction and you will no longer encounter the "missing vout key" error.
mista phi
CC BY-SA 4.0
2024-01-20T15:13:12.287Z
You can post an answer to your own question. This has the advantage that others with similar problems can see in their search results that this question has 1 answer instead of seeing it marked as 0 answers.
RedGrittyBrick
CC BY-SA 4.0
2024-01-21T22:12:08.577Z
@RedGrittyBrick - Sweet...  Thx for the tip
mista phi
<php><createrawtransaction><getrawtransaction>
EasyBitcoin-PHP not working for Rawtransactions RPCs
mista phi
# EasyBitcoin-PHP not working for Rawtransactions RPCs

(Asked by: username_0 on 2024-01-19)

I've been using easybitcoin to access "Wallet RPCs" as defined here - <https://developer.bitcoin.org/reference/rpc/index.html#rawtransactions-rpcs>

But it doesn't seem to work with "Rawtransactions RPCs" like createrawtransaction or getrawtransaction. Nothing is being returned from these calls.

Any ideas on how to get PHP to work with Rawtransactions RPCs?

**Tags:** php, createrawtransaction, getrawtransaction

> **Comments:**
> **username_1**: What is "easybitcoin"? Is it a service, a library, a program? If you are trying to use someone else’s Bitcoin Core node, I would suggest that you use up-to-date documentation which would be found e.g. here for [v26.0.0](https://bitcoincore.org/en/doc/26.0.0). If you are using some service, have you checked that service’s documentation what API calls they provide access for?  
> **username_2**: Are you using the library from https://github.com/aceat64/EasyBitcoin-PHP which has not been updated in the last seven years? Have you checked `->error` and `->raw_response`? Can you create the simplest possible PHP script that demonstrates the problem and edit it into your question?  
> **username_0**: Yea RGB, that's the one. lol.  Checked out the error response and it's returning "Invalid parameter, missing vout key"; even though the vouts are being provided.  I was able to overcome other errors but I'm stuck at this one.  
> **username_0**: Yea RGB, that's the one. I checked out the error response and it's returning "Invalid parameter, missing vout key"; even though the vouts are sent.  I was able to overcome other errors but stuck at this one.  It turns out that the call has to be made with an array that's not formatted in json otherwise I get an error of "Expecting type array, got string".  The input I send is: Array ( [0] => Array ( [txid] => abcb22f7bee8e3c210ea73b2fb06acdb3ed71c12bc296b0337d83476c8d566e1 [vout] => 1 ) [1] => Array ( [txid] => abcbe89927171e204454f390a4e1bcc7d22cc450ba70fa5d667787bb6d449bf1 [vout] => 1 ) )  
> **username_0**: I've confirmed that it does work...  The issue ultimately stemmed from sending numerical values with quotes around them.  The function apparently identifies this as a string and disregards the value if it's expecting a number.  Key point to remember when using easybitcoin-php - never place quotes around a parameter that is expecting a number and you may have to send an array in the parms rather than sending it in json format.   Thx to you guys that contributed.  
> **username_0**: Here's a tip that may be helpful for others.  If your script is creating an array of utxo inputs to send to createrawtransaction, you too may get an error "Invalid parameter, missing vout key" - even when you are clearly including the vout in the array.  To resolve this, do a json_encode on the array, perform a str_replace to remove any quotes around vout values like str_replace('"0"', 0, str_replace('"1"', 1, $input)), then do a json_decode($input, true) to get an array again.  Use this array as input to createrawtransaction and you will no longer encounter the "missing vout key" error.  
> **username_2**: You can post an answer to your own question. This has the advantage that others with similar problems can see in their search results that this question has 1 answer instead of seeing it marked as 0 answers.  
> **username_0**: @username_2 - Sweet...  Thx for the tip  

---

## 1 answers

### Answer by username_2 on 2024-01-21. Score: 0

OP's found:

> The issue ultimately stemmed from sending numerical values with quotes around them. The function apparently identifies this as a string and disregards the value if it's expecting a number. Key point to remember when using easybitcoin-php - never place quotes around a parameter that is expecting a number

Community Wiki because material is all from comments


---

