Class: Sdp::Token

Inherits:
Struct
  • Object
show all
Defined in:
lib/sdp/resources/issuance.rb

Overview

A token as SDP’s issuance API reports it. Like every SDP resource, optional fields are OMITTED (absent, not null), so each member is nil when SDP didn’t send it. extensions is passed through as the raw snake_cased hash — the Token-2022 extension set is large and provider-shaped, so this gem surfaces it untyped rather than modelling it.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def created_at
  @created_at
end

#decimalsObject

Returns the value of attribute decimals

Returns:

  • (Object)

    the current value of decimals



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def decimals
  @decimals
end

#deployed_atObject

Returns the value of attribute deployed_at

Returns:

  • (Object)

    the current value of deployed_at



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def deployed_at
  @deployed_at
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def description
  @description
end

#extensionsObject

Returns the value of attribute extensions

Returns:

  • (Object)

    the current value of extensions



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def extensions
  @extensions
end

#freezableObject

Returns the value of attribute freezable

Returns:

  • (Object)

    the current value of freezable



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def freezable
  @freezable
end

#freeze_authorityObject

Returns the value of attribute freeze_authority

Returns:

  • (Object)

    the current value of freeze_authority



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def freeze_authority
  @freeze_authority
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def id
  @id
end

#image_urlObject

Returns the value of attribute image_url

Returns:

  • (Object)

    the current value of image_url



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def image_url
  @image_url
end

#max_supplyObject

Returns the value of attribute max_supply

Returns:

  • (Object)

    the current value of max_supply



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def max_supply
  @max_supply
end

#mint_addressObject

Returns the value of attribute mint_address

Returns:

  • (Object)

    the current value of mint_address



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def mint_address
  @mint_address
end

#mint_authorityObject

Returns the value of attribute mint_authority

Returns:

  • (Object)

    the current value of mint_authority



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def mint_authority
  @mint_authority
end

#mintableObject

Returns the value of attribute mintable

Returns:

  • (Object)

    the current value of mintable



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def mintable
  @mintable
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def name
  @name
end

#project_idObject

Returns the value of attribute project_id

Returns:

  • (Object)

    the current value of project_id



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def project_id
  @project_id
end

#requires_allowlistObject

Returns the value of attribute requires_allowlist

Returns:

  • (Object)

    the current value of requires_allowlist



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def requires_allowlist
  @requires_allowlist
end

#signing_wallet_idObject

Returns the value of attribute signing_wallet_id

Returns:

  • (Object)

    the current value of signing_wallet_id



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def signing_wallet_id
  @signing_wallet_id
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def status
  @status
end

#symbolObject

Returns the value of attribute symbol

Returns:

  • (Object)

    the current value of symbol



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def symbol
  @symbol
end

#templateObject

Returns the value of attribute template

Returns:

  • (Object)

    the current value of template



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def template
  @template
end

#total_supplyObject

Returns the value of attribute total_supply

Returns:

  • (Object)

    the current value of total_supply



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def total_supply
  @total_supply
end

#updated_atObject

Returns the value of attribute updated_at

Returns:

  • (Object)

    the current value of updated_at



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def updated_at
  @updated_at
end

#uriObject

Returns the value of attribute uri

Returns:

  • (Object)

    the current value of uri



11
12
13
# File 'lib/sdp/resources/issuance.rb', line 11

def uri
  @uri
end

Class Method Details

.from_hash(hash) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/sdp/resources/issuance.rb', line 17

def self.from_hash(hash)
  hash ||= {}
  new(
    id: hash[:id],
    project_id: hash[:project_id],
    signing_wallet_id: hash[:signing_wallet_id],
    mint_address: hash[:mint_address],
    mint_authority: hash[:mint_authority],
    freeze_authority: hash[:freeze_authority],
    name: hash[:name],
    symbol: hash[:symbol],
    decimals: hash[:decimals],
    description: hash[:description],
    uri: hash[:uri],
    image_url: hash[:image_url],
    template: hash[:template],
    extensions: hash[:extensions],
    total_supply: hash[:total_supply],
    max_supply: hash[:max_supply],
    mintable: hash[:is_mintable],
    freezable: hash[:is_freezable],
    requires_allowlist: hash[:requires_allowlist],
    status: hash[:status],
    deployed_at: hash[:deployed_at],
    created_at: hash[:created_at],
    updated_at: hash[:updated_at]
  )
end