Skip to content

Commit e828191

Browse files
authored
Merge pull request #17 from neilgarb/v0.0.8
Updates for v0.0.8
2 parents 810d643 + 5af98c2 commit e828191

33 files changed

+929
-431
lines changed

src/Luno/Client.php

Lines changed: 94 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function CancelWithdrawal(Request\CancelWithdrawal $req): Response\Cancel
2222
/**
2323
* CreateAccount makes a call to POST /api/1/accounts.
2424
*
25-
* Create an additional account for the specified currency.
25+
* This request creates an Account for the specified currency. Please note that the balances for the Account will be displayed based on the <code>asset</code> value, which is the currency the Account is based on.
2626
*
2727
* Permissions required: <code>Perm_W_Addresses</code>
2828
*/
@@ -127,7 +127,7 @@ public function ExerciseQuote(Request\ExerciseQuote $req): Response\ExerciseQuot
127127
/**
128128
* GetBalances makes a call to GET /api/1/balance.
129129
*
130-
* Return the list of all accounts and their respective balances.
130+
* The list of all Accounts and their respective balances for the requesting user.
131131
*
132132
* Permissions required: <code>Perm_R_Balance</code>
133133
*/
@@ -141,8 +141,7 @@ public function GetBalances(Request\GetBalances $req): Response\GetBalances
141141
/**
142142
* GetFeeInfo makes a call to GET /api/1/fee_info.
143143
*
144-
* Returns your fees and 30 day trading volume (as of midnight) for a given
145-
* pair.
144+
* Returns the fees and 30 day trading volume (as of midnight) for a given currency pair. For complete details, please see <a href="en/countries">Fees & Features</a>.
146145
*
147146
* Permissions required: <code>Perm_R_Orders</code>
148147
*/
@@ -157,11 +156,10 @@ public function GetFeeInfo(Request\GetFeeInfo $req): Response\GetFeeInfo
157156
* GetFundingAddress makes a call to GET /api/1/funding_address.
158157
*
159158
* Returns the default receive address associated with your account and the
160-
* amount received via the address. You can specify an optional address
161-
* parameter to return information for a non-default receive address. In the
162-
* response, total_received is the total confirmed Bitcoin amount received
163-
* excluding unconfirmed transactions. total_unconfirmed is the total sum of
164-
* unconfirmed receive transactions.
159+
* amount received via the address. Users can specify an optional address parameter to return information for a non-default receive address.
160+
*
161+
* In the response, <code>total_received</code> is the total confirmed amount received excluding unconfirmed transactions.
162+
* <code>total_unconfirmed</code> is the total sum of unconfirmed receive transactions.
165163
*
166164
* Permissions required: <code>Perm_R_Addresses</code>
167165
*/
@@ -172,6 +170,23 @@ public function GetFundingAddress(Request\GetFundingAddress $req): Response\GetF
172170
return $mapper->map($res, new Response\GetFundingAddress);
173171
}
174172

173+
/**
174+
* GetLightningReceive makes a call to GET /api/1/lightning/receive/{id}.
175+
*
176+
* <b>Alpha warning!</b> The Lightning API is still in Alpha stage.
177+
* The risks are limited api availability and channel capacity.
178+
*
179+
* Lookup the status of a Lightning Receive Invoice.
180+
*
181+
* Permissions required: <code>Perm_W_Send</code>
182+
*/
183+
public function GetLightningReceive(Request\GetLightningReceive $req): Response\GetLightningReceive
184+
{
185+
$res = $this->do("GET", "/api/1/lightning/receive/{id}", $req, true);
186+
$mapper = new \JsonMapper();
187+
return $mapper->map($res, new Response\GetLightningReceive);
188+
}
189+
175190
/**
176191
* GetOrder makes a call to GET /api/1/orders/{id}.
177192
*
@@ -189,9 +204,12 @@ public function GetOrder(Request\GetOrder $req): Response\GetOrder
189204
/**
190205
* GetOrderBook makes a call to GET /api/1/orderbook_top.
191206
*
192-
* Returns a list of the top 100 bids and asks in the order book.
193-
* Ask orders are sorted by price ascending.
194-
* Bid orders are sorted by price descending.
207+
* Returns a list of the top 100 <em>bids</em> and <em>asks</em> for the currency pair specified in the Order Book.
208+
*
209+
* Ask Orders are sorted by price ascending.
210+
*
211+
* Bid Orders are sorted by price descending.
212+
*
195213
* Orders of the same price are aggregated.
196214
*/
197215
public function GetOrderBook(Request\GetOrderBook $req): Response\GetOrderBook
@@ -204,13 +222,17 @@ public function GetOrderBook(Request\GetOrderBook $req): Response\GetOrderBook
204222
/**
205223
* GetOrderBookFull makes a call to GET /api/1/orderbook.
206224
*
207-
* Returns a list of all bids and asks in the order book.
225+
* This request returns a list of all <em>bids</em> and <em>asks</em> for the currency pair specified in the Order Book.
226+
*
208227
* Ask orders are sorted by price ascending.
228+
*
209229
* Bid orders are sorted by price descending.
230+
*
210231
* Multiple orders at the same price are not aggregated.
211232
*
212-
* Warning: This may return a large amount of data. Generally you should rather
213-
* use GetOrderBook or the Streaming API.
233+
* <b>Warning:</b> This may return a large amount of data.
234+
* Users are recommended to use the <a href="#operation/getOrderBook">top 100 bids and asks</a>
235+
* or the <a href="#tag/streaming-API-(beta)">Streaming API</a>.
214236
*/
215237
public function GetOrderBookFull(Request\GetOrderBookFull $req): Response\GetOrderBookFull
216238
{
@@ -274,10 +296,10 @@ public function GetWithdrawal(Request\GetWithdrawal $req): Response\GetWithdrawa
274296
/**
275297
* ListOrders makes a call to GET /api/1/listorders.
276298
*
277-
* Returns a list of the most recently placed orders. You can specify an
278-
* optional <code>state=PENDING</code> parameter to restrict the results to only
279-
* open orders. You can also specify the market by using the optional pair
280-
* parameter. The list is truncated after 100 items.
299+
* Returns a list of the most recently placed Orders.
300+
* Users can specify an optional <code>state=PENDING</code> parameter to restrict the results to only open Orders.
301+
* Users can also specify the market by using the optional currency pair parameter.
302+
* The list is truncated after 100 items.
281303
*
282304
* Permissions required: <code>Perm_R_Orders</code>
283305
*/
@@ -291,10 +313,9 @@ public function ListOrders(Request\ListOrders $req): Response\ListOrders
291313
/**
292314
* ListPendingTransactions makes a call to GET /api/1/accounts/{id}/pending.
293315
*
294-
* Return a list of all pending transactions related to the account.
316+
* Return a list of all transactions that have not completed for the Account.
295317
*
296-
* Unlike account entries, pending transactions are not numbered, and may be
297-
* reordered, deleted or updated at any time.
318+
* Pending transactions are not numbered, and may be reordered, deleted or updated at any time.
298319
*
299320
* Permissions required: <code>Perm_R_Transactions</code>
300321
*/
@@ -308,8 +329,8 @@ public function ListPendingTransactions(Request\ListPendingTransactions $req): R
308329
/**
309330
* ListTrades makes a call to GET /api/1/trades.
310331
*
311-
* Returns a list of the most recent trades. At most 100 results are returned
312-
* per call.
332+
* Returns a list of the most recent trades that happened in the last 24h. At
333+
* most 100 results are returned per call.
313334
*/
314335
public function ListTrades(Request\ListTrades $req): Response\ListTrades
315336
{
@@ -344,16 +365,13 @@ public function ListTransactions(Request\ListTransactions $req): Response\ListTr
344365
/**
345366
* ListUserTrades makes a call to GET /api/1/listtrades.
346367
*
347-
* Returns a list of your recent trades for a given pair, sorted by oldest
348-
* first. If <code>before</code> is specified, then the trades are returned
349-
* sorted by most-recent first.
368+
* Returns a list of the recent Trades for a given currency pair for this user, sorted by oldest first.
369+
* If <code>before</code> is specified, then Trades are returned sorted by most-recent first.
350370
*
351-
* <code>type</code> in the response indicates the type of order that you placed
352-
* in order to participate in the trade. Possible types: <code>BID</code>,
353-
* <code>ASK</code>.
371+
* <code>type</code> in the response indicates the type of Order that was placed to participate in the trade.
372+
* Possible types: <code>BID</code>, <code>ASK</code>.
354373
*
355-
* If <code>is_buy</code> in the response is true, then the order which
356-
* completed the trade (market taker) was a bid order.
374+
* If <code>is_buy</code> in the response is true, then the Order which completed the trade (market taker) was a Bid Order.
357375
*
358376
* Results of this query may lag behind the latest data.
359377
*
@@ -405,18 +423,15 @@ public function PostLimitOrder(Request\PostLimitOrder $req): Response\PostLimitO
405423
/**
406424
* PostMarketOrder makes a call to POST /api/1/marketorder.
407425
*
408-
* Create a new market order.
426+
* Create a new Market Order.
409427
*
410-
* A market order executes immediately, and either buys as much Bitcoin or
411-
* Ethereum that can be bought for a set amount of fiat currency, or sells a
412-
* set amount of Bitcoin or Ethereum for as much fiat as possible.
428+
* A Market Order executes immediately, and either buys as much of the asset that can be bought for a set amount of fiat currency, or sells a set amount of the asset for as much as possible.
413429
*
414-
* Warning! Orders cannot be reversed once they have executed. Please ensure
415-
* your program has been thoroughly tested before submitting orders.
430+
* <b>Warning!</b> Orders cannot be reversed once they have executed.
431+
* Please ensure your program has been thoroughly tested before submitting Orders.
416432
*
417-
* If no base_account_id or counter_account_id are specified, your default base
418-
* currency or counter currency account will be used. You can find your account
419-
* IDs by calling the <a href="#operation/getBalances">Balances</a> API.
433+
* If no <code>base_account_id</code> or <code>counter_account_id</code> are specified, the default base currency or counter currency account will be used.
434+
* Users can find their account IDs by calling the <a href="#operation/getBalances">Balances</a> request.
420435
*
421436
* Permissions required: <code>Perm_W_Orders</code>
422437
*/
@@ -427,6 +442,24 @@ public function PostMarketOrder(Request\PostMarketOrder $req): Response\PostMark
427442
return $mapper->map($res, new Response\PostMarketOrder);
428443
}
429444

445+
/**
446+
* ReceiveLightning makes a call to POST /api/1/lightning/receive.
447+
*
448+
* <b>Alpha warning!</b> The Lightning API is still in Alpha stage.
449+
* The risks are limited api availability and channel capacity.
450+
*
451+
* Create a lightning invoice which can be used to receive
452+
* BTC payments over the lightning network.
453+
*
454+
* Permissions required: <code>Perm_W_Send</code>
455+
*/
456+
public function ReceiveLightning(Request\ReceiveLightning $req): Response\ReceiveLightning
457+
{
458+
$res = $this->do("POST", "/api/1/lightning/receive", $req, true);
459+
$mapper = new \JsonMapper();
460+
return $mapper->map($res, new Response\ReceiveLightning);
461+
}
462+
430463
/**
431464
* Send makes a call to POST /api/1/send.
432465
*
@@ -448,6 +481,26 @@ public function Send(Request\Send $req): Response\Send
448481
return $mapper->map($res, new Response\Send);
449482
}
450483

484+
/**
485+
* SendLightning makes a call to POST /api/1/lightning/send.
486+
*
487+
* <b>Alpha warning!</b> The Lightning API is still in Alpha stage.
488+
* The risks are limited api availability and channel capacity.
489+
*
490+
* Send Bitcoin over the Lightning network from your Bitcoin Account.
491+
*
492+
* Warning! Cryptocurrency transactions are irreversible. Please ensure your
493+
* program has been thoroughly tested before using this call.
494+
*
495+
* Permissions required: <code>Perm_W_Send</code>
496+
*/
497+
public function SendLightning(Request\SendLightning $req): Response\SendLightning
498+
{
499+
$res = $this->do("POST", "/api/1/lightning/send", $req, true);
500+
$mapper = new \JsonMapper();
501+
return $mapper->map($res, new Response\SendLightning);
502+
}
503+
451504
/**
452505
* StopOrder makes a call to POST /api/1/stoporder.
453506
*

src/Luno/Request/CancelWithdrawal.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ class CancelWithdrawal extends AbstractRequest
1010
protected $id;
1111

1212
/**
13-
* @return string
13+
* @return int
1414
*/
15-
public function getId(): string
15+
public function getId(): int
1616
{
1717
if (!isset($this->id)) {
18-
return "";
18+
return 0;
1919
}
2020
return $this->id;
2121
}
2222

2323
/**
24-
* @param string $id
24+
* @param int $id
2525
*/
26-
public function setId(string $id)
26+
public function setId(int $id)
2727
{
2828
$this->id = $id;
2929
}

src/Luno/Request/CreateAccount.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
class CreateAccount extends AbstractRequest
66
{
77
/**
8-
* The currency code for the account you want to create
8+
* The currency code for the Account you want to create. Please see the Currency section for a detailed list of currencies supported by the Luno platform.
99
*
10-
* You must be verified to trade currency in order to be able to create an
11-
* account. A user has a limit of 4 accounts per currency.
10+
* Users must be verified to trade currency in order to be able to create an Account. For more information on the verification process, please see <a href="/help/en/articles/1000168396">How do I verify my identity?</a>.
11+
*
12+
* Users have a limit of 4 accounts per currency.
1213
*/
1314
protected $currency;
1415

src/Luno/Request/CreateFundingAddress.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class CreateFundingAddress extends AbstractRequest
1010
protected $asset;
1111

1212
/**
13-
* An optional name for the new address
13+
* An optional name for the new Receive Address
1414
*/
1515
protected $name;
1616

src/Luno/Request/CreateQuote.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,39 +88,39 @@ public function setType(string $type)
8888
}
8989

9090
/**
91-
* @return string
91+
* @return int
9292
*/
93-
public function getBaseAccountId(): string
93+
public function getBaseAccountId(): int
9494
{
9595
if (!isset($this->base_account_id)) {
96-
return "";
96+
return 0;
9797
}
9898
return $this->base_account_id;
9999
}
100100

101101
/**
102-
* @param string $baseAccountId
102+
* @param int $baseAccountId
103103
*/
104-
public function setBaseAccountId(string $baseAccountId)
104+
public function setBaseAccountId(int $baseAccountId)
105105
{
106106
$this->base_account_id = $baseAccountId;
107107
}
108108

109109
/**
110-
* @return string
110+
* @return int
111111
*/
112-
public function getCounterAccountId(): string
112+
public function getCounterAccountId(): int
113113
{
114114
if (!isset($this->counter_account_id)) {
115-
return "";
115+
return 0;
116116
}
117117
return $this->counter_account_id;
118118
}
119119

120120
/**
121-
* @param string $counterAccountId
121+
* @param int $counterAccountId
122122
*/
123-
public function setCounterAccountId(string $counterAccountId)
123+
public function setCounterAccountId(int $counterAccountId)
124124
{
125125
$this->counter_account_id = $counterAccountId;
126126
}

src/Luno/Request/CreateWithdrawal.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,20 @@ public function setType(string $type)
7373
}
7474

7575
/**
76-
* @return string
76+
* @return int
7777
*/
78-
public function getBeneficiaryId(): string
78+
public function getBeneficiaryId(): int
7979
{
8080
if (!isset($this->beneficiary_id)) {
81-
return "";
81+
return 0;
8282
}
8383
return $this->beneficiary_id;
8484
}
8585

8686
/**
87-
* @param string $beneficiaryId
87+
* @param int $beneficiaryId
8888
*/
89-
public function setBeneficiaryId(string $beneficiaryId)
89+
public function setBeneficiaryId(int $beneficiaryId)
9090
{
9191
$this->beneficiary_id = $beneficiaryId;
9292
}

src/Luno/Request/DiscardQuote.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ class DiscardQuote extends AbstractRequest
1010
protected $id;
1111

1212
/**
13-
* @return string
13+
* @return int
1414
*/
15-
public function getId(): string
15+
public function getId(): int
1616
{
1717
if (!isset($this->id)) {
18-
return "";
18+
return 0;
1919
}
2020
return $this->id;
2121
}
2222

2323
/**
24-
* @param string $id
24+
* @param int $id
2525
*/
26-
public function setId(string $id)
26+
public function setId(int $id)
2727
{
2828
$this->id = $id;
2929
}

0 commit comments

Comments
 (0)