.do.asset¶
.mint¶
pruf.do.asset.mint(assetId, rightsHash, nodeId, lifeCycleLimit, hardData1, hardData2, URISuffix)
Mints an asset on PRüF.
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, can be used to verify in-person ownership.
nodeId
String | Uint32
ID used to reference a node, in most cases used to classify assets by type or producer.
lifeCycleLimit
String | Uint32
(experimental) Used for applications which are concerned with service iteration
hardData(1/2)
String | Bytes32
Key used to link asset to off-chain storage, hardData2 must be set to bytes32(0) if it is not required.
URISuffix
String
Hash of external CAS network suffix
Example usage¶
1//Example pruf-js code 2 3let _assetId = pruf.utils.generateRawAssetID("input1", "input2", "input3", "input4"); 4let _rightsHash = pruf.utils.generateSecureRgt(_assetId, "Secret"); 5let _nodeId = "10"; 6let _lifeCycleLimit = "100000" 7let _hardData1 = "0x88c046dc8adba2414c0cbf87f1089c9682067c739b2fc6d3a1fdfd4e61587bbd" 8let _hardData2 = "0x0000000000000000000000000000000000000000000000000000000000000000" 9 10pruf.do.asset.mint 11( 12 _assetId, 13 _rightHolderHash, 14 _nodeId, 15 _lifeCycleLimit, 16 _hardData1, 17 _hardData2, 18 URISuffix 19) 20.send({ from: props.addr }) 21.on("receipt"()=>{ 22 console.log(receipt.transactionHash); 23});
.mintBare¶
pruf.do.asset.mintBare(assetId, rightsHash, nodeId, lifeCycleLimit, hardData1, hardData2, URISuffix)
Mints an asset on PRüF, with no attatched hardData.
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 secrets, can be used to verify in-person ownership.
nodeId
String | Uint32
ID used to reference a node, in most cases used to classify assets by type or producer.
lifeCycleLimit
String | Uint32
(experimental) Used for applications which are concerned with service iteration
URISuffix
String
Hash of external CAS network suffix
Example usage¶
1//Example pruf-js code 2 3let _assetId = pruf.utils.generateRawAssetID("input1", "input2", "input3", "input4"); 4let _rightsHash = pruf.utils.generateSecureRgt(_assetId, "Secret"); 5let _nodeId = "10"; 6let _lifeCycleLimit = "100000" 7 8pruf.do.asset.mintBare 9( 10 _assetId, 11 _rightHolderHash, 12 _nodeId, 13 _lifeCycleLimit, 14 URISuffix 15) 16.send({ from: props.addr }) 17.on("receipt"()=>{ 18 console.log(receipt.transactionHash); 19});
.modifySoftData:¶
pruf.do.asset.modifySoftData(assetId, softData1, softData2)
Changes an asset’s mutable off-chain data key.
Parameters¶
assetId
String | Bytes32
Unique value which refers to an asset
softData(1/2)
String | Uint32
New parsed CID used to link asset to off-chain storage
Example usage¶
1//Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d"; 4let _softData1 = "0x88c046dc8adba2414c0cbf87f1089c9682067c739b2fc6d3a1fdfd4e61587bbd" 5let _softData2 = "0x0000000000000000000000000000000000000000000000000000000000000000" 6 7pruf.do.asset.modifySoftData 8( 9 _assetId, 10 _softData1, 11 _softData2 12) 13.send({ from: props.addr }) 14.on("receipt"()=>{ 15 console.log(receipt.transactionHash); 16});
.addHardData:¶
pruf.do.asset.addHardData(assetId, hardData1, hardData2)
Permanently inscribes an asset with an off-chain storage reference key
Parameters¶
assetId
String | Bytes32
Unique value which refers to an asset
hardData(1/2)
String | Bytes32
Key used to link asset to off-chain storage, hardData2 must be set to bytes32(0) if it is not required.
Example usage¶
1//Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 4let _hardData1 = "0x88c046dc8adba2414c0cbf87f1089c9682067c739b2fc6d3a1fdfd4e61587bbd" 5 let _hardData2 = "0x0000000000000000000000000000000000000000000000000000000000000000" 6 7 pruf.do.asset.addHardData( 8_assetId, 9_inscription 10) 11.send({ from: props.addr }) 12.on("receipt"()=>{ 13 console.log(receipt.transactionHash); 14});
.updateHardData¶
pruf.do.asset.updateHardData(assetId, hardData1, hardData2)
Update the hard data of an asset.
Note: This is a restricted operation, and can only go through if it matches the upgrade data set by the node administrator.
Parameters¶
assetId
String | Bytes32
Hash built from individual inputs which is used to identify the asset on the network
hardData(1/2)
String | Bytes32
Field(s) for updated asset hardData, hardData2 must be set to bytes32(0) if it is not required.
Example usage¶
1 //Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 4 let _hardData1 = "0x88c046dc8adba2414c0cbf87f1089c9682067c739b2fc6d3a1fdfd4e61587bbd" 5 let _hardData2 = "0x0000000000000000000000000000000000000000000000000000000000000000" 6 7 pruf.do.asset.updateHardData 8 ( 9 _assetId, 10 _hardData1, 11 _hardData2, 12 ) 13 .send({ from: props.addr }) 14 .on("receipt"()=>{ 15 console.log(receipt.transactionHash); 16 });
.modifyAssetStatus:¶
pruf.do.asset.modifyAssetStatus(assetId, newStatus)
Changes an asset’s active status.
Parameters¶
assetId
String | Bytes32
Unique value which refers to an asset
newStatus
String | Uint8
Indicator of Asset Status to determine eligibility for ops using the PRüF protocol
Example usage¶
1//Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 4let _newStatus = "51"; //'51' is the transferable status 5 6pruf.do.modifyAssetExtData( 7 _assetId, 8 _newStatus 9) 10.send({ from: props.addr }) 11.on("receipt"()=>{ 12 console.log(receipt.transactionHash); 13});
.markAssetLostOrStolen:¶
pruf.do.asset.markAssetLostOrStolen(assetId, newStatus)
Changes an asset’s active status to lost or stolen.
Parameters¶
assetId
String | Bytes32
Unique value which refers to an asset
newStatus
String | Uint8
Indicator of Asset Status to determine eligibility for ops using the PRüF protocol
Example usage¶
1//Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 4let _newStatus = "53"; //'53' is the lost status 5 6pruf.do.asset.markAssetLostOrStolen( 7 _assetId, 8 _newStatus 9) 10.send({ from: props.addr }) 11.on("receipt"()=>{ 12 console.log(receipt.transactionHash); 13});
.decrementLifeCycle:¶
pruf.do.decrementLifeCycle(assetId, amount)
Decrements the LifeCycle of an asset by a specified amount.
Parameters¶
assetId
String | Bytes32
Unique value which refers to an asset
amount
String | Uint32
Amount to decrement from the asset LifeCycle
Example usage¶
1//Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 4let _amount = "25"; 5 6pruf.do.asset.decrementLifeCycle( 7_assetId, 8_amount 9) 10.send({ from: props.addr }) 11.on("receipt"()=>{ 12 console.log(receipt.transactionHash); 13});
.verifyRightsHash:¶
pruf.do.asset.verifyRightsHash(assetId, rightsHash)
Creates transaction which compares a submitted rightsHash to the rightsHash stored in asset record.
Parameters¶
assetId
String | Bytes32
Unique value which refers to an asset
rightsHash
String | Bytes32
Hash built from a secret which is used to verify asset ownership
Example usage¶
1//Example pruf-js code 2 3let _assetId = pruf.utils.generateIndex("input1", "input2", "input3", "input4") 4let _rightsHash = pruf.utils.generateSecureRgt(assetId, "Secret"); 5 6pruf.do.asset.verifyRightsHash( 7_assetId, 8_rightsHash 9) 10.send({ from: props.addr }) 11.on("receipt"()=>{ 12 console.log(receipt.events.REPORT.returnValues._msg); 13});
.modifyRightsHash:¶
pruf.do.asset.modifyRightsHash(assetId, newRightsHash)
Changes the rightshash of the asset to reflect new data.
Parameters¶
assetId
String | Bytes32
Unique value which refers to an asset
newRightsHash
String | Bytes32
Hash which will replace the current entry
Example usage¶
1//Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 4let _newHash = pruf.utils.generateSecureRgt(_assetId, "Secret"); 5 6pruf.do.asset.modifyRightsHash( 7_assetId, 8_newHash 9) 10.send({ from: props.addr }) 11.on("receipt"()=>{ 12 console.log(receipt.transactionHash); 13});
.approve¶
pruf.do.asset.approve(to, assetId)
Approves an address to access ERC-721 functionality of an asset.
Parameters¶
to
String | Address
Address to which user would like to grant approval
assetId
String | Bytes32
Hash built from individual inputs which is used to identify the asset on the network
Example usage¶
1//Example pruf-js code 2 3let _to = "0x0D15833D60F448487f157578F3e8c208AFCBa537" 4let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 5pruf.do.asset.approve 6( 7 _to, 8 _assetId 9) 10.send({ from: props.addr }) 11.on("receipt"()=>{ 12 console.log(receipt.transactionHash); 13});
.setApprovalForAll¶
pruf.do.asset.setApprovalForAll(to, approved)
Approves an address to access ERC-721 functionality of all assets.
Parameters¶
to
String | Address
Address to which user would like to grant approval
approved
Bool
Desired setting for approval
Example usage¶
1//Example pruf-js code 2 3let _to = "0x0D15833D60F448487f157578F3e8c208AFCBa537" 4let _approval = false 5pruf.do.asset.setApprovalForAll 6( 7 _to, 8 _approval 9) 10.send({ from: props.addr }) 11.on("receipt"()=>{ 12 console.log(receipt.transactionHash); 13});
.setColdWallet¶
pruf.do.asset.setColdWallet()
Sets sender’s wallet to cold, revoking protocol’s ERC-721 priveleges.
Parameters¶
None
Example usage¶
1//Example pruf-js code 2 3pruf.do.asset.setColdWallet() 4.send({ from: props.addr }) 5.on("receipt"()=>{ 6 console.log(receipt.transactionHash); 7});
.unSetColdWallet¶
pruf.do.asset.unSetColdWallet()
Sets sender’s wallet to hot, giving protocol ERC-721 priveleges.
Parameters¶
None
Example usage¶
1//Example pruf-js code 2 3pruf.do.asset.unSetColdWallet() 4.send({ from: props.addr }) 5.on("receipt"()=>{ 6 console.log(receipt.transactionHash); 7});
.permissiveSetURI¶
pruf.do.asset.permissiveSetURI(assetId, newUriSuffix)
Set new token URI String, under special circumstances.
Parameters¶
assetId
String | Bytes32
Unique value which refers to an asset
newUriSuffix
String
URI String for asset content routing
Example usage¶
1//Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 4let _newUriSuffix = "/assets/images/prufcircle-1200x1200.png" 5 6pruf.do.asset.permissiveSetURI 7( 8 _assetId, 9 _newURI 10) 11.send({ from: props.addr }) 12.on("receipt"()=>{ 13 console.log(receipt.transactionHash); 14});
.transfer¶
pruf.do.asset.transfer(from, to, assetId)
Transfers an asset from a controlled wallet to a specified receiving address.
Parameters¶
from
String | Address
Address currently holding the asset
to
String | Address
Address which will receive the asset
assetId
String | Bytes32
Unique value which refers to an asset
Example usage¶
1//Example pruf-js code 2 3let _from = "0x0D15833D60F448487f157578F3e8c208AFCBa537" 4let _to = "0x31b396CAc41e65bFC520050Fa7c7882409CBbF48" 5let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 6 7pruf.do.asset.transfer 8( 9 _from, 10 _to, 11 _assetId 12) 13.send({ from: props.addr }) 14.on("receipt"()=>{ 15 console.log(receipt.transactionHash); 16});
.addHardData¶
pruf.do.asset.addHardData(assetId, hardData1, hardData2)
Sets sender’s wallet to hot, giving protocol ERC-721 priveleges.
Parameters¶
assetId
String | Bytes32
Unique value which refers to an asset
hardData(1/2)
String | Bytes32
Field(s) for asset hardData, hardData2 must be set to bytes32(0) if it is not required.
Example usage¶
1//Example pruf-js code 2 3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d" 4let _hardData1 = "0x88c046dc8adba2414c0cbf87f1089c9682067c739b2fc6d3a1fdfd4e61587bbd" 5let _hardData2 = "0x0000000000000000000000000000000000000000000000000000000000000000" 6 7pruf.do.asset.addHardData 8( 9 _assetId, 10 _hardData1, 11 _hardData2 12) 13.send({ from: props.addr }) 14.on("receipt"()=>{ 15 console.log(receipt.transactionHash); 16});