class Nem::Transaction::ProvisionNamespace
@attr [String] new_part
@attr [String] parent @attr [String] rental_fee_sink
@attr [Integer] rental_fee
Constants
- TYPE
Attributes
new_part[R]
parent[R]
rental_fee[R]
rental_fee_sink[R]
Public Class Methods
new(new_part, parent = nil, timestamp: nil, deadline: nil, network: nil)
click to toggle source
# File lib/nem/transaction/provision_namespace.rb, line 12 def initialize(new_part, parent = nil, timestamp: nil, deadline: nil, network: nil) @new_part = new_part @parent = parent @rental_fee = rental[:fee] @rental_fee_sink = rental[:sink] @network = network || Nem.default_network @type = TYPE @fee = Nem::Fee::ProvisionNamespace.new(self) @timestamp = timestamp || Time.now @deadline = deadline || Time.now + Nem.default_deadline end
Public Instance Methods
root?()
click to toggle source
@return [Boolean]
# File lib/nem/transaction/provision_namespace.rb, line 26 def root? !!(@parent == nil) end
sub?()
click to toggle source
@return [Boolean]
# File lib/nem/transaction/provision_namespace.rb, line 31 def sub? !!(@parent && @new_part) end
to_hash()
click to toggle source
attributes must be CAMEL CASE for NIS params @return [Hash]
# File lib/nem/transaction/provision_namespace.rb, line 37 def to_hash { newPart: new_part, parent: parent, rentalFeeSink: rental_fee_sink, rentalFee: rental_fee } end
Private Instance Methods
rental()
click to toggle source
@see www.nem.ninja/docs/#namespaces
# File lib/nem/transaction/provision_namespace.rb, line 49 def rental if @network == :mainnet if root? { fee: 100 * 1_000_000, sink: 'NAMESPACEWH4MKFMBCVFERDPOOP4FK7MTBXDPZZA' } else { fee: 10 * 1_000_000, sink: 'NAMESPACEWH4MKFMBCVFERDPOOP4FK7MTBXDPZZA' } end else if root? { fee: 100 * 1_000_000, sink: 'TAMESPACEWH4MKFMBCVFERDPOOP4FK7MTDJEYP35' } else { fee: 10 * 1_000_000, sink: 'TAMESPACEWH4MKFMBCVFERDPOOP4FK7MTDJEYP35' } end end end