Class: NearApi::Actions::Transfer
- Inherits:
-
Object
- Object
- NearApi::Actions::Transfer
- Includes:
- Borsh
- Defined in:
- lib/near_api/actions/transfer.rb
Instance Method Summary collapse
-
#initialize(near_amount: nil, amount: nil) ⇒ Transfer
constructor
A new instance of Transfer.
Constructor Details
#initialize(near_amount: nil, amount: nil) ⇒ Transfer
Returns a new instance of Transfer.
11 12 13 14 15 16 17 18 |
# 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 |