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

Name
Type
Description

apiAccessToken*

string

walletAddress*

hex string

Wallet Address

attributes

QuadrataAttribute[]

Array of attribute names Can be provided in sdkConfig

chainId

QuadrataNetwork

Blockchain ID Can be provided in sdkConfig

offeringId

string

Unique offering id For accreditation re-attestation

privacyScopes

QuadrataPrivacyConsent[]

Privacy consent scopes For checking granted consent Can be provided in sdkConfig

options

object

Fetch Options

SDK Configuration

Name
Type
Description

environment*

QuadrataEnvironment

attributes

QuadrataAttribute[]

Attribute name array Can be provided in params

network

QuadrataNetwork

Blockchain ID Can be provided in params as chainId

privacyScopes

QuadrataPrivacyConsent[]

Privacy consent scopes For checking granted consent Can be provided in params

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