Class: Sdp::Balance
- Inherits:
-
Struct
- Object
- Struct
- Sdp::Balance
- Defined in:
- lib/sdp/resources/wallets.rb
Overview
Token balance row from GET /v1/payments/wallets/:id/balances. amount is base units (string); ui_amount is the decimal string. usd_value is passed through when SDP includes it and is nil otherwise (varies across SDP versions) — nil means “no price”, never zero.
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#decimals ⇒ Object
Returns the value of attribute decimals.
-
#mint ⇒ Object
Returns the value of attribute mint.
-
#token ⇒ Object
Returns the value of attribute token.
-
#ui_amount ⇒ Object
Returns the value of attribute ui_amount.
-
#usd_value ⇒ Object
Returns the value of attribute usd_value.
Class Method Summary collapse
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount
10 11 12 |
# File 'lib/sdp/resources/wallets.rb', line 10 def amount @amount end |
#decimals ⇒ Object
Returns the value of attribute decimals
10 11 12 |
# File 'lib/sdp/resources/wallets.rb', line 10 def decimals @decimals end |
#mint ⇒ Object
Returns the value of attribute mint
10 11 12 |
# File 'lib/sdp/resources/wallets.rb', line 10 def mint @mint end |
#token ⇒ Object
Returns the value of attribute token
10 11 12 |
# File 'lib/sdp/resources/wallets.rb', line 10 def token @token end |
#ui_amount ⇒ Object
Returns the value of attribute ui_amount
10 11 12 |
# File 'lib/sdp/resources/wallets.rb', line 10 def ui_amount @ui_amount end |
#usd_value ⇒ Object
Returns the value of attribute usd_value
10 11 12 |
# File 'lib/sdp/resources/wallets.rb', line 10 def usd_value @usd_value end |
Class Method Details
.from_hash(hash) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sdp/resources/wallets.rb', line 11 def self.from_hash(hash) hash ||= {} new( token: hash[:token], mint: hash[:mint], amount: hash[:amount], ui_amount: hash[:ui_amount], decimals: hash[:decimals], usd_value: hash[:usd_value] ) end |