Skip to content

Commit

Permalink
websocket improvement #18
Browse files Browse the repository at this point in the history
websocket improvement
  • Loading branch information
MockingMagician authored Mar 26, 2021
2 parents 5803886 + aa55404 commit 50951fa
Show file tree
Hide file tree
Showing 18 changed files with 849 additions and 278 deletions.
75 changes: 75 additions & 0 deletions docs/_sass/custom/custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
div.highlighter-rouge { background-color: #232525; }
code { background-color: #232525; line-height: unset; }
.highlight { color: #ffffff }
.highlight pre { background-color: #232525; }
.highlight .hll { background-color: #333333 }
.highlight .c { color: #6c9662; font-style: italic; background-color: #232525 } /* Comment */
.highlight .cd { color: #6c9662; font-style: italic }
.highlight .err { color: #ffffff } /* Error */
.highlight .g { color: #ffffff } /* Generic */
.highlight .k { color: #ca7732; font-weight: bold } /* Keyword */
.highlight .l { color: #ffffff } /* Literal */
.highlight .n { color: #ffffff } /* Name */
.highlight .o { color: #ffffff } /* Operator */
.highlight .x { color: #ffffff } /* Other */
.highlight .p { color: #ffffff } /* Punctuation */
.highlight .cm { color: #6c9662; font-style: italic; background-color: #232525 } /* Comment.Multiline */
.highlight .cp { color: #ff262d; font-weight: bold; font-style: italic; background-color: #232525 } /* Comment.Preproc */
.highlight .c1 { color: #6c9662; font-style: italic; background-color: #232525 } /* Comment.Single */
.highlight .cs { color: #6c9662; font-style: italic; background-color: #232525 } /* Comment.Special */
.highlight .gd { color: #ffffff } /* Generic.Deleted */
.highlight .ge { color: #ffffff } /* Generic.Emph */
.highlight .gr { color: #ffffff } /* Generic.Error */
.highlight .gh { color: #ffffff; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #ffffff } /* Generic.Inserted */
.highlight .go { color: #444444; background-color: #222222 } /* Generic.Output */
.highlight .gp { color: #ffffff } /* Generic.Prompt */
.highlight .gs { color: #ffffff } /* Generic.Strong */
.highlight .gu { color: #ffffff; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #ffffff } /* Generic.Traceback */
.highlight .kc { color: #ca7732; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #ca7732; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #ca7732; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #ca7732 } /* Keyword.Pseudo */
.highlight .kr { color: #ca7732; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #cdcaa9; font-weight: bold } /* Keyword.Type */
.highlight .ld { color: #ffffff } /* Literal.Date */
.highlight .m { color: #3f99d1; font-weight: bold } /* Literal.Number */
.highlight .s { color: #3f99d1 } /* Literal.String */
.highlight .na { color: #ff80c4; font-weight: bold } /* Name.Attribute */
.highlight .nb { color: #ffffff } /* Name.Builtin */
.highlight .nc { color: #ffffff } /* Name.Class */
.highlight .no { color: #3f99d1 } /* Name.Constant */
.highlight .nd { color: #ffffff } /* Name.Decorator */
.highlight .ni { color: #ffffff } /* Name.Entity */
.highlight .ne { color: #ffffff } /* Name.Exception */
.highlight .nf { color: #fdc161; font-weight: bold } /* Name.Function */
.highlight .nl { color: #ffffff } /* Name.Label */
.highlight .nn { color: #ffffff } /* Name.Namespace */
.highlight .nx { color: #ffffff } /* Name.Other */
.highlight .py { color: #ffffff } /* Name.Property */
.highlight .nt { color: #ca7732; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #9775a9
} /* Name.Variable */
.highlight .ow { color: #ffffff } /* Operator.Word */
.highlight .w { color: #888888 } /* Text.Whitespace */
.highlight .mf { color: #3f99d1; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #3f99d1; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #3f99d1; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #3f99d1; font-weight: bold } /* Literal.Number.Oct */
.highlight .sb { color: #3f99d1 } /* Literal.String.Backtick */
.highlight .sc { color: #3f99d1 } /* Literal.String.Char */
.highlight .sd { color: #3f99d1 } /* Literal.String.Doc */
.highlight .s2 { color: #3f99d1 } /* Literal.String.Double */
.highlight .se { color: #3f99d1 } /* Literal.String.Escape */
.highlight .sh { color: #3f99d1 } /* Literal.String.Heredoc */
.highlight .si { color: #3f99d1 } /* Literal.String.Interpol */
.highlight .sx { color: #3f99d1 } /* Literal.String.Other */
.highlight .sr { color: #3f99d1 } /* Literal.String.Regex */
.highlight .s1 { color: #3f99d1 } /* Literal.String.Single */
.highlight .ss { color: #3f99d1 } /* Literal.String.Symbol */
.highlight .bp { color: #ffffff } /* Name.Builtin.Pseudo */
.highlight .vc { color: #ca7732 } /* Name.Variable.Class */
.highlight .vg { color: #ca7732 } /* Name.Variable.Global */
.highlight .vi { color: #ca7732 } /* Name.Variable.Instance */
.highlight .il { color: #3f99d1; font-weight: bold } /* Literal.Number.Integer.Long */
31 changes: 19 additions & 12 deletions docs/coinbase-facade.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,45 +223,52 @@ manage_rate_limits: false # pass false here to disable rate limit managing
```php
use MockingMagician\CoinbaseProSdk\CoinbaseFacade;
use MockingMagician\CoinbaseProSdk\Contracts\Api\ApiInterface;
use MockingMagician\CoinbaseProSdk\Functional\Build\MarketOrderToPlace;

/** @var ApiInterface $api */

$marketOrder = CoinbaseFacade::createMarketOrderToPlace(
MarketOrderToPlace::SIDE_BUY,
'BTC-USD',
0.0001
);
```
More information about orders can be found in [Orders feature](./feature/orders.md)
More information about [Orders](./feature/orders.md)

### Limit order

```php
use MockingMagician\CoinbaseProSdk\CoinbaseFacade;
use MockingMagician\CoinbaseProSdk\Contracts\Api\ApiInterface;
use MockingMagician\CoinbaseProSdk\Functional\Build\LimitOrderToPlace;

/** @var ApiInterface $api */

$limitOrder = CoinbaseFacade::createLimitOrderToPlace(
LimitOrderToPlace::SIDE_BUY,
'BTC-USD',
10000,
0.0001
);
```
More information about orders can be found in [Orders feature](./feature/orders.md)
More information about [Orders](./feature/orders.md)

### Pagination

```php
use MockingMagician\CoinbaseProSdk\CoinbaseFacade;
use MockingMagician\CoinbaseProSdk\Contracts\Api\ApiInterface;

/** @var ApiInterface $api */

$pagination = CoinbaseFacade::createPagination();
```
More information about pagination can be found in [Pagination](./pagination.md)
More information about [Pagination](./pagination.md)

### Websocket

Websocket is not part of the Coinbase REST api, it is real-time market data updates provided by coinbase.

***It is not necessary to be authenticated*** to take advantage of it, so a method is directly defined in CoinbaseFacade to take advantage of this feature.

```php
use MockingMagician\CoinbaseProSdk\CoinbaseFacade;

$websocket = CoinbaseFacade::createUnauthenticatedWebsocket();
```

***It is also possible to take advantage of it in an authenticated way*** in order to obtain more detailed information about the operations that concern the authenticated user. In this case it is necessary to use the websocket provided with the api.

More information about [Websocket](./feature/websocket.md)
Loading

0 comments on commit 50951fa

Please sign in to comment.