generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial pass inscriptions for Laravel
- Loading branch information
1 parent
05062ba
commit 008179d
Showing
9 changed files
with
935 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Trustenterprises\LaravelHashgraph\Contracts; | ||
|
||
use Trustenterprises\LaravelHashgraph\Models\Inscriptions\BurnInscription; | ||
use Trustenterprises\LaravelHashgraph\Models\Inscriptions\DeployInscription; | ||
use Trustenterprises\LaravelHashgraph\Models\Inscriptions\MintInscription; | ||
use Trustenterprises\LaravelHashgraph\Models\Inscriptions\InscriptionResponse; | ||
use Trustenterprises\LaravelHashgraph\Models\Inscriptions\TransferInscription; | ||
|
||
interface InscriptionMethodInterface | ||
{ | ||
/** | ||
* @param MintInscription $request | ||
* @return InscriptionResponse | ||
*/ | ||
public function deployInscription(DeployInscription $request): InscriptionResponse; | ||
|
||
/** | ||
* @param MintInscription $request | ||
* @return InscriptionResponse | ||
*/ | ||
public function mintInscription(MintInscription $request): InscriptionResponse; | ||
|
||
/** | ||
* @param BurnInscription $request | ||
* @return InscriptionResponse | ||
*/ | ||
public function burnInscription(BurnInscription $request): InscriptionResponse; | ||
|
||
/** | ||
* @param TransferInscription $request | ||
* @return InscriptionResponse | ||
*/ | ||
public function transferInscription(TransferInscription $request): InscriptionResponse; | ||
} |
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,130 @@ | ||
<?php | ||
|
||
namespace Trustenterprises\LaravelHashgraph\Models\Inscriptions; | ||
|
||
use GuzzleHttp\RequestOptions; | ||
|
||
class BurnInscription | ||
{ | ||
private String $from; | ||
|
||
private int $amount; | ||
|
||
private String $ticker; | ||
|
||
private ?String $memo = null; | ||
|
||
private ?String $topic_id = null; | ||
|
||
/** | ||
* FungibleToken constructor. | ||
* @param string $ticker | ||
* @param string $from | ||
* @param int $amount | ||
*/ | ||
public function __construct(string $ticker, string $from, int $amount) | ||
{ | ||
$this->ticker = $ticker; | ||
$this->from = $from; | ||
$this->amount = $amount; | ||
} | ||
|
||
public function forRequest(): array | ||
{ | ||
$payload = [ | ||
'from' => $this->getFrom(), | ||
'amount' => $this->getAmount(), | ||
]; | ||
|
||
if ($this->getMemo()) { | ||
$payload['memo'] = $this->getMemo(); | ||
} | ||
|
||
if ($this->getPrivateTopicId()) { | ||
$payload['topic_id'] = $this->getPrivateTopicId(); | ||
} | ||
|
||
return [ RequestOptions::JSON => $payload ]; | ||
} | ||
|
||
/** | ||
* @return String|string | ||
*/ | ||
public function getTicker() | ||
{ | ||
return $this->ticker; | ||
} | ||
|
||
/** | ||
* @param String|string $ticker | ||
*/ | ||
public function setTicker($ticker) | ||
{ | ||
$this->ticker = $ticker; | ||
} | ||
|
||
/** | ||
* @return String | ||
*/ | ||
public function getMemo() | ||
{ | ||
return $this->memo; | ||
} | ||
|
||
/** | ||
* @param String $memo | ||
*/ | ||
public function setMemo($memo) | ||
{ | ||
$this->memo = $memo; | ||
} | ||
|
||
/** | ||
* @return String | ||
*/ | ||
public function getPrivateTopicId() | ||
{ | ||
return $this->topic_id; | ||
} | ||
|
||
/** | ||
* @param String $topic_id | ||
*/ | ||
public function setPrivateTopic($topic_id) | ||
{ | ||
$this->topic_id = $topic_id; | ||
} | ||
|
||
/** | ||
* @return string|string | ||
*/ | ||
public function getFrom() | ||
{ | ||
return $this->from; | ||
} | ||
|
||
/** | ||
* @param string|string $from | ||
*/ | ||
public function setFrom($from) | ||
{ | ||
$this->from = $from; | ||
} | ||
|
||
/** | ||
* @return int|int | ||
*/ | ||
public function getAmount() | ||
{ | ||
return $this->amount; | ||
} | ||
|
||
/** | ||
* @param int|int $amount | ||
*/ | ||
public function setAmount($amount) | ||
{ | ||
$this->amount = $amount; | ||
} | ||
} | ||
|
Oops, something went wrong.