Giter Club home page Giter Club logo

block_io-php's People

Contributors

doersf avatar nowackipawel avatar owenvoke avatar patricklodder 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

Watchers

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

block_io-php's Issues

Force use of TLSv1 is not working

All the POST requests I'm trying to send end up with exception:
"An error occurred while validating SSL connectivity. Please make sure you are using TLSv1 or above."

I see curl is forced to use TLSv1 already but looks like this is not working.

I'm testing on:

  • Ubuntu 14.04
  • PHP 5.6.13
  • cURL 7.35.0

Can you please recommend me anything to solve this issue?

Fail request When use $block_io->sweep_from_address

$sweepInfo = $block_io->sweep_from_address(array('from_address' => $from_address, 'to_address' => $to_address, 'private_key' => $private_key));

Hi,

I used this command sweep_from_address, I have a Private key but when i connect to block_io server it fails my request ,

` from_address = $new_address->data->address;
try
{

        $sweepToAddress = $block_io->sweep_from_address(array('from_address' => $from_address, 'to_address' => 'xxxxxx', 'private_key' => 'xxxxxx'));
    
        echo $sweepToAddress->status;  //<<<fail
        
    } catch (Exception $e) {
        echo $e->getMessage() . "\n";
    }

`

Problem with withdraw

Hi
I wrote a sample code for withdrawing.
It's work for 3 months.
But it doesn't work today!
I get this error!

Please guide me.
Thanks

{
"status": "fail",
"data": {
"error_message": "Please use client-side signatures for this request. You can use our official PHP/Ruby/NodeJS/Python libraries; see block.io/api."
}
}

Queries regarding block_io payment processing.

Hey,

We want to process payment through another wallet to my block_io wallet. Is there any documentation for it? since we are trying to call prepare_transaction with another wallet address it's throwing some errors regarding addresses not exist in account. So can anyone please help me how can process payment?

Class 'BitWasp\Bitcoin\Network\NetworkFactory' not found

I am using Laravel getting the following error log on use of the used create_and_sign_transaction request
Laravel.log

BitWasp\Bitcoin\Network\NetworkFactory' not found {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Class 'BitWasp\Bitcoin\Network\NetworkFactory' not found . . .
#0 C:\xampp2\htdocs\blockio\core\app\Http\Lib\BlockIo.php(197): App\Lib\BlockIo->getNetwork('DOGE')
#1 C:\xampp2\htdocs\blockio\core\app\Http\Controllers\PaymentController.php(91): App\Lib\BlockIo->create_and_sign_transaction(Object(stdClass))
#2 [internal function]: App\Http\Controllers\PaymentController->withdrawPost(Object(Illuminate\Http\Request))
#3 C:\xampp2\htdocs\blockio\core\vendor\laravel\framework\src\Illuminate\Routing\Controller.php(54): call_user_func_array(Array, Array)

Also my Controller
$apiKey = $method->val1;
$version = 2;
$pin = $method->val2;
$block_io = new BlockIo($apiKey, $pin, $version);
$convert = $block_io->prepare_transaction(array('amounts' => $request->amount, 'from_addresses' =>$method->wallet, 'to_addresses' => $account->wallet));
$create_and_sign_transaction_response = $block_io->create_and_sign_transaction($convert);
$submit_transaction_response = $block_io->submit_transaction(array('transaction_data' => $create_and_sign_transaction_response));

Is there an alternative solution to this problem?

Class 'App\LaraBlockIo' not found

(1/1) FatalThrowableError ::: Class 'App\LaraBlockIo' not found
https://tavogi.com/blockio
I already configure : config/app.php, config/larablockio.php
My ModelFile BlockIo.php

namespace App;
use Blockavel\LaraBlockIo\LaraBlockIoServiceProvider;
//use config\LaraBlockIo;
use Illuminate\Database\Eloquent\Model;
class BlockIo extends Model
{
public static function test($arr)
{
return LaraBlockIo::get_network_fee_estimate($arr);
}
}

confidence.php error

Hi i receive this error in confidence.php

Warning: array_slice() expects parameter 1 to be array, null given in

any idea ?

thanks !

Hi

Hi how do i get this package working in Laravel?
Problem 1
- block_io-php/block_io-php[2.0.0, ..., 2.0.2] require bitwasp/bitcoin dev-minimal -> found bitwasp/bitcoin[dev-master, 0.0.1, ..., 0.0.35.x-dev, v1.0.0, ..., 1.0.x-dev] but it does not match the constraint.
- Root composer.json requires block_io-php/block_io-php ^2.0 -> satisfiable by block_io-php/block_io-php[2.0.0, 2.0.1, 2.0.2].

I couldn't install bitwasp either conflicts with other packages and my php version 8.
any suggestions? Thanks!

Summarize, sign and submit transaction is not working

I tried to follow the example but when I try to sign a transaction or summarize, I will get the following error:
Fatal error: Uncaught Error: Object of class stdClass could not be converted to string in /home/dolphine/public_html/vendor/block_io-php/block_io-php/lib/block_io.php:86 Stack trace: #0 /home/dolphine/public_html/vendor/block_io-php/block_io-php/lib/block_io.php(65): BlockIo->_request('summarize_prepa...', Object(stdClass)) #1 /home/dolphine/public_html/json_test.php(16): BlockIo->__call('summarize_prepa...', Object(stdClass)) #2 {main} thrown in /home/dolphine/public_html/vendor/block_io-php/block_io-php/lib/block_io.php on line 86

Below is what My Code look like:
`ini_set('display_errors', 1);
include "./vendor/autoload.php";
$apiKey = "dogeTestApixxx";
$version = 2; // API version
$pin = "xxxxxxxx";
$block_io = new BlockIo($apiKey, $pin, $version);

// $data = $block_io->prepare_transaction(array('amounts' => '100', 'from_addresses' => '2N6p8xNx47n8DqKCqbvMqXPbTttPT26T9BX', 'to_addresses' => '2N5p5Z7E5rXSKXdpAHJdd3jn1HFWkWjd1yJ'));
$address = "2N5p5Z7E5rXSKXdpAHJdd3jn1HFWkWjd1yJ";
$sendAmount = 100;
$prepare_transaction_response = $block_io->prepare_transaction(array('to_address' => $address, 'amount' => $sendAmount));

// the summary of the prepared transaction
// for in-depth data, inspect the $prepare_transaction_response directly
print json_encode($block_io->summarize_prepared_transaction($prepare_transaction_response)) . PHP_EOL;`

Mass payments

Is there any way to do Mass payments using block.io

new issue

Where is block.io support
#7 opened 18 days ago by s1rxploitView all issues opened by s1rxploit

Recover account

Hi there! Please, help me, how do I recover my account with mnemonic?

Passing JSON data to Exceptions

Hello there,

It may be helpful to also pass the json data retrieved with the error_message somehow to Exceptions.

An example:
Withdrawing a value bigger than the wallet value + network fee return an error where it is also suggested the value of withdrawal in order to also pay the network fee.

This is rather an enhancement request than an issue.

Thanks.

Installation Fails; Require "bitwasp/bitcoin dev-minimal" throws an error

When installing this package via composer, this error pops up

Problem 1 - block_io-php/block_io-php[2.0.0, ..., 2.0.2] require bitwasp/bitcoin dev-minimal -> found bitwasp/bitcoin[dev-master, 0.0.1, ..., 0.0.35.x-dev, v1.0.0, ..., 1.0.x-dev] but it does not match the constraint. - Root composer.json requires block_io-php/block_io-php ^2.0 -> satisfiable by block_io-php/block_io-php[2.0.0, 2.0.1, 2.0.2].

After this error persisted, I went ahead to install "bitwasp/bitcoin dev-master" and then tried installing blockio, but the same requirements made the installation fail. I am currently stuck here and everyone else trying to install might also get stuck

My device is running on PHP 7.4, MacOS 10.15.7 Catalina

Composer.json

Hello, i am receiving errors while composer update.

- Root composer.json requires bitwasp/bitcoin dev-minimal, found bitwasp/bitcoin[dev-master, 0.0.1, ..., 0.0.35.x-dev, v1.0.0, ..., 1.0.x-dev] but it does not match the constraint.

Problem 2
- Root composer.json requires block_io-php/block_io-php 2.0.2 -> satisfiable by block_io-php/block_io-php[2.0.2].
- block_io-php/block_io-php 2.0.2 requires bitwasp/bitcoin dev-minimal -> found bitwasp/bitcoin[dev-master, 0.0.1, ..., 0.0.35.x-dev, v1.0.0, ..., 1.0.x-dev] but it does not match the constraint.

I am using example of composer.json from your readme.md.
Any help is appreciated, (other guy had same problem and he solved it himself, there were no answers given or information about solution shared)

Using PHP 7.4

Installing the PHP library

While trying to process the transaction got this error. This is during the summarize_prepared_transaction call

Fatal error: Uncaught Error: Object of class stdClass could not be converted to string in /home/naturetrustus/public_html/test/vendor/block_io-php/block_io-php/lib/block_io.php:86
Stack trace:
#0 /home/naturetrustus/public_html/test/vendor/block_io-php/block_io-php/lib/block_io.php(65): BlockIo->_request('summarize_prepa...', Object(stdClass))
#1 /home/naturetrustus/public_html/test/test.php(63): BlockIo->__call('summarize_prepa...', Object(stdClass))
#2 {main}
thrown in /home/naturetrustus/public_html/test/vendor/block_io-php/block_io-php/lib/block_io.php on line 86

Transaction Fees even in testnet

I have a testnet address with 0.00078 BTC.

When I try to withdraw this to another testnet address, I get this error:

Withdrawal amount cannot exceed -0.00057 ฿T due to mandatory network fees. Estimated network fee: 0.00135 ฿T

This makes it impossible to withdraw it. Please fix this. Thanks.

Create user "label" is different from "user_id": BlockIo documentation confusion

The documentation isn't ideal for the create_user API method:

https://block.io/api/simple/php

When you call this method, $response=$block_io->create_user(array('label' => 'some value'));, you can also call this $response=$block_io->create_user(array('user_id' => 'some value'));

The latter's $response gives you both a user_id and a label. However, only the user_id returned by BlockIo can be used in the get_user_balance method

$block_io->get_user_balance(array('user_id' => 'USER ID'));

It would be preferable to clarify in this PHP library and on the BlockIo's site documentation that the label is something the developer defines whereas user_id is set by BlockIo.

hex2bin(): Hexadecimal input string must have an even length

I'm using lib/block_io.php and catch exception "hex2bin(): Hexadecimal input string must have an even length" during $block_io->withdraw_from_labels

Exception point: $hashed = hash('sha256', hex2bin($pp));
In method: fromPassphrase($pp)

What I have to do?

Invalid bitwasp/bitcoin version specified in composer.json

When trying to require this package the following error is thrown:

Problem 1 - block_io-php/block_io-php[2.0.0, ..., 2.0.2] require bitwasp/bitcoin dev-minimal -> found bitwasp/bitcoin[dev-master, 0.0.1, ..., 0.0.35.x-dev, v1.0.0, ..., 1.0.x-dev] but it does not match the constraint. - Root composer.json requires block_io-php/block_io-php ^2.0 -> satisfiable by block_io-php/block_io-php[2.0.0, 2.0.1, 2.0.2].

Error while generating the wallet address through block.io

Fatal error: Uncaught exception 'Exception' with message 'Failed: ' in /home/comsaintech/public_html/laxmicoin/block_io.php:121 Stack trace: #0 /home/comsaintech/public_html/laxmicoin/block_io.php(65): BlockIo->_request('get_new_address', Array) #1 /home/comsaintech/public_html/laxmicoin/dashboard/updatewallet.php(18): BlockIo->__call('get_new_address', Array) #2 /home/comsaintech/public_html/laxmicoin/dashboard/updatewallet.php(18): BlockIo->get_new_address(Array) #3 {main} thrown in /home/comsaintech/public_html/laxmicoin/block_io.php on line 121

This is the error i am getting when tried to generate the wallet address through block.io API. Not able to identify what's the problem. Anyone please help to get the solution.

Exceptions

Type: Exception

Message: Failed: Cannot withdraw funds without Network Fee of xxxxxxxxxx BTC. Maximum withdrawable balance is xxxxxxxxx BTC.

Filename: /vendor/block_io-php/block_io-php/lib/block_io.php

Line Number: 121

So, I want to merge all my balance from all addresses into my main address.

For that, I made a call to get_address_balance and it gives me the available_balance, but I have to deduct network fees.

So, I needed to make a call to get_network_fee_estimate, with the available balance, so it fails and returns me the max_withdrawal_available, so, then, I withdraw that amount from all those addresses into the main one.

That's all fine, except that, instead of failing silently (like $op->status == 'fail') and returning the max_withdrawal_available, the get_network_fee_estimate call throws an exception, which crashes the script.

I expected that when a call failed, it would give a "fail" status but not for it to throw an exception and crash the script. Or, at the very least, add a max_withdrawable_balance call, which would automatically deduct the network fees and give a withdrawable balance.

My question, is it ok for me to get rid of the line 121 ?
if ($json_result->status != 'success') { throw new Exception('Failed: ' . $json_result->data->error_message); }
or will it break something else?

Thanks!

mrypt functions are deprecated

While withdrawing money, I'm getting an exception.

ErrorException in block_io.php line 303:Function mcrypt_decrypt() is deprecated

Using PHP 7.0. Please fix this!

Maybe openssl_encrypt would be a better choice.

Getting Error : Fatal error: Uncaught Error: Class 'BlockIo\Exception' not found in

Hi,
i am getting this error

when calling get get_balance()

Fatal error: Uncaught Error: Class 'BlockIo\Exception' not found in C:\xampp\htdocs\project\vendor\block_io-php\block_io-php\lib\Client.php:96 Stack trace: #0 C:\xampp\htdocs\project\vendor\block_io-php\block_io-php\lib\Client.php(74): BlockIo\Client->_request('get_balance', Array) #1 C:\xampp\htdocs\project\cron\test.php(19): BlockIo\Client->__call('get_balance', Array) #2 {main} thrown in C:\xampp\htdocs\project\vendor\block_io-php\block_io-php\lib\Client.php on line 96

Fatal error: Uncaught exception 'Exception' with message 'Failed: '...

Maybe I'm doing something wrong??
Here's my code..

require_once '../libs/block_io.php'; //Block.io API
$version = 2; // API version
$pin = getenv('BLOCKIOPIN'); //Block_io main pin 
// echo $pin; // OK
$apiKey = getenv('dogetestnet'); //DOGE testnet
// echo $apiKey; // OK
$block_io = new BlockIo($apiKey, $pin, $version);
$Address = $block_io->get_my_addresses();  //this is line 34 at blockio_test.php

RETURNS

Notice: Trying to get property of non-object in ../repo/libs/block_io.php on line 107 Notice: Trying to get property of non-object in ../repo/libs/block_io.php on line 107 Notice: Trying to get property of non-object in ../repo/libs/block_io.php on line 107 Fatal error: Uncaught exception 'Exception' with message 'Failed: ' in ../repo/libs/block_io.php:107 Stack trace: # 0 ../repo/libs/block_io.php(60): BlockIo->_request('get_my_addresse...', Array) # 1 ../repo/php/blockio_test.php(34): BlockIo->__call('get_my_addresse...', Array) # 2 ../repo/php/blockio_test.php(34): BlockIo->get_my_addresses() # 3 {main} thrown in ../repo/libs/block_io.php on line 107

amount parameter in create request

Hi, I am working on your API and I am having a problem to understand the flow.
I have used the create request and it is not accepting amount parameter.
Can you please let me know how will we send the amount with to_address parameter in the following code ? and how this transaction will be proceed ?

$apiKey = "-----------";
$pin = "--------";
$version = 2; // the API version to use

$block_io = new BlockIo($apiKey, $pin, $version);

$response = $block_io->create_forwarding_address(array('to_address' => '----------' ));

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.