class NearApi::Actions::Transfer

Attributes

amount[R]

Public Class Methods

new(near_amount: nil, amount: nil) click to toggle source
# File lib/near_api/actions/transfer.rb, line 11
def initialize(near_amount: nil, amount: nil)
  if (near_amount.nil? && amount.nil?) || (!near_amount.nil? && !amount.nil?)
    raise ArgumentError, 'please specify one of: near_amount or amount'
  end

  @amount = amount unless amount.nil?
  @amount = Yocto.from_near(near_amount) unless near_amount.nil?
end

Private Instance Methods

action_code() click to toggle source
# File lib/near_api/actions/transfer.rb, line 24
def action_code
  3
end