Fetch Privacy Grants

Quadrata SDK API Service: Fetch Privacy Grants

Fetch which privacy data has been granted consent to your dApp by a known wallet address. This feature must be enabled for your dApp.

Parameters

One private key parameter is required. You can provide your private key in any of the formats listed.

See API Service Options for more information

SDK Configuration

See API Get Privacy Permissions for more information about the underlying API endpoint.

Example

import type { API } from '@quadrata/sdk/types';
import { fetchPrivacyGrants, QuadrataEnvironment } from '@quadrata/sdk/api';

type ResponseType = API.Service.FetchPrivacyGrants.Response;
type ParsedResponseType = API.Service.FetchPrivacyGrants.ParsedResponse;

const response: ResponseType = await fetchPrivacyGrants(
    // params
    {
        apiKey: process.env.QUADRATA_API_KEY,
        walletAddress: '0x123',
        
        // private signing key
        privateKeyDerBase64: process.env.QUADRATA_PRIVATE_KEY_DER_BASE64,
        
        // optional fetch options
        options: {
            cache: 'no-cache'
        }
    },
    // sdk config
    { environment: QuadrataEnvironment.PRODUCTION }
);

const grantedConsent: ParsedResponse = response.data.grants;

Last updated