📂 Functions
# beaconIdToReaderToWhitelistStatus()
Table of Contents
For on-chain smart contracts, the function
beaconIdToReaderToWhitelistStatus() (opens new window)
returns detailed whitelisting status for the reader
and beaconId
parameters.
Get Whitelisted
Please contact the API3 Business Development API Team (opens new window) about Beacon whitelisting.
# Example Code
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "@api3/airnode-protocol/contracts/rrp/requesters/interfaces/IRrpBeaconServer.sol";
contract mySmartContract {
function myReadableDetails(
bytes32 _beaconId
address _beaconContractAddress
) external {
uint64 private expirationTimestamp;
uint192 private indefiniteWhitelistCount;
// Calling the BeaconServer for detailed whitelist status
// where "this" is the contract address of this contract (myReadableDetails).
(expirationTimestamp, indefiniteWhitelistCount) =
RrpBeaconServer(_beaconContractAddress).beaconIdToReaderToWhitelistStatus(
_beaconId,
this
);
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Parameters
beaconIdToReaderToWhitelistStatus(bytes32 beaconId, address reader)
bytes32 beaconId
- The ID of the beacon.address reader
- The address to get the whitelist details for.
# Returns
uint64 private expirationTimestamp
- Timestamp at which the whitelisting of the reader will expire.uint192 indefiniteWhitelistCount
- Number of timesreader
was whitelisted indefinitely forbeaconId
. A reader is indefinitely whitelisted by the whitelist manager account or by any other account that has the INDEFINITE_WHITELISTER_ROLE_DESCRIPTION (opens new window) role. Each time an authorized account indefinitely whitelists the reader a recorded counter is incremented. When the reader's whitelist status is revoked then the counter is decremented. This means that as long as the counter (indefiniteWhitelistCount
) is greater than 0 the reader is whitelisted indefinitely.
When the address
has not been whitelisted this function returns:
expirationTimestamp uint64 : 0
indefiniteWhitelistCount uint192 : 0
1
2
2