dryphp / bitcoin.php Goto Github PK
View Code? Open in Web Editor NEWBitcoin library for PHP.
Home Page: http://www.nostate.com/3962/bitcoin-php-a-php-library-for-bitcoin/
Bitcoin library for PHP.
Home Page: http://www.nostate.com/3962/bitcoin-php-a-php-library-for-bitcoin/
To people who are downloading this code--please note that a more up to date version exists as a part of the Drupal uc_bitcoin project at http://drupal.org/project/uc_bitcoin. Please consider downloading this and retriveing bitcoin.inc from this project.
Hello, I have some difficult to get command "addmultisigaddress" working.
From help:
Examples:
Add a multisig address from 2 addresses
bitcoin-cli addmultisigaddress 2 "["16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5","171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV"]"
As json rpc call
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addmultisigaddress", "params": [2, "["16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5","171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
I tried this:
$data = Array("firstAddress","secondAddress");
$client->query("addmultisigaddress",2,json_encode($data));
But in the response tcpdumped it says command is malformed, I tried in every way but I havn't success, can you help me?
Thank you
I have a idea, but idk if it's the right way:
1 - create a legacy address (normal address) and store in a var.
2 - create a segwit address with legacy address created previously
So, any idea? Suggestion? #
https://github.com/mikegogulski/bitcoin-php/blob/master/src/bitcoin.inc#L873
This check do not allow to work with default (empty) account ''
As those watching the repo may have noticed, this project now has a permanent new home at https://github.com/dryphp/bitcoin.php. (It previously lived at https://github.com/mikegogulski/bitcoin-php.)
As the original author @mikegogulski has long since moved on to other endeavors, I'm helping hand off commit bits (in a manner similar to the C4 process) to anyone who has significantly contributed to this project previously or has done significant work in their own fork of the project.
Pinging the following folks in particular, in case they'd be interested in folding their work back upstream:
Also CCing @sam2kb, @justmoon, and @globalcitizen, who already had push access, as well as @Dexus, @mezrin, and @psyvisions, to whom I've extended push access today for their past contributions.
Also notifying @meitar, @DarrellDuane, @parweb, @slawekw, and @bartek6949 who have each previously made at least one commit to a fork of their own.
You should manage too the compressed public key in Bitcoin::pubKeyToAddress()
This appears on cron run. Any ideas?
Drupal 6-x.x, with curl and both RPCs present.
I am wondering if I ARCHIVE an unused address, would that solve the Gap_Limit?
my client does not check to see if the address is claimed by another account in the wallet.
What's the best way to check for this and use the move function.
I'm attempting to build off chain transactions within the same wallet to avoid paying fees.
Thanks!
When starting bitcoind with "-testnet" causes site testing to fail.
The reason is that in checkAddress(bitcon-php.inc) the address version is bound to be (1 byte) 00000000
Since the testnet has (1 byte) 00000111
... the checkAddress($address) will return false when running a site for development.
hello
can you please add the method :
listtransactions [account] [count=10] [from=0]
here is the one i have made :
/**
* Return an array of transactions made by an account.
*
* @param string $account The account to get transactions from.
* @param integer $count The number of transactions to return.
* @param integer $from The start number of transactions.
* @return array An array.
*/
public function listtransactions($account = "", $count = 10, $from = 0) {
if (!is_numeric($count) || $count < 0)
throw new BitcoinClientException('listtransactions requires a numeric count >= 0');
if (!is_numeric($from) || $from < 0)
throw new BitcoinClientException('listtransactions requires a numeric from >= 0');
return $this->query("listtransactions", $account, $count, $from);
}
during the time you are reading this, please merge the other patches to keep this very good library alive and not leave it forked in multiple versions.
thank you in advance
Fix your thing please...
I've spent several hours now trying to get sendmany working . I finally appear to have everything in the correct format, however for some reason sendmany appears to be stripping the amounts from the array I pass it.
Here's what var_dump tells me it's passing to sendmany:
array(2) {
["AcRHK6pzn2iT7e4xTZzYQDEitjXN3ecLaj"]=>
float(0.06643307)
["Ae2ZwXUFyymNo3JVkKAjT9k3akURK7bmxo"]=>
float(6.630817816701)
}
However when I run a tcpdump on the daemon I see the following:
"method": "sendmany",
"params": [
"default",
{"AcRHK6pzn2iT7e4xTZzYQDEitjXN3ecLaj":"","Ae2ZwXUFyymNo3JVkKAjT9k3akURK7bmxo":""},
1
],
"id": null
}
Can this be used to create private keys and public address pairs similar to https://www.bitaddress.org. If so, how would I go about doing so?
If i have insufficent funds the API itself returns
"Insufficient funds"
but this is not transported into your lib.
instead it returns
"Didn't receive 200 OK from remote server. (HTTP/1.1 500 Internal Server Error)"
I think it should better return the problem.
debug info returned from json_rpc after trying to send:
(object)jsonrpcresp
jsonrpcresp Object
(
[content_type] => application/json
[id] =>
[val] => 0
[valtyp] =>
[errno] => 5
[errstr] => Didn't receive 200 OK from remote server. (HTTP/1.1 500 Internal Server Error)
[payload] =>
[hdrs] => Array
(
)
[_cookies] => Array
(
)
[raw_data] => HTTP/1.1 500 Internal Server Error
Date: Tue, 19 Jul 2011 22:53:24 +0000
Connection: close
Content-Length: 77
Content-Type: application/json
Server: bitcoin-json-rpc/0.3.24-beta
{"result":null,"error":{"code":-4,"message":"Insufficient funds"},"id":null}
)
Hi,
I use JSON RPC API of blockchain and when i try to use move function he return an error message ! Any one can provide a help ?
Thank's.
My code:
function pay($from, $to, $amount) {
$bitcoin = new jsonRPCClient('http://'.json_username.':'.json_password.'@'.json_server.':'.json_port.'/');
$move = $bitcoin->move($from, $to, $amount);
return $move;
}
Get an error from jsonRPCClient.php lib.
The default account name in a wallet is the empty string "". However, several methods reject this when given as a parameter. The following methods seem to be affected:
getaccountaddress
getaddressesbyaccount
getreceivedbyaccount
sendfrom
sendmany
For example, it's not possible to call $bc->getaccountaddress("") to get the default account's address. It will fail with an exception saying "getaccountaddress requires an account."
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.