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 getStatemethod has been implemented to get the state of user's verification.
- 
The getCountriesmethod returns the list of available countries.
- 
The kyc0Verification,kyc1Verification,kyc2Verificationmethods 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:
| case | case type | description | 
| success | CRPTKYCState | state of user's verification | 
| failure | CRPTError | error details | 
CRPTError
The type property of the CRPTError object may have the value below:
| value | description | 
| AUTHORIZATION | authorization error | 
| KYC0 | KYC0 error | 
| KYC1 | KYC1 error | 
| KYC2 | KYC2 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:
| case | case type | description | 
| success | [CRPTCountry] | array of available countries | 
| failure | CRPTError | error details | 
CRPTError
The type property of the CRPTError object may have one of the values below:
| value | error description | 
| AUTHORIZATION | authorization error | 
| BACKEND | backend 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 name | parameter type | description | 
| firstName | String | user's first name | 
| lastName | String | user's last name | 
| residenceCountryCode | String | residence country code | 
CRPTKYCVerificationResult
The CRPTKYCVerificationResult object value is attached to success or failure case:
| case | case type | description | 
| success | CRPTKYCState | user's KYC state | 
| failure | CRPTError | error details | 
CRPTError
The type property of the CRPTError object may have one of the values below:
| value | error description | 
| AUTHORIZATION | authorization error | 
| BACKEND | backend error | 
| VERIFIED | user 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 name | parameter type | description | 
| flowHandler | Void | external View Controller to pass KYC verification | 
CRPTKYC1VerificationResult
The CRPTKYC1VerificationResult object value is attached to success or failure case:
| case | case type | description | 
| success | CRPTKYCState | user's KYC state | 
| failure | CRPTError | error details | 
CRPTError
The type property of the CRPTError object may have one of the values below:
| value | error description | 
| AUTHORIZATION | authorization error | 
| BACKEND | backend error | 
| VERIFIED | user 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 name | parameter type | description | 
| residenceAddress | CRPTResidenceAddress | user's address of residence | 
| documentType | CRPTKYC2DocumentType | user's document type | 
| documentPhotoUrl | URL | document photo URL | 
CRPTKYCVerificationResult
The CRPTKYCVerificationResult object value is attached to success or failure case:
| case | case type | description | 
| success | CRPTKYCState | user's KYC state | 
| failure | CRPTError | error details | 
CRPTError
The type property of the CRPTError object may have one of the values below:
| value | error description | 
| AUTHORIZATION | authorization error | 
| BACKEND | backend error | 
| VERIFIED | user has already passed KYC2 verification | 
Updated over 3 years ago
