Additional classes
- CRPTAddCardModel
- CRPTAmount
- CRPTBillingAddressModel
- CRPTCardModel
- CRPTCountry
- CRPTCurrency
- CRPTCustomerOperations
- CRPTCustomerProfile
- CRPTError
- CRPTKYCState
- CRPTKYCStatus
- CRPTKYCTypes
- CRPTLimits
- CRPTTransactionStatus
- CrypteriumOperationView
- Decimal
- WalletModel
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
name | type | description |
---|---|---|
billingAddress | CRPTBillingAddressModel | billing address of a bank card |
cardExpirationMonth | Int | card expiration month in a two-digit format |
cardExpirationYear | Int | card expiration year in a two-digit format |
cardHolder | String | cardholder name |
cardNumber | Int64 | card 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
name | type | description |
---|---|---|
value | Decimal | amount of crypto, fee |
currency | CRPTCurrency | cryptocurrency |
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
name | type | description |
---|---|---|
countryCode | String | alpha-3 (three-letter) country code defined in ISO 3166 |
city | String | city name |
address | String | street name, building number, apartment number, etc. |
zip | String | zip-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
name | type | description |
---|---|---|
cardId | Int64 | card id |
maskedPan | String | masked PAN card number, the first six and last four digits 123456****3456 |
billingAddressRequired | Bool | True - card operations are NOT available, add billing address False - card operations are available |
validationStatus | CRPTCardDescriptorStatus | validation 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:
value | description |
---|---|
NEW | new card, to buy crypto a user needs to pass verification |
APPROVED | approved card, verification has passed, card operations are available |
UNAVAILABLE | unavailable 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
name | type | description |
---|---|---|
code | String | country code |
name | String | country name |
isoCode | String | alpha-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:
value | name |
---|---|
AAC | Double-A Chain |
ALGO | Algorand |
ANW | Anchor Neural World |
AVAX | Avalanche |
BAT | Basic Attention Token |
BCH | Bitcoin Cash |
BNB | BNB |
BTC | Bitcoin |
BTCV | Bitcoin Vault |
CAD | Candy Protocol |
CHO | Choise.com |
CIX100 | Cryptoindex.com 100 |
CRPT | Crypterium |
DAI | Dai |
DAO | DAO Maker |
DASH | Dash |
DOGE | Dogecoin |
ETH | Ethereum |
EUR | Euro |
EURS | Stasis euro |
EVER | Everscale |
GALA | Gala |
GLEEC | Gleec |
LINK | Chainlink |
LTC | Litecoin |
MANA | Decentraland |
MAPS | MAPS |
MATIC | Polygon |
MKR | Maker |
OMG | OMG Network |
REP | Augur |
SAND | The Sandbox |
SHIB | Shiba Inu |
SOL | Solana |
TRX | TRON |
TUSD | TrueUSD |
UNI | Uniswap |
USDC | USD Coin |
USDT | Tether |
XDC | XDC Network |
XRP | Ripple |
ZRX | 0x |
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
name | type | description |
---|---|---|
country | String | user's country |
String | user's e-mail | |
firstName | String | user's first name |
lastName | String | user's last name |
phone (mobile Android) | String | user's phone number |
primaryCurrency | String | main 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:
value | description |
---|---|
CANCELLED | user exited the flow |
VERIFIED | already passed verification |
NO_DATA | no data |
MAINTENANCE | maintenance error |
UPDATE | needs to update |
LIMITS | limits exceeded |
KYC0 | KYC0 verification error |
KYC1 | KYC1 verification error |
KYC2 | KYC2 verification error |
BACKEND | backend error, the backend returns an error message |
VALIDATION | validation error |
AUTHORIZATION | authorization error |
BILLING_REQUIRED | billing address required |
AMOUNT | not 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:
value | description |
---|---|
NONE | KYC verification not started |
IN_PROGRESS | KYC verification in progress |
REJECTED | documents checked, KYC verification rejected |
APPROVED | documents 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:
value | description |
---|---|
KYC0 | KYC0 verification passed |
KYC1 | KYC1 verification passed |
KYC2 | KYC2 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:
value | type | description |
---|---|---|
minAmountFrom | Decimal | minimum amount |
maxAmountFrom | Decimal | maximum 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:
value | description |
---|---|
SUCCESS | transaction executed successfully |
PENDING | transaction pending |
CONFIRMATION | transaction needs to be confirmed by e-mail |
FAILURE | transaction 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:
value | description |
---|---|
NONE | operation is available, no restrictions |
KYC_REQUIRED | KYC required |
KYC_VERIFYING | KYC is verifying |
KYC_DENIED | KYC denied |
KYC_REJECTED | KYC rejected |
MAINTENANCE | operation is maintaining |
UPDATE | update 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:
value | description |
---|---|
NONE | no need to pass KYC |
KYC_0 | pass KYC0 |
KYC_1 | pass KYC1 |
KYC_2 | pass 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
name | type | description |
---|---|---|
address | String | wallet address |
balance | Decimal | wallet balance |
currency | String | wallet currency |
fiat | WalletFiatView | wallet |
id | Int64 | wallet id; if it is equal to -1, you need to create a wallet |
scale | Int | number 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
name | type | description |
---|---|---|
amount | Decimal | equivalent amount of money in fiat |
change | Decimal | changes in the last day |
changePercent | Decimal | changes in percent in the last day |
customerCurrency | String | fiat currency |
Updated over 2 years ago