Skip to content

Commit

Permalink
Merge pull request #82 from CelsiusNetwork/release/1.0.0
Browse files Browse the repository at this point in the history
Release/1.0.0
  • Loading branch information
ctebah-celsius authored Mar 8, 2022
2 parents 435bc15 + ce1193d commit 57b88f6
Show file tree
Hide file tree
Showing 9 changed files with 364 additions and 143 deletions.
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,62 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2022-03-08
### Added
- Functionalities:
- Added functionality to `http-client` for sending PUT requests. Kudos to [@ptlls](https://github.com/ptlls)
- Methods:
- ```CelsiusInstance.getSupportedCountries(userSecret)``` that returns the list of countries supported by Celsius.
- ```CelsiusInstance.health(message)``` checks the health of the server. Kudos to [@andreujuanc](https://github.com/andreujuanc)
- ```CelsiusInstance.getKycVerificationStatus(userId, userSecret)``` checks the KYC status, similar to existing `getKycStatus` method, but takes also `userId` as a parameter
and returns a response containing property `status` which shows the status of KYC and `reason` which states the reason for the status if needed.
- ```CelsiusInstance.startKycVerification(userId, documentType, userDocuments, userSecret)``` starts the KYC verification same as existing `verifyKyc` method, but it doesn't
create the user, but rather receives an existing user's id - `userId` as a parameter
- ```CelsiusInstance.createUser(user)``` which returns `userId` which can be used to manipulate user info and starting KYC verification. Also, the `user_token` property will be used as `userSecret`
- ```CelsiusInstance.updateUser(userId, user, userSecret)```
- ```CelsiusInstance.updateUserEmail(email, userSecret)```
- ```CelsiusInstance.confirmTermsOfUse(termsOfUseId, confirmationDate, userSecret)``` use to accept the latest terms of use. Kudos to [@ptlls](https://github.com/ptlls)
- Types:
- `CreateUser` with properties `first_name`, `last_name`, `middle_name`?, `email`?, `title`?, `date_of_birth`,
`citizenship`, `country`, `state`?, `city`, `zip`, `street`, `building_number`?, `flat_number`, `itin`?, national_id?,
`ssn`?, `gender`, `user_token`
- `UpdateUser` with properties `first_name`, `last_name`, `middle_name`?, `email`?,`title`?, `date_of_birth`,
`citizenship`,`country`,`state`?,`city`,`zip`, `street`,`building_number`?,`flat_number`?,`itin`?,
`national_id`?, `ssn`?, `gender`,
- `UpdateEmail` with `email` property, for updating user email.
- `CreateUserResponse` with properties `userId`, `userToken`
- `SupportedCountriesResponse` with properties `alpha2`, `alpha3`, `countryCallingCodes`, `currencies`
`emoji`, `ioc`, `languages`, `name` and `status`
- `KYCStatusResponse` with properties `status` and `reasons`
### Updated
- Updated methods:
- `getInterestRates` return type changed to `Promise<InterestRates[]>` . Kudos to [@barathvk](https://github.com/barathvk)
- `getTransactionSummary`, pagination options parameter changed from `PaginationOptions` to `CelsiusPaginationOptions`. Kudos to [@crypto-diplodocus](https://github.com/crypto-diplodocus) and [@rbayliss](https://github.com/rbayliss)
- `getCoinTransactions`, pagination options changed from `PaginationOptions` to `CelsiusPaginationOptions`. Kudos to [@crypto-diplodocus](https://github.com/crypto-diplodocus) and [@rbayliss](https://github.com/rbayliss)
- Updated types:
- added `coin` property to `CelsiusWithdrawOptions`
- Updated dependencies:
- Bump `nokogiri` from 1.10.8 to 1.12.5
- Bump `path-parse` from 1.0.6 to 1.0.7
- Bump `addressable` from 2.5.2 to 2.8.0
- Bump `hosted-git-info` from 2.7.1 to 2.8.9
- Bump `lodash` from 4.17.19 to 4.17.21
- Bump `axios` from 0.18.1 to 0.21.1
### Deleted:
- Deleted methods:
- ```CelsiusInstance.createUser```
- ```CelsiusInstance.getUsers```
- ```CelsiusInstance.changeMetadata```
- ```CelsiusInstance.changeWithdrawalAddress```
- Deleted types:
- `PaginationOptions`
- `UserWithdrawalAddress`
- `UserMetadataResponse`
- `UserCreateResponse`
- `UsersResponse`
- `WithdrawalAddress`
- `InstitutionalUser`

## [0.10.15] - 2020-12-23
- Adding a new property `amount_precise` to the `CelsiusTransactionRecord` type. It provides the exact transaction amount, without any rounding applied.
- Fixing typos in jsdoc. Kudos to [@saginadir](https://github.com/saginadir) who noticed the typo and contributed code that fixes it!
Expand Down
72 changes: 48 additions & 24 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,43 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.11.1)
colorator (1.1.0)
commonmarker (0.17.13)
ruby-enum (~> 0.5)
concurrent-ruby (1.1.4)
dnsruby (1.61.2)
addressable (~> 2.5)
em-websocket (0.5.1)
concurrent-ruby (1.1.9)
dnsruby (1.61.7)
simpleidn (~> 0.1)
em-websocket (0.5.2)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
ethon (0.11.0)
ffi (>= 1.3.0)
ethon (0.14.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
execjs (2.7.0)
faraday (0.15.4)
faraday (1.5.1)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
faraday-patron (~> 1.0)
multipart-post (>= 1.2, < 3)
ffi (1.9.25)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
ffi (1.15.3)
forwardable-extended (2.6.0)
gemoji (3.0.0)
github-pages (193)
Expand Down Expand Up @@ -185,7 +200,7 @@ GEM
jekyll-seo-tag (~> 2.0)
jekyll-titles-from-headings (0.5.1)
jekyll (~> 3.3)
jekyll-watch (2.1.2)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.10.1)
gemoji (~> 3.0)
Expand All @@ -198,44 +213,53 @@ GEM
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
mercenary (0.3.6)
mini_portile2 (2.4.0)
mini_portile2 (2.6.1)
minima (2.5.0)
jekyll (~> 3.5)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.11.3)
multipart-post (2.0.0)
nokogiri (1.10.8)
mini_portile2 (~> 2.4.0)
octokit (4.13.0)
multipart-post (2.1.1)
nokogiri (1.12.5)
mini_portile2 (~> 2.6.1)
racc (~> 1.4)
octokit (4.21.0)
sawyer (~> 0.8.0, >= 0.5.3)
faraday (>= 0.9)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (2.0.5)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
racc (1.5.2)
ffi (~> 1.0)
rouge (2.2.1)
ruby-enum (0.7.2)
i18n
ruby2_keywords (0.0.4)
ruby_dep (1.5.0)
rubyzip (2.0.0)
safe_yaml (1.0.4)
sass (3.7.2)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
simpleidn (0.2.1)
unf (~> 0.1.4)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
typhoeus (1.3.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.4.0)

PLATFORMS
Expand Down
138 changes: 79 additions & 59 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,28 @@ declare module 'celsius-sdk' {
amount_in_usd: string;
}

interface SupportedCountriesResponse {
alpha2: string;
alpha3: string;
countryCallingCodes: string[];
currencies: string[];
emoji: string;
ioc: string;
languages: string[];
name: string;
status: string;
}

interface KYCStatusResponse {
status: string,
reasons: object
}


/**
* Celsius Withdraw Options
*/
interface CelsiusWithdrawOptions {
/** The coin you wish to withdraw */
coin: string;
/** This is the withdrawal amount you want */
amount: number;
/** This is destination address that you want the tokens to be deposited */
Expand Down Expand Up @@ -187,15 +203,6 @@ declare module 'celsius-sdk' {
document_back_image: string;
}

interface PaginationOptions {
page?: number;
limit?: number;
email?: string;
name?: string;
orderBy?: string;
direction?: string;
}

interface User {
id: string;
auth0_user_id: string;
Expand Down Expand Up @@ -233,47 +240,56 @@ declare module 'celsius-sdk' {
kyc_status: KycStatus;
}

interface UserMetadataResponse {
message: 'User`s metadata has been updated';
}

interface UserCreateResponse {
message: 'User has been created';
}

interface UserWithdrawalAddress {
user_id: string;
coin: string;
bitgo_wallet_id: string;
address: string;
manually_set: boolean;
created_at: string;
updated_at: string;
version: number;
}

interface UsersResponse {
users: {
total: number,
results: User[]
}
}

interface WithdrawalAddress {
short: string,
address: string
}

interface InstitutionalUser {
companyName: string;
email: string;
country: string;
state?: string;
taxNumber?: string;
contactPerson: string;
contactEmail: string;
note?: string;
withdrawalWallets: WithdrawalAddress[];
interface CreateUser {
first_name: string,
last_name: string,
middle_name?: string,
email?: string,
title?: string,
date_of_birth: Date,
citizenship: string,
country: string,
state?: string,
city: string,
zip: string,
street: string,
building_number?: string,
flat_number?: string,
itin?: string,
national_id?: string,
ssn?: string,
gender: string,
user_token: string
}

interface UpdateUser {
first_name: string,
last_name: string,
middle_name?: string,
email?: string,
title?: string,
date_of_birth: Date,
citizenship: string,
country: string,
state?: string,
city: string,
zip: string,
street: string,
building_number?: string,
flat_number?: string,
itin?: string,
national_id?: string,
ssn?: string,
gender: string,
}

interface UpdateEmail{
email: string
}

interface CreateUserResponse {
userId: string,
userToken: string
}

interface CelsiusInstance {
Expand All @@ -284,19 +300,23 @@ declare module 'celsius-sdk' {
getBalanceSummary(userSecret: string): Promise<CelsiusBalanceSummaryResponse>;
getCoinBalance(coin: string, userSecret: string): Promise<CelsiusCoinBalanceResponse>;
getInterestSummary(userSecret: string): Promise<CelsiusInterestSummaryResponse>;
getTransactionSummary(pagination: CelsiusPagination, userSecret: string): Promise<CelsiusTransactionSummary>;
getCoinTransactions(coin: string, pagination: CelsiusPagination, userSecret: string): Promise<CelsiusTransactionSummary>;
getTransactionSummary(pagination: CelsiusPaginationOptions, userSecret: string): Promise<CelsiusTransactionSummary>;
getCoinTransactions(coin: string, pagination: CelsiusPaginationOptions, userSecret: string): Promise<CelsiusTransactionSummary>;
getDeposit(coin: string, userSecret: string): Promise<{address: string}>;
withdraw(coin: string, formFields: CelsiusWithdrawOptions, userSecret: string): Promise<{transaction_id: string}>;
getWithdrawalAddressForCoin(coin: string, userSecret: string): Promise<{address: string}>
getWithdrawalAddresses(userSecret: string): Promise<CelsiusWithdrawalAddresses>
getTransactionStatus(transaction: string, userSecret: string): Promise<CelsiusWithdrawalTransaction>;
getUsers(pagination: PaginationOptions, userSecret: string): Promise<UsersResponse>;
changeMetadata(id: string, data: object, userSecret: string): Promise<UserMetadataResponse>;
changeWithdrawalAddress(id: string, data: WithdrawalAddress, userSecret: string): Promise<UserWithdrawalAddress>;
createUser(user: InstitutionalUser, userSecret: string): Promise<UserCreateResponse>
getInterestRates(): Promise<InterestRates>
getInterestRates(): Promise<InterestRates[]>
getStatistics(userSecret: string, timestamp?: string): Promise<CelsiusStatisticsResponse>
confirmTermsOfUse(termsOfUseId: string, confirmationDate: Date, userSecret: string): Promise<{success: boolean}>
health(message: string): Promise<{originalMessage: string}>
getSupportedCountries(userSecret:string): Promise<SupportedCountriesResponse[]>
getKycVerificationStatus(userId:string, userSecret:string):Promise<KYCStatusResponse>
startKycVerification(userId:string, documentType: string, userDocuments: CelsiusKycFiles, userSecret: string):Promise<{message: string}>
createUser(user: CreateUser): Promise<CreateUserResponse>
updateUser(userId:string, user:UpdateUser, userSecret: string):Promise<{status:boolean}>
updateUserEmail(email:UpdateEmail, userSecret:string):Promise<{status:boolean}>
}

interface InterestRates {
Expand Down
Loading

0 comments on commit 57b88f6

Please sign in to comment.