mirror of
https://github.com/kevachat/kevacoin-php.git
synced 2025-02-02 01:44:36 +00:00
implement sendFrom method
This commit is contained in:
parent
e852a26401
commit
de9e6f905d
@ -600,6 +600,45 @@ class Client
|
||||
return null;
|
||||
}
|
||||
|
||||
public function sendFrom(
|
||||
string $fromaccount,
|
||||
string $toaddress,
|
||||
float $amount,
|
||||
?int $minconf = null,
|
||||
?string $comment = null,
|
||||
?string $comment_to = null
|
||||
): ?string
|
||||
{
|
||||
$this->_id++;
|
||||
|
||||
$this->_prepare(
|
||||
'',
|
||||
'POST',
|
||||
[
|
||||
'method' => 'sendfrom',
|
||||
'params' =>
|
||||
[
|
||||
$fromaccount,
|
||||
$toaddress,
|
||||
$amount,
|
||||
$minconf,
|
||||
$comment,
|
||||
$comment_to
|
||||
],
|
||||
'id' => $this->_id
|
||||
]
|
||||
);
|
||||
|
||||
$response = $this->_execute();
|
||||
|
||||
if (!empty($response['result']) && !empty($response['result']['txid']) && is_string($response['result']['txid']))
|
||||
{
|
||||
return $response['result']['txid'];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getAccount(string $address): ?string
|
||||
{
|
||||
$this->_id++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user