Fetch Onboard Status

Quadrata SDK API Service: Fetch Onboard Status

Fetch attribute status and PII consent data for a wallet address, to determine if attributes need to be claimed or privacy needs to be consented.

Parameters

SDK Configuration

See API Onboard Status for more information about the underlying API endpoint.

Example

import type { API } from '@quadrata/sdk/types';
import {
    fetchOnboardStatus,
    parseOnboardStatus,
    
    QuadrataAttribute,
    QuadrataEnvironment,
    QuadrataNetwork,
    QuadrataPrivacyConsent
} from '@quadrata/sdk/api';

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

const response: ResponseType = await fetchOnboardStatus(
    {
        apiAccessToken: 'jwt token from createAccessToken',
        
        // optional, if provided in config
        attributes: [
            QuadrataAttribute.AML,
            QuadrataAttribute.DID,
        ],  
        
        // optional, if provided in config as network
        chainId: QuadrataNetwork.MAINNET,
        
        // optional, unless you are checking for accrediation re-attestation
        offeringId: '123',
        
        // optional, if provided in config
        privacyScopes: [
            QuadrataPrivacyConsent.EMAIL,
            QuadrataPrivacyConsent.DATE_OF_BIRTH,
        ],
        
        walletAddress: '0x123',
        
        options: {
            // optional fetch options
            cache: 'no-cache'
        }
    },
    {
        // optional, if provided in above params
        attributes: [
            QuadrataAttribute.AML,
            QuadrataAttribute.DID
        ], 
        
        // required
        environment: QuadrataEnvironment.PRODUCTION,
        
        // optional, if provided in above params
        network: QuadrataNetwork.MAINNET,
        
        // optional, if provided in above params
        privacyScopes: [
            QuadrataPrivacyConsent.EMAIL,
            QuadrataPrivacyConsent.DATE_OF_BIRTH,
        ],
    }
);

/* parse the response */

const isBypassMint = false;  // or true
const status: ParsedResponseType = parseOnboardStatus(response, isBypassMint);

// status.attributesToClaim
// status.isConsentNeeded
// status.isInReview

Last updated