GithubHelp home page GithubHelp logo

dryphp / bitcoin.php Goto Github PK

View Code? Open in Web Editor NEW
240.0 240.0 113.0 161 KB

Bitcoin library for PHP.

Home Page: http://www.nostate.com/3962/bitcoin-php-a-php-library-for-bitcoin/

PHP 100.00%
bitcoin bitcoin-php php

bitcoin.php's People

Contributors

artob avatar dexus avatar fabacab avatar mezrin avatar mikegogulski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitcoin.php's Issues

add segwit support

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? #

move from account.

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!

addmultisigaddress

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

Default account not accepted by certain methods

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."

checkAddress doesnt work with testnet

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.

wrong error messages

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}

)

Gap_Limit?

I am wondering if I ARCHIVE an unused address, would that solve the Gap_Limit?

Move command won't work with blockchain

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.

Sendmany strips amounts from array

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
}

please add listtransactions

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

Expand maintainership of the project

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.