Class: PunkBlocks

Inherits:
Ethlite::Contract show all
Defined in:
lib/ethlite/contracts/punk_blocks.rb

Instance Method Summary collapse

Methods inherited from Ethlite::Contract

address, at, default_address, #do_call, #initialize, methods, sig

Constructor Details

This class inherits a constructor from Ethlite::Contract

Instance Method Details

#blocks(arg0) ⇒ Object

storage - mapping(bytes32 => Block) public blocks

stores punk attributes as a png


95
96
97
# File 'lib/ethlite/contracts/punk_blocks.rb', line 95

def blocks(arg0)
  do_call("blocks", arg0)
end

#getBlocks(_fromID, _count) ⇒ Object

function getBlocks

getBlocks returns a sequential list of blocks in a single call
    @param _fromID is which id to begin from
    @param _count how many items to retrieve.
    @return Block[] list of blocks, uint256 next id


106
107
108
# File 'lib/ethlite/contracts/punk_blocks.rb', line 106

def getBlocks(_fromID, _count)
  do_call("getBlocks", _fromID, _count)
end

#index(arg0) ⇒ Object

storage - mapping(uint256 => bytes32) public index

index of each block by its sequence


114
115
116
# File 'lib/ethlite/contracts/punk_blocks.rb', line 114

def index(arg0)
  do_call("index", arg0)
end

#nextIdObject

storage - uint256 public nextId

next id to use when adding a block


122
123
124
# File 'lib/ethlite/contracts/punk_blocks.rb', line 122

def nextId()
  do_call("nextId")
end

#svgFromIDs(_ids) ⇒ Object

function svgFromIDs

svgFromIDs returns the svg data as a string
       e.g. [9,55,99]
       One of the elements must be must be a layer 0 block.
       This element decides what version of image to use for the higher layers
       (dataMale or dataFemale)
     @param _ids uint256 ids of an attribute, by it's index of creation


135
136
137
# File 'lib/ethlite/contracts/punk_blocks.rb', line 135

def svgFromIDs(_ids)
  do_call("svgFromIDs", _ids)
end

#svgFromKeys(_attributeKeys) ⇒ Object

function svgFromKeys

svgFromKeys returns the svg data as a string
@param _attributeKeys a list of attribute names that have been hashed,
        eg keccak256("Male 1"), keccak256("Goat")
        must have at least 1 layer 0 attribute (eg. keccak256("Male 1")) which
        decides what version of image to use for the higher layers
        (dataMale or dataFemale)
        e.g. ["0x9039da071f773e85254cbd0f99efa70230c4c11d63fce84323db9eca8e8ef283",
        "0xd5de5c20969a9e22f93842ca4d65bac0c0387225cee45a944a14f03f9221fd4a"]


150
151
152
# File 'lib/ethlite/contracts/punk_blocks.rb', line 150

def svgFromKeys(_attributeKeys)
  do_call("svgFromKeys", _attributeKeys)
end

#svgFromNames(_attributeNames) ⇒ Object

function svgFromNames

svgFromNames returns the svg data as a string
@param _attributeNames a list of attribute names, eg "Male 1", "Goat"
   must have at least 1 layer 0 attribute (eg. Male, Female, Alien, Ape, Zombie)
   e.g. ["Male 1","Goat"]
   Where "Male 1" is a layer 0 attribute, that decides what version of
   image to use for the higher
  layers (dataMale or dataFemale)


164
165
166
# File 'lib/ethlite/contracts/punk_blocks.rb', line 164

def svgFromNames(_attributeNames)
  do_call("svgFromNames", _attributeNames)
end

#svgFromPunkID(_tokenID) ⇒ Object

function svgFromPunkID

svgFromPunkID returns the svg data as a string given a punk id
    @param _tokenID uint256 IDs a punk id, 0-9999


173
174
175
# File 'lib/ethlite/contracts/punk_blocks.rb', line 173

def svgFromPunkID(_tokenID)
  do_call("svgFromPunkID", _tokenID)
end