.get.asset

.recordExists

pruf.get.asset.recordExists(assetId)

Check to see if an asset exists.

Parameters

  1. assetId

    • String | Bytes32

    • Hash built from individual inputs which is used to identify the asset on the network

Returns

  1. 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

  1. assetId

    • String | Bytes32

    • Hash built from individual inputs which is used to identify the asset on the network

  2. rightsHash

    • String | Bytes32

    • Hash built from a secret which is used to verify asset ownership

Returns

  1. 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

  1. assetId

    • String | Bytes32

    • Hash built from individual inputs which is used to identify the asset on the network

Returns

  1. 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

  1. address

    • String | Address

    • Address of token holder

  2. index * String | Uint256 * Index of asset in wallet

Returns

  1. 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

  1. index

    • String | Uint256

    • Index of asset

Returns

  1. 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

  1. address

    • String | Address

    • Asset holder address

Returns

  1. 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

  1. 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

  1. assetId

    • String | Bytes32

    • Hash built from individual inputs which is used to identify the asset on the network

Returns

  1. 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

  1. assetId

    • String | Bytes32

    • Hash built from individual inputs which is used to identify the asset on the network

Returns

  1. 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

  1. address

    • String | Address

    • Address to check

Returns

  1. 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

  1. owner

    • String | Address

    • Owner address of assets

  2. operator

    • String | Address

    • Address of operator to investigate for eligibility

Returns

  1. 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

  1. storageProviderId

    • String | Uint8

    • ID of storage provider recognized by the PRüF protocol

Returns

  1. 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

  1. nodeId

    • String | Uint32

    • ID of node within the PRüF protocol

Returns

  1. 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

  1. assetId

    • String | Bytes32

    • Hash built from individual inputs which is used to identify the asset on the network

Returns

  1. Array | operator

Example usage

1//Example pruf-js code
2
3let _assetId = "0x968a4a295335fa4badbc4746a701d4407a7df7febd489a7de44959358ff5a21d"
4
5pruf.get.asset.approvedOperator(_assetId)
6.then(console.log)