Giter Club home page Giter Club logo

coinbase-pro-sdk's People

Contributors

jasonatindiecentive avatar mockingmagician avatar rogerthomas84 avatar

Stargazers

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

Watchers

 avatar

coinbase-pro-sdk's Issues

Unable to get currencies from API

Attempting to use this call:

$api->currencies()->getCurrencies();

Return this error and there are no expected parameters to be passed.

Argument 2 passed to MockingMagician\CoinbaseProSdk\Functional\DTO\CurrencyDetailsData::__construct() must be of the type string, null given, called in /Users/xxxxx/Sites/localhost/crypto/crypto/vendor/mocking-magician/coinbase-pro-sdk/src/Functional/DTO/CurrencyDetailsData.php on line 154

On a side note I am looking to convert from BTC to DAI and vica versa - but I can't seem to figure that out in this package. Thoughts?

OrderData.php post_only must be of the type bool, null given

Hi,

Argument 11 passed to MockingMagician\CoinbaseProSdk\Functional\DTO\OrderData::__construct() must be of the type bool, null given, called in...

For some reason, the Coinbase pro API is returning this null field, and the library expects a bool value.
This is the field: post_only It must be able to be bool? null

Thank you for the bundle.

Change how the API responses to the server?

Thanks for the library, it was just what I needed.

I am using this with Laravel currently and when I get the API response I can dd($response); and see the array data from Coinbase. Is it possible to convert this easily to JSON?

I have tried to json_encode($response) and it returns ['','','','',''] blank brackets. I did some research and it found this reponse:

"This means that AccountData does not implement JsonSerializable and the members seen there are all private so they are not exposed when it gets converted to json. If you wrote those classes you should probably change then and if not then consult the documentation of whoever wrote them on how to get those fields exposed so you can write some custom code to covert them to an array"

This is just a simple $response = $api->accounts()->list(); by the way.

What do you think?

OrderBook level issue

Hey! Thanks for this awesome API Wrapper, so far it has been very helpful in the development process.

Now the problem: I'm trying to understand how to read the order book from the API.
I've found in the docs the following

$res = $this->api->products()->getProductOrderBook('BTC-USD')->getAsks();

but then it doesn't return an array nor an iterable object with the ask's order book. instead it returns:

array(1) {
  [0]=>
  object(MockingMagician\CoinbaseProSdk\Functional\DTO\OrderBookDetailsData)#46 (4) {
    ["price":"MockingMagician\CoinbaseProSdk\Functional\DTO\OrderBookDetailsData":private]=>
    float(57588.79)
    ["size":"MockingMagician\CoinbaseProSdk\Functional\DTO\OrderBookDetailsData":private]=>
    float(0.08184382)
    ["numOrders":"MockingMagician\CoinbaseProSdk\Functional\DTO\OrderBookDetailsData":private]=>
    int(3)
    ["orderId":"MockingMagician\CoinbaseProSdk\Functional\DTO\OrderBookDetailsData":private]=>
    NULL
  }
}

Which seems not to be iterable (unless I'm not understanding how to iterate it), nor useful for calculations.
I've also read the docs stating something about the "levels" but I don't find documentation stating what does a level mean and how can it be used.

My use case is quite simple, I just need to use the order book to know what's the price I have to pay to buy x amount of the product.

Thank you very much for your time in reviewing this issue!

Error while calling it from queue

Serialization of 'Closure' is not allowed

We are building a trading bot, so we have are calling CoinbaseFacade from Queue, It throws "Serialization of 'Closure' is not allowed", Not sure how to fix that

image

getCurrencies() is returning an object

getCurrencies() is returning an object of MockingMagician\CoinbaseProSdk\Functional\DTO\CurrencyData instead of an array

Expected behavior

an array of currencies with child arrays of associated data

Screenshots

If applicable, add screenshots to help explain your problem.

image
image

Add any other context about the problem here.
Fresh install with PHP 8

local.ERROR: NotFound

Hi,

I'm getting this error when using the package in a Laravel Job script, any ideas?


local.ERROR: NotFound {"exception":"[object] (MockingMagician\\CoinbaseProSdk\\Functional\\Error\\ApiError(code: 0): NotFound at /home/dca-x8rfh/website.com/vendor/mocking-magician/coinbase-pro-sdk/src/Functional/Request/Request.php:132)
[stacktrace]
#0 /home/dca-x8rfh/website.com/vendor/mocking-magician/coinbase-pro-sdk/src/Functional/Request/RequestWithErrorManagement.php(41): MockingMagician\\CoinbaseProSdk\\Functional\\Request\\Request->send()
#1 /home/dca-x8rfh/website.com/vendor/mocking-magician/coinbase-pro-sdk/src/Functional/Connectivity/Orders.php(127): MockingMagician\\CoinbaseProSdk\\Functional\\Request\\RequestWithErrorManagement->send()
#2 /home/dca-x8rfh/website.com/vendor/mocking-magician/coinbase-pro-sdk/src/Functional/Connectivity/Orders.php(135): MockingMagician\\CoinbaseProSdk\\Functional\\Connectivity\\Orders->getOrderByIdRaw()
#3 /home/dca-x8rfh/website.com/app/Jobs/RunStrategy.php(122): MockingMagician\\CoinbaseProSdk\\Functional\\Connectivity\\Orders->getOrderById()
#4 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\\Jobs\\RunStrategy->handle()
#5 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#6 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#7 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod()
#8 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\\Container\\BoundMethod::call()
#9 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call()
#10 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}()
#11 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#12 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then()
#13 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(120): Illuminate\\Bus\\Dispatcher->dispatchNow()
#14 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}()
#15 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Queue/Middleware/WithoutOverlapping.php(71): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#16 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Queue\\Middleware\\WithoutOverlapping->handle()
#17 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#18 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(122): Illuminate\\Pipeline\\Pipeline->then()
#19 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware()
#20 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(98): Illuminate\\Queue\\CallQueuedHandler->call()
#21 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(428): Illuminate\\Queue\\Jobs\\Job->fire()
#22 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(378): Illuminate\\Queue\\Worker->process()
#23 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(172): Illuminate\\Queue\\Worker->runJob()
#24 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(117): Illuminate\\Queue\\Worker->daemon()
#25 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\\Queue\\Console\\WorkCommand->runWorker()
#26 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle()
#27 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#28 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#29 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod()
#30 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\\Container\\BoundMethod::call()
#31 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\\Container\\Container->call()
#32 /home/dca-x8rfh/website.com/vendor/symfony/console/Command/Command.php(298): Illuminate\\Console\\Command->execute()
#33 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\\Component\\Console\\Command\\Command->run()
#34 /home/dca-x8rfh/website.com/vendor/symfony/console/Application.php(1005): Illuminate\\Console\\Command->run()
#35 /home/dca-x8rfh/website.com/vendor/symfony/console/Application.php(299): Symfony\\Component\\Console\\Application->doRunCommand()
#36 /home/dca-x8rfh/website.com/vendor/symfony/console/Application.php(171): Symfony\\Component\\Console\\Application->doRun()
#37 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Console/Application.php(94): Symfony\\Component\\Console\\Application->run()
#38 /home/dca-x8rfh/website.com/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run()
#39 /home/dca-x8rfh/website.com/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle()
#40 {main}
"} ```

Products Api Not working its shows error

$api = CoinbaseFacade::createDefaultCoinbaseApi($endpoint, $api_key, $api_secret, $passphrase);

//APis

$api->products()->getProducts('BTC-USD');

$api->products()->getSingleProduct('BTC-USD');

Error:
"message": "Undefined array key "base_min_size"",

file": "vendor\mocking-magician\coinbase-pro-sdk\src\Functional\DTO\ProductData.php",

Need better install instructions.

So I used composer to install this package and after numerous warnings about running it as root (I did not, I deleted the vendor directory it made in the root directory) and ran it as an unprivileged user. The code is all there, but the make file refers most functions /vendor/bin/..... which does not exist and was not created. The php functions are all there, but I can't run your test files and I can't seem to use the Namespace you created to access the functions. The Makefile fails for every option but help.

The code looks good and it is just what I was looking for, but I've spent all evening trying to get it installed correctly. The docker tests looked like they were going to work (after installing docker and docker.io) but ended up in a loop saying:

cc -DONIG_ESCAPE_UCHAR_COLLISION=1 -DUChar=OnigUChar -DHAVE_CONFIG_H -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/usr/src/php/ext/mbstring -DPHP_ATOM_INC -I/usr/src/php/ext/mbstring/include -I/usr/src/php/ext/mbstring/main -I/usr/src/php/ext/mbstring -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/src/php/ext/mbstring/libmbfl -I/usr/src/php/ext/mbstring/libmbfl/mbfl -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c /usr/src/php/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.c -fPIC -DPIC -o libmbfl/filters/.libs/mbfilter_iso8859_6.o
/bin/bash /usr/src/php/ext/mbstring/libtool --mode=compile cc -DONIG_ESCAPE_UCHAR_COLLISION=1 -DUChar=OnigUChar -DHAVE_CONFIG_H -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/usr/src/php/ext/mbstring -DPHP_ATOM_INC -I/usr/src/php/ext/mbstring/include -I/usr/src/php/ext/mbstring/main -I/usr/src/php/ext/mbstring -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/src/php/ext/mbstring/libmbfl -I/usr/src/php/ext/mbstring/libmbfl/mbfl -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c /usr/src/php/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.c -o libmbfl/filters/mbfilter_iso8859_7.lo

Over and over.

I am running PHP 7.,4 on Ubuntu Linux 20.04 LTS. Could you provide a little more information than the one line install instruction in the docs? The rest of the docs are good and I think I could really use this if I can figure out the environment to get started.

Support Symfony 5.x

It does not look like the package supports the latest version of Symfony. I haven't tested updating the composer.json file.

I cannot place a limit order

My problem:

The limit order feature fails because the tool cannot find LimitOrdertoPlace class

This feature provides an error when executing the complex limit order as listed on the website
not sure why it is not found...

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.