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-dev

Permissions

Calling smart contract have to be granted permissions to call getAttributesBulk in Mainnet. Contact us via email at [email protected] or Discord

Testnets like Goerli,Mumbai,etc.. do not require any permissions

Function

QuadReader.sol
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)

attributes

The list of attributes you want to query. See: Supported attributes.

bytes32[] (required)

Return values

A list of issued values for each attributes being queried.

For Solidity version < 0.8.0

UsegetAttributesBulkLegacy()which returns three arrays. The index of each array maps to the others to create a tuple (e.g. attributeValues[0], epochs[0], issuers[0] are part of the same result).

  • attributeValues: Raw or hashed attribute values. See Supported attributes for the return values of each attribute.

  • epochs: Timestamp that indicates when the attribute was verified by the passport issuer.

  • issuers: Passport issuer who verified the attributes.

Example

Last updated