Class: Glueby::Contract::AR::ReissuableToken
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Glueby::Contract::AR::ReissuableToken
- Defined in:
- lib/glueby/contract/active_record/reissuable_token.rb
Class Method Summary collapse
-
.saved?(color_id) ⇒ Boolean
Check if the color_id is already stored.
-
.script_pubkey(color_id) ⇒ Tapyrus::Script
Get the script_pubkey corresponding to the color_id in Tapyrus::Script format.
Class Method Details
.saved?(color_id) ⇒ Boolean
Check if the color_id is already stored
19 20 21 |
# File 'lib/glueby/contract/active_record/reissuable_token.rb', line 19 def self.saved?(color_id) Glueby::Contract::AR::ReissuableToken.where(color_id: color_id).exists? end |
.script_pubkey(color_id) ⇒ Tapyrus::Script
Get the script_pubkey corresponding to the color_id in Tapyrus::Script format
9 10 11 12 13 14 |
# File 'lib/glueby/contract/active_record/reissuable_token.rb', line 9 def self.script_pubkey(color_id) script_pubkey = Glueby::Contract::AR::ReissuableToken.where(color_id: color_id).pluck(:script_pubkey).first if script_pubkey Tapyrus::Script.parse_from_payload(script_pubkey.htb) end end |