Class: Minter::CreateCoinTx

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Transaction

#multisign, #sign, #tx_hash

Constructor Details

#initialize(name:, symbol:, initial_amount:, max_supply:, initial_reserve:, reserve_ratio:, nonce:, chain_id:, gas_coin:, gas_price:) ⇒ CreateCoinTx

rubocop:disable Metrics/ParameterLists



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

def initialize(name:, symbol:, initial_amount:, max_supply:, initial_reserve:, reserve_ratio:, nonce:, chain_id:, gas_coin:, gas_price:) # rubocop:disable Metrics/ParameterLists
  @name = name
  @symbol = symbol
  @max_supply = max_supply
  @initial_amount = initial_amount
  @initial_reserve = initial_reserve
  @reserve_ratio = reserve_ratio
  @nonce = nonce
  @chain_id = chain_id
  @gas_coin = gas_coin
  @gas_price = gas_price
end

Instance Attribute Details

#chain_idObject

Returns the value of attribute chain_id.



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

def chain_id
  @chain_id
end

#gas_coinObject

Returns the value of attribute gas_coin.



5
6
7
# File 'lib/minter/transactions/create_coin_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/create_coin_tx.rb', line 5

def gas_price
  @gas_price
end

#initial_amountObject

Returns the value of attribute initial_amount.



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

def initial_amount
  @initial_amount
end

#initial_reserveObject

Returns the value of attribute initial_reserve.



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

def initial_reserve
  @initial_reserve
end

#max_supplyObject

Returns the value of attribute max_supply.



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

def max_supply
  @max_supply
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#nonceObject

Returns the value of attribute nonce.



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

def nonce
  @nonce
end

#reserve_ratioObject

Returns the value of attribute reserve_ratio.



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

def reserve_ratio
  @reserve_ratio
end

#symbolObject

Returns the value of attribute symbol.



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

def symbol
  @symbol
end

Instance Method Details

#to_paramsObject



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

def to_params
  { Name: name,
    Symbol: symbol,
    InitialAmount: initial_amount,
    MaxSupply: max_supply,
    InitialReserve: initial_reserve,
    ReserveRation: reserve_ratio, # TODO: rename ReserveRation to ReserveRatio
    Nonce: nonce,
    ChainId: chain_id,
    GasCoin: gas_coin,
    GasPrice: gas_price }
end