This repository has been archived by the owner on Sep 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from habrauser/new_methods
Added new classes CreateWallet, ListWallets, LoadWallets
- Loading branch information
Showing
8 changed files
with
195 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
|
||
namespace Electrum\Request\Method\Address; | ||
|
||
|
||
use Electrum\Request\AbstractMethod; | ||
use Electrum\Request\MethodInterface; | ||
|
||
/** | ||
* Generating new address if you need more | ||
* @original_author Pascal Krason <p.krason@padr.io> | ||
*/ | ||
class CreateNewAddress extends AbstractMethod implements MethodInterface | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $method = 'createnewaddress'; | ||
|
||
/** | ||
* @param array $attributes | ||
* @return object | ||
* @throws \Electrum\Request\Exception\BadRequestException | ||
* @throws \Electrum\Response\Exception\ElectrumResponseException | ||
*/ | ||
public function execute(array $attributes = []) | ||
{ | ||
return $this->getClient()->execute($this->method, $attributes); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Electrum\Request\Method\Wallet; | ||
|
||
use Electrum\Request\AbstractMethod; | ||
use Electrum\Request\MethodInterface; | ||
|
||
/** | ||
* Return newly created wallet | ||
* @original_author Pascal Krason <p.krason@padr.io> | ||
*/ | ||
class CreateWallet extends AbstractMethod implements MethodInterface | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $method = 'create'; | ||
|
||
/** | ||
* @param array $attributes | ||
* @return object | ||
* @throws \Electrum\Request\Exception\BadRequestException | ||
* @throws \Electrum\Response\Exception\ElectrumResponseException | ||
*/ | ||
public function execute(array $attributes = []) | ||
{ | ||
return $this->getClient()->execute($this->method, $attributes); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
|
||
namespace Electrum\Request\Method\Wallet; | ||
|
||
|
||
use Electrum\Request\AbstractMethod; | ||
use Electrum\Request\MethodInterface; | ||
|
||
/** | ||
* Return all loaded wallets | ||
* @original_author Pascal Krason <p.krason@padr.io> | ||
*/ | ||
class ListWallets extends AbstractMethod implements MethodInterface | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $method = 'list_wallets'; | ||
|
||
/** | ||
* @return object | ||
* @throws \Electrum\Request\Exception\BadRequestException | ||
* @throws \Electrum\Response\Exception\ElectrumResponseException | ||
*/ | ||
public function execute() | ||
{ | ||
return $this->getClient()->execute($this->method); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
|
||
namespace Electrum\Request\Method\Wallet; | ||
|
||
|
||
use Electrum\Request\AbstractMethod; | ||
use Electrum\Request\MethodInterface; | ||
|
||
/** | ||
* Load wallet | ||
* @original_author Pascal Krason <p.krason@padr.io> | ||
*/ | ||
class LoadWallet extends AbstractMethod implements MethodInterface | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $method = 'load_wallet'; | ||
|
||
/** | ||
* @param array $attributes | ||
* @return object | ||
* @throws \Electrum\Request\Exception\BadRequestException | ||
* @throws \Electrum\Response\Exception\ElectrumResponseException | ||
*/ | ||
public function execute(array $attributes = []) | ||
{ | ||
return $this->getClient()->execute($this->method, $attributes); | ||
} | ||
} |