Fetch Privacy Data

Quadrata SDK API Service: Fetch Privacy Data

Fetch underlying PII for an individual or business by a known wallet address. This is a privacy data query and incurs Quad Unit charges. This feature must be enabled for your dApp.

Parameters

NameTypeDescription

apiKey*

string

Your API Key

walletAddress*

hex string

Wallet address

privateKeyDerBase64

string

Base64 DER String

privateKeyDer

string

DER Binary String

privateKeyPem

string

PEM String

privateKey

CryptoKey

CryptoKey object

privacyAccessToken

string

Access token If not provided, one will be generated See createPrivacyAccessToken

scopes

QuadrataPrivacyConsent[]

Sparse scopes to fetch If you don't want everything

options

object

Fetch Options

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

NameTypeDescription

environment*

QuadrataEnvironment

Access token See createAccessToken

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

Example

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

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

const response: ResponseType = await fetchPrivacyData(
    // params
    {
        apiKey: process.env.QUADRATA_API_KEY,
        walletAddress: '0x123',
        
        // private signing key
        privateKeyDerBase64: process.env.QUADRATA_PRIVATE_KEY_DER_BASE64,
        
        // optional, if not provided, will be generated for you
        privacyAccessToken: 'access token from createPrivacyAccessToken',
        
        // optional sparse scopes
        scopes: [
            QuadrataPrivacyConsent.EMAIL,
            QuadrataPrivacyConsent.DATE_OF_BIRTH
        ],
        
        // optional fetch options
        options: {
            cache: 'no-cache'
        }
    },
    // sdk config
    { environment: QuadrataEnvironment.PRODUCTION }
);

const attributes: ParsedResponseType = response.data.attributes;

Last updated