class XRBP::NodeStore::Rate

Represents a transfer rate.

The percent of an amount sent that is charged to the sender and paid to the issuer.

xrpl.org/transfer-fees.html

From rippled docs:

Transfer rates are specified as fractions of 1 billion.
For example, a transfer rate of 1% is represented as
  1,010,000,000.

Attributes

rate[R]

Public Class Methods

new(rate=nil) click to toggle source
# File lib/xrbp/nodestore/protocol/rate.rb, line 17
def initialize(rate=nil)
  @rate = rate
end
parity() click to toggle source

Rate signifying a 1:1 exchange

# File lib/xrbp/nodestore/protocol/rate.rb, line 22
def self.parity
  @parity ||= Rate.new(QUALITY_ONE)
end

Public Instance Methods

to_amount() click to toggle source
# File lib/xrbp/nodestore/protocol/rate.rb, line 26
def to_amount
  STAmount.new :issue    => NodeStore.no_issue,
               :mantissa => rate,
               :exponent =>   -9
end