Skip to content

Commit 7ac5182

Browse files
author
DESKTOP\Kostadin
committed
add nonce to tokens transfer api in eth
1 parent 66be3c9 commit 7ac5182

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/RestApis/Blockchain/ETH/TokenAPI/TransferTokens.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ class TransferTokens extends Common {
1818
* @param $gasPrice int
1919
* @param $gasLimit int
2020
* @param $token double
21+
* @param $nonce int
2122
* @return \stdClass
2223
*/
23-
public function transferWithPass($network, $fromAddress, $toAddress, $contract, $password, $gasPrice, $gasLimit, $token)
24+
public function transferWithPass($network, $fromAddress, $toAddress, $contract, $password, $gasPrice, $gasLimit, $token, $nonce = null)
2425
{
2526
$this->network = $network;
2627

@@ -34,6 +35,10 @@ public function transferWithPass($network, $fromAddress, $toAddress, $contract,
3435
'token' => $token
3536
];
3637

38+
if(!is_null($nonce)) {
39+
$params['nonce'] = $nonce;
40+
}
41+
3742
return (new Response(
3843
$this->request([
3944
'method' => 'POST',
@@ -51,9 +56,10 @@ public function transferWithPass($network, $fromAddress, $toAddress, $contract,
5156
* @param $gasPrice int
5257
* @param $gasLimit int
5358
* @param $token double
59+
* @param $nonce int
5460
* @return \stdClass
5561
*/
56-
public function transferWithPvtKey($network, $fromAddress, $toAddress, $contract, $privateKey, $gasPrice, $gasLimit, $token)
62+
public function transferWithPvtKey($network, $fromAddress, $toAddress, $contract, $privateKey, $gasPrice, $gasLimit, $token, $nonce = null)
5763
{
5864
$this->network = $network;
5965

@@ -67,6 +73,10 @@ public function transferWithPvtKey($network, $fromAddress, $toAddress, $contract
6773
'token' => $token
6874
];
6975

76+
if(!is_null($nonce)) {
77+
$params['nonce'] = $nonce;
78+
}
79+
7080
return (new Response(
7181
$this->request([
7282
'method' => 'POST',

0 commit comments

Comments
 (0)