Class: Minter::DeclareCandidacyTx

Inherits:
Transaction show all
Defined in:
lib/minter/transactions/declare_candidacy_tx.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Transaction

#multisign, #sign, #tx_hash

Constructor Details

#initialize(address:, pubkey:, commission:, coin:, stake:, nonce:, chain_id:, gas_coin:, gas_price:) ⇒ DeclareCandidacyTx

rubocop:disable Metrics/ParameterLists



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/minter/transactions/declare_candidacy_tx.rb', line 7

def initialize(address:, pubkey:, commission:, coin:, stake:, nonce:, chain_id:, gas_coin:, gas_price:) # rubocop:disable Metrics/ParameterLists
  @address = address
  @pubkey = pubkey
  @commission = commission
  @coin = coin
  @stake = stake
  @nonce = nonce
  @chain_id = chain_id
  @gas_coin = gas_coin
  @gas_price = gas_price
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



5
6
7
# File 'lib/minter/transactions/declare_candidacy_tx.rb', line 5

def address
  @address
end

#chain_idObject

Returns the value of attribute chain_id.



5
6
7
# File 'lib/minter/transactions/declare_candidacy_tx.rb', line 5

def chain_id
  @chain_id
end

#coinObject

Returns the value of attribute coin.



5
6
7
# File 'lib/minter/transactions/declare_candidacy_tx.rb', line 5

def coin
  @coin
end

#commissionObject

Returns the value of attribute commission.



5
6
7
# File 'lib/minter/transactions/declare_candidacy_tx.rb', line 5

def commission
  @commission
end

#gas_coinObject

Returns the value of attribute gas_coin.



5
6
7
# File 'lib/minter/transactions/declare_candidacy_tx.rb', line 5

def gas_coin
  @gas_coin
end

#gas_priceObject

Returns the value of attribute gas_price.



5
6
7
# File 'lib/minter/transactions/declare_candidacy_tx.rb', line 5

def gas_price
  @gas_price
end

#nonceObject

Returns the value of attribute nonce.



5
6
7
# File 'lib/minter/transactions/declare_candidacy_tx.rb', line 5

def nonce
  @nonce
end

#pubkeyObject

Returns the value of attribute pubkey.



5
6
7
# File 'lib/minter/transactions/declare_candidacy_tx.rb', line 5

def pubkey
  @pubkey
end

#stakeObject

Returns the value of attribute stake.



5
6
7
# File 'lib/minter/transactions/declare_candidacy_tx.rb', line 5

def stake
  @stake
end

Instance Method Details

#to_paramsObject



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/minter/transactions/declare_candidacy_tx.rb', line 19

def to_params
  { Address: address,
    PubKey: pubkey,
    Commission: commission,
    Coin: coin,
    Stake: stake,
    Nonce: nonce,
    ChainId: chain_id,
    GasCoin: gas_coin,
    GasPrice: gas_price }
end