denpamusic / php-bitcoinrpc Goto Github PK
View Code? Open in Web Editor NEWFully unit-tested Bitcoin JSON-RPC client based on GuzzleHttp.
License: MIT License
Fully unit-tested Bitcoin JSON-RPC client based on GuzzleHttp.
License: MIT License
$result = $this->client->createrawtransaction($inputsArray, $outputsArray)->get();
wrong message:
Expected type array, got string
I have bitcoind open, tested and works with bitcoin-cli. Currently, when I do “bitcoind->getwalletinfo()->result();”, or rather any request at all, it will return an internal server error (500). I just moved the files which previously works on a windows computer to a linux VPS, installed a fresh version of thisibrary using linux Composer and made sure all the files were in the correct directories. Pls help ;-;
Hi
I am php developer I want send bitcoin form self wallet to another. Dothis package cab help me?
I am experimenting a coin and get to stage of sending from individual to another. I found out using "sentfrom" require to specify the account which i did not specify initially while generating the address, so to rectify this i want the system to automatically fix the account users to their addresses using "setaccount"
$bimcoind->setaccount(strval($addr),strval($id));
the error report says Denpa\Bitcoin\Exceptions\BadRemoteCallException: setaccount can only be used with own address
How do can i rectify or go about setting the account user to individual addresses.
I need help.
php-bitcoinrpc/src/functions.php
Line 121 in 172c184
Using set_exception_handler can override existings handler and can be a big problem for application that already use it.
For it has shutdown the NewRelic error reporting !
I suggest either to not use it or, to use it right before a call and call restore_exception_handler after the call (a successfull call or an error one).
I will have to find a way to change that. If i can will propose you a pullrequest
When I prep a valid json string and pass it to sendmany
, I get told it's not a valid json object:
https://developer.bitcoin.org/reference/rpc/sendmany.html
Denpa\Bitcoin\Exceptions\BadRemoteCallException
JSON value is not an object as expected
Here are some testnet addresses and amounts:
$payments = '{"tb1q87nfvuezn53pv5c6fwzz5tm9mp3dga9dajzel2":0.00014664,"tb1q87nfvuezn53pv5c6fwzz5tm9mp3dga9dajzel2":0.00048881,"tb1qmcnn8mxhdxa742nzdpcz0kzrdqtg7m0xvkes8t":0.0002444,"tb1qgc5vlfnt7fhnx5ly9yjt8zte8jppre0fa68xjl":0.00019776}';
Addresses to deduct fees from:
$addresses = '["tb1q87nfvuezn53pv5c6fwzz5tm9mp3dga9dajzel2","tb1q87nfvuezn53pv5c6fwzz5tm9mp3dga9dajzel2","tb1qmcnn8mxhdxa742nzdpcz0kzrdqtg7m0xvkes8t","tb1qgc5vlfnt7fhnx5ly9yjt8zte8jppre0fa68xjl"]';
I'm calling:
$send = $this->jsonrpc->sendmany(
"",
$payments,
1,
"My Comment",
$addresses
)->get();
And getting the error described above.
I'm expecting a TXID returned from the BTC node
Logs
If applicable, attach log files.
Feel free to omit any sensitive information.
Environment
Describe your runtime environment:
I've tried creating an array and json_encode() etc.. all fails.
Seems I need to explicitly send an object, but JSON is just a string.
Describe the bug
The latest Laravel version comes with Guzzle 7.0.1 See Guzzle 7 Released
Running composer fails with:
Your requirements could not be resolved to an installable set of packages.
To Reproduce
Run
composer require denpa/php-bitcoinrpc
with a fresh Laravel 7 installation
Expected behavior
Dependency should be met
Logs
composer require denpa/php-bitcoinrpc
Using version ^2.1 for denpa/php-bitcoinrpc
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for guzzlehttp/guzzle (locked at 7.0.1, required as ^7.0) -> satisfiable by guzzlehttp/guzzle[7.0.1].
- denpa/php-bitcoinrpc 2.1.x-dev requires guzzlehttp/guzzle ^6.3 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
- denpa/php-bitcoinrpc 2.2.x-dev requires guzzlehttp/guzzle ^6.3 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
- denpa/php-bitcoinrpc v2.1.0 requires guzzlehttp/guzzle ^6.3 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
- denpa/php-bitcoinrpc v2.1.1 requires guzzlehttp/guzzle ^6.3 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
- denpa/php-bitcoinrpc v2.1.2 requires guzzlehttp/guzzle ^6.3 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
- Conclusion: don't install guzzlehttp/guzzle 6.5.x-dev
- Installation request for denpa/php-bitcoinrpc ^2.1 -> satisfiable by denpa/php-bitcoinrpc[2.1.x-dev, 2.2.x-dev, v2.1.0, v2.1.1, v2.1.2].
Installation failed, reverting ./composer.json to its original content.
Environment
Describe your runtime environment:
Laravel Framework 7.25.0
PHP 7.3.11 (cli) (built: Jun 5 2020 23:50:40) ( NTS )
I almost deployed with this library and did a final test and found a problem. Guzzle returned this error (for no discernible reason, but thats not the point of this report): Recv failure: Connection was reset (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
The problem is that this library for some reason re-sent the transaction a second later during the same function call, so it double-sent the coins AND threw an error to top it all off.
You can reproduce this yourself I've wasted too much time already... Just force that error to occur when sending coins and see what happens.
Is there support for batch requests? I could not find any info about it.
It would be nice if we could do something like this:
$block = $bitcoind->getBlockHash([100, 101]');
and
$block = $bitcoind->getBlock(['000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f, '00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048']');
Describe the bug
when I invoke the method adrressbylabel, I hope only to receive the address with that label, however it returns all
To Reproduce
adrressbylabel
Feel free to omit any sensitive information.
Expected behavior
I hope only to receive the address with that label.
Cryptocurrency
Environment
Sorry for my ignorance but how can I send bitcoins to another address?
I'm trying
$send = $BTC->request('sendtoaddress', '*************************************************** 0.06');
Any example or not is possible?
Thanks ;D and good job.
See: denpamusic/laravel-bitcoinrpc#4 (comment)
Implement support for multiwallet RPC calls using wallet(string $walletname)
function.
Issue
I've encrypted my wallet with a passphrase. Running commands after this change needs using passphrase before calling methods, but I did not find anywhere to set such key.
My solution:
I suggest having a new option in configs to allow communicate with wallet using passphrase if it is set.
I have a system in which users buy packages and buy plans ETC, on they can make withdrawal requests on the basis of their earning, can I make their withdrawal requests automatically on the basis their request
hi, i'm not able to connect to my node (prune),maybe i haven't my .conf whith right options:
prune=550
rpcuser=xxxxxxxxxxxxx
rpcpassword=xxxxxxxxxxxxxxx
maxconnections=24
server=1
testnet=0
rpcconnect=127.0.0.1
daemon=1
Do i need to change anything? Thanks
$free = $this->getWallet("emptyWallet");
$address = $free->request("getnewaddress")->get();
$amount = $free->request("getbalance")->get();
$main = $this->getWallet("mainWallet");
var_dump($main->request("sendtoaddress", $address, $amount, "payment", "user", true, false, null, 'CONSERVATIVE')->get());
when you do this is works, but if you declare $main before $free variable, it mixes up things. This means it is bound to some static variables on backend. So, if you do write the code in the following order;
$main = $this->getWallet("mainWallet");
$free = $this->getWallet("emptyWallet");
$address = $free->request("getnewaddress")->get();
$amount = $free->request("getbalance")->get();
var_dump($main->request("sendtoaddress", $address, $amount, "payment", "user", true, false, null, 'CONSERVATIVE')->get());
It will give you "Insufficent Funds" error, as it will try to use the last active wallet's balance. "getWallet" function should not be static variable bound. Normally if you save it in memory on $main variable, when you use $main variable, it should point to the state of its declaration no matter which variable you change afterwards, as long as you don't change the main variable.
If it is working as non-static library, it should be completely compatible with it.
To reproduce this problem,
Just create two wallets, one of them should be empty. Put the empty wallet to $free variable section and the other to the $main. The second code group I sent will give you "Insufficent Funds" error no matter how much you have on the main wallet.
Problem 1
- The requested package denpa/php-bitcoinrpc No version set (parsed as 1.0.0) is satisfiable by denpa/php-bitcoinrpc[No version set (parsed as 1.0.0)] but these conflict with your requirements or minimum-stability.
please could tell me how to solve it.very thanks
Does this library work without Bitcoin core...
And can I create wallet, send BTC to wallet, receive BTC using this library?
Hello.
Tell me what to do next-after using $bitcoind-> Sendtoaddress in the case of using 3 networks:
Now I used this method (sendToAddress) in the regtest, I received the transaction Id. And then what to do - how to make sure that the transaction has confirmations? I understand correctly what I need to use with the createrawtransaction, then signrawtransactionwithwallet, and then sendrawtransaction? Or something else? How can I do this with your library?
Could you write in steps - what needs to be done.
Thanks.
example: https://btc.getblock.io/API_KEY/mainnet/
it can't connect
Fatal error: Uncaught Denpa\Bitcoin\Exceptions\BadRemoteCallException: Method not found in /var/www/html/bot/vendor/denpa/php-bitcoinrpc/src/Exceptions/Handler.php:70 Stack trace: #0 /var/www/html/bot/vendor/denpa/php-bitcoinrpc/src/Exceptions/Handler.php(107): Denpa\Bitcoin\Exceptions\Handler->requestExceptionHandler(Object(GuzzleHttp\Exception\ClientException)) #1 /var/www/html/bot/vendor/denpa/php-bitcoinrpc/src/Client.php(161): Denpa\Bitcoin\Exceptions\Handler->handle(Object(GuzzleHttp\Exception\ClientException)) #2 /var/www/html/bot/vendor/denpa/php-bitcoinrpc/src/Client.php(227): Denpa\Bitcoin\Client->request('listransactions') #3 /var/www/html/bot/index.php(19): Denpa\Bitcoin\Client->__call('listransactions', Array) #4 {main} thrown in /var/www/html/bot/vendor/denpa/php-bitcoinrpc/src/Exceptions/Handler.php on line 70
This is what I'm getting trying to run $bitcoind->listransactions();
Tried to use parameters like $bitcoind->listransactions('*',10); etc - got the same.
You referred to https://bitcoin.org/en/developer-reference#bitcoin-core-apis in the description. Are there any other functions which are not working?
Cryptocurrency
Environment
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.