Query multiple attributes
Use the getAttributesBulk function from the QuadReader smart contract to query multiple attributes about a passport holder.
Requirements
Installation
Install @quadrata/contracts package
npm i @quadrata/contracts --save-devPermissions
Calling smart contract have to be granted permissions to call getAttributesBulk in Mainnet.
Contact us via email at [email protected] or Discord
Function
import "@quadrata/contracts/interfaces/IQuadPassportStore.sol";
// For Solidity version >= 0.8.0.
reader.getAttributesBulk(
address user,
bytes32[] calldata attributes
) external returns(
IQuadPassportStore.Attribute[] memory attributes
);
// For Solidity version < 0.8.0.
reader.getAttributesBulkLegacy(
address user,
bytes32[] calldata attributes
) external returns(
bytes32[] attributeValues,
uint256[] epochs,
address[] issuers
);Parameters
Parameter
Description
Type
user
address of the passport holder
address (required)
Return values
A list of issued values for each attributes being queried.
This function will return exactly a list of the same length as the number of attributes being queried.
If an attribute hasn't been issued yet, it's value will be:
Attribute{value: bytes32(0), epoch: uint256(0), issuer: address(0)}
Example
You can find our helper library to facilitate parsing the response => QuadReaderUtils
Last updated