Class: PunkBlocks
- Inherits:
-
Ethlite::Contract
- Object
- Ethlite::Contract
- PunkBlocks
- Defined in:
- lib/ethlite/contracts/punk_blocks.rb
Instance Method Summary collapse
-
#blocks(arg0) ⇒ Object
storage - mapping(bytes32 => Block) public blocks.
-
#getBlocks(_fromID, _count) ⇒ Object
function getBlocks.
-
#index(arg0) ⇒ Object
storage - mapping(uint256 => bytes32) public index.
-
#nextId ⇒ Object
storage - uint256 public nextId.
-
#svgFromIDs(_ids) ⇒ Object
function svgFromIDs.
-
#svgFromKeys(_attributeKeys) ⇒ Object
function svgFromKeys.
-
#svgFromNames(_attributeNames) ⇒ Object
function svgFromNames.
-
#svgFromPunkID(_tokenID) ⇒ Object
function svgFromPunkID.
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
94 95 96 |
# File 'lib/ethlite/contracts/punk_blocks.rb', line 94 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
105 106 107 |
# File 'lib/ethlite/contracts/punk_blocks.rb', line 105 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
113 114 115 |
# File 'lib/ethlite/contracts/punk_blocks.rb', line 113 def index(arg0) do_call("index", arg0) end |
#nextId ⇒ Object
storage - uint256 public nextId
next id to use when adding a block
121 122 123 |
# File 'lib/ethlite/contracts/punk_blocks.rb', line 121 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
134 135 136 |
# File 'lib/ethlite/contracts/punk_blocks.rb', line 134 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"]
149 150 151 |
# File 'lib/ethlite/contracts/punk_blocks.rb', line 149 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)
163 164 165 |
# File 'lib/ethlite/contracts/punk_blocks.rb', line 163 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
172 173 174 |
# File 'lib/ethlite/contracts/punk_blocks.rb', line 172 def svgFromPunkID(_tokenID) do_call("svgFromPunkID", _tokenID) end |