Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add-referral-create-user #98

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ client
| `getExchangeOrders` | <ul><li>**opts.userId**: The identifier of the user</li><li>**opts.side**: The order side (buy or side)</li><li>**opts.status**: The order's status e.g open, filled, canceled etc</li><li>**opts.open**: The info on whether the order is active or not </li><li>**opts.side**: The order side (buy or side)</li><li>**opts.limit**: Amount of orders per page. Maximum: 50. Default: 50</li><li>**opts.page**: Page of order data. Default: 1</li><li>**opts.symbol**: The symbol-pair to filter by, pass undefined to receive data on all currencies</li><li>**opts.orderBy:** The field to order data by e.g. amount, id.</li><li>**opts.order:** Ascending (asc) or descending (desc).</li><li>**opts.startDate:** Start date of query in ISO8601 format.</li><li>**opts.endDate:** End date of query in ISO8601 format.</li></ul> | Retrieve user's orders by admin |
| `cancelExchangeUserOrder` | <ul><li>**userId**: The identifier of the user</li><li>**orderId**: The identifier of the order</li></ul> | Cancel user's order by order id |
| `getExchangeUsers` | <ul><li>**opts**: Optional parameters</li><li>**opts.userId**: The identifier of the user to filter by</li><li>**opts.search**: The search text to filter by, pass undefined to receive data on all fields</li><li>**opts.pending**: The pending field to filter by, pass undefined to receive all data</li><li>**opts.pendingType**: Th pending type info to filter by, pass undefined to receive data</li><li>**opts.limit**: Amount of users per page. Maximum: 50. Default: 50</li><li>**opts.page**: Page of user data. Default: 1</li><li>**opts.orderBy**: The field to order data by e.g. amount, id.</li><li>**opts.order**: Ascending (asc) or descending (desc).</li><li>**opts.startDate**: Start date of query in ISO8601 format.</li><li>**opts.endDate**: End date of query in ISO8601 format.</li><li>**opts.format**: Custom format of data set. Enum: ['all', 'csv']</li></ul> | Retrieve list of the user info by admin |
| `createExchangeUser` | <ul><li>**email**: The mail address for the user</li<li>**password**: The password for the user</li></ul> | Create exchange user |
| `createExchangeUser` | <ul><li>**email**: The mail address for the user</li><li>**password**: The password for the user</li><li>**opts.referral**: The referral code for the user</li></ul> | Create exchange user |
| `updateExchangeUser` | <ul><li>**userId**: The identifier of the user to filter by</li><li>**opts.meta**: The field to update user meta info</li><li>**opts.overwrite**: the field to set overwrite option along with meta object</li><li>**opts.role**: The field to update user role ('admin', 'supervisor', 'support', 'kyc', 'communicator', 'user')</li><li>**opts.note**: The field to update user note </li><li>**opts.verification_level**: The field to set user's verification level</li></ul> | Update exchange user |
| `createExchangeUserWallet` | <ul><li>**userId**: The identifier of the user</li><li>**crypto**: The coin for the wallet e.g btc, eth</li><li>**opts.network**: The network info </li></ul> | Create wallet for exchange user |
| `getExchangeUserWallet` | <ul><li>**opts.userId**: The identifier of the user to filter by</li><li>**opts.limit**: Amount of users per page. Maximum: 50. Default: 50</li><li>**opts.currency**: The currency to filter by</li><li>**opts.page**: Page of user data. Default: 1</li><li>**opts.orderBy**: The field to order data by e.g. amount, id.</li><li>**opts.order**: Ascending (asc) or descending (desc).</li><li>**opts.startDate**: Start date of query in ISO8601 format.</li><li>**opts.endDate**: End date of query in ISO8601 format.</li><li>**opts.address**: Address of crypto</li><li>**opts.isValid**: Specify whether or not wallet is valid</li><li>**opts.network**: Crypto network of currency</li><li>**opts.format**: Custom format of data set. Enum: ['all', 'csv']</li></ul> | Retrieve users' wallets by admin |
Expand Down
10 changes: 9 additions & 1 deletion kit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1828,15 +1828,23 @@ class HollaExKit {
* Create exchange user
* @param {string} email - The mail address for the user
* @param {string} password - The password for the user
* @param {string} opts.referral - The referral code for the user
* @return {object} A JSON object with message
*/
createExchangeUser(email, password) {
createExchangeUser(email, password, opts = {
referral: null
}) {
const verb = 'POST';
let path = `${this.baseUrl}/admin/user`;
const data = {
email,
password
};


if (isString(opts.referral)) {
data.referral = opts.referral;
};

const headers = generateHeaders(
this.headers,
Expand Down