Client Helper Component
Quadrata SDK Client Helper Component
The Helper Component provides a way to interact with the state of a Quadrata application from within your app.
It will have access to props that let you know what's happening before, during, and after onboarding.
There are different helper components for both KYB
and KYC
onboarding applications which contain different props.
The helper component is mapped from the component Helper
type at @quadrata/sdk/types/components/helper
Helper Component Props
No matter which application type is being accessed (KYB or KYC), the helper component will always have the following props:
isApplicationComplete
: A boolean that tells you if the application is complete or not.isApplicationReady
: A boolean that tells you if the application is ready to be launched or not.isLoading
: A boolean that tells you if the application is loading or not.isOpen
: A boolean that tells you if the application is open or not.isPassportInReview
: A boolean that tells you if the the passport is in review or not. If the passport is in review, that means all the attributes are claimed and the application is awaiting manual review.launchApplication
: A function that launches the application and setsisOpen
totrue
.closeApplication
: A function that closes the application and setsisOpen
tofalse
.
KYB Helper Props
When the user is going through the KYB application, the following additional props will be passed to your helper component:
isConsentGranted
: A boolean that tells you if KYB consent has been granted or not.isConsentRequested
: A boolean that tells you if the onboarding application is configured to request for KYB privacy consent.isKybApplication
: A boolean that tells you if the application is a KYB application or not.walletAddresses
: An array containing all of the business wallet addresses inserted into the KYB application during onboarding.
KYC Helper Props
When the user is going through the KYC application, the following additional props will be passed to your helper component:
isConsentGranted
: A boolean that tells you if the consent passed intoprivacyScopes
is granted or not.isConsentNeeded
: A boolean that tells you if the consent passed intoprivacyScopes
have not been granted. That is, should the application prompt the user for consent or not.isConsentRequested
: A boolean that tells you if anything has been passed intoprivacyScopes
or not.isKycApplication
: A boolean that tells you if the application is a KYC application or not.walletAddress
: A string that contains the wallet address passed into component or connected through wallet connect.
When the SDK loads the KYC components, onboard status is abstracted for you. So the props you pass into kycProps
are not directly passed into the KYC application. They are first checked against the wallet address to see which attributes or privacy scopes are needed.
This is done through the useOnboardStatus hook, which is handled for you.
This is why you have helper properties for isConsentGranted, isConsentNeeded, isConsentRequested, etc.
Multi-Component (All In One) Helper Props
When both kybProps
and kycProps
are passed into the Quadrata
component, the following additional props will be passed to your helper component:
isConsentGranted
: A boolean that tells you if the consent passed intoprivacyScopes
is granted or not.isConsentNeeded
: A boolean that tells you if the consent passed intoprivacyScopes
have not been granted. That is, should the application prompt the user for consent or not.isConsentRequested
: A boolean that tells you if anything has been passed intoprivacyScopes
or not.isKybApplication
: A boolean that tells you if the application is a KYB application or not.isKycApplication
: A boolean that tells you if the application is a KYC application or not.launchKybApplication
: A function that launches only the KYB application and setsisOpen
totrue
.launchKycApplication
: A function that launches only the KYC application and setsisOpen
totrue
.walletAddress
: A string that contains the wallet address passed into component or connected through wallet connect.walletAddresses
: An array containing all of the business wallet addresses inserted into the KYB application during onboarding. This will only be available whenisKybApplication
is true.
In this context the launchApplication
function will launch a modal that gives the user the option to choose between KYB and KYC applications.
If the user's wallet is not connected or passed in, the KYC
application will be disabled in this modal.
Wagmi Connect Helper Props
If you are using the Quadrata SDK with Wagmi, you can use the withWagmiConnect
props initializer.
Using this, the event handlers to connect wallets and sign transactions will be abstracted for you, so you do not need to worry about handling the them yourself.
In this context, the helper object will have the following additional props:
isWalletConnected
: A boolean that tells you if the wallet is connected or not.
Usage
The helper component is required as either a child component or as a prop.
As Child Component
As Prop
Last updated