-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathAbiFunction.php
More file actions
40 lines (35 loc) · 1.63 KB
/
AbiFunction.php
File metadata and controls
40 lines (35 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
declare(strict_types=1);
namespace ArkEcosystem\Crypto\Enums;
use ArkEcosystem\Crypto\Transactions\Types\EvmCall;
use ArkEcosystem\Crypto\Transactions\Types\Multipayment;
use ArkEcosystem\Crypto\Transactions\Types\Unvote;
use ArkEcosystem\Crypto\Transactions\Types\UsernameRegistration;
use ArkEcosystem\Crypto\Transactions\Types\UsernameResignation;
use ArkEcosystem\Crypto\Transactions\Types\ValidatorRegistration;
use ArkEcosystem\Crypto\Transactions\Types\ValidatorResignation;
use ArkEcosystem\Crypto\Transactions\Types\Vote;
enum AbiFunction: string
{
case VOTE = 'vote';
case UNVOTE = 'unvote';
case VALIDATOR_REGISTRATION = 'registerValidator';
case VALIDATOR_RESIGNATION = 'resignValidator';
case USERNAME_REGISTRATION = 'registerUsername';
case USERNAME_RESIGNATION = 'resignUsername';
case MULTIPAYMENT = 'pay';
case TRANSFER = 'transfer';
public function transactionClass(): string
{
return match ($this) {
self::VOTE => Vote::class,
self::UNVOTE => Unvote::class,
self::VALIDATOR_REGISTRATION => ValidatorRegistration::class,
self::VALIDATOR_RESIGNATION => ValidatorResignation::class,
self::USERNAME_REGISTRATION => UsernameRegistration::class,
self::USERNAME_RESIGNATION => UsernameResignation::class,
self::MULTIPAYMENT => Multipayment::class,
self::TRANSFER => EvmCall::class,
};
}
}