@@ -91,30 +91,18 @@ export async function getAttestationData({
91
91
) ,
92
92
} ;
93
93
94
- const passportSchema = onchainInfo [ chainId ] . easSchemas . passport . uid ;
95
- // check if user has attestations
96
- const passportUid = ( await publicClient . readContract ( {
97
- abi : resolverAbi ,
98
- address : resolverAddress as `0x${string } `,
99
- functionName : "userAttestations" , // Name of the function in your contract ABI
100
- args : [ address , passportSchema ] , // Arguments to the function
101
- } ) ) as `0x${string } `;
102
-
103
- let providers : AttestationData [ "providers" ] = [ ] ;
104
- if ( passportUid !== ZERO_BYTES32 ) {
105
- const cachedPassport = await getPassport ( {
106
- publicClient,
107
- address,
108
- decoderAddress,
109
- decoderAbi,
110
- } ) ;
94
+ const cachedPassport = await getPassport ( {
95
+ publicClient,
96
+ address,
97
+ decoderAddress,
98
+ decoderAbi,
99
+ } ) ;
111
100
112
- providers = cachedPassport . map ( ( { provider, issuanceDate, expirationDate } ) => ( {
113
- providerName : provider as PROVIDER_ID ,
114
- issuanceDate : new Date ( Number ( issuanceDate ) * 1000 ) ,
115
- expirationDate : new Date ( Number ( expirationDate ) * 1000 ) ,
116
- } ) ) ;
117
- }
101
+ const providers = cachedPassport . map ( ( { provider, issuanceDate, expirationDate } ) => ( {
102
+ providerName : provider as PROVIDER_ID ,
103
+ issuanceDate : new Date ( Number ( issuanceDate ) * 1000 ) ,
104
+ expirationDate : new Date ( Number ( expirationDate ) * 1000 ) ,
105
+ } ) ) ;
118
106
119
107
return {
120
108
providers,
0 commit comments