arkecosystem-crypto 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/lib/arkecosystem/crypto.rb +35 -42
  3. data/lib/arkecosystem/crypto/{identity → identities}/address.rb +10 -4
  4. data/lib/arkecosystem/crypto/identities/private_key.rb +18 -0
  5. data/lib/arkecosystem/crypto/identities/public_key.rb +18 -0
  6. data/lib/arkecosystem/crypto/{identity → identities}/wif.rb +4 -4
  7. data/lib/arkecosystem/crypto/networks/devnet.rb +1 -5
  8. data/lib/arkecosystem/crypto/networks/mainnet.rb +1 -5
  9. data/lib/arkecosystem/crypto/networks/testnet.rb +1 -5
  10. data/lib/arkecosystem/crypto/transactions/builder/base.rb +52 -0
  11. data/lib/arkecosystem/crypto/transactions/builder/delegate_registration.rb +34 -0
  12. data/lib/arkecosystem/crypto/transactions/builder/multi_signature_registration.rb +43 -0
  13. data/lib/arkecosystem/crypto/transactions/builder/second_signature_registration.rb +28 -0
  14. data/lib/arkecosystem/crypto/transactions/builder/transfer.rb +33 -0
  15. data/lib/arkecosystem/crypto/transactions/builder/vote.rb +29 -0
  16. data/lib/arkecosystem/crypto/transactions/deserializer.rb +98 -0
  17. data/lib/arkecosystem/crypto/transactions/deserializers/base.rb +17 -0
  18. data/lib/arkecosystem/crypto/transactions/deserializers/delegate_registration.rb +24 -0
  19. data/lib/arkecosystem/crypto/transactions/deserializers/delegate_resignation.rb +14 -0
  20. data/lib/arkecosystem/crypto/transactions/deserializers/ipfs.rb +20 -0
  21. data/lib/arkecosystem/crypto/transactions/deserializers/multi_payment.rb +40 -0
  22. data/lib/arkecosystem/crypto/transactions/deserializers/multi_signature_registration.rb +34 -0
  23. data/lib/arkecosystem/crypto/transactions/deserializers/second_signature_registration.rb +20 -0
  24. data/lib/arkecosystem/crypto/transactions/deserializers/timelock_transfer.rb +21 -0
  25. data/lib/arkecosystem/crypto/transactions/deserializers/transfer.rb +21 -0
  26. data/lib/arkecosystem/crypto/transactions/deserializers/vote.rb +33 -0
  27. data/lib/arkecosystem/crypto/transactions/serializer.rb +86 -0
  28. data/lib/arkecosystem/crypto/transactions/serializers/base.rb +15 -0
  29. data/lib/arkecosystem/crypto/transactions/serializers/delegate_registration.rb +19 -0
  30. data/lib/arkecosystem/crypto/transactions/serializers/delegate_resignation.rb +14 -0
  31. data/lib/arkecosystem/crypto/transactions/serializers/ipfs.rb +19 -0
  32. data/lib/arkecosystem/crypto/transactions/serializers/multi_payment.rb +25 -0
  33. data/lib/arkecosystem/crypto/transactions/serializers/multi_signature_registration.rb +33 -0
  34. data/lib/arkecosystem/crypto/transactions/serializers/second_signature_registration.rb +16 -0
  35. data/lib/arkecosystem/crypto/transactions/serializers/timelock_transfer.rb +23 -0
  36. data/lib/arkecosystem/crypto/transactions/serializers/transfer.rb +22 -0
  37. data/lib/arkecosystem/crypto/transactions/serializers/vote.rb +25 -0
  38. data/lib/arkecosystem/crypto/transactions/transaction.rb +198 -0
  39. data/lib/arkecosystem/crypto/utils/message.rb +42 -0
  40. data/lib/arkecosystem/crypto/utils/slot.rb +23 -0
  41. data/lib/arkecosystem/crypto/version.rb +1 -1
  42. metadata +67 -39
  43. data/lib/arkecosystem/crypto/builder/delegate_registration.rb +0 -33
  44. data/lib/arkecosystem/crypto/builder/multi_signature_registration.rb +0 -45
  45. data/lib/arkecosystem/crypto/builder/second_signature_registration.rb +0 -27
  46. data/lib/arkecosystem/crypto/builder/transaction.rb +0 -109
  47. data/lib/arkecosystem/crypto/builder/transfer.rb +0 -32
  48. data/lib/arkecosystem/crypto/builder/vote.rb +0 -28
  49. data/lib/arkecosystem/crypto/crypto.rb +0 -144
  50. data/lib/arkecosystem/crypto/deserialiser.rb +0 -94
  51. data/lib/arkecosystem/crypto/deserialisers/base.rb +0 -15
  52. data/lib/arkecosystem/crypto/deserialisers/delegate_registration.rb +0 -22
  53. data/lib/arkecosystem/crypto/deserialisers/delegate_resignation.rb +0 -12
  54. data/lib/arkecosystem/crypto/deserialisers/ipfs.rb +0 -18
  55. data/lib/arkecosystem/crypto/deserialisers/multi_payment.rb +0 -38
  56. data/lib/arkecosystem/crypto/deserialisers/multi_signature_registration.rb +0 -32
  57. data/lib/arkecosystem/crypto/deserialisers/second_signature_registration.rb +0 -18
  58. data/lib/arkecosystem/crypto/deserialisers/timelock_transfer.rb +0 -19
  59. data/lib/arkecosystem/crypto/deserialisers/transfer.rb +0 -18
  60. data/lib/arkecosystem/crypto/deserialisers/vote.rb +0 -31
  61. data/lib/arkecosystem/crypto/identity/private_key.rb +0 -14
  62. data/lib/arkecosystem/crypto/identity/public_key.rb +0 -18
  63. data/lib/arkecosystem/crypto/message.rb +0 -42
  64. data/lib/arkecosystem/crypto/models/transaction.rb +0 -16
  65. data/lib/arkecosystem/crypto/serialiser.rb +0 -84
  66. data/lib/arkecosystem/crypto/serialisers/base.rb +0 -13
  67. data/lib/arkecosystem/crypto/serialisers/delegate_registration.rb +0 -17
  68. data/lib/arkecosystem/crypto/serialisers/delegate_resignation.rb +0 -12
  69. data/lib/arkecosystem/crypto/serialisers/ipfs.rb +0 -17
  70. data/lib/arkecosystem/crypto/serialisers/multi_payment.rb +0 -23
  71. data/lib/arkecosystem/crypto/serialisers/multi_signature_registration.rb +0 -31
  72. data/lib/arkecosystem/crypto/serialisers/second_signature_registration.rb +0 -14
  73. data/lib/arkecosystem/crypto/serialisers/timelock_transfer.rb +0 -21
  74. data/lib/arkecosystem/crypto/serialisers/transfer.rb +0 -20
  75. data/lib/arkecosystem/crypto/serialisers/vote.rb +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b64a593bf5f7bd992cafb8351fbfbe6f4bb29e1d25f2630bbc95439f7f31a638
4
- data.tar.gz: a455e2df8f107f3fe9e8ff800c98f1c56cc09c204fa79d47104577868cf1c918
3
+ metadata.gz: cd066f7d7ee4b19bfc41e6015e3ac4ad5d328177619cb1fca893eee07b3c77a2
4
+ data.tar.gz: f5adc3875d4ef53dadd8f5a661ce7bc3774b0096dfe95bbca01c3573974aab8c
5
5
  SHA512:
6
- metadata.gz: ed8656bf7f41e751ec93db37c5f80baee5a1d9d80d65b58d142f07138bae869174974a601495da8dd27d0f78e6c9e0d2e3f3e59bdb621f37044dbf8abf3324b1
7
- data.tar.gz: 0033c2c7b4a951ebb3282a1924ba8abcb8f1816008a51e14baa2f1de35ee7a526a268dc23859acaf1f72be14c42bd5566a4e52500f1def70d2ee85cac894e747
6
+ metadata.gz: 42c940cfe7fb6171c01fbc87637518df3bf649ae288293b28cd6778d963462aeb18322a13ccdc5fa6d4def7663a98d05a09f8acda42fcb7bb77cd0bba53b4995
7
+ data.tar.gz: 8760434dd8193b858f0f615001ed465fda9182475a3bc834ffc1ac0aab79803dccd4439117d8874a6feab431b79e33a6d0038599ea6a39a5b1d33f5c5bd43552
@@ -1,49 +1,42 @@
1
- require 'arkecosystem/crypto/crypto'
2
- require 'arkecosystem/crypto/message'
3
-
4
- require 'arkecosystem/crypto/builder/delegate_registration'
5
- require 'arkecosystem/crypto/builder/multi_signature_registration'
6
- require 'arkecosystem/crypto/builder/second_signature_registration'
7
- require 'arkecosystem/crypto/builder/transfer'
8
- require 'arkecosystem/crypto/builder/vote'
9
-
10
1
  require 'arkecosystem/crypto/configuration/fee'
11
2
  require 'arkecosystem/crypto/configuration/network'
12
-
13
3
  require 'arkecosystem/crypto/enums/fees'
14
4
  require 'arkecosystem/crypto/enums/types'
15
-
16
- require 'arkecosystem/crypto/identity/address'
17
- require 'arkecosystem/crypto/identity/private_key'
18
- require 'arkecosystem/crypto/identity/public_key'
19
- require 'arkecosystem/crypto/identity/wif'
20
-
21
- require 'arkecosystem/crypto/models/transaction'
22
-
5
+ require 'arkecosystem/crypto/identities/address'
6
+ require 'arkecosystem/crypto/identities/private_key'
7
+ require 'arkecosystem/crypto/identities/public_key'
8
+ require 'arkecosystem/crypto/identities/wif'
23
9
  require 'arkecosystem/crypto/networks/devnet'
24
10
  require 'arkecosystem/crypto/networks/mainnet'
25
11
  require 'arkecosystem/crypto/networks/testnet'
26
-
27
- require 'arkecosystem/crypto/serialiser'
28
- require 'arkecosystem/crypto/serialisers/base'
29
- require 'arkecosystem/crypto/serialisers/delegate_registration'
30
- require 'arkecosystem/crypto/serialisers/delegate_resignation'
31
- require 'arkecosystem/crypto/serialisers/ipfs'
32
- require 'arkecosystem/crypto/serialisers/multi_payment'
33
- require 'arkecosystem/crypto/serialisers/multi_signature_registration'
34
- require 'arkecosystem/crypto/serialisers/second_signature_registration'
35
- require 'arkecosystem/crypto/serialisers/timelock_transfer'
36
- require 'arkecosystem/crypto/serialisers/transfer'
37
- require 'arkecosystem/crypto/serialisers/vote'
38
-
39
- require 'arkecosystem/crypto/deserialiser'
40
- require 'arkecosystem/crypto/deserialisers/base'
41
- require 'arkecosystem/crypto/deserialisers/delegate_registration'
42
- require 'arkecosystem/crypto/deserialisers/delegate_resignation'
43
- require 'arkecosystem/crypto/deserialisers/ipfs'
44
- require 'arkecosystem/crypto/deserialisers/multi_payment'
45
- require 'arkecosystem/crypto/deserialisers/multi_signature_registration'
46
- require 'arkecosystem/crypto/deserialisers/second_signature_registration'
47
- require 'arkecosystem/crypto/deserialisers/timelock_transfer'
48
- require 'arkecosystem/crypto/deserialisers/transfer'
49
- require 'arkecosystem/crypto/deserialisers/vote'
12
+ require 'arkecosystem/crypto/transactions/builder/base'
13
+ require 'arkecosystem/crypto/transactions/builder/delegate_registration'
14
+ require 'arkecosystem/crypto/transactions/builder/multi_signature_registration'
15
+ require 'arkecosystem/crypto/transactions/builder/second_signature_registration'
16
+ require 'arkecosystem/crypto/transactions/builder/transfer'
17
+ require 'arkecosystem/crypto/transactions/builder/vote'
18
+ require 'arkecosystem/crypto/transactions/deserializer'
19
+ require 'arkecosystem/crypto/transactions/deserializers/base'
20
+ require 'arkecosystem/crypto/transactions/deserializers/delegate_registration'
21
+ require 'arkecosystem/crypto/transactions/deserializers/delegate_resignation'
22
+ require 'arkecosystem/crypto/transactions/deserializers/ipfs'
23
+ require 'arkecosystem/crypto/transactions/deserializers/multi_payment'
24
+ require 'arkecosystem/crypto/transactions/deserializers/multi_signature_registration'
25
+ require 'arkecosystem/crypto/transactions/deserializers/second_signature_registration'
26
+ require 'arkecosystem/crypto/transactions/deserializers/timelock_transfer'
27
+ require 'arkecosystem/crypto/transactions/deserializers/transfer'
28
+ require 'arkecosystem/crypto/transactions/deserializers/vote'
29
+ require 'arkecosystem/crypto/transactions/serializer'
30
+ require 'arkecosystem/crypto/transactions/serializers/base'
31
+ require 'arkecosystem/crypto/transactions/serializers/delegate_registration'
32
+ require 'arkecosystem/crypto/transactions/serializers/delegate_resignation'
33
+ require 'arkecosystem/crypto/transactions/serializers/ipfs'
34
+ require 'arkecosystem/crypto/transactions/serializers/multi_payment'
35
+ require 'arkecosystem/crypto/transactions/serializers/multi_signature_registration'
36
+ require 'arkecosystem/crypto/transactions/serializers/second_signature_registration'
37
+ require 'arkecosystem/crypto/transactions/serializers/timelock_transfer'
38
+ require 'arkecosystem/crypto/transactions/serializers/transfer'
39
+ require 'arkecosystem/crypto/transactions/serializers/vote'
40
+ require 'arkecosystem/crypto/transactions/transaction'
41
+ require 'arkecosystem/crypto/utils/message'
42
+ require 'arkecosystem/crypto/utils/slot'
@@ -3,11 +3,11 @@ require 'arkecosystem/crypto/configuration/network'
3
3
 
4
4
  module ArkEcosystem
5
5
  module Crypto
6
- module Identity
6
+ module Identities
7
7
  # The identity utility for an address.
8
8
  class Address
9
- def self.from_secret(secret, network = nil)
10
- private_key = PrivateKey.from_secret(secret)
9
+ def self.from_passphrase(passphrase, network = nil)
10
+ private_key = PrivateKey.from_passphrase(passphrase)
11
11
 
12
12
  from_private_key(private_key, network)
13
13
  end
@@ -23,7 +23,13 @@ module ArkEcosystem
23
23
 
24
24
  public_key = Digest::RMD160.digest(private_key.public_key)
25
25
 
26
- BTC::Base58.base58check_from_data([network.version.to_i(16)].pack('c') + public_key)
26
+ version = if network.is_a? Integer
27
+ network
28
+ else
29
+ network.version
30
+ end
31
+
32
+ BTC::Base58.base58check_from_data([version].pack('c') + public_key)
27
33
  end
28
34
 
29
35
  def self.validate(address)
@@ -0,0 +1,18 @@
1
+ require 'btcruby'
2
+
3
+ module ArkEcosystem
4
+ module Crypto
5
+ module Identities
6
+ # The identity utility for a private key.
7
+ class PrivateKey
8
+ def self.from_passphrase(passphrase)
9
+ BTC::Key.new(private_key: Digest::SHA256.digest(passphrase))
10
+ end
11
+
12
+ def self.from_hex(private_key)
13
+ BTC::Key.new(private_key: BTC.from_hex(private_key))
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ require 'btcruby'
2
+
3
+ module ArkEcosystem
4
+ module Crypto
5
+ module Identities
6
+ # The identity utility for a public key.
7
+ class PublicKey
8
+ def self.from_passphrase(passphrase)
9
+ PrivateKey.from_passphrase(passphrase).public_key
10
+ end
11
+
12
+ def self.from_hex(public_key)
13
+ BTC::Key.new(public_key: BTC.from_hex(public_key))
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -2,16 +2,16 @@ require 'btcruby'
2
2
 
3
3
  module ArkEcosystem
4
4
  module Crypto
5
- module Identity
5
+ module Identities
6
6
  # The identity utility for a WIF.
7
7
  class WIF
8
- def self.from_secret(secret, network = nil)
8
+ def self.from_passphrase(passphrase, network = nil)
9
9
  network ||= ArkEcosystem::Crypto::Configuration::Network.get
10
10
 
11
- secret = Digest::SHA256.digest(secret)
11
+ passphrase = Digest::SHA256.digest(passphrase)
12
12
 
13
13
  seed = [network.wif].pack('C*')
14
- seed << secret
14
+ seed << passphrase
15
15
  seed << [0x01].pack('C*')
16
16
 
17
17
  BTC::Base58.base58check_from_data(seed)
@@ -8,11 +8,7 @@ module ArkEcosystem
8
8
  end
9
9
 
10
10
  def self.version
11
- '1e'
12
- end
13
-
14
- def self.nethash
15
- '578e820911f24e039733b45e4882b73e301f813a0d2c31330dafda84534ffa23'
11
+ 0x1e
16
12
  end
17
13
 
18
14
  def self.wif
@@ -8,11 +8,7 @@ module ArkEcosystem
8
8
  end
9
9
 
10
10
  def self.version
11
- '17'
12
- end
13
-
14
- def self.nethash
15
- '6e84d08bd299ed97c212c886c98a57e36545c8f5d645ca7eeae63a8bd62d8988'
11
+ 0x17
16
12
  end
17
13
 
18
14
  def self.wif
@@ -8,11 +8,7 @@ module ArkEcosystem
8
8
  end
9
9
 
10
10
  def self.version
11
- '17'
12
- end
13
-
14
- def self.nethash
15
- 'd9acd04bde4234a81addb8482333b4ac906bed7be5a9970ce8ada428bd083192'
11
+ 0x17
16
12
  end
17
13
 
18
14
  def self.wif
@@ -0,0 +1,52 @@
1
+ require 'time'
2
+ require 'arkecosystem/crypto/identities/private_key'
3
+ require 'arkecosystem/crypto/configuration/fee'
4
+ require 'arkecosystem/crypto/configuration/network'
5
+ require 'btcruby/base58'
6
+ require 'deep_hash_transform'
7
+
8
+ module ArkEcosystem
9
+ module Crypto
10
+ module Transactions
11
+ module Builder
12
+ # The base builder for transactions.
13
+ class Base
14
+ def initialize
15
+ @transaction = ArkEcosystem::Crypto::Transactions::Transaction.new()
16
+ @transaction.type = type
17
+ @transaction.fee = ArkEcosystem::Crypto::Configuration::Fee.get(@transaction.type)
18
+ @transaction.sender_public_key = nil
19
+ @transaction.recipient_id = nil
20
+ @transaction.amount = 0
21
+ @transaction.vendor_field = nil
22
+ @transaction.timestamp = ArkEcosystem::Crypto::Utils::Slot.get_time
23
+ @transaction.asset = {}
24
+ end
25
+
26
+ def sign(passphrase)
27
+ sign_and_create_id(passphrase)
28
+ end
29
+
30
+ def sign_and_create_id(passphrase)
31
+ @transaction.sign(passphrase)
32
+ @transaction.id = @transaction.get_id
33
+ self
34
+ end
35
+
36
+ def second_sign(second_passphrase)
37
+ @transaction.second_sign(second_passphrase)
38
+ self
39
+ end
40
+
41
+ def verify
42
+ @transaction.verify
43
+ end
44
+
45
+ def second_verify(second_public_key)
46
+ @transaction.second_verify(second_public_key)
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,34 @@
1
+ require 'arkecosystem/crypto/enums/fees'
2
+ require 'arkecosystem/crypto/enums/types'
3
+ require 'arkecosystem/crypto/identities/public_key'
4
+ require 'arkecosystem/crypto/transactions/builder/base'
5
+
6
+ module ArkEcosystem
7
+ module Crypto
8
+ module Transactions
9
+ module Builder
10
+ # The builder for delegate registration transactions.
11
+ class DelegateRegistration < Base
12
+ def set_username(username)
13
+ @username = username
14
+ self
15
+ end
16
+
17
+ def sign(passphrase)
18
+ @transaction.asset = {
19
+ delegate: {
20
+ username: @username,
21
+ public_key: ArkEcosystem::Crypto::Identities::PublicKey.from_passphrase(passphrase)
22
+ }
23
+ }
24
+ sign_and_create_id(passphrase)
25
+ end
26
+
27
+ def type
28
+ ArkEcosystem::Crypto::Enums::Types::DELEGATE_REGISTRATION
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,43 @@
1
+ require 'arkecosystem/crypto/enums/fees'
2
+ require 'arkecosystem/crypto/enums/types'
3
+ require 'arkecosystem/crypto/transactions/builder/base'
4
+
5
+ module ArkEcosystem
6
+ module Crypto
7
+ module Transactions
8
+ module Builder
9
+ # The builder for multi signature registration transactions.
10
+ class MultiSignatureRegistration < Base
11
+ def initialize
12
+ super
13
+
14
+ @transaction.asset = {
15
+ multisignature: {}
16
+ }
17
+ end
18
+
19
+ def set_keysgroup(keysgroup)
20
+ @fee = (keysgroup.size + 1) * ArkEcosystem::Crypto::Configuration::Fee.get(@transaction.type)
21
+
22
+ @transaction.asset[:multisignature][:keysgroup] = keysgroup
23
+ self
24
+ end
25
+
26
+ def set_lifetime(lifetime)
27
+ @transaction.asset[:multisignature][:lifetime] = lifetime
28
+ self
29
+ end
30
+
31
+ def set_min(min)
32
+ @transaction.asset[:multisignature][:min] = min
33
+ self
34
+ end
35
+
36
+ def type
37
+ ArkEcosystem::Crypto::Enums::Types::MULTI_SIGNATURE_REGISTRATION
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,28 @@
1
+ require 'arkecosystem/crypto/enums/fees'
2
+ require 'arkecosystem/crypto/enums/types'
3
+ require 'arkecosystem/crypto/identities/public_key'
4
+ require 'arkecosystem/crypto/transactions/builder/base'
5
+
6
+ module ArkEcosystem
7
+ module Crypto
8
+ module Transactions
9
+ module Builder
10
+ # The builder for second signature registration transactions.
11
+ class SecondSignatureRegistration < Base
12
+ def set_second_passphrase(second_passphrase)
13
+ @transaction.asset = {
14
+ signature: {
15
+ public_key: ArkEcosystem::Crypto::Identities::PublicKey.from_passphrase(second_passphrase)
16
+ }
17
+ }
18
+ self
19
+ end
20
+
21
+ def type
22
+ ArkEcosystem::Crypto::Enums::Types::SECOND_SIGNATURE_REGISTRATION
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,33 @@
1
+ require 'arkecosystem/crypto/enums/fees'
2
+ require 'arkecosystem/crypto/enums/types'
3
+ require 'arkecosystem/crypto/transactions/builder/base'
4
+
5
+ module ArkEcosystem
6
+ module Crypto
7
+ module Transactions
8
+ module Builder
9
+ # The builder for transfer transactions.
10
+ class Transfer < Base
11
+ def set_recipient_id(recipient_id)
12
+ @transaction.recipient_id = recipient_id
13
+ self
14
+ end
15
+
16
+ def set_amount(amount)
17
+ @transaction.amount = amount
18
+ self
19
+ end
20
+
21
+ def set_vendor_field(vendor_field)
22
+ @transaction.vendor_field = vendor_field
23
+ self
24
+ end
25
+
26
+ def type
27
+ ArkEcosystem::Crypto::Enums::Types::TRANSFER
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,29 @@
1
+ require 'arkecosystem/crypto/enums/fees'
2
+ require 'arkecosystem/crypto/enums/types'
3
+ require 'arkecosystem/crypto/identities/address'
4
+ require 'arkecosystem/crypto/transactions/builder/base'
5
+
6
+ module ArkEcosystem
7
+ module Crypto
8
+ module Transactions
9
+ module Builder
10
+ # The builder for vote transactions.
11
+ class Vote < Base
12
+ def set_votes(votes)
13
+ @transaction.asset[:votes] = votes
14
+ self
15
+ end
16
+
17
+ def sign(passphrase)
18
+ @transaction.recipient_id = ArkEcosystem::Crypto::Identities::Address.from_passphrase(passphrase)
19
+ sign_and_create_id(passphrase)
20
+ end
21
+
22
+ def type
23
+ ArkEcosystem::Crypto::Enums::Types::VOTE
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end