.get.asset¶
.recordExists¶
pruf.get.asset.recordExists(assetId)
Check to see if an asset exists.
Parameters¶
assetId
String | Bytes32
Hash built from individual inputs which is used to identify the asset on the network
Returns¶
Bool
Example usage¶
1//Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 4 5pruf.get.asset.recordExists(_assetId) 6.then(console.log)
.isRightsHolder¶
pruf.get.asset.isRightsHolder(assetId, rightsHash)
Check to see if hash matches the one on file.
Parameters¶
assetId
String | Bytes32
Hash built from individual inputs which is used to identify the asset on the network
rightsHash
String | Bytes32
Hash built from a secret which is used to verify asset ownership
Returns¶
Bool
Example usage¶
1//Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 4let _rightsHash = pruf.utils.generateSecureRgt(assetId, "Secret"); 5 6pruf.get.asset.isRightsHolder(_assetId, _rightsHash) 7.then(console.log)
.record¶
pruf.get.asset.record(assetId)
Get asset record.
Parameters¶
assetId
String | Bytes32
Hash built from individual inputs which is used to identify the asset on the network
Returns¶
Object | Record
Example usage¶
1//Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 4 5pruf.get.asset.record(_assetId) 6.then(console.log)
.heldAssetAtIndex¶
pruf.get.asset.heldAssetAtIndex(address, index)
Get the asset ID at index from a holding wallet.
Parameters¶
address
String | Address
Address of token holder
index * String | Uint256 * Index of asset in wallet
Returns¶
Bytes32 | assetId
Example usage¶
1//Example pruf-js code 2 3let _address = "0xBef3b0b67061CACD4E10968d8Ba23A1c864c8049" 4let _index = "1" 5 6pruf.get.asset.heldAssetAtIndex(_address, _index) 7.then(console.log)
.assetAtIndex¶
pruf.get.asset.assetAtIndex(index)
Get asset ID at specified index.
Parameters¶
index
String | Uint256
Index of asset
Returns¶
Bytes32 | assetId
Example usage¶
1//Example pruf-js code 2 3let _index = "3" 4 5pruf.get.asset.assetAtIndex(_index) 6.then(console.log)
.balanceOf¶
pruf.get.asset.balanceOf(address)
Get the asset balance of a wallet.
Parameters¶
address
String | Address
Asset holder address
Returns¶
Uint256 | balance
Example usage¶
1//Example pruf-js code 2 3let _address = "0xBef3b0b67061CACD4E10968d8Ba23A1c864c8049" 4 5pruf.get.asset.balanceOf(_address) 6.then(console.log)
.totalSupply¶
pruf.get.asset.totalSupply()
Get the total supply of assets.
Parameters¶
None
Returns¶
Uint256 | totalSupply
Example usage¶
1//Example pruf-js code 2 3pruf.get.asset.totalSupply() 4.then(console.log)
.ownerOf¶
pruf.get.asset.ownerOf(assetId)
Get the owner of a specified asset.
Parameters¶
assetId
String | Bytes32
Hash built from individual inputs which is used to identify the asset on the network
Returns¶
Address | tokenHolder
Example usage¶
1//Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 4 5pruf.get.asset.ownerOf(_assetId) 6.then(console.log)
.URI¶
pruf.get.asset.URI(assetId)
Get the full URI of a specified asset.
Parameters¶
assetId
String | Bytes32
Hash built from individual inputs which is used to identify the asset on the network
Returns¶
String | URI
Example usage¶
1//Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 4 5pruf.get.asset.URI(_assetId) 6.then(console.log)
.isColdWallet¶
pruf.get.asset.isColdWallet(address)
Check to see if an address is set to “cold”.
Parameters¶
address
String | Address
Address to check
Returns¶
Bool
Example usage¶
1//Example pruf-js code 2 3let _address = "0xBef3b0b67061CACD4E10968d8Ba23A1c864c8049" 4 5pruf.get.asset.isColdWallet(_address) 6.then(console.log)
.isApprovedForAll¶
pruf.get.asset.isApprovedForAll(owner, operator)
Check to see if an operator is approved for all ERC-721 asset functionality in a wallet.
Parameters¶
owner
String | Address
Owner address of assets
operator
String | Address
Address of operator to investigate for eligibility
Returns¶
Bool
Example usage¶
1//Example pruf-js code 2 3let _owner = "0xBef3b0b67061CACD4E10968d8Ba23A1c864c8049" 4let _operator = "0x0D15833D60F448487f157578F3e8c208AFCBa537" 5 6pruf.get.asset.isApprovedForAll(_owner, _operator) 7.then(console.log)
.baseURIFromStorageProvider¶
pruf.get.asset.baseURIFromStorageProvider(storageProviderId)
Determine the baseURI given the storage provider ID.
Parameters¶
storageProviderId
String | Uint8
ID of storage provider recognized by the PRüF protocol
Returns¶
String | baseUri
Example usage¶
1//Example pruf-js code 2 3let _storageProviderId = "1" 4 5pruf.get.asset.baseURIFromStorageProvider(_storageProviderId) 6.then(console.log)
.baseURIFromNode¶
pruf.get.asset.baseURIFromNode(nodeId)
Determine the baseURI given the node ID.
Parameters¶
nodeId
String | Uint32
ID of node within the PRüF protocol
Returns¶
String | baseUri
Example usage¶
1//Example pruf-js code 2 3let _nodeId = "10" 4 5pruf.get.asset.baseURIFromNode(_nodeId) 6.then(console.log)
.approvedOperator¶
pruf.get.asset.approvedOperator(assetId)
Get approved operator of an asset, if there is one.
Parameters¶
assetId
String | Bytes32
Hash built from individual inputs which is used to identify the asset on the network
Returns¶
Array | operator
Example usage¶
1//Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 4 5pruf.get.asset.approvedOperator(_assetId) 6.then(console.log)