Skip to content

Commit ba7b6f7

Browse files
authored
Add support for memo field for ATOM coin (#36)
1 parent d524ef1 commit ba7b6f7

File tree

7 files changed

+195
-13
lines changed

7 files changed

+195
-13
lines changed

src/Luno/Client.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ public function GetFundingAddress(Request\GetFundingAddress $req): Response\GetF
129129
* <code>client_move_id</code>. If both are provided an API error will be
130130
* returned.
131131
*
132-
* This endpoint is in BETA, behaviour and specification may change without
133-
* any previous notice.
134-
*
135132
* Permissions required: <code>MP_None</code>
136133
*/
137134
public function GetMove(Request\GetMove $req): Response\GetMove
@@ -281,9 +278,6 @@ public function ListBeneficiariesResponse(Request\ListBeneficiariesResponse $req
281278
* Returns a list of the most recent moves ordered from newest to oldest.
282279
* This endpoint will list up to 100 most recent moves by default.
283280
*
284-
* This endpoint is in BETA, behaviour and specification may change without
285-
* any previous notice.
286-
*
287281
* Permissions required: <code>MP_None</code>
288282
*/
289283
public function ListMoves(Request\ListMoves $req): Response\ListMoves
@@ -396,9 +390,6 @@ public function ListTransactions(Request\ListTransactions $req): Response\ListTr
396390
* until you have all the transfers you need.
397391
* This endpoint will list up to 100 transfers at a time by default.
398392
*
399-
* This endpoint is in BETA, behaviour and specification may change without
400-
* any previous notice.
401-
*
402393
* Permissions required: <Code>Perm_R_Transfers</Code>
403394
*/
404395
public function ListTransfers(Request\ListTransfers $req): Response\ListTransfers
@@ -466,9 +457,6 @@ public function Markets(Request\Markets $req): Response\Markets
466457
*
467458
* Note: moves will show as transactions, but not as transfers.
468459
*
469-
* This endpoint is in BETA, behaviour and specification may change without
470-
* any previous notice.
471-
*
472460
* Permissions required: <code>MP_None_Write</code>
473461
*/
474462
public function Move(Request\Move $req): Response\Move

src/Luno/Request/CreateAccount.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class CreateAccount extends AbstractRequest
99
*
1010
* 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>.
1111
*
12-
* Users have a limit of 4 accounts per currency.
12+
* Users have a limit of 10 accounts per currency.
1313
*/
1414
protected $currency;
1515

src/Luno/Request/Send.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ class Send extends AbstractRequest
6363
*/
6464
protected $is_forex_send;
6565

66+
/**
67+
* Optional memo string used to provide account information for ATOM, etc. where it holds "account" information
68+
* for a generic address.
69+
*/
70+
protected $memo;
71+
6672
/**
6773
* Message to send to the recipient.
6874
* This is only relevant when sending to an email address.
@@ -259,6 +265,25 @@ public function setIsForexSend(bool $isForexSend)
259265
$this->is_forex_send = $isForexSend;
260266
}
261267

268+
/**
269+
* @return string
270+
*/
271+
public function getMemo(): string
272+
{
273+
if (!isset($this->memo)) {
274+
return "";
275+
}
276+
return $this->memo;
277+
}
278+
279+
/**
280+
* @param string $memo
281+
*/
282+
public function setMemo(string $memo)
283+
{
284+
$this->memo = $memo;
285+
}
286+
262287
/**
263288
* @return string
264289
*/

src/Luno/Request/Validate.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ class Validate extends AbstractRequest
7777
*/
7878
protected $is_self_send;
7979

80+
/**
81+
* Optional memo string used to provide account information for ATOM, etc. where it holds "account" information
82+
* for a generic address.
83+
*/
84+
protected $memo;
85+
8086
/**
8187
* Nationality ISO 3166-1 country code of the nationality of the (non-institutional) beneficial owner of the address
8288
*/
@@ -320,6 +326,25 @@ public function setIsSelfSend(bool $isSelfSend)
320326
$this->is_self_send = $isSelfSend;
321327
}
322328

329+
/**
330+
* @return string
331+
*/
332+
public function getMemo(): string
333+
{
334+
if (!isset($this->memo)) {
335+
return "";
336+
}
337+
return $this->memo;
338+
}
339+
340+
/**
341+
* @param string $memo
342+
*/
343+
public function setMemo(string $memo)
344+
{
345+
$this->memo = $memo;
346+
}
347+
323348
/**
324349
* @return string
325350
*/

src/Luno/Response/GetOrderV2.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ class GetOrderV2 extends AbstractResponse
1111
*/
1212
protected $base;
1313

14+
/**
15+
* The base account ID used to place the order
16+
*/
17+
protected $base_account_id;
18+
1419
/**
1520
* Client Order ID has the value that was passed in when the Order was posted.
1621
*/
@@ -32,6 +37,11 @@ class GetOrderV2 extends AbstractResponse
3237
*/
3338
protected $counter;
3439

40+
/**
41+
* The counter account ID used to place the order
42+
*/
43+
protected $counter_account_id;
44+
3545
/**
3646
* Time of order creation (Unix milliseconds)
3747
*/
@@ -137,6 +147,25 @@ public function setBase(float $base)
137147
$this->base = $base;
138148
}
139149

150+
/**
151+
* @return int
152+
*/
153+
public function getBaseAccountId(): int
154+
{
155+
if (!isset($this->base_account_id)) {
156+
return 0;
157+
}
158+
return $this->base_account_id;
159+
}
160+
161+
/**
162+
* @param int $baseAccountId
163+
*/
164+
public function setBaseAccountId(int $baseAccountId)
165+
{
166+
$this->base_account_id = $baseAccountId;
167+
}
168+
140169
/**
141170
* @return string
142171
*/
@@ -194,6 +223,25 @@ public function setCounter(float $counter)
194223
$this->counter = $counter;
195224
}
196225

226+
/**
227+
* @return int
228+
*/
229+
public function getCounterAccountId(): int
230+
{
231+
if (!isset($this->counter_account_id)) {
232+
return 0;
233+
}
234+
return $this->counter_account_id;
235+
}
236+
237+
/**
238+
* @param int $counterAccountId
239+
*/
240+
public function setCounterAccountId(int $counterAccountId)
241+
{
242+
$this->counter_account_id = $counterAccountId;
243+
}
244+
197245
/**
198246
* @return int
199247
*/

src/Luno/Response/GetOrderV3.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ class GetOrderV3 extends AbstractResponse
1111
*/
1212
protected $base;
1313

14+
/**
15+
* The base account ID used to place the order
16+
*/
17+
protected $base_account_id;
18+
1419
/**
1520
* Client Order ID has the value that was passed in when the Order was posted.
1621
*/
@@ -32,6 +37,11 @@ class GetOrderV3 extends AbstractResponse
3237
*/
3338
protected $counter;
3439

40+
/**
41+
* The counter account ID used to place the order
42+
*/
43+
protected $counter_account_id;
44+
3545
/**
3646
* Time of order creation (Unix milliseconds)
3747
*/
@@ -137,6 +147,25 @@ public function setBase(float $base)
137147
$this->base = $base;
138148
}
139149

150+
/**
151+
* @return int
152+
*/
153+
public function getBaseAccountId(): int
154+
{
155+
if (!isset($this->base_account_id)) {
156+
return 0;
157+
}
158+
return $this->base_account_id;
159+
}
160+
161+
/**
162+
* @param int $baseAccountId
163+
*/
164+
public function setBaseAccountId(int $baseAccountId)
165+
{
166+
$this->base_account_id = $baseAccountId;
167+
}
168+
140169
/**
141170
* @return string
142171
*/
@@ -194,6 +223,25 @@ public function setCounter(float $counter)
194223
$this->counter = $counter;
195224
}
196225

226+
/**
227+
* @return int
228+
*/
229+
public function getCounterAccountId(): int
230+
{
231+
if (!isset($this->counter_account_id)) {
232+
return 0;
233+
}
234+
return $this->counter_account_id;
235+
}
236+
237+
/**
238+
* @param int $counterAccountId
239+
*/
240+
public function setCounterAccountId(int $counterAccountId)
241+
{
242+
$this->counter_account_id = $counterAccountId;
243+
}
244+
197245
/**
198246
* @return int
199247
*/

src/Luno/Types/OrderV2.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ class OrderV2
1111
*/
1212
protected $base;
1313

14+
/**
15+
* The base account ID used to place the order
16+
*/
17+
protected $base_account_id;
18+
1419
/**
1520
* Client Order ID has the value that was passed in when the Order was posted.
1621
*/
@@ -32,6 +37,11 @@ class OrderV2
3237
*/
3338
protected $counter;
3439

40+
/**
41+
* The counter account ID used to place the order
42+
*/
43+
protected $counter_account_id;
44+
3545
/**
3646
* Time of order creation (Unix milliseconds)
3747
*/
@@ -137,6 +147,25 @@ public function setBase(float $base)
137147
$this->base = $base;
138148
}
139149

150+
/**
151+
* @return int
152+
*/
153+
public function getBaseAccountId(): int
154+
{
155+
if (!isset($this->base_account_id)) {
156+
return 0;
157+
}
158+
return $this->base_account_id;
159+
}
160+
161+
/**
162+
* @param int $baseAccountId
163+
*/
164+
public function setBaseAccountId(int $baseAccountId)
165+
{
166+
$this->base_account_id = $baseAccountId;
167+
}
168+
140169
/**
141170
* @return string
142171
*/
@@ -194,6 +223,25 @@ public function setCounter(float $counter)
194223
$this->counter = $counter;
195224
}
196225

226+
/**
227+
* @return int
228+
*/
229+
public function getCounterAccountId(): int
230+
{
231+
if (!isset($this->counter_account_id)) {
232+
return 0;
233+
}
234+
return $this->counter_account_id;
235+
}
236+
237+
/**
238+
* @param int $counterAccountId
239+
*/
240+
public function setCounterAccountId(int $counterAccountId)
241+
{
242+
$this->counter_account_id = $counterAccountId;
243+
}
244+
197245
/**
198246
* @return int
199247
*/

0 commit comments

Comments
 (0)