-
Notifications
You must be signed in to change notification settings - Fork 0
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 #3 from kadena-php/feature/refactor-and-add-capabi…
…lity-support Refactor and add capability support
- Loading branch information
Showing
76 changed files
with
1,825 additions
and
1,658 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
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,10 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Kadena\Contracts; | ||
|
||
interface Collection | ||
{ | ||
public function toArray(): array; | ||
public function first(): mixed; | ||
public function get(int $offset): mixed; | ||
} |
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,12 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Kadena\Contracts\Crypto; | ||
|
||
use Kadena\ValueObjects\Command\Command; | ||
use Kadena\ValueObjects\Command\SignedCommand; | ||
use Kadena\ValueObjects\Signer\KeyPairCollection; | ||
|
||
interface CommandSigner | ||
{ | ||
public static function sign(Command $command, KeyPairCollection $keyPairs): SignedCommand; | ||
} |
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,10 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Kadena\Contracts\Crypto; | ||
|
||
use Kadena\ValueObjects\Signer\KeyPair; | ||
|
||
interface KeyFactory | ||
{ | ||
public static function generate(): KeyPair; | ||
} |
11 changes: 4 additions & 7 deletions
11
src/Crypto/Contracts/Signer.php → src/Contracts/Crypto/MessageSigner.php
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,12 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Kadena\Contracts\DataMappers; | ||
|
||
use Kadena\ValueObjects\Command\Command; | ||
|
||
interface CommandMapper | ||
{ | ||
public static function toArray(Command $command): array; | ||
public static function toString(Command $command): string; | ||
public static function fromString(string $commandJson): Command; | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Contracts/DataMappers/SignedCommandCollectionMapper.php
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,11 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Kadena\Contracts\DataMappers; | ||
|
||
use Kadena\ValueObjects\Command\SignedCommandCollection; | ||
|
||
interface SignedCommandCollectionMapper | ||
{ | ||
public static function toArray(SignedCommandCollection $commands): array; | ||
public static function toString(SignedCommandCollection $commands): string; | ||
} |
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,12 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Kadena\Contracts\DataMappers; | ||
|
||
use Kadena\ValueObjects\Command\SignedCommand; | ||
|
||
interface SignedCommandMapper | ||
{ | ||
public static function toArray(SignedCommand $command): array; | ||
public static function toString(SignedCommand $command): string; | ||
public static function fromString(string $commandJson): SignedCommand; | ||
} |
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,23 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Kadena\Contracts\Pact; | ||
|
||
use Kadena\ValueObjects\Command\Command; | ||
use Kadena\ValueObjects\Command\Metadata; | ||
use Kadena\ValueObjects\Command\Payload\ContinuePayload; | ||
use Kadena\ValueObjects\Command\Payload\ExecutePayload; | ||
use Kadena\ValueObjects\Signer\Signer; | ||
use Kadena\ValueObjects\Signer\SignerCollection; | ||
|
||
interface CommandFactory | ||
{ | ||
public static function load(Command $command): self; | ||
public function addSigner(Signer $signer): self; | ||
public function withMetadata(Metadata $metadata): self; | ||
public function withExecutePayload(ExecutePayload $payload): self; | ||
public function withContinuePayload(ContinuePayload $payload): self; | ||
public function withNonce(string $nonce): self; | ||
public function withNetworkId(string $networkId): self; | ||
public function withSigners(SignerCollection $signers): self; | ||
public function make(): Command; | ||
} |
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,11 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Kadena\Contracts\Pact; | ||
|
||
use Kadena\ValueObjects\Command\Metadata; | ||
|
||
interface MetadataFactory | ||
{ | ||
public function withOptions(array $options): self; | ||
public function make(): Metadata; | ||
} |
Oops, something went wrong.