KYC verification

In the SDK we have implemented CrypteriumKYC class to work with user's KYC. Use this class to get user's verification data and pass KYC verification.

To expand the limits of cryptocurrency operations, a user should pass name, residence and credential verification. The limits depend on the level of verification: the higher the level, the wider the limits.

In the CrypteriumKYC class, we have implemented several methods for KYC verification:

  • The getState method has been implemented to get the state of user's verification.

  • The getCountries method returns the list of available countries.

  • The kyc0Verification, kyc1Verification, kyc2Verification methods check different levels of user's KYC verification.

See more details in the description of each method.

CrypteriumKYC class

The CrypteriumKYC class has been implemented to work with user's KYC. To manage the process, initialize a CrypteriumKYC object:

let kyc: CrypteriumKYC = CrypteriumAPI.kyc()
kyc: ICrypteriumKyc = CrypteriumAPI.kyc()

Methods

getState

Use the getState method to get the state of user's verification. The method calls a completion closure and puts an object of CRPTKYCStateResult type as an argument of the closure.

kyc.getState(completion: (CRPTKYCStateResult) -> Void)

enum CRPTKYCStateResult {
	case success(CRPTKYCState)
	case failure(CRPTError)
}
kyc.getState(completion: (CRPTKYCStateResult) -> Unit)
  
sealed class CRPTKYCStateResult {
    data class success(val state: CRPTKYCState) : CRPTKYCStateResult()
    data class failure(val error: CRPTError) : CRPTKYCStateResult()
}

CRPTKYCStateResult

The CRPTKYCStateResult object value is attached to a success or a failure case:

casecase typedescription
successCRPTKYCStatestate of user's verification
failureCRPTErrorerror details

CRPTError

The type property of the CRPTError object may have the value below:

valuedescription
AUTHORIZATIONauthorization error
KYC0KYC0 error
KYC1KYC1 error
KYC2KYC2 error

getCountries

The getCountries method returns the list of available countries. The method calls a completion closure and puts an object of the CRPTKYCCountriesResult type as an argument of the closure.

kyc.getCountries(completion: (CRPTKYCCountriesResult) -> Void)

enum CRPTKYCCountriesResult {
	case success([CRPTCountry])
	case failure(CRPTError)
}
kyc.getCountries(completion: (CRPTKYCCountriesResult) -> Unit)
  
sealed class CRPTKYCCountriesResult {
    data class success(val countries: List<CRPTCountry>) : CRPTKYCCountriesResult()
    data class failure(val error: CRPTError) : CRPTKYCCountriesResult()
}

CRPTKYCCountriesResult

The CRPTKYCCountriesResult object value is attached to success or failure case:

casecase typedescription
success[CRPTCountry]array of available countries
failureCRPTErrorerror details

CRPTError

The type property of the CRPTError object may have one of the values below:

valueerror description
AUTHORIZATIONauthorization error
BACKENDbackend error

kyc0Verification

The kyc0Verification method allows to verify a user's first and last name and a country of residence.

kyc.kyc0Verification(firstName: String, lastName: String, residenceCountryCode: String, completion: (CRPTKYC0VerificationResult) -> Void)

enum CRPTKYCVerificationResult {
	case success(CRPTKYCState)
	case failure(CRPTError)
}
kyc.kyc0Verification(firstName: String, lastName: String, residenceCountry: CRPTCountry, completion: (CRPTKYC0VerificationResult) -> Unit)
  
sealed class CRPTKYC0VerificationResult {
    data class success(val state: CRPTKYCState) : CRPTKYC0VerificationResult()
    data class failure(val error: CRPTError) : CRPTKYC0VerificationResult()
}

Income parameters

parameter nameparameter typedescription
firstNameStringuser's first name
lastNameStringuser's last name
residenceCountryCodeStringresidence country code

CRPTKYCVerificationResult

The CRPTKYCVerificationResult object value is attached to success or failure case:

casecase typedescription
successCRPTKYCStateuser's KYC state
failureCRPTErrorerror details

CRPTError

The type property of the CRPTError object may have one of the values below:

valueerror description
AUTHORIZATIONauthorization error
BACKENDbackend error
VERIFIEDuser has already passed KYC0 verification

kyc1Verification

The kyc1Verification method allows to pass face verification and ID card verification. The method gets a UIViewController as a closure. This closure returns UIViewController with the default credentials to pass general KYC. The method calls a completion closure and puts an object of the CRPTKYC1VerificationResult type as an argument of the closure.

kyc.kyc1Verification(flowHandler: (UIViewController) -> Void, completion: (CRPTKYC1VerificationResult) -> Void)

enum CRPTKYC1VerificationResult {
	case success(CRPTKYCState)
	case failure(CRPTError)
}
kyc.kyc1Verification(completion: (CRPTKYC1VerificationResult) -> Unit)
  
sealed class CRPTKYC1VerificationResult {
    data class success(val state: CRPTKYCState) : CRPTKYC1VerificationResult()
    data class failure(val error: CRPTError) : CRPTKYC1VerificationResult()
}

Income parameters

parameter nameparameter typedescription
flowHandlerVoidexternal View Controller to pass KYC verification

CRPTKYC1VerificationResult

The CRPTKYC1VerificationResult object value is attached to success or failure case:

casecase typedescription
successCRPTKYCStateuser's KYC state
failureCRPTErrorerror details

CRPTError

The type property of the CRPTError object may have one of the values below:

valueerror description
AUTHORIZATIONauthorization error
BACKENDbackend error
VERIFIEDuser has already passed KYC1 verification

kyc2Verification

The kyc2Verification method allows to pass residence verification. To confirm residence, a user gives any official document where his address is stated. It could be a bank statement, a utility bill or even a passport, if it contains user's address.
The method calls a completion closure and puts an object of the CRPTKYCVerificationResult type as an argument of the closure.

kyc.kyc2Verification(residenceAddress: CRPTResidenceAddress, documentType: CRPTKYC2DocumentType, documentPhotoUrl: URL, completion: (CRPTKYC2VerificationResult) -> Void)

enum CRPTKYCVerificationResult {
	case success(CRPTKYCState)
	case failure(CRPTError)
}
kyc.kyc2Verification(residenceAddress: CRPTResidenceAddress, documentType: CRPTKYC2DocumentType, documentPhotoUrl: URI, completion: (CRPTKYC2VerificationResult) -> Unit)

sealed class CRPTKYC2VerificationResult {
    data class success(val state: CRPTKYCState) : CRPTKYC2VerificationResult()
    data class failure(val error: CRPTError) : CRPTKYC2VerificationResult()
}

Income parameters

parameter nameparameter typedescription
residenceAddressCRPTResidenceAddressuser's address of residence
documentTypeCRPTKYC2DocumentTypeuser's document type
documentPhotoUrlURLdocument photo URL

CRPTKYCVerificationResult

The CRPTKYCVerificationResult object value is attached to success or failure case:

casecase typedescription
successCRPTKYCStateuser's KYC state
failureCRPTErrorerror details

CRPTError

The type property of the CRPTError object may have one of the values below:

valueerror description
AUTHORIZATIONauthorization error
BACKENDbackend error
VERIFIEDuser has already passed KYC2 verification