Additional classes

CRPTAddCardModel

TheCRPTAddCardModel class has been implemented to add user's cards.

struct CRPTAddCardModel {
 	var billingAddress: CRPTBillingAddressModel
 	var cardExpirationMonth: Int
	var cardExpirationYear:	Int
	var cardHolder:	String
	var cardNumber:	Int64
}
class CRPTAddCardModel(
    val billingAddress: CRPTBillingAddressModel?,
    val cardExpirationMonth: Int?,
    val cardExpirationYear: Int?,
    val cardHolder: String?,
    val cardNumber: Long?
)

Properties

nametypedescription
billingAddressCRPTBillingAddressModelbilling address of a bank card
cardExpirationMonthIntcard expiration month in a two-digit format
cardExpirationYearIntcard expiration year in a two-digit format
cardHolderStringcardholder name
cardNumberInt64card number

CRPTAmount

The CRPTAmount object contains the amount of a certain cryptocurrency.

struct CRPTAmount {
  var value: Decimal
  var currency: CRPTCurrency
}
class CRPTAmount(
  var amount: BigDecimal,
  var sourceCurrency: String?    
)

Properties

nametypedescription
valueDecimalamount of crypto, fee
currencyCRPTCurrencycryptocurrency

CRPTBillingAddressModel

The CRPTBillingAddressModel object contains address data of a bank card.

enum CRPTBillingAddressModel: String {
  var countryCode: String
  var city: String
  var address: String
  var zip: String
}
class CRPTBillingAddressModel (
    val countryCode: String?,
    val city: String?,
    val address: String?,
    val zip: String?
)

Properties

nametypedescription
countryCodeStringalpha-3 (three-letter) country code defined in ISO 3166
cityStringcity name
addressStringstreet name, building number, apartment number, etc.
zipStringzip-code

CRPTCardModel

The CRPTCardModel class operates with the bank cards added by a user.

struct CRPTCardModel {
  var cardId: Int64?
  var maskedPan: String?
  var billingAddressRequired: Bool?
  var validationStatus: CRPTCardDescriptorStatus? 
}
class CRPTCardModel(
    val cardId: Int?,
    val maskedPan: String?,
    val billingAddressRequired: Boolean?,
    val validationStatus: CRPTCardDescriptorStatus?
)

Properties

nametypedescription
cardIdInt64card id
maskedPanStringmasked PAN card number, the first six and last four digits 123456****3456
billingAddressRequiredBoolTrue - card operations are NOT available, add billing address
False - card operations are available
validationStatusCRPTCardDescriptorStatusvalidation status

CRPTCardDescriptorStatus

The CRPTCardDescriptorStatus object contains a card descriptor status. It allows you to understand how to operate with the descriptor.

enum CRPTCardDescriptorStatus: String {
  case new = “NEW”
  case approved = “APPROVED”
  case unavailable = “UNAVAILABLE”
}
enum class CRPTCardDescriptorStatus {
    NEW, APPROVED, UNAVAILABLE
}

The value of the CRPTCardDescriptorStatus object is attached to one of the cases below:

valuedescription
NEWnew card, to buy crypto a user needs to pass verification
APPROVEDapproved card, verification has passed, card operations are available
UNAVAILABLEunavailable card, card operations are not available

CRPTCountry

The CRPTCardModel class represents the description of a country.

struct CRPTCountry {
  var name:	String
  var code: String
  var isoCode: String 
}
class CRPTCountry(
    var code: String,
    var name: String,
    var isoCode: String,
)

Properties

nametypedescription
codeStringcountry code
nameStringcountry name
isoCodeStringalpha-3 (three-letter) country code defined in ISO 3166

CRPTCurrency

The CRPTCurrency object is the enumeration of available cryptocurrencies. This list may vary from version to version.

enum CRPTCurrency: String {
  case btc = “BTC”
  case bch = “BCH”
  case eth = “ETH”
  case xrp = “XRP”
  ...
}
enum class CRPTCurrency {
    BTC, BCH, ETH, XRP, LTC, CRPT, USDC, USDT, EUR, MKR, QASH, LINK, BAT, DAI, EURS,...
}

The CRPTCurrency object may have the value below:

valuename
AACDouble-A Chain
ALGOAlgorand
ANWAnchor Neural World
AVAXAvalanche
BATBasic Attention Token
BCHBitcoin Cash
BNBBNB
BTCBitcoin
BTCVBitcoin Vault
CADCandy Protocol
CHOChoise.com
CIX100Cryptoindex.com 100
CRPTCrypterium
DAIDai
DAODAO Maker
DASHDash
DOGEDogecoin
ETHEthereum
EUREuro
EURSStasis euro
EVEREverscale
GALAGala
GLEECGleec
LINKChainlink
LTCLitecoin
MANADecentraland
MAPSMAPS
MATICPolygon
MKRMaker
OMGOMG Network
REPAugur
SANDThe Sandbox
SHIBShiba Inu
SOLSolana
TRXTRON
TUSDTrueUSD
UNIUniswap
USDCUSD Coin
USDTTether
XDCXDC Network
XRPRipple
ZRX0x

CRPTCustomerOperations

The CRPTCustomerOperations object is an array of CrypteriumOperationView objects. It is used in the getSaved method of the CrypteriumOperationsStore class. The CrypteriumOperationView object is an object defining a single available operation.

typealias CRPTCustomerOperations = [CrypteriumOperationView]
class CRPTCustomerOperations {
    var operations: List<CRPTCustomerOperation>? = null
}

CRPTCustomerProfile

The CRPTCustomerProfile class has been implemented to contain user's profile data.

struct CustomerProfile {
   var country: String?  
   var email: String?  
   var firstName: String?
   var lastName: String?  
   var phone: String?  
   var primaryCurrency: String? 
}
class CRPTCustomerProfile(
	 val country: String?,  
   val email: String?,  
   val firstName: String?,
   val lastName: String?,  
   val mobile: String?,  
   val primaryCurrency: String? 
)

Properties

nametypedescription
countryStringuser's country
emailStringuser's e-mail
firstNameStringuser's first name
lastNameStringuser's last name
phone (mobile Android)Stringuser's phone number
primaryCurrencyStringmain fiat currency of a wallet

CRPTError

The CRPTError class describes different types of errors.

struct CRPTError: Error {
  var code: Int?
  var type: CRPTErrorType?
  var message: String?
}

enum CRPTErrorType: String {
  case cancelled = “CANCELLED”
  case verified = “VERIFIED”
  case noData = “NO_DATA”
  case maintenance = “MAINTENANCE”
  case update = “UPDATE”
  case limits = “LIMITS”
  case kyc0 = “KYC0”
  case kyc1 = “KYC1"
  case kyc2 = “KYC2”
  case backend = “BACKEND”
  case internet = “INTERNET”
  case validation = “VALIDATION”
  case authorization = “AUTHORIZATION”
  case billingRequired = “BILLING_REQUIRED”
  case amount = “AMOUNT”
}
class CRPTError(
    val code: Int?
    val type: CRPTErrorType?
    val message: String?
) 
  
enum class CRPTErrorType(val value: String) {
    CANCEL("CANCEL"),
    NO_DATA("NO_DATA"),
    MAINTENANCE("MAINTENANCE"),
    UPDATE("UPDATE"),
    LIMITS("LIMITS"),
    KYC0("KYC0"),
    KYC1("KYC1"),
    KYC2("KYC2"),
    BACKEND("BACKEND"),
    INTERNET("INTERNET"),
    VALIDATION("VALIDATION"),
    VERIFIED("VERIFIED"),
    AUTHORIZATION("AUTHORIZATION")
}

The CRPTErrorType object may have the value below:

valuedescription
CANCELLEDuser exited the flow
VERIFIEDalready passed verification
NO_DATAno data
MAINTENANCEmaintenance error
UPDATEneeds to update
LIMITSlimits exceeded
KYC0KYC0 verification error
KYC1KYC1 verification error
KYC2KYC2 verification error
BACKENDbackend error, the backend returns an error message
VALIDATIONvalidation error
AUTHORIZATIONauthorization error
BILLING_REQUIREDbilling address required
AMOUNTnot enough amount for operation

CRPTKYCState

The CRPTKYCState object defines the KYC state of a user. Each KYC level has a definite status.

struct CRPTKYCState {
	level:	CRPTKYCType
	status:	CRPTKYCStatus
}
class CRPTKYCState(
    val kycLevels: ArrayList<CRPTKYCLevel> = ArrayList()
)
  
class CRPTKYCLevel(
    val level: CRPTKYCType,
    val status: CRPTKYCStatus
)

CRPTKYCStatus

The CRPTKYCStatus enumeration contains KYC verification status.

enum CRPTKYCStatus: String {
  case _none = "NONE"
  case inProgress = "IN_PROGRESS"
  case rejected = "REJECTED"
  case approved = "APPROVED"
}
enum class CRPTKYCStatus(val type: String) {
    IN_PROGRESS("IN_PROGRESS"),
    REJECTED("REJECTED"),
    APPROVED("APPROVED"),
    NONE("NONE"),
}

The CRPTKYCStatus object may have the value below:

valuedescription
NONEKYC verification not started
IN_PROGRESSKYC verification in progress
REJECTEDdocuments checked, KYC verification rejected
APPROVEDdocuments approved, KYC verification passed

CRPTKYCType

The CRPTKYCType enumeration contains KYC verification levels.

enum CRPTKYCType: String {
  case kyc0 = “KYC0”
  case kyc1 = “KYC1”
  case kyc2 = “KYC2”
}
enum class CRPTKYCType(val type: String) {
    KYC0("KYC0"),
    KYC1("KYC1"),
    KYC2("KYC2"),
}

The CRPTKYCType object may have the value below:

valuedescription
KYC0KYC0 verification passed
KYC1KYC1 verification passed
KYC2KYC2 verification passed

CRPTLimits

The CRPTLimits object contains minimum and maximum of available crypto or fiat.

struct CRPTLimits {
  let minAmountFrom: Decimal
  let maxAmountFrom: Decimal
}
class CRPTLimits(
    var min: BigDecimal?,
    var max: BigDecimal?
)

The CRPTLimits object may have the value below:

valuetypedescription
minAmountFromDecimalminimum amount
maxAmountFromDecimalmaximum amount

CRPTTransactionStatus

The CRPTTransactionStatus class represents the enumeration of transaction statuses.

enum CRPTTransactionStatus: String {
  case success = “SUCCESS”
  case pending = “PENDING”
  case confirmation = “CONFIRMATION”
  case failure = “FAILURE”
}
enum class CRPTTransactionStatus {
    SUCCESS, PENDING, CONFIRMATION, FAILURE
}

The CRPTTransactionStatus object may have the value below:

valuedescription
SUCCESStransaction executed successfully
PENDINGtransaction pending
CONFIRMATIONtransaction needs to be confirmed by e-mail
FAILUREtransaction failed

CrypteriumOperationView

The CrypteriumOperationView object is an operation available in the getSaved method of the CrypteriumOperationsStore class.

struct CrypteriumOperationView {
  var constraint: Constraint
  var kycLevelPermissibleList: [FoundationElement<KycLevelPermissibleList>]?
  var name: String
}
class CRPTCustomerOperation  {
    var name: OperationName? 
    var constraint: String? 
    var kycLevelPermissibleList: ArrayList<KycLevel>?
}

The fields of the CrypteriumOperationView object are described below.

Constraint

The Constraint object allows you to determine whether an operation is available or not. Depending on the value, different actions are expected. On Android, the constraint variable is of String type.

enum Constraint: String { 
    case _none = “NONE”
    case kycRequired = “KYC_REQUIRED”
    case kycVerifying = “KYC_VERIFYING”
    case kycDenied = “KYC_DENIED”
    case kycRejected = “KYC_REJECTED”
    case maintenance = “MAINTENANCE”
    case update = “UPDATE”
  }

The Constraint object value is attached to one of the cases below:

valuedescription
NONEoperation is available, no restrictions
KYC_REQUIREDKYC required
KYC_VERIFYINGKYC is verifying
KYC_DENIEDKYC denied
KYC_REJECTEDKYC rejected
MAINTENANCEoperation is maintaining
UPDATEupdate the operation

KycLevelPermissibleList

The KycLevelPermissibleList object is one of the values for the KYC attached constraint of the CrypteriumOperationView object. To make the operation available, a user needs to perform the appropriate action depending on the case.

enum KycLevelPermissibleList: String {
  case _none = “NONE”
  case kyc0 = “KYC_0”
  case kyc1 = “KYC_1"
  case kyc2 = “KYC_2”
}
enum class KycLevel {
    NONE,
    KYC_0,
    KYC_1,
    KYC_2;
}

The KycLevelPermissibleList object value is attached to the cases below:

valuedescription
NONEno need to pass KYC
KYC_0pass KYC0
KYC_1pass KYC1
KYC_2pass KYC2

Decimal

In order to work with numbers, we use Decimal structure for the iOS SDK and BigDecimal class for the Android SDK.
The difference is in the code example below:

payout.averageFee(for amount: Decimal, completion: (CRPTFeeResult) -> Void)
payout.averageFee(amount: BigDecimal, completion: (CRPTFeeResult) -> Unit)

WalletModel

The WalletModel object is an object containing the description of each wallet: cryptocurrency, address, balance, etc.

struct WalletModel {
   var address: String?
   var balance: Decimal?  
   var currency: String
   var fiat: WalletFiatView?
   var id: Int64? 
   var scale: Int?   
}
class CRPTCustomerAccount {
    var balance: BigDecimal?,
    var currency: String?,
    var scale: Int
}

Properties

nametypedescription
addressStringwallet address
balanceDecimalwallet balance
currencyStringwallet currency
fiatWalletFiatViewwallet
idInt64wallet id; if it is equal to -1, you need to create a wallet
scaleIntnumber of valid decimal places for the wallet currency

The WalletFiatView object contains fiat balance of a user.

struct WalletFiatView {
     var amount: Decimal? 
     var change: Decimal? 
     var changePercent: Decimal? 
     var customerCurrency: String? 
}

Properties

nametypedescription
amountDecimalequivalent amount of money in fiat
changeDecimalchanges in the last day
changePercentDecimalchanges in percent in the last day
customerCurrencyStringfiat currency